mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
UI: CURD labels
- fix update lable break connection with repository
This commit is contained in:
9
public/css/bootstrap-colorpicker.min.css
vendored
9
public/css/bootstrap-colorpicker.min.css
vendored
@@ -1,9 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap Colorpicker
|
||||
* http://mjolnic.github.io/bootstrap-colorpicker/
|
||||
*
|
||||
* Originally written by (c) 2012 Stefan Petre
|
||||
* Licensed under the Apache License v2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
*
|
||||
*/.colorpicker-saturation{float:left;width:100px;height:100px;cursor:crosshair;background-image:url("../img/bootstrap-colorpicker/saturation.png")}.colorpicker-saturation i{position:absolute;top:0;left:0;display:block;width:5px;height:5px;margin:-4px 0 0 -4px;border:1px solid #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-saturation i b{display:block;width:5px;height:5px;border:1px solid #fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-hue,.colorpicker-alpha{float:left;width:15px;height:100px;margin-bottom:4px;margin-left:4px;cursor:row-resize}.colorpicker-hue i,.colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:100%;height:1px;margin-top:-1px;background:#000;border-top:1px solid #fff}.colorpicker-hue{background-image:url("../img/bootstrap-colorpicker/hue.png")}.colorpicker-alpha{display:none;background-image:url("../img/bootstrap-colorpicker/alpha.png")}.colorpicker{top:0;left:0;z-index:2500;min-width:130px;padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1}.colorpicker:before,.colorpicker:after{display:table;line-height:0;content:""}.colorpicker:after{clear:both}.colorpicker:before{position:absolute;top:-7px;left:6px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.colorpicker:after{position:absolute;top:-6px;left:7px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.colorpicker div{position:relative}.colorpicker.colorpicker-with-alpha{min-width:140px}.colorpicker.colorpicker-with-alpha .colorpicker-alpha{display:block}.colorpicker-color{height:10px;margin-top:5px;clear:both;background-image:url("../img/bootstrap-colorpicker/alpha.png");background-position:0 100%}.colorpicker-color div{height:10px}.colorpicker-element .input-group-addon i,.colorpicker-element .add-on i{display:inline-block;width:16px;height:16px;vertical-align:text-top;cursor:pointer}.colorpicker.colorpicker-inline{position:relative;z-index:auto;display:inline-block;float:none}.colorpicker.colorpicker-horizontal{width:110px;height:auto;min-width:110px}.colorpicker.colorpicker-horizontal .colorpicker-saturation{margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-color{width:100px}.colorpicker.colorpicker-horizontal .colorpicker-hue,.colorpicker.colorpicker-horizontal .colorpicker-alpha{float:left;width:100px;height:15px;margin-bottom:4px;margin-left:0;cursor:col-resize}.colorpicker.colorpicker-horizontal .colorpicker-hue i,.colorpicker.colorpicker-horizontal .colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:1px;height:15px;margin-top:0;background:#fff;border:0}.colorpicker.colorpicker-horizontal .colorpicker-hue{background-image:url("../img/bootstrap-colorpicker/hue-horizontal.png")}.colorpicker.colorpicker-horizontal .colorpicker-alpha{background-image:url("../img/bootstrap-colorpicker/alpha-horizontal.png")}.colorpicker.colorpicker-hidden{display:none}.colorpicker.colorpicker-visible{display:block}.colorpicker-inline.colorpicker-visible{display:inline-block}
|
2
public/css/gogs.min.css
vendored
2
public/css/gogs.min.css
vendored
File diff suppressed because one or more lines are too long
1
public/js/bootstrap-colorpicker.min.js
vendored
1
public/js/bootstrap-colorpicker.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,3 +1,5 @@
|
||||
var csrf;
|
||||
|
||||
function initInstall() {
|
||||
if ($('.install').length == 0) {
|
||||
return;
|
||||
@@ -32,25 +34,55 @@ function initInstall() {
|
||||
});
|
||||
};
|
||||
|
||||
function initRepository(){
|
||||
function initRepository() {
|
||||
if ($('.repository').length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($('.labels').length == 0) {
|
||||
// Labels
|
||||
if ($('.repository.labels').length == 0) {
|
||||
return;
|
||||
}
|
||||
$('.color-picker').each( function() {
|
||||
$('.color-picker').each(function () {
|
||||
$(this).minicolors();
|
||||
});
|
||||
$('.precolors .color').click(function(){
|
||||
$('.precolors .color').click(function () {
|
||||
var color_hex = $(this).data('color-hex')
|
||||
$('.color-picker').val(color_hex);
|
||||
$('.minicolors-swatch-color').css("background-color", color_hex);
|
||||
});
|
||||
$('.delete-label-button').click(function () {
|
||||
var $this = $(this);
|
||||
$('.delete-label.modal').modal({
|
||||
closable: false,
|
||||
onApprove: function () {
|
||||
$.post($this.data('url'), {
|
||||
"_csrf": csrf,
|
||||
"id": $this.data("id")
|
||||
}).done(function (data) {
|
||||
window.location.href = data.redirect;
|
||||
});
|
||||
}
|
||||
}).modal('show');
|
||||
return false;
|
||||
});
|
||||
$('.edit-label-button').click(function () {
|
||||
$('#label-modal-id').val($(this).data('id'));
|
||||
$('#label-modal-title').val($(this).data('title'));
|
||||
$('#label-modal-color').val($(this).data('color'))
|
||||
$('.minicolors-swatch-color').css("background-color", $(this).data('color'));
|
||||
$('.edit-label.modal').modal({
|
||||
onApprove: function () {
|
||||
$('.edit-label.form').submit();
|
||||
}
|
||||
}).modal('show');
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
csrf = $('meta[name=_csrf]').attr("content");
|
||||
|
||||
// Semantic UI modules.
|
||||
$('.dropdown').dropdown();
|
||||
$('.jump.dropdown').dropdown({
|
||||
|
@@ -137,4 +137,32 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edit-label.modal {
|
||||
.color-picker {
|
||||
margin-top: -8px!important;
|
||||
height: 35px;
|
||||
width: auto!important;
|
||||
padding-left: 30px!important;
|
||||
}
|
||||
.minicolors-swatch.minicolors-sprite {
|
||||
top: 1px;
|
||||
left: 10px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
.precolors {
|
||||
margin-bottom: -11px!important;
|
||||
padding-left: 0!important;
|
||||
padding-right: 0!important;
|
||||
margin-right: 10px!important;
|
||||
width: 120px!important;
|
||||
.color {
|
||||
float: left;
|
||||
margin: 0!important;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user