Type.registerNamespace("Telerik.Web.UI.Editor");
Type.registerNamespace("Telerik.Web.UI.Editor.Modules");
Telerik.Web.UI.Editor.ModulesManager=function(_1){
this._editor=_1;
this._modules=[];
this._onEditorModeChangeDelegate=Function.createDelegate(this,this._onEditorModeChange);
};
Telerik.Web.UI.Editor.ModulesManager.prototype={initialize:function(){
this.createModules();
this._editor.add_modeChange(this._onEditorModeChangeDelegate);
},getModuleByName:function(_2){
for(var i=0;i<this._modules.length;i++){
if(this._modules[i].get_name()==_2){
return this._modules[i];
}
}
return null;
},createModules:function(){
if(!this._editor){
return;
}
var _4=this._editor.get_modulesJSON();
for(var i=0;i<_4.length;i++){
this.createModule(_4[i]);
}
},createModule:function(_6){
if(_6.attributes){
for(var _7 in _6.attributes){
_6[_7.toLowerCase()]=_6.attributes[_7];
}
}
var _8=_6["enabled"];
if(false==_8){
return;
}
_6["editor"]=this._editor;
var _9=_6["name"];
if(_9){
_6["title"]=this._editor.getLocalizedString(_9);
}
var _a=null;
var _b=null;
try{
_a=eval("Telerik.Web.UI.Editor.Modules."+_9);
}
catch(e){
_b=e;
}
if(!_a){
try{
_a=eval(_9);
}
catch(e){
_b=e;
}
}
if(!_a){
}
if(_a){
var _c=document.createElement("DIV");
var _d=this._getModuleZone(_6["dockingzone"]);
delete _6.dockingzone;
delete _6.dockable;
if(_d){
if(_d.innerHTML=="&nbsp;"||_d.innerHTML.length==1){
_d.innerHTML="";
}
_d.appendChild(_c);
}
this._modules[this._modules.length]=$create(_a,_6,null,null,_c);
}
},_getModuleZone:function(_e){
var id=this._editor.get_id();
var _10=$get(id+_e);
if(!_10){
_10=$get(id+"Module");
}
return _10;
},_onEditorModeChange:function(_11,_12){
var _13=Telerik.Web.UI.EditModes;
var _14=_11.get_mode();
this.setModulesVisible((_14==_13.Design));
},setModulesVisible:function(_15){
var _16=this._modules;
if(!this._enabledModules){
this._enabledModules={};
}
for(var i=0;i<_16.length;i++){
var _18=_16[i];
var _19=_18.get_name();
var _1a=_15;
if(!_1a){
if(_18.get_visible()){
this._enabledModules[_19]=true;
}
}else{
if(this._enabledModules[_19]){
_1a=true;
}else{
_1a=false;
}
}
_18.set_visible(_1a);
}
if(_15){
this._enabledModules=null;
}
this._fixIEBottomZoneDisplacement(_15);
},_fixIEBottomZoneDisplacement:function(_1b){
if($telerik.isIE){
if(!this._emptySpan){
this._emptySpan=document.createElement("span");
var _1c=this._getModuleZone("Bottom");
if(_1c){
var _1d=this._emptySpan;
_1d.innerHTML="&nbsp;";
_1d.style.display="none";
_1c.appendChild(_1d);
}
}
this._emptySpan.style.display=_1b?"none":"";
}
},get_modules:function(){
return this._modules;
}};
Telerik.Web.UI.Editor.ModulesManager.registerClass("Telerik.Web.UI.Editor.ModulesManager",null);
Telerik.Web.UI.Editor.Modules.ModuleBase=function(_1e){
Telerik.Web.UI.Editor.Modules.ModuleBase.initializeBase(this,[_1e]);
this._editor=null;
this._name="";
this._visible=true;
this._enabled=true;
this._rendered=false;
this._enableMaxWidth=true;
this._title="";
this._className="reModule";
this._scriptFile="";
this._attributes={};
this.isSafari=$telerik.isSafari;
this.isIE=$telerik.isIE;
this.isOpera=$telerik.isOpera;
this.isFirefox=$telerik.isFirefox;
};
Telerik.Web.UI.Editor.Modules.ModuleBase.prototype={initialize:function(){
Telerik.Web.UI.Editor.Modules.ModuleBase.callBaseMethod(this,"initialize");
if(this.get_visible()){
this.render();
}
},render:function(){
var _1f=this.get_element();
if(_1f){
_1f.className=this._className;
}
this._rendered=true;
},toggleVisibility:function(){
this.set_visible(!this.get_visible());
},attachEventHandler:function(_20,_21){
var _22=this.get_editor();
if(_22){
_22.attachEventHandler(_20,_21);
}
},_getLocalizedString:function(_23,_24){
return this._editor.getLocalizedString(_23,_24);
},get_editor:function(){
return this._editor;
},set_editor:function(_25){
this._editor=_25;
},get_attributes:function(){
return this._attributes;
},set_attributes:function(_26){
this._attributes=_26;
},get_scriptFile:function(){
return this._scriptFile;
},set_scriptFile:function(_27){
this._scriptFile=_27;
},get_visible:function(){
var _28=this.get_element();
if(!_28){
return false;
}
return (_28.style.display!="none");
},set_visible:function(_29){
if(_29&&!this._rendered){
this.render();
}
var _2a=this.get_element();
_2a.style.display=_29?"":"none";
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_2b){
this._enabled=_2b;
},get_title:function(){
return this._title;
},set_title:function(_2c){
this._title=_2c;
},get_name:function(){
return this._name;
},set_name:function(_2d){
this._name=_2d;
}};
Telerik.Web.UI.Editor.Modules.ModuleBase.registerClass("Telerik.Web.UI.Editor.Modules.ModuleBase",Sys.UI.Control);
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector=function(_2e){
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.initializeBase(this,[_2e]);
};
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.prototype={initialize:function(){
this._onSelectionChangeDelegate=Function.createDelegate(this,this.showDomPath);
this._editorPathArray=[];
this._removeElementString=this._getLocalizedString("DomInspectorRemoveElement","Remove Element");
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.callBaseMethod(this,"initialize");
},dispose:function(){
this.clear();
this._registerMouseHandlers(false);
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.callBaseMethod(this,"dispose");
},render:function(){
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.callBaseMethod(this,"render");
this.clear();
this.get_editor().add_selectionChange(this._onSelectionChangeDelegate);
this._registerMouseHandlers(true);
this.showDomPath();
},_registerMouseHandlers:function(_2f){
var _30=this.get_element();
if(true==_2f){
var _31={click:this._onMouseClick,mouseover:this._onMouseOver,mouseout:this._onMouseOut};
$addHandlers(_30,_31,this);
}else{
if(_30){
$clearHandlers(_30);
}
}
},_onMouseOver:function(e){
var _33=this._getReferredEditorElement(e);
if(!_33||this._isSelectedElement(_33)){
return;
}
try{
Sys.UI.DomElement.addCssClass(_33,"RadEDomMouseOver");
}
catch(e){
}
},_onMouseOut:function(e){
var _35=this._getReferredEditorElement(e);
if(!_35){
return;
}
try{
Sys.UI.DomElement.removeCssClass(_35,"RadEDomMouseOver");
if(""==_35.className){
_35.removeAttribute("className",0);
_35.removeAttribute("class",0);
}
}
catch(e){
}
},_onMouseClick:function(e){
var _37=e.target;
if(!_37||_37.tagName!="A"){
return null;
}
if(_37.innerHTML==this._removeElementString){
var _38=this._editorPathArray[0];
this.removeSelectedElement(_38);
}else{
var _38=this._getReferredEditorElement(e);
this.selectElement(_38);
}
return $telerik.cancelRawEvent(e);
},clear:function(){
this.get_element().innerHTML="&nbsp;";
this._editorPathArray=[];
},_createRemoveLink:function(){
var _39=document.createElement("A");
_39.innerHTML=this._removeElementString;
_39.href="javascript:void(0)";
_39.className="reModule_domlink";
this.get_element().appendChild(_39);
},addDomCouple:function(_3a,_3b){
if(!_3a||!_3a.tagName){
return;
}
var _3c=this.get_element();
var _3d=document.createElement("A");
_3d.oncontextmenu=$telerik.cancelRawEvent;
_3d.href="javascript:void(0);";
_3d.innerHTML=_3a.tagName;
_3d.className=_3b?"reModule_domlink_selected ":"reModule_domlink";
_3c.appendChild(_3d);
var _3e=document.createElement("SPAN");
_3e.innerHTML="&nbsp;> ";
_3c.appendChild(_3e);
},_getPathArray:function(_3f,_40){
var _41=[];
while(_3f!=_40&&null!=_3f){
_41[_41.length]=_3f;
_3f=_3f.parentNode;
}
return _41;
},_isSelectedElement:function(_42){
var _43=this._editorPathArray;
if(_43&&_43[0]==_42){
return true;
}
},_getReferredEditorElement:function(e){
var _45=e.target;
if(!_45||_45.tagName!="A"){
return null;
}
var _46=this.get_element().getElementsByTagName("A");
var _47=-1;
for(var i=0;i<_46.length;i++){
if(_46[i]==_45){
_47=i;
break;
}
}
if(_47>-1){
var _49=this._editorPathArray.concat([]).reverse();
return _49[_47];
}
},showDomPath:function(){
if(!this.get_visible()){
return;
}
try{
var _4a=this.get_editor().getSelectedElement();
if(!_4a){
return;
}
var _4b=this.get_editor().get_contentArea();
if(this.isIE&&!_4b.contains(_4a)){
return;
}
this.clear();
this._editorPathArray=this._getPathArray(_4a,_4b);
var _4c=this._editorPathArray;
for(var i=_4c.length-1;i>=0;i--){
this.addDomCouple(_4c[i],(i==0));
}
if(_4c.length>0){
this._createRemoveLink();
}
}
catch(ex){
}
},selectElement:function(_4e){
try{
this._selectedElement=_4e;
this.get_editor().selectElement(_4e);
this._selectedElement=null;
}
catch(ex){
}
},removeSelectedElement:function(_4f){
try{
if(_4f.tagName=="TD"||_4f.tagName=="TH"){
this.get_editor().fire("DeleteCell");
}else{
if(_4f.tagName=="TR"){
this.get_editor().fire("DeleteRow");
}else{
if(_4f.tagName=="TABLE"||_4f.tagName=="TBODY"||_4f.tagName=="THEAD"||_4f.tagName=="TFOOT"||_4f.tagName=="EMBED"||_4f.tagName=="OBJECT"||_4f.tagName=="INPUT"||_4f.tagName=="IMG"||_4f.tagName=="HR"){
var cmd=new Telerik.Web.UI.Editor.GenericCommand(this._removeElementString,this.get_editor().get_contentWindow());
var _51=_4f.parentNode;
_51.removeChild(_4f);
this.get_editor().setFocus();
this.get_editor().executeCommand(cmd);
_52.select();
this.get_editor().setActive();
this.get_editor().setFocus();
}else{
if(_4f.tagName!="BODY"){
var _52=this.get_editor().createRestorePoint();
var _51=_4f.parentNode;
var cmd=new Telerik.Web.UI.Editor.GenericCommand(this._removeElementString,this.get_editor().get_contentWindow());
var _53="";
for(var i=0;i<_51.childNodes.length;i++){
if(_4f!=_51.childNodes[i]){
_53+=Telerik.Web.UI.Editor.Utils.getOuterHtml(_51.childNodes[i]);
}else{
_53+=_4f.innerHTML;
}
}
_51.innerHTML=_53;
this.get_editor().setFocus();
this.get_editor().executeCommand(cmd);
_52.select();
this.get_editor().setActive();
this.get_editor().setFocus();
}
}
}
}
}
catch(ex){
}
this.get_editor().raiseEvent("selectionChange");
}};
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorDomInspector",Telerik.Web.UI.Editor.Modules.ModuleBase);
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector=function(_55){
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.initializeBase(this,[_55]);
};
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.prototype={initialize:function(){
this._onSelectionChangedDelegate=Function.createDelegate(this,this._onSelectionChanged);
this._intervalDelegate=Function.createDelegate(this,this.updateEditorContent);
this._textarea=null;
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"initialize");
},dispose:function(){
if(this._textarea){
this._textarea.value="";
}
this._clearInterval();
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"dispose");
},_clearInterval:function(){
if(this._interval){
window.clearInterval(this._interval);
}
},set_visible:function(_56){
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"set_visible",[_56]);
if(_56){
this._interval=window.setInterval(this._intervalDelegate,4000);
this._onSelectionChanged();
}else{
this._clearInterval();
}
},render:function(){
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"render");
var _57=document.createElement("TEXTAREA");
_57.style.width="99%";
_57.className="reTextarea";
_57.setAttribute("rows","10");
_57.setAttribute("cols","80");
this._textarea=_57;
if(!this.isIE){
_57.onclick=new Function("this.focus();");
}
var _58=this.get_element();
_58.appendChild(_57);
this.get_editor().add_selectionChange(this._onSelectionChangedDelegate);
},updateEditorContent:function(){
if(!this.get_visible()){
return;
}
var _59=this._textarea.value;
var _5a=this.get_editor().get_document().body.innerHTML;
if(_59==this._oldContent||_59==_5a){
return;
}
this._oldContent=_59;
this._updateFlag=true;
this.get_editor().set_html(_59,this._getLocalizedString("Typing"),false);
this._textarea.focus();
},_onSelectionChanged:function(){
if(this._updateFlag){
this._updateFlag=false;
return;
}
this._textarea.value=this.get_editor().get_document().body.innerHTML;
}};
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector",Telerik.Web.UI.Editor.Modules.ModuleBase);
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector=function(_5b){
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.initializeBase(this,[_5b]);
this._updateMainPanelDelegate=Function.createDelegate(this,this._updateMainPanel);
this._onToolValueSelectedDelegate=Function.createDelegate(this,this._onToolValueSelected);
this._onDropDownBeforeShowDelegate=Function.createDelegate(this,this._onDropDownBeforeShow);
this._tools={};
this._toolNames={};
this._selectedElement=null;
};
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.prototype={_nodeAttributesArray:{TABLE:["width","borderColor","cellSpacing","bgColor","className","SetTableProperties","height","cellPadding","align","border"],TH:["width","borderColor","bgColor","className","SetCellProperties","height","align","noWrap","border"],TD:["width","borderColor","bgColor","className","SetCellProperties","height","align","noWrap","border"],TR:["width","className","height"],A:["href","className","LinkManager","title","target"],IMG:["width","borderColor","className","SetImageProperties","height","align","border","alt"],INPUT:["NAME","width","height","id","title","className","value"],FORM:["className","width","height","NAME","action","id"],TEXTAREA:["className","width","height","NAME","id","rows","cols"]},_nodeInspectorAttributesArray:[["rows","NAME","width","cellSpacing","borderColor","href","alt","align","value","target","SetTableProperties","SetCellProperties","LinkManager"],["cols","id","height","action","cellPadding","border","bgColor","title","noWrap","className","SetImageProperties"]],initialize:function(){
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.callBaseMethod(this,"initialize");
this.get_editor().add_selectionChange(this._updateMainPanelDelegate);
this._invalidValueString=this._getLocalizedString("NodeInspectorInvalidValue","Invalid value. Please enter a number.");
},render:function(){
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.callBaseMethod(this,"render");
var _5c=this.get_element();
_5c.style.height="50px";
},get_skin:function(){
return this._editor.get_skin();
},getNamedCssForSelectedElement:function(_5d){
return this.get_editor().getCssArray(_5d);
},dispose:function(){
this._tools=[];
this._mainPanel=null;
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.callBaseMethod(this,"dispose");
},_createMainPanel:function(){
var _5e=this._tools;
var _5f=this._toolNames;
var _60=this._nodeInspectorAttributesArray;
var _61=document.createElement("TABLE");
_61.border=0;
_61.cellSpacing=0;
_61.cellPadding=0;
for(var _62=0;_62<_60.length;_62++){
var _63=_60[_62];
var _64=_61.insertRow(-1);
for(var i=0;i<_63.length;i++){
var _66=_63[i];
var _67=_64.insertCell(-1);
_67.style.display="none";
_67.setAttribute("controlName",_66);
_67.innerHTML=this._getLocalizedString(_66,_66);
_67.className="reModuleLabel";
_67=_64.insertCell(-1);
_67.style.display="none";
_67.setAttribute("controlHolder",_66);
var _68=this._getControlByName(_66);
if(_68){
_5e[_66]=_68;
_67.appendChild(_68.get_element());
}
}
}
return _61;
},_updateMainPanel:function(){
if(!this.get_visible()){
return;
}
if(!this._isMainCreated){
this._mainPanel=this._createMainPanel();
this._mainPanel.style.display="none";
this.get_element().appendChild(this._mainPanel);
this._isMainCreated=true;
}
var _69=this.get_editor();
var _6a=_69.getSelectedElement();
if(!_6a||_6a.tagName=="BODY"||_6a.ownerDocument!=_69.get_document()){
this._mainPanel.style.display="none";
return;
}
if(_6a.tagName=="TBODY"&&this.isOpera){
_6a=_6a.parentNode;
}
var _6b=this._nodeAttributesArray[_6a.tagName];
if(!_6b){
var _6c=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_6a,"A");
if(!_6c){
_6c=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_6a,"TD");
}
if(!_6c){
_6c=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_6a,"TH");
}
if(_6c){
_6a=_6c;
}else{
this._mainPanel.style.display="none";
return;
}
}
var _6d=null;
if(this._selectedElement){
try{
_6d=this._selectedElement.tagName;
}
catch(e){
}
}
if(!this._selectedElement||(_6d!=_6a.tagName)){
var _6e=this.get_editor().get_document();
this._tools["align"].setTagName(_6a.tagName);
}
this._selectedElement=_6a;
this._updateControlValues(this._selectedElement);
this._mainPanel.style.display="";
},_arrayValueExists:function(_6f,_70){
return Array.contains(_70,_6f);
},_issValidAttribValue:function(_71){
if(null==_71){
return false;
}
_71=_71.trim();
if(""==_71){
return true;
}
var _72=parseInt(_71);
if(isNaN(_72)){
return false;
}
return true;
},_onDropDownBeforeShow:function(_73,_74){
var _75=this.get_editor();
var _76=_73.get_name();
var _77=_73.get_items();
if(_77&&_77.length>0){
return;
}
var _78=null;
switch(_76){
case "className":
var _79=this._selectedElement;
var _7a=_79&&_79.tagName?_79.tagName:"";
_78=_75.getCssArray(_7a);
break;
case "target":
_78=[["_blank",this._getLocalizedString("blank","New Window")],["_self",this._getLocalizedString("self","Same Window")],["_parent",this._getLocalizedString("parent","Parent window")],["_top",this._getLocalizedString("top","Top browser window")],["_search",this._getLocalizedString("search","Search pane")],["_media",this._getLocalizedString("media","Media pane")]];
break;
case "bgColor":
case "borderColor":
_78=_75.get_colors();
break;
}
if(_78){
_73.set_items(_78);
}
},_onToolValueSelected:function(_7b,_7c){
if(_7b){
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(_7b)||Telerik.Web.UI.EditorSpinBox.isInstanceOfType(_7b)||Telerik.Web.UI.EditorCheckBox.isInstanceOfType(_7b)||Telerik.Web.UI.EditorTextBox.isInstanceOfType(_7b)){
this.fire(_7b);
}else{
this.get_editor().fire(_7b.get_name());
}
}
},executeStyleRuleCommand:function(_7d,_7e,_7f,_80){
var _81=this.get_editor();
var _82=new Telerik.Web.UI.Editor.StyleRuleCommand(_80,_81.get_contentWindow(),_7d,_7e,_7f);
_81.executeCommand(_82);
},executeAttributeCommand:function(_83,_84,_85,_86){
var _87=this.get_editor();
var _88=new Telerik.Web.UI.Editor.AttributeCommand(_86,_87.get_contentWindow(),_83,_84,_85);
_87.executeCommand(_88);
},_updateControlValues:function(_89){
var _8a=this._nodeAttributesArray[_89.tagName];
var _8b=this._mainPanel;
var _8c=this._tools;
for(var _8d=0;_8d<_8b.rows.length;_8d++){
var _8e=_8b.rows[_8d];
for(var i=0;i<_8e.cells.length;i++){
var _90=_8e.cells[i];
var _91=_90.getAttribute("controlName");
if(_91){
_90.style.display=this._arrayValueExists(_91,_8a)?"":"none";
}
var _92=_90.getAttribute("controlHolder");
if(_92){
_90.style.display=this._arrayValueExists(_92,_8a)?"":"none";
if("none"==_90.style.display){
continue;
}
var _93=_8c[_92];
var _94=_89.getAttribute?_89.getAttribute(_92,2):"";
if(_92=="noWrap"){
var _95=(_89.style.whiteSpace=="nowrap")?"nowrap":"";
if(!_95){
_95=_89.noWrap;
}
_93.set_value(_95);
}else{
if(_92=="border"){
var _96=parseInt(_89.style["borderWidth"]);
if(isNaN(_96)){
_96="";
}
_93.set_value(_96);
}else{
if(_92=="borderColor"||_92=="bgColor"){
if(_92=="bgColor"){
_92="backgroundColor";
}
var _96=_89.style[_92];
if(!_96){
_96=_89.getAttribute(_92);
}
if(_96){
var _97=_96.indexOf(")");
if(_97!=-1){
_96=_96.substring(0,_97+1);
}
}
_93.set_color(_96);
}else{
if(_92=="align"){
var _98=_89.tagName.toLowerCase();
switch(_98){
case "img":
var _99=($telerik.isIE)?"styleFloat":"cssFloat";
var _9a=(typeof (_89.style[_99])=="undefined")?"":_89.style[_99];
var _9b=(typeof (_89.style["verticalAlign"])=="undefined")?"":_89.style["verticalAlign"];
if(_9b==""&&_9a!=""){
switch(_9a){
case "left":
_93.updateValue("left",null);
break;
case "right":
_93.updateValue("right",null);
break;
}
}
if(_9a==""){
switch(_9b){
case "top":
_93.updateValue("top",null);
break;
case "middle":
_93.updateValue("absmiddle",null);
break;
case "text-bottom":
_93.updateValue("bottom",null);
break;
}
}
break;
case "td":
case "th":
var _9c=_89.style["textAlign"];
var _9b=_89.style["verticalAlign"];
var _9d=_89.getAttribute("align");
var _9e=_89.getAttribute("vAlign");
if((_9c=="left"||_9c=="center"||_9c=="right")&&(_9b=="top"||_9b=="middle"||_9b=="bottom")){
_93.updateValue(_9c,_9b);
}else{
if(_9d||_9e){
_93.updateValue(_9d,_9e);
}else{
_93.updateValue(null,null);
}
}
break;
default:
_93.updateValue(_89.getAttribute("align"),_89.getAttribute("vAlign"));
break;
}
}else{
if(_92=="target"){
var _96=_89.getAttribute(_92);
_93.updateValue(_96);
}else{
if(_92=="width"||_92=="height"){
var _96=_89.style[_92];
if(!_96){
_96=_89.getAttribute(_92);
}
_93.set_value(_96);
}else{
if("name"==_92.toLowerCase()){
_93.set_value(_89.name);
}else{
if("className"==_92){
if(!this.isIE){
_94=_89.getAttribute("class");
}
if(!_94){
_94="";
}
_93.updateValue(_94);
}else{
if(_94&&_93.set_value){
_93.set_value(_94);
}else{
if(_93.set_value){
_93.set_value("");
}
}
}
}
}
}
}
}
}
}
}
}
}
},fire:function(_9f){
if(!_9f){
return;
}
var _a0=_9f.get_name();
var _a1=this.get_editor();
var _a2=this._getLocalizedString(_a0,_a0);
if(!_a2){
_a2=_a0;
}
var _a3=this._selectedElement;
if("AlignmentSelector"==_a0){
var _a4=_9f.getAlign();
var _a5=_9f.getVAlign();
var _a2=this._getLocalizedString("Align","Align");
var _a6=this._getLocalizedString("vAlign","vAlign");
var _a7=($telerik.isIE)?"styleFloat":"cssFloat";
var _a8=_a3.tagName.toLowerCase();
var _a9=false;
switch(_a8){
case "img":
switch(_a4){
case "left":
this.executeStyleRuleCommand(_a3,_a7,"left",_a2);
this.executeStyleRuleCommand(_a3,"verticalAlign","",_a2);
break;
case "right":
this.executeStyleRuleCommand(_a3,_a7,"right",_a2);
this.executeStyleRuleCommand(_a3,"verticalAlign","",_a2);
break;
case "top":
this.executeStyleRuleCommand(_a3,_a7,"",_a2);
this.executeStyleRuleCommand(_a3,"verticalAlign","top",_a2);
break;
case "bottom":
this.executeStyleRuleCommand(_a3,_a7,"",_a2);
this.executeStyleRuleCommand(_a3,"verticalAlign","text-bottom",_a2);
break;
case "absmiddle":
this.executeStyleRuleCommand(_a3,_a7,"",_a2);
this.executeStyleRuleCommand(_a3,"verticalAlign","middle",_a2);
break;
default:
this.executeStyleRuleCommand(_a3,_a7,"",_a2);
this.executeStyleRuleCommand(_a3,"verticalAlign","",_a2);
break;
}
_a9=true;
break;
case "td":
case "th":
this.executeStyleRuleCommand(_a3,"textAlign",_a4,_a2);
this.executeStyleRuleCommand(_a3,"verticalAlign",_a5,_a6);
_a9=true;
break;
default:
this.executeAttributeCommand(_a3,"align",_a4,_a2);
this.executeAttributeCommand(_a3,"vAlign",_a5,_a6);
break;
}
if(_a9){
_a3.removeAttribute("align");
_a3.removeAttribute("vAlign");
}
}else{
if("borderColor"==_a0){
var _aa=_9f.get_selectedItem();
if(this._selectedElement.tagName!="TABLE"){
this.executeStyleRuleCommand(this._selectedElement,"borderColor",_aa,_a2);
_a3.removeAttribute("borderColor");
}else{
this.executeAttributeCommand(this._selectedElement,"borderColor",_aa,_a2);
}
}else{
if("bgColor"==_a0){
var _aa=_9f.get_selectedItem();
this.executeStyleRuleCommand(this._selectedElement,"backgroundColor",_aa,_a2);
_a3.removeAttribute("bgColor");
}else{
if("border"==_a0){
var _aa=_9f.get_selectedItem();
if(!this._issValidAttribValue(_aa)){
alert(this._invalidValueString);
return;
}
if(_aa){
_aa+="px";
this.executeStyleRuleCommand(this._selectedElement,"borderWidth",_aa,_a2);
this.executeStyleRuleCommand(this._selectedElement,"borderStyle","solid",_a2);
}else{
this.executeStyleRuleCommand(this._selectedElement,"borderWidth","",_a2);
this.executeStyleRuleCommand(this._selectedElement,"borderStyle","",_a2);
}
_a3.removeAttribute("border");
}else{
if("width"==_a0||"height"==_a0){
var _aa=_9f.get_selectedItem();
if(!this._issValidAttribValue(_aa)){
alert(this._invalidValueString);
return;
}
function ConvertIntToPixel(_ab){
var _ac=""+_ab;
if(_ac.indexOf("%")!=-1){
return _ac;
}else{
var _ad=_ac.match(/(em|ex|px|in|cm|mm|pt|pc)$/);
_ac=parseInt(_ac);
if(!isNaN(_ac)){
_ac=(_ad)?_ac+_ad[0]:_ac+"px";
return _ac;
}
}
return _ab;
}
_aa=ConvertIntToPixel(_aa);
if(this._selectedElement.removeAttribute){
this._selectedElement.removeAttribute(_a0);
}
this.executeStyleRuleCommand(this._selectedElement,_a0,_aa,_a2);
}else{
if("noWrap"==_a0){
var _ae=_9f.get_selectedItem();
if(_ae){
this.executeStyleRuleCommand(this._selectedElement,"whiteSpace","nowrap",_a2);
}else{
this.executeStyleRuleCommand(this._selectedElement,"whiteSpace","",_a2);
}
}else{
var _af=_a0;
var _ae=_9f.get_selectedItem();
switch(_a0){
case "background":
case "className":
case "target":
case "value":
break;
case "cellSpacing":
case "cellPadding":
if(!this._issValidAttribValue(_ae)){
alert(this._invalidValueString);
return;
}
break;
case "NAME":
if(!this.isIE){
_af="name";
}
}
this.executeAttributeCommand(_a3,_af,_ae,_a2);
}
}
}
}
}
}
if(this._selectedElement){
this._updateControlValues(this._selectedElement);
}
if(this._selectedElement.style.cssText==""){
this._selectedElement.removeAttribute("style");
}
},_getControlByName:function(_b0){
var _b1=null;
var _b2={text:this._getLocalizedString(_b0),name:_b0,addClickHandler:true,skin:this.get_skin()};
var _b3={"valueSelected":this._onToolValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate};
switch(_b0){
case "className":
_b2["text"]=this._getLocalizedString("className");
_b2["width"]="90px";
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3,Telerik.Web.UI.Editor.ApplyClassDropDown);
break;
case "borderColor":
case "bgColor":
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3,Telerik.Web.UI.Editor.ColorPicker);
break;
case "align":
_b2["name"]="AlignmentSelector";
_b2["text"]=this._getLocalizedString("align");
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3,Telerik.Web.UI.Editor.AlignmentSelector);
break;
case "SetCellProperties":
case "SetTableProperties":
case "SetImageProperties":
case "LinkManager":
delete _b3.show;
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3);
break;
case "target":
_b2["sizetofit"]=true;
_b2["width"]="90px";
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3,Telerik.Web.UI.EditorUpdateableDropDown);
break;
case "noWrap":
delete _b3.show;
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3,Telerik.Web.UI.EditorCheckBox,document.createElement("span"));
break;
case "width":
case "height":
case "cellPadding":
case "cellSpacing":
case "rows":
case "cols":
case "border":
delete _b3.show;
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3,Telerik.Web.UI.EditorSpinBox,document.createElement("span"));
break;
default:
delete _b3.show;
_b1=Telerik.Web.UI.EditorButton.createTool(_b2,_b3,Telerik.Web.UI.EditorTextBox,document.createElement("span"));
}
return _b1;
}};
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector",Telerik.Web.UI.Editor.Modules.ModuleBase);
Telerik.Web.UI.Editor.Modules.RadEditorStatistics=function(_b4){
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.initializeBase(this,[_b4]);
};
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.prototype={initialize:function(){
this._enableMaxWidth=false;
this._wordsString=this._getLocalizedString("StatisticsWords","Words:");
this._charactersString=this._getLocalizedString("StatisticsCharacters","Characters:");
this._onDoCountDelegate=Function.createDelegate(this,this.doCount);
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.callBaseMethod(this,"initialize");
},render:function(){
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.callBaseMethod(this,"render");
this.get_editor().add_selectionChange(this._onDoCountDelegate);
this.doCount();
},doCount:function(){
if(!this.get_visible()){
return;
}
var _b5=this.get_editor().get_text();
var _b6=0;
var _b7=0;
if(_b5){
var _b8=/[!\.?;,:&_\-\�\{\}\[\]\(\)~#'"]/g;
_b5=_b5.replace(_b8,"");
var _b9=/(^\s+)|(\s+$)/g;
_b5=_b5.replace(_b9,"");
if(_b5){
splitRegX=/\s+/;
var _ba=_b5.split(splitRegX);
_b6=_ba.length;
var _bb=/(\r\n)+/g;
_b5=_b5.replace(_bb,"");
_b7=_b5.length;
}
}
var _bc=this.get_element();
_bc.innerHTML="<span style='line-height:22px'>"+this._wordsString+" "+_b6+" &nbsp;&nbsp;"+this._charactersString+" "+_b7+"&nbsp;</span>";
}};
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorStatistics",Telerik.Web.UI.Editor.Modules.ModuleBase);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();