tinymce.PluginManager.add("textcolor",function(e){function t(){var e,t,n=[];for(t=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],e=0;t.length>e;e+=2)n.push({text:t[e+1],color:t[e]});return n}function n(){var e,n,r,i,o,a=this;for(e=t(),n='<table class="mce-grid mce-colorbutton-grid" role="presentation" cellspacing="0"><tbody>',r=Math.ceil(Math.sqrt(e.length)),o=0;5>o;o++){for(n+="<tr>",i=0;8>i;i++){var s=e[8*o+i];n+='<td><div id="'+a._id+"-"+(8*o+i)+'"'+' data-mce-color="'+s.color+'"'+' role="option"'+' tabIndex="-1"'+' style="'+(s?"background-color: #"+s.color:"")+'"'+' title="'+s.text+'">'+"</div>"+"</td>"}n+="</tr>"}return n+="</tbody></table>"}function r(t){var n,r=this.parent();(n=t.target.getAttribute("data-mce-color"))&&(r.hidePanel(),n="#"+n,r.color(n),r.hidePanel(),e.execCommand(r.settings.selectcmd,!1,n))}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",popoverAlign:"bc-tl",selectcmd:"ForeColor",panel:{html:n,onclick:r}}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",popoverAlign:"bc-tl",selectcmd:"HiliteColor",panel:{html:n,onclick:r}})}); |