$.texyla.setDefaults({colors:['red','blue','aqua','black','fuchsia','gray','green','lime','maroon','navy','olive','orange','purple','silver','teal','white','yellow','#AABBCC']});$.texyla.addWindow("color",{createContent:function(){var _this=this;var colors=$('<div></div>');var colorsEl=$('<div class="colors"></div>').appendTo(colors);function colorClk(color){return function(){_this.texy.update();if(_this.texy.isCursor()){_this.texy.selectBlock().phrase('',' .{color: '+color+'}');}else{_this.texy.phrase('"',' .{color: '+color+'}"');}
if(colors.find("input.close-after-insert").get(0).checked){colors.dialog("close");}}}
for(var i=0;i<_this.options.colors.length;i++){var color=_this.options.colors[i];$('<span class="ui-state-default ui-corner-all" title="'+color+'">'+'<span style="background-color:'+color+'">&nbsp;</span>'+'</span>').hover(function(){$(this).addClass("ui-state-hover");},function(){$(this).removeClass("ui-state-hover");}).click(colorClk(color)).appendTo(colorsEl);}
colors.append("<br><label><input type='checkbox' checked class='close-after-insert'> "+this.lng.windowCloseAfterInsert+"</label>");return colors;},dimensions:[200,150]});