RadEditorDomInspector.prototype=new RadEditorModuleBase( ); RadEditorDomInspector.prototype.base=RadEditorModuleBase.prototype.constructor; var DOM_INSPECTOR_HORIZONTAL_HEIGHT="\x320px"; var DOM_INSPECTOR_VERTICAL_HEIGHT="80px"; function RadEditorDomInspector(moduleArgs){var theDiv=moduleArgs.Document.createElement("\104\x49V"); theDiv.style.paddingTop="\062\x70x"; if (window.opera){theDiv.style.height=DOM_INSPECTOR_HORIZONTAL_HEIGHT; theDiv.style.lineHeight=DOM_INSPECTOR_HORIZONTAL_HEIGHT; }moduleArgs.ModuleElement=theDiv; this.base(moduleArgs); this.SelectedDomCouple=null; this.RemoveElementString=this.GetLocalizedString("\104\x6fmIns\x70ectorRem\x6fveEle\x6dent","Remove \x45lement"); }
; RadEditorDomInspector.prototype.OnDispose= function ( ){ this.Clear( ); this.SelectedDomCouple=null; this.SelectedElement=null; };RadEditorDomInspector.prototype.OnRenderHorizontal= function ( ){ this.style.height=DOM_INSPECTOR_HORIZONTAL_HEIGHT; } ; RadEditorDomInspector.prototype.OnRenderVertical= function ( ){ this.style.height=DOM_INSPECTOR_VERTICAL_HEIGHT; } ; RadEditorDomInspector.prototype.OnCreate= function ( ){var selfPointer=this ; this.AttachEventHandler(RadEditorNamespace.RADEVENT_SEL_CHANGED, function ( ){selfPointer.CreatePath( ); } ); var topElem=this.TopElement; topElem.OnRenderVertical=this.OnRenderVertical; topElem.OnRenderHorizontal=this.OnRenderHorizontal; topElem.style.width=this.Editor.Width; topElem.style.height=DOM_INSPECTOR_HORIZONTAL_HEIGHT; } ; RadEditorDomInspector.prototype.CreatePath= function ( ){if (!this.IsEnabled)return; var elem=this.Editor.GetSelectedElement( ); if (!elem)return; var contentArea=this.Editor.ContentArea; if (this.Editor.IsIE && !contentArea.contains(elem))return; var array=[ ]; var counter=0; while (elem!=contentArea && null!=elem){array[counter++]=elem; elem=elem.parentNode; } this.Clear( ); var domCouple=null; var domElement; var isLast= false; for (var i=array.length-1; i>=0; i--){domElement=array[i]; isLast=(0==i) || (null!=this.SelectedElement && domElement==this.SelectedElement); if (domElement && domElement.tagName){isSelected=(0==i) || (null!=this.SelectedElement && domElement==this.SelectedElement); domCouple=this.AddDomCouple(domElement,isSelected); }if (isLast){break; }} this.SelectedElement=null; this.SelectedDomCouple=domCouple; if (this.SelectedDomCouple){var domLink=this.Document.createElement("\x41"); domLink.innerHTML=this.RemoveElementString; domLink.href="j\x61vascrip\x74:void(0)"; domLink.className="DomP\x61thLink"; domLink.Parent=this ; domLink.onmousedown=new Function("thi\x73.Parent.\x52\145\x6doveSe\x6cectedE\x6cement(\x29\073\x72etu\x72n fa\x6c\163\x65;"); this.ModuleElement.appendChild(domLink); }} ; RadEditorDomInspector.prototype.AddDomCouple= function (domElement,isSelected){var domLink=this.Document.createElement("A"); this.ModuleElement.appendChild(domLink); var empty=this.Document.createElement("\x53PAN"); empty.innerHTML="\x26nbsp;> "; this.ModuleElement.appendChild(empty); var couple=new DomCouple(domLink,domElement,(isSelected?"\x44o\x6d\x50ath\x4cinkSele\x63ted": ""),isSelected,this ); return couple; } ; RadEditorDomInspector.prototype.Clear= function ( ){if (this.SelectedDomCouple){ this.SelectedDomCouple.Clear( ); }var links=this.ModuleElement.getElementsByTagName("\101"); for (i=0; i<links.length; i++){var link=links[i]; link.Parent=null; } this.ModuleElement.innerHTML=""; } ; RadEditorDomInspector.prototype.RemoveSelectedElement= function ( ){if (!this.Editor.IsEditingEnabled( ))return; if (!this.SelectedDomCouple || !this.SelectedDomCouple.DomElement){return; }var elem=this.SelectedDomCouple.DomElement; try {if (elem.tagName=="TD" || elem.tagName=="TH"){ this.Editor.DeleteCell( ); }else if (elem.tagName=="\x54R"){ this.Editor.DeleteRow( ); }else if (elem.tagName=="TA\x42LE" || elem.tagName=="T\x42ODY" || elem.tagName=="TH\x45AD" || elem.tagName=="T\x46OOT" || elem.tagName=="\x45MBED" || elem.tagName=="\x4fBJECT" || elem.tagName=="I\x4ePUT" || elem.tagName=="\111\x4d\107" || elem.tagName=="HR"){var cmd=RadEditorNamespace.RadGenericCommand.New(this.RemoveElementString,this.Editor.ContentWindow); var parentNode=elem.parentNode; parentNode.removeChild(elem); this.Editor.SetFocus( ); this.Editor.ExecuteCommand(cmd); restorePoint.Select( ); this.Editor.SetActive( ); this.Editor.SetFocus( ); }else if (elem.tagName!="BODY"){var restorePoint=RadEditorNamespace.RadCreateRestorePoint(this.Editor.ContentWindow); var parentNode=elem.parentNode; var cmd=RadEditorNamespace.RadGenericCommand.New(this.RemoveElementString,this.Editor.ContentWindow); var newHtml=""; for (var i=0; i<parentNode.childNodes.length; i++){if (elem!=parentNode.childNodes[i]){newHtml+=RadEditorNamespace.Utils.GetOuterHtml(parentNode.childNodes[i]); }else {newHtml+=elem.innerHTML; }}parentNode.innerHTML=newHtml; this.Editor.SetFocus( ); this.Editor.ExecuteCommand(cmd); restorePoint.Select( ); this.Editor.SetActive( ); this.Editor.SetFocus( ); }}catch (ex){} this.Editor.FireEvent(RadEditorNamespace.RADEVENT_SEL_CHANGED,null); } ; RadEditorDomInspector.prototype.SelectElement= function (elem){try { this.SelectedElement=elem; this.Editor.SelectElement(elem); this.SelectedElement=null; }catch (ex){}};function DomCouple(domLink,domElement,className,isSelected,RadEditorDomInspector){ this.RadEditorDomInspector=RadEditorDomInspector; this.DomLink=domLink; this.DomElement=domElement; this.Selected=isSelected; if (domLink){domLink.href="\x6aavasc\x72\151\x70t:voi\x64\050\x30);"; domLink.className=className?className: "\x44om\x50\141t\x68Link"; domLink.Parent=this ; domLink.onclick=new Function("this.\x50arent.Se\x6cectElem\x65nt();"); domLink.onmouseover=new Function("this\x2eParent.o\x6emouseov\x65\162\x28);"); domLink.onmouseout=new Function("this\x2eParent.o\x6emouseout\x28);"); if (domElement!=null){domLink.innerHTML=domElement.tagName; }}}
; DomCouple.prototype.Clear= function ( ){ this.RadEditorDomInspector.SelectedDomCouple=null; this.DomLink.className="D\x6fmPathLin\x6b"; } ; DomCouple.prototype.onmouseover= function ( ){if (this.Selected)return; try { this.DomElementClass=this.DomElement.className; this.DomElement.className+=" RadEDo\x6dMouseOv\x65\162"; }catch (e){ ; }} ; DomCouple.prototype.onmouseout= function ( ){if (null!=this.DomElementClass)this.DomElement.className=this.DomElementClass; try {if (""==this.DomElement.className){ this.DomElement.removeAttribute("clas\x73Name",0); this.DomElement.removeAttribute("\x63las\x73",0); }}catch (e){ ; }} ; DomCouple.prototype.SelectElement= function ( ){ this.onmouseout( ); if (this.RadEditorDomInspector.SelectedDomCouple){ this.RadEditorDomInspector.SelectedDomCouple.Clear( ); } this.DomLink.className="D\x6fmPathLin\x6b\123\x65lected"; this.RadEditorDomInspector.SelectedDomCouple=this ; this.RadEditorDomInspector.SelectElement(this.DomElement); } ;
RadEditorHtmlInspector.prototype=new RadEditorModuleBase( ); RadEditorHtmlInspector.prototype.base=RadEditorModuleBase.prototype.constructor; function RadEditorHtmlInspector(moduleArgs){var txtArea=moduleArgs.Document.createElement("\x54EXTAREA"); moduleArgs.ModuleElement=txtArea; txtArea.style.width="\x399%"; moduleArgs.ClassName="RadETe\x78\164\x41rea"; this.base(moduleArgs); this.ModuleElement.setAttribute("rows","10"); this.ModuleElement.setAttribute("cols","\x380"); if (!document.all)this.ModuleElement.onclick= function ( ){ this.focus( ); } ; }
; RadEditorHtmlInspector.prototype.OnDispose= function ( ){ this.ModuleElement.onkeyup=null; };RadEditorHtmlInspector.prototype.IsSelChanged= function (keyCode){if (keyCode==32 || keyCode==9 || keyCode==8 || keyCode==46 || keyCode==13){return true; }if (keyCode==190)return true; if (keyCode>47 && keyCode<58)return true; return false; } ; RadEditorHtmlInspector.prototype.OnCreate= function ( ){var selfPointer=this ; this.AttachEventHandler(RadEditorNamespace.RADEVENT_SEL_CHANGED, function ( ){selfPointer.OnSelectionChanged( ); } ); this.AttachEventHandler(RadEditorNamespace.RADEVENT_CALLBACK_STARTED, function ( ){selfPointer.ModuleElement.value=""; } ); this.ModuleElement.onkeyup= function anon(e){if (!e)e=window.event; if (selfPointer.IsSelChanged(e.keyCode)){selfPointer.UpdateContentArea(e); }} ; var oModule=this ; this.TopElement.OnResize= function ( ){var oArea=oModule.ModuleElement; oArea.style.height=(parseInt(oModule.TopElement.offsetHeight)-3)+"px"; oArea.style.width=(parseInt(oModule.TopElement.offsetWidth)-3)+"px"; };} ; RadEditorHtmlInspector.prototype.UpdateContentArea= function (e){if (!this.IsEnabled)return; this.Flag= true; this.Editor.SetHtml(this.ModuleElement.value,this.Localization['Ty\x70ing'], false); this.ModuleElement.focus( ); } ; RadEditorHtmlInspector.prototype.OnSelectionChanged= function ( ){if (this.Flag){ this.Flag= false; return; } this.ModuleElement.value=this.Editor.GetHtml( ); } ;
RadEditorNamespace.RadSpinBox= function (toolArgs){ this.Width=toolArgs.Width?parseInt(toolArgs.Width)+"\x70x": "50\x70\170"; this.Title=toolArgs.Title; this.Controller=toolArgs.Controller; this.Name=toolArgs.Name; this.Document=toolArgs.Document; this.SelectedValue=""; this.ClassName="\x52a\x64\x45Te\x78tBox"; };RadEditorNamespace.RadSpinBox.prototype.Dispose= function ( ){ this.Element.onchange=null; this.Element.onkeypress=null; this.Element.onclick=null; this.Element.Parent=null; this.Element=null; } ; RadEditorNamespace.RadSpinBox.prototype.GetTopElement= function ( ){return this.Element; } ; RadEditorNamespace.RadSpinBox.prototype.GetSelectedValue= function ( ){return this.SelectedValue; } ; RadEditorNamespace.RadSpinBox.prototype.SetValue= function (value){ this.Element.value=value; } ; RadEditorNamespace.RadSpinBox.prototype.Create= function ( ){var inputElement=this.Document.createElement("\x49NPU\x54"); inputElement.setAttribute("\x73ize","3"); inputElement.style.width=this.Width; inputElement.className=this.ClassName; inputElement.Parent=this ; var commandName=this.Name; var executeFunction= function (e,elem,isSecondToExecute){elem.Executed= true; elem.Parent.SelectedValue=elem.value; elem.Parent.Controller.Fire(commandName,elem.Parent); return RadEditorNamespace.Utils.CancelEvent(e); } ; inputElement.onchange= function (e){if (!e)e=window.event; return executeFunction(e,this, true); } ; inputElement.onclick= function (e){ this.focus( ); } ; inputElement.onkeypress= function (e){if (!e)e=window.event; if (e.keyCode==13){return executeFunction(e,this ); }} ; this.Element=inputElement; return this.Element; } ; RadEditorNamespace.RadCheckBox= function (toolArgs){ this.Title=toolArgs.Title; this.Controller=toolArgs.Controller; this.Name=toolArgs.Name; this.Document=toolArgs.Document; this.SelectedValue= false; };RadEditorNamespace.RadCheckBox.prototype.Dispose= function ( ){ this.Element.onclick=null; this.Element.Parent=null; this.Element=null; } ; RadEditorNamespace.RadCheckBox.prototype.GetTopElement= function ( ){return this.Element; } ; RadEditorNamespace.RadCheckBox.prototype.GetSelectedValue= function ( ){return this.SelectedValue; } ; RadEditorNamespace.RadCheckBox.prototype.SetValue= function (value){if (this.Element.checked!=value)this.Element.checked=value; } ; RadEditorNamespace.RadCheckBox.prototype.Create= function ( ){var inputElement=this.Document.createElement("\111\x4ePUT"); inputElement.setAttribute("type","CHECKBOX"); inputElement.Parent=this ; inputElement.onclick= function (e){var oP=this.Parent; oP.SelectedValue=!oP.SelectedValue; this.checked=oP.SelectedValue; oP.SelectedValue=this.checked; oP.Controller.Fire(oP.Name,oP); } ; this.Element=inputElement; return this.Element; } ; RadEditorNamespace.RadTargetBox= function (toolArgs){ this.Title=toolArgs.Title; this.Controller=toolArgs.Controller; this.Name=toolArgs.Name; this.Document=toolArgs.Document; this.Width=toolArgs.Width?toolArgs.Width: "\x395px"; this.TargetList=toolArgs.TargetList; this.SelectedValue=""; };RadEditorNamespace.RadTargetBox.prototype.Dispose= function ( ){ this.Element.onchange=null; this.Element.Parent=null; this.TargetList=null; this.Element=null; } ; RadEditorNamespace.RadTargetBox.prototype.GetTopElement= function ( ){return this.Element; } ; RadEditorNamespace.RadTargetBox.prototype.GetSelectedValue= function ( ){return this.SelectedValue; } ; RadEditorNamespace.RadTargetBox.prototype.SetValue= function (value){var options=this.Element.options; for (var i=0; i<options.length; i++){if (options[i].value==value){ this.Element.selectedIndex=i; return; }} this.Element.selectedIndex=-1; } ; RadEditorNamespace.RadTargetBox.prototype.Create= function ( ){var inputElement=this.Document.createElement("\x53ELE\x43\124"); inputElement.className="Rad\x45DropDown"; inputElement.style.width=this.Width; var targetList=this.TargetList; inputElement.options[0]=new Option("\x2d--",""); for (var item in targetList){if (typeof(targetList[item])=="\x73tri\x6e\147"){inputElement.options[inputElement.options.length]=new Option(targetList[item],item); }}inputElement.Parent=this ; var commandName=this.Name; inputElement.onchange= function ( ){ this.Parent.SelectedValue=this.options[this.selectedIndex].value; this.Parent.Controller.Fire(commandName,this.Parent); } ; this.Element=inputElement; return this.Element; } ; RadEditorNamespace.ATTRIBUTE_INSPECTOR_HORIZONTAL_HEIGHT="\x351\x70\x78"; RadEditorNodeInspector.prototype=new RadEditorModuleBase( ); RadEditorNodeInspector.prototype.base=RadEditorModuleBase.prototype.constructor; function RadEditorNodeInspector(moduleArgs){var oName=window.opera?"SP\x41N": "\x44IV"; moduleArgs.ModuleElement=moduleArgs.Document.createElement(oName); this.base(moduleArgs); this.ArrowDropdownUrl=this.Editor.SkinBasePath+"\x42uttons/a\x72rowDrop\x64own.gi\x66"; this.ArrowIconUrl=this.Editor.SkinBasePath+"\x42utt\x6f\x6es/\x61rrowIco\x6e.gif"; this.IsIE=document.all && !window.opera? true : false; this.Controls= {} ; this.ControlNames= {} ; this.SelectedElement=null; this.SelectedElementString=this.GetLocalizedString("\x4eodeIn\x73\x70ec\x74orSelect\x65dEleme\x6et","\x54he \x73\x65le\x63\164\x65d ele\x6dent is\x20"); this.InvalidValueString=this.GetLocalizedString("NodeIns\x70ectorI\x6evalidVa\x6cue","\x49nva\x6c\151\x64 value\x2e\040\x50lease\x20enter \x61\040\x6eumb\x65r."); }
; RadEditorNodeInspector.prototype.GetNamedCssForSelectedElement= function (oVal){return this.Editor.GetNamedCssForSelectedElement(oVal); } ; RadEditorNodeInspector.prototype.OnDispose= function ( ){var controls=this.Controls; for (var ctrlName in controls){var ctrl=controls[ctrlName]; if (ctrl.Dispose){ctrl.Dispose( ); }}var mainTable=this.MainPanel; if (mainTable){for (var rowCount=0; rowCount<mainTable.rows.length; rowCount++){var oRow=mainTable.rows[rowCount]; var len=oRow.cells.length; for (var i=0; i<len; i++){var delTd=oRow.cells[0]; delTd.style.display=""; delTd.parentNode.deleteCell(delTd); }}} this.Controls=null; this.MainPanel=null; } ; RadEditorNodeInspectorAttributesArray=[["ro\x77s","NAME","\x77idt\x68","cellSpa\x63\151\x6eg","align","\x68\162e\x66","\x76alue","\x63lassNa\x6d\145",RadEditorNamespace.RADCOMMAND_SET_TABLE_PROPERTIES,RadEditorNamespace.RADCOMMAND_SET_CELL_PROPERTIES,RadEditorNamespace.RADCOMMAND_SET_LINK_PROPERTIES,RadEditorNamespace.RADCOMMAND_SET_IMAGE_PROPERTIES],["\x63o\x6c\163","id","\150\x65ight","\x61ction","\x63\145l\x6c\x50a\x64\x64in\x67","\x62orde\x72\103\x6f\154o\x72","\x62gCol\x6f\x72","\x62or\x64\145r","\x61lt","noWr\x61\160","\x74arget","\x74itle"]]; RadEditorNodeInspector.prototype.NodeAttributesArray= {} ; RadEditorNodeInspector.prototype.NodeAttributesArray["\x54ABLE"]=["width","cel\x6cSpacing","\x62gColor","\x63las\x73\116a\x6de",RadEditorNamespace.RADCOMMAND_SET_TABLE_PROPERTIES,"heig\x68t","\x63ellPa\x64\x64in\x67","\x61\154i\x67\156","\x62order"]; RadEditorNodeInspector.prototype.NodeAttributesArray["TH"]=RadEditorNodeInspector.prototype.NodeAttributesArray["TD"]=["\x77idth","\x62gCol\x6f\162","c\x6c\141s\x73\116a\x6d\145",RadEditorNamespace.RADCOMMAND_SET_CELL_PROPERTIES,"\x68eigh\x74","\141\x6c\151g\x6e","noWrap"]; RadEditorNodeInspector.prototype.NodeAttributesArray["TR"]=["\x77idt\x68","\x63\154a\x73\163\x4eame","\x68eight"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\x41"]=["href","clas\x73Name",RadEditorNamespace.RADCOMMAND_SET_LINK_PROPERTIES,"t\x69tle","target"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\x49MG"]=["\x77idt\x68","borderC\x6f\154o\x72","\x63las\x73\116a\x6de",RadEditorNamespace.RADCOMMAND_SET_IMAGE_PROPERTIES,"\x68eight","a\x6c\151g\x6e","\x62order","\x61\154t"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\x49NPUT"]=["NA\x4dE","wi\x64th","\x68eight","id","t\x69\164l\x65","va\x6c\165e","\x63lassName"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\106\x4fRM"]=["c\x6cassName","width","he\x69\147h\x74","N\x41\115E","act\x69\157n","id"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\x54EXTA\x52\x45A"]=["class\x4eame","\167\x69dth","\x68eig\x68\164","\x4e\101\x4d\x45","id","\x72ow\x73","c\x6f\154\x73"]; RadEditorNodeInspector.prototype.OnCreate= function ( ){var selfPointer=this ; this.AttachEventHandler(RadEditorNamespace.RADEVENT_SEL_CHANGED, function ( ){selfPointer.UpdateMainPanel( ); } ); var topElem=this.TopElement; topElem.OnRenderVertical=RadEditorNamespace.AttributeInspector_OnRenderVertical; topElem.OnRenderHorizontal=RadEditorNamespace.AttributeInspector_OnRenderHorizontal; topElem.style.height=RadEditorNamespace.ATTRIBUTE_INSPECTOR_HORIZONTAL_HEIGHT; topElem.style.width=this.Editor.Width; } ; RadEditorNodeInspector.prototype.CreateMainPanel= function ( ){var controls=this.Controls; var controlNames=this.ControlNames; var mainPanelArray=RadEditorNodeInspectorAttributesArray; var mainTable=this.Document.createElement("TA\x42LE"); mainTable.border=0; mainTable.cellSpacing=0; mainTable.cellPadding=0; for (var rowCount=0; rowCount<mainPanelArray.length; rowCount++){var curRow=mainPanelArray[rowCount]; var oRow=mainTable.insertRow(-1); for (var i=0; i<curRow.length; i++){var item=curRow[i]; var oCell=oRow.insertCell(-1); oCell.style.display="none"; oCell.setAttribute("contro\x6cName",item); oCell.innerHTML=this.GetLocalizedString(item,item); oCell.className="R\x61dEToolTe\x78\164"; oCell.style.paddingLeft="4px"; oCell=oRow.insertCell(-1); oCell.style.display="\x6eone"; oCell.setAttribute("\x63ontrolHo\x6cder",item); var control=this.GetControlByName(item); if (control){controls[item]=control; oCell.appendChild(control.GetTopElement( )); }}}return mainTable; };RadEditorNodeInspector.prototype.UpdateMainPanel= function ( ){if (!this.IsEnabled)return; if (!this.IsMainCreated){ this.MainPanel=this.CreateMainPanel( ); this.MainPanel.style.display="none"; this.ModuleElement.appendChild(this.MainPanel); this.IsMainCreated= true; }var oElem=this.Editor.GetSelectedElement( ); var T= false; if (oElem){if (this.Editor.SmartForm && this.Editor.SmartForm.isDDFieldElement(oElem)){T= true; }else if (oElem.parentNode && "\x53PAN"==oElem.parentNode.tagName && this.Editor.SmartForm && this.Editor.SmartForm.isDDFieldElement(oElem.parentNode)){T= true; }else if ("\163\x74ring"==typeof oElem.className && oElem.className!=""){var elemClassName=oElem.className; $ektron.each((elemClassName || "").split(/\s+/), function (i,className){if ($ektron.browser.msie && parseInt($ektron.browser.version,10)>=9 && "de\x73ign_sele\x63ted_fi\x65\154\x64"==className){return false; }else if ("desi\x67n_"==className.substr(0,7) || "\x65\x6b\164\x72on_thumb\x6eail"==className){T= true; return false; }} ); }}if (!oElem || oElem.tagName=="BODY" || oElem.ownerDocument!=this.Editor.Document || true ==T){ this.MainPanel.style.display="none"; return; }if (oElem.tagName=="\x54BODY" && this.Editor.IsOpera){oElem=oElem.parentNode; }var controlRow=this.NodeAttributesArray[oElem.tagName]; if (!controlRow){var oCell=RadEditorNamespace.Utils.GetElementParentByTag(oElem,"A"); if (!oCell)oCell=RadEditorNamespace.Utils.GetElementParentByTag(oElem,"\x54D"); if (!oCell)oCell=RadEditorNamespace.Utils.GetElementParentByTag(oElem,"TH"); if (oCell)oElem=oCell; else { this.MainPanel.style.display="\x6eon\x65"; return; }}var tagName=null; if (this.SelectedElement){try {tagName=this.SelectedElement.tagName; }catch (e){ ; }}if (!this.SelectedElement || (tagName!=oElem.tagName)){var editor=this.Editor; var cssDocument=this.Editor.GetDocument( ); var cssControl=this.Controls["\x63lassN\x61\155\x65"]; cssControl.IsCreated= false; cssControl.GetDataFunction= function (name){return editor.GetCssClassesByTagName(oElem.tagName,editor.Document); } ; this.Controls["al\x69gn"].SetTagName(oElem.tagName); } this.SelectedElement=oElem; this.UpdateControlValues(this.SelectedElement); this.MainPanel.style.display=""; } ; RadEditorNodeInspector.prototype.UpdateControlValues= function (oElem){var controlRow=this.NodeAttributesArray[oElem.tagName]; var mainTable=this.MainPanel; var controls=this.Controls; for (var rowCount=0; rowCount<mainTable.rows.length; rowCount++){var oRow=mainTable.rows[rowCount]; for (var i=0; i<oRow.cells.length; i++){var oCell=oRow.cells[i]; var attrName=oCell.getAttribute("contro\x6cName"); if (attrName){oCell.style.display=this.ArrayValueExists(attrName,controlRow)?"": "\x6eone"; }var attrHolder=oCell.getAttribute("\143\x6f\156t\x72olHolde\x72"); if (attrHolder){oCell.style.display=this.ArrayValueExists(attrHolder,controlRow)?"": "\x6eone"; if ("none"==oCell.style.display)continue; var control=controls[attrHolder]; var attr=oElem.getAttribute?oElem.getAttribute(attrHolder): ""; if (attrHolder=="\x6eoWrap"){control.SetValue(oElem.noWrap); }else if (attrHolder=="\x61li\x67\x6e"){control.SetValue(oElem.getAttribute("al\x69gn"),oElem.getAttribute("vAlign")); }else if (attrHolder=="bord\x65rColor" || attrHolder=="w\x69\144\x74\x68" || attrHolder=="\x68eight"){var oVal=oElem.style[attrHolder]; if (!oVal)oVal=oElem.getAttribute(attrHolder); control.SetValue(oVal); }else if ("name"==attrHolder.toLowerCase( )){control.SetValue(oElem.name); }else if (("\x68ref"==attrHolder || "src"==attrHolder) && oElem.getAttribute("\144\x61ta-ekt\x72on-url")){control.SetValue($ektron(oElem).attr("\x64ata-ekt\x72\157\x6e-url")); }else if (attr){control.SetValue(attr); }else if (!this.IsIE && "cl\x61ssName"==attrHolder){var attr=oElem.getAttribute?oElem.getAttribute("class"): ""; if (attr)control.SetValue(attr); }else {if (control.SetValue)control.SetValue(""); }}}}} ; RadEditorNodeInspector.prototype.Fire= function (commandName,oTool){if (!this.Editor.IsEditingEnabled( ))return; var title=this.GetLocalizedString(commandName,commandName); var oElem=this.SelectedElement; if (commandName==RadEditorNamespace.RADCOMMAND_SET_CELL_PROPERTIES || commandName==RadEditorNamespace.RADCOMMAND_SET_TABLE_PROPERTIES || commandName==RadEditorNamespace.RADCOMMAND_SET_IMAGE_PROPERTIES || commandName==RadEditorNamespace.RADCOMMAND_SET_LINK_PROPERTIES){ this.Editor.Fire(commandName,this ); return; }else if ("\x61lign"==commandName){var align=oTool.GetAlign( ); var vAlign=oTool.GetVAlign( ); this.Editor.ExecuteSetAttributeCommand(oElem,"a\x6cign",align,title); title=this.GetLocalizedString("vA\x6cign","\x76Align"); this.Editor.ExecuteSetAttributeCommand(oElem,"vA\x6cign",vAlign,title); }else if ("borderC\x6flor"==commandName){var selValue=oTool.GetSelectedValue( ); this.Editor.ExecuteSetStyleRuleCommand(this.SelectedElement,"borde\x72Color",selValue,title); }else if ("\x77idth"==commandName || "\x68eigh\x74"==commandName){var selValue=oTool.GetSelectedValue( ); if (!this.IsValidAttribValue(selValue)){alert(this.InvalidValueString); return; }function ConvertIntToPixel(oVal){var oNew=""+oVal; if (oNew.indexOf("\x25")!=-1){return oNew; }else {oNew=parseInt(oNew); if (!isNaN(oNew)){oNew=oNew+"\x70x"; return oNew; }}return oVal; }selValue=ConvertIntToPixel(selValue); if (this.SelectedElement.removeAttribute)this.SelectedElement.removeAttribute(commandName); this.Editor.ExecuteSetStyleRuleCommand(this.SelectedElement,commandName,selValue,title); }else {var attribName=commandName; var attribValue=oTool.GetSelectedValue( ); switch (commandName){case RadEditorNamespace.RADCOMMAND_APPLY_CLASS:attribName="c\x6cassName"; break; case RadEditorNamespace.RADCOMMAND_BACKCOLOR:attribName="b\x67\103\x6f\154\x6f\162"; break; case "value":break; case "\x6eoWr\x61\160":if (attribValue)attribValue="\x6eoWr\x61\x70"; else attribValue=""; break; case "\x62order":case "\x63\x65ll\x53\x70a\x63\151\x6eg":case "\143\x65\x6clP\x61\144\x64\151\x6eg":if (!this.IsValidAttribValue(attribValue)){alert(this.InvalidValueString); return; }break; case "src":case "href": this.Editor.ExecuteSetAttributeCommand(oElem,"data-\x65ktron-ur\x6c",attribValue,title); break; case "\x4eAME":if (!this.IsIE)attribName="name"; }var theEditor=this.Editor; setTimeout( function ( ){theEditor.ExecuteSetAttributeCommand(oElem,attribName,attribValue,title); } ,100); } this.Editor.FireEvent(RadEditorNamespace.RADEVENT_SEL_CHANGED); };RadEditorNodeInspector.prototype.GetSelectedValue= function ( ){return this.SelectedElement; } ; RadEditorNodeInspector.prototype.GetIconUrl= function (fileName){return (this.Editor.SkinBasePath+"\x42u\x74\x74ons\x2f"+fileName); } ; RadEditorNodeInspector.prototype.ArrayValueExists= function (value,array){for (var i=0; i<array.length; i++){if (array[i]==value)return true; }return false; } ; RadEditorNodeInspector.prototype.IsValidAttribValue= function (value){if (null==value)return false; value=RadEditorNamespace.Utils.Trim(value); if (""==value)return true; var result=parseInt(value); if (isNaN(result)){return false; }return true; } ; RadEditorNodeInspector.prototype.GetControlByName= function (name){var control=null; var theWidth=null; var editor=this.Editor; var oController=this ; var localiz=this.Localization; var getControllerFn= function ( ){return oController; } ; switch (name){case "cla\x73sName":var toolArgs= {GetController:getControllerFn,Document: this.Document,Name:RadEditorNamespace.RADCOMMAND_APPLY_CLASS,Title: this.Localization[RadEditorNamespace.RADCOMMAND_APPLY_CLASS],ArrowUrl: this.ArrowDropdownUrl,Width: 80,PopupWidth: 180,PopupHeight: 150,CellSpacing: 2,CellPadding: 2,UseCssArray: false ,ClearStyleString:localiz["Cle\x61rStyle"],PopupIconPath: this.Editor.SkinBasePath+"\x49mg/" } ; control=RadEditorNamespace.RadCssCombo.New(toolArgs); control.Create( ); break; case "\x62or\x64\145\x72Color":case "\142\x67\x43olo\x72":var toolArgs= {GetController:getControllerFn,Document: this.Document,Name: "\x62orderCo\x6c\x6fr"==name?"\x62ord\x65\x72Co\x6cor":RadEditorNamespace.RADCOMMAND_BACKCOLOR,AddCustomColor:localiz["\x41ddC\x75\x73to\x6d\103\x6flor"],AddCustomHexColor:localiz["\x41ddCustom\x48exColor"],PromptColor:localiz["\x50romp\x74\103\x6flor"],Title: this.GetLocalizedString(name),ArrowUrl: this.ArrowIconUrl,PopupWidth: 120,PopupHeight: 120,CellSpacing: 1,CellPadding: 1,IconUrl: this.GetIconUrl("B\x61ckColor\x2egif"),AllowCustomColors: this.Editor.AllowCustomColors,GetDataFunction:function (name){return editor.GetDataArrayForTool("BackCol\x6fr"); }} ; control=RadEditorNamespace.RadColorPicker.New(toolArgs); control.Create( ); break; case "align":var toolArgs= {GetController:getControllerFn,Document: this.Document,Name: "align",Title: this.GetLocalizedString("\x61lign","ali\x67\156"),ArrowUrl: this.ArrowIconUrl,SkinBasePath: this.Editor.SkinBasePath,IconUrl: this.GetIconUrl("../Img/\x41lignMidd\x6ceLeft.gi\x66")} ; control=RadEditorNamespace.RadAlignmentSelector.New(toolArgs); control.Create( ); break; case RadEditorNamespace.RADCOMMAND_SET_CELL_PROPERTIES:case RadEditorNamespace.RADCOMMAND_SET_TABLE_PROPERTIES:case RadEditorNamespace.RADCOMMAND_SET_IMAGE_PROPERTIES:case RadEditorNamespace.RADCOMMAND_SET_LINK_PROPERTIES:var toolArgs= {GetController:getControllerFn,Document: this.Document,Name:name,Title: this.Localization[name],IconUrl: this.GetIconUrl(name+"\x2egif")} ; control=RadEditorNamespace.RadToolBase.New(toolArgs); control.Create( ); break; case "target":var targetList= {_blank: this.GetLocalizedString("\x5fblank","_b\x6c\141\x6ek"),_self: this.GetLocalizedString("\x5fself","_sel\x66"),_parent: this.GetLocalizedString("_\x70\141\x72ent","_p\x61\x72en\x74"),_top: this.GetLocalizedString("_t\x6fp","\x5ftop"),_search: this.GetLocalizedString("\x5fsea\x72\x63h","_\x73\145\x61rch"),_media: this.GetLocalizedString("_\x6dedia","_med\x69\141")} ; var toolArgs= {TargetList:targetList,Controller: this,Document: this.Document,Name:name } ; control=new RadEditorNamespace.RadTargetBox(toolArgs); control.Create( ); break; case "no\x57\162\x61\160":var toolArgs= {Controller: this,Document: this.Document,Name:name } ; control=new RadEditorNamespace.RadCheckBox(toolArgs); control.Create( ); break; case "hr\x65f":theWidth=200; case "\x74itle":case "val\x75\145":case "NAME":case "\x61c\x74\x69on":case "\x69d":if (!theWidth)theWidth=110; default:var toolArgs= {Controller: this,Document: this.Document,Name:name,Title: this.Localization[name],Width:theWidth } ; control=new RadEditorNamespace.RadSpinBox(toolArgs); control.Create( ); }return control; } ; RadEditorNamespace.AttributeInspector_OnRenderHorizontal= function ( ){var table=this.getElementsByTagName("TA\x42LE")[0]; var panelRowCount=RadEditorNodeInspectorAttributesArray.length; var currentRowCount=table.rows.length; for (var counter=0; counter<panelRowCount; counter++){var newRow=table.insertRow(table.rows.length); var currentPanelRowCount=RadEditorNodeInspectorAttributesArray[counter].length*2; for (var i=0; i<currentPanelRowCount; i++){var curRow=table.rows[0]; var curCell=curRow.cells[0]; curRow.removeChild(curCell); curRow.parentNode.removeChild(curRow); newRow.appendChild(curCell); }} this.style.display="\x69nli\x6e\x65"; this.style.height=RadEditorNamespace.ATTRIBUTE_INSPECTOR_HORIZONTAL_HEIGHT; };RadEditorNamespace.AttributeInspector_OnRenderVertical= function ( ){var table=this.getElementsByTagName("\x54ABLE")[0]; var rowCount=table.rows.length; for (var i=0; i<rowCount; i++){var curRow=table.rows[0]; var cellCount=curRow.cells.length; for (var j=0; j<cellCount; j++){var cell=curRow.cells[0]; var newRow=table.insertRow(table.rows.length); curRow.removeChild(cell); newRow.appendChild(cell); }curRow.parentNode.removeChild(curRow); } this.style.display="\x62l\x6f\x63k"; };
o3.prototype=new RadEditorModuleBase( ); o3.prototype.base=RadEditorModuleBase.prototype.constructor; function o3(moduleArgs){var theDiv=moduleArgs.Document.createElement("\104IV"); moduleArgs.ModuleElement=theDiv.cloneNode( true); this.base(moduleArgs); this.EnableMaxWidth= false; this.O3=this.GetLocalizedString("\x53ta\x74\151\x73ticsWo\x72ds","Wor\x64\163\x3a"); this.l3=this.GetLocalizedString("\x53tatis\x74\x69cs\x43haracte\x72s","C\x68\141\x72acters\x3a"); }
; o3.prototype.OnCreate= function ( ){var selfPointer=this ; this.AttachEventHandler(RadEditorNamespace.RADEVENT_SEL_CHANGED, function ( ){selfPointer.i3( ); } ); if (this.Editor.Document.body)this.AttachEventHandler("o\x6eblur", function ( ){selfPointer.i3( ); } ); var isEnabled=this.IsEnabled; this.IsEnabled= true; this.i3( ); this.IsEnabled=isEnabled; } ; o3.prototype.i3= function ( ){if (!this.IsEnabled || !this.Editor.Document.body)return; var content=this.Editor.GetText( ); var I3=0; var o4=0; if (content){O4=/[\x21\x2e\x3f\x3b\x2c\x3a\x26\x5f\x2d\x7b\x7d\x5b\x5d\x28\x29\x7e\x23\x27\x22]/g; content=content.replace(O4,""); l4=/(^\s+)|(\s+$)/g; content=content.replace(l4,""); if (content){i4=/\s+/; var array=content.split(i4); I3=array.length; o4=content.length; }} this.ModuleElement.innerHTML="\074span \x73\164\x79le=\047\x6cin\x65-heigh\x74:22px\047>"+this.O3+" "+I3+"\040"+this.l3+"\x20"+o4+"&nbsp;\074/span>"; } ;
if (typeof(RadEditorXhtmlValidatorDocTypes)=="u\x6e\144\x65fined"){RadEditorXhtmlValidatorDocTypes= { "\130\x48TML 1.0 \x53trict": ["!\x44OCTYPE \x68tml PUBL\x49C \042-//W3\x43//DTD\x20\130\x48TML 1\x2e0 Str\x69ct//E\x4e\042\x20\042\x68tt\x70://ww\x77.w3.o\x72g/TR\x2fxhtm\x6c1/DTD\x2fxhtml\x31-str\x69ct.d\x74d\042", false],"XH\x54ML 1.0 T\x72\141\x6e\163\x69\164\x69onal": ["!DOC\x54\131\x50\105\x20\x68tm\x6c PUBLI\x43\040\x22-//W3\x43//DTD\x20XHTM\x4c\040\x31.0 T\x72ansit\x69onal/\x2fEN\042\x20\042\150\x74tp:\x2f/www.\x773.org\x2fTR/x\x68tml1\x2fDTD/x\x68tml1-\x74rans\x69tion\x61l.dt\x64\042", false],"XHT\x4d\114\x20\x31.1": ["!DOC\x54\131P\x45 html PU\x42LIC \042-//W3C/\x2fDTD XH\x54ML 1.1\x2f/EN\x22 \042\x68ttp\x3a//www\x2ew3.or\x67/TR/x\x68tml11\x2fDTD/\x78html1\x31.dtd\x22", false] } ; }RadEditorXhtmlValidator.prototype=new RadEditorModuleBase( ); RadEditorXhtmlValidator.prototype.base=RadEditorModuleBase.prototype.constructor; function RadEditorXhtmlValidator(moduleArgs){moduleArgs.ModuleElement=moduleArgs.Document.createElement("di\x76"); this.base(moduleArgs); }
; RadEditorXhtmlValidator.prototype.OnCreate= function ( ){ this.CreateHeader( ); this.CreateIframe( ); this.ModuleElement.appendChild(this.Iframe); } ; RadEditorXhtmlValidator.prototype.OnDispose= function ( ){if (this.ValidateButton){ this.ValidateButton.onclick=null; this.ValidateButton=null; }if (this.ToggleCheckbox){ this.ToggleCheckbox.onclick=null; this.ToggleCheckbox=null; } this.ContentField=null; this.DoctypeField=null; this.DoctypeSelect=null; this.ValidateForm=null; RadEditorNamespace.Utils.DetachEventEx(this.Iframe,"load",this.IframeLoadingFun); this.Iframe=null; } ; RadEditorXhtmlValidator.prototype.Validate= function ( ){oFinalContent="\074div>"+this.Editor.getContent( )+"\074\057\x64\151\x76>"; this.ContentField.value=oFinalContent; this.ShowIframe( true); if (this.ToggleCheckbox && !this.ToggleCheckbox.checked)this.ToggleCheckbox.checked= true; if (this.DoctypeSelect && this.DoctypeSelect.selectedIndex>-1){ this.DoctypeField.value="\x3c"+this.DoctypeSelect.options[this.DoctypeSelect.selectedIndex].value+">"; } this.ValidateForm.submit( ); } ; RadEditorXhtmlValidator.prototype.ShowIframe= function (toShow){var iframe=this.Iframe; if (toShow){iframe.style.width="9\x39%"; var oHeight=400; iframe.style.height=oHeight+"\160\x78"; this.Editor.FixIeHeight(iframe,oHeight); iframe.style.border="\x31px \x72\x69dg\x65 #aaaaa\x61"; }else {iframe.style.width="\x30p\x78"; iframe.style.height="0px"; iframe.style.border="0px\x20ridge #a\x61aaaa"; }} ; RadEditorXhtmlValidator.prototype.CreateIframe= function ( ){var iframe=document.createElement("ifram\x65"); this.Iframe=iframe; iframe.frameBorder='\060'; iframe.src=this.Editor.RadControlsDir+"\x45ditor/X\x68\x74m\x6c\057\x58htmlV\x61\154\x69dator.\x61\163\x70x"; iframe.style.margin="\061\x70x"; this.ShowIframe( false); var oModule=this ; var oFun= function ( ){var oDoc=oModule.Iframe.contentWindow.document; oModule.ContentField=oDoc.getElementById("\x45ditor\x43\157\x6etent"); oModule.DoctypeField=oDoc.getElementById("\x45di\x74\157\x72Doctyp\x65"); oModule.ValidateForm=oDoc.forms["\x52adEdi\x74\x6fr\x58\150\x74mlFo\x72\155"]; } ; this.IframeLoadingFun=oFun; RadEditorNamespace.Utils.AttachEventEx(iframe,"load",this.IframeLoadingFun); iframe=null; } ; RadEditorXhtmlValidator.prototype.CreateHeader= function ( ){var oModule=this ; var oBut=document.createElement("input"); oBut.type="b\x75tton"; oBut.className="RadEXhtm\x6cButton"; oBut.onclick= function ( ){oModule.Validate( ); oModule.CheckboxChecked= true; };oBut.value=this.GetLocalizedString("Va\x6cidateXH\x54ML","Validat\x65\040\x58HTML"); var oCheckbox=document.createElement("\x49NPUT"); oCheckbox.setAttribute("\x74ype","\x63heckb\x6f\170"); oCheckbox.style.marginBottom="2px"; this.CheckboxChecked= false; oCheckbox.onclick= function ( ){oModule.CheckboxChecked=!oModule.CheckboxChecked; this.checked=oModule.CheckboxChecked; oModule.ShowIframe(oModule.CheckboxChecked); } ; this.ModuleElement.appendChild(oCheckbox); this.ToggleCheckbox=oCheckbox; var oSpan=document.createElement("sp\x61n"); oSpan.style.height="\x316px"; oSpan.onclick=new Function('\x74hi\x73\x2epr\x65viousSi\x62\154\x69ng.c\x6c\151\x63\153\x28)'); oSpan.innerHTML=this.GetLocalizedString("Exp\x61ndValida\x74\157\x72","Expand\x2f\x43ol\x6c\141p\x73e Vali\x64ator")+" &\x6e\142s\x70\073\x20| &nbsp\x3b"; this.ModuleElement.appendChild(oSpan); var oSpan=document.createElement("\x73pan"); oSpan.innerHTML=this.GetLocalizedString("F\x6frmSelect","Select")+":"; this.ModuleElement.appendChild(oSpan); var oSelect=document.createElement("\163\x65lect"); oSelect.className="\x52ad\x45\104\x72opDown"; oSelect.style.width="\x3140px"; var doctypeList=RadEditorXhtmlValidatorDocTypes; for (var item in doctypeList){var newOption=new Option(item,doctypeList[item][0]); if (doctypeList[item][1]){newOption.selected= true; }oSelect.options[oSelect.options.length]=newOption; }oSelect.style.display="n\x6fne"; if (this.Editor.IsIE && "co\x6dplete"!=document.readyState){RadEditorNamespace.Utils.AttachEventEx(window,"lo\x61d", function ( ){oModule.DoctypeSelect.style.display=""; } ); }else oSelect.style.display=""; this.ModuleElement.appendChild(oSelect); this.ModuleElement.appendChild(oBut); this.ValidateButton=oBut; this.DoctypeSelect=oSelect; oBut=null; oSpan=null; oCheckbox=null; oSelect=null; } ;
function RadEditorModuleBase(moduleArgs){if (!moduleArgs)return; this.Editor=moduleArgs.Editor; this.IsIE=this.Editor.IsIE; this.IsOpera=this.Editor.IsOpera; this.Localization=this.Editor.Localization; this.Document=moduleArgs.Document; this.ModuleElement=moduleArgs.ModuleElement; this.Title=moduleArgs.Title; this.Id=moduleArgs.Id; this.ModuleElement.className=moduleArgs.ClassName?moduleArgs.ClassName: "\x52\x61dEModu\x6ce"; this.TopElement=null; this.EventHandlerQueue= {} ; this.IsCreated= false; this.IsEnabled= false; this.IsDockable=moduleArgs.IsDockable; this.InitialDockingZoneId=moduleArgs.InitialDockingZoneId; this.VisibleDisplay=null; this.EnableMaxWidth= true; }RadEditorModuleBase.prototype.GetTopElement= function ( ){if (!this.IsCreated)this.Create( ); return this.TopElement; } ; RadEditorModuleBase.prototype.SetVisible= function (visible){if (visible && !this.IsEnabled)return; var oElem=this.GetTopElement( ); if (visible){if (oElem.Show){oElem.Show( ); }else oElem.style.display=this.VisibleDisplay; }else {if (oElem.Hide)oElem.Hide( ); else oElem.style.display="\x6eone"; }} ; RadEditorModuleBase.prototype.OnModuleResize= function ( ){if (!window.event)return; var src=window.event.srcElement; if (src.tagName!="TABLE")return; if (src && null!=src.IsDocked){if (!src.IsDocked( )){src.ShowOverlay( ); }}} ; RadEditorModuleBase.prototype.CreateDockableWrapper= function ( ){var oTable=RadEditorNamespace.Utils.GetPlainTable(document); oTable.insertRow(-1); if (this.IsDockable){oTable.width="100%"; }var oCell=oTable.rows[0].insertCell(-1); oCell.innerHTML="\x3cspan s\x74\x79l\x65=\047\x66\x6fnt-siz\x65\072\x31px;li\x6ee-he\x69ght:\x30\160\x78;\047\x3e&n\x62sp;\074\057\x73pan>"; oCell.setAttribute("heig\x68t","1\x30\060\x25"); oCell.appendChild(this.ModuleElement); if (this.IsDockable && RadEditorNamespace.Docking){var newTable=RadEditorNamespace.Docking.WrapInDockingContainer(oTable,this.IsVertical,RadEditorNamespace.RadEditorModule_RenderHorizontal,RadEditorNamespace.RadEditorModule_RenderVertical,"RadEMod\x75leTable","\x52adEMod\x75\x6ceT\x61ble",this.Title); oTable=newTable; } this.VisibleDisplay=this.IsIE && !this.IsOpera?"\x69nline": ""; oTable.className="R\x61dEModule\x54\141\x62le"; if (!this.IsIE){oTable.setAttribute("styl\x65","float\x3a\154e\x66t"); }if (this.Editor.IsIE && oTable.attachEvent){oTable.attachEvent("\157\x6eresize",RadEditorModuleBase.prototype.OnModuleResize); }return oTable; } ; RadEditorModuleBase.prototype.Dispose= function ( ){for (var i in this.EventHandlerQueue){ this.DetachEventHandler(i); this.EventHandlerQueue[i]=null; } this.EventHandlerQueue=null; try {if (this.OnDispose)this.OnDispose( ); }catch (e){alert("\x44ispo\x73\x65 \x66\141\x69led f\x6f\162\x20"+this.Title+" - "+e.message); }if (this.TopElement){ this.TopElement.OnRenderVertical=null; this.TopElement.OnRenderHorizontal=null; this.TopElement.OnResize=null; this.TopElement.OnUndock=null; this.TopElement.OnDock=null; this.TopElement=null; } this.ModuleElement=null; this.Editor=null; } ; RadEditorModuleBase.prototype.SetEnabled= function (enabled){ this.IsEnabled=enabled; this.SetVisible(enabled); } ; RadEditorModuleBase.prototype.Create= function ( ){ this.TopElement=this.CreateDockableWrapper( ); var module=this ; this.IsCreated= true; if (this.OnCreate){ this.OnCreate( ); }return this.TopElement; } ; RadEditorNamespace.RadEditorModule_RenderHorizontal= function ( ){ this.style.width=""; if (this.OnRenderHorizontal!=null){ this.OnRenderHorizontal( ); }} ; RadEditorNamespace.RadEditorModule_RenderVertical= function ( ){ this.style.width="\061\x300\x70\x78"; if (this.OnRenderVertical!=null){ this.OnRenderVertical( ); }} ; RadEditorModuleBase.prototype.GetLocalizedString= function (key,defaultValue){var moduleName=typeof(this ).toString( ); var str=this.Localization[key]; return str!=null?str:defaultValue; } ; RadEditorModuleBase.prototype.AttachEventHandler= function (eventName,eventHandler){ this.EventHandlerQueue[eventName]=eventHandler; this.Editor.AttachEventHandler(eventName,this.EventHandlerQueue[eventName]); } ; RadEditorModuleBase.prototype.DetachEventHandler= function (eventName){ this.Editor.DetachEventHandler(eventName,this.EventHandlerQueue[eventName]); } ; RadEditorModuleBase.prototype.OnCreate= function ( ){} ; RadEditorModuleBase.prototype.OnDispose= function ( ){} ;
RadEditor.prototype.SetModulesVisible= function (setVisible){var modules=this.Modules; for (var count=0; count<modules.length; count++){modules[count].SetVisible(setVisible); }} ; RadEditor.prototype.LoadModules= function (theEditor){var oModuleLength=theEditor.DefaultModulesArray.length; if (oModuleLength>0){for (var i=0; i<oModuleLength; i++){var curModule=theEditor.DefaultModulesArray[i]; var arg=0; var moduleName=curModule[arg++]; var dockingZone=curModule[arg++]; var dockable=curModule[arg++]; var visible=curModule[arg++]; var controlPage=curModule[arg++]; var scriptFile=curModule[arg++]; var params=curModule[arg++]; var id=null; try {theEditor.LoadModule(moduleName,dockingZone,dockable,visible,id); }catch (e){} ; }var attachModuleHandlers= function (editor){editor.AttachEventHandler(RadEditorNamespace.RADEVENT_MODE_CHANGED, function ( ){var setVisible=(editor.Mode==RadEditorNamespace.RADEDITOR_DESIGN_MODE); editor.SetModulesVisible(setVisible); } ); editor.AttachEventHandler(RadEditorNamespace.RADEVENT_SIZE_CHANGED, function ( ){var oLength=editor.Modules.length; for (var i=0; i<oLength; i++){var oModule=editor.Modules[i]; oModule.UpdateDockedSize( ); }} ); } ; attachModuleHandlers(theEditor); }} ; RadEditor.prototype.LoadModule= function (moduleName,dockingZone,dockable,setVisible,id){var localizedName=this.GetLocalizedString(moduleName,moduleName); var moduleArgs= {Editor: this,Document:document,Title:localizedName,Id:id,InitialDockingZoneId:dockingZone,IsDockable:dockable && this.EnableDocking } ; eval("\x76ar mod\x75\x6ce\x20= new "+moduleName+"\x28mod\x75\154\x65Args)"); this.Modules[this.Modules.length]=module; var theEditor=this ; if (!module.IsCreated){var topElement=module.Create( ); var parentNode=this.GetDockingZoneById(module.InitialDockingZoneId); parentNode.appendChild(topElement); if (module.IsDockable){theEditor.MakeDockable(topElement); }module.SetEnabled(setVisible); if (setVisible)$ektron(parentNode).parent( ).show( ); theEditor.ResetSize( ); }module.TopElement.OnUndock= function ( ){module.Editor.ResetSize( ); module.TopElement.style.width=""; module.TopElement.width=""; };module.TopElement.OnDock= function ( ){module.Editor.ResetSize( ); module.UpdateDockedSize( ); };module.UpdateDockedSize= function ( ){var oModule=this ; var toResize= false; if (!oModule.IsDockable){var oElem=oModule.GetTopElement( ); if (oElem && oElem.parentNode && !oModule.Editor.IsZoneVertical(oElem.parentNode)){toResize= true; }}else {var oElem=oModule.GetTopElement( ); if (oElem.IsDocked && oElem.IsDocked( ) && !oElem.IsVertical)toResize= true; }if (toResize && oModule.EnableMaxWidth && oModule.TopElement){var oElem=oModule.TopElement; var oParent=oElem.parentNode; if (oParent && oParent.style.width=="100\x25"){oElem.parentNode.style.width="\x3100\x25"; }oElem.style.width="\x3100%"; if (oElem.Show && oElem.IsVisible && oElem.IsVisible( ))oElem.Show( ); }};return module; } ; RadEditor.prototype.GetModules= function ( ){return this.Modules; } ;
RadEditorNamespace.RadAlignmentSelector= {New:function (toolArgs){toolArgs.ClassName="Rad\x45\x54oolLon\x67"; toolArgs.PopupWidth=73; toolArgs.PopupHeight=85; toolArgs.CellSpacing=2; toolArgs.CellPadding=2; toolArgs.PopupClassName="\x52adAl\x69\147\x6ementS\x65lecto\x72Table"; var obj=RadEditorNamespace.RadComboBoxBase.New(toolArgs); RadEditorNamespace.Utils.ExtendObject(obj,this ); obj.TagName=""; obj.ActiveAlignmentArray=null; obj.SelectedTuple=null; obj.NoAlignmentIndex=-1; obj.SkinBasePath=toolArgs.SkinBasePath; obj.ItemsPerRow=3; obj.IsPopupScrollable= false; return obj; } ,ImgAlignment: [["",""],["none",""],["",""],["",""],["top",""],["",""],["left",""],["a\x62smiddle",""],["right",""],["",""],["\x62ottom",""],["",""]],CellAlignment: [["",""],["none",""],["",""],["left","\x74op"],["\x63enter","\x74op"],["righ\x74","top"],["left","\x6didd\x6c\145"],["\143\x65\156t\x65r","\x6d\151d\x64\154\x65"],["r\x69ght","middle"],["left","bottom"],["\x63enter","botto\x6d"],["right","bott\x6fm"]],TableAlignment: [["",""],["non\x65",""],["",""],["left",""],["\143\x65nter",""],["rig\x68t",""],["",""],["",""],["",""],["",""],["",""],["",""]],CaptionIEAlignment: [["",""],["none",""],["",""],["lef\x74","\x74op"],["center","\x74op"],["\x72ight","top"],["",""],["",""],["",""],["l\x65\146\x74","bottom"],["\x63enter","bott\x6fm"],["\x72igh\x74","bottom"]],CaptionNSAlignment: [["",""],["n\x6fne",""],["",""],["",""],["","\x74op"],["",""],["",""],["",""],["",""],["",""],["","bottom"],["",""]],AlignmentImages: ["\170\x2egif","\x78.gif","\x78\056\x67if","\x41lign\x54\157\x70Left.gi\x66","\x41\154i\x67\156\x54\157\x70\103\x65nter.g\x69\146","AlignTop\x52\151\x67ht.gif","AlignM\x69ddleLef\x74\056\x67if","Alig\x6eMiddleCe\x6eter.gif","AlignMid\x64\154\x65\122i\x67ht.gif","Al\x69\x67nB\x6f\164\x74\x6fmL\x65ft.gif","Al\x69\147\x6e\x42ot\x74omCente\x72.gif","\x41lignB\x6f\164\x74omRight.\x67if"],SetTagName:function (tagName){ this.TagName=tagName; this.ActiveAlignmentArray=this.GetLookupTableByTagName(this.TagName); this.OnCellClick(this.NoAlignmentIndex); } ,GetLookupTableByTagName:function (tagName){switch (tagName.toUpperCase( )){case "IMG":return this.ImgAlignment; case "\x54A\x42\x4cE":return this.TableAlignment; case "TD":return this.CellAlignment; case "TH":return this.CellAlignment; case "\103\x41PTION":return (this.IsIE?this.CaptionIEAlignment: this.CaptionNSAlignment); default:return null; }} ,ConfigureAlignmentTable:function (tagName){var table=this.PopupBodyElement; var count=0; for (var i=0; i<table.rows.length; i++){var isRowVisible= false; for (var j=0; j<table.rows[i].cells.length; j++){var cell=table.rows[i].cells[j]; var isCellVisible=this.IsAvailable(count++); cell.style.visibility=isCellVisible?"\x76isible": "\x68idd\x65\x6e"; isRowVisible |= isCellVisible; }if (null!=document.all){table.rows[i].style.display=isRowVisible?"": "\x6eone"; }}} ,IsAvailable:function (index){var isVisible= false; if (this.ActiveAlignmentArray){var alignment=this.ActiveAlignmentArray[index]; isVisible=((null!=alignment) && (""!=alignment[0] || ""!=alignment[1])); }return isVisible; } ,SetButtonImage:function (imgFileName){var oElem=this.GetTopElement( ).getElementsByTagName("\x49M\x47")[0]; oElem.src=this.SkinBasePath+"\x49mg/"+imgFileName; oElem.style.margin="4px"; } ,OnCellClick:function (index){if (index==this.NoAlignmentIndex){ this.SelectedTuple=""; this.SetButtonImage("\x78.gif"); }else {if (this.ActiveAlignmentArray && 0<=index && index<this.ActiveAlignmentArray.length){ this.SelectedTuple=this.ActiveAlignmentArray[index]; this.SetButtonImage(this.AlignmentImages[index]); if (""!=this.ClientClickString)eval(this.ClientClickString); }}} ,SelectAlignment:function (align,vAlign){align=(""==align || !align)?"none":align.toUpperCase( ); vAlign=!vAlign?"":vAlign.toUpperCase( ); if (this.ActiveAlignmentArray){var selIndex=-1; for (i=0; i<this.ActiveAlignmentArray.length; i++){if (this.IsAvailable(i)){var ha=this.ActiveAlignmentArray[i][0].toUpperCase( ); var va=this.ActiveAlignmentArray[i][1].toUpperCase( ); if (-1==selIndex){selIndex=i; }if ((align==ha || align==va) && (vAlign==ha || vAlign==va)){ this.OnCellClick(i); return; }}} this.OnCellClick(selIndex); }} ,SetValue:function (align,vAlign){ this.SelectAlignment(align,vAlign); } ,GetAlign:function ( ){var value=(this.SelectedTuple?this.SelectedTuple[0]: ""); if ("\x6eone"==value){value=""; }return value; } ,GetVAlign:function ( ){var value=(this.SelectedTuple?this.SelectedTuple[1]: ""); if ("\156\x6fne"==value){value=""; }return value; } ,OnBeforeShowPopup:function ( ){if (!this.ItemsCreated){ this.CreateItems( ); this.ItemsCreated= true; } this.ConfigureAlignmentTable(this.TagName); } ,CreateItems:function ( ){var oTable=this.PopupBodyElement; var oRow=null; var curRowItems=0; var arrayLength=this.AlignmentImages.length; for (var i=0; i<arrayLength; i++){if (0==i%this.ItemsPerRow){oRow=oTable.insertRow(-1); curRowItems=0; }curRowItems++; this.AddAlignmentCell(oRow,i); }} ,AddAlignmentCell:function (oRow,index){var oCell=oRow.insertCell(-1); oCell.RadClassOver="Over"; oCell.RadClassOut=""; oCell.onmouseout=RadEditorNamespace.OnItemMouseOut; oCell.onmouseover=RadEditorNamespace.OnItemMouseOver; var oImg=this.Popup.CreateElement("img"); oImg.align="absMidd\x6ce"; oImg.border="\x30"; oImg.src=this.SkinBasePath+"Img/"+this.AlignmentImages[index]; oCell.appendChild(oImg); this.ConfigureCell(oCell,this,index); return oCell; }} ;

