/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license
*/ CKEDITOR.dialog.add(“uicolor”,function(f){function B(a){a=a.data.getTarget();var c;“td”==a.getName()&&(c=a.getChild(0).getHtml())&&(n(),r(a),m©)}function r(a){a&&(g=a,g.setAttribute(“aria-selected”,!0),g.addClass(“cke_colordialog_selected”))}function n(){g&&(g.removeClass(“cke_colordialog_selected”),g.removeAttribute(“aria-selected”),g=null)}function m(a){k.getContentElement(“picker”,“selectedColor”).setValue(a);a||l.getById(t).removeStyle(“background-color”)}function C(a){!a.name&&(a=new CKEDITOR.event(a)); var c=!/mouse/.test(a.name),b=a.data.getTarget(),h;“td”==b.getName()&&(h=b.getChild(0).getHtml())&&(u(a),c?e=b:D=b,c&&b.addClass(G(h)?“cke_colordialog_focused_light”:“cke_colordialog_focused_dark”),v(h))}function u(a){if(a=!/mouse/.test(a.name)&&e)a.removeClass(“cke_colordialog_focused_light”),a.removeClass(“cke_colordialog_focused_dark”);e||D||v(!1)}function v(a){a?(l.getById(w).setStyle(“background-color”,a),l.getById(x).setHtml(a)):(l.getById(w).removeStyle(“background-color”),l.getById(x).setHtml(“x26nbsp;”))} function G(a){a=a.replace(/^#/,“”);for(var c=0,b=[];2>=c;c++)b=parseInt(a.substr(2*c,2),16);return 165<=.2126*b+.7152*b+.0722*b}function H(a){var c=a.data,b=c.getTarget(),h=c.getKeystroke(),d=“rtl”==f.lang.dir;switch(h){case 38:if(a=b.getParent().getPrevious())a=a.getChild(),a.focus();c.preventDefault();break;case 40:(a=b.getParent().getNext())&&(a=a.getChild())&&1==a.type&&a.focus();c.preventDefault();break;case 32:case 13:B(a);c.preventDefault();break;case d? 37:39:(a=b.getNext())?1==a.type&&(a.focus(),c.preventDefault(!0)):(a=b.getParent().getNext())&&(a=a.getChild())&&1==a.type&&(a.focus(),c.preventDefault(!0));break;case d?39:37:if(a=b.getPrevious())a.focus(),c.preventDefault(!0);else if(a=b.getParent().getPrevious())a=a.getLast(),a.focus(),c.preventDefault(!0)}}function p(a){return CKEDITOR.tools.getNextId()+“_”+a}function E(a){var c=null;q&&a&&(c=q.findOne(‘td[data-colorx3d“’a
‘”]'));return c}function F(a,c){var b=a||c;f.setUiColor(b);k.getContentElement(“picker”, “configBox”).setValue(b);if(a&&k.getContentElement(“picker”,“predefined”).getValue()!==b)k.getContentElement(“picker”,“predefined”).setValue(b);else if©{var d=E(b);d?r(d):n();k.getContentElement(“picker”,“selectedColor”).getValue()!==b&&m(b)}}function y(a){return a.getUiColor()?CKEDITOR.tools.parseCssText(“color:”+a.getUiColor(),!0).color:null}var z=CKEDITOR.dom.element,l=CKEDITOR.document,d=f.lang.uicolor,w=p(“hicolor”),x=p(“hicolortext”),t=p(“selhicolor”),k,q,g,e,D;q=function(){function a(a,d){for(var A= a;A<a+3;A++){var f=new z(b.$.insertRow(-1));f.setAttribute(“role”,“row”);for(var e=d;e<d+3;e++)for(var g=0;6>g;g++)c(f.$,“#”+h+h+h)}}function c(a,c){var b=new z(a.insertCell(-1));b.setAttribute(“class”,“ColorCell cke_colordialog_colorcell”);b.setAttribute(“tabIndex”,-1);b.setAttribute(“role”,“gridcell”);b.setAttribute(“data-color”,c);b.on(“keydown”,H);b.on(“click”,B);b.on(“focus”,C);b.on(“blur”,u);b.setStyle(“background-color”,c);var d=p(“color_table_cell”);b.setAttribute(“aria-labelledby”, d);b.append(CKEDITOR.dom.element.createFromHtml('x3cspan idx3d“'d
'” classx3d“cke_voice_label”x3e'c
“x3c/spanx3e”,CKEDITOR.document))}var b=CKEDITOR.dom.element.createFromHtml('x3ctable tabIndexx3d“-1” classx3d“cke_colordialog_table” aria-labelx3d“'d.options
'” rolex3d“grid” stylex3d“border-collapse:separate;” cellspacingx3d“0”x3ex3ccaption classx3d“cke_voice_label”x3e'd.options
'x3c/captionx3ex3ctbody rolex3d“presentation”x3ex3c/tbodyx3ex3c/tablex3e');b.on(“mouseover”, C);b.on(“mouseout”,u);var h=“00 33 66 99 cc ff”.split(“ ”);a(0,0);a(3,0);a(0,3);a(3,3);var e=new z(b.$.insertRow(-1));e.setAttribute(“role”,“row”);c(e.$,“#000000”);for(var g=0;16>g;g++){var f=g.toString(16);c(e.$,“#”+f+f+f+f+f+f)}c(e.$,“#ffffff”);return b}();CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(CKEDITOR.plugins.get(“uicolor”).path+“dialogs/uicolor.css”));return{title:d.title,minWidth:360,minHeight:220,buttons:,onLoad:function(){k=this},onHide:function(){n(); m(null);e&&(e.removeClass(“cke_colordialog_focused_light”),e.removeClass(“cke_colordialog_focused_dark”),e=null,v(null))},contents:[{id:“picker”,label:d.title,accessKey:“I”,elements:[{type:“hbox”,padding:0,widths:,children:[{type:“html”,html:“x3cdivx3ex3c/divx3e”,onLoad:function(){CKEDITOR.document.getById(this.domId).append(q)},focus:function(){var a=y(f),c=a?E(a):e||this.getElement().getElementsByTag(“td”).getItem(0);c&&(c&&c.focus(),a&&(r©,m(a)))}},{type:“html”,html:“x26nbsp;”}, {type:“vbox”,padding:0,widths:,children:[{type:“html”,html:“x3cspanx3e”d.highlight
'x3c/spanx3ex3cdiv idx3d“'w
'” stylex3d“border: 1px solid; height: 74px; width: 74px;”x3ex3c/divx3ex3cdiv idx3d“'x
'”x3ex26nbsp;x3c/divx3ex3cspanx3e'd.selected
'x3c/spanx3ex3cdiv idx3d“'t
'” stylex3d“border: 1px solid; height: 20px; width: 74px;”x3ex3c/divx3e'},{type:“text”,label:d.selected,labelStyle:“display:none”,id:“selectedColor”,style:“width: 76px;margin-top:4px”, onChange:function(){try{var a=this.getValue();a&&(l.getById(t).setStyle(“background-color”,a),F(a))}catch©{n(),m(null)}}}]}]},{type:“vbox”,children:[{type:“hbox”,padding:0,children:[{id:“predefined”,type:“select”,“default”:“”,width:“100%”,label:d.predefined,items:[,[“Light blue”,“#9ab8f3”],,[“Metallic”,“#949aaa”],,[“Olive”,“#a2c980”],[“Happy green”,“#9bd446”],[“Jezebel Blue”,“#14b8c4”],,[“Easy red”,“#ff6969”],[“Pisces 3”,“#48b4f2”],[“Aquarius 5”, “#487ed4”],,[“Scrambled Egg”,“#c7a622”],[“Hello monday”,“#8e8d80”],[“Lovely sunshine”,“#f1e8b1”],[“Recycled air”,“#b3c593”],,[“Mark Twain”,“#cfe91d”],[“Specks of dust”,“#d1b596”],],onShow:function(){this.setValue(y(f))},onChange:function(){var a=this.getValue();a&&(F(null,a),this.focus())}}]},{id:“configBox”,type:“text”,label:d.config,onShow:function(){this.getInputElement().setAttribute(“readonly”,!0);this.setValue(y(f))},onChange:function(){var a= this.getValue();a&&CKEDITOR.tools.style.parse._findColor(a).length&&this.setValue('config.uiColor x3d “'+a.toLowerCase()+'”',!0)}}]}]}]}});