1 if(!dojo._hasResource["dijit._editor.plugins.TextColor"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dijit._editor.plugins.TextColor"] = true;
3 dojo.provide("dijit._editor.plugins.TextColor");
5 dojo.require("dijit._editor._Plugin");
6 dojo.require("dijit.ColorPalette");
8 dojo.declare("dijit._editor.plugins.TextColor",
12 // This plugin provides dropdown color pickers for setting text color and background color
15 // The commands provided by this plugin are:
16 // * foreColor - sets the text color
17 // * hiliteColor - sets the background color
19 buttonClass: dijit.form.DropDownButton,
21 //TODO: set initial focus/selection state?
23 constructor: function(){
24 this.dropDown = new dijit.ColorPalette();
25 this.connect(this.dropDown, "onChange", function(color){
26 this.editor.execCommand(this.command, color);
32 dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
33 if(o.plugin){ return; }
35 case "foreColor": case "hiliteColor":
36 o.plugin = new dijit._editor.plugins.TextColor({command: o.args.name});