2 Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(!dojo._hasResource["dijit._editor.plugins.TextColor"]){
9 dojo._hasResource["dijit._editor.plugins.TextColor"]=true;
10 dojo.provide("dijit._editor.plugins.TextColor");
11 dojo.require("dijit._editor._Plugin");
12 dojo.require("dijit.ColorPalette");
13 dojo.declare("dijit._editor.plugins.TextColor",dijit._editor._Plugin,{buttonClass:dijit.form.DropDownButton,useDefaultCommand:false,constructor:function(){
14 this.dropDown=new dijit.ColorPalette();
15 this.connect(this.dropDown,"onChange",function(_1){
16 this.editor.execCommand(this.command,_1);
18 },updateState:function(){
21 if(!_2||!_2.isLoaded||!_3.length){
27 _4=_2.queryCommandValue(_3)||"";
36 if(_4=="transparent"){
39 if(typeof _4=="string"){
40 if(_4.indexOf("rgb")>-1){
41 _4=dojo.colorFromRgb(_4).toHex();
44 _4=((_4&255)<<16)|(_4&65280)|((_4&16711680)>>>16);
46 _4="#000000".slice(0,7-_4.length)+_4;
48 if(_4!==this.dropDown.get("value")){
49 this.dropDown.set("value",_4,false);
52 dojo.subscribe(dijit._scopeName+".Editor.getPlugin",null,function(o){
59 o.plugin=new dijit._editor.plugins.TextColor({command:o.args.name});