RadEditorDomInspector.prototype=new RadEditorModuleBase( ); RadEditorDomInspector.prototype.base=RadEditorModuleBase.prototype.constructor; var DOM_INSPECTOR_HORIZONTAL_HEIGHT="2\x30\x70x"; var DOM_INSPECTOR_VERTICAL_HEIGHT="80px"; function RadEditorDomInspector(moduleArgs){var theDiv=moduleArgs.Document.createElement("DIV"); theDiv.style.paddingTop="\x32p\x78"; 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("\x44omInsp\x65\143\x74orR\x65\155\x6fveEl\x65\155\x65\156\x74","Re\x6d\157v\x65\040\x45lemen\x74"); }
; 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("A"); domLink.innerHTML=this.RemoveElementString; domLink.href="ja\x76ascript\x3avoid(0)"; domLink.className="\x44om\x50\x61th\x4cink"; domLink.Parent=this ; domLink.onmousedown=new Function("this\x2eParent.\x52emoveSe\x6c\145\x63ted\x45\154\x65\155\x65nt()\x3bretur\x6e fals\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("SPA\x4e"); empty.innerHTML="&nbsp;> "; this.ModuleElement.appendChild(empty); var couple=new DomCouple(domLink,domElement,(isSelected?"\x44omPath\x4c\151\x6ekSelec\x74ed": ""),isSelected,this ); return couple; } ; RadEditorDomInspector.prototype.Clear= function ( ){if (this.SelectedDomCouple){ this.SelectedDomCouple.Clear( ); }var links=this.ModuleElement.getElementsByTagName("\x41"); 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=="\x54H"){ this.Editor.DeleteCell( ); }else if (elem.tagName=="TR"){ this.Editor.DeleteRow( ); }else if (elem.tagName=="TABLE" || elem.tagName=="TBOD\x59" || elem.tagName=="\x54HEA\x44" || elem.tagName=="TFOOT" || elem.tagName=="EMB\x45D" || elem.tagName=="\117\x42JECT" || elem.tagName=="\x49NPUT" || elem.tagName=="IMG" || 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!="\x42ODY"){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="jav\x61script:v\x6fid(0);"; domLink.className=className?className: "Dom\x50\141\x74\150\x4c\151\x6e\153"; domLink.Parent=this ; domLink.onclick=new Function("thi\x73.Paren\x74.SelectE\x6c\145\x6dent(\x29;"); domLink.onmouseover=new Function("\x74his.P\x61\x72e\x6e\x74.o\x6emouseov\x65r();"); domLink.onmouseout=new Function("\x74hi\x73\056\x50aren\x74\056\x6fnmouse\x6f\165\x74();"); if (domElement!=null){domLink.innerHTML=domElement.tagName; }}}
; DomCouple.prototype.Clear= function ( ){ this.RadEditorDomInspector.SelectedDomCouple=null; this.DomLink.className="\x44o\x6d\x50at\x68\114\x69nk"; } ; DomCouple.prototype.onmouseover= function ( ){if (this.Selected)return; try { this.DomElementClass=this.DomElement.className; this.DomElement.className+="\x20RadE\x44\157\x6dMous\x65Over"; }catch (e){ ; }} ; DomCouple.prototype.onmouseout= function ( ){if (null!=this.DomElementClass)this.DomElement.className=this.DomElementClass; try {if (""==this.DomElement.className){ this.DomElement.removeAttribute("\x63lass\x4e\x61m\x65",0); this.DomElement.removeAttribute("\x63l\x61\x73s",0); }}catch (e){ ; }} ; DomCouple.prototype.SelectElement= function ( ){ this.onmouseout( ); if (this.RadEditorDomInspector.SelectedDomCouple){ this.RadEditorDomInspector.SelectedDomCouple.Clear( ); } this.DomLink.className="DomPa\x74hLinkSe\x6cected"; 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("\x54\x45XTA\x52\105\x41"); moduleArgs.ModuleElement=txtArea; txtArea.style.width="99\x25"; moduleArgs.ClassName="\x52ad\x45\x54ex\x74\101\x72ea"; this.base(moduleArgs); this.ModuleElement.setAttribute("\162\x6fws","\x310"); this.ModuleElement.setAttribute("\143\x6fls","\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)+"p\x78"; };} ; RadEditorHtmlInspector.prototype.UpdateContentArea= function (e){if (!this.IsEnabled)return; this.Flag= true; this.Editor.SetHtml(this.ModuleElement.value,this.Localization['Typi\x6eg'], 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)+"\x70\x78": "\x350px"; 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("I\x4ePUT"); 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){if (isSecondToExecute){if (elem.Executed){elem.Executed= false; return RadEditorNamespace.Utils.CancelEvent(e); }}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("\x49NPUT"); inputElement.setAttribute("\x74ype","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: "\x395p\x78"; 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="\122\x61dEDropDo\x77n"; inputElement.style.width=this.Width; var targetList=this.TargetList; inputElement.options[0]=new Option("\x2d--",""); for (var item in targetList){if (typeof(targetList[item])=="\x73tring"){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="51px"; RadEditorNodeInspector.prototype=new RadEditorModuleBase( ); RadEditorNodeInspector.prototype.base=RadEditorModuleBase.prototype.constructor; function RadEditorNodeInspector(moduleArgs){var oName=window.opera?"S\x50AN": "\x44IV"; moduleArgs.ModuleElement=moduleArgs.Document.createElement(oName); this.base(moduleArgs); this.ArrowDropdownUrl=this.Editor.SkinBasePath+"Butto\x6es/arrow\x44ropdown\x2egif"; this.ArrowIconUrl=this.Editor.SkinBasePath+"\x42ut\x74\157\x6es/arrow\x49con.gi\x66"; this.IsIE=document.all && !window.opera? true : false; this.Controls= {} ; this.ControlNames= {} ; this.SelectedElement=null; this.SelectedElementString=this.GetLocalizedString("\x4eodeIns\x70\x65ct\x6f\162\x53ele\x63tedElem\x65nt","The \x73\x65le\x63\164\x65\144\x20\145\x6c\145\x6d\145\x6et is "); this.InvalidValueString=this.GetLocalizedString("N\x6fdeInspec\x74orInvali\x64Value","I\x6evalid val\x75e. Pleas\x65 enter \x61 number\x2e"); }
; 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=[["row\x73","\x4eAME","\x77idth","\x63ellSpac\x69\156\x67","\x61lign","\x68ref","\x76alue","\x63lassNam\x65",RadEditorNamespace.RADCOMMAND_SET_TABLE_PROPERTIES,RadEditorNamespace.RADCOMMAND_SET_CELL_PROPERTIES,RadEditorNamespace.RADCOMMAND_SET_LINK_PROPERTIES,RadEditorNamespace.RADCOMMAND_SET_IMAGE_PROPERTIES],["cols","\x69d","hei\x67\x68t","\x61ction","\x63\145\x6c\x6cPa\x64ding","\x62\157r\x64\145\x72\103\x6f\154\x6fr","\x62gCo\x6c\157r","border","\x61lt","\x6eoWr\x61\160","\x74ar\x67\x65t","title"]]; RadEditorNodeInspector.prototype.NodeAttributesArray= {} ; RadEditorNodeInspector.prototype.NodeAttributesArray["TAB\x4cE"]=["wid\x74h","\x63ell\x53\160a\x63ing","b\x67\103\x6f\x6cor","\x63\x6cas\x73\x4eam\x65",RadEditorNamespace.RADCOMMAND_SET_TABLE_PROPERTIES,"he\x69ght","\x63ellP\x61\144\x64ing","ali\x67\156","\x62ord\x65\162"]; RadEditorNodeInspector.prototype.NodeAttributesArray["T\x48"]=RadEditorNodeInspector.prototype.NodeAttributesArray["\x54D"]=["wid\x74h","bgC\x6f\154o\x72","\x63las\x73\116a\x6de",RadEditorNamespace.RADCOMMAND_SET_CELL_PROPERTIES,"heigh\x74","\x61lign","\x6eoWrap"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\x54R"]=["\x77idth","\x63lassNa\x6d\x65","\x68eigh\x74"]; RadEditorNodeInspector.prototype.NodeAttributesArray["A"]=["\x68ref","\x63las\x73\x4eam\x65",RadEditorNamespace.RADCOMMAND_SET_LINK_PROPERTIES,"\x74itle","targe\x74"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\x49MG"]=["\x77\151\x64\164\x68","\x62or\x64\x65rCo\x6cor","classNam\x65",RadEditorNamespace.RADCOMMAND_SET_IMAGE_PROPERTIES,"\x68eig\x68\164","\x61\154i\x67\x6e","border","\x61lt"]; RadEditorNodeInspector.prototype.NodeAttributesArray["IN\x50UT"]=["NAME","\167\x69\144t\x68","\x68eigh\x74","\x69d","titl\x65","value","\x63lassN\x61\x6de"]; RadEditorNodeInspector.prototype.NodeAttributesArray["FORM"]=["\x63la\x73\163\x4eame","\167\x69dth","hei\x67\x68t","\x4eAME","\x61\143t\x69\157\x6e","id"]; RadEditorNodeInspector.prototype.NodeAttributesArray["\x54EX\x54\101R\x45A"]=["\x63lass\x4e\141\x6de","width","he\x69\147h\x74","N\x41\x4dE","i\x64","ro\x77\163","\x63ols"]; 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("\124\x41BLE"); 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="no\x6ee"; oCell.setAttribute("contr\x6f\154\x4eame",item); oCell.innerHTML=this.GetLocalizedString(item,item); oCell.className="R\x61dEToolT\x65\170\x74"; oCell.style.paddingLeft="4p\x78"; 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 ("string"==typeof oElem.className && oElem.className!=""){var elemClassName=oElem.className; $ektron.each((elemClassName || "").split(/\s+/), function (i,className){if ("\x64esi\x67\x6e_"==className.substr(0,7)){T= true; return false; }} ); }}if (!oElem || oElem.tagName=="\x42OD\x59" || oElem.ownerDocument!=this.Editor.Document || true ==T){ this.MainPanel.style.display="none"; return; }if (oElem.tagName=="TBODY" && 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,"TD"); if (!oCell)oCell=RadEditorNamespace.Utils.GetElementParentByTag(oElem,"TH"); if (oCell)oElem=oCell; else { this.MainPanel.style.display="no\x6ee"; 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["classN\x61me"]; cssControl.IsCreated= false; cssControl.GetDataFunction= function (name){return editor.GetCssClassesByTagName(oElem.tagName,editor.Document); } ; this.Controls["\x61lign"].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("\x63ontrolN\x61\155\x65"); if (attrName){oCell.style.display=this.ArrayValueExists(attrName,controlRow)?"": "no\x6ee"; }var attrHolder=oCell.getAttribute("c\x6fntrolHol\x64er"); if (attrHolder){oCell.style.display=this.ArrayValueExists(attrHolder,controlRow)?"": "none"; if ("non\x65"==oCell.style.display)continue; var control=controls[attrHolder]; var attr=oElem.getAttribute?oElem.getAttribute(attrHolder): ""; if (attrHolder=="\156\x6fWrap"){control.SetValue(oElem.noWrap); }else if (attrHolder=="alig\x6e"){control.SetValue(oElem.getAttribute("\x61li\x67\x6e"),oElem.getAttribute("vAlign")); }else if (attrHolder=="\x62orderC\x6f\154\x6fr" || attrHolder=="\x77idth" || attrHolder=="heig\x68\164"){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 (("href"==attrHolder || "\x73rc"==attrHolder) && oElem.getAttribute("\x64at\x61\x2dek\x74ron-url")){control.SetValue(oElem.getAttribute("data-ekt\x72on-url")); }else if (attr){control.SetValue(attr); }else if (!this.IsIE && "class\x4eame"==attrHolder){var attr=oElem.getAttribute?oElem.getAttribute("c\x6cass"): ""; 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 ("a\x6cign"==commandName){var align=oTool.GetAlign( ); var vAlign=oTool.GetVAlign( ); this.Editor.ExecuteSetAttributeCommand(oElem,"\x61lign",align,title); title=this.GetLocalizedString("v\x41lign","\x76Align"); this.Editor.ExecuteSetAttributeCommand(oElem,"\166\x41lign",vAlign,title); }else if ("bor\x64erColor"==commandName){var selValue=oTool.GetSelectedValue( ); this.Editor.ExecuteSetStyleRuleCommand(this.SelectedElement,"borderC\x6flor",selValue,title); }else if ("\x77idth"==commandName || "h\x65ight"==commandName){var selValue=oTool.GetSelectedValue( ); if (!this.IsValidAttribValue(selValue)){alert(this.InvalidValueString); return; }function ConvertIntToPixel(oVal){var oNew=""+oVal; if (oNew.indexOf("%")!=-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="\143\x6cas\x73\x4ea\x6d\145"; break; case RadEditorNamespace.RADCOMMAND_BACKCOLOR:attribName="\x62gCo\x6c\157\x72"; break; case "value":break; case "\156\x6f\x57ra\x70":if (attribValue)attribValue="\x6eoWrap"; else attribValue=""; break; case "\x62or\x64\x65r":case "cellS\x70\141\x63\151\x6e\147":case "\x63ell\x50\x61dd\x69\156\x67":if (!this.IsValidAttribValue(attribValue)){alert(this.InvalidValueString); return; }break; case "NAME":if (!this.IsIE)attribName="\x6eame"; } this.Editor.ExecuteSetAttributeCommand(oElem,attribName,attribValue,title); } this.Editor.FireEvent(RadEditorNamespace.RADEVENT_SEL_CHANGED); };RadEditorNodeInspector.prototype.GetSelectedValue= function ( ){return this.SelectedElement; } ; RadEditorNodeInspector.prototype.GetIconUrl= function (fileName){return (this.Editor.SkinBasePath+"\x42utt\x6f\x6es/"+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 "\x63lass\x4e\141\x6de":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["\x43learSty\x6c\145"],PopupIconPath: this.Editor.SkinBasePath+"\x49mg/" } ; control=RadEditorNamespace.RadCssCombo.New(toolArgs); control.Create( ); break; case "bo\x72derColor":case "bgCo\x6c\157r":var toolArgs= {GetController:getControllerFn,Document: this.Document,Name: "\x62orderCo\x6c\157\x72"==name?"\142\x6frderCo\x6cor":RadEditorNamespace.RADCOMMAND_BACKCOLOR,AddCustomColor:localiz["\x41ddCus\x74\x6fm\x43\157\x6cor"],AddCustomHexColor:localiz["AddCust\x6fmHexCol\x6f\162"],PromptColor:localiz["Pro\x6dptColor"],Title: this.GetLocalizedString(name),ArrowUrl: this.ArrowIconUrl,PopupWidth: 120,PopupHeight: 120,CellSpacing: 1,CellPadding: 1,IconUrl: this.GetIconUrl("\x42ackC\x6f\154\x6fr.gif"),AllowCustomColors: this.Editor.AllowCustomColors,GetDataFunction:function (name){return editor.GetDataArrayForTool("BackC\x6flor"); }} ; control=RadEditorNamespace.RadColorPicker.New(toolArgs); control.Create( ); break; case "\x61\154\x69\x67n":var toolArgs= {GetController:getControllerFn,Document: this.Document,Name: "\x61lign",Title: this.GetLocalizedString("ali\x67n","\x61lign"),ArrowUrl: this.ArrowIconUrl,SkinBasePath: this.Editor.SkinBasePath,IconUrl: this.GetIconUrl("../Im\x67/AlignM\x69ddleLef\x74.gif")} ; 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 "\x74arget":var targetList= {_blank: this.GetLocalizedString("\x5fbl\x61\x6ek","_bl\x61\156\x6b"),_self: this.GetLocalizedString("\x5fself","_se\x6c\146"),_parent: this.GetLocalizedString("_\x70arent","_pa\x72\145\x6et"),_top: this.GetLocalizedString("\x5ftop","\x5ftop"),_search: this.GetLocalizedString("_sea\x72\143\x68","_search"),_media: this.GetLocalizedString("_med\x69a","_med\x69a")} ; var toolArgs= {TargetList:targetList,Controller: this,Document: this.Document,Name:name } ; control=new RadEditorNamespace.RadTargetBox(toolArgs); control.Create( ); break; case "\x6eoW\x72\x61p":var toolArgs= {Controller: this,Document: this.Document,Name:name } ; control=new RadEditorNamespace.RadCheckBox(toolArgs); control.Create( ); break; case "href":theWidth=200; case "\x74it\x6c\145":case "value":case "NAM\x45":case "action":case "id":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("TABL\x45")[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="inlin\x65"; this.style.height=RadEditorNamespace.ATTRIBUTE_INSPECTOR_HORIZONTAL_HEIGHT; };RadEditorNamespace.AttributeInspector_OnRenderVertical= function ( ){var table=this.getElementsByTagName("\124\x41BLE")[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="\x62lock"; };
o3.prototype=new RadEditorModuleBase( ); o3.prototype.base=RadEditorModuleBase.prototype.constructor; function o3(moduleArgs){var theDiv=moduleArgs.Document.createElement("\x44\x49V"); moduleArgs.ModuleElement=theDiv.cloneNode( true); this.base(moduleArgs); this.EnableMaxWidth= false; this.O3=this.GetLocalizedString("\x53\x74\x61tis\x74icsWord\x73","\x57ords\x3a"); this.l3=this.GetLocalizedString("Sta\x74istics\x43\150\x61rac\x74ers","Charact\x65\162s\x3a"); }
; o3.prototype.OnCreate= function ( ){var selfPointer=this ; this.AttachEventHandler(RadEditorNamespace.RADEVENT_SEL_CHANGED, function ( ){selfPointer.i3( ); } ); if (this.Editor.Document.body)this.AttachEventHandler("\x6f\x6e\x62lu\x72", 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 sty\x6ce=\047\x6cine\x2dheight\x3a22px\047\076"+this.O3+" "+I3+" "+this.l3+" "+o4+"&n\x62sp;\074\x2fspa\x6e\076"; } ;
if (typeof(RadEditorXhtmlValidatorDocTypes)=="undefi\x6e\x65d"){RadEditorXhtmlValidatorDocTypes= { "XH\x54ML 1.0 S\x74rict": ["\x21DOC\x54\131\x50E h\x74\155\x6c PUBL\x49C \042-//W3C\x2f\057\x44TD\x20XHTML\x20\061\x2e0 St\x72ict//\x45N\042\x20\042\x68t\x74p://\x77ww.w\x33.org/\x54R/xht\x6dl1/DT\x44/xhtm\x6c1-str\x69ct.d\x74d\042", false],"\x58HTML\x20\x31.\x30 Transit\x69onal": ["!D\x4fCTYPE ht\x6d\154\x20\x50UB\x4cIC \042\x2d//\x57\063\x43//DT\x44 XHT\x4dL 1.0 \x54ransi\x74ional\x2f/EN\042\040\x22http\x3a//ww\x77.w3.o\x72g/TR/\x78html1\x2fDTD/x\x68tml1-\x74ransi\x74iona\x6c.dtd\x22", false],"\x58HTML 1.\x31": ["\041\x44OCTYPE \x68\164\x6d\154\x20\120\x55BLIC \042-//W3\x43\057\x2fDTD\x20XHTML\x201.1//\x45N\042\x20\042\x68tt\x70://ww\x77.w3.\x6frg/T\x52/xhtm\x6c11/DT\x44/xht\x6dl11.d\x74d\042", false] } ; }RadEditorXhtmlValidator.prototype=new RadEditorModuleBase( ); RadEditorXhtmlValidator.prototype.base=RadEditorModuleBase.prototype.constructor; function RadEditorXhtmlValidator(moduleArgs){moduleArgs.ModuleElement=moduleArgs.Document.createElement("div"); 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\x3e"+this.Editor.getContent( )+"\074/div>"; 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="99%"; var oHeight=400; iframe.style.height=oHeight+"px"; this.Editor.FixIeHeight(iframe,oHeight); iframe.style.border="\061\x70x r\x69\x64g\x65 #aaaaa\x61"; }else {iframe.style.width="\x30px"; iframe.style.height="0px"; iframe.style.border="0px rid\x67e #aaa\x61aa"; }} ; RadEditorXhtmlValidator.prototype.CreateIframe= function ( ){var iframe=document.createElement("\151\x66rame"); this.Iframe=iframe; iframe.frameBorder='0'; iframe.src=this.Editor.RadControlsDir+"Edi\x74or/Xhtml\x2fXhtmlVa\x6c\151\x64ator.a\x73px"; iframe.style.margin="\x31px"; this.ShowIframe( false); var oModule=this ; var oFun= function ( ){var oDoc=oModule.Iframe.contentWindow.document; oModule.ContentField=oDoc.getElementById("\x45dito\x72\x43on\x74ent"); oModule.DoctypeField=oDoc.getElementById("E\x64itorDo\x63\x74y\x70\145"); oModule.ValidateForm=oDoc.forms["\x52adEdit\x6f\x72Xh\x74mlForm"]; } ; this.IframeLoadingFun=oFun; RadEditorNamespace.Utils.AttachEventEx(iframe,"\x6coad",this.IframeLoadingFun); iframe=null; } ; RadEditorXhtmlValidator.prototype.CreateHeader= function ( ){var oModule=this ; var oBut=document.createElement("\151\x6eput"); oBut.type="\x62utton"; oBut.className="R\x61dEXhtmlB\x75tton"; oBut.onclick= function ( ){oModule.Validate( ); oModule.CheckboxChecked= true; };oBut.value=this.GetLocalizedString("\x56alid\x61\x74eX\x48\124\x4dL","Vali\x64\141t\x65 XHTML"); var oCheckbox=document.createElement("INPUT"); oCheckbox.setAttribute("type","\x63heckbox"); oCheckbox.style.marginBottom="\x32px"; 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("s\x70an"); oSpan.style.height="\x316px"; oSpan.onclick=new Function('thi\x73.previou\x73Sibling\x2e\143\x6cick(\x29'); oSpan.innerHTML=this.GetLocalizedString("\x45xpandVa\x6c\151\x64ator","\x45xpand/Col\x6capse Va\x6c\151\x64\141\x74\157\x72")+" \x26\156\x62\x73p;\x20| &nbsp;"; this.ModuleElement.appendChild(oSpan); var oSpan=document.createElement("\x73p\x61\x6e"); oSpan.innerHTML=this.GetLocalizedString("FormSe\x6cect","Select")+"\x3a"; this.ModuleElement.appendChild(oSpan); var oSelect=document.createElement("\x73elect"); oSelect.className="Rad\x45DropDown"; oSelect.style.width="14\x30px"; 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="\x6eone"; if (this.Editor.IsIE && "\x63ompl\x65\x74e"!=document.readyState){RadEditorNamespace.Utils.AttachEventEx(window,"load", 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\x61dEModul\x65"; 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!="\x54ABLE")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="\x3100%"; }var oCell=oTable.rows[0].insertCell(-1); oCell.innerHTML="\x3cspa\x6e\x20st\x79le=\047font\x2dsize:\x31px;lin\x65\055\x68eig\x68t:0p\x78;\047\x3e&nb\x73p;\074\x2fs\x70an>"; oCell.setAttribute("\x68eight","100%"); oCell.appendChild(this.ModuleElement); if (this.IsDockable && RadEditorNamespace.Docking){var newTable=RadEditorNamespace.Docking.WrapInDockingContainer(oTable,this.IsVertical,RadEditorNamespace.RadEditorModule_RenderHorizontal,RadEditorNamespace.RadEditorModule_RenderVertical,"RadEMo\x64uleTabl\x65","\x52adE\x4d\157\x64\165\x6c\x65T\x61\142\x6c\145",this.Title); oTable=newTable; } this.VisibleDisplay=this.IsIE && !this.IsOpera?"i\x6eline": ""; oTable.className="RadEMo\x64uleTabl\x65"; if (!this.IsIE){oTable.setAttribute("\x73tyl\x65","\x66loat:lef\x74"); }if (this.Editor.IsIE && oTable.attachEvent){oTable.attachEvent("onres\x69ze",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 f\x61iled fo\x72 "+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="10\x30px"; 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("\x76\x61r m\x6f\x64ul\x65 = new "+moduleName+"(\x6d\157\x64uleAr\x67\163)"); 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%"){oElem.parentNode.style.width="\x310\x30\x25"; }oElem.style.width="100%"; 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="R\x61\x64EToolL\x6fng"; toolArgs.PopupWidth=73; toolArgs.PopupHeight=85; toolArgs.CellSpacing=2; toolArgs.CellPadding=2; toolArgs.PopupClassName="RadAli\x67nmentS\x65lectorT\x61ble"; 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",""],["",""],["lef\x74",""],["\x61bsmi\x64\144\x6ce",""],["right",""],["",""],["bot\x74om",""],["",""]],CellAlignment: [["",""],["none",""],["",""],["lef\x74","top"],["cente\x72","\x74op"],["\x72ight","to\x70"],["\x6ceft","m\x69\144d\x6c\145"],["cen\x74\145\x72","middle"],["righ\x74","\x6did\x64\x6ce"],["left","bottom"],["cente\x72","bottom"],["\x72ight","bottom"]],TableAlignment: [["",""],["none",""],["",""],["left",""],["ce\x6eter",""],["\x72ight",""],["",""],["",""],["",""],["",""],["",""],["",""]],CaptionIEAlignment: [["",""],["\156\x6fne",""],["",""],["lef\x74","top"],["center","\164\x6f\160"],["\162\x69\x67ht","t\x6f\160"],["",""],["",""],["",""],["\x6ceft","bo\x74\164o\x6d"],["\x63enter","b\x6f\164t\x6f\155"],["right","bott\x6f\155"]],CaptionNSAlignment: [["",""],["none",""],["",""],["",""],["","\x74op"],["",""],["",""],["",""],["",""],["",""],["","bottom"],["",""]],AlignmentImages: ["x.gif","x.gif","\x78.gif","\101l\x69\147n\x54opLeft.g\x69f","\x41lignTopC\x65\156\x74\145\x72.gif","\101l\x69\147n\x54\157\x70\122i\x67ht.gif","\x41lign\x4d\x69dd\x6c\145\x4c\145\x66t.gif","\x41lignMi\x64\144\x6c\145C\x65nter.g\x69\146","AlignM\x69\144d\x6ceRight.g\x69f","AlignB\x6f\164t\x6f\155\x4c\145f\x74.gif","Al\x69gnBottom\x43enter.gi\x66","\x41lignBott\x6f\155\x52\x69gh\x74.gif"],SetTagName:function (tagName){ this.TagName=tagName; this.ActiveAlignmentArray=this.GetLookupTableByTagName(this.TagName); this.OnCellClick(this.NoAlignmentIndex); } ,GetLookupTableByTagName:function (tagName){switch (tagName.toUpperCase( )){case "\x49MG":return this.ImgAlignment; case "\x54ABLE":return this.TableAlignment; case "\124\x44":return this.CellAlignment; case "TH":return this.CellAlignment; case "\x43APTION":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": "h\x69\x64den"; 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("\x49MG")[0]; oElem.src=this.SkinBasePath+"\x49mg/"+imgFileName; oElem.style.margin="\x34px"; } ,OnCellClick:function (index){if (index==this.NoAlignmentIndex){ this.SelectedTuple=""; this.SetButtonImage("x.\x67\151\x66"); }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 ("none"==value){value=""; }return value; } ,GetVAlign:function ( ){var value=(this.SelectedTuple?this.SelectedTuple[1]: ""); if ("\x6eone"==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("\x69mg"); oImg.align="\x61bsMidd\x6c\145"; oImg.border="\060"; oImg.src=this.SkinBasePath+"\x49mg/"+this.AlignmentImages[index]; oCell.appendChild(oImg); this.ConfigureCell(oCell,this,index); return oCell; }} ;

