HTMLArea.TextIndicator=HTMLArea.Plugin.extend({constructor:function(editor,pluginName){this.base(editor,pluginName);},configurePlugin:function(editor){var pluginInformation={version:"1.0",developer:"Stanislas Rolland",developerUrl:"http://www.sjbr.ca/",copyrightOwner:"Stanislas Rolland",sponsor:"SJBR",sponsorUrl:"http://www.sjbr.ca/",license:"GPL"};this.registerPluginInformation(pluginInformation);var buttonId='TextIndicator';var textConfiguration={id:buttonId,cls:'indicator',text:'A',tooltip:this.localize(buttonId.toLowerCase())};this.registerText(textConfiguration);return true;},onUpdateToolbar:function(button,mode,selectionEmpty,ancestors){var editor=this.editor;if(mode==='wysiwyg'&&editor.isEditable()){var doc=editor._doc;var style={fontWeight:'normal',fontStyle:'normal'};try{style.backgroundColor=HTMLArea._makeColor(doc.queryCommandValue((Ext.isIE||Ext.isWebKit)?'BackColor':'HiliteColor'));style.color=HTMLArea._makeColor(doc.queryCommandValue('ForeColor'));style.fontFamily=doc.queryCommandValue('FontName');}catch(e){}
if(Ext.isGecko){var computedStyle=editor.iframe.getEl().dom.contentWindow.getComputedStyle(editor.getParentElement(),null);style.color=computedStyle.getPropertyValue('color');style.backgroundColor=computedStyle.getPropertyValue('background-color');style.fontFamily=computedStyle.getPropertyValue('font-family');}
try{style.fontWeight=doc.queryCommandState('Bold')?'bold':'normal';}catch(e){style.fontWeight='normal';}
try{style.fontStyle=doc.queryCommandState('Italic')?'italic':'normal';}catch(e){style.fontStyle='normal';}
button.getEl().setStyle(style);}}});