2150 |
mathias |
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 |
buttonClass: dijit.form.DropDownButton,
|
|
|
12 |
|
|
|
13 |
//TODO: set initial focus/selection state?
|
|
|
14 |
|
|
|
15 |
constructor: function(){
|
|
|
16 |
this.dropDown = new dijit.ColorPalette();
|
|
|
17 |
dojo.connect(this.dropDown, "onChange", this, function(color){
|
|
|
18 |
this.editor.execCommand(this.command, color);
|
|
|
19 |
});
|
|
|
20 |
}
|
|
|
21 |
}
|
|
|
22 |
);
|
|
|
23 |
|
|
|
24 |
}
|