diff --git a/public/src/admin/manage/category.js b/public/src/admin/manage/category.js index 8bec2edc21..51f3f8b0e6 100644 --- a/public/src/admin/manage/category.js +++ b/public/src/admin/manage/category.js @@ -3,11 +3,10 @@ define('admin/manage/category', [ 'uploader', 'iconSelect', - 'admin/modules/colorpicker', 'categorySelector', 'benchpress', 'api', -], function (uploader, iconSelect, colorpicker, categorySelector, Benchpress, api) { +], function (uploader, iconSelect, categorySelector, Benchpress, api) { var Category = {}; var updateHash = {}; @@ -21,21 +20,6 @@ define('admin/manage/category', [ ajaxify.go('admin/manage/categories/' + selectedCategory.cid); }); - function enableColorPicker(idx, inputEl) { - var $inputEl = $(inputEl); - var previewEl = $inputEl.parents('[data-cid]').find('.category-preview'); - - colorpicker.enable($inputEl, function (hsb, hex) { - if ($inputEl.attr('data-name') === 'bgColor') { - previewEl.css('background-color', '#' + hex); - } else if ($inputEl.attr('data-name') === 'color') { - previewEl.css('color', '#' + hex); - } - - modified($inputEl[0]); - }); - } - handleTags(); $('#category-settings input, #category-settings select').on('change', function (ev) { @@ -46,7 +30,17 @@ define('admin/manage/category', [ $('.category-preview').css('background-size', $(this).val()); }); - $('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker); + $('[data-name="bgColor"], [data-name="color"]').on('input', function () { + var $inputEl = $(this); + var previewEl = $inputEl.parents('[data-cid]').find('.category-preview'); + if ($inputEl.attr('data-name') === 'bgColor') { + previewEl.css('background-color', $inputEl.val()); + } else if ($inputEl.attr('data-name') === 'color') { + previewEl.css('color', $inputEl.val()); + } + + modified($inputEl[0]); + }); $('#save').on('click', function () { var tags = $('#tag-whitelist').val() ? $('#tag-whitelist').val().split(',') : []; diff --git a/public/src/admin/manage/group.js b/public/src/admin/manage/group.js index b161732b21..1cf6cd1935 100644 --- a/public/src/admin/manage/group.js +++ b/public/src/admin/manage/group.js @@ -3,12 +3,11 @@ define('admin/manage/group', [ 'forum/groups/memberlist', 'iconSelect', - 'admin/modules/colorpicker', 'translator', 'categorySelector', 'groupSearch', 'api', -], function (memberList, iconSelect, colorpicker, translator, categorySelector, groupSearch, api) { +], function (memberList, iconSelect, translator, categorySelector, groupSearch, api) { var Groups = {}; Groups.init = function () { @@ -27,15 +26,15 @@ define('admin/manage/group', [ memberList.init('admin/manage/group'); - changeGroupUserTitle.keyup(function () { + changeGroupUserTitle.on('keyup', function () { groupLabelPreviewText.text(changeGroupUserTitle.val()); }); - changeGroupLabelColor.keyup(function () { - groupLabelPreview.css('background', changeGroupLabelColor.val() || '#000000'); + changeGroupLabelColor.on('keyup input', function () { + groupLabelPreview.css('background-color', changeGroupLabelColor.val() || '#000000'); }); - changeGroupTextColor.keyup(function () { + changeGroupTextColor.on('keyup input', function () { groupLabelPreview.css('color', changeGroupTextColor.val() || '#ffffff'); }); @@ -63,14 +62,6 @@ define('admin/manage/group', [ groupSearch.init($('[component="group-selector"]')); - colorpicker.enable(changeGroupLabelColor, function (hsb, hex) { - groupLabelPreview.css('background-color', '#' + hex); - }); - - colorpicker.enable(changeGroupTextColor, function (hsb, hex) { - groupLabelPreview.css('color', '#' + hex); - }); - $('form [data-property]').on('change', function () { app.flags = app.flags || {}; app.flags._unsaved = true; diff --git a/public/src/admin/manage/tags.js b/public/src/admin/manage/tags.js index 7fc70b7cce..699d2ddffa 100644 --- a/public/src/admin/manage/tags.js +++ b/public/src/admin/manage/tags.js @@ -4,8 +4,7 @@ define('admin/manage/tags', [ 'forum/infinitescroll', 'admin/modules/selectable', - 'admin/modules/colorpicker', -], function (infinitescroll, selectable, colorpicker) { +], function (infinitescroll, selectable) { var Tags = {}; var timeoutId = 0; @@ -91,7 +90,7 @@ define('admin/manage/tags', [ } var firstTag = $(tagsToModify[0]); - var modal = bootbox.dialog({ + bootbox.dialog({ title: '[[admin/manage/tags:alerts.editing]]', message: firstTag.find('.tag-modal').html(), buttons: { @@ -100,15 +99,17 @@ define('admin/manage/tags', [ className: 'btn-primary save', callback: function () { var modal = $('.bootbox'); - var bgColor = modal.find('[data-name="bgColor"]').val(); - var color = modal.find('[data-name="color"]').val(); + var resetColors = modal.find('#reset-colors').is(':checked'); + var bgColor = resetColors ? '' : modal.find('[data-name="bgColor"]').val(); + var color = resetColors ? '' : modal.find('[data-name="color"]').val(); + var data = []; tagsToModify.each(function (idx, tag) { tag = $(tag); data.push({ value: tag.attr('data-tag'), - color: modal.find('[data-name="color"]').val(), - bgColor: modal.find('[data-name="bgColor"]').val(), + color: color, + bgColor: bgColor, }); tag.find('[data-name="bgColor"]').val(bgColor); @@ -126,8 +127,6 @@ define('admin/manage/tags', [ }, }, }); - - handleColorPickers(modal); }); } @@ -195,14 +194,5 @@ define('admin/manage/tags', [ }); } - function handleColorPickers(modal) { - function enableColorPicker(idx, inputEl) { - var $inputEl = $(inputEl); - colorpicker.enable($inputEl); - } - - modal.find('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker); - } - return Tags; }); diff --git a/public/src/client/groups/details.js b/public/src/client/groups/details.js index 4498aa40ed..d06554bde8 100644 --- a/public/src/client/groups/details.js +++ b/public/src/client/groups/details.js @@ -8,7 +8,6 @@ define('forum/groups/details', [ 'pictureCropper', 'translator', 'api', - 'vendor/colorpicker/colorpicker', ], function (memberList, iconSelect, components, coverPhoto, pictureCropper, translator, api) { var Details = {}; var groupName; @@ -138,8 +137,6 @@ define('forum/groups/details', [ Details.prepareSettings = function () { var settingsFormEl = components.get('groups/settings'); - var labelColorBtn = settingsFormEl.find('[data-action="label-color-select"]'); - var textColorBtn = settingsFormEl.find('[data-action="text-color-select"]'); var labelColorValueEl = settingsFormEl.find('[name="labelColor"]'); var textColorValueEl = settingsFormEl.find('[name="textColor"]'); var iconBtn = settingsFormEl.find('[data-action="icon-select"]'); @@ -149,27 +146,12 @@ define('forum/groups/details', [ var userTitleEnabledEl = settingsFormEl.find('[name="userTitleEnabled"]'); var iconValueEl = settingsFormEl.find('[name="icon"]'); - // Add color picker to settings form - labelColorBtn.ColorPicker({ - color: labelColorValueEl.val() || '#000', - onChange: function (hsb, hex) { - labelColorValueEl.val('#' + hex); - previewEl.css('background-color', '#' + hex); - }, - onShow: function (colpkr) { - $(colpkr).css('z-index', 1051); - }, + labelColorValueEl.on('input', function () { + previewEl.css('background-color', labelColorValueEl.val()); }); - textColorBtn.ColorPicker({ - color: textColorValueEl.val() || '#fff', - onChange: function (hsb, hex) { - textColorValueEl.val('#' + hex); - previewEl.css('color', '#' + hex); - }, - onShow: function (colpkr) { - $(colpkr).css('z-index', 1051); - }, + textColorValueEl.on('input', function () { + previewEl.css('color', textColorValueEl.val()); }); // Add icon selection interface diff --git a/public/vendor/colorpicker/colorpicker.css b/public/vendor/colorpicker/colorpicker.css deleted file mode 100644 index 6f8ed782b9..0000000000 --- a/public/vendor/colorpicker/colorpicker.css +++ /dev/null @@ -1,161 +0,0 @@ -.colorpicker { - width: 356px; - height: 176px; - overflow: hidden; - position: absolute; - background: url(./vendor/colorpicker/images/custom_background.png); - font-family: Arial, Helvetica, sans-serif; - display: none; -} -.colorpicker_color { - width: 150px; - height: 150px; - left: 14px; - top: 13px; - position: absolute; - background: #f00; - overflow: hidden; - cursor: crosshair; -} -.colorpicker_color div { - position: absolute; - top: 0; - left: 0; - width: 150px; - height: 150px; - background: url(./vendor/colorpicker/images/colorpicker_overlay.png); -} -.colorpicker_color div div { - position: absolute; - top: 0; - left: 0; - width: 11px; - height: 11px; - overflow: hidden; - background: url(./vendor/colorpicker/images/colorpicker_select.gif); - margin: -5px 0 0 -5px; -} -.colorpicker_hue { - position: absolute; - top: 13px; - left: 171px; - width: 35px; - height: 150px; - cursor: n-resize; -} -.colorpicker_hue div { - position: absolute; - width: 35px; - height: 9px; - overflow: hidden; - background: url(./vendor/colorpicker/images/custom_indic.gif) left top; - margin: -4px 0 0 0; - left: 0px; -} -.colorpicker_new_color { - position: absolute; - width: 60px; - height: 30px; - left: 213px; - top: 13px; - background: #f00; -} -.colorpicker_current_color { - position: absolute; - width: 60px; - height: 30px; - left: 283px; - top: 13px; - background: #f00; -} -.colorpicker input { - background-color: transparent; - border: 1px solid transparent; - position: absolute; - font-size: 10px; - font-family: Arial, Helvetica, sans-serif; - color: #898989; - top: 4px; - right: 11px; - text-align: right; - margin: 0; - padding: 0; - height: 11px; -} -.colorpicker_hex { - position: absolute; - width: 72px; - height: 22px; - background: url(./vendor/colorpicker/images/custom_hex.png) top; - left: 212px; - top: 142px; -} -.colorpicker_hex input { - right: 6px; -} -.colorpicker_field { - height: 22px; - width: 62px; - background-position: top; - position: absolute; -} -.colorpicker_field span { - position: absolute; - width: 12px; - height: 22px; - overflow: hidden; - top: 0; - right: 0; - cursor: n-resize; -} -.colorpicker_rgb_r { - background-image: url(./vendor/colorpicker/images/custom_rgb_r.png); - top: 52px; - left: 212px; -} -.colorpicker_rgb_g { - background-image: url(./vendor/colorpicker/images/custom_rgb_g.png); - top: 82px; - left: 212px; -} -.colorpicker_rgb_b { - background-image: url(./vendor/colorpicker/images/custom_rgb_b.png); - top: 112px; - left: 212px; -} -.colorpicker_hsb_h { - background-image: url(./vendor/colorpicker/images/custom_hsb_h.png); - top: 52px; - left: 282px; -} -.colorpicker_hsb_s { - background-image: url(./vendor/colorpicker/images/custom_hsb_s.png); - top: 82px; - left: 282px; -} -.colorpicker_hsb_b { - background-image: url(./vendor/colorpicker/images/custom_hsb_b.png); - top: 112px; - left: 282px; -} -.colorpicker_submit { - position: absolute; - width: 22px; - height: 22px; - background: url(./vendor/colorpicker/images/custom_submit.png) top; - left: 322px; - top: 142px; - overflow: hidden; -} -.colorpicker_focus { - background-position: center; -} -.colorpicker_hex.colorpicker_focus { - background-position: bottom; -} -.colorpicker_submit.colorpicker_focus { - background-position: bottom; -} -.colorpicker_slider { - background-position: bottom; -} \ No newline at end of file diff --git a/public/vendor/colorpicker/colorpicker.js b/public/vendor/colorpicker/colorpicker.js deleted file mode 100644 index 217d0c60b6..0000000000 --- a/public/vendor/colorpicker/colorpicker.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * - * Color picker - * Author: Stefan Petre www.eyecon.ro - * - * Dual licensed under the MIT and GPL licenses - * - */ -(function(e){var t=function(){var t={},n,r=65,i,s='
',o={eventName:"click",onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(){},onSubmit:function(){},color:"ff0000",livePreview:true,flat:false},u=function(t,n){var r=q(t);e(n).data("colorpicker").fields.eq(1).val(r.r).end().eq(2).val(r.g).end().eq(3).val(r.b).end()},a=function(t,n){e(n).data("colorpicker").fields.eq(4).val(t.h).end().eq(5).val(t.s).end().eq(6).val(t.b).end()},f=function(t,n){e(n).data("colorpicker").fields.eq(0).val(U(t)).end()},l=function(t,n){e(n).data("colorpicker").selector.css("backgroundColor","#"+U({h:t.h,s:100,b:100}));e(n).data("colorpicker").selectorIndic.css({left:parseInt(150*t.s/100,10),top:parseInt(150*(100-t.b)/100,10)})},c=function(t,n){e(n).data("colorpicker").hue.css("top",parseInt(150-150*t.h/360,10))},h=function(t,n){e(n).data("colorpicker").currentColor.css("backgroundColor","#"+U(t))},p=function(t,n){e(n).data("colorpicker").newColor.css("backgroundColor","#"+U(t))},d=function(t){var n=t.charCode||t.keyCode||-1;if(n>r&&n<=90||n==32){return false}var i=e(this).parent().parent();if(i.data("colorpicker").livePreview===true){v.apply(this)}},v=function(t){var n=e(this).parent().parent(),r;if(this.parentNode.className.indexOf("_hex")>0){n.data("colorpicker").color=r=F(B(this.value))}else if(this.parentNode.className.indexOf("_hsb")>0){n.data("colorpicker").color=r=P({h:parseInt(n.data("colorpicker").fields.eq(4).val(),10),s:parseInt(n.data("colorpicker").fields.eq(5).val(),10),b:parseInt(n.data("colorpicker").fields.eq(6).val(),10)})}else{n.data("colorpicker").color=r=I(H({r:parseInt(n.data("colorpicker").fields.eq(1).val(),10),g:parseInt(n.data("colorpicker").fields.eq(2).val(),10),b:parseInt(n.data("colorpicker").fields.eq(3).val(),10)}))}if(t){u(r,n.get(0));f(r,n.get(0));a(r,n.get(0))}l(r,n.get(0));c(r,n.get(0));p(r,n.get(0));n.data("colorpicker").onChange.apply(n,[r,U(r),q(r)])},m=function(t){var n=e(this).parent().parent();n.data("colorpicker").fields.parent().removeClass("colorpicker_focus")},g=function(){r=this.parentNode.className.indexOf("_hex")>0?70:65;e(this).parent().parent().data("colorpicker").fields.parent().removeClass("colorpicker_focus");e(this).parent().addClass("colorpicker_focus")},y=function(t){var n=e(this).parent().find("input").focus();var r={el:e(this).parent().addClass("colorpicker_slider"),max:this.parentNode.className.indexOf("_hsb_h")>0?360:this.parentNode.className.indexOf("_hsb")>0?100:255,y:t.pageY,field:n,val:parseInt(n.val(),10),preview:e(this).parent().parent().data("colorpicker").livePreview};e(document).bind("mouseup",r,w);e(document).bind("mousemove",r,b)},b=function(e){e.data.field.val(Math.max(0,Math.min(e.data.max,parseInt(e.data.val+e.pageY-e.data.y,10))));if(e.data.preview){v.apply(e.data.field.get(0),[true])}return false},w=function(t){v.apply(t.data.field.get(0),[true]);t.data.el.removeClass("colorpicker_slider").find("input").focus();e(document).unbind("mouseup",w);e(document).unbind("mousemove",b);return false},E=function(t){var n={cal:e(this).parent(),y:e(this).offset().top};n.preview=n.cal.data("colorpicker").livePreview;e(document).bind("mouseup",n,x);e(document).bind("mousemove",n,S)},S=function(e){v.apply(e.data.cal.data("colorpicker").fields.eq(4).val(parseInt(360*(150-Math.max(0,Math.min(150,e.pageY-e.data.y)))/150,10)).get(0),[e.data.preview]);return false},x=function(t){u(t.data.cal.data("colorpicker").color,t.data.cal.get(0));f(t.data.cal.data("colorpicker").color,t.data.cal.get(0));e(document).unbind("mouseup",x);e(document).unbind("mousemove",S);return false},T=function(t){var n={cal:e(this).parent(),pos:e(this).offset()};n.preview=n.cal.data("colorpicker").livePreview;e(document).bind("mouseup",n,C);e(document).bind("mousemove",n,N)},N=function(e){v.apply(e.data.cal.data("colorpicker").fields.eq(6).val(parseInt(100*(150-Math.max(0,Math.min(150,e.pageY-e.data.pos.top)))/150,10)).end().eq(5).val(parseInt(100*Math.max(0,Math.min(150,e.pageX-e.data.pos.left))/150,10)).get(0),[e.data.preview]);return false},C=function(t){u(t.data.cal.data("colorpicker").color,t.data.cal.get(0));f(t.data.cal.data("colorpicker").color,t.data.cal.get(0));e(document).unbind("mouseup",C);e(document).unbind("mousemove",N);return false},k=function(t){e(this).addClass("colorpicker_focus")},L=function(t){e(this).removeClass("colorpicker_focus")},A=function(t){var n=e(this).parent();var r=n.data("colorpicker").color;n.data("colorpicker").origColor=r;h(r,n.get(0));n.data("colorpicker").onSubmit(r,U(r),q(r),n.data("colorpicker").el)},O=function(t){var n=e("#"+e(this).data("colorpickerId"));n.data("colorpicker").onBeforeShow.apply(this,[n.get(0)]);var r=e(this).offset();var i=D();var s=r.top+this.offsetHeight;var o=r.left;if(s+176>i.t+i.h){s-=this.offsetHeight+176}if(o+356>i.l+i.w){o-=356}n.css({left:o+"px",top:s+"px"});if(n.data("colorpicker").onShow.apply(this,[n.get(0)])!=false){n.show()}e(document).bind("mousedown",{cal:n},M);return false},M=function(t){if(!_(t.data.cal.get(0),t.target,t.data.cal.get(0))){if(t.data.cal.data("colorpicker").onHide.apply(this,[t.data.cal.get(0)])!=false){t.data.cal.hide()}e(document).unbind("mousedown",M)}},_=function(e,t,n){if(e==t){return true}if(e.contains){return e.contains(t)}if(e.compareDocumentPosition){return!!(e.compareDocumentPosition(t)&16)}var r=t.parentNode;while(r&&r!=n){if(r==e)return true;r=r.parentNode}return false},D=function(){var e=document.compatMode=="CSS1Compat";return{l:window.pageXOffset||(e?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(e?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(e?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(e?document.documentElement.clientHeight:document.body.clientHeight)}},P=function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},H=function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},B=function(e){var t=6-e.length;if(t>0){var n=[];for(var r=0;r-1?e.substring(1):e,16);return{r:e>>16,g:(e&65280)>>8,b:e&255}},F=function(e){return I(j(e))},I=function(e){var t={h:0,s:0,b:0};var n=Math.min(e.r,e.g,e.b);var r=Math.max(e.r,e.g,e.b);var i=r-n;t.b=r;if(r!=0){}t.s=r!=0?255*i/r:0;if(t.s!=0){if(e.r==r){t.h=(e.g-e.b)/i}else if(e.g==r){t.h=2+(e.b-e.r)/i}else{t.h=4+(e.r-e.g)/i}}else{t.h=-1}t.h*=60;if(t.h<0){t.h+=360}t.s*=100/255;t.b*=100/255;return t},q=function(e){var t={};var n=Math.round(e.h);var r=Math.round(e.s*255/100);var i=Math.round(e.b*255/100);if(r==0){t.r=t.g=t.b=i}else{var s=i;var o=(255-r)*i/255;var u=(s-o)*(n%60)/60;if(n==360)n=0;if(n<60){t.r=s;t.b=o;t.g=o+u}else if(n<120){t.g=s;t.b=o;t.r=s-u}else if(n<180){t.g=s;t.r=o;t.b=o+u}else if(n<240){t.b=s;t.r=o;t.g=s-u}else if(n<300){t.b=s;t.g=o;t.r=o+u}else if(n<360){t.r=s;t.g=o;t.b=s-u}else{t.r=0;t.g=0;t.b=0}}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},R=function(t){var n=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];e.each(n,function(e,t){if(t.length==1){n[e]="0"+t}});return n.join("")},U=function(e){return R(q(e))},z=function(){var t=e(this).parent();var n=t.data("colorpicker").origColor;t.data("colorpicker").color=n;u(n,t.get(0));f(n,t.get(0));a(n,t.get(0));l(n,t.get(0));c(n,t.get(0));p(n,t.get(0))};return{init:function(t){t=e.extend({},o,t||{});if(typeof t.color=="string"){t.color=F(t.color)}else if(t.color.r!=undefined&&t.color.g!=undefined&&t.color.b!=undefined){t.color=I(t.color)}else if(t.color.h!=undefined&&t.color.s!=undefined&&t.color.b!=undefined){t.color=P(t.color)}else{return this}return this.each(function(){if(!e(this).data("colorpickerId")){var n=e.extend({},t);n.origColor=t.color;var r="collorpicker_"+parseInt(Math.random()*1e3);e(this).data("colorpickerId",r);var i=e(s).attr("id",r);if(n.flat){i.appendTo(this).show()}else{i.appendTo(document.body)}n.fields=i.find("input").bind("keyup",d).bind("change",v).bind("blur",m).bind("focus",g);i.find("span").bind("mousedown",y).end().find(">div.colorpicker_current_color").bind("click",z);n.selector=i.find("div.colorpicker_color").bind("mousedown",T);n.selectorIndic=n.selector.find("div div");n.el=this;n.hue=i.find("div.colorpicker_hue div");i.find("div.colorpicker_hue").bind("mousedown",E);n.newColor=i.find("div.colorpicker_new_color");n.currentColor=i.find("div.colorpicker_current_color");i.data("colorpicker",n);i.find("div.colorpicker_submit").bind("mouseenter",k).bind("mouseleave",L).bind("click",A);u(n.color,i.get(0));a(n.color,i.get(0));f(n.color,i.get(0));c(n.color,i.get(0));l(n.color,i.get(0));h(n.color,i.get(0));p(n.color,i.get(0));if(n.flat){i.css({position:"relative",display:"block"})}else{e(this).bind(n.eventName,O)}}})},showPicker:function(){return this.each(function(){if(e(this).data("colorpickerId")){O.apply(this)}})},hidePicker:function(){return this.each(function(){if(e(this).data("colorpickerId")){e("#"+e(this).data("colorpickerId")).hide()}})},setColor:function(t){if(typeof t=="string"){t=F(t)}else if(t.r!=undefined&&t.g!=undefined&&t.b!=undefined){t=I(t)}else if(t.h!=undefined&&t.s!=undefined&&t.b!=undefined){t=P(t)}else{return this}return this.each(function(){if(e(this).data("colorpickerId")){var n=e("#"+e(this).data("colorpickerId"));n.data("colorpicker").color=t;n.data("colorpicker").origColor=t;u(t,n.get(0));a(t,n.get(0));f(t,n.get(0));c(t,n.get(0));l(t,n.get(0));h(t,n.get(0));p(t,n.get(0))}})}}}();e.fn.extend({ColorPicker:t.init,ColorPickerHide:t.hidePicker,ColorPickerShow:t.showPicker,ColorPickerSetColor:t.setColor})})(jQuery) \ No newline at end of file diff --git a/public/vendor/colorpicker/images/blank.gif b/public/vendor/colorpicker/images/blank.gif deleted file mode 100644 index 75b945d255..0000000000 Binary files a/public/vendor/colorpicker/images/blank.gif and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_background.png b/public/vendor/colorpicker/images/colorpicker_background.png deleted file mode 100644 index 8401572f19..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_background.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_hex.png b/public/vendor/colorpicker/images/colorpicker_hex.png deleted file mode 100644 index 4e532d7c65..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_hex.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_hsb_b.png b/public/vendor/colorpicker/images/colorpicker_hsb_b.png deleted file mode 100644 index dfac595d01..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_hsb_b.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_hsb_h.png b/public/vendor/colorpicker/images/colorpicker_hsb_h.png deleted file mode 100644 index 3977ed9f21..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_hsb_h.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_hsb_s.png b/public/vendor/colorpicker/images/colorpicker_hsb_s.png deleted file mode 100644 index a2a699736c..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_hsb_s.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_indic.gif b/public/vendor/colorpicker/images/colorpicker_indic.gif deleted file mode 100644 index f9fa95e282..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_indic.gif and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_overlay.png b/public/vendor/colorpicker/images/colorpicker_overlay.png deleted file mode 100644 index 561cdd9c59..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_overlay.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_rgb_b.png b/public/vendor/colorpicker/images/colorpicker_rgb_b.png deleted file mode 100644 index dfac595d01..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_rgb_b.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_rgb_g.png b/public/vendor/colorpicker/images/colorpicker_rgb_g.png deleted file mode 100644 index 72b32760a5..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_rgb_g.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_rgb_r.png b/public/vendor/colorpicker/images/colorpicker_rgb_r.png deleted file mode 100644 index 4855fe03f8..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_rgb_r.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_select.gif b/public/vendor/colorpicker/images/colorpicker_select.gif deleted file mode 100644 index 599f7f13a6..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_select.gif and /dev/null differ diff --git a/public/vendor/colorpicker/images/colorpicker_submit.png b/public/vendor/colorpicker/images/colorpicker_submit.png deleted file mode 100644 index 7f4c0825f5..0000000000 Binary files a/public/vendor/colorpicker/images/colorpicker_submit.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_background.png b/public/vendor/colorpicker/images/custom_background.png deleted file mode 100644 index cf55ffdd68..0000000000 Binary files a/public/vendor/colorpicker/images/custom_background.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_hex.png b/public/vendor/colorpicker/images/custom_hex.png deleted file mode 100644 index 888f444495..0000000000 Binary files a/public/vendor/colorpicker/images/custom_hex.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_hsb_b.png b/public/vendor/colorpicker/images/custom_hsb_b.png deleted file mode 100644 index 2f99dae8e6..0000000000 Binary files a/public/vendor/colorpicker/images/custom_hsb_b.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_hsb_h.png b/public/vendor/colorpicker/images/custom_hsb_h.png deleted file mode 100644 index a217e9218e..0000000000 Binary files a/public/vendor/colorpicker/images/custom_hsb_h.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_hsb_s.png b/public/vendor/colorpicker/images/custom_hsb_s.png deleted file mode 100644 index 7826b41507..0000000000 Binary files a/public/vendor/colorpicker/images/custom_hsb_s.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_indic.gif b/public/vendor/colorpicker/images/custom_indic.gif deleted file mode 100644 index 222fb94cfd..0000000000 Binary files a/public/vendor/colorpicker/images/custom_indic.gif and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_rgb_b.png b/public/vendor/colorpicker/images/custom_rgb_b.png deleted file mode 100644 index 80764e5d6d..0000000000 Binary files a/public/vendor/colorpicker/images/custom_rgb_b.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_rgb_g.png b/public/vendor/colorpicker/images/custom_rgb_g.png deleted file mode 100644 index fc9778be1e..0000000000 Binary files a/public/vendor/colorpicker/images/custom_rgb_g.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_rgb_r.png b/public/vendor/colorpicker/images/custom_rgb_r.png deleted file mode 100644 index 91b0cd4c52..0000000000 Binary files a/public/vendor/colorpicker/images/custom_rgb_r.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/custom_submit.png b/public/vendor/colorpicker/images/custom_submit.png deleted file mode 100644 index cd202cd93b..0000000000 Binary files a/public/vendor/colorpicker/images/custom_submit.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/select.png b/public/vendor/colorpicker/images/select.png deleted file mode 100644 index 21213bfd51..0000000000 Binary files a/public/vendor/colorpicker/images/select.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/select2.png b/public/vendor/colorpicker/images/select2.png deleted file mode 100644 index 2cd2cabeb6..0000000000 Binary files a/public/vendor/colorpicker/images/select2.png and /dev/null differ diff --git a/public/vendor/colorpicker/images/slider.png b/public/vendor/colorpicker/images/slider.png deleted file mode 100644 index 8b03da96eb..0000000000 Binary files a/public/vendor/colorpicker/images/slider.png and /dev/null differ diff --git a/src/categories/create.js b/src/categories/create.js index b724ef031b..81edf33765 100644 --- a/src/categories/create.js +++ b/src/categories/create.js @@ -111,7 +111,7 @@ module.exports = function (Categories) { Categories.assignColours = function () { const backgrounds = ['#AB4642', '#DC9656', '#F7CA88', '#A1B56C', '#86C1B9', '#7CAFC2', '#BA8BAF', '#A16946']; - const text = ['#fff', '#fff', '#333', '#fff', '#333', '#fff', '#fff', '#fff']; + const text = ['#ffffff', '#ffffff', '#333333', '#ffffff', '#333333', '#ffffff', '#ffffff', '#ffffff']; const index = Math.floor(Math.random() * backgrounds.length); return [backgrounds[index], text[index]]; }; diff --git a/src/meta/css.js b/src/meta/css.js index fa6ad4eaef..0bc5e3a34f 100644 --- a/src/meta/css.js +++ b/src/meta/css.js @@ -26,7 +26,6 @@ var buildImports = { '@import "font-awesome";', '@import "../../public/less/jquery-ui.less";', '@import (inline) "../public/vendor/jquery/bootstrap-tagsinput/bootstrap-tagsinput.css";', - '@import (inline) "../public/vendor/colorpicker/colorpicker.css";', '@import (inline) "../node_modules/cropperjs/dist/cropper.css";', '@import "../../public/less/flags.less";', '@import "../../public/less/generics.less";', @@ -42,7 +41,6 @@ var buildImports = { '@import "font-awesome";', '@import "../public/less/admin/admin";', '@import "../public/less/generics.less";', - '@import (inline) "../public/vendor/colorpicker/colorpicker.css";', '@import "../../public/less/jquery-ui.less";', '@import (inline) "../public/vendor/jquery/bootstrap-tagsinput/bootstrap-tagsinput.css";', '@import (inline) "../public/vendor/mdl/material.css";', diff --git a/src/meta/js.js b/src/meta/js.js index fa0792cd69..acf5fe49c9 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -83,7 +83,6 @@ JS.scripts = { admin: [ 'node_modules/material-design-lite/material.js', - 'public/vendor/colorpicker/colorpicker.js', 'public/src/admin/admin.js', 'public/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js', 'public/vendor/jquery/deserialize/jquery.deserialize.min.js', diff --git a/src/upgrades/1.15.0/fix_category_colors.js b/src/upgrades/1.15.0/fix_category_colors.js new file mode 100644 index 0000000000..d773105d54 --- /dev/null +++ b/src/upgrades/1.15.0/fix_category_colors.js @@ -0,0 +1,21 @@ +'use strict'; + +const db = require('../../database'); + +module.exports = { + name: 'Fix category colors that are 3 digit hex colors', + timestamp: Date.UTC(2020, 9, 11), + method: async () => { + const batch = require('../../batch'); + await batch.processSortedSet('categories:cid', async function (cids) { + let categoryData = await db.getObjects(cids.map(c => 'category:' + c)); + categoryData = categoryData.filter(c => c && (c.color === '#fff' || c.color === '#333' || String(c.color).length !== 7)); + if (categoryData.length) { + await Promise.all(categoryData.map(async (data) => { + const color = '#' + new Array(6).fill((data.color && data.color[1]) || 'f').join(''); + await db.setObjectField('category:' + data.cid, 'color', color); + })); + } + }, { batch: 500 }); + }, +}; diff --git a/src/views/admin/manage/category.tpl b/src/views/admin/manage/category.tpl index b64599eae4..48fb985066 100644 --- a/src/views/admin/manage/category.tpl +++ b/src/views/admin/manage/category.tpl @@ -28,7 +28,7 @@ - +
@@ -36,7 +36,7 @@ - +
diff --git a/src/views/admin/manage/group.tpl b/src/views/admin/manage/group.tpl index 95112eec87..382a26cf8e 100644 --- a/src/views/admin/manage/group.tpl +++ b/src/views/admin/manage/group.tpl @@ -30,13 +30,13 @@
-
+
-
+
diff --git a/src/views/admin/manage/tags.tpl b/src/views/admin/manage/tags.tpl index 4493bd67db..7492e05d41 100644 --- a/src/views/admin/manage/tags.tpl +++ b/src/views/admin/manage/tags.tpl @@ -25,11 +25,16 @@