]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dijit/_editor/plugins/TextColor.js
Comment class stub
[eow] / static / dojo-release-1.1.1 / dijit / _editor / plugins / TextColor.js
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");
4
5 dojo.require("dijit._editor._Plugin");
6 dojo.require("dijit.ColorPalette");
7
8 dojo.declare("dijit._editor.plugins.TextColor",
9         dijit._editor._Plugin,
10         {
11                 //      summary:
12                 //              This plugin provides dropdown color pickers for setting text color and background color
13                 //
14                 //      description:
15                 //              The commands provided by this plugin are:
16                 //              * foreColor - sets the text color
17                 //              * hiliteColor - sets the background color
18
19                 buttonClass: dijit.form.DropDownButton,
20
21 //TODO: set initial focus/selection state?
22
23                 constructor: function(){
24                         this.dropDown = new dijit.ColorPalette();
25                         this.connect(this.dropDown, "onChange", function(color){
26                                 this.editor.execCommand(this.command, color);
27                         });
28                 }
29         }
30 );
31
32 dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
33         if(o.plugin){ return; }
34         switch(o.args.name){
35         case "foreColor": case "hiliteColor":
36                 o.plugin = new dijit._editor.plugins.TextColor({command: o.args.name});
37         }
38 });
39
40 }