Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Utils={getInvisibleParent:function(_1){
while(_1!=document){
if("none"==$telerik.getCurrentStyle(_1,"display","")){
return _1;
}
_1=_1.parentNode;
}
return null;
},evalScriptCode:function(_2){
var _3=$telerik.isSafari;
if(_3){
_2=_2.replace(/^\s*<!--((.|\n)*)-->\s*$/mi,"$1");
}
var _4=document.createElement("script");
_4.setAttribute("type","text/javascript");
if(_3){
_4.appendChild(document.createTextNode(_2));
}else{
_4.text=_2;
}
var _5=document.getElementsByTagName("head")[0];
_5.appendChild(_4);
if(_3){
_4.innerHTML="";
}else{
_4.parentNode.removeChild(_4);
}
},cleanPastedContent:function(_6,_7,_8,_9){
var _a=_6;
if(_7==Telerik.Web.UI.StripFormattingOptions.None){
if((_6.match(/style="[^"]*?mso[^"]*?"/ig)||_6.match(/class="?[^"]*?mso[^"]*?"?/ig))&&confirm(_8)){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD");
}
}else{
if(_7&Telerik.Web.UI.StripFormattingOptions.All){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"ALL");
}else{
if(_7&Telerik.Web.UI.StripFormattingOptions.AllExceptNewLines){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"ALL_NO_BRAKES");
}else{
if(_7&Telerik.Web.UI.StripFormattingOptions.MSWordRemoveAll){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD_ALL");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.MSWordNoFonts){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD_NO_FONTS");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.MSWord){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.Css){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"CSS");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.Font){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"FONT");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.Span){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"SPAN");
}
_a=_6;
}
}
}
if(null!=_9&&false==_9){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_a,"SCRIPT");
}
return _a;
},isCursorMovingKey:function(_b){
if(_b>=33&&_b<=40){
return true;
}
return false;
},isSystemKey:function(_c){
if(_c>=112&&_c<=123){
return true;
}
if(_c>=8&&_c<=27){
return true;
}
if(_c>=32&&_c<=46){
return true;
}
if(_c==93){
return true;
}
return false;
},storeBrowserPosition:function(){
var _d=document.body;
var _e=document.documentElement;
this._browserTop=_d.scrollTop>_e.scrollTop?_d.scrollTop:_e.scrollTop;
this._browserLeft=_d.scrollLeft>_e.scrollLeft?_d.scrollTop:_e.scrollLeft;
},restoreBrowserPosition:function(_f,top){
try{
if(null==_f){
_f=this._browserLeft;
}
if(null==top){
top=this._browserTop;
}
var _11=document.body;
var _12=document.documentElement;
_11.scrollTop=top;
_11.scrollLeft=_f;
_12.scrollTop=top;
_12.scrollLeft=_f;
}
catch(ex){
}
},_getPasteIframe:function(){
if(!this._pasteIframe){
this._pasteIframe=document.createElement("IFRAME");
var _13=this._pasteIframe.style;
_13.width="1px";
_13.height="1px";
_13.border="0px solid red";
_13.overflow="hidden";
_13.position="absolute";
document.body.appendChild(this._pasteIframe);
var doc=this._pasteIframe.contentWindow.document;
var _15=doc.open("text/html","replace");
var _16="<html><head><title>New Document</title></head>"+"<body contentEditable='true' style='overflow:hidden;margin:0px;padding:0px;height:100%'>"+"</html>";
_15.write(_16);
_15.close();
}
return this._pasteIframe;
},getPasteContainer:function(){
var _17=this._getPasteIframe();
return _17.contentWindow.document.body;
},getClipboardAsHtml:function(){
var div=this.getPasteContainer();
div.innerHTML="";
div.setActive();
document.execCommand("Paste",null);
var _19=div.innerHTML;
div.innerHTML="";
return _19;
},stripFormatting:function(_1a,_1b){
switch(_1b){
case "ALL":
_1a=_1a.replace(/<\/?[^>]*>/ig,"");
break;
case "ALL_NO_BRAKES":
_1a=_1a.replace(/<BR(\s[^>]*)?\/?>/ig,"~RADEDITORBRAKE~");
_1a=_1a.replace(/<\/?[^>]*>/ig,"");
_1a=_1a.replace(/~RADEDITORBRAKE~/ig,"<br/>");
_1a=_1a.replace(/\n/ig,"<br/>");
_1a=_1a.replace(/\r/ig,"");
break;
case "WORD":
case "WORD_ALL":
case "WORD_NO_FONTS":
_1a=this.stripWordFormatting(_1a,_1b);
break;
case "CSS":
_1a=_1a.replace(new RegExp("(<[^>]+) class=[^ |^>]*([^>]*>)","ig"),"$1 $2");
_1a=_1a.replace(/(<[^>]+) style="[^"]*"([^>]*>)/ig,"$1 $2");
break;
case "FONT":
_1a=_1a.replace(/<\/?font[^>]*>/ig,"");
break;
case "SPAN":
_1a=_1a.replace(/<\/?span[^>]*>/ig,"");
break;
case "SCRIPT":
_1a=_1a.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
_1a=_1a.replace(new RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
break;
default:
break;
}
return _1a;
},replaceNewLineWithBr:function(_1c){
try{
_1c=_1c.replace(/\n/g,"<br>");
return _1c;
}
catch(exc){
}
},convertText2Html:function(_1d){
try{
_1d=_1d.replace(/</g,"&lt;");
_1d=_1d.replace(/>/g,"&gt;");
_1d=_1d.replace(/\n/g,"<br>");
return _1d;
}
catch(exc){
}
},clearWordAttributesInElement:function(_1e,_1f){
var _20=$telerik.isIE?_1e.all:_1e.getElementsByTagName("*");
for(var i=0;i<_20.length;i++){
var _22=_20[i];
var _23=new RegExp("mso","gi");
if(_22.nodeType==1){
if(_23.exec(_22.className)){
_22.className="";
}
_22.removeAttribute("lang","",0);
_22.removeAttribute("stylw","",0);
_22.style.cssText=_22.style.cssText.replace(/(([\w-]*?mso[\w-]*?):(.+?)([;^$]|$))/gi,"");
if($telerik.isIE){
_22.style.removeAttribute("tab-stops",0);
_22.style.removeAttribute("textIndent",0);
}
if($telerik.isIE&&(_1f=="WORD_NO_FONTS"||_1f=="WORD_ALL")){
_22.style.removeAttribute("fontFamily",0);
_22.removeAttribute("face",0);
}
for(j=_22.attributes.length-1;j>=0;j--){
var _24=_22.attributes[j];
if("null"!=_24.value&&""!=_24.value){
if(_23.exec(_24.name)||_23.exec(_24.value)){
_22.removeAttribute(_24.name);
}
}
}
}
}
},stripWordFormatting:function(_25,_26){
if(_26=="WORD_ALL"){
var _27=/<SPAN[^>]*?>([\s\S]*?)<\/SPAN[^>]*?>/ig;
while(_25.match(_27)){
_25=_25.replace(_27,"$1");
}
var _28=/<FONT[^>]*?>([\s\S]*?)<\/FONT[^>]*?>/ig;
while(_25.match(_28)){
_25=_25.replace(_28,"$1");
}
}
_25=_25.replace(/<span>([^<>]+)<\/span>/gi,"<span EditorSaved='true'>$1</span>");
_25=_25.replace(/<font>([^<>]+)<\/font>/gi,"<font EditorSaved='true'>$1</font>");
var _29=document.createElement("DIV");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_29,_25);
this.clearWordAttributesInElement(_29,_26);
var _2a=_29.innerHTML;
_2a=_2a.replace(/\t/g," ");
_2a=_2a.replace(/<\/?\w+:[^>]*>/gi,"");
_2a=_2a.replace(/<\\?\??xml[^>]>/gi,"");
_2a=_2a.replace(/<p>&nbsp;<\/p>/gi,"<BR><BR>");
_2a=_2a.replace(/[ ]+/g," ");
_2a=_2a.replace(/<(\/)?strong>/ig,"<$1B>");
_2a=_2a.replace(/<(\/)?em>/ig,"<$1I>");
_2a=_2a.replace(/^\s/i,"");
_2a=_2a.replace(/\s$/i,"");
_2a=_2a.replace(/<o:[pP]>&nbsp;<\/o:[pP]>/gi,"");
_2a=_2a.replace(/<st1:.*?>/gi,"");
_2a=_2a.replace(/<font>([^<>]+)<\/font>/gi,"$1");
_2a=_2a.replace(/<span>([^<>]+)<\/span>/gi,"$1");
_2a=_2a.replace(/[\s]+EditorSaved=[\'\"]true[\'\"]/gi,"");
_2a=_2a.replace(/<\?xml[^>]*>/ig,"");
_2a=_2a.replace(/<\/?[a-z]+:[^>]*>/ig,"");
_2a=_2a.replace(/style=(""|'')/ig,"");
_2a=_2a.replace(/class=(""|'')/ig,"");
_2a=_2a.replace(/v:shape="[^"]+"/ig,"");
_2a=_2a.replace(/<span[^>]*>\s*<\/span[^>]*>/ig," ");
_2a=_2a.replace(/<font[^>]*>\s*<\/font[^>]*>/ig," ");
_2a=_2a.replace(/\s+/ig," ");
_2a=_2a.replace(/<span><span>/ig,"<span>");
_2a=_2a.replace(/<\/span><\/span>/ig,"</span>");
return _2a;
},createTable:function(_2b,_2c,_2d){
if(!_2d){
_2d=document;
}
var _2e=_2d.createElement("TABLE");
for(var r=0;r<_2b;r++){
oRow=_2e.insertRow(-1);
for(var c=0;c<_2c;c++){
oCell=oRow.insertCell(-1);
oCell.innerHTML="&nbsp;";
}
}
return _2e;
},mergeElementAttributes:function(_31,_32,_33){
if(!_31||!_32){
return;
}
if(_31.mergeAttributes){
_32.mergeAttributes(_31,_33);
}else{
for(var ac=0;ac<_31.attributes.length;ac++){
var _35=_31.attributes[ac].nodeValue;
_32.setAttribute(_31.attributes[ac].nodeName,_35);
}
if(""==_32.getAttribute("style")){
_32.removeAttribute("style");
}
}
},getElementParentByTag:function(_36,_37){
if(null==_36){
return null;
}
if(null==_37){
return _36;
}
try{
while(_36&&null!=_36.tagName&&_36.tagName!=_37){
_36=_36.parentNode;
}
return ((_36.tagName==_37)?_36:null);
}
catch(e){
return null;
}
},selectElement:function(_38,_39){
if(!_39){
return;
}
var _3a=_38.document;
if($telerik.isIE){
var _3b;
switch(_39.tagName){
case "TABLE":
case "IMG":
case "HR":
case "INPUT":
_3b=_3a.body.createControlRange();
_3b.add(_39);
break;
case "UL":
case "OL":
_3b=_3a.body.createTextRange();
_3b.moveToElementText(_39);
var _3c=_3b.parentElement();
if(_3c.tagName!="UL"||_3c.tagName!="OL"){
_3b.moveEnd("character",-1);
}
break;
default:
_3b=_3a.body.createTextRange();
_3b.moveToElementText(_39);
break;
}
if(_3b){
_3b.select();
return true;
}
}else{
if(_38.getSelection){
var _3b=_3a.createRange();
_3b.selectNode(_39);
if(window.opera){
_3b.selectNodeContents(_39);
}
var _3d=_38.getSelection();
if($telerik.isSafari){
_3d.setBaseAndExtent(_3b.startContainer,_3b.startOffset,_3b.endContainer,_3b.endOffset);
}else{
_3d.removeAllRanges();
_3d.addRange(_3b);
}
return true;
}
}
return false;
},getOuterHtml:function(_3e){
return $telerik.getOuterHtml(_3e);
},hasHtmlContent:function(_3f){
if(!_3f||!_3f.match){
return _3f;
}
return _3f.match(/</);
},setElementInnerHtml:function(_40,_41){
var _42=$telerik.isIE?this.getStoredOriginalPathsAndAttributes(_41):_41;
_40.innerHTML="<span>&nbsp;</span>"+_42;
_40.removeChild(_40.firstChild);
if($telerik.isIE){
this.restoreOriginalPathsAndAttributes(_40);
}
},getStoredOriginalPathsAndAttributes:function(_43){
var _44=new RegExp("(href|src)\\s*=\\s*('|\")?(.+?)(\\2)([^<]*?>)","ig");
var _45=function(_46,g1,g2,g3,g4,g5,_4c,_4d){
if(!g2){
g2="";
g3=g3+g5;
var _4e=g3.match(/(\s|>)/gi);
if(_4e){
var _4f=_4e.index;
g5=g3.substring(_4f,g3.length);
g3=g3.substring(0,_4f);
}else{
return _46;
}
}
return g1+"="+g2+g3+g2+" originalAttribute=\""+g1+"\" originalPath=\""+g3+"\""+g5;
};
_43=_43.replace(_44,_45);
var _50=new RegExp("(<!--[\\s\\S]*?) originalAttribute=\"(href|src)\" originalPath=\"[^\"]+\"([\\s\\S]*?-->)","ig");
_43=_43.replace(_50,"$1$3");
return _43;
},restoreOriginalPathsAndAttributes:function(_51){
var _52=_51.getElementsByTagName("*");
for(var i=0;i<_52.length;i++){
var _54=_52[i];
var _55=_54.getAttribute("originalPath");
var _56=_54.getAttribute("originalAttribute");
if(_55!=null&&_56!=null){
_54.removeAttribute("originalPath");
_54.removeAttribute("originalAttribute");
if(_55.toLowerCase().indexOf("mailto:")==0){
continue;
}
_55=_55.replace(window.location.href+"#","#");
_54.removeAttribute(_56);
var _57=_54.innerHTML;
_54.setAttribute(_56,_55);
if(_57.indexOf("www.")==0&&_54.innerHTML.match("[a-z]+://")){
_54.innerHTML=_57;
}
}
}
},_encodeHtmlContent:function(_58,_59){
var _5a=new Array("%","<",">","!","\"","#","$","&","'","(",")",",",":",";","=","?","[","\\","]","^","`","{","|","}","~","+");
var _5b=_58;
if(_59){
for(var i=0;i<_5a.length;i++){
_5b=_5b.replace(new RegExp("\\x"+_5a[i].charCodeAt(0).toString(16),"ig"),"%"+_5a[i].charCodeAt(0).toString(16));
}
}else{
for(var i=_5a.length-1;i>=0;i--){
_5b=_5b.replace(new RegExp("%"+_5a[i].charCodeAt(0).toString(16),"ig"),_5a[i]);
}
}
return _5b;
},encodePostbackContent:function(_5d){
return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(_5d,true);
},decodePostbackContent:function(_5e){
return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(_5e,false);
},addStyleSheet:function(url,doc,id){
doc=doc||document;
var _62=doc.createElement("link");
_62.setAttribute("href",url,0);
_62.setAttribute("type","text/css");
if(id){
_62.setAttribute("id",id);
}else{
id="";
}
_62.setAttribute("rel","stylesheet",0);
var _63=doc.getElementsByTagName("head")[0];
if($telerik.isSafari){
var _64=function(){
_63.appendChild(_62);
};
window.setTimeout(_64,200);
}else{
_63.appendChild(_62);
}
},_copyElementsBetweenNodes:function(_65,_66,_67){
var _68=_65.getElementsByTagName(_67);
var _69=_66.getElementsByTagName(_67);
for(var i=0;i<_68.length;i++){
switch(_67){
case "script":
case "title":
_69[i].text=_68[i].text;
break;
case "style":
if(_69[i].innerHTML!=_68[i].innerHTML){
_69[i].styleSheet.cssText=_68[i].styleSheet.cssText;
}
break;
default:
_69[i].innerHTML=_68[i].innerHTML;
break;
}
}
},cloneNodeWithChildren:function(_6b){
if(!_6b){
return null;
}
if($telerik.isIE&&_6b.getElementsByTagName){
var _6c=_6b.cloneNode(true);
if(typeof (_6c.innerHTML)!="string"){
this.setElementInnerHtml(_6c,_6b.innerHTML);
}
this._copyElementsBetweenNodes(_6b,_6c,"script");
this._copyElementsBetweenNodes(_6b,_6c,"map");
this._copyElementsBetweenNodes(_6b,_6c,"style");
this._copyElementsBetweenNodes(_6b,_6c,"title");
return _6c;
}else{
return _6b.cloneNode(true);
}
},getUniqueID:function(){
if(!window["RadEditor_uniqueSeed"]){
window["RadEditor_uniqueSeed"]=new Date()-101;
}
if(!window["RadEditor_uniqueIdCounter"]){
window["RadEditor_uniqueIdCounter"]=1;
}else{
window["RadEditor_uniqueIdCounter"]++;
}
var _6d=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_6d;
}};
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandStates=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.Editor.CommandStates.prototype={Disabled:-1,Off:0,On:1};
Telerik.Web.UI.Editor.CommandStates.registerEnum("Telerik.Web.UI.Editor.CommandStates",false);
Telerik.Web.UI.Editor.CommandBase=function(_6e,_6f,_70){
this.isSafari=$telerik.isSafari;
this.isIE=$telerik.isIE;
this.isOpera=$telerik.isOpera;
this.isFirefox=$telerik.isFirefox;
this._title=_6e;
this._window=_6f;
this._isExecuted=false;
this._canUnexecute=(_70!=false);
};
Telerik.Web.UI.Editor.CommandBase.prototype={getState:function(_71){
return Telerik.Web.UI.Editor.CommandStates.Off;
},getValue:function(_72){
return null;
},set_window:function(_73){
this._window=_73;
},get_window:function(){
return this._window;
},get_title:function(){
return this._title;
},set_title:function(_74){
this._title=_74;
},execute:function(){
this._isExecuted=false;
if(null==this.onExecute||null==this.get_window()){
return false;
}
try{
if(!this.RestorePoint1){
this.RestorePoint1=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
}else{
this.RestorePoint1.select();
}
return (this._isExecuted=this.onExecute());
}
catch(ex){
}
return false;
},onExecute:function(){
if(this.isIE&&null!=this.OnExecuteIE){
return this.OnExecuteIE();
}else{
if(null!=window.getSelection&&null!=this.OnExecuteMoz){
return this.OnExecuteMoz();
}
}
return false;
},unexecute:function(){
try{
if(this._canUnexecute&&this._isExecuted){
this.RestorePoint1.restore();
}
}
catch(ex){
}
}};
Telerik.Web.UI.Editor.CommandBase.registerClass("Telerik.Web.UI.Editor.CommandBase",null);
Telerik.Web.UI.Editor.PasteHtmlCommand=function(_75,_76,_77,_78){
Telerik.Web.UI.Editor.PasteHtmlCommand.initializeBase(this,[(_75||"Insert Html"),_76,true]);
this.HtmlText=_77;
this.SelectText=(true==_78);
};
Telerik.Web.UI.Editor.PasteHtmlCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.PasteHtmlCommand(this.get_title(),this.get_window(),this.HtmlText);
},onExecute:function(){
var sel=new Telerik.Web.UI.Editor.Selection(this.get_window());
sel.pasteHtml(this.HtmlText,this.SelectText);
return true;
}};
Telerik.Web.UI.Editor.PasteHtmlCommand.registerClass("Telerik.Web.UI.Editor.PasteHtmlCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.GenericCommand=function(_7a,_7b){
Telerik.Web.UI.Editor.GenericCommand.initializeBase(this,[_7a,_7b,true]);
this.RestorePoint1=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
};
Telerik.Web.UI.Editor.GenericCommand.prototype={execute:function(){
if(null==this.RestorePoint2){
this.RestorePoint2=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
}else{
this.RestorePoint2.restore();
}
return true;
},unexecute:function(){
this.RestorePoint1.restore(true);
}};
Telerik.Web.UI.Editor.GenericCommand.registerClass("Telerik.Web.UI.Editor.GenericCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TextTypeCommand=function(_7c,_7d){
Telerik.Web.UI.Editor.TextTypeCommand.initializeBase(this,[(_7c||"Typing"),_7d]);
};
Telerik.Web.UI.Editor.TextTypeCommand.prototype={update:function(){
if(this.RestorePoint2){
this.RestorePoint2.update();
}
}};
Telerik.Web.UI.Editor.TextTypeCommand.registerClass("Telerik.Web.UI.Editor.TextTypeCommand",Telerik.Web.UI.Editor.GenericCommand);
Telerik.Web.UI.Editor.BrowserCommand=function(_7e,_7f,_80,_81){
var _82=true;
switch(this.CommandID){
case "Copy":
case "SelectAll":
case "Print":
_82=false;
break;
}
Telerik.Web.UI.Editor.BrowserCommand.initializeBase(this,[(_7e||_80),_7f,_82]);
this.CommandID=_80;
this.Value=_81;
};
Telerik.Web.UI.Editor.BrowserCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.BrowserCommand(this._title,this.get_window(),this.CommandID,this.Value);
},getState:function(_83){
try{
_83=_83||this.get_window();
var _84=_83.document;
if(null==_84){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
var _85=true;
if("Paste"!=this.CommandID){
_85=_84.queryCommandEnabled(this.CommandID);
}else{
if(!$telerik.isIE7){
_85=_84.queryCommandEnabled(this.CommandID);
}
}
if(!this.isOpera&&!_85){
if(!this.isSafari||!this.CommandID=="RealFontSize"){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
}
var _86=null;
if("Paste"!=this.CommandID){
_86=_84.queryCommandState(this.CommandID);
}else{
if(!$telerik.isIE7){
_86=_84.queryCommandState(this.CommandID);
}
}
return _86?Telerik.Web.UI.Editor.CommandStates.On:Telerik.Web.UI.Editor.CommandStates.Off;
}
catch(ex){
return Telerik.Web.UI.Editor.CommandStates.Off;
}
},getValue:function(_87){
try{
_87=_87||this.get_window();
return _87.document.queryCommandValue(this.CommandID);
}
catch(ex){
}
return null;
},onExecute:function(){
var _88=this.get_window();
if(!_88){
return false;
}
var _89=_88.document;
if("AbsolutePosition"==this.CommandID){
_89.execCommand("2D-Position",false,true);
}
var _8a=true;
if(this.CommandID=="BackColor"&&(this.isOpera||this.isFirefox)){
this.CommandID="HiliteColor";
_8a=false;
}
if(this.CommandID=="FontSize"&&this.isSafari&&!$telerik.isSafari3){
var _8b=parseInt(this.Value);
switch(_8b){
case 1:
this.Value="8pt";
break;
case 2:
this.Value="10pt";
break;
case 3:
this.Value="12pt";
break;
case 4:
this.Value="14pt";
break;
case 5:
this.Value="18pt";
break;
case 6:
this.Value="24pt";
break;
case 7:
this.Value="36pt";
break;
}
}
try{
_89.execCommand("UseCSS",false,(false!=_8a));
}
catch(e){
}
var _8c=_89.execCommand(this.CommandID,false,this.Value);
try{
_89.execCommand("UseCSS",false,true);
}
catch(e){
}
return _8c;
}};
Telerik.Web.UI.Editor.BrowserCommand.registerClass("Telerik.Web.UI.Editor.BrowserCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.StyleRuleCommand=function(_8d,_8e,_8f,_90,_91){
Telerik.Web.UI.Editor.StyleRuleCommand.initializeBase(this,[(_8d||sCmdID),_8e,true]);
if(!_8f){
var _92=new Telerik.Web.UI.Editor.Selection(this._window);
_8f=_92.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_8f);
this._styleAttributeName=_90;
this._newValue=_91;
};
Telerik.Web.UI.Editor.StyleRuleCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.StyleRuleCommand(this._title,this._window,null,this._styleAttributeName,this._newValue);
},execute:function(){
var _93=this._nodeBookmark.select();
if(!_93){
return false;
}
if(!this._isExecuted){
this._oldValue=_93.style[this._styleAttributeName];
}
_93.style[this._styleAttributeName]=this._newValue;
this._isExecuted=true;
return true;
},unexecute:function(){
var _94=this._nodeBookmark.select();
_94.style[this._styleAttributeName]=this._oldValue;
}};
Telerik.Web.UI.Editor.StyleRuleCommand.registerClass("Telerik.Web.UI.Editor.StyleRuleCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.AttributeCommand=function(_95,_96,_97,_98,_99){
Telerik.Web.UI.Editor.AttributeCommand.initializeBase(this,[(_95||sCmdID),_96,true]);
if(!_97){
var _9a=new Telerik.Web.UI.Editor.Selection(this._window);
_97=_9a.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_97);
this._attribName=_98;
this._newValue=_99;
};
Telerik.Web.UI.Editor.AttributeCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.AttributeCommand(this._title,this._window,null,this._attribName,this._newValue);
},execute:function(){
var _9b=this._nodeBookmark.select();
if(!_9b){
return false;
}
if(!this._isExecuted){
this._oldValue=_9b.getAttribute(this._attribName);
}
if(this._attribName&&this._attribName.toLowerCase()=="name"&&document.all){
_9b.name=this._newValue;
_9b.removeAttribute("name");
_9b.removeAttribute("NAME");
}
var _9c=this._newValue.trim();
if(""==_9c){
_9b.removeAttribute(this._attribName,0);
if("className"==this._attribName){
_9b.removeAttribute("class",0);
}
}else{
_9b[this._attribName]=this._newValue;
if(this._attribName.toLowerCase()=="nowrap"){
_9b.setAttribute(this._attribName,this._newValue);
}
}
this._isExecuted=true;
return true;
},unexecute:function(){
var _9d=this._nodeBookmark.select();
_9d[this._attribName]=this._oldValue;
}};
Telerik.Web.UI.Editor.AttributeCommand.registerClass("Telerik.Web.UI.Editor.AttributeCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.ClassNameCommand=function(_9e,_9f,_a0){
Telerik.Web.UI.Editor.ClassNameCommand.initializeBase(this,[(_9e||"Classname"),_9f,true]);
};
Telerik.Web.UI.Editor.ClassNameCommand.prototype={getValue:function(_a1){
_a1=_a1||this._window;
if($telerik.isIE){
return this._getValueIE(_a1);
}else{
return this._getValueMoz(_a1);
}
},_getValueIE:function(_a2){
var _a3=new Telerik.Web.UI.Editor.Selection(_a2);
var _a4=_a3.getParentElement();
if("BODY"==_a4.tagName){
return "";
}else{
return (""==_a4.className?"":_a4.className);
}
},_getValueMoz:function(_a5){
if(!_a5){
return "";
}
var _a6=_a5.getSelection();
if(!_a6){
return "";
}
if(_a6.rangeCount!=1){
return "";
}
var _a7=(_a6.focusNode.nodeType!=3?_a6.focusNode:_a6.focusNode.parentNode);
var _a8=(_a6.anchorNode.nodeType!=3?_a6.anchorNode:_a6.anchorNode.parentNode);
if(_a7!=_a8){
return "";
}
var _a9=new Telerik.Web.UI.Editor.Selection(_a5);
var _aa="",_ab;
if(null!=_a9&&null!=(_ab=_a9.getParentElement())){
_aa=_ab.className;
}
return (""==_aa?"":_aa);
}};
Telerik.Web.UI.Editor.ClassNameCommand.registerClass("Telerik.Web.UI.Editor.ClassNameCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.FormatBlockCommand=function(_ac,_ad,_ae){
Telerik.Web.UI.Editor.FormatBlockCommand.initializeBase(this,[(_ac||"Format Block"),_ad,true]);
this.FormatValue=_ae;
};
Telerik.Web.UI.Editor.FormatBlockCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.FormatBlockCommand(this.Title,this._window,this.FormatValue);
},getValue:function(_af){
try{
_af=_af||this._window;
var _b0=_af.document.queryCommandValue("FormatBlock");
if(!document.all){
switch(_b0){
case "x":
case "":
_b0="Normal";
break;
}
}
return _b0;
}
catch(ex){
}
return null;
},_isFormatBlockElement:function(_b1){
if(!_b1||!_b1.tagName){
return false;
}
var _b2=_b1.tagName;
if(_b2=="H1"||_b2=="H2"||_b2=="H3"||_b2=="H4"||_b2=="H5"||_b2=="H6"||_b2=="H7"||_b2=="ADDRESS"||_b2=="PRE"){
return true;
}
},OnExecuteIE:function(){
var _b3=this._window.document;
if("<p>"==this.FormatValue.toLowerCase()){
return _b3.execCommand("FormatBlock",false,"<p>")&&_b3.execCommand("RemoveFormat");
}
var _b4=_b3.selection.createRange();
var _b5=false;
var _b6=_b4.htmlText.trim();
if(_b6&&_b6.length>2&&_b6.substr(0,2).toLowerCase()=="<p"){
_b5=true;
}
if(!_b5&&""!=_b4.text){
var _b7=this.FormatValue.substring(1,this.FormatValue.length-1);
_b3.execCommand("FormatBlock",false,"<p>");
_b3.execCommand("RemoveFormat");
var _b8=_b3.createElement(_b7);
_b8.innerHTML=_b4.htmlText;
_b4.pasteHTML(_b8.outerHTML);
return true;
}else{
return _b3.execCommand("FormatBlock",false,this.FormatValue);
}
},OnExecuteMoz:function(){
var _b9=this.FormatValue.substring(1,this.FormatValue.length-1);
var _ba=this._window.document;
var _bb=("body"==this.FormatValue.toLowerCase()||"normal"==this.FormatValue.toLowerCase());
var _bc=null;
var _bd=_b9.indexOf(" ");
if(_bd!=-1){
_bc=_b9.substring(_bd+1);
_b9=_b9.substring(0,_bd);
}
if(this.isSafari){
if(_bb){
}else{
var _be=_ba.createElement(_b9);
if(_bc){
var _bf="";
_bf=_bc.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_bf.length>0){
_be.className=_bf;
}
}
var _c0=new Telerik.Web.UI.Editor.Selection(this._window);
_be.innerHTML=_c0.getHtml();
var _c1=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_be.outerHTML,true);
_c1.execute();
}
return;
}
if(_bb){
return _ba.execCommand("FormatBlock",false,"Normal");
}
var _c2=this._window.getSelection();
if(_c2.rangeCount<1){
return false;
}
var _c3=_c2.getRangeAt(0);
var _c4=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
if(_c3.toString()!=""&&!this._isFormatBlockElement(_c4)){
try{
var _be=_ba.createElement(_b9);
if(_bc){
var _bf="";
_bf=_bc.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_bf.length>0){
_be.className=_bf;
}
}
_be.appendChild(_c3.extractContents());
_c3.insertNode(_be);
return true;
}
catch(ex){
return false;
}
}else{
return _ba.execCommand("FormatBlock",false,this.FormatValue);
}
return false;
}};
Telerik.Web.UI.Editor.FormatBlockCommand.registerClass("Telerik.Web.UI.Editor.FormatBlockCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.InsertListCommand=function(_c5,_c6,_c7,_c8,_c9){
Telerik.Web.UI.Editor.InsertListCommand.initializeBase(this,[(_c5||"Insert List"),_c6,true]);
this._newLineBr=(_c7==true);
this._commandName=_c8;
this._listType=(_c8=="InsertOrderedList")?"OL":"UL";
this._listStyle=_c9;
this._document=this._window.document;
};
Telerik.Web.UI.Editor.InsertListCommand.prototype={_insertList:function(){
return this._document.execCommand(this._commandName,false,false);
},_pasteHtml:function(_ca){
var _cb=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_ca);
_cb.execute();
},_expandSelection:function(_cc,_cd,_ce){
var _cf=_cc.duplicate();
var _d0=null;
var _d1=null;
for(var i=_cd.length-1;i>=0;i--){
_cf.moveToElementText(_cd[i]);
var _d3=_cc.compareEndPoints("StartToStart",_cf);
if(-1==_d3||0==_d3){
if(_ce[_cd[i].tagName]!=null){
_d1=_cd[i];
}
}else{
if(_ce[_cd[i].tagName]!=null){
_d0=_cd[i];
break;
}
}
}
if(_d0){
_cf.moveToElementText(_d0);
_cc.setEndPoint("StartToEnd",_cf);
}else{
var _d4=_cc.parentElement();
_cf.moveToElementText(_d4);
_cc.setEndPoint("StartToStart",_cf);
}
if(_d1){
_cf.moveToElementText(_d1);
if("BR"==_d1.tagName){
_cc.setEndPoint("EndToEnd",_cf);
}else{
_cc.setEndPoint("EndToStart",_cf);
}
}else{
var _d4=_cc.parentElement();
_cf.moveToElementText(_d4);
_cc.setEndPoint("EndToEnd",_cf);
}
_cc.select();
},_handleEmptyListSelection:function(_d5,_d6){
var _d7=_d5.parentElement();
var _d8=(_d7&&"P"==_d7.tagName.toUpperCase());
var brs=_d7.getElementsByTagName("BR");
if(_d8&&brs.length==0){
return this._insertList();
}else{
var _da={};
_da["BR"]="";
_da["TD"]="";
_da["OL"]="";
_da["UL"]="";
_da["TABLE"]="";
_da["DIV"]="";
_da["IMG"]="";
_da["OBJECT"]="";
var _db=_d5.parentElement().getElementsByTagName("*");
this._expandSelection(_d5,_db,_da);
if(_d5.htmlText){
return this.OnExecuteIE();
}
}
},OnExecuteIE:function(){
if(!this._newLineBr){
return this._insertList();
}
var _dc=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
var _dd=this._document.selection.createRange();
if("OL"==_dc.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_dc,"OL")!=null||"UL"==_dc.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_dc,"UL")!=null){
return this._insertList();
}else{
if("TD"==_dc.tagName||"TR"==_dc.tagName||"TBODY"==_dc.tagName||"TABLE"==_dc.tagName){
var _dd=this._document.selection.createRange();
var _de=_dd.parentElement().getElementsByTagName("TD");
for(var i=_de.length-1;i>=0;i--){
brRange=_dd.duplicate();
brRange.moveToElementText(_de[i]);
if(_dd.inRange(brRange)&&_de[i].innerHTML!=""){
_dd.moveToElementText(_de[i]);
}
}
}
}
var _e0=this._document.selection;
var _e1=this._listType;
if(_e0.type=="Control"){
var _e2=this._document.body.createTextRange();
_e2.moveToElementText(_dd(0));
var _e3=_e2.parentElement();
var _e4=_e3.tagName.toLowerCase();
if(_e4=="table"||_e4=="tbody"){
var _e5=_e3.parentNode.outerHTML;
_e3.parentNode.outerHTML="<"+_e1+"><LI>"+_e5+"</LI></"+_e1+">";
}else{
var _e5=_e2.htmlText;
this._pasteHtml("<"+_e1+"><LI>"+_e5+"</LI></"+_e1+">");
}
}else{
if(_dd.htmlText==""){
return this._handleEmptyListSelection(_dd,this._commandName);
}
var _e6=this._document.createElement("SPAN");
_e6.innerHTML=_dd.htmlText;
if(_e6.getElementsByTagName("P").length>0){
return this._insertList();
}else{
var _e7;
if(_dd.parentElement().tagName.toUpperCase()=="LI"){
_e7=_dd.parentElement().parentNode;
}else{
_e7=_dd.parentElement();
}
if(_e7.tagName.toUpperCase()=="OL"||_e7.tagName.toUpperCase()=="UL"){
var _e8=_e7.tagName.toUpperCase();
if(_e1==_e8){
if(this._newLineBr){
var _e9=_dd.duplicate();
var _ea=_dd.duplicate();
_ea.moveToElementText(_e7);
var _eb=_dd.duplicate();
var _ec=_e7.getElementsByTagName("LI");
var _ed=0;
var _ee=_ec.length-1;
var _ef=_dd.duplicate();
_ef.moveToElementText(_ec[0]);
var _f0=_dd.duplicate();
_f0.moveToElementText(_ec[_ec.length-1]);
_eb.setEndPoint("EndToEnd",_f0);
_eb.setEndPoint("StartToStart",_ef);
while((_ed<_ec.length)&&(_eb.compareEndPoints("StartToStart",_e9)<=0)){
_eb.moveToElementText(_ec[_ed]);
_eb.setEndPoint("EndToEnd",_f0);
_ed++;
}
_ed-=2;
while((_ee>0)&&(_eb.compareEndPoints("EndToEnd",_e9)>=0)){
_eb.moveToElementText(_ec[_ee]);
_eb.setEndPoint("StartToStart",_ef);
_ee--;
}
_ee+=2;
var _f1=_dd.duplicate();
var _f2=_dd.duplicate();
_f1.moveToElementText(_ec[_ed]);
_f1.collapse(true);
_f1.setEndPoint("StartToStart",_ea);
_f2.moveToElementText(_ec[_ee]);
_f2.collapse(false);
_f2.setEndPoint("EndToEnd",_ea);
_dd.setEndPoint("StartToEnd",_f1);
_dd.setEndPoint("EndToStart",_f2);
var _f3="";
var _f4=false;
var _f5=false;
if(_f1.htmlText.replace(/<(.*?)>/)!=""){
_f3+="<"+_e8+">"+_f1.htmlText+"</"+_e8+">";
}else{
_f4=true;
}
_f3+=_dd.htmlText.replace(/<LI\/?>/gi,"<BR>").replace(/<\/LI>/gi,"").replace(/^\s*<BR\/?>/gi,"").replace(/<BR\/?>\s*$/gi,"");
if(_f2.htmlText.replace(/<(.*?)>/)!=""){
_f3+="<"+_e8+">"+_f2.htmlText+"</"+_e8+">";
}else{
_f5=true;
_f3+="<BR>";
}
if(_f4&&_f5){
_f3=_f3.replace(new RegExp("</?"+_e8+"/?>","gi"),"").replace(/^\s*<BR\/?>/gi,"");
}
if(_e7.parentNode.childNodes[0]==_e7){
_ea.collapse();
_e7.parentNode.removeChild(_e7,_f3);
}else{
_ea.moveStart("character",-1);
}
this._pasteHtml(_f3);
}else{
return this._insertList();
}
}else{
return this._insertList();
}
}else{
var _f6=_dd.duplicate();
_f6.collapse(false);
_f6.moveEnd("character",1);
if(_f6.htmlText.match(/<BR\/?>/gi)){
_dd.moveEnd("character",1);
}
var _f7="<"+_e1+"><LI>"+_dd.htmlText.replace(/(<BR\s*>\s*)*$/gi,"").replace(/<BR\/?>$/gi,"").replace(/<BR\/?>/gi,"</LI><LI>")+"</LI></"+_e1+">";
try{
_dd.pasteHTML(_f7);
}
catch(e){
}
}
}
}
return true;
},OnExecuteMoz:function(){
return this._insertList();
}};
Telerik.Web.UI.Editor.InsertListCommand.registerClass("Telerik.Web.UI.Editor.InsertListCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableCommandBase=function(_f8,_f9){
Telerik.Web.UI.Editor.TableCommandBase.initializeBase(this,[(_f8||"Table Command"),_f9,true]);
};
Telerik.Web.UI.Editor.TableCommandBase.prototype={getState:function(_fa){
return this.getSelectedCell(_fa)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
},getSelectedCell:function(_fb){
var _fc=new Telerik.Web.UI.Editor.Selection(_fb||this._window);
var _fd;
if(_fc){
_fd=_fc.getParentElement();
}
while(null!=_fd&&_fd.tagName!="TD"&&_fd.tagName!="TH"&&_fd.tagName!="BODY"){
_fd=_fd.parentNode;
}
if(!_fd||!_fd.tagName){
return null;
}
return (_fd.tagName=="TD"||_fd.tagName=="TH"?_fd:null);
},getSelectedRow:function(_fe){
var _ff=new Telerik.Web.UI.Editor.Selection(_fe||this._window);
var _100;
if(_ff){
_100=_ff.getParentElement();
}
if(!_100){
return null;
}
while(null!=_100&&_100.tagName!="TR"&&_100.tagName!="BODY"){
_100=_100.parentNode;
}
return (_100&&_100.tagName=="TR"?_100:null);
},getParentTable:function(_101){
if(!_101){
return null;
}
while(null!=_101&&_101.parentNode!=_101&&"TABLE"!=_101.tagName){
_101=_101.parentNode;
}
return (_101&&_101.tagName=="TABLE"?_101:null);
},getNextSiblingCell:function(cell){
if(!cell){
return null;
}
var row=cell.parentNode;
var _104=cell.cellIndex+1;
if(0<=_104&&_104<row.cells.length){
return row.cells[_104];
}
return null;
},getPreviouseSiblingCell:function(cell){
if(!cell){
return null;
}
var row=cell.parentNode;
var _107=cell.cellIndex-1;
if(0<=_107&&_107<row.cells.length){
return row.cells[_107];
}
return null;
}};
Telerik.Web.UI.Editor.TableCommandBase.registerClass("Telerik.Web.UI.Editor.TableCommandBase",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableInsertRow=function(_108,_109,_10a){
Telerik.Web.UI.Editor.TableInsertRow.initializeBase(this,[(_108||"Insert row"),_109,true]);
this._direction=_10a||"above";
};
Telerik.Web.UI.Editor.TableInsertRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertRow(this._title,this._window,this._direction);
},getState:function(_10b){
return (this.getSelectedRow(_10b)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var row=cell.parentNode;
var _10e=row.rowIndex;
if("below"==this._direction){
_10e++;
}
var _10f=this.getParentTable(row);
if(!_10f){
return false;
}
var _110=_10f.insertRow(_10e);
if(!_110){
return false;
}
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(row,_110);
var _111;
for(var i=0;i<row.cells.length;i++){
cell=row.cells[i];
_111=_110.insertCell(-1);
_111.colSpan=cell.colSpan;
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_111);
_111.innerHTML=this.isIE?"":"&nbsp;";
}
return true;
}};
Telerik.Web.UI.Editor.TableInsertRow.registerClass("Telerik.Web.UI.Editor.TableInsertRow",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteRow=function(_113,_114){
Telerik.Web.UI.Editor.TableDeleteRow.initializeBase(this,[(_113||"Delete Row"),_114,true]);
};
Telerik.Web.UI.Editor.TableDeleteRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableDeleteRow(this._title,this._window);
},getState:function(_115){
return (this.getSelectedRow(_115)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var row=this.getSelectedRow();
if(!row){
return false;
}
row.parentNode.removeChild(row);
return true;
}};
Telerik.Web.UI.Editor.TableDeleteRow.registerClass("Telerik.Web.UI.Editor.TableDeleteRow",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableInsertColumn=function(_117,_118,_119){
Telerik.Web.UI.Editor.TableInsertColumn.initializeBase(this,[(_117||"Insert column"),_118,true]);
this._direction=_119||"left";
};
Telerik.Web.UI.Editor.TableInsertColumn.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertColumn(this._title,this._window,this._direction);
},getState:function(_11a){
return (this.getSelectedCell(_11a)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _11c=cell.cellIndex;
if("right"==this._direction){
_11c++;
}
var _11d=this.getParentTable(cell);
if(!_11d){
return false;
}
var rows=_11d.rows;
var _11f;
for(var i=0;i<rows.length;i++){
_11f=rows[i].insertCell(_11c);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_11f);
_11f.innerHTML=this.isIE?"":"&nbsp;";
}
return true;
}};
Telerik.Web.UI.Editor.TableInsertColumn.registerClass("Telerik.Web.UI.Editor.TableInsertColumn",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteColumn=function(_121,_122,_123){
Telerik.Web.UI.Editor.TableDeleteColumn.initializeBase(this,[(_121||"Delete column"),_122,true]);
};
Telerik.Web.UI.Editor.TableDeleteColumn.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableDeleteColumn.New(this._title,this._window);
},getState:function(_124){
return (this.getSelectedCell(_124)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _126=cell.cellIndex;
var _127=this.getParentTable(cell);
if(!_127){
return false;
}
var rows=_127.rows;
for(var i=0;i<rows.length;i++){
cell=rows[i].cells[_126];
if(cell){
cell.parentNode.removeChild(cell);
}
}
return true;
}};
Telerik.Web.UI.Editor.TableDeleteColumn.registerClass("Telerik.Web.UI.Editor.TableDeleteColumn",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeRows=function(_12a,_12b){
Telerik.Web.UI.Editor.TableMergeRows.initializeBase(this,[(_12a||"Merge rows"),_12b,true]);
};
Telerik.Web.UI.Editor.TableMergeRows.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeRows.New(this._title,this._window);
},getState:function(_12c){
var cell=this.getSelectedCell(_12c);
if(null!=cell&&null!=this.getLowerCell(cell)&&1==cell.colSpan){
return Telerik.Web.UI.Editor.CommandStates.Off;
}else{
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _12f=this.getLowerCell(cell);
if(!_12f){
return false;
}
if(""!=_12f.innerHTML){
if(""!=cell.innerHTML){
cell.innerHTML+="<br>";
}
cell.innerHTML+=_12f.innerHTML;
}
cell.rowSpan+=_12f.rowSpan;
_12f.parentNode.removeChild(_12f);
return true;
},getLowerCell:function(cell){
if(!cell){
return null;
}
var _131=this.getParentTable(cell);
var row=cell.parentNode;
var _133=_131.rows[row.rowIndex+cell.rowSpan];
if(!_133){
return null;
}
var _134=_133.cells[cell.cellIndex];
return _134;
}};
Telerik.Web.UI.Editor.TableMergeRows.registerClass("Telerik.Web.UI.Editor.TableMergeRows",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeColumns=function(_135,_136){
Telerik.Web.UI.Editor.TableMergeColumns.initializeBase(this,[(_135||"Merge columns"),_136,true]);
};
Telerik.Web.UI.Editor.TableMergeColumns.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeColumns.New(this._title,this._window);
},getState:function(_137){
var cell=this.getSelectedCell(_137);
if(null!=cell&&null!=this.getNextSiblingCell(cell)){
return Telerik.Web.UI.Editor.CommandStates.Off;
}else{
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
},onExecute:function(){
var cell=this.getSelectedCell();
if(null==cell){
return false;
}
var _13a=this.getNextSiblingCell(cell);
if(!_13a){
return false;
}
cell.colSpan+=_13a.colSpan;
if(""!=_13a.innerHTML){
if(""!=cell.innerHTML){
cell.innerHTML+="<br>";
}
cell.innerHTML+=_13a.innerHTML;
}
_13a.parentNode.removeChild(_13a);
return true;
}};
Telerik.Web.UI.Editor.TableMergeColumns.registerClass("Telerik.Web.UI.Editor.TableMergeColumns",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableSplitCell=function(_13b,_13c){
Telerik.Web.UI.Editor.TableSplitCell.initializeBase(this,[(_13b||"Split cell"),_13c,true]);
this._newRows=2;
this._newColumns=2;
};
Telerik.Web.UI.Editor.TableSplitCell.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableSplitCell(this._title,this._window);
},getState:function(_13d){
var cell=this.getSelectedCell(_13d);
if(!cell){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
return ((cell.colSpan>1||cell.rowSpan>1)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _140=this.getParentTable(cell);
if(!_140){
return false;
}
var row=cell.parentNode;
var _142=("THEAD"==row.parentNode.tagName.toUpperCase()?"TH":"TD");
if(cell.colSpan>1){
for(i=1;i<this._newColumns;i++){
var _143=this._window.document.createElement(_142);
_143.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_143);
_143.colSpan=1;
if(cell.cellIndex+1<row.cells.length){
row.insertBefore(_143,row.cells[cell.cellIndex+1]);
}else{
row.appendChild(_143);
}
cell.colSpan--;
}
}
if(cell.rowSpan>1){
for(i=1;i<this._newRows;i++){
var _144=_140.rows[row.rowIndex+cell.rowSpan-1];
if(!_144||0==_144.cells.length){
break;
}
var _143=this._window.document.createElement(_142);
_143.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_143);
_143.rowSpan=1;
if(cell.cellIndex+1<_144.cells.length){
_144.insertBefore(_143,_144.cells[cell.cellIndex+1]);
}else{
_144.appendChild(_143);
}
cell.rowSpan--;
}
}
return true;
}};
Telerik.Web.UI.Editor.TableSplitCell.registerClass("Telerik.Web.UI.Editor.TableSplitCell",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteCell=function(_145,_146){
Telerik.Web.UI.Editor.TableDeleteCell.initializeBase(this,[(_145||"Delete cell"),_146,true]);
};
Telerik.Web.UI.Editor.TableDeleteCell.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableDeleteCell(this._title,this._window);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
cell.parentNode.removeChild(cell);
return true;
}};
Telerik.Web.UI.Editor.TableDeleteCell.registerClass("Telerik.Web.UI.Editor.TableDeleteCell",Telerik.Web.UI.Editor.TableCommandBase);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorButton=function(_148){
Telerik.Web.UI.EditorButton.initializeBase(this,[_148]);
this._attributes={};
this._autoPostBack=false;
this._enabled=true;
this._name="";
this._text="";
this._shortCut="";
this._showIcon=true;
this._showText=false;
this._clientTypeName="Telerik.Web.UI.EditorButton";
this._isOn=false;
this._skin="";
this._addClickHandler=false;
};
Telerik.Web.UI.EditorButton.createToolWrapper=function(_149,skin){
var ul=document.createElement("UL");
var li=document.createElement("LI");
li.innerHTML="&nbsp;";
li.className="rade_grip grip_first";
ul.appendChild(li);
ul.className="rade_toolbar "+skin;
var _14d=_149.get_element();
ul.appendChild(_14d);
li=document.createElement("LI");
li.innerHTML="&nbsp;";
li.className="rade_grip grip_last";
ul.appendChild(li);
return ul;
};
Telerik.Web.UI.EditorButton.getToolRootNode=function(_14e){
while(_14e&&_14e.tagName!="LI"){
_14e=_14e.parentNode;
}
return _14e;
};
Telerik.Web.UI.EditorButton._createButton=function(_14f){
var _150=document.createElement("LI");
var a=document.createElement("A");
_150.appendChild(a);
a.className=_14f.showText==true?"rade_tool_text":"rade_tool";
var text=_14f["text"];
a.title=text?text:_14f["name"];
a.href="#";
a.setAttribute("unselectable","on");
if(_14f.showIcon!=false){
var span=document.createElement("SPAN");
span.className=_14f.name;
span.innerHTML="&nbsp;";
span.setAttribute("unselectable","on");
a.appendChild(span);
}
if(_14f.showText==true){
var span=document.createElement("SPAN");
span.className="rade_button_text";
span.innerHTML=_14f.text?_14f.text:_14f.name;
span.setAttribute("unselectable","on");
a.appendChild(span);
}
return _150;
};
Telerik.Web.UI.EditorButton.createTool=function(_154,_155,type,_157,_158){
if(!type){
type=Telerik.Web.UI.EditorButton;
}
if(!_157){
_157=Telerik.Web.UI.EditorButton._createButton(_154);
if(type==Telerik.Web.UI.EditorSplitButton||type.inheritsFrom(Telerik.Web.UI.EditorSplitButton)){
var a=_157.getElementsByTagName("A")[0];
if(a){
Sys.UI.DomElement.addCssClass(a,"rad_splitbutton");
var span=document.createElement("SPAN");
span.className="split_arrow";
span.innerHTML="&nbsp;";
a.appendChild(span);
}
}else{
if(type==Telerik.Web.UI.EditorDropDown||type.inheritsFrom(Telerik.Web.UI.EditorDropDown)){
var a=_157.getElementsByTagName("A")[0];
if(a){
Sys.UI.DomElement.removeCssClass(a,"rade_tool");
Sys.UI.DomElement.addCssClass(a,"rade_dropdown");
a.innerHTML="";
var span=document.createElement("SPAN");
span.innerHTML="&nbsp;";
var _15b=_154["width"]?_154["width"]:"50px";
span.style.width=_15b;
a.appendChild(span);
}
}
}
}
var tool=$create(type,_154,_155,null,_157);
if(_158&&_158.appendChild){
_158.appendChild(_157);
}
return tool;
};
Telerik.Web.UI.EditorButton.prototype={initialize:function(){
var _15d=this.getAnchorElement();
if(_15d){
if(!_15d.title||_15d.title.length==0){
_15d.title=this.get_text();
}
_15d.setAttribute("unselectable","on");
}
var span=this.getSpanElement();
if(span){
span.setAttribute("unselectable","on");
}
if(this._addClickHandler){
var _15f=this.get_element();
$addHandlers(_15f,{"click":this.click},this);
}
},dispose:function(){
var _160=this.get_element();
if(_160){
$clearHandlers(_160);
}
Telerik.Web.UI.EditorButton.callBaseMethod(this,"dispose");
},click:function(e){
this.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(e);
},add_valueSelected:function(_162){
this.get_events().addHandler("valueSelected",_162);
},remove_valueSelected:function(_163){
this.get_events().removeHandler("valueSelected",_163);
},raiseEvent:function(_164,_165){
var _166=this.get_events().getHandler(_164);
if(_166){
if(!_165){
_165=Sys.EventArgs.Empty;
}
_166(this,_165);
}
},set_width:function(_167){
var span=this.getSpanElement();
if(span){
span.style.width=_167;
}
},get_width:function(){
return this.get_element().offsetWidth;
},set_height:function(_169){
var span=this.getSpanElement();
if(span){
span.style.height=_169;
}
},get_height:function(){
return this.get_element().offsetHeight;
},isTarget:function(e){
return $telerik.isDescendantOrSelf(this.get_element(),e.target);
},setState:function(_16c){
this.set_enabled(_16c!=Telerik.Web.UI.Editor.CommandStates.Disabled);
this.setOn(_16c==Telerik.Web.UI.Editor.CommandStates.On);
},setFocus:function(){
var elem=this.getAnchorElement();
if(elem&&elem.focus){
elem.focus();
}
},get_addClickHandler:function(){
return this._addClickHandler;
},set_addClickHandler:function(_16e){
this._addClickHandler=_16e;
},get_attributes:function(){
return this._attributes;
},set_attributes:function(_16f){
this._attributes=_16f;
},get_autoPostBack:function(){
return this._autoPostBack;
},set_autoPostBack:function(_170){
this._autoPostBack=_170;
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_171){
if(this._enabled!=_171){
this._enabled=_171;
var _172=this.getAnchorElement();
if(!this._enabled){
this._addAnchorCssClass("rade_tool_disabled");
_172.setAttribute("disabled","disabled");
}else{
this._removeAnchorCssClass("rade_tool_disabled");
_172.removeAttribute("disabled");
}
}
},isOn:function(){
return this._isOn;
},setOn:function(_173){
if(this._isOn!=_173){
this._isOn=_173;
if(this._isOn){
this._addAnchorCssClass("rade_tool_selected");
}else{
this._removeAnchorCssClass("rade_tool_selected");
}
}
},get_name:function(){
return this._name;
},set_name:function(_174){
this._name=_174;
},get_text:function(){
if(!this._text){
return this.get_name();
}else{
return this._text;
}
},set_text:function(_175){
if(this._text!=_175){
this._text=_175;
if(this.get_showText()){
this.getSpanElement().innerHTML=_175;
}
}
},get_shortCut:function(){
return this._shortCut;
},set_shortCut:function(_176){
this._shortCut=_176;
},get_showIcon:function(){
return this._showIcon;
},set_showIcon:function(_177){
if(this._showIcon!=_177){
this._showIcon=_177;
}
},get_skin:function(){
return this._skin;
},set_skin:function(_178){
this._skin=_178;
},_addAnchorCssClass:function(_179){
Sys.UI.DomElement.addCssClass(this.getAnchorElement(),_179);
},_removeAnchorCssClass:function(_17a){
Sys.UI.DomElement.removeCssClass(this.getAnchorElement(),_17a);
},get_showText:function(){
return this._showText;
},set_showText:function(_17b){
if(this._showText!=_17b){
this._showText=_17b;
}
},get_type:function(){
return this._type;
},set_type:function(_17c){
this._type=_17c;
},get_clientTypeName:function(){
return this._clientTypeName;
},set_clientTypeName:function(_17d){
this._clientTypeName=_17d;
},getAnchorElement:function(){
var _17e=this.get_element().firstChild;
while(_17e!=null&&(_17e.tagName==null)){
_17e=_17e.nextSibling;
}
return _17e;
},getSpanElement:function(){
var _17f=this.getAnchorElement();
var _180=_17f.firstChild;
while(_180!=null&&(_180.tagName==null||_180.tagName.toLowerCase()!="span")){
_180=_180.nextSibling;
}
return _180;
}};
Telerik.Web.UI.EditorButton.registerClass("Telerik.Web.UI.EditorButton",Sys.UI.Control);
Telerik.Web.UI.EditorSpinBoxEventArgs=function(_181,_182){
Telerik.Web.UI.EditorSpinBoxEventArgs.initializeBase(this);
this._newValue=_181;
this._oldValue=_182;
};
Telerik.Web.UI.EditorSpinBoxEventArgs.prototype={get_oldValue:function(){
return this._oldValue;
},get_newValue:function(){
return this._newValue;
}};
Telerik.Web.UI.EditorSpinBoxEventArgs.registerClass("Telerik.Web.UI.EditorSpinBoxEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.EditorSpinBox=function(_183){
Telerik.Web.UI.EditorSpinBox.initializeBase(this,[_183]);
this._width="50px";
this._className="rade_SpinBox";
this._selectedItem="";
this._initialValue="";
this._visibleInput=true;
this._enabledIncrease=true;
this._enabledDecrease=true;
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSpinBox.prototype={dispose:function(){
this._inputElement.onchange=null;
this._inputElement.onkeypress=null;
this._inputElement.onclick=null;
this._inputElement=null;
this._increaseButton.onclick=null;
this._increaseButton=null;
this._decreaseButton.onclick=null;
this._decreaseButton=null;
Telerik.Web.UI.EditorSpinBox.callBaseMethod(this,"dispose");
},initialize:function(){
this._createInputElement();
this._createPlusMinusList();
},_createInputElement:function(){
var _184=document.createElement("INPUT");
_184.setAttribute("size","3");
_184.style.width="30px";
_184.onclick=function(e){
this.focus();
};
_184.onkeypress=Function.createDelegate(this,this._onKeyPressHandler);
_184.onchange=Function.createDelegate(this,this._onChangeHandler);
this._inputElement=_184;
var _186=this.get_element();
_186.appendChild(_184);
_186.style.width=this.get_width();
_186.className=(this.get_skin()+" "+this._className);
},_createPlusMinusList:function(){
var _187=document.createElement("UL");
this.get_element().appendChild(_187);
var _188=document.createElement("LI");
Sys.UI.DomElement.addCssClass(_188,"rade_SpinBox_tool rade_sbt_increase");
_187.appendChild(_188);
var _189=document.createElement("A");
_189.title="Increase";
_189.href="javascript:void(0);";
_189.innerHTML="<span>+</span>";
_189.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
_188.appendChild(_189);
this._increaseButton=_189;
var _188=document.createElement("LI");
Sys.UI.DomElement.addCssClass(_188,"rade_SpinBox_tool rade_sbt_decrease");
_187.appendChild(_188);
var _189=document.createElement("A");
_189.title="Decrease";
_189.href="javascript:void(0);";
_189.innerHTML="<span>-</span>";
_189.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
_188.appendChild(_189);
this._decreaseButton=_189;
},_executeFunction:function(e,elem,_18c){
if(_18c){
if(elem.Executed){
elem.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
elem.Executed=true;
var _18d=(this._selectedItem!="")?this._selectedItem:this._initialValue;
this._selectedItem=elem.value;
var _18e=new Telerik.Web.UI.EditorSpinBoxEventArgs(elem.value,_18d);
this.raiseEvent("valueSelected",_18e);
},_onPlusMinusClickHandler:function(e){
var _190=null;
if(!e){
_190=window.event.srcElement;
}else{
_190=e.target;
}
if(!_190){
return;
}
var _191=_190.parentNode;
var _192=this.get_value();
_192=_192.replace(/^0+(\d)/ig,"$1");
if(""==_192){
_192="0";
}
var _193=parseInt(_192);
var _194=_193+"";
if(isNaN(_193)){
return;
}else{
_194=_192.substring(_194.length);
}
if(_191==this._increaseButton){
if(this._enabledIncrease){
_193++;
}else{
return;
}
}else{
if(_191==this._decreaseButton){
if(this._enabledDecrease){
_193--;
}else{
return;
}
}else{
_191=null;
}
}
if(_191){
this.set_value(_193+_194);
this._executeFunction(e,this._inputElement);
}
},_onChangeHandler:function(e){
if(!e){
e=window.event;
}
this._executeFunction(e,this._inputElement);
},_onKeyPressHandler:function(e){
if(!e){
e=window.event;
}
if(e.keyCode==13){
this._executeFunction(e,this._inputElement);
return $telerik.cancelRawEvent(e);
}
},_onKeyDownHandler:function(e){
if(!e){
var e=window.event;
}
e.returnValue=this._isKeyValid(e);
},_onKeyUpHandler:function(e){
if(!e){
var e=window.event;
}
if(this._isKeyValid(e,true)){
var _199=this._selectedItem;
var _19a=this.get_value();
var _19b=new Telerik.Web.UI.EditorSpinBoxEventArgs(_19a,_199);
this.raiseEvent("valueSelected",_19b);
}
},_isKeyValid:function(e,_19d){
try{
if(!_19d){
_19d=false;
}
if(!e){
e=window.event;
}
var _19e=((48<=e.keyCode&&e.keyCode<=57)||(96<=e.keyCode&&e.keyCode<=105)||(13==e.keyCode)||(8==e.keyCode)||(46==e.keyCode)||(9==e.keyCode));
if(!_19d){
_19e|=((35<=e.keyCode&&e.keyCode<=40));
}
return _19e;
}
catch(ex){
return true;
}
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_19f){
if(null==_19f){
_19f="";
}
this._inputElement.value=_19f;
if(this._initialValue==""){
this._initialValue=_19f;
}
},get_width:function(){
return this._width;
},set_width:function(_1a0){
this._width=_1a0;
var _1a1=this.get_element();
_1a1.style.width=this._width;
},get_enabledIncrease:function(){
return this._enabledIncrease;
},set_enabledIncrease:function(_1a2){
this._enabledIncrease=_1a2;
if(!this._enabledIncrease){
Sys.UI.DomElement.addCssClass(this._increaseButton,"disabled-button");
}else{
Sys.UI.DomElement.removeCssClass(this._increaseButton,"disabled-button");
}
},get_enabledDecrease:function(){
return this._enabledDecrease;
},set_enabledDecrease:function(_1a3){
this._enabledDecrease=_1a3;
if(!this._enabledDecrease){
Sys.UI.DomElement.addCssClass(this._decreaseButton,"disabled-button");
}else{
Sys.UI.DomElement.removeCssClass(this._decreaseButton,"disabled-button");
}
},get_visibleInput:function(){
return this._visibleInput;
},set_visibleInput:function(_1a4){
this._visibleInput=_1a4;
if(!this._visibleInput){
this._inputElement.style.display="none";
}else{
this._inputElement.style.display="";
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1a5){
this._clientStateFieldID=_1a5;
}};
Telerik.Web.UI.EditorSpinBox.registerClass("Telerik.Web.UI.EditorSpinBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorCheckBox=function(_1a6){
Telerik.Web.UI.EditorCheckBox.initializeBase(this,[_1a6]);
this._selectedItem=false;
};
Telerik.Web.UI.EditorCheckBox.prototype={dispose:function(){
this._inputElement.onclick=null;
this._inputElement.Parent=null;
this._inputElement=null;
Telerik.Web.UI.EditorCheckBox.callBaseMethod(this,"dispose");
},get_selectedItem:function(){
return this._selectedItem;
},set_value:function(_1a7){
if(this._inputElement.checked!=_1a7){
this._inputElement.checked=_1a7;
}
},initialize:function(){
var _1a8=document.createElement("INPUT");
_1a8.setAttribute("type","CHECKBOX");
_1a8.Parent=this;
_1a8.onclick=function(e){
var oP=this.Parent;
oP._selectedItem=!oP._selectedItem;
this.checked=oP._selectedItem;
oP._selectedItem=this.checked;
oP.raiseEvent("valueSelected");
};
this._inputElement=_1a8;
this.get_element().appendChild(_1a8);
}};
Telerik.Web.UI.EditorCheckBox.registerClass("Telerik.Web.UI.EditorCheckBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorTextBox=function(_1ab){
Telerik.Web.UI.EditorTextBox.initializeBase(this,[_1ab]);
this._width="110px";
this._selectedItem="";
};
Telerik.Web.UI.EditorTextBox.prototype={dispose:function(){
this._inputElement.onchange=null;
this._inputElement.onkeypress=null;
this._inputElement.onclick=null;
this._inputElement.Parent=null;
this._inputElement=null;
Telerik.Web.UI.EditorTextBox.callBaseMethod(this,"dispose");
},get_width:function(){
return this._width;
},set_width:function(_1ac){
this._width=_1ac;
},initialize:function(){
var _1ad=document.createElement("INPUT");
_1ad.style.width=this.get_width();
_1ad.Parent=this;
var _1ae=this.get_name();
var _1af=function(e,elem,_1b2){
if(_1b2){
if(elem.Executed){
elem.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
elem.Executed=true;
elem.Parent._selectedItem=elem.value;
elem.Parent.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(e);
};
_1ad.onchange=function(e){
if(!e){
e=window.event;
}
return _1af(e,this,true);
};
_1ad.onclick=function(e){
this.focus();
};
_1ad.onkeypress=function(e){
if(!e){
e=window.event;
}
if(e.keyCode==13){
return _1af(e,this);
}
};
this._inputElement=_1ad;
this.get_element().appendChild(_1ad);
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1b6){
if(null==_1b6){
_1b6="";
}
this._inputElement.value=_1b6;
}};
Telerik.Web.UI.EditorTextBox.registerClass("Telerik.Web.UI.EditorTextBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.ImageDialogCaller=function(_1b7){
Telerik.Web.UI.ImageDialogCaller.initializeBase(this,[_1b7]);
this._width="150px";
this._className="rade_ImageDialogCaller";
this._editor=null;
this._clientStateFieldID=null;
};
Telerik.Web.UI.ImageDialogCaller.prototype={dispose:function(){
this._inputElement=null;
this._pushButton.onclick=null;
this._pushButton=null;
this._editor=null;
Telerik.Web.UI.ImageDialogCaller.callBaseMethod(this,"dispose");
},initialize:function(){
this._createInputElement();
this._createButton();
var _1b8=this.get_element();
_1b8.style.width=parseInt(this._inputElement.style.width)+30+"px";
_1b8.className=(this.get_skin()+" "+this._className);
},_createInputElement:function(){
var _1b9=document.createElement("INPUT");
_1b9.style.width=this.get_width();
this._inputElement=_1b9;
this.get_element().appendChild(_1b9);
},_createButton:function(){
var _1ba=document.createElement("A");
_1ba.title="Call Image Manager";
_1ba.href="javascript:void(0);";
_1ba.onclick=Function.createDelegate(this,this._onButtonClickHandler);
_1ba.innerHTML="<span>...</span>";
this.get_element().appendChild(_1ba);
this._pushButton=_1ba;
},_onButtonClickHandler:function(e){
var _1bc=this;
var _1bd=function(_1be,args){
var src="";
var img=args.Result;
if(img){
src=img.getAttribute("src",2);
}
if(src){
_1bc._inputElement.value=src;
_1bc.raiseEvent("valueSelected");
}
};
var args={editor:this.get_editor()};
this._editor.showDialog("ImageManager",args,_1bd);
},get_editor:function(){
return this._editor;
},set_editor:function(_1c3){
this._editor=_1c3;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1c4){
if(null==_1c4){
_1c4="";
}
this._inputElement.value=_1c4;
},get_width:function(){
return this._width;
},set_width:function(_1c5){
this._width=_1c5;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1c6){
this._clientStateFieldID=_1c6;
}};
Telerik.Web.UI.ImageDialogCaller.registerClass("Telerik.Web.UI.ImageDialogCaller",Telerik.Web.UI.EditorButton);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorDropDown=function(_1c7){
Telerik.Web.UI.EditorDropDown.initializeBase(this,[_1c7]);
this.isIE=$telerik.isIE;
this._popupVisible=false;
this._rendered=false;
this._childrenRendered=false;
this._popupElement=null;
this._itemRootElement=null;
this._onPopupClickDelegate=null;
this._onPopupMouseDownDelegate=null;
this._onPopupMouseOverDelegate=null;
this._items=[];
this._isArrayCollection=false;
this._selectedIndex=-1;
this._activeIndex=-1;
this._itemsPerRow=1;
this._sizeToFit=false;
this._clearSelectedOnShow=true;
this._rootPopupClassName="rade_dropDownBody";
this._popupClassName="";
this._popupWidth="200px";
this._popupHeight="200px";
};
Telerik.Web.UI.EditorDropDown.prototype={click:function(e){
this.show();
return $telerik.cancelRawEvent(e);
},dispose:function(){
Telerik.Web.UI.EditorDropDown.callBaseMethod(this,"dispose");
this.disposeChildren();
this.detachEventHandlers();
},isExpanded:function(){
return this._popupVisible;
},show:function(){
if(this._popupVisible){
return;
}
if(this.get_clearSelectedOnShow()){
this.set_selectedIndex(-1);
}
var _1c9=false;
if(!this._rendered){
this.render();
_1c9=true;
}
this.raiseEvent("show");
if(!this._childrenRendered){
this.renderChildren();
this._childrenRendered=true;
_1c9=true;
}
if(_1c9){
this._makeAllItemsUnselectable();
}
this._show();
},configurePopupPropertiesBeforeShow:function(){
this._popupBehavior.set_positioningMode(Telerik.Web.PositioningMode.BottomLeft);
},hide:function(){
if(this._popupBehavior){
this._popupBehavior.hide(true);
}
this._popupVisible=false;
this._getPopupVisibilityController().notifyPopupClosed(this);
this.raiseEvent("hide");
},onPopupMouseOver:function(e){
var _1cb=this.resolveActiveIndex(e);
if(_1cb>-1){
this.set_activeIndex(_1cb,e);
}
this._cancelEvent(e);
},_cancelEvent:function(e){
if(e){
e.preventDefault();
e.stopPropagation();
e.returnValue=false;
e.cancelBubble=true;
}
},_onPopupClick:function(e){
var _1ce=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_1ce>-1){
this._selectedIndex=_1ce;
this.hide();
this.raiseEvent("valueSelected");
}
},get_activeIndex:function(){
return this._activeIndex;
},set_activeIndex:function(_1cf,e){
this._activeIndex=_1cf;
this.selectUIItem(e);
},selectPreviousItem:function(){
var _1d1=this.get_activeIndex();
if(_1d1-1>=0){
this.set_activeIndex(_1d1-1);
}
},selectNextItem:function(){
var _1d2=this.get_activeIndex();
if(_1d2+1<this._items.length){
this.set_activeIndex(_1d2+1);
}
},selectUIItem:function(e,_1d4){
if(!this._popupElement){
return;
}
var _1d5=this._popupElement.getElementsByTagName("TD");
var len=_1d5.length;
var _1d7=this.get_activeIndex();
var _1d8=null;
for(var i=0;i<len;i++){
var _1da=_1d5[i];
if(_1da.item_index==_1d7){
_1da.className="rade_itemOver";
_1d8=_1da;
}else{
if(_1d4&&_1da.item_index<=_1d7){
_1da.className="rade_itemOver";
}else{
_1da.className="";
}
}
}
if(_1d8&&!e){
this._scrollIntoView(_1d8,_1d8.parentNode.parentNode.parentNode.parentNode);
}
return _1d8;
},_scrollIntoView:function(_1db,_1dc){
if($telerik.isIE||!_1dc){
var _1dd=_1dc;
_1dd.scrollTop=0;
var _1de=_1dd.getClientRects()[0];
var _1df=_1de.top;
var _1e0=_1de.bottom;
var _1e1=_1db.getClientRects()[0].bottom;
if(_1e1==0){
return;
}
while(_1e1>_1e0||_1e1<_1df){
var _1e2="down";
if(_1e1<_1df){
_1e2="up";
}
_1dd.doScroll(_1e2);
_1e1=_1db.getClientRects()[0].bottom;
}
}else{
if(_1db.scrollIntoView){
_1db.scrollIntoView(false);
}
}
},attachEventHandlers:function(){
if(!this._popupElement){
return;
}
this.detachEventHandlers();
this._onPopupMouseOverDelegate=Function.createDelegate(this,this.onPopupMouseOver);
$addHandler(this._popupElement,"mouseover",this._onPopupMouseOverDelegate);
this._onPopupClickDelegate=Function.createDelegate(this,this._onPopupClick);
$addHandler(this._popupElement,"mousedown",this._onPopupClickDelegate);
},detachEventHandlers:function(){
if(null!=this._onPopupMouseOverDelegate){
$removeHandler(this._popupElement,"mouseover",this._onPopupMouseOverDelegate);
this._onPopupMouseOverDelegate=null;
}
if(null!=this._onPopupClickDelegate){
$addHandler(this._popupElement,"mousedown",this._onPopupClickDelegate);
this._onPopupClickDelegate=null;
}
},disposeChildren:function(){
this._childrenRendered=false;
if(this._itemRootElement&&this._itemRootElement.parentNode){
var _1e3=this._itemRootElement;
this.renderItemRoot();
_1e3.parentNode.replaceChild(this._itemRootElement,_1e3);
}
},render:function(){
this._createUI();
this.renderHeader();
this.renderChildren();
this.renderFooter();
this._rendered=true;
this._childrenRendered=true;
},renderHeader:function(){
},renderFooter:function(){
},renderItemRoot:function(){
this._itemRootElement=this._getTable();
return this._itemRootElement;
},renderNewRow:function(){
return (this._itemRootElement.insertRow(-1));
},renderItemContainer:function(){
var _1e4=this._itemRootElement.rows[this._itemRootElement.rows.length-1];
var cell=_1e4.insertCell(-1);
return cell;
},renderChildren:function(){
for(var i=0;i<this._items.length;i++){
if(0==(i%this._itemsPerRow)){
this.renderNewRow();
}
var _1e7=this.renderItemContainer();
this.markItemContainer(_1e7,i);
this.renderChild(_1e7,this._items[i],i);
}
},renderChild:function(_1e8,_1e9,_1ea){
var _1eb=document.createElement("span");
if(_1e9){
var _1ec=null;
var _1ed=null;
if(_1e9 instanceof Array){
_1ec=_1e9[1];
_1ed=_1e9[2];
}else{
_1ec=_1e9;
}
if(_1ed){
var _1ee=document.createElement("span");
_1ee.innerHTML="&nbsp;";
_1ee.className=_1ed;
_1eb.appendChild(_1ee);
}
if(_1ec){
_1eb.innerHTML+=_1ec;
_1eb.noWrap=true;
}
}
_1e8.innerHTML=_1eb.innerHTML;
},resolveActiveIndex:function(e){
var _1f0=e.target;
var _1f1=-1;
while(_1f0&&_1f0!=this._itemRootElement){
if(null!=_1f0.item_index){
_1f1=_1f0.item_index;
break;
}
_1f0=_1f0.parentNode;
}
return _1f1;
},markItemContainer:function(_1f2,_1f3){
_1f2.item_index=_1f3;
},_makeAllItemsUnselectable:function(){
if(!this._popupElement){
return;
}
var _1f4=this._popupElement.getElementsByTagName("*");
var len=_1f4.length;
for(var i=0;i<len;i++){
_1f4[i].unselectable="on";
}
},_show:function(){
this.configurePopupPropertiesBeforeShow();
var _1f7=this._popupElement;
var _1f8=this.get_sizetofit();
var _1f9=_1f7.style.overflow;
if(_1f8){
_1f7.style.overflowY="hidden";
}
_1f7.style.width=this.get_popupwidth();
_1f7.style.height=this.get_popupheight();
this._itemRootElement.style.width="100%";
this._popupBehavior.show();
if(_1f8){
_1f7.style.width=this._getPopupChildrenWidth();
var _1fa=this._getPopupChildrenHeight();
if(_1fa!="0px"){
_1f7.style.height=_1fa;
}
}
this._popupBehavior.show();
this._getPopupVisibilityController().set_activePopup(this);
_1f7.style.zIndex="100000";
if(_1f8){
_1f7.style.overflowY=_1f9;
}
this._popupVisible=true;
},_getPopupChildrenWidth:function(){
var _1fb=this.get_popupElement().childNodes;
var _1fc=0;
for(var i=0;i<_1fb.length;i++){
var _1fe=_1fb[i].offsetWidth;
if(_1fe&&_1fe>_1fc){
_1fc=_1fe;
}
}
return _1fc+"px";
},_getPopupChildrenHeight:function(){
var _1ff=this.get_popupElement().childNodes;
var _200=0;
for(var i=0;i<_1ff.length;i++){
if(_1ff[i].offsetHeight){
_200+=_1ff[i].offsetHeight;
}
}
return _200+"px";
},_getPopupVisibilityController:function(){
return Telerik.Web.UI.Editor.PopupController;
},getUniqueID:function(){
if(!window["RadEditor_uniqueSeed"]){
window["RadEditor_uniqueSeed"]=new Date()-101;
}
if(!window["RadEditor_uniqueIdCounter"]){
window["RadEditor_uniqueIdCounter"]=1;
}else{
window["RadEditor_uniqueIdCounter"]++;
}
var _202=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_202;
},_createUI:function(){
if(this._popupBehavior){
return;
}
var _203=this.get_element();
if(!this._popupElement){
var _204=document.createElement("DIV");
$telerik.addCssClasses(_204,[this.get_skin(),this._rootPopupClassName,this.get_popupclassname()]);
this._popupElement=_204;
this._popupElement.style.display="none";
this._popupElement.style.position="absolute";
document.body.appendChild(this._popupElement);
}
this.renderItemRoot();
this._popupElement.appendChild(this._itemRootElement);
this._popupBehavior=$create(Telerik.Web.PopupBehavior,{"id":this.getUniqueID(),"parentElement":_203},null,null,this._popupElement);
this.attachEventHandlers();
},_getTable:function(){
var _205=document.createElement("table");
_205.border=0;
_205.cellPadding=0;
_205.setAttribute("unselectable","on");
_205.style.cursor="default";
return _205;
},get_clearSelectedOnShow:function(){
return this._clearSelectedOnShow;
},set_clearSelectedOnShow:function(_206){
this._clearSelectedOnShow=_206;
},get_popupElement:function(){
return this._popupElement;
},get_selectedItem:function(){
if(this._items&&this._selectedIndex>-1){
var item=this._items[this._selectedIndex];
var _208=((true==this._isArrayCollection)||(item instanceof Array))?item[0]:item;
return _208;
}
return null;
},get_selectedIndex:function(){
return this._selectedIndex;
},set_selectedIndex:function(_209){
this._selectedIndex=_209;
this.set_activeIndex(_209);
},get_items:function(){
return this._items;
},set_items:function(_20a){
this.disposeChildren();
this._items=_20a;
},get_itemsperrow:function(){
return this._itemsPerRow;
},set_itemsperrow:function(_20b){
this._itemsPerRow=_20b;
},get_sizetofit:function(){
return this._sizeToFit;
},set_sizetofit:function(_20c){
this._sizeToFit=_20c;
},get_popupclassname:function(){
return this._popupClassName;
},set_popupclassname:function(_20d){
this._popupClassName=_20d;
},get_rootpopupclassname:function(){
return this._rootPopupClassName;
},set_rootpopupclassname:function(_20e){
this._rootPopupClassName=_20e;
},get_popupwidth:function(){
return this._popupWidth;
},set_popupwidth:function(_20f){
this._popupWidth=_20f;
},get_popupheight:function(){
return this._popupHeight;
},set_popupheight:function(_210){
this._popupHeight=_210;
},add_show:function(_211){
this.get_events().addHandler("show",_211);
},remove_show:function(_212){
this.get_events().removeHandler("show",_212);
},add_hide:function(_213){
this.get_events().addHandler("hide",_213);
},remove_hide:function(_214){
this.get_events().removeHandler("hide",_214);
}};
Telerik.Web.UI.EditorDropDown.registerClass("Telerik.Web.UI.EditorDropDown",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorUpdateableDropDown=function(_215){
Telerik.Web.UI.EditorUpdateableDropDown.initializeBase(this,[_215]);
};
Telerik.Web.UI.EditorUpdateableDropDown.prototype={updateValue:function(oVal){
if(null==oVal){
return;
}
try{
if(!oVal){
oVal=this.get_text();
}
var _217=this.getSpanElement();
if(_217){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_217.innerHTML=this._value;
}
}
catch(e){
}
},get_value:function(){
if(!this._value||this._value==this.get_text()){
return "";
}
return this._value;
},set_value:function(oVal){
this.updateValue(oVal);
}};
Telerik.Web.UI.EditorUpdateableDropDown.registerClass("Telerik.Web.UI.EditorUpdateableDropDown",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.EditorSelfUpdateableDropDown=function(_219){
Telerik.Web.UI.EditorSelfUpdateableDropDown.initializeBase(this,[_219]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSelfUpdateableDropDown.prototype={_onPopupClick:function(e){
var _21b=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_21b>-1){
this._selectedIndex=_21b;
this.hide();
var _21c=this.get_selectedItem();
if(_21c){
this.updateValue(_21c);
}
this.raiseEvent("valueSelected");
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_21d){
this._clientStateFieldID=_21d;
}};
Telerik.Web.UI.EditorSelfUpdateableDropDown.registerClass("Telerik.Web.UI.EditorSelfUpdateableDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorSplitButton=function(_21e){
Telerik.Web.UI.EditorSplitButton.initializeBase(this,[_21e]);
};
Telerik.Web.UI.EditorSplitButton.prototype={click:function(e){
var _220=this.isArrowClicked(e.target);
if(_220){
this.show();
}else{
var _221=this.get_selectedItem();
if(null==_221){
this.show();
}else{
this.raiseEvent("valueSelected");
}
}
return $telerik.cancelRawEvent(e);
},initialize:function(){
Telerik.Web.UI.EditorSplitButton.callBaseMethod(this,"initialize");
this.set_clearSelectedOnShow(false);
},isArrowClicked:function(_222){
var _223=this._getArrowElement();
if(_222==_223){
return true;
}
return false;
},_getArrowElement:function(){
var _224=this.getAnchorElement().getElementsByTagName("SPAN");
var _225=_224[_224.length-1];
return _225;
}};
Telerik.Web.UI.EditorSplitButton.registerClass("Telerik.Web.UI.EditorSplitButton",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorToolStrip=function(_226){
Telerik.Web.UI.EditorToolStrip.initializeBase(this,[_226]);
this._tools=[];
this._udpateHeader=true;
};
Telerik.Web.UI.EditorToolStrip.prototype={selectUIItem:function(e){
for(var i=0;i<this._items.length;i++){
var tool=this._items[i];
if(i==this._activeIndex&&tool.get_enabled()){
tool.setOn(true);
}else{
tool.setOn(false);
if(this.isIE){
var a=tool.getAnchorElement();
if(a){
var newA=a.cloneNode(true);
a.replaceNode(newA);
}
}
}
}
},set_selectedIndex:function(_22c){
Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"set_selectedIndex",[_22c]);
if(this.get_updateHeader()){
var tool=this.get_selectedItem();
if(!tool||!tool.getSpanElement){
return;
}
var span=tool.getSpanElement();
if(span){
var _22f=span.cloneNode(true);
var _230=this.getSpanElement();
var _231=_230.parentNode;
_231.replaceChild(_22f,_230);
var _232=tool.getAnchorElement();
if(_232){
_231.setAttribute("title",_232.getAttribute("title"));
}
}
}
},_onPopupClick:function(e){
var tool=this._resolveSelectedTool(e);
this._cancelEvent(e);
if(tool){
var _235=Array.indexOf(this._items,tool);
if($telerik.isSafari){
this._selectedIndex=_235;
this.set_activeIndex(_235);
}else{
this.set_selectedIndex(_235);
}
this.hide();
this.raiseEvent("valueSelected");
}
},renderItemRoot:function(){
var _236=document.createElement("DIV");
_236.className="rade_tlbVertical";
_236.style.cssFloat="left";
_236.style.width="100%";
this._itemRootElement=_236;
return this._itemRootElement;
},renderChildren:function(){
var _237=this.get_itemsperrow();
var _238=this.get_tools();
var ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
for(var i=0;i<_238.length;i++){
if(_237>1&&i>1&&(i%this.get_itemsperrow()==0)){
ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
}
var _23b=_238[i];
if(null==_23b["showText"]){
_23b["showText"]=true;
}
var tool=Telerik.Web.UI.EditorButton.createTool(_23b,null,null,null,ul);
this._items[this._items.length]=tool;
}
},_resolveSelectedTool:function(e){
for(var i=0;i<this._items.length;i++){
var tool=this._items[i];
if(tool.isTarget(e)){
if(tool.get_enabled()){
return tool;
}else{
return null;
}
}
}
},get_tools:function(){
return this._tools;
},set_tools:function(_240){
this._tools=_240;
},get_updateHeader:function(){
return this._udpateHeader;
},set_updateHeader:function(_241){
this._udpateHeader=_241;
}};
Telerik.Web.UI.EditorToolStrip.registerClass("Telerik.Web.UI.EditorToolStrip",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.EditorContextMenu=function(_242){
Telerik.Web.UI.EditorContextMenu.initializeBase(this,[_242]);
this._parentElement=null;
this._eventObject=null;
};
Telerik.Web.UI.EditorContextMenu.prototype={initialize:function(){
this.set_updateHeader(false);
this.set_clearSelectedOnShow(true);
},show:function(){
this.set_activeIndex(-1);
Telerik.Web.UI.EditorContextMenu.callBaseMethod(this,"show");
},configurePopupPropertiesBeforeShow:function(){
var _243=this._popupBehavior;
_243.set_positioningMode(Telerik.Web.PositioningMode.Absolute);
var _244=this.get_parentElement();
if(_244){
_243.set_parentElement(_244);
}
var e=this._eventObject;
if(e){
_243.set_x(e.clientX+10);
_243.set_y(e.clientY+10);
}
},set_eventObject:function(_246){
this._eventObject=_246;
},get_tagName:function(){
return this._tagName;
},set_tagName:function(_247){
this._tagName=_247;
},get_parentElement:function(){
return this._parentElement;
},set_parentElement:function(_248){
this._parentElement=_248;
}};
Telerik.Web.UI.EditorContextMenu.registerClass("Telerik.Web.UI.EditorContextMenu",Telerik.Web.UI.EditorToolStrip);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.AlignmentSelector=function(_249){
Telerik.Web.UI.Editor.AlignmentSelector.initializeBase(this,[_249]);
this._popupWidth="78px";
this._popupHeight="100px";
this._popupClassName="rade_AlignmentSelector";
this._tagName="TD";
this._selectedTuple=null;
this._noAlignmentIndex=0;
this._itemsPerRow=3;
this._onValueSelectedDelegate=null;
this._clientStateFieldID=null;
};
Telerik.Web.UI.Editor.AlignmentSelector.prototype={initialize:function(){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"initialize");
this._onValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this.add_valueSelected(this._onValueSelectedDelegate);
this.setTagName(this._tagName);
this._configureAlignmentTable(this._tagName);
},dispose:function(){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"dispose");
this.remove_valueSelected(this._onValueSelectedDelegate);
},_imgAlignment:[["",""],["none",""],["",""],["",""],["top",""],["",""],["left",""],["absmiddle",""],["right",""],["",""],["bottom",""],["",""]],_cellAlignment:[["",""],["none",""],["",""],["left","top"],["center","top"],["right","top"],["left","middle"],["center","middle"],["right","middle"],["left","bottom"],["center","bottom"],["right","bottom"]],_tableAlignment:[["",""],["none",""],["",""],["left",""],["center",""],["right",""],["",""],["",""],["",""],["",""],["",""],["",""]],_captionIEAlignment:[["",""],["none",""],["",""],["left","top"],["center","top"],["right","top"],["",""],["",""],["",""],["left","bottom"],["center","bottom"],["right","bottom"]],_captionNSAlignment:[["",""],["none",""],["",""],["",""],["","top"],["",""],["",""],["",""],["",""],["",""],["","bottom"],["",""]],_alignmentClassName:["rade_NoAlignment","rade_NoAlignment","rade_NoAlignment","rade_TopLeft","rade_TopCenter","rade_TopRight","rade_MiddleLeft","rade_MiddleCenter","rade_MiddleRight","rade_BottomLeft","rade_BottomCenter","rade_BottomRight"],_getLookupTableByTagName:function(_24a){
switch(_24a.toUpperCase()){
case "IMG":
return this._imgAlignment;
case "TABLE":
return this._tableAlignment;
case "TD":
return this._cellAlignment;
case "TH":
return this._cellAlignment;
case "CAPTION":
return ($telerik.isIE?this._captionIEAlignment:this._captionNSAlignment);
default:
return null;
}
},_configureAlignmentTable:function(_24b){
if(!this._rendered){
this.render();
}
var _24c=this._itemRootElement;
var _24d=0;
for(var i=0;i<_24c.rows.length;i++){
var _24f=false;
for(var j=0;j<_24c.rows[i].cells.length;j++){
var cell=_24c.rows[i].cells[j];
var _252=this._isAvailable(_24d++);
cell.style.visibility=_252?"visible":"hidden";
_24f|=_252;
}
if(null!=document.all){
_24c.rows[i].style.display=_24f?"":"none";
}
}
},_isAvailable:function(_253){
var _254=false;
if(this._items){
var _255=this._items[_253];
_254=((null!=_255)&&(""!=_255[0]||""!=_255[1]));
}
return _254;
},renderChild:function(_256,_257,_258){
var _259=document.createElement("div");
if(_257){
_259.innerHTML="&nbsp;";
_259.className=this._alignmentClassName[_258];
}
_256.appendChild(_259);
},_onDropDownValueSelected:function(){
this.set_selectedIndex(this.get_selectedIndex());
},_selectAlignment:function(_25a,_25b){
_25a=(""==_25a||!_25a)?"none":_25a.toUpperCase();
_25b=!_25b?"":_25b.toUpperCase();
if(this._items){
var _25c=-1;
for(i=0;i<this._items.length;i++){
if(this._isAvailable(i)){
var ha=this._items[i][0].toUpperCase();
var va=this._items[i][1].toUpperCase();
if(-1==_25c){
_25c=i;
}
if((_25a==ha||_25a==va)&&(_25b==ha||_25b==va)){
this.set_selectedIndex(i);
return;
}
}
}
this.set_selectedIndex(_25c);
}
},set_selectedIndex:function(_25f){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"set_selectedIndex",[_25f]);
var span=this.getSpanElement();
var _261=this._alignmentClassName[_25f];
span.className=_261;
},setTagName:function(_262){
this._tagName=_262;
this._items=this._getLookupTableByTagName(this._tagName);
this.set_selectedIndex(this._noAlignmentIndex);
},updateValue:function(_263,_264){
this._selectAlignment(_263,_264);
},getAlign:function(){
var _265=this._items[this._selectedIndex];
var _266=(_265?_265[0]:"");
if("none"==_266){
_266="";
}
return _266;
},getVAlign:function(){
var _267=this._items[this._selectedIndex];
var _268=(_267?_267[1]:"");
if("none"==_268){
_268="";
}
return _268;
},show:function(){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"show");
this._itemRootElement.cellSpacing=0;
this._configureAlignmentTable(this._tagName);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_269){
this._clientStateFieldID=_269;
}};
Telerik.Web.UI.Editor.AlignmentSelector.registerClass("Telerik.Web.UI.Editor.AlignmentSelector",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.InsertTableHelper=function(_26a){
Telerik.Web.UI.Editor.InsertTableHelper.initializeBase(this,[_26a]);
};
Telerik.Web.UI.Editor.InsertTableHelper.prototype={initialize:function(){
var _26b=new Array(this.get_itemsperrow()*this.get_itemsperrow());
for(var i=0;i<_26b.length;i++){
_26b[i]=i;
}
this._items=_26b;
},hide:function(){
},renderChild:function(_26d,_26e,_26f){
var oDiv=document.createElement("div");
oDiv.innerHTML="&nbsp;";
_26d.appendChild(oDiv);
var dim=this._getDimensionByIndex(_26f);
_26d.setAttribute("title"," "+dim.rows+" x "+dim.cols+" ");
},_getDimensionByIndex:function(_272){
var _273=0;
var _274=0;
var _275=this.get_itemsperrow();
for(var i=0;i<this._items.length;i++){
if(i%_275==0){
_273++;
_274=0;
}
_274++;
if(_272==i){
break;
}
}
var obj={rows:_273,cols:_274};
return obj;
},get_selectedItem:function(){
var _278=this.get_selectedIndex();
return this._getDimensionByIndex(_278);
},selectUIItem:function(e,_27a){
var _27b=this._popupElement.getElementsByTagName("TD");
var len=_27b.length;
var _27d=this.get_activeIndex();
var dim=this._getDimensionByIndex(_27d);
var cols=dim.cols;
for(var i=0;i<len;i++){
var _281=_27b[i];
var _282=_281.item_index;
if(_282<=_27d&&_281.cellIndex<cols){
_281.className="rade_itemOver";
}else{
_281.className="";
}
}
}};
Telerik.Web.UI.Editor.InsertTableHelper.registerClass("Telerik.Web.UI.Editor.InsertTableHelper",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.Editor.InsertTable=function(_283){
Telerik.Web.UI.Editor.InsertTable.initializeBase(this,[_283]);
};
Telerik.Web.UI.Editor.InsertTable.prototype={initialize:function(){
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"initialize");
this._onTableHelperValueSelectedDelegate=Function.createDelegate(this,this._onTableHelperValueSelected);
this._tableHelper=null;
this._tableHelperItemsPerRow=this.get_itemsperrow();
this.set_itemsperrow(6);
this.set_popupwidth("140px");
var _284=this.get_tools();
this._longTool=_284[0];
Array.removeAt(_284,0);
for(var i=0;i<_284.length;i++){
_284[i].showText=false;
}
},show:function(){
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"show");
this._tableHelper.set_selectedIndex(-1);
},_onPopupClick:function(e){
this._tableHelperClicked=false;
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"_onPopupClick",[e]);
},_onTableHelperValueSelected:function(){
this._tableHelperClicked=true;
this.set_selectedIndex(-1);
var span=this.getSpanElement();
span.className="InsertTable";
this.hide();
this.raiseEvent("valueSelected");
},get_selectedItem:function(){
if(this._tableHelperClicked){
return this._tableHelper.get_selectedItem();
}else{
return Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"get_selectedItem");
}
},renderHeader:function(){
var args={"skin":this.get_skin(),"itemsperrow":this._tableHelperItemsPerRow,"sizetofit":true};
var _289={"valueSelected":this._onTableHelperValueSelectedDelegate};
var tool=$create(Telerik.Web.UI.Editor.InsertTableHelper,args,_289,null,document.createElement("DIV"));
tool.set_rootpopupclassname("");
this._tableHelper=tool;
tool.render();
var _28b=tool.get_popupElement();
_28b.style.display="";
_28b.style.visibility="visible";
_28b.style.position="";
_28b.style.cssFloat="left";
var _28c=this.get_popupElement();
_28c.insertBefore(_28b,_28c.firstChild);
},renderChildren:function(){
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"renderChildren");
var _28d=this._itemRootElement;
if(this._longTool){
var ul=document.createElement("UL");
_28d.insertBefore(ul,_28d.firstChild);
this._longTool["showText"]=true;
var tool=Telerik.Web.UI.EditorButton.createTool(this._longTool,null,null,null,ul);
tool.get_element().style.width="auto";
this._items[this._items.length]=tool;
}
}};
Telerik.Web.UI.Editor.InsertTable.registerClass("Telerik.Web.UI.Editor.InsertTable",Telerik.Web.UI.EditorToolStrip);
Telerik.Web.UI.Editor.ColorPicker=function(_290){
Telerik.Web.UI.Editor.ColorPicker.initializeBase(this,[_290]);
this._onValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this._itemsPerRow=10;
this._popupClassName="rade_ColorPicker";
this._sizeToFit=true;
this._clientStateFieldID=null;
};
Telerik.Web.UI.Editor.ColorPicker.prototype={initialize:function(){
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"initialize");
this.add_valueSelected(this._onValueSelectedDelegate);
},dispose:function(){
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"dispose");
this.remove_valueSelected(this._onValueSelectedDelegate);
},_onDropDownValueSelected:function(){
var _291=this.get_selectedItem();
this.set_color(_291);
},set_color:function(_292){
if(!_292){
_292="";
}
var _293=this.getSpanElement();
_293.style.borderBottom="0px";
_293.style.height="";
if(_292){
var _294=_293.offsetHeight;
if(_294){
_293.style.height=(_294-3)+"px";
}
_293.style.borderBottom="3px solid "+_292;
}
this._color=_292;
},get_color:function(){
return this._color;
},onPopupMouseOver:function(e){
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"onPopupMouseOver",[e]);
var _296=this.get_activeIndex();
var _297=this._items[_296];
if(null==_297){
return;
}
if(this._infoSpan1){
this._infoSpan1.innerHTML=_297;
this._infoSpan1.style.backgroundColor=_297;
}
if(this._infoSpan2){
this._infoSpan2.innerHTML=_297;
this._infoSpan2.style.color=_297;
}
},renderFooter:function(){
var oDiv=document.createElement("div");
oDiv.className="rade_ColorPickerFooter";
var _299=document.createElement("span");
_299.className="rade_DarkColor";
var _29a=document.createElement("span");
_29a.className="rade_LightColor";
_299.innerHTML=_29a.innerHTML="&nbsp";
oDiv.appendChild(_299);
oDiv.appendChild(_29a);
this.get_popupElement().appendChild(oDiv);
this._infoSpan1=_299;
this._infoSpan2=_29a;
},renderChild:function(_29b,_29c,_29d){
var oDiv=document.createElement("div");
if(null!=_29c){
oDiv.style.backgroundColor=_29c;
oDiv.setAttribute("title",_29c);
oDiv.innerHTML="&nbsp;";
}
_29b.appendChild(oDiv);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_29f){
this._clientStateFieldID=_29f;
}};
Telerik.Web.UI.Editor.ColorPicker.registerClass("Telerik.Web.UI.Editor.ColorPicker",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.UndoRedoDropDown=function(_2a0){
Telerik.Web.UI.Editor.UndoRedoDropDown.initializeBase(this,[_2a0]);
};
Telerik.Web.UI.Editor.UndoRedoDropDown.prototype={renderFooter:function(){
},get_selectedItem:function(){
var _2a1=Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"get_selectedItem");
if(!_2a1){
_2a1=1;
}
return _2a1;
},selectUIItem:function(e,_2a3){
return Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"selectUIItem",[e,true]);
}};
Telerik.Web.UI.Editor.UndoRedoDropDown.registerClass("Telerik.Web.UI.Editor.UndoRedoDropDown",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.ApplyClassDropDown=function(_2a4){
Telerik.Web.UI.Editor.ApplyClassDropDown.initializeBase(this,[_2a4]);
this._popupClassName="rade_ApplyClass";
this._onValueSelectedDelegate=null;
this._clientStateFieldID=null;
this._isArrayCollection=true;
};
Telerik.Web.UI.Editor.ApplyClassDropDown.prototype={initialize:function(){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"initialize");
this._onValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this.add_valueSelected(this._onValueSelectedDelegate);
this._cssClassRegex=/[^\{]*\{([^\}]+)\}/gi;
this._cssClasses={a:"rade_class_a",img:"rade_class_img",table:"rade_class_table",td:"rade_class_td",all:"rade_class_all",unknown:"rade_class_unknown"};
},dispose:function(){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"dispose");
this.remove_valueSelected(this._onValueSelectedDelegate);
},_onDropDownValueSelected:function(){
this.updateValue(this.get_selectedItem());
},_getClassIcon:function(tag){
var _2a6="";
if(!tag){
_2a6=this._cssClasses["notag"];
}else{
tag=tag.toLowerCase();
var res=this._cssClasses[tag];
_2a6=res?res:this._cssClasses["unknown"];
}
var _2a8=document.createElement("span");
_2a8.innerHTML="&nbsp;"+tag;
_2a8.className=_2a6;
return _2a8;
},_getClassTag:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2ab=str.lastIndexOf(".");
if(_2ab==0){
return "ALL";
}
var _2ac=str.lastIndexOf(" ",_2ab);
return str.substring((_2ac+1),_2ab);
},_getClassCss:function(_2ad){
var re=this._cssClassRegex;
var oCss="";
if(null!=_2ad.cssText){
oCss=_2ad.cssText;
oCss=oCss.replace(re,"$1");
}else{
oCss=_2ad.style.cssText;
}
return oCss;
},_getDisplayName:function(rule){
if(!rule||!rule.selectorText){
return "";
}
var _2b1=rule.selectorText;
var _2b2=_2b1.indexOf(".");
if(-1==_2b2){
_2b2=0;
}else{
_2b2+=1;
}
var _2b3=_2b1.indexOf(":");
if(-1==_2b3){
_2b3=_2b1.length;
}
return _2b1.substring(_2b2,_2b3);
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2b6=str.lastIndexOf(".");
if(_2b6==-1){
return "";
}
var _2b7=str.indexOf(" ",_2b6);
if(-1==_2b7){
_2b7=str.indexOf(":",_2b6);
}
if(-1==_2b7){
_2b7=str.length;
}
return str.substring((_2b6+1),_2b7);
},_getChild:function(_2b8,_2b9,_2ba){
var elem=document.createElement("DIV");
if(_2b9.toLowerCase()=="a"){
elem=document.createElement("A");
elem.href="#";
elem.onmouseover="window.status = ''; return false;";
elem.onclick=new Function("return false;");
elem.style.cursor="default";
}
if(null!=elem.style.cssText){
elem.style.cssText=_2b8;
}
elem.setAttribute("style",_2b8);
elem.innerHTML=_2ba;
elem.style.visibility="visible";
elem.style.marginLeft="0px";
elem.style.overflowX="hidden";
elem.style.position="";
elem.style.cssFloat="";
elem.style.styleFloat="";
return elem;
},set_items:function(_2bc){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"set_items",[_2bc]);
this._items.splice(0,0,["",{cssText:"",selectorText:"Clear Class"}]);
},renderChild:function(cell,_2be,_2bf){
var _2c0=_2be[1];
var oTag=this._getClassTag(_2c0);
var oCss=this._getClassCss(_2c0);
var _2c3=_2be[2]?_2be[2]:this._getDisplayName(_2c0);
cell.setAttribute("title",_2c0.selectorText);
var _2c4=this._getClassIcon(oTag);
cell.appendChild(_2c4);
var div=this._getChild(oCss,oTag,_2c3);
cell.appendChild(div);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_2c6){
this._clientStateFieldID=_2c6;
}};
Telerik.Web.UI.Editor.ApplyClassDropDown.registerClass("Telerik.Web.UI.Editor.ApplyClassDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontNameDropDown=function(_2c7){
Telerik.Web.UI.Editor.FontNameDropDown.initializeBase(this,[_2c7]);
};
Telerik.Web.UI.Editor.FontNameDropDown.prototype={updateValue:function(oVal){
try{
if(!oVal){
oVal=this.get_text();
}
if(null==oVal||"AZBY"==oVal){
return;
}
var _2c9=this.getSpanElement();
if(_2c9){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_2c9.innerHTML=this._value;
}
}
catch(e){
}
},renderChildren:function(){
var _2ca=this._items;
if(_2ca&&_2ca[0]&&!(_2ca[0] instanceof Array)){
for(var i=0;i<_2ca.length;i++){
var item=_2ca[i];
_2ca[i]=[item,String.format("<span style='font:normal 13px {0};'>",item)+item+"</span>"];
}
}
return Telerik.Web.UI.Editor.FontNameDropDown.callBaseMethod(this,"renderChildren");
}};
Telerik.Web.UI.Editor.FontNameDropDown.registerClass("Telerik.Web.UI.Editor.FontNameDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontSizeDropDown=function(_2cd){
Telerik.Web.UI.Editor.FontSizeDropDown.initializeBase(this,[_2cd]);
};
Telerik.Web.UI.Editor.FontSizeDropDown.prototype={renderChildren:function(){
var _2ce=this._items;
if(_2ce&&_2ce[0]&&!(_2ce[0] instanceof Array)){
for(var i=0;i<_2ce.length;i++){
var item=_2ce[i];
_2ce[i]=[item,String.format("<font size={0}>",item)+item+"</font>"];
}
}
return Telerik.Web.UI.Editor.FontSizeDropDown.callBaseMethod(this,"renderChildren");
}};
Telerik.Web.UI.Editor.FontSizeDropDown.registerClass("Telerik.Web.UI.Editor.FontSizeDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.InsertCustomLinkDropDown=function(_2d1){
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.initializeBase(this,[_2d1]);
};
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.prototype={renderItemRoot:function(){
var ul=document.createElement("UL");
ul.className="rade_CustomLinks";
this._itemRootElement=ul;
return this._itemRootElement;
},show:function(){
this._linkCounter=0;
return Telerik.Web.UI.Editor.InsertCustomLinkDropDown.callBaseMethod(this,"show");
},renderChildren:function(){
this.FlatLinksArray=[];
for(var i=0;i<this._items.length;i++){
var link=this._items[i];
this._parseSubtree(link,this._itemRootElement);
}
},get_selectedItem:function(){
var _2d5=this.FlatLinksArray[this.get_selectedIndex()];
return {innerHTML:_2d5.name,href:_2d5.href,target:_2d5.target,title:_2d5.toolTip};
},_parseSubtree:function(_2d6,t){
var _2d8=this._linkCounter;
this.FlatLinksArray[_2d8]=_2d6;
var li=document.createElement("LI");
t.appendChild(li);
var _2da=_2d6.childLinks&&_2d6.childLinks.length;
var span=document.createElement("SPAN");
span.innerHTML="&nbsp;";
span.className=_2da?"rade_CustomLinksIcon rade_icon_plus":"rade_CustomLinksIcon rade_icon_empty";
if(_2da){
function onclick(e){
var _2dd=Sys.UI.DomElement.containsCssClass(this,"rade_icon_plus");
var ul=this.parentNode.getElementsByTagName("UL")[0];
if(ul){
ul.style.display=_2dd?"":"none";
var _2df=_2dd?"rade_icon_plus":"rade_icon_minus";
var _2e0=_2dd?"rade_icon_minus":"rade_icon_plus";
Sys.UI.DomElement.removeCssClass(this,_2df);
Sys.UI.DomElement.addCssClass(this,_2e0);
}
return false;
}
$addHandler(span,"click",onclick);
}
li.appendChild(span);
var _2e1=null;
if(_2d6.href){
_2e1=document.createElement("A");
_2e1.href="#";
_2e1.innerHTML=_2d6.name;
li.appendChild(_2e1);
this.markItemContainer(_2e1,this._linkCounter);
}else{
_2e1=document.createElement("SPAN");
_2e1.innerHTML=_2d6.name;
li.appendChild(_2e1);
}
this._linkCounter++;
if(_2da){
var ul=document.createElement("UL");
li.appendChild(ul);
var _2e3=_2d6.childLinks;
for(var i=0;i<_2d6.childLinks.length;i++){
var _2e5=_2e3[i];
this._parseSubtree(_2e5,ul);
}
ul.style.display="none";
}
}};
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.registerClass("Telerik.Web.UI.Editor.InsertCustomLinkDropDown",Telerik.Web.UI.EditorDropDown);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor._PopupController=function(){
this._activePopup=null;
this._registerGlobalBodyEventHandlers();
};
Telerik.Web.UI.Editor._PopupController.prototype={_registerGlobalBodyEventHandlers:function(){
function configureFrameHandlers(_2e6,_2e7){
var _2e8=window.frames;
for(var i=0;i<_2e8.length;i++){
var _2ea=null;
try{
_2ea=_2e8[i].window.document;
}
catch(e){
}
if(!_2ea){
continue;
}
if(false!=_2e6){
_2e7.attachToDocument(_2ea);
}else{
_2e7.detachFromDocument(_2ea);
}
}
}
var _2eb=Function.createDelegate(null,function(e){
if(e.keyCode==27){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
});
$addHandler(document.body,"keydown",_2eb);
configureFrameHandlers(true,this);
$addHandler(document.body,"mousedown",this._hideHandler);
Sys.Application.add_unload(function(){
configureFrameHandlers(false,Telerik.Web.UI.Editor.PopupController);
$removeHandler(document.body,"mousedown",Telerik.Web.UI.Editor.PopupController._hideHandler);
$removeHandler(document.body,"keydown",_2eb);
});
},attachToDocument:function(_2ed){
$telerik.addExternalHandler(_2ed,"mousedown",this._hideHandler);
},detachFromDocument:function(_2ee){
$telerik.removeExternalHandler(_2ee,"mousedown",this._hideHandler);
},_hideHandler:function(e){
Telerik.Web.UI.Editor.PopupController._hideIfOutsidePopup(e);
},hideActivePopup:function(){
if(this._activePopup!=null){
this._activePopup.hide();
this._activePopup=null;
}
},_hideIfOutsidePopup:function(e){
if(this._activePopup!=null){
if(!this._activePopup.get_popupElement){
return;
}
var _2f1=this._activePopup.get_popupElement();
if(!this._isMouseOverElement(e,_2f1)){
this.hideActivePopup();
}
}
},_isMouseOverElement:function(e,_2f3){
var rect=null;
try{
rect=$telerik.getBounds(_2f3);
}
catch(e){
return false;
}
if(e&&e.target&&e.target.tagName=="SELECT"&&e.clientX<0){
return true;
}
var body=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;
var x=e.clientX-2+body.scrollLeft;
var y=e.clientY-2+body.scrollTop;
return $telerik.containsPoint(rect,x,y);
},notifyPopupClosed:function(_2f8){
if(this._activePopup==_2f8){
this._activePopup=null;
}
},set_activePopup:function(_2f9){
if(this._activePopup&&(_2f9!=this._activePopup)){
this._activePopup.hide();
}
this._activePopup=_2f9;
},get_activePopup:function(){
return this._activePopup;
}};
Telerik.Web.UI.Editor._PopupController.registerClass("Telerik.Web.UI.Editor._PopupController",null);
if(!Telerik.Web.UI.Editor.PopupController){
Sys.Application.add_load(function(){
window.setTimeout(function(){
Telerik.Web.UI.Editor.PopupController=new Telerik.Web.UI.Editor._PopupController();
},100);
});
}
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.DefaultToolAdapter=function(_2fa){
Telerik.Web.UI.Editor.DefaultToolAdapter.initializeBase(this,[_2fa]);
this._editor=null;
this._toolJSON=[];
this._tools=[];
this._contextMenusEnabled=true;
this.isIE=$telerik.isIE;
this._editorIEFirstShow=false;
};
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=null;
Telerik.Web.UI.Editor.DefaultToolAdapter.prototype={initialize:function(){
this._onEditorSelectionChangeDelegate=Function.createDelegate(this,this._onEditorSelectionChange);
this._onEditorModeChangeDelegate=Function.createDelegate(this,this._onEditorModeChange);
this._onToolAdapterClickDelegate=Function.createDelegate(this,this._onToolBarClick);
this._onToolAdapterKeyDownDelegate=Function.createDelegate(this,this._onKeyDownHandler);
this._onDropDownValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this._onDropDownBeforeShowDelegate=Function.createDelegate(this,this._onDropDownBeforeShow);
this._onDropDownHideDelegate=Function.createDelegate(this,this._onDropDownHide);
this._initToolbarMode();
this._initContextMenus();
this._registerEditorHandlers();
},_initToolbarMode:function(){
var _2fb=this.get_editor();
var _2fc=this.get_element();
var _2fd=Telerik.Web.UI.EditorToolbarMode;
var _2fe=_2fb.get_toolbarMode();
if(_2fe!=_2fd.Default){
_2fc.style.visibility="hidden";
}
this._initToolbars();
if(_2fe!=_2fd.Default){
this._createWindowWrapper();
if(_2fe==_2fd.ShowOnFocus){
this._initShowOnFocus();
}else{
if(_2fe==_2fd.PageTop){
this._initPageTop();
}else{
if(_2fe==_2fd.Floating){
this._initFloating();
}
}
}
_2fc.style.visibility="visible";
}
},get_toolbarHolder:function(){
return this._toolbarHolder;
},_moveToolbarsToEditor:function(_2ff){
var _300=this.get_element();
if(!_2ff){
var wnd=this.get_toolbarHolder();
if(!this._fakeToolbarParent){
var div=_300.ownerDocument.createElement("DIV");
div.control=_300.control;
_300.parentNode.appendChild(div);
_300.control=null;
div.style.display="none";
window.setTimeout(function(){
wnd.set_contentElement(_300);
_300.style.display="";
},0);
this._fakeToolbarParent=div;
}else{
wnd.set_contentElement(_300);
}
_300.style.width="100%";
}else{
_300.style.width="";
var _303=this.get_editor().get_TopZone();
_303.appendChild(_300);
}
},_createWindowWrapper:function(){
if(!this._toolbarHolder){
var _304=this.get_editor();
var wnd=_304.get_dialogOpener().get_container().clone(_304.get_id()+"_toolbarMode");
wnd.set_visibleStatusbar(false);
var _306=this.get_element();
var _307=_306.offsetWidth;
wnd.setSize(_307+10,"");
wnd.add_show(function(_308,args){
var _30a=_308.get_contentElement();
if(!_30a){
return;
}
_30a.style.overflow="";
_30a.style.height="";
var _30b=_30a.offsetWidth;
var _30c=_30a.offsetHeight;
_308.setSize(_30b+10,"");
});
this._toolbarHolder=wnd;
this._moveToolbarsToEditor(false);
}
return this._toolbarHolder;
},_createFloatingButton:function(){
this._onToggleFloatingToolbarDelegate=Function.createDelegate(this,this._onToggleFloatingToolbar);
var _30d=this.get_editor();
var skin=_30d.get_skin();
var _30f={name:"ToggleFloatingToolbar",addClickHandler:true,skin:skin};
var _310={"valueSelected":this._onToggleFloatingToolbarDelegate};
var _311=Telerik.Web.UI.EditorButton.createTool(_30f,_310);
var _312=Telerik.Web.UI.EditorButton.createToolWrapper(_311,skin);
var _313=$get(_30d.get_id()+"Top");
if(_313){
_313.appendChild(_312);
}
},_onToggleFloatingToolbar:function(){
var _314=!this._toolbarHolder.isVisible();
this._showToolbarHolder(_314);
},_positionToolbarAboveEditor:function(){
var wnd=this._toolbarHolder;
var _316=this.get_editor();
var _317=$telerik.getBounds(_316.get_element());
var x=_317.x;
var y=_317.y-wnd.getWindowBounds().height;
wnd.moveTo(x,y);
},_positionOnPageTop:function(){
var wnd=this._toolbarHolder;
var _31b=wnd._getViewportBounds();
var x=_31b.scrollLeft;
var y=_31b.scrollTop;
wnd.moveTo(x,y);
wnd.set_width(_31b.width-10);
if(!wnd.isPinned()){
wnd.togglePin();
}
},_showToolbarHolder:function(_31e){
if(!_31e){
this._toolbarHolder.hide();
return;
}else{
if($telerik.isIE&&!this._editorIEFirstShow){
this._editorIEFirstShow=true;
return;
}
}
if(this.get_editor().isFullScreen()){
return;
}
var _31f=Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper;
if(_31f==this&&_31f._toolbarHolder&&_31f._toolbarHolder.isVisible()){
_31f._toolbarHolder.setActive(true);
return;
}
if(_31f&&_31f._showToolbarHolder){
_31f._showToolbarHolder(false);
}
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=this;
this._toolbarHolder.show();
var _320=this.get_editor();
var _321=Telerik.Web.UI.EditorToolbarMode;
var _322=_320.get_toolbarMode();
if(_322==_321.ShowOnFocus){
this._positionToolbarAboveEditor();
}else{
if(_322==_321.PageTop){
this._positionOnPageTop();
}else{
if(_322==_321.Floating){
if(!this._wasShown){
this._positionToolbarAboveEditor();
this._wasShown=true;
}
}
}
}
},_initFloating:function(){
this._createFloatingButton();
},_initPageTop:function(){
var wnd=this._toolbarHolder;
wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);
wnd.set_visibleTitlebar(false);
this._initToolbarModeEvents();
},_initShowOnFocus:function(){
var wnd=this._toolbarHolder;
var _325=Telerik.Web.UI.WindowBehaviors;
wnd.set_behaviors(_325.Resize);
wnd.set_visibleTitlebar(false);
this._initToolbarModeEvents();
},_initToolbarModeEvents:function(){
var _326=this;
var _327=function(){
_326._showToolbarHolder(true);
};
var _328=this.get_editor();
if(_328.isIE){
this.get_editor().add_editReady(function(){
_328.attachEventHandler("beforeeditfocus",_327);
});
}else{
_328.add_selectionChange(_327);
}
_328.add_modeChange(function(){
_326._showToolbarHolder(_326.get_editor().get_mode()==Telerik.Web.UI.EditModes.Design);
});
_328.add_submit(function(){
_326._showToolbarHolder(false);
});
_328.add_toggleScreenMode(function(){
var _329=_326.get_editor().isFullScreen();
_326._moveToolbarsToEditor(_329);
var wnd=_326.get_toolbarHolder();
if(_329){
wnd.hide();
}else{
wnd.show();
}
});
this._bodyClickDelegate=Function.createDelegate(this,this._onBodyClick);
$addHandler(document.body,"click",this._bodyClickDelegate);
},_onBodyClick:function(){
this._showToolbarHolder(false);
},_disposeToolbarModeHandlers:function(){
if(this._bodyClickDelegate){
$removeHandler(document.body,"click",this._bodyClickDelegate);
this._bodyClickDelegate=null;
}
},_initToolbars:function(){
var root=this.get_element();
var _32c=root.parentNode;
var _32d=false;
if($telerik.isIE){
var _32e=Telerik.Web.UI.Editor.Utils.getInvisibleParent(_32c);
_32d=(_32e!=null);
if(_32d){
root.parentNode.removeChild(root);
root.style.position="absolute";
root.style.top="-5000px";
root.style.left="-5000px";
document.body.appendChild(root);
}
}
var _32f=this.get_toolJSON();
var _330=this._getToolBarElements();
var _331=[];
for(var i=0;i<_32f.length;i++){
var json=_32f[i];
var _334=_330[i];
this._initializeToolbar(json,_334);
var _335=json["attributes"];
var zone=_335?_335["dockingzone"]:null;
if(zone){
_331[_331.length]=[zone,_334];
}
}
if(_32d){
root.style.position="";
root.style.top="";
root.style.left="";
root.parentNode.removeChild(root);
_32c.appendChild(root);
}
var _337=this.get_editor();
if(_337.get_toolbarMode()!=Telerik.Web.UI.EditorToolbarMode.Default){
return;
}
var _338=_337.get_id();
for(var i=0;i<_331.length;i++){
var _339=_331[i][0];
var zone=_339.charAt(0).toUpperCase()+_339.substring(1);
var _33a=$get(_338+zone);
if(!_33a){
_33a=$get(_339);
}
if(_33a){
if(_33a.innerHTML=="&nbsp;"){
_33a.innerHTML="";
}
_33a.appendChild(_331[i][1]);
}
}
},onContextMenu:function(e){
if(!this._contextMenusEnabled){
return;
}
var _33c=this.get_editor();
if(_33c.get_mode()!=Telerik.Web.UI.EditModes.Design){
return;
}
this.createContextMenus();
var _33d=e.srcElement?e.srcElement:e.target;
var _33e=_33d.tagName;
var _33f=this._contextMenus[_33e];
if("TH"==_33e&&!_33f){
_33f=this._contextMenus["TD"];
}
var _340="";
if(!_33f){
var _341=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_33d,"A");
if(!_341){
_341=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_33d,"TD");
}
if(!_341){
_341=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_33d,"TABLE");
}
if(_341){
_340=_341.tagName;
_33d=_341;
}else{
_340="*";
}
_33f=this._contextMenus[_340];
}
if(_33f&&_33e=="IMG"&&_33d&&"true"==_33d.getAttribute("isflash")){
_33f=null;
}
if(!this.isIE&&_340=="*"){
return;
}
if(_33f){
_33f.set_eventObject(e);
_33f.show();
}
return $telerik.cancelRawEvent(e);
},enableContextMenus:function(_342){
this._contextMenusEnabled=_342;
},_initContextMenus:function(){
var _343=Function.createDelegate(this,this.onContextMenu);
var _344=this.get_editor();
_344.add_editReady(function(){
_344.attachEventHandler("contextmenu",_343);
});
},createContextMenus:function(){
if(this._contextMenus){
return;
}
this._contextMenus={};
var _345=this.get_editor();
var skin=_345.get_skin();
var _347=_345.get_contextMenusJSON();
var _348={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
for(var i=0;i<_347.length;i++){
var args=_347[i];
args["sizetofit"]=true;
args["parentElement"]=_345.get_contentAreaElement();
args["skin"]=skin;
var tool=$create(Telerik.Web.UI.EditorContextMenu,args,_348,null,document.createElement("SPAN"));
this._contextMenus[args.tagName]=tool;
}
},dispose:function(){
var _34c=this._getToolBarElements();
for(var i=0;i<_34c.length;i++){
$clearHandlers(_34c[i]);
}
this._tools=[];
this._disposeToolbarModeHandlers();
var wnd=this.get_toolbarHolder();
if(wnd&&wnd.dispose){
wnd.dispose();
}
Telerik.Web.UI.Editor.DefaultToolAdapter.callBaseMethod(this,"dispose");
},setFocus:function(){
var tool=this._tools[0];
window.setTimeout(function(){
if(tool){
tool.setFocus();
}
},100);
return false;
},getContextMenuByTagName:function(_350){
this.createContextMenus();
return this._contextMenus[_350];
},getToolByName:function(name){
for(var i=0;i<this._tools.length;i++){
var tool=this._tools[i];
if(tool&&tool.get_name()==name){
return tool;
}
}
return null;
},setToolState:function(_354,_355){
if(!_354){
_354=this._tools;
}
var _356=this.get_editor();
for(var i=0;i<_354.length;i++){
var _358=_354[i];
var _359=_358.get_name();
if(_358.setState){
var _35a=_355;
if(null==_35a){
_35a=_356.getToolState(_359);
}
if(null!=_35a){
_358.setState(_35a);
}
}
if(_358.updateValue){
_358.updateValue(_356.getToolValue(_359));
}
}
},_convertCommandsArray:function(_35b){
var _35c=[];
for(var i=0;i<_35b.length;i++){
_35c[i]=[i+1,_35b[i].get_title()];
}
return _35c;
},_onDropDownHide:function(_35e,args){
var _360=this.get_editor();
_360.enableContentArea(true);
},_onDropDownBeforeShow:function(_361,args){
var _363=this.get_editor();
if(Telerik.Web.UI.EditorToolStrip.isInstanceOfType(_361)){
this.setToolState(_361.get_items());
}
if(!_363.getSelection().isControl()&&!Telerik.Web.UI.EditorContextMenu.isInstanceOfType(_361)){
_363.enableContentArea(false);
}
var _364=_361.get_name();
if(_364=="Undo"){
var _365=_363.get_commandsManager().getCommandsToUndo();
_365=this._convertCommandsArray(_365);
_361.set_items(_365);
}else{
if(_364=="Redo"){
var _366=_363.get_commandsManager().getCommandsToRedo();
_366=this._convertCommandsArray(_366);
_361.set_items(_366);
}else{
if(_364=="ModuleManager"){
var _367=_363.get_modulesManager();
if(!_367){
return;
}
var _368=_367.get_modules();
var _369=[];
for(var i=0;i<_368.length;i++){
var _36b=_368[i];
var name=_36b.get_name();
var _36d=_36b.get_title();
if(!_36d){
_36d=name;
}
cssClass=_36b.get_visible()?"rade_module_visible_icon":"rade_module_hidden_icon";
_369[i]=[name,_36d,cssClass];
}
_361.set_items(_369);
}
}
}
var _36e=_361.get_items();
if(_36e&&_36e.length>0){
return;
}
var _36f=null;
switch(_364){
case "ApplyClass":
_36f=_363.getCssArray();
break;
case "FontName":
_36f=_363.get_fontNames();
break;
case "FontSize":
_36f=_363.get_fontSizes();
break;
case "InsertSymbol":
_36f=_363.get_symbols();
break;
case "BackColor":
case "ForeColor":
_36f=_363.get_colors();
break;
case "RealFontSize":
_36f=_363.get_realFontSizes();
break;
case "InsertSnippet":
_36f=_363.get_snippets();
break;
case "Zoom":
_36f=["10%","20%","50%","100%","150%","200%","300%","500%"];
break;
case "FormatBlock":
_36f=_363.get_paragraphs();
break;
case "InsertCustomLink":
_36f=_363.get_links();
break;
case "AjaxSpellCheck":
case "SpellCheck":
_36f=_363.get_languages();
break;
}
if(_36f){
_361.set_items(_36f);
}
},_initializeToolbar:function(_370,_371){
var _372=_371.getElementsByTagName("li");
var _373=_370.tools;
var _374=this.get_editor();
var skin=_374.get_skin();
var _376=0;
if(_373){
var _377=0;
for(var i=0;i<_373.length;i++){
var _379=_372[i+1];
_377+=_379.offsetWidth;
var _37a=Telerik.Web.UI.EditorButton;
var _37b=_373[i].type;
var _37c=_373[i].name;
var _37d=Telerik.Web.UI.EditorToolType;
var args=_373[i];
var tool=null;
var _380=false;
if(_37b){
switch(_37b){
case _37d.Button:
break;
case _37d.Separator:
if(!_376){
_376+=parseInt($telerik.getCurrentStyle(_379,"marginLeft"));
_376+=parseInt($telerik.getCurrentStyle(_379,"marginRight"));
}
_377+=_376;
_37a=null;
break;
case _37d.DropDown:
_37a=Telerik.Web.UI.EditorDropDown;
_380=true;
if(_37c=="FontName"){
_37a=Telerik.Web.UI.Editor.FontNameDropDown;
}else{
if(_37c=="FontSize"){
_37a=Telerik.Web.UI.Editor.FontSizeDropDown;
}else{
if(_37c=="FormatBlock"){
_37a=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_37c=="RealFontSize"){
_37a=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_37c=="Zoom"){
_37a=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_37c=="InsertCustomLink"){
_37a=Telerik.Web.UI.Editor.InsertCustomLinkDropDown;
}else{
if(_37c=="ApplyClass"){
_37a=Telerik.Web.UI.Editor.ApplyClassDropDown;
}
}
}
}
}
}
}
break;
case _37d.SplitButton:
_37a=Telerik.Web.UI.EditorSplitButton;
if(_37c=="ForeColor"||_37c=="BackColor"){
_37a=Telerik.Web.UI.Editor.ColorPicker;
}else{
if(_37c=="Undo"||_37c=="Redo"){
_37a=Telerik.Web.UI.Editor.UndoRedoDropDown;
}
}
_380=true;
break;
case _37d.ToolStrip:
if(_37c=="InsertTable"){
_37a=Telerik.Web.UI.Editor.InsertTable;
}else{
_37a=Telerik.Web.UI.EditorToolStrip;
}
_380=true;
break;
case _37d.Custom:
break;
}
}
if(args.attributes){
for(var item in args.attributes){
args[item.toLowerCase()]=args.attributes[item];
}
}
if(_37a){
var _382=null;
if(_380){
_382={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
args["skin"]=skin;
}
tool=$create(_37a,args,_382,null,_379);
}
if(tool){
Array.add(this._tools,tool);
var _383=tool.get_shortCut();
if(_383){
var _384=tool.get_name();
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(tool)&&!(Telerik.Web.UI.EditorSplitButton.isInstanceOfType(tool))){
_384="RadE_ToolAdapter_"+_384;
Telerik.Web.UI.Editor.CommandList[_384]=this._toolAdapterDropDownExpander;
}
_374.setShortCut(_384,_383);
}
}
}
var ul=_371;
if(this.isIE&&ul&&_377){
ul.style.width=(_377+(_372[0].offsetWidth)*2)+"px";
}
if($telerik.isSafari){
ul.setAttribute("onmousedown","return false;");
}
$addHandlers(_371,{"click":this._onToolAdapterClickDelegate,"keydown":this._onToolAdapterKeyDownDelegate},this);
}
},_toolAdapterDropDownExpander:function(_386,_387){
var tool=_387.getToolByName(_386.replace("RadE_ToolAdapter_",""));
tool.setFocus();
tool.show();
tool.selectNextItem();
return false;
},_onEditorModeChange:function(_389,args){
var _38b=Telerik.Web.UI.EditModes;
var mode=_389.get_mode();
this._setEnabled((mode==_38b.Design));
},_onEditorSelectionChange:function(_38d,args){
this.setToolState();
},_setEnabled:function(_38f){
var _390=this._tools;
for(var i=0;i<_390.length;i++){
var tool=_390[i];
tool.set_enabled(_38f);
}
},_registerEditorHandlers:function(){
var _393=this.get_editor();
_393.add_selectionChange(this._onEditorSelectionChangeDelegate);
_393.add_modeChange(this._onEditorModeChangeDelegate);
},_onDropDownValueSelected:function(_394,args){
var _396=_394.get_selectedItem();
if(Telerik.Web.UI.EditorButton.isInstanceOfType(_396)){
this._raiseEditorEvent(_396,null);
}else{
this._raiseEditorEvent(_394,_396);
}
},_onKeyDownHandler:function(e){
var _398=e.keyCode;
if(9==_398||37==_398||39==_398||121==_398){
if(Telerik.Web.UI.Editor.PopupController){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
}
if(121==_398){
var _399=this.get_editor();
window.setTimeout(function(){
if(_399){
_399.setFocus();
}
},100);
if(e.rawEvent){
$telerik.cancelRawEvent(e.rawEvent);
}
return $telerik.cancelRawEvent(e);
}
if(9==_398){
return;
}
var _39a=this._getSelectedTool(e);
if(!Telerik.Web.UI.EditorButton.isInstanceOfType(_39a)){
return;
}
if(37==_398||39==_398){
var tool=_39a;
while(true){
tool=(37==_398)?this._getPreviousTool(tool):this._getNextTool(tool);
if(null==tool){
break;
}
if(tool.get_enabled()){
break;
}
}
if(tool&&tool.get_enabled()){
tool.setFocus();
}
}
if(13==_398&&_39a&&!_39a.get_selectedItem){
this._raiseEditorEvent(_39a,null);
return;
}
if(!Telerik.Web.UI.EditorDropDown.isInstanceOfType(_39a)){
return;
}
if(38==_398||40==_398){
var _39c=false;
if(!_39a.isExpanded()){
_39a.show();
_39c=true;
}
if(_39c||40==_398){
_39a.selectNextItem();
}else{
_39a.selectPreviousItem();
}
}else{
if(13==_398){
_39a.hide();
if(_39a.get_activeIndex){
_39a.set_selectedIndex(_39a.get_activeIndex());
}
this._onDropDownValueSelected(_39a);
}else{
if(27==_398){
_39a.hide();
}
}
}
},_onToolBarClick:function(e){
var _39e=this._getSelectedTool(e);
if(_39e){
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(_39e)){
_39e.click(e);
}else{
if(false){
}else{
this._raiseEditorEvent(_39e);
}
}
}
var _39f=this.get_editor();
if(_39f.get_mode()!=Telerik.Web.UI.EditModes.Design){
$telerik.cancelRawEvent(e);
}
},_raiseEditorEvent:function(tool,_3a1){
var _3a2=this.get_events().getHandler("ToolClick");
if(_3a2){
var _3a3=tool.get_name?tool.get_name():"";
var _3a4=new Telerik.Web.UI.EditorCommandEventArgs(_3a3,tool,_3a1);
_3a2(tool,_3a4);
}
},_getPreviousTool:function(tool){
var _3a6=Array.indexOf(this._tools,tool);
return this._tools[_3a6-1];
},_getNextTool:function(tool){
var _3a8=Array.indexOf(this._tools,tool);
return this._tools[_3a8+1];
},_getSelectedTool:function(e){
var _3aa=Telerik.Web.UI.EditorButton.getToolRootNode(e.target);
if(null==_3aa){
return;
}
var _3ab=_3aa.control;
if(null==_3ab){
return;
}
if(_3ab.get_enabled&&_3ab.get_enabled()==false){
return;
}
if(e&&_3ab){
e.preventDefault();
e.stopPropagation();
}
return _3ab;
},_getToolBarElements:function(){
var _3ac=this.get_element();
var _3ad=_3ac.getElementsByTagName("ul");
return _3ad;
},get_toolbarHolder:function(){
return this._toolbarHolder;
},get_editor:function(){
return this._editor;
},set_editor:function(_3ae){
if(this._editor!=_3ae){
this._editor=_3ae;
}
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_3af){
this._toolJSON=_3af;
},add_toolClick:function(_3b0){
this.get_events().addHandler("ToolClick",_3b0);
},remove_toolClick:function(_3b1){
this.get_events().removeHandler("ToolClick",_3b1);
}};
Telerik.Web.UI.Editor.DefaultToolAdapter.registerClass("Telerik.Web.UI.Editor.DefaultToolAdapter",Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
with(Telerik.Web.UI.Editor){
Telerik.Web.UI.Editor.UpdateCommandsArray={InsertOrderedList:new BrowserCommand(null,null,"InsertOrderedList"),InsertUnorderedList:new BrowserCommand(null,null,"InsertUnorderedList"),Unlink:new BrowserCommand(null,null,"Unlink"),Bold:new BrowserCommand(null,null,"Bold"),Italic:new BrowserCommand(null,null,"Italic"),Underline:new BrowserCommand(null,null,"Underline"),FontName:new BrowserCommand(null,null,"FontName"),FontSize:new BrowserCommand(null,null,"FontSize"),Paste:new BrowserCommand(null,null,"Paste"),Cut:new BrowserCommand(null,null,"Cut"),Copy:new BrowserCommand(null,null,"Copy"),JustifyLeft:new BrowserCommand(null,null,"JustifyLeft"),JustifyRight:new BrowserCommand(null,null,"JustifyRight"),JustifyCenter:new BrowserCommand(null,null,"JustifyCenter"),JustifyNone:new BrowserCommand(null,null,"JustifyNone"),JustifyFull:new BrowserCommand(null,null,"JustifyFull"),Indent:new BrowserCommand(null,null,"Indent"),Outdent:new BrowserCommand(null,null,"Outdent"),Unlink:new BrowserCommand(null,null,"Unlink"),Subscript:new BrowserCommand(null,null,"Subscript"),Superscript:new BrowserCommand(null,null,"Superscript"),StrikeThrough:new BrowserCommand(null,null,"StrikeThrough"),AbsolutePosition:new BrowserCommand(null,null,"AbsolutePosition"),FormatBlock:new FormatBlockCommand(null,null,null),InsertRowAbove:new TableInsertRow(null,null,"above"),InsertRowBelow:new TableInsertRow(null,null,"below"),InsertColumnLeft:new TableInsertColumn(null,null,"left"),InsertColumnRight:new TableInsertColumn(null,null,"right"),DeleteRow:new TableDeleteRow(null,null),DeleteColumn:new TableDeleteColumn(null,null),DeleteCell:new TableDeleteCell(null,null),MergeColumns:new TableMergeColumns(null,null),MergeRows:new TableMergeRows(null,null),SplitCell:new TableSplitCell(null,null),ApplyClass:new ClassNameCommand(null,null)};
}
Telerik.Web.UI.Editor.CommandList=new (function(){
this.AjaxSpellCheck=function(_3b2,_3b3,args){
function createSpellCheckEngine(){
if(!_3b3.get_ajaxSpellCheck()){
var _3b5={"editor":_3b3};
var _3b6=document.createElement("DIV");
var _3b7=$create(Telerik.Web.UI.Editor.AjaxSpellCheck,_3b5,null,null,_3b6);
var _3b8=_3b7.get_element();
var _3b9=$get(_3b3.get_id()+"Top");
if(_3b9){
_3b9.appendChild(_3b8);
}
_3b3.set_ajaxSpellCheck(_3b7);
}
var _3ba=_3b3.get_ajaxSpellCheck();
if(args&&args.value){
_3ba.set_language(args.value);
}
_3ba.spellCheck();
}
if(typeof (Telerik.Web.UI.Editor.AjaxSpellCheck)=="undefined"){
function OnWebRequestCompleted(_3bb,_3bc){
var _3bd=_3bb.get_responseData();
Telerik.Web.UI.Editor.Utils.evalScriptCode(_3bd);
createSpellCheckEngine();
}
var _3be=_3b3.get_ajaxSpellCheckScriptReference();
var _3bf=new Sys.Net.WebRequest();
_3bf.set_url(_3be);
_3bf.set_httpVerb("GET");
_3bf.add_completed(OnWebRequestCompleted);
_3bf.invoke();
}else{
createSpellCheckEngine();
}
return false;
};
this.ModuleManager=function(_3c0,_3c1,args){
var _3c3=args.value;
var _3c4=_3c1.get_modulesManager();
if(!_3c4){
return false;
}
var _3c5=_3c4.getModuleByName(_3c3);
if(_3c5){
_3c5.toggleVisibility();
_3c1._updateEditorSize(null,true);
}
return false;
};
this.ToggleScreenMode=function(_3c6,_3c7,args){
_3c7.toggleScreenMode();
return false;
};
this.InsertRowAbove=this.InsertRowBelow=function(_3c9,_3ca,args){
_3ca.executeCommand(new Telerik.Web.UI.Editor.TableInsertRow(_3ca.getLocalizedString(_3c9),null,_3c9=="InsertRowAbove"?"above":"below"));
};
this.InsertColumnLeft=this.InsertColumnRight=function(_3cc,_3cd,args){
_3cd.executeCommand(new Telerik.Web.UI.Editor.TableInsertColumn(_3cd.getLocalizedString(_3cc),null,_3cc=="InsertColumnLeft"?"left":"right"));
};
this.DeleteRow=function(_3cf,_3d0,args){
_3d0.executeCommand(new Telerik.Web.UI.Editor.TableDeleteRow(_3d0.getLocalizedString(_3cf)));
};
this.DeleteColumn=function(_3d2,_3d3,args){
_3d3.executeCommand(new Telerik.Web.UI.Editor.TableDeleteColumn(_3d3.getLocalizedString(_3d2)));
};
this.DeleteCell=function(_3d5,_3d6,args){
_3d6.executeCommand(new Telerik.Web.UI.Editor.TableDeleteCell(_3d6.getLocalizedString(_3d5)));
};
this.MergeColumns=function(_3d8,_3d9,args){
_3d9.executeCommand(new Telerik.Web.UI.Editor.TableMergeColumns(_3d9.getLocalizedString(_3d8)));
};
this.MergeRows=function(_3db,_3dc,args){
_3dc.executeCommand(new Telerik.Web.UI.Editor.TableMergeRows(_3dc.getLocalizedString(_3db)));
};
this.SplitCell=function(_3de,_3df,args){
_3df.executeCommand(new Telerik.Web.UI.Editor.TableSplitCell(_3df.getLocalizedString(_3de)));
};
this.DeleteTable=function(_3e1,_3e2,args){
var _3e4=args.value;
if(!_3e4){
_3e4=_3e2.getSelectedElement();
}
if(_3e4&&"TABLE"!=_3e4.tagName){
_3e4=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_3e4,"TABLE");
}
if(_3e4){
_3e2.selectElement(_3e4);
_3e2.executeBrowserCommand("Delete");
}
};
this.InsertFormForm=this.InsertFormButton=this.InsertFormCheckbox=this.InsertFormHidden=this.InsertFormImageButton=this.InsertFormPassword=this.InsertFormRadio=this.InsertFormReset=this.InsertFormSelect=this.InsertFormSubmit=this.InsertFormTextarea=this.InsertFormText=function(_3e5,_3e6,args){
var _3e8=_3e5.substring(10);
var _3e9=new Telerik.Web.UI.EditorCommandEventArgs(_3e5,args.get_tool(),_3e8);
_3e6.fire("InsertFormElement",_3e9);
};
this.StripAll=this.StripCss=this.StripFont=this.StripSpan=this.StripWord=function(_3ea,_3eb,args){
var _3ed=_3ea.substring(5);
var _3ee=new Telerik.Web.UI.EditorCommandEventArgs(_3ea,args.get_tool(),_3ed.toUpperCase());
_3eb.fire("FormatStripper",_3ee);
};
this.FormatStripper=function(_3ef,_3f0,args){
var _3f2=args.value;
var _3f3="";
try{
_3f3=_3f0.getSelectionHtml();
}
catch(e){
}
var oSel=_3f0.get_document().selection?_3f0.get_document().selection:_3f0.get_contentWindow().getSelection();
var _3f5=oSel.type?oSel.type.toLowerCase()=="none":oSel.isCollapsed;
if(_3f5||_3f3==""||_3f0.get_html()==_3f3){
var _3f6=Telerik.Web.UI.Editor.Utils.stripFormatting(_3f0.get_html(),_3f2);
_3f0.set_html(_3f6,_3f0.getLocalizedString(_3ef)+" "+_3f2);
}else{
if(_3f3!=null){
var _3f6=Telerik.Web.UI.Editor.Utils.stripFormatting(_3f3,_3f2);
_3f0.pasteHtml(_3f6,_3ef);
}
}
};
this.InsertTable=function(_3f7,_3f8,args){
var _3fa=args.value;
if(_3fa){
var _3fb=Telerik.Web.UI.Editor.Utils.createTable(_3fa.rows,_3fa.cols);
var _3fc=Telerik.Web.UI.Editor.Utils.getOuterHtml(_3fb);
_3f8.pasteHtml(_3fc,_3f7);
}
};
this.InsertTab=function(_3fd,_3fe,_3ff){
var _400=_3fe.getSelectedElement();
if(_400.tagName=="LI"){
_3fe.fire("Indent");
}else{
_3fe.pasteHtml(" &nbsp;&nbsp;&nbsp;&nbsp;",_3fd);
}
return false;
};
this.SetToolFocus=function(_401,_402,_403){
var _404=_402.get_toolAdapter();
if(_404){
_404.setFocus();
}
return false;
};
this.ViewHtml=function(_405,_406,_407){
alert(_406.get_html(true));
return false;
};
this.Undo=this.Redo=function(_408,_409,args){
var _40b=args?args.value:1;
if(!_40b){
_40b=1;
}
if(_408=="Redo"){
_409.redo(_40b);
}else{
_409.undo(_40b);
}
};
this.PastePlainText=function(_40c,_40d,_40e){
var _40f=function(_410){
if(_410){
var _411=_410.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
_411=Telerik.Web.UI.Editor.Utils.replaceNewLineWithBr(_411);
if(_411){
_40d.pasteHtml(_411,_40c);
}
}
};
if(_40d.isIE){
_40f(window.clipboardData.getData("Text"));
}else{
var _412=function(_413,args){
_40f(args.get_content());
};
_40d.showDialog("CleanPasteTextContent",{},_412);
return false;
}
};
this.PasteFromWord=this.PasteFromWordNoFontsNoSizes=this.PasteAsHtml=function(_415,_416,_417){
var _418=function(_419,_41a){
var _41b="";
if(_415=="PasteFromWord"){
_41b=Telerik.Web.UI.Editor.Utils.stripFormatting(_419,"WORD");
}else{
if(_415=="PasteFromWordNoFontsNoSizes"){
_41b=Telerik.Web.UI.Editor.Utils.stripFormatting(_419,"WORD_ALL");
}else{
_41b=Telerik.Web.UI.Editor.Utils.convertText2Html(_419);
}
}
if(_41a){
_41a.select();
}
if(_41b){
_416.pasteHtml(_41b,_415);
}
};
if(_416.isIE){
var _41c=_416.createRestorePoint();
var _41d=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
_418(_41d,_41c);
}else{
var _41e=function(_41f,args){
_418(args.get_content());
};
_416.showDialog("CleanPasteHtmlContent",{},_41e);
}
};
this.Copy=function(_421,_422,args){
if(null!=args){
var _424=window.opera?false:true;
if(_424){
try{
document.queryCommandEnabled(_421);
}
catch(e){
_424=false;
}
}
if(_424){
_422.get_document().execCommand(_421,false,null);
}else{
alert(_422.getLocalizedString("UseCtrlC"));
}
}
};
this.Cut=this.Paste=function(_425,_426,args){
if(null!=args){
var _428=window.opera?false:true;
if(_428){
try{
if(!_426.isIE7){
document.queryCommandEnabled(_425);
}
}
catch(e){
_428=false;
}
}
if(_425=="Paste"&&_428&&_426.isIE7){
_426.get_document().body.fireEvent("onbeforepaste");
}
if(_428){
var oCmd=new Telerik.Web.UI.Editor.GenericCommand(_426.getLocalizedString(_425),_426.get_contentWindow());
_426.get_document().execCommand(_425,false,null);
_426.executeCommand(oCmd);
}else{
var id=(_425=="Cut"?"UseCtrlX":"UseCtrlV");
alert(_426.getLocalizedString(id));
}
}else{
_426._pendingCutPasteCommand=new Telerik.Web.UI.Editor.GenericCommand(_426.getLocalizedString(_425),_426.get_contentWindow());
}
};
this.InsertParagraph=function(_42b,_42c,_42d){
_42c.executeBrowserCommand(_42b,true,"");
return true;
};
this.FormatBlock=function(_42e,_42f,args){
_42f.executeCommand(new Telerik.Web.UI.Editor.FormatBlockCommand(_42f.getLocalizedString(_42e),_42f.get_contentWindow(),args.value));
};
this.InsertOrderedList=this.InsertUnorderedList=function(_431,_432,args){
_432.setFocus();
_432.executeCommand(new Telerik.Web.UI.Editor.InsertListCommand(_432.getLocalizedString(_431),_432.get_contentWindow(),_432.get_newLineBr(),_431,null));
};
this.Bold=this.Italic=this.Underline=this.JustifyLeft=this.JustifyRight=this.JustifyCenter=this.JustifyNone=this.Indent=this.Outdent=this.SelectAll=this.Unlink=this.JustifyFull=this.StrikeThrough=this.Subscript=this.Superscript=this.AbsolutePosition=function(_434,_435,_436){
_435.setActive();
var _437="SelectAll"!=_434;
if(_434=="Unlink"&&!_435.isIE){
var elem=_435.getSelectedElement();
if(elem&&elem.tagName=="A"){
_435.selectElement(elem,false);
}
}
_435.executeBrowserCommand(_434,_437,null,null);
return true;
};
this.ForeColor=this.BackColor=this.FontName=this.FontSize=function(_439,_43a,args){
var _43c=args.value;
_43a.executeBrowserCommand(_439,true,_43c);
};
this.Zoom=function(_43d,_43e,args){
var _440=args.value;
var tool=args.get_tool?args.get_tool():null;
if(_440&&tool&&tool.updateValue){
tool.updateValue(_440);
}
_43e._contentArea.style.zoom=_440;
return false;
};
this.Print=function(_442,_443,args){
if(_443.isIE){
_443.get_document().execCommand(_442,false,null);
}else{
if(_443.get_contentWindow().print){
_443.get_contentWindow().print();
}
}
return false;
};
this.InsertSnippet=function(_445,_446,args){
_446.pasteHtml(args.value,_445);
};
this.InsertFormElement=function(_448,_449,args){
var _44b=args.value;
_44b=_44b.toLowerCase();
var _44c=null;
switch(_44b){
case "form":
_44c=_449.createElement("form","150px","150px");
_44c.innerHTML="&nbsp;";
break;
case "textarea":
_44c=_449.createElement("textarea");
break;
case "select":
_44c=_449.createElement("select","100px","22px");
break;
case "checkbox":
case "radio":
_44c=_449.createElement("input");
_44c.setAttribute("type",_44b);
break;
case "button":
case "reset":
case "submit":
_44c=_449.createElement("input","50px","22px");
_44c.setAttribute("type",_44b);
break;
case "hidden":
case "password":
case "text":
_44c=_449.createElement("input","100px","22px");
_44c.setAttribute("type",_44b);
break;
}
if(_44c){
var id=Telerik.Web.UI.Editor.Utils.getUniqueID();
_44c.setAttribute("id",id);
var html=Telerik.Web.UI.Editor.Utils.getOuterHtml(_44c);
_449.pasteHtml(html,_448);
var _44f=_449.get_document().getElementById(id);
if(_44f){
_44f.removeAttribute("id");
if(_44f.setActive){
_44f.setActive();
}
return false;
}
}
};
this.InsertGroupbox=this.InsertDate=this.InsertTime=this.InsertSymbol=this.InsertHorizontalRule=function(_450,_451,args){
var _453="";
switch(_450){
case "InsertSymbol":
_453=args.value;
break;
case "InsertHorizontalRule":
_453="<hr>";
break;
case "InsertDate":
var now=new Date();
_453="&nbsp;"+now.toLocaleDateString();
break;
case "InsertTime":
var now=new Date();
_453="&nbsp;"+now.toLocaleTimeString();
break;
default:
_453="<fieldset style='WIDTH: 200px; HEIGHT: 76px'> <legend>Title</legend>Content... </fieldset> ";
}
_451.pasteHtml(_453,_450);
};
this.ImageManager=function(_455,_456,_457){
var _458=function(_459,args){
_456.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_455);
};
var _45b=_456.getSelectedElement();
if(_45b&&_45b.tagName.toLowerCase()=="img"){
_456.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_45b.src);
}
var args={editor:_456};
_456.showDialog("ImageManager",args,_458);
_456.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.SilverlightManager=function(_45d,_45e,_45f){
var _460=function(_461,args){
var html=args.Result;
var _464=_45e._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _465=_45e._filtersManager.getFilterByName("MozillaKeepFlashString");
html=(_464)?_464.getDesignContent(html):html;
html=(_465)?_465.getDesignContent(html):html;
_45e.pasteHtml(html,_45d);
};
var _466={};
var _467=_45e.getSelectedElement();
if(_467){
if($telerik.isIE&&_467.object&&_467.object.Movie){
var _468=_467.object.Movie;
_45e.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_468);
_466.selectedItemUrl=_468;
_466.selectedObject=_467;
}
}
_45e.showDialog("SilverlightManager",_466,_460);
_45e.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.FlashManager=function(_469,_46a,_46b){
var _46c=function(_46d,args){
var _46f=_46a._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _470=_46a._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_46f)?_46f.getDesignContent(html):html;
html=(_470)?_470.getDesignContent(html):html;
_46a.pasteHtml(html,_469);
};
var _472={};
var _473=_46a.getSelectedElement();
if(_473){
if($telerik.isIE&&_473.object&&_473.object.Movie){
var _474=_473.object.Movie;
_46a.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_474);
_472.selectedItemUrl=_474;
_472.selectedObject=_473;
}
}
_46a.showDialog("FlashManager",_472,_46c);
_46a.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.MediaManager=function(_475,_476,_477){
var _478=function(_479,args){
var _47b=_476._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _47c=_476._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_47b)?_47b.getDesignContent(html):html;
html=(_47c)?_47c.getDesignContent(html):html;
_476.pasteHtml(html,_475);
};
var _47e={};
var _47f=_476.getSelectedElement();
if(_47f){
if($telerik.isIE&&_47f.object&&_47f.object.FileName){
var _480=_47f.object.FileName;
_476.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_480);
_47e.selectedItemUrl=_480;
_47e.selectedObject=_47f;
}
}
_476.showDialog("MediaManager",_47e,_478);
_476.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.TemplateManager=function(_481,_482,_483){
var _484=function(_485,args){
_482.pasteHtml(args.Result,_481);
};
_482.showDialog("TemplateManager",{},_484);
return false;
};
this.AboutDialog=function(_487,_488,_489){
_488.showDialog("AboutDialog");
return false;
};
this.Help=function(_48a,_48b,_48c){
_48b.showDialog("Help");
return false;
};
this.PageProperties=function(_48d,_48e,_48f){
var _490=function(_491,args){
};
var _493={};
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_493,"BODY",_48e,_48d);
_48e.showDialog("PageProperties",_493,_490);
return false;
};
this.ImageMapDialog=function(_494,_495,args){
var _497=Telerik.Web.UI.Editor.CommandList._getImageMapDialogArgument(_495);
var _498=function(wnd,_49a){
Telerik.Web.UI.Editor.CommandList._setImageMapProperties(_495,_49a);
return false;
};
_495.showDialog("ImageMapDialog",_497,_498);
return false;
};
this._setImageMapProperties=function(_49b,args){
if(!args){
return;
}
var _49d=_49b.getSelectedElement();
var _49e;
if(_49d&&_49d.tagName=="IMG"){
_49e=_49d;
if(args.ImageSrc!=_49e.src){
_49e.src=args.ImageSrc;
}
}else{
if(!args.ImageSrc){
return;
}
_49b.pasteHtml("<img src=\""+args.ImageSrc+"\" id = \"__tmp__\">");
_49e=_49b.get_document().getElementById("__tmp__");
_49e.removeAttribute("id");
if(document.all){
var oRng=_49b.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_49e);
oRng.select();
}
}
var _4a0=document.createElement("SPAN");
_4a0.innerHTML=args.MapHtml;
var _4a1=_4a0.getElementsByTagName("map");
if(_4a1.length==0){
return;
}
var _4a2=_4a1[0].innerHTML;
_4a0=null;
if(!_4a2){
_49e.removeAttribute("useMap");
return;
}
var _4a3="";
var map=null;
var _4a5=_49e.getAttribute("useMap");
if(_4a5){
_4a3=_4a5.substr(1);
map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_49b,_4a3);
}
if(map==null){
var _4a6=new Date()-100;
var _4a3="rade_img_map_"+_4a6;
map=_49b.get_document().createElement("map");
map.id=_4a3;
this._setNameAttribute(map,_4a3);
map=_49b.get_document().body.appendChild(map);
_49e.setAttribute("useMap","#"+_4a3);
_49e.setAttribute("border","0");
}
map.innerHTML=_4a2;
};
this._setNameAttribute=function(_4a7,name){
_4a7.removeAttribute("name");
_4a7.removeAttribute("NAME");
_4a7.name=null;
_4a7.name=name;
_4a7["NAME"]=name;
};
this._getImageMapDialogArgument=function(_4a9){
var _4aa={};
_4aa._editor=_4a9;
var _4ab=_4a9.getSelectedElement();
if(_4ab&&_4ab.tagName=="IMG"){
_4aa.ImageSrc=_4ab.getAttribute("src",2);
_4aa.ImageWidth=(_4ab.style.width)?_4ab.style.width:_4ab.width;
_4aa.ImageHeight=(_4ab.style.height)?_4ab.style.height:_4ab.height;
if($telerik.isIE){
var oRng=_4a9.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_4ab);
oRng.select();
}
if(_4ab.useMap){
var _4ad=_4ab.getAttribute("useMap").substr(1);
var map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_4a9,_4ad);
if(map!=null){
_4aa.ImageMapHTML="<map name = \""+_4ad+"\">"+map.innerHTML+"</map>";
}else{
_4aa.ImageMapHTML="";
}
_4ab.style.width=_4aa.ImageWidth;
_4ab.style.height=_4aa.ImageHeight;
}
}
return _4aa;
};
this._getImageMapByName=function(_4af,_4b0){
var _4b1=_4af.get_document();
var map=_4b1.getElementById(_4b0);
if(map!=null){
return map;
}
var maps=_4b1.getElementsByTagName("map");
for(var i=0;i<maps.length;i++){
if(maps[i].getAttribute("name")==_4b0){
return maps[i];
}
}
return null;
};
this.DocumentManager=function(_4b5,_4b6,_4b7){
var _4b8={};
var _4b9=function(_4ba,args){
_4b6.pasteHyperLink(args.Result,_4b5);
};
var _4bc=_4b6.get_dialogOpener().get_additionalQueryString();
var _4bd=_4b6.getSelectedElement();
if(_4bd&&_4bd.tagName.toLowerCase()=="a"){
_4b6.get_dialogOpener().set_additionalQueryString(_4bc+"&PreselectedItemUrl="+_4bd.href);
}
_4b6.showDialog("DocumentManager",_4b8,_4b9);
_4b6.get_dialogOpener().set_additionalQueryString(_4bc);
return false;
};
this.TableWizard=function(_4be,_4bf,_4c0){
var _4c1=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4bf,null,true,false);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4c1,"TABLE",_4bf,_4be);
var _4c2=function(_4c3,args){
_4bf.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4be);
};
_4bf.showDialog("TableWizard",_4c1,_4c2);
return false;
};
this.SetTableProperties=function(_4c5,_4c6,_4c7){
var _4c8=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4c6,1,false,true);
if(!_4c8){
alert(_4c6.getLocalizedString("tablewarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4c8,"TABLE",_4c6,_4c5);
var _4c9=Telerik.Web.UI.Editor.CommandList._getParentTable(_4c6);
var _4ca=function(_4cb,args){
_4c6.selectElement(_4c9);
_4c6.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4c5);
};
_4c6.showDialog("TableWizard",_4c8,_4ca);
return false;
};
this.SetCellProperties=function(_4cd,_4ce,_4cf){
var _4d0=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4ce,2,false,true);
if(!_4d0){
alert(_4ce.getLocalizedString("cellwarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4d0,"TABLE",_4ce,_4cd);
var _4d1=Telerik.Web.UI.Editor.CommandList._getParentTable(_4ce);
var _4d2=function(_4d3,args){
_4ce.selectElement(_4d1);
_4ce.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4cd);
};
_4ce.showDialog("TableWizard",_4d0,_4d2);
return false;
};
this.FindAndReplace=function(_4d5,_4d6,_4d7){
var _4d8={};
_4d8._editor=_4d6;
var _4d9=function(_4da,args){
};
_4d6.showDialog("FindAndReplace",_4d8,_4d9);
return false;
};
this.StyleBuilder=function(_4dc,_4dd,_4de){
var _4df=function(_4e0,args){
_4dd.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_4dc);
};
var _4e2={};
var _4e3=_4dd.getSelection();
var _4e4=_4e3.getParentElement();
if(!_4e3.isControl()){
var _4e5=_4e3.getHtml();
if(_4e5!=""||(_4e4&&_4e4.tagName&&_4e4.tagName.toLowerCase()=="body")){
var _4e6=_4dd.createElement("span");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_4e6,_4e5);
_4e4=_4e6;
}else{
_4dd.selectElement(_4e4,false);
}
}
_4e2.htmlElement=_4e4;
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4e2,"*",_4dd,_4dc);
_4e2.fontNames=_4dd.get_fontNames();
_4dd.showDialog("StyleBuilder",_4e2,_4df);
return false;
};
this.XhtmlValidator=function(_4e7,_4e8,_4e9){
var _4ea=_4e8;
var _4eb=function(_4ec,args){
};
_4e8.showDialog("XhtmlValidator",_4ea,_4eb);
return false;
};
this.TrackChangesDialog=function(_4ee,_4ef,_4f0){
var _4f1=_4ef;
var _4f2=function(_4f3,args){
};
_4ef.showDialog("TrackChangesDialog",_4f1,_4f2);
};
this.InsertCustomLink=function(_4f5,_4f6,args){
var link=args.value;
var _4f9=String.format("<a href='{1}' title='{3}' target='{2}'>{0}</a>",link.innerHTML,link.href,link.target,link.title);
var _4fa=Telerik.Web.UI.Editor.CommandList._getParentLink(_4f6);
if(_4fa){
var _4fb=_4fa.cloneNode(true);
if(link.href){
_4fb.setAttribute("href",link.href);
}
if(link.target){
_4fb.setAttribute("target",link.target);
}
if(link.title){
_4fb.setAttribute("title",link.title);
}
if(!_4fb.innerHTML){
_4fb.innerHTML=link.innerHTML;
}
_4f9=Telerik.Web.UI.Editor.Utils.getOuterHtml(_4fb);
}
_4f6.pasteHtml(_4f9,_4f5);
};
this._getDialogArguments=function(_4fc,_4fd,_4fe,_4ff){
_4fc.Colors=_4fe.get_colors();
if("TD"==_4fd||"TH"==_4fd||"TABLE"==_4fd){
_4fc.CssClasses=_4fe.getCssArray("TABLE");
_4fc.CellCssClasses=_4fe.getCssArray("TD");
}else{
if("A"==_4fd||"BODY"==_4fd||"IMG"==_4fd){
_4fc.CssClasses=_4fe.getCssArray(_4fd);
}
}
_4fc.Editor=_4fe;
};
this.SetLinkProperties=this.LinkManager=function(_500,_501,_502){
var _503=Telerik.Web.UI.Editor.CommandList._getLinkArgument(_501);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_503,"A",_501,_500);
var _504=function(_505,args){
_501.pasteHyperLink(args.realLink,_500);
};
_501.showDialog("LinkManager",_503,_504);
return false;
};
this.SetImageProperties=function(_507,_508,_509){
var _50a={};
_50a.Element=_508.getSelectedElement();
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_50a,"IMG",_508,_507);
var _50b=function(_50c,args){
_508.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_507);
};
_508.showDialog("ImageProperties",_50a,_50b);
return false;
};
this.FormatCodeBlock=function(_50e,_50f,_510){
var _511={dirtyCode:_50f.getSelectionHtml()};
if(_50f.get_document().selection&&_50f.get_document().selection){
var _512=_50f.get_document().selection.type.toLowerCase();
if(_512=="control"||_512=="none"){
_511.dirtyCode="";
}
}
var _513=function(_514,args){
_50f.pasteHtml(args.get_code(),_50e);
};
_50f.showDialog("FormatCodeBlock",_511,_513);
return false;
};
this._getDocumentAnchors=function(_516){
var _517=_516.getElementsByTagName("A");
var _518=new Array();
for(var i=0;i<_517.length;i++){
if(_517[i].name){
_518[_518.length]=_517[i];
}
}
return _518;
};
this._getParentLink=function(_51a){
_51a.setFocus();
var _51b=_51a.getSelectedElement();
var _51c=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_51b,"A");
if(_51c){
_51a.selectElement(_51c);
}else{
var _51d="";
if(_51b&&_51b.tagName=="IMG"){
_51d=Telerik.Web.UI.Editor.Utils.getOuterHtml(_51b);
}else{
_51d=_51a.getSelection().getHtml();
}
_51c=_51a.get_document().createElement("A");
try{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_51c,_51d);
}
catch(e){
_51c.innerHTML=Telerik.Web.UI.Editor.Utils.stripFormatting(_51d,"ALL");
}
}
return _51c;
};
this._getLinkArgument=function(_51e,_51f){
var _520=Telerik.Web.UI.Editor.CommandList._getParentLink(_51e);
return {selectedTabIndex:_51f?_51f:0,realLink:_520.cloneNode(true),showText:!Telerik.Web.UI.Editor.Utils.hasHtmlContent(_520.innerHTML),documentAnchors:Telerik.Web.UI.Editor.CommandList._getDocumentAnchors(_51e.get_document())};
};
this._getParentTable=function(_521){
_521.setFocus();
var _522=_521.getSelectedElement();
var _523=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_522,"TABLE");
return _523;
};
this._getParentCell=function(_524){
_524.setFocus();
var _525=_524.getSelectedElement();
var _526=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_525,"TD");
return _526;
};
this._getTableArgument=function(_527,_528,_529,_52a){
var _52b;
var _52c=null;
if(_529){
_52b=Telerik.Web.UI.Editor.Utils.createTable(2,2,_527._document);
}else{
_52b=Telerik.Web.UI.Editor.CommandList._getParentTable(_527);
}
if(!_529&&!_52b){
return null;
}
if(_52a){
_52c=Telerik.Web.UI.Editor.CommandList._getParentCell(_527);
}
var _52d=_52b.cloneNode(true);
var _52e=_52b;
return {selectedTabIndex:_528?_528:0,cellToModify:_52c,tableToModify:_52d,originalTable:_52e,tableDocument:(_52d.document)?_52d.document:_527.get_document()};
};
this.EnterParagraphMozilla=function(_52f,_530,args){
var _532=_530.getSelectedElement();
if("LI"==_532.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_532,"LI")!=null){
_530.bubbleKeyEventToBrowser();
return false;
}
var _533=_530.get_contentWindow();
var oDoc=_533.document;
function checkParent(_535,_536){
_536[_536.length]=_535;
while(_535!=null&&_535.tagName!="P"){
if(_535.tagName=="TD"){
return null;
}
_535=_535.parentNode;
_536[_536.length]=_535;
}
return _535;
}
var _537=_533.getSelection();
var _538=_537.getRangeAt(0);
var _539=_538.cloneRange();
_538.deleteContents();
var _53a=_538.startOffset;
var _53b=_538.startContainer;
var _53c="";
var _53d=[];
var inP=checkParent(_53b,_53d);
if(inP){
var _53f=(inP.innerHTML=="");
var _540=_538.cloneRange();
_540.setStart(inP,0);
_540.setEnd(_53b,_53a);
var _541=_540.cloneContents();
var _542=_538.cloneRange();
_542.setStart(_53b,_53a);
if(inP.lastChild){
_542.setEndAfter(inP.lastChild);
}else{
_542.setEnd(inP,0);
}
var _543=_542.cloneContents();
_538.selectNode(inP);
_537.removeAllRanges();
_537.addRange(_538);
inP=inP.cloneNode(true);
inP.innerHTML="";
var _544=inP.cloneNode(true);
if(_53f){
_544.innerHTML="&nbsp;";
}else{
_544.appendChild(_541);
}
endPar=inP.cloneNode(true);
endPar.appendChild(_543);
var newP=inP.cloneNode(true);
var _546=newP;
if(_53d.length>0){
for(var i=_53d.length;i>0;i--){
var _548=_53d[i];
var _549=_548&&_548.cloneNode?_548.cloneNode(false):null;
if(_549&&_549.tagName!="P"){
_546.appendChild(_549);
_546=_549;
}
}
}
_546.innerHTML="&nbsp;";
_546.setAttribute("id","radETempNode");
var _54a=oDoc.createElement("div");
_54a.appendChild(_544);
_54a.appendChild(newP);
if(!_53f){
_54a.appendChild(endPar);
}
_53c=_54a.innerHTML;
}else{
_53c="<p id='radETempNode'>&nbsp;</p>";
}
_530.pasteHtml(_53c,"Enter",false,false,false);
oP=oDoc.getElementById("radETempNode");
if(oP){
oP.removeAttribute("id",0);
var _537=_533.getSelection();
var _538=oDoc.createRange();
_538.selectNodeContents(oP);
_537.removeAllRanges();
_537.addRange(_538);
}
var ps=oDoc.getElementsByTagName("P");
for(var i=0;i<ps.length;i++){
var _54c=ps[i].innerHTML;
if(_54c==""||_54c.trim().toLowerCase()=="<br>"){
ps[i].parentNode.removeChild(ps[i]);
}
}
return false;
};
this.Enter=function(_54d,_54e,args){
var _550=_54e.getSelectedElement();
if("LI"==_550.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_550,"LI")!=null){
_54e.bubbleKeyEventToBrowser();
return false;
}
try{
var _551=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_54e.get_contentWindow());
var _552=_54e.get_document().selection.createRange();
if(_552.pasteHTML){
var tag=_550.tagName;
if(tag.charAt(0)=="H"&&parseInt(tag.charAt(1))>0){
var _554=_552.duplicate();
_554.moveToElementText(_550);
_54e.bubbleKeyEventToBrowser();
return false;
}
_552.pasteHTML("<br>");
_552.select();
_552.moveEnd("character",1);
_552.moveStart("character",1);
_552.collapse(false);
}else{
if(_552(0)){
_552.execCommand("Delete");
}
}
_54e.executeCommand(_551);
}
catch(exc){
alert(exc.message);
}
return false;
};
this.ShiftEnter=function(_555,_556,args){
var _558=_556.getSelectedElement();
if("LI"==_558.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_558,"LI")!=null){
var _559=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_556.get_contentWindow());
var _55a=_556.get_document().selection.createRange();
_55a.pasteHTML("<br>");
_55a.select();
_55a.moveEnd("character",1);
_55a.moveStart("character",1);
_55a.collapse(false);
_556.executeCommand(_559);
return false;
}
_556.bubbleKeyEventToBrowser();
return false;
};
this.ToggleTableBorder=function(_55b,_55c,args){
_55c.toggleEnhancedEdit();
return false;
};
this.RealFontSize=function(_55e,_55f,args){
var _561=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_55f);
var _562=_561.markedElements;
var _563=_55f.createRestorePoint();
var _564=new Telerik.Web.UI.Editor.GenericCommand(_55f.getLocalizedString(_55e),_55f.get_contentWindow());
if(_562.length==0){
var _565=_55f.getSelection().getParentElement();
if($telerik.isIE&&!_55f.getSelection().getHtml()&&(_565.tagName=="FONT"||_565.tagName=="SPAN")){
_55f._document.execCommand("RemoveFormat",null,false);
}
_55f.pasteHtml("<font style='font-size:"+args.value+"' id='radERealFont'>&nbsp;</font>",_55e);
var _566=_55f._document.getElementById("radERealFont");
_566.removeAttribute("id");
if($telerik.isIE){
_55f.selectElement(_566);
_55f.getSelection().collapse();
_566.innerHTML="";
}else{
if(_55f._contentWindow.getSelection){
var oSel=_55f._contentWindow.getSelection();
var _568=_55f.getSelection().getRange();
oSel.removeAllRanges();
if(_568&&_568.selectNodeContents){
_568.selectNodeContents(_566);
}
oSel.addRange(_568);
}
}
}else{
for(var i=0;i<_562.length;i++){
_562[i].style.fontSize=args.value;
_562[i].removeAttribute("size");
}
if(_563){
_563.select();
}
_55f.executeCommand(_564);
}
};
this.ConvertToUpper=this.ConvertToLower=function(_56a,_56b,args){
var _56d;
var endR;
if($telerik.isIE){
if(_56b._document.selection.type.toLowerCase()=="control"){
return;
}
var _56f=_56b._document.selection.createRange();
_56d=_56f.duplicate();
endR=_56f.duplicate();
_56d.collapse();
endR.collapse(false);
}
var _570=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_56b);
var _571=_570.markedElements;
var _572=_570.newElements;
var _573=new Telerik.Web.UI.Editor.GenericCommand(_56b.getLocalizedString(_56a),_56b.get_contentWindow());
for(var i=0;i<_571.length;i++){
changeChildNodesCase(_571[i]);
}
for(var i=0;i<_572.length;i++){
if($telerik.isIE){
_572[i].removeNode(false);
}else{
var _575=document.createRange();
_575.selectNodeContents(_572[i]);
_572[i].parentNode.replaceChild(_575.extractContents(),_572[i]);
}
}
if($telerik.isIE){
var _576=_56b._document.selection.createRange();
_576.setEndPoint("StartToStart",_56d);
_576.setEndPoint("EndToEnd",endR);
_576.select();
}else{
var _577=_56b.get_contentWindow().getSelection();
var rng=_577.getRangeAt(0);
rng.collapse(true);
}
_56b.executeCommand(_573);
function changeChildNodesCase(_579){
var _57a=_579.childNodes;
for(var i=0;i<_57a.length;i++){
if(_57a[i].nodeType==3){
_57a[i].nodeValue=("ConvertToLower"==_56a)?_57a[i].nodeValue.toLowerCase():_57a[i].nodeValue.toUpperCase();
}else{
if(_57a[i].nodeType==1&&_57a[i].tagName.toUpperCase()!="FONT"){
changeChildNodesCase(_57a[i]);
}
}
}
}
};
this.ApplyClass=function(_57c,_57d,args){
var _57f=args.value;
var _580=_57d.get_document();
var _581=_57d.createRestorePoint();
var _582=new Telerik.Web.UI.Editor.GenericCommand(_57d.getLocalizedString(_57c),_57d.get_contentWindow());
if(_57d.isIE){
var _583=_580.selection.createRange();
var _584=(_583.length>0?_583(0):_583.parentElement());
if(_584.tagName=="LI"){
var _585=_583.htmlText;
var _586=_585.match(/<LI\/?>/gi);
var _587=_586?_586.length:0;
if(_587>1){
_584=_584.parentNode;
}else{
if(_587==0&&(Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_584,_583.htmlText))&&_584.parentNode.childNodes.length==1){
_584=_584.parentNode;
}
}
}
if(_583.length>0||_584.tagName=="OL"||_584.tagName=="UL"){
_584.className=_57f;
return;
}
}
var _588=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_57d);
var _589=_588.markedElements;
if(_589.length==0){
var _58a=_57d.getSelection().getParentElement();
if($telerik.isIE&&!_57d.getSelection().getHtml()&&(_58a.tagName=="FONT"||_58a.tagName=="SPAN")){
_57d._document.execCommand("RemoveFormat",null,false);
}
_57d.pasteHtml("<font class='"+_57f+"' id='radERealFont'>&nbsp;</font>",_57c);
var _58b=_57d._document.getElementById("radERealFont");
_58b.removeAttribute("id");
if($telerik.isIE){
_57d.selectElement(_58b);
_57d.getSelection().collapse();
_58b.innerHTML="";
}else{
if(_57d._contentWindow.getSelection){
var oSel=_57d._contentWindow.getSelection();
var _58d=_57d.getSelection().getRange();
oSel.removeAllRanges();
if(_58d&&_58d.selectNodeContents){
_58d.selectNodeContents(_58b);
}
oSel.addRange(_58d);
}
}
}else{
for(var i=0;i<_589.length;i++){
_589[i].className=_57f;
}
if(_581){
_581.select();
}
_57d.executeCommand(_582);
}
};
this._markEditorSelection=function(_58f){
if(_58f.get_html()==""){
return {markedElements:[],newElements:[]};
}
var _590="AZBY";
var _591="_cm";
var _592=[];
var _593=[];
var _594=[];
var _595=$telerik.isSafari?"span":"font";
var _596=_58f._contentArea;
var _597=_58f.getSelection();
if(_597.isControl()){
var _598=_597.getParentElement();
var _599=_58f._document.createElement(_595);
_599.appendChild(_598.cloneNode(true));
_598.parentNode.replaceChild(_599,_598);
return {markedElements:[_599],newElements:[_599]};
}
if(!$telerik.isSafari){
keepFontNames();
}
if(!$telerik.isIE){
_596.ownerDocument.execCommand("UseCSS",false,true);
}
_596.ownerDocument.execCommand("FontName",false,_590);
var _59a=_596.getElementsByTagName(_595);
for(var i=0;i<_59a.length;i++){
var _599=_59a[i];
if(_599.getAttribute("face")==_590||_599.style.fontFamily==_590){
_599.removeAttribute("face");
if(_599.style.fontFamily==_590){
_599.style.fontFamily="";
}
_593.push(_599);
var _59c=_599.getElementsByTagName(_595);
for(var j=0;j<_59c.length;j++){
var _o=_59c[j];
if(_o.getAttribute("face")!=_590){
_593.push(_o);
}
}
if(!_599.getAttribute(_591)){
_594.push(_599);
}
}
_599.removeAttribute(_591);
}
if(!$telerik.isSafari){
restoreFontNames();
}
if(!$telerik.isIE){
_596.ownerDocument.execCommand("UseCSS",false,false);
}
function keepFontNames(){
var _59f=_58f._contentArea.getElementsByTagName(_595);
for(var i=0;i<_59f.length;i++){
var _5a1=_59f[i];
if(_59f[i].face){
_5a1.setAttribute("_face",_5a1.face);
_592.push(_5a1);
}
_5a1.setAttribute(_591,1);
}
}
function restoreFontNames(){
for(var i=0;i<_592.length;i++){
_592[i].face=_592[i].getAttribute("_face");
_592[i].removeAttribute("_face");
}
_592=[];
}
return {markedElements:_593,newElements:_594};
};
})();
if(typeof (RadEditorCommandList)=="undefined"){
var RadEditorCommandList=Telerik.Web.UI.Editor.CommandList;
}
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandsManager=function(_5a3){
this._commands=[];
this._currentCommandIndex=-1;
};
Telerik.Web.UI.Editor.CommandsManager.prototype={get_commands:function(){
return this._commands;
},execute:function(_5a4,_5a5){
if(_5a4&&_5a4.execute){
var _5a6=_5a4.execute();
if(false==_5a5){
return false;
}
if(_5a6&&_5a4._canUnexecute){
this._clearCommandsToRedo();
Array.add(this._commands,_5a4);
this._currentCommandIndex=this._commands.length-1;
return true;
}
}
return false;
},undo:function(_5a7){
if(_5a7>this._commands.length){
_5a7=this._commands.length;
}
var _5a8=0;
var _5a9=null;
while(0<_5a7--&&0<=this._currentCommandIndex&&this._currentCommandIndex<this._commands.length){
_5a9=this._commands[this._currentCommandIndex--];
if(_5a9){
_5a9.unexecute();
_5a8++;
}
}
},redo:function(_5aa){
if(_5aa>this._commands.length){
_5aa=this._commands.length;
}
var _5ab=0;
var _5ac=null;
var _5ad=this._currentCommandIndex+1;
while(0<_5aa--&&0<=_5ad&&_5ad<this._commands.length){
_5ac=this._commands[_5ad];
if(_5ac){
_5ac.execute();
this._currentCommandIndex=_5ad;
_5ab++;
}
_5ad++;
}
},removeCommandAt:function(_5ae){
this._commands.splice(_5ae,1);
if(this._currentCommandIndex>=_5ae){
this._currentCommandIndex--;
}
},isUndoAvailable:function(){
return (-1<this._currentCommandIndex);
},isRedoAvailable:function(){
return (this._currentCommandIndex<this._commands.length-1);
},getCommandsToUndo:function(){
if(this.isUndoAvailable()){
return (this._commands.slice(0,this._currentCommandIndex+1)).reverse();
}else{
return [];
}
},getCommandsToRedo:function(){
if(this.isRedoAvailable()){
return this._commands.slice(this._currentCommandIndex+1);
}else{
return [];
}
},canRepeatLastCommand:function(){
return ((this._currentCommandIndex==this._commands.length-1)&&null!=this._commands[this._currentCommandIndex]&&("function"==typeof (this._commands[this._currentCommandIndex].clone)));
},repeatLastCommand:function(){
if(this.canRepeatLastCommand()){
var _5af=this._commands[this._currentCommandIndex].clone();
this.execute(_5af);
}
},_clearCommandsToRedo:function(){
if(this.isRedoAvailable()){
this._commands.splice(this._currentCommandIndex+1,this._commands.length-this._currentCommandIndex);
}
}};
Telerik.Web.UI.Editor.CommandsManager.registerClass("Telerik.Web.UI.Editor.CommandsManager",null);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditingOptions=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditingOptions.prototype={Typing:1,Tools:2,ContextMenus:4,Tab:8,Modules:16,EditModes:32,All:63};
Telerik.Web.UI.EditingOptions.registerEnum("Telerik.Web.UI.EditingOptions",false);
Telerik.Web.UI.StripFormattingOptions=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.StripFormattingOptions.prototype={None:0,NoneSupressCleanMessage:1,MSWord:2,MSWordNoFonts:4,MSWordRemoveAll:8,Css:16,Font:32,Span:64,AllExceptNewLines:128,All:256};
Telerik.Web.UI.StripFormattingOptions.registerEnum("Telerik.Web.UI.StripFormattingOptions",false);
Telerik.Web.UI.EditModes=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditModes.prototype={Design:1,Html:2,Preview:4,All:7};
Telerik.Web.UI.EditModes.registerEnum("Telerik.Web.UI.EditModes",false);
Telerik.Web.UI.EditorToolbarMode=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditorToolbarMode.prototype={Default:1,Floating:2,PageTop:4,ShowOnFocus:8};
Telerik.Web.UI.EditorToolbarMode.registerEnum("Telerik.Web.UI.EditorToolbarMode",false);
Telerik.Web.UI.EditorFilters=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditorFilters.prototype={None:0,RemoveScripts:1,MakeUrlsAbsolute:2,FixUlBoldItalic:4,FixEnclosingP:8,IECleanAnchors:16,MozEmStrong:32,ConvertFontToSpan:64,ConvertToXhtml:128,IndentHTMLContent:256,DefaultFilters:65533};
Telerik.Web.UI.EditorFilters.registerEnum("Telerik.Web.UI.EditorFilters",false);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Filter=function(){
Telerik.Web.UI.Editor.Filter.initializeBase(this);
this.IsDom=false;
this.Enabled=false;
this.Name="RadEditor filter";
this.Description="RadEditor filter description";
};
Telerik.Web.UI.Editor.Filter.prototype={dispose:function(){
},getHtmlContent:function(_5b0){
return _5b0;
},getDesignContent:function(_5b1){
return _5b1;
},get_isDom:function(){
return this.IsDom;
},set_isDom:function(_5b2){
this.IsDom=_5b2;
},get_enabled:function(){
return this.Enabled;
},set_enabled:function(_5b3){
this.Enabled=_5b3;
},get_name:function(){
return this.Name;
},set_name:function(_5b4){
this.Name=_5b4;
},get_description:function(){
return this.Description;
},set_description:function(_5b5){
this.Description=_5b5;
}};
Telerik.Web.UI.Editor.Filter.registerClass("Telerik.Web.UI.Editor.Filter",Sys.Component);
Telerik.Web.UI.Editor.StripScriptsFilter=function(){
Telerik.Web.UI.Editor.StripScriptsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="StripScriptsFilter";
this.Description="This filter strips all script tags from the content.";
};
Telerik.Web.UI.Editor.StripScriptsFilter.prototype={getHtmlContent:function(_5b6){
return this._performStripping(_5b6);
},getDesignContent:function(_5b7){
return this._performStripping(_5b7);
},_performStripping:function(_5b8){
var _5b9=_5b8.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
_5b9=_5b9.replace(RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
return _5b9;
}};
Telerik.Web.UI.Editor.StripScriptsFilter.registerClass("Telerik.Web.UI.Editor.StripScriptsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.EncodeScriptsFilter=function(){
Telerik.Web.UI.Editor.EncodeScriptsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="EncodeScriptsFilter";
this.Description="This filter encodes all script tags from the content.";
};
Telerik.Web.UI.Editor.EncodeScriptsFilter.prototype={getHtmlContent:function(_5ba){
var _5bb=new RegExp("<!"+"--RADEDITORSAVEDTAG_([\\s\\S]*?)--"+">","ig");
var _5bc=new RegExp("--RADEDITORSAVEDTAGENDING>","ig");
var _5bd=_5ba.replace(_5bb,"<$1>");
_5bd=_5bd.replace(_5bc,"--"+">");
return _5bd;
},getDesignContent:function(_5be){
var _5bf=function(_5c0,_5c1,_5c2,_5c3,_5c4){
var _5c5=_5c4.substring(0,_5c3).lastIndexOf("<!"+"--");
var _5c6=_5c4.substring(0,_5c3).lastIndexOf("--"+">");
if(_5c5>_5c6){
_5c5=_5c4.substring(_5c3,_5c4.length).indexOf("<!"+"--");
_5c6=_5c4.substring(_5c3,_5c4.length).indexOf("--"+">");
if((_5c5==-1&&_5c6>-1)||(_5c6<_5c5)){
return _5c0;
}
}
var _5c7=_5c2.replace("--"+">","--RADEDITORSAVEDTAGENDING>");
var _5c8="<!"+"--RADEDITORSAVEDTAG_"+_5c1+_5c7+"--"+">";
return _5c8;
};
var _5c9=new RegExp("<(script|noscript)([\\s\\S]*?<\\/\\1)>","ig");
var _5ca=_5be.replace(_5c9,_5bf);
return _5ca;
}};
Telerik.Web.UI.Editor.EncodeScriptsFilter.registerClass("Telerik.Web.UI.Editor.EncodeScriptsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.RemoveExtraBrakes=function(){
Telerik.Web.UI.Editor.RemoveExtraBrakes.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="RemoveExtraBrakes";
this.Description="This filter strips all extra brakse inside some tags like p, h1, etc.";
};
Telerik.Web.UI.Editor.RemoveExtraBrakes.prototype={getHtmlContent:function(_5cb){
return this._performStripping(_5cb);
},_performStripping:function(_5cc){
var _5cd=_5cc;
_5cd=_5cd.replace(/<BR\s?\/?>\s*<\/(H1|H2|H3|H4|H5|H6|LI|P)/ig,"</$1");
_5cd=_5cd.replace(/<(H1|H2|H3|H4|H5|H6|LI|P)([^>]*)?><BR\s?\/?>/ig,"<$1 $2>");
return _5cd;
}};
Telerik.Web.UI.Editor.RemoveExtraBrakes.registerClass("Telerik.Web.UI.Editor.RemoveExtraBrakes",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FixNestedLists=function(){
Telerik.Web.UI.Editor.FixNestedLists.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="FixNestedLists";
this.Description="This filter produces valid XHTML from nested lists";
};
Telerik.Web.UI.Editor.FixNestedLists.prototype={_getElements:function(_5ce,_5cf){
var _5d0=_5ce.getElementsByTagName(_5cf);
if(!_5d0){
_5d0=_5ce.ownerDocument.getElementsByTagName(_5cf);
}
return _5d0;
},fixLists:function(_5d1,_5d2){
var _5d3=this._getElements(_5d1,_5d2);
for(var i=_5d3.length-1;i>=0;i--){
var list=_5d3[i];
var _5d6=list.previousSibling;
if(_5d6&&_5d6.nodeType==3){
_5d6=_5d6.previousSibling;
}
if(_5d6&&"li"==list.previousSibling.nodeName.toLowerCase()){
_5d6.appendChild(list.cloneNode(true));
var _5d7=list.parentNode;
_5d7.removeChild(list);
_5d7=null;
}
}
},getHtmlContent:function(_5d8){
this.fixLists(_5d8,"OL");
this.fixLists(_5d8,"UL");
return _5d8;
}};
Telerik.Web.UI.Editor.FixNestedLists.registerClass("Telerik.Web.UI.Editor.FixNestedLists",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FixUlBoldItalic=function(){
Telerik.Web.UI.Editor.FixUlBoldItalic.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="FixUlBoldItalic";
this.Description="This filter changes u, b, i tags to spans with CSS";
};
Telerik.Web.UI.Editor.FixUlBoldItalic.prototype={_getElements:function(_5d9,_5da){
var _5db=_5d9.getElementsByTagName(_5da);
if(!_5db){
_5db=_5d9.ownerDocument.getElementsByTagName(_5da);
}
return _5db;
},_replaceElementWithSpan:function(_5dc,_5dd,_5de){
var _5df=this._getElements(_5dc,_5dd);
while(_5df.length>0){
var _5e0=_5dc.ownerDocument.createElement("span");
_5e0.style.cssText=_5de;
var _5e1=_5df[0].innerHTML;
if($telerik.isIE&&_5e1==" "){
_5e0.innerText=_5e1;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_5e0,_5e1);
}
_5df[0].parentNode.replaceChild(_5e0,_5df[0]);
_5df=this._getElements(_5dc,_5dd);
}
},_replaceSpanWithElement:function(_5e2,_5e3,_5e4){
var _5e5=this._getElements(_5e2,"span");
var _5e6=_5e5.length-1;
while(_5e6>=0){
var _5e7=[];
var _5e8=_5e5[_5e6];
for(var i=0;i<_5e8.childNodes.length;i++){
Array.add(_5e7,_5e8.childNodes[i].cloneNode(true));
}
if(_5e8.style.cssText.toLowerCase()==_5e4||_5e8.style.cssText.toLowerCase()==(_5e4+";")){
var _5ea=_5e2.ownerDocument.createElement(_5e3);
for(var j=0;j<_5e7.length;j++){
_5ea.appendChild(_5e7[j]);
}
_5e8.parentNode.replaceChild(_5ea,_5e5[_5e6]);
_5e5=this._getElements(_5e2,"span");
_5e6=_5e5.length-1;
}else{
_5e6--;
}
}
},getHtmlContent:function(_5ec){
this._replaceElementWithSpan(_5ec,"u","text-decoration:underline;");
return _5ec;
},getDesignContent:function(_5ed){
this._replaceSpanWithElement(_5ed,"u","text-decoration: underline");
return _5ed;
}};
Telerik.Web.UI.Editor.FixUlBoldItalic.registerClass("Telerik.Web.UI.Editor.FixUlBoldItalic",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IEKeepCommentsFilter=function(){
Telerik.Web.UI.Editor.IEKeepCommentsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IEKeepCommentsFilter";
this.Description="This filter keeps the conditional comments in IE.";
};
Telerik.Web.UI.Editor.IEKeepCommentsFilter.prototype={getHtmlContent:function(_5ee){
var _5ef=new RegExp("<!"+"--RADEDITORSAVEDCOMMENT","ig");
var _5f0=_5ee.replace(_5ef,"<!--");
return _5f0;
},getDesignContent:function(_5f1){
var _5f2=new RegExp("<!"+"--(\\[[^]]+\\][\\s\\S]*?)-"+"->","ig");
var _5f3=_5f1.replace(_5f2,"<!-"+"-RADEDITORSAVEDCOMMENT$1-"+"->");
return _5f3;
}};
Telerik.Web.UI.Editor.IEKeepCommentsFilter.registerClass("Telerik.Web.UI.Editor.IEKeepCommentsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IEKeepObjectParamsFilter=function(){
Telerik.Web.UI.Editor.IEKeepObjectParamsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IEKeepObjectParamsFilter";
this.Description="This filter keeps the params of object tags when going to html mode and back.";
};
Telerik.Web.UI.Editor.IEKeepObjectParamsFilter.prototype={getHtmlContent:function(_5f4){
var _5f5=new RegExp("<param([\\s\\S]+?)?>","ig");
var _5f6=new RegExp("<rade_param([\\s>])","ig");
var _5f7=_5f4;
if(_5f5.test(_5f4)&&_5f6.test(_5f4)){
_5f7=_5f7.replace(_5f5,"");
}
_5f7=_5f7.replace(_5f6,"<param$1");
_5f7=_5f7.replace(/<\/rade_param>/gi,"");
return _5f7;
},getDesignContent:function(_5f8){
var _5f9=new RegExp("<param([\\s\\S]+?)/?>","ig");
var _5fa=_5f8.replace(_5f9,"<rade_param$1></rade_param><param$1>");
return _5fa;
}};
Telerik.Web.UI.Editor.IEKeepObjectParamsFilter.registerClass("Telerik.Web.UI.Editor.IEKeepObjectParamsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FixEnclosingP=function(){
Telerik.Web.UI.Editor.FixEnclosingP.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="FixEnclosingP";
this.Description="This filter removes a parent paragraph tag if the whole content is inside it.";
};
Telerik.Web.UI.Editor.FixEnclosingP.prototype={_removeNode:function(node){
var _5fc=node.parentNode;
if(_5fc!=null){
while(node.childNodes&&node.childNodes.length>0){
_5fc.insertBefore(node.childNodes[0],node);
}
_5fc.removeChild(node);
return _5fc;
}
return true;
},getHtmlContent:function(_5fd){
var _5fe=null;
if(_5fd.tagName.toLowerCase()=="html"){
_5fe=_5fd.getElementsByTagName("BODY")[0];
}else{
_5fe=_5fd;
}
if($telerik.isIE){
if(_5fe&&(_5fe.firstChild)&&("P"==_5fe.firstChild.tagName)&&(_5fe.childNodes.length==1)&&(_5fe.innerHTML.substring(0,3).toLowerCase()=="<p>")){
this._removeNode(_5fe.firstChild);
}
}else{
if(_5fe&&(_5fe.childNodes.length==1)&&(_5fe.firstChild.tagName)&&("br"==_5fe.firstChild.tagName.toLowerCase())){
_5fe.innerHTML="";
}
}
return _5fd;
}};
Telerik.Web.UI.Editor.FixEnclosingP.registerClass("Telerik.Web.UI.Editor.FixEnclosingP",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IEFixEmptyParagraphs=function(){
Telerik.Web.UI.Editor.IEFixEmptyParagraphs.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IEFixEmptyParagraphs";
this.Description="This filter inserts a non-braking space in empty paragraph tags so they are rendered correctly in IE.";
};
Telerik.Web.UI.Editor.IEFixEmptyParagraphs.prototype={getHtmlContent:function(_5ff){
var re=new RegExp("(<p[^>]*>)(<\\/p>)","ig");
var _601=_5ff.replace(re,"$1&nbsp;$2");
return _601;
}};
Telerik.Web.UI.Editor.IEFixEmptyParagraphs.registerClass("Telerik.Web.UI.Editor.IEFixEmptyParagraphs",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IECleanAnchorsFilter=function(){
Telerik.Web.UI.Editor.IECleanAnchorsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IECleanAnchorsFilter";
this.Description="This filter removse the current page href from all anchor (#) links .";
};
Telerik.Web.UI.Editor.IECleanAnchorsFilter.prototype={getHtmlContent:function(_602){
var _603=document.location.href;
var re=new RegExp("(<A[^<>]*?(href)\\s*=\\s*['\"])("+_603+")(\\#[^'\"]*?['\"][^>]*?>)","ig");
var _605=_602.replace(re,"$1$4");
return _605;
}};
Telerik.Web.UI.Editor.IECleanAnchorsFilter.registerClass("Telerik.Web.UI.Editor.IECleanAnchorsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozEmStrongFilter=function(){
Telerik.Web.UI.Editor.MozEmStrongFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="MozEmStrongFilter";
this.Description="This filter changes b,strong and i,em in Mozilla browsers.";
};
Telerik.Web.UI.Editor.MozEmStrongFilter.prototype={getHtmlContent:function(_606){
var _607=_606.replace(new RegExp("<b(\\s([^>])*?)?>","ig"),"<strong$1>");
_607=_607.replace(new RegExp("</b(\\s([^>])*?)?>","ig"),"</strong$1>");
_607=_607.replace(new RegExp("<i(\\s([^>])*?)?>","ig"),"<em$1>");
_607=_607.replace(new RegExp("</i(\\s([^>])*?)?>","ig"),"</em$1>");
return _607;
},getDesignContent:function(_608){
var _609=_608.replace(new RegExp("<strong(\\s([^>])*?)?>","ig"),"<b$1>");
_609=_609.replace(new RegExp("</strong(\\s([^>])*?)?>","ig"),"</b$1>");
_609=_609.replace(new RegExp("<em(\\s([^>])*?)?>","ig"),"<i$1>");
_609=_609.replace(new RegExp("</em(\\s([^>])*?)?>","ig"),"</i$1>");
return _609;
}};
Telerik.Web.UI.Editor.MozEmStrongFilter.registerClass("Telerik.Web.UI.Editor.MozEmStrongFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozillaKeepStylesString=function(){
Telerik.Web.UI.Editor.MozillaKeepStylesString.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="MozillaKeepStylesString";
this.Description="This filter remembers the positions of link tags in the html content (part 1).";
this.markerCounter=0;
};
Telerik.Web.UI.Editor.MozillaKeepStylesString.prototype={getDesignContent:function(_60a){
var self=this;
var _60c=function(_60d,_60e,_60f,_610,_611){
var _612=_611.indexOf("</head>",_610);
if(_612!=-1&&_611.indexOf("<body",_612)!=-1){
return _60d;
}else{
self.markerCounter++;
var _613="RadEditorStyleKeeper"+self.markerCounter;
var _614="<div id='"+_613+"' style='display:none;'>&nbsp;</div><"+_60e+" reoriginalpositionmarker='"+_613+"'"+_60f;
return _614;
}
};
var _615=new RegExp("<(link|style)([^>]*>)","gi");
var _616=_60a.replace(_615,_60c);
return _616;
}};
Telerik.Web.UI.Editor.MozillaKeepStylesString.registerClass("Telerik.Web.UI.Editor.MozillaKeepStylesString",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozillaKeepStylesDom=function(){
Telerik.Web.UI.Editor.MozillaKeepStylesDom.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="MozillaKeepStylesDom";
this.Description="This filter remembers the positions of link tags in the html content(part 2).";
this._divs=[];
};
Telerik.Web.UI.Editor.MozillaKeepStylesDom.prototype={getHtmlContent:function(_617){
var _618=_617.getElementsByTagName("HEAD")[0];
var _619=true;
if(!_618){
_618=_617.ownerDocument.getElementsByTagName("HEAD")[0];
_619=false;
}
if(!_618){
return _617;
}
this._restoreElements(_618,_617,"STYLE");
this._restoreElements(_618,_617,"LINK");
var divs=_617.getElementsByTagName("DIV");
if(divs){
for(var j=divs.length-1;j>=0;j--){
var _61c=divs[j];
if(_61c.id.indexOf("RadEditorStyleKeeper")==0){
var _61d=_61c.parentNode;
_61d.removeChild(_61c);
}
}
}
divs=null;
if(_619){
this._removeElements(_618,"STYLE");
this._removeElements(_618,"LINK");
}
this._removeMarkerAttributes(_617,"STYLE");
this._removeMarkerAttributes(_617,"LINK");
return _617;
},_restoreElements:function(_61e,_61f,_620){
var _621;
_621=_61e.getElementsByTagName(_620);
this._divs=_61f.getElementsByTagName("DIV");
var i=0;
while(_621.length>0&&i<_621.length){
this._restoreStyle(_621[i++]);
}
},_restoreStyle:function(_623){
var _624=_623.getAttribute("reoriginalpositionmarker");
if(_624){
j=0;
var _625=null;
while(j<this._divs.length&&!_625){
if(this._divs[j].id==_624){
_625=this._divs[j];
}
j++;
}
if(_625){
var _626=_623.cloneNode(true);
_626.removeAttribute("reoriginalpositionmarker");
var _627=_625.parentNode;
_627.replaceChild(_626,_625);
return true;
}
}
return false;
},_removeElements:function(_628,_629){
var _62a=_628.getElementsByTagName(_629);
if(_62a){
for(var j=_62a.length-1;j>=0;j--){
var _62c=_62a[j];
if(null!=_62c.getAttribute("reoriginalpositionmarker")){
var _62d=_62c.parentNode;
_62d.removeChild(_62c);
}
}
_62a=null;
}
},_removeMarkerAttributes:function(_62e,_62f){
styles=_62e.getElementsByTagName(_62f);
if(styles){
for(var j=styles.length-1;j>=0;j--){
styles[j].removeAttribute("reoriginalpositionmarker");
}
}
styles=null;
}};
Telerik.Web.UI.Editor.MozillaKeepStylesDom.registerClass("Telerik.Web.UI.Editor.MozillaKeepStylesDom",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozillaKeepFlashString=function(_631){
Telerik.Web.UI.Editor.MozillaKeepFlashString.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="MozillaKeepFlashString";
this.Description="This filter replaces the flash/media objects with static images in design mode.";
this._flashImageSrc=_631?_631:"FlashManager.gif";
};
Telerik.Web.UI.Editor.MozillaKeepFlashString.prototype={getDesignContent:function(_632){
var _633=this;
var _634=function(_635,gr1,gr2,gr3,str,_63a){
var _63b=String.format("<img isflash=\"true\" {0} />{1}",gr1,gr2);
_63b=_63b.replace(/\ssrc=/gi,String.format(" src=\"{0}\" flashSrc=",_633._flashImageSrc));
return _63b;
};
var _63c=new RegExp("<embed([^>]*)?>(.*)?(<\\/embed>)?","ig");
var _63d=_632.replace(_63c,_634);
return _63d;
}};
Telerik.Web.UI.Editor.MozillaKeepFlashString.registerClass("Telerik.Web.UI.Editor.MozillaKeepFlashString",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozillaKeepFlash=function(){
Telerik.Web.UI.Editor.MozillaKeepFlash.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="MozillaKeepFlash";
this.Description="This filter replaces the flash/media objects with static images in design mode.";
};
Telerik.Web.UI.Editor.MozillaKeepFlash.prototype={getHtmlContent:function(_63e){
if(!_63e){
return _63e;
}
var _63f=_63e.getElementsByTagName("IMG");
for(var i=0;i<_63f.length;i++){
var _641=_63f[i];
var _642=_641.getAttribute("isflash");
if(_642!=null){
var _643=_641.getAttribute("flashSrc");
var _644=Telerik.Web.UI.Editor.Utils.getOuterHtml(_641);
_644=_644.replace(/<img/gi,"<embed");
var oDiv=_641.ownerDocument.createElement("DIV");
oDiv.innerHTML=_644;
newNode=oDiv.firstChild;
if(_643){
newNode.src=_643;
if($telerik.isSafari){
newNode.setAttribute("src",_643);
}
}
newNode.removeAttribute("flashSrc");
newNode.removeAttribute("isflash");
var _646=_641.parentNode;
_646.insertBefore(newNode,_641);
_646.removeChild(_641);
i--;
}
}
return _63e;
}};
Telerik.Web.UI.Editor.MozillaKeepFlash.registerClass("Telerik.Web.UI.Editor.MozillaKeepFlash",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.StripJunkFilter=function(){
Telerik.Web.UI.Editor.StripJunkFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="StripJunkFilter";
this.Description="This filter strips extra content, added by the Safari/Firefox browsers.";
};
Telerik.Web.UI.Editor.StripJunkFilter.prototype={getHtmlContent:function(_647){
var html=_647;
if($telerik.isSafari){
html=html.replace(new RegExp(" class=\"khtml-block-placeholder\"","ig"),"");
html=html.replace(new RegExp(" class=\"Apple-style-span\"","ig"),"");
html=html.replace(new RegExp(" class=\"webkit-block-placeholder\"","ig"),"");
}
if($telerik.isFirefox){
html=html.replace(new RegExp("\\s?<br type=\"_moz\" \\/>","ig")," ");
html=html.replace(new RegExp(" _moz_[a-z_]*=\"[^\"]*\"","ig"),"");
html=html.replace(new RegExp(" type=\"_moz\"","ig"),"");
}
return html;
}};
Telerik.Web.UI.Editor.StripJunkFilter.registerClass("Telerik.Web.UI.Editor.StripJunkFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.ConvertFontToSpanFilter=function(){
Telerik.Web.UI.Editor.ConvertFontToSpanFilter.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="ConvertFontToSpanFilter";
this.Description="This filter changes deprecated font tags to compliant span tags.";
this._fontSizesPx=["10px","13px","16px","18px","24px","32px","48px"];
this._fontSizesRevPx=[];
for(var i=0;i<this._fontSizesPx.length;i++){
this._fontSizesRevPx[parseInt(this._fontSizesPx[i])]=i;
}
};
Telerik.Web.UI.Editor.ConvertFontToSpanFilter.prototype={dispose:function(){
this._fontSizesPx=null;
this._fontSizesRevPx=null;
},getHtmlContent:function(_64a){
var _64b=_64a.ownerDocument;
var _64c=_64b.createElement("SPAN");
var span,font,_64f;
var _650=_64a.getElementsByTagName("FONT");
while(_650.length>0){
font=_650[0];
_64f=font.parentNode;
span=_64c.cloneNode(false);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(font,span,false);
if(font.style.cssText&&font.style.cssText!=""){
span.style.cssText=font.style.cssText;
}
if(font.className){
span.className=font.className;
}
if(font.face){
span.style.fontFamily=font.face;
if(span.getAttribute("face")!=null){
span.removeAttribute("face");
}
}
var size=0;
if(font.style.fontSize){
span.style.fontSize=font.style.fontSize;
}else{
if(!isNaN(size=parseInt(font.size))&&font.size!="+0"){
try{
if(size<0){
size=size+4;
}
span.style.fontSize=this._fontSizesPx[size-1];
}
catch(ex){
span.style.fontSize=this._fontSizesPx[3];
}
if(span.getAttribute("size")!=null){
span.removeAttribute("size");
}
}
}
if(font.color){
span.style.color=font.color;
if(span.getAttribute("color")!=null){
span.removeAttribute("color");
}
}
if($telerik.isIE&&font.innerHTML==" "){
span.innerText=font.innerHTML;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(span,font.innerHTML);
}
_64f.replaceChild(span,font);
_650=_64a.getElementsByTagName("FONT");
}
return _64a;
},getDesignContent:function(_652){
var _653=_652.ownerDocument;
var _654=_653.createElement("FONT");
var span,font,_657;
var _658=_652.getElementsByTagName("SPAN");
while(_658.length>0){
span=_658[0];
_657=span.parentNode;
font=_654.cloneNode(false);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(span,font,false);
if(span.style.cssText&&span.style.cssText!=""){
font.style.cssText=span.style.cssText;
}
if(span.className){
font.className=span.className;
}
if(span.style.fontFamily){
font.face=span.style.fontFamily;
this._removeElementStyleAttribute(font,"fontFamily");
}
if(span.style.fontSize){
var size=3;
var _65a=null;
if(-1!=span.style.fontSize.indexOf("px")){
_65a=this._fontSizesRevPx[parseInt(span.style.fontSize)];
}
if(typeof (_65a)!="undefined"&&null!=_65a){
font.size=_65a+1;
this._removeElementStyleAttribute(font,"fontSize");
}
}
if(span.style.color){
font.color=this._fixColorValue(span.style.color);
this._removeElementStyleAttribute(font,"color");
}
if($telerik.isIE&&span.innerHTML==" "){
font.innerText=span.innerHTML;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(font,span.innerHTML);
}
_657.replaceChild(font,span);
_658=_652.getElementsByTagName("SPAN");
}
return _652;
},_fixColorValue:function(_65b){
if(_65b.toLowerCase().indexOf("rgb")!=-1){
var _65c="#";
var _65d=function(val){
var _65f=parseInt(val,10).toString(16);
_65c=_65c+(_65f.length==1?"0"+_65f:_65f);
return val;
};
_65b=_65b.replace(/(\d+)/gi,_65d);
_65d=null;
return _65c;
}else{
return _65b;
}
},_removeElementStyleAttribute:function(_660,_661){
if(_660.style&&_660.style[_661]){
if(_660.style.removeAttribute){
_660.style.removeAttribute(_661);
}else{
if(_660.style.removeProperty){
_661=_661.replace(/([A-Z])/g,"-$1").toLowerCase();
_660.style.removeProperty(_661);
}
}
if(_660.style[_661]){
_660.style[_661]=null;
}
if(_660.style.cssText){
}else{
_660.removeAttribute("style");
}
}
}};
Telerik.Web.UI.Editor.ConvertFontToSpanFilter.registerClass("Telerik.Web.UI.Editor.ConvertFontToSpanFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.ConvertToXhtmlFilter=function(){
Telerik.Web.UI.Editor.ConvertToXhtmlFilter.initializeBase(this);
this._uniqueIds={};
this.Name="ConvertToXhtmlFilter";
this.Description="This filter converts the HTML from the editor content area to valid XHTML";
this.Enabled=true;
this.IsDom=true;
};
Telerik.Web.UI.Editor.ConvertToXhtmlFilter.prototype={dispose:function(){
this._uniqueIds=null;
},getHtmlContent:function(_662){
if(!_662){
return "";
}
var sb=new Sys.StringBuilder("");
this._appendNodeXhtml(_662,sb);
return sb.toString();
},_convertAttribute:function(s){
return String(s).replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
},_getAttributeValue:function(_665,_666,sb){
var name=_665.nodeName;
var _669=_665.nodeValue;
if(name!="style"){
if($telerik.isIE&&(name=="type"||name=="value"||name=="selected")){
if(!_669){
return;
}
}else{
if(!_665.specified){
if($telerik.isIE&&_669==""&&typeof (_666[name])=="string"&&_666[name]!=""){
_669=_666[name];
}else{
return;
}
}
}
if(!_669){
return;
}
if(!isNaN(_669)){
_669=_666.getAttribute(name);
}
if($telerik.isIE&&(name=="href"||name=="src")){
_669=_666.getAttribute(name,2);
}
sb.append(" "+(_665.expando?name:name.toLowerCase())+"=\""+this._convertAttribute(_669)+"\"");
}else{
var _66a=_666.style.cssText;
if(_66a){
sb.append(" style=\""+this._convertAttribute(_66a.toLowerCase())+"\"");
}
}
},_canHaveChildren:function(node){
switch(node.tagName.toUpperCase()){
case "AREA":
case "BASE":
case "BASEFONT":
case "COL":
case "FRAME":
case "HR":
case "IMG":
case "BR":
case "INPUT":
case "ISINDEX":
case "LINK":
case "META":
case "PARAM":
return false;
}
return true;
},_appendElementNode:function(node,sb){
if(node.tagName.charAt(0)=="/"){
return;
}
if(node.nodeName=="!"){
sb.append(node.text);
return;
}
var name=node.nodeName;
if(node.scopeName){
if(node.scopeName=="HTML"){
name=name.toLowerCase();
}else{
name=node.scopeName+":"+name;
}
}else{
name=name.toLowerCase();
}
sb.append("<"+name);
if($telerik.isIE){
if("img"==name){
var oImg=document.createElement("IMG");
oImg.mergeAttributes(node);
if(oImg.width){
sb.append(" width=\""+node.getAttribute("width",2)+"\"");
}
if(oImg.height){
sb.append(" height=\""+node.getAttribute("height",2)+"\"");
}
if(oImg.getAttribute("alt").length==0){
sb.append(" alt=\""+oImg.getAttribute("alt")+"\"");
}
}else{
if("area"==name||"a"==name){
if(node.shape){
sb.append(" shape=\""+node.shape.toLowerCase()+"\"");
}
if(node.coords){
sb.append(" coords=\""+node.getAttribute("coords")+"\"");
}
if(node.href){
var _670=node.getAttribute("href",2).replace("about:blank","");
_670=_670.replace("about:","");
_670=_670.replace(/&amp;/gi,"&").replace(/&/gi,"&amp;");
sb.append(" href=\""+_670+"\"");
node.removeAttribute("href",0);
}
}
}
}
try{
var _671=node.attributes;
var l=_671.length;
for(var i=0;i<l;i++){
this._getAttributeValue(_671[i],node,sb);
}
}
catch(exc){
}
switch(name){
case "script":
sb.append(">"+node.text+"</"+name+">");
break;
case "textarea":
sb.append(">"+node.value+"</"+name+">");
break;
case "iframe":
sb.append("></iframe>");
break;
case "object":
sb.append(">");
var _674="";
if(node.altHtml){
_674=node.altHtml;
}else{
_674=node.innerHTML;
}
if($telerik.isIE){
_674=_674.replace(/\soriginalAttribute="[^"]+"/gi,"");
_674=_674.replace(/\soriginalPath="[^"]+"/gi,"");
}
sb.append(_674);
sb.append("</object>");
break;
case "title":
case "style":
case "comment":
case "noscript":
var _674=node.innerHTML;
if($telerik.isIE&&_674.length==0){
_674=node.ownerDocument.title;
}
sb.append(">"+_674+"</"+name+">");
break;
default:
if(node.hasChildNodes()||(true==node.canHaveChildren||(node.canHaveChildren==null&&this._canHaveChildren(node)))){
sb.append(">");
var cs=node.childNodes;
l=cs.length;
for(var i=0;i<l;i++){
this._appendNodeXhtml(cs[i],sb);
}
sb.append("</"+name+">");
}else{
sb.append(" />");
}
break;
}
},_appendTextNode:function(node,sb){
var _678=String(node.nodeValue);
var _679=node.parentNode.nodeName.toLowerCase();
if(!$telerik.isIE&&(_679=="style"||_679=="script")){
sb.append(_678);
}else{
_678=_678.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
if($telerik.isFirefox){
_678=_678.replace(/[\u00a0]/g,"&nbsp;");
}
sb.append(_678);
}
},_appendCDataNode:function(node,sb){
sb.append("<![CDA"+"TA[\n"+node.nodeValue+"\n]"+"]>");
},_appendCommentNode:function(node,sb){
var _67e=node.nodeValue;
if(!_67e&&node.text){
_67e=node.text;
}else{
_67e="<!--"+_67e+"-->";
}
sb.append(_67e);
},_appendNodeXhtml:function(node,sb){
if(node.uniqueID){
if(this._uniqueIds[node.uniqueID]){
return;
}else{
this._uniqueIds[node.uniqueID]=true;
}
}
switch(node.nodeType){
case 1:
this._appendElementNode(node,sb);
break;
case 3:
this._appendTextNode(node,sb);
break;
case 4:
this._appendCDataNode(node,sb);
break;
case 8:
this._appendCommentNode(node,sb);
break;
}
}};
Telerik.Web.UI.Editor.ConvertToXhtmlFilter.registerClass("Telerik.Web.UI.Editor.ConvertToXhtmlFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IndentHTMLContentFilter=function(){
Telerik.Web.UI.Editor.IndentHTMLContentFilter.initializeBase(this);
this.Name="IndentHTMLContentFilter";
this.Description="This filter indents the HTML content so it is more readable when you view the code";
this.Enabled=true;
this.IsDom=false;
this._indentPattern="    ";
this._protectedData=null;
var _681="P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION";
var _682="HTML|HEAD|BODY|STYLE|FORM|TABLE|TBODY|THEAD|TR";
var _683=_682+"|UL|OL";
this._ignoreTags=new RegExp("(<PRE[^>]*>|<!--|<SCRIPT[^>]*>)([\\s\\S]*?)(<\\/PRE>|-->|<\\/SCRIPT>)","gi");
this._tagsNLBefore=new RegExp("<("+_681+")[^>]*>","gi");
this._tagsNLAfter=new RegExp("<\\/("+_681+")[^>]*>","gi");
this._tagsNLNoCloseAfter=new RegExp("<(BR|HR)[^>]*\\/?>","gi");
this._tagsNLBeforeAndAfter=new RegExp("<\\/?("+_682+")[^>]*>","gi");
this._tagsIncIndent=new RegExp("^<("+_683+")[\\s\\/>]","i");
this._tagsDecIndent=new RegExp("^<\\/("+_683+")[\\s\\>]","i");
this._shrinkNL=new RegExp("\\s*\\n+\\s*","gi");
};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.prototype={dispose:function(){
this._protectedData=[];
},getHtmlContent:function(html){
var _685=html.trim();
if(_685.indexOf("<body")==0){
_685=_685.substring(_685.indexOf(">")+1,_685.length-7);
}
this._protectedData=[];
var self=this;
var _687=function(_688,_689,_68a,_68b,_68c,_68d){
Array.add(self._protectedData,_68a);
return _689+"RADEDITORFORMATTED_"+self._protectedData.length+_68b;
};
_685=_685.replace(this._ignoreTags,_687);
var _68e="$&";
if($telerik.isSafari){
_68e="$0";
}
_685=_685.replace(this._tagsNLBefore,"\n"+_68e);
_685=_685.replace(this._tagsNLAfter,_68e+"\n");
_685=_685.replace(this._tagsNLNoCloseAfter,_68e+"\n");
_685=_685.replace(this._tagsNLBeforeAndAfter,"\n"+_68e+"\n");
var _68f=_685.split(this._shrinkNL);
var _690=new Sys.StringBuilder("");
var _691="";
for(var i=0;i<_68f.length;i++){
var line=_68f[i];
if(line.length==0){
continue;
}
if(this._tagsDecIndent.test(line)){
if(_691.length>this._indentPattern.length){
_691=_691.substring(this._indentPattern.length);
}else{
_691="";
}
}
_690.append(_691);
_690.append(line);
_690.append("\n");
if(this._tagsIncIndent.test(line)){
_691+=this._indentPattern;
}
}
_685=_690.toString();
for(var i=0;i<this._protectedData.length;i++){
var _694=new RegExp("RADEDITORFORMATTED_"+(i+1));
_685=_685.replace(_694,this._protectedData[i]);
}
return _685;
}};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.registerClass("Telerik.Web.UI.Editor.IndentHTMLContentFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MakeUrlsAbsolute=function(){
Telerik.Web.UI.Editor.MakeUrlsAbsolute.initializeBase(this);
this.Name="MakeUrlsAbsolute";
this.Description="This filter makes all src and href attributes in the editor content have absolute URLs";
this.Enabled=true;
this.IsDom=true;
};
Telerik.Web.UI.Editor.MakeUrlsAbsolute.prototype={getHtmlContent:function(_695){
this._updateElements(_695,"A","href");
this._updateElements(_695,"AREA","href");
this._updateElements(_695,"IMG","src");
this._updateElements(_695,"EMBED","src");
return _695;
},_getElements:function(_696,_697){
var _698=_696.getElementsByTagName(_697);
if(!_698){
_698=_696.ownerDocument.getElementsByTagName(_697);
}
return _698;
},_updateElements:function(_699,_69a,_69b){
var _69c=_699.ownerDocument.createElement("div");
var _69d=this._getElements(_699,_69a);
if(_69d){
for(var i=0;i<_69d.length;i++){
if("href"==_69b&&_69d[i].getAttribute("href",2)){
_69c.innerHTML="<a href=\""+_69d[i].getAttribute("href",2).replace(/\"/gi,"%22")+"\">test</a>";
_69d[i].setAttribute("href",_69c.childNodes[0].href);
}else{
if("src"==_69b&&_69d[i].getAttribute("src",2)){
_69c.innerHTML="<img src=\""+_69d[i].getAttribute("src",2).replace(/\"/gi,"%22")+"\" />";
_69d[i].setAttribute("src",_69c.childNodes[0].src);
}
}
}
}
_69c.innerHTML="";
_69c=null;
}};
Telerik.Web.UI.Editor.MakeUrlsAbsolute.registerClass("Telerik.Web.UI.Editor.MakeUrlsAbsolute",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FiltersManager=function(){
Telerik.Web.UI.Editor.FiltersManager.initializeBase(this);
this._filters=[];
this._enableXhtmlFilter=true;
this._convertToXhtmlFilter=new Telerik.Web.UI.Editor.ConvertToXhtmlFilter();
};
Telerik.Web.UI.Editor.FiltersManager.prototype={dispose:function(){
this._filters=null;
this._convertToXhtmlFilter=null;
},clear:function(){
Array.clear(this._filters);
},get_enableXhtmlFilter:function(){
return this._enableXhtmlFilter;
},set_enableXhtmlFilter:function(_69f){
this._enableXhtmlFilter=_69f;
},add:function(_6a0){
Array.add(this._filters,_6a0);
},addAt:function(_6a1,_6a2){
Array.insert(this._filters,_6a2,_6a1);
},remove:function(_6a3){
Array.remove(this._filters,_6a3);
},removeAt:function(_6a4){
Array.removeAt(this._filters,_6a4);
},getFilterAt:function(_6a5){
return this._filters[_6a5];
},getFilterByName:function(name){
for(var i=0;i<this._filters.length;i++){
var _6a8=this._filters[i];
if(_6a8&&name==_6a8.get_name()){
return _6a8;
}
}
},getDesignContent:function(_6a9){
var _6aa=_6a9;
for(var i=0;i<this._filters.length;i++){
var _6ac=this._filters[i];
if((!_6ac.get_isDom())&&(false!=_6ac.get_enabled())&&_6ac.getDesignContent){
try{
_6aa=_6ac.getDesignContent(_6aa);
}
catch(exc){
alert("Error while executing filter "+_6ac.get_name()+" - "+exc.toString());
}
}
}
return _6aa;
},getDesignContentDom:function(_6ad){
for(var i=0;i<this._filters.length;i++){
var _6af=this._filters[i];
if((_6af.get_isDom())&&(false!=_6af.get_enabled())&&_6af.getDesignContent){
try{
_6ad=_6af.getDesignContent(_6ad);
}
catch(exc){
alert("Error while executing filter "+_6af.get_name()+" - "+exc.toString());
}
}
}
return _6ad;
},getHtmlContent:function(_6b0){
for(var i=0;i<this._filters.length;i++){
var _6b2=this._filters[i];
if((_6b2.get_isDom())&&(false!=_6b2.get_enabled())&&_6b2.getHtmlContent){
try{
_6b0=_6b2.getHtmlContent(_6b0);
}
catch(exc){
alert("Error while executing filter "+_6b2.get_name()+" - "+exc.toString());
}
}
}
var _6b3;
if(this.get_enableXhtmlFilter()){
try{
_6b3=this._convertToXhtmlFilter.getHtmlContent(_6b0);
}
catch(exc){
alert("Error while executing filter XHTML - "+exc.toString());
}
}else{
_6b3=_6b0.innerHTML;
}
_6b3=_6b3.replace(/<body\s*\/>/i,"<body></body>");
for(var i=0;i<this._filters.length;i++){
var _6b2=this._filters[i];
if((!_6b2.get_isDom())&&(false!=_6b2.get_enabled())&&_6b2.getHtmlContent){
try{
_6b3=_6b2.getHtmlContent(_6b3);
}
catch(exc){
alert("Error while executing filter "+_6b2.get_name()+" - "+exc.toString());
}
}
}
return _6b3;
}};
Telerik.Web.UI.Editor.FiltersManager.registerClass("Telerik.Web.UI.Editor.FiltersManager",Sys.Component);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.RestorePoint=function(_6b4){
this.Window=_6b4;
this.Document=_6b4.document;
this.update();
this.Update=this.update;
this.Restore=this.restore;
this.Select=this.select;
};
if($telerik.isIE){
Telerik.Web.UI.Editor.RestorePoint.prototype={update:function(){
this.HtmlText=this.Document.body.innerHTML;
var _6b5=this.Document.selection.createRange();
if(_6b5.length){
this.SourceIndex=_6b5.item(0).sourceIndex;
}else{
this.StartBookmark=_6b5.getBookmark();
}
},restore:function(_6b6){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this.Document.body,this.HtmlText);
this.select(_6b6);
},select:function(_6b7){
if(null!=this.SourceIndex){
var _6b8=this.Document.body.createControlRange();
_6b8.addElement(this.Document.all(this.SourceIndex));
_6b8.select();
}else{
if(null!=this.StartBookmark){
var _6b8=this.Document.body.createTextRange();
_6b8.moveToBookmark(this.StartBookmark);
_6b8.select();
if(true==_6b7&&_6b8.collapse){
_6b8.collapse();
}
}
}
}};
}else{
Telerik.Web.UI.Editor.RestorePoint.prototype={restore:function(){
try{
this.Window.document.body.innerHTML=this.HtmlText;
this.select();
}
catch(e){
}
},select:function(){
try{
this.Window.focus();
this._moveToBookmark(this.Window.getSelection(),this.Bookmark);
}
catch(ex){
}
},update:function(){
try{
this.HtmlText=this.Window.document.body.innerHTML;
this.Bookmark=this._bookmarkSelection(this.Window.getSelection());
}
catch(e){
}
},_bookmarkSelection:function(_6b9){
if(_6b9){
return {anchorNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6b9.anchorNode),anchorOffset:_6b9.anchorOffset,focusNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6b9.focusNode),focusOffset:_6b9.focusOffset,isCollapsed:_6b9.isCollapsed};
}else{
return {};
}
},_moveToBookmark:function(_6ba,_6bb){
var _6bc=_6bb.anchorNodeBookmark.select();
var _6bd=_6bb.focusNodeBookmark.select();
_6ba.collapse(_6bc,_6bb.anchorOffset);
if(!_6bb.isCollapsed){
_6ba.extend(_6bd,_6bb.focusOffset);
}
}};
}
Telerik.Web.UI.Editor.RestorePoint.registerClass("Telerik.Web.UI.Editor.RestorePoint",null);
Telerik.Web.UI.Editor.SelectionBookmark=function(_6be,node){
this.Window=_6be;
this.NodePath=this._findNodePath(this.Window.document.documentElement,node);
};
Telerik.Web.UI.Editor.SelectionBookmark.prototype={select:function(){
var node=this._findNode(this.Window.document.documentElement,this.NodePath);
try{
Telerik.Web.UI.Editor.Utils.selectElement(this.Window,node);
}
catch(ex){
}
return node;
},_findNodePath:function(_6c1,node){
var n,res;
for(var i=0;i<_6c1.childNodes.length;i++){
n=_6c1.childNodes[i];
res=this._findNodePath(n,node);
if(""!=res){
return ""+i+","+res;
}
if(n==node){
return ""+i;
}
}
return "";
},_findNode:function(_6c6,_6c7){
var arr=_6c7.split(",");
for(var i=0;i<arr.length;i++){
_6c6=_6c6.childNodes[arr[i]];
}
return _6c6;
}};
Telerik.Web.UI.Editor.SelectionBookmark.registerClass("Telerik.Web.UI.Editor.SelectionBookmark",null);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Selection=function(_6ca){
this._window=_6ca;
this.isSafari=$telerik.isSafari;
this.isOpera=$telerik.isOpera;
this.GetRange=this.getRange;
this.GetParentElement=this.getParentElement;
this.IsControl=this.isControl;
this.GetText=this.getText;
this.GetHtmlText=this.getHtml;
this.PasteHtml=this.pasteHtml;
this.Collapse=this.collapse;
};
Telerik.Web.UI.Editor.Selection.prototype={pasteHtml:function(_6cb,_6cc){
_6cc=(_6cc==true);
if($telerik.isIE){
return this._executeIE(_6cb,_6cc);
}else{
return this._executeMozilla(_6cb,_6cc);
}
},_executeIE:function(_6cd,_6ce){
var _6cf=this._window.document;
var _6d0=_6cf.selection;
if(_6d0.type.toLowerCase()!="none"){
_6d0.createRange().execCommand("Delete");
}
if(_6d0.type.toLowerCase()!="none"){
_6cf.execCommand("Delete");
}
_6cf.body.setActive();
selRange=_6d0.createRange();
if(selRange&&selRange.length){
var _6d1=selRange.item(0);
if(_6d1&&_6d1.tagName=="BODY"){
var _6d2=_6d1.getElementsByTagName("FORM")[0];
if(_6d2){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_6d2,_6d2.innerHTML+_6cd);
}
}
}else{
var _6d3=selRange.duplicate();
_6d3.collapse(true);
_6cd=Telerik.Web.UI.Editor.Utils.getStoredOriginalPathsAndAttributes(_6cd);
selRange.pasteHTML(_6cd);
Telerik.Web.UI.Editor.Utils.restoreOriginalPathsAndAttributes(selRange.parentElement());
if(_6ce){
_6d3.setEndPoint("EndToEnd",selRange);
_6d3.select();
}
}
return true;
},_executeMozilla:function(_6d4,_6d5){
var oDoc=this._window.document;
var _6d7=oDoc.createElement("SPAN");
_6d7.innerHTML=_6d4;
var _6d8="radetempnode";
if(this.isOpera){
_6d7.setAttribute("id",_6d8);
}
this._insertNodeAtSelection(this._window,_6d7,true);
if(this.isOpera){
var _6d9=oDoc.createRange();
var _6da=this._window.getSelection();
var span=oDoc.getElementById(_6d8);
_6d9.selectNodeContents(span);
var _6dc=_6d9.extractContents();
_6d9.selectNode(span);
var _6dd=_6d9.extractContents();
_6d9.insertNode(_6dc);
_6da.addRange(_6d9);
return true;
}else{
if(!this.isSafari){
var _6d9=oDoc.createRange();
_6d9.selectNodeContents(_6d7);
var _6dc=_6d9.extractContents();
_6d9.selectNode(_6d7);
_6d9.deleteContents();
this._insertNodeAtSelection(this._window,_6dc,_6d5);
}
}
return true;
},_insertNodeAtSelection:function(win,_6df,_6e0){
var _6e1=win.getSelection();
if(_6e1.rangeCount==0){
win.document.body.appendChild(_6df);
return;
}
var _6e2=null;
if(_6e1.getRangeAt){
_6e2=_6e1.getRangeAt(0);
}else{
_6e2=win.document.createRange();
_6e2.setStart(_6e1.anchorNode,_6e1.anchorOffset);
_6e2.setEnd(_6e1.focusNode,_6e1.focusOffset);
}
if(_6e1.removeAllRanges){
_6e1.removeAllRanges();
}
_6e2.deleteContents();
var _6e3=$telerik.isSafari&&!$telerik.isSafari3?_6e1.baseNode:_6e2.startContainer;
var _6e4=$telerik.isSafari&&!$telerik.isSafari3?_6e1.baseOffset:_6e2.startOffset;
if($telerik.isSafari&&null==_6e3){
_6e3=win.document.body;
}
_6e2=win.document.createRange();
if((_6df.nodeType==3)&&(_6e3.nodeType==3)){
_6e3.insertData(_6e4,_6df.nodeValue);
_6e2.setEnd(_6e3,_6e4+_6df.length);
if(_6e0){
_6e2.setStart(_6e3,_6e4);
}else{
_6e2.setStart(_6e3,_6e4+_6df.length);
}
}else{
var _6e5;
if(_6e3.nodeType==3){
var _6e6=_6e3;
_6e3=_6e6.parentNode;
var _6e7=_6e6.nodeValue;
var _6e8=_6e7.substr(0,_6e4);
var _6e9=_6e7.substr(_6e4);
var _6ea=win.document.createTextNode(_6e8);
var _6e5=win.document.createTextNode(_6e9);
_6e3.insertBefore(_6e5,_6e6);
_6e3.insertBefore(_6df,_6e5);
try{
_6e3.insertBefore(_6ea,_6df);
}
catch(exc){
}
_6e3.removeChild(_6e6);
}else{
if(_6e3.childNodes.length>0){
_6e5=_6e3.childNodes[_6e4];
_6e3.insertBefore(_6df,_6e5);
}else{
if(_6e3.tagName!="BODY"){
_6e3=_6e3.parentNode;
}
_6e3.appendChild(_6df);
}
}
try{
if(_6e0){
_6e2.setStart(_6df,0);
_6e2.setEnd(_6e5,0);
}else{
_6e2.setEnd(_6e5,0);
_6e2.setStart(_6e5,0);
}
}
catch(exc){
}
}
try{
_6e1.addRange(_6e2);
}
catch(exc){
}
},selectRange:function(_6eb){
if(!_6eb){
return;
}
var _6ec=this._window;
if(_6eb.select){
_6eb.select();
}else{
if(_6ec.getSelection){
var _6ed=_6ec.getSelection();
if(_6ed.removeAllRanges){
_6ed.removeAllRanges();
_6ed.addRange(_6eb);
}else{
var base=_6eb.baseNode;
if(null==base){
base=_6ec.document.body;
}
var _6ef=_6eb.extentNode;
if(null==_6ef){
_6ef=_6ec.document.body;
}
_6ed.setBaseAndExtent(base,_6eb.startOffset,_6ef,_6eb.endOffset);
}
}
}
},getRange:function(){
if(!this._window){
return null;
}
if(this._window.document.selection&&!window.opera){
return this._window.document.selection.createRange();
}else{
if(this._window.getSelection){
var _6f0=this._window.getSelection();
if(!_6f0||_6f0.rangeCount<1){
return null;
}
var rng=null;
if(_6f0.getRangeAt){
rng=_6f0.getRangeAt(0);
}else{
rng=this._window.document.createRange();
rng.setStart(_6f0.anchorNode,_6f0.anchorOffset);
rng.setEnd(_6f0.focusNode,_6f0.focusOffset);
}
return rng;
}
}
},getParentElement:function(){
var rng=this.getRange();
if(!rng){
return null;
}
if(rng.commonAncestorContainer){
var _6f3=this._window.getSelection();
var _6f4=rng.startContainer?rng.startContainer:_6f3.baseNode;
var _6f5=rng.endContainer?rng.endContainer:_6f3.extentNode;
var _6f6=rng.startOffset!=null?rng.startOffset:_6f3.baseOffset;
var _6f7=rng.endOffset!=null?rng.endOffset:_6f3.extentOffset;
if(_6f4==_6f5&&(_6f7-_6f6)==1){
return _6f3.anchorNode.childNodes[_6f3.anchorOffset];
}else{
if(!rng.commonAncestorContainer.tagName){
if(this._window.document==rng.commonAncestorContainer&&_6f3.baseNode){
return _6f3.baseNode.parentNode;
}
return rng.commonAncestorContainer.parentNode;
}else{
return rng.commonAncestorContainer;
}
}
}else{
if(rng.length){
return rng.item(0);
}else{
if(rng.parentElement){
return rng.parentElement();
}else{
return null;
}
}
}
},isControl:function(){
if(this._window.document.selection){
return (this._window.document.selection.type=="Control");
}else{
var oSel=this._window.getSelection();
if(oSel.toString()!=""){
return false;
}
var _6f9=oSel.focusNode;
if(!_6f9||_6f9.nodeType==1){
return false;
}
return (_6f9.tagName=="IMG");
}
},getText:function(){
if(this._window.document.selection){
var rng=this._window.document.selection.createRange();
if(rng.length){
return "";
}else{
if(null!=rng.text){
return rng.text;
}
}
}else{
if(this._window.getSelection){
return this._window.getSelection().toString();
}else{
return "";
}
}
},getHtml:function(){
if(this._window.document.selection&&!window.opera){
var rng=this._window.document.selection.createRange();
if(rng.length){
return rng.item(0).outerHTML;
}else{
if(rng.htmlText){
return rng.htmlText;
}else{
return "";
}
}
}else{
if(this._window.getSelection){
var _6fc=this._window.getSelection();
var rng=null;
if(null==_6fc){
return "";
}
if(_6fc.getRangeAt&&typeof (_6fc.rangeCount)!="undefined"&&_6fc.rangeCount==0){
return "";
}
if(_6fc.getRangeAt){
rng=_6fc.getRangeAt(0);
var _6fd=this._window.document.createElement("div");
var _6fe=rng.cloneContents();
if(_6fe){
_6fd.appendChild(_6fe);
return _6fd.innerHTML;
}else{
return "";
}
}else{
return _6fc;
}
}else{
return "";
}
}
},collapse:function(_6ff){
_6ff=(_6ff==true);
if(this._window.document.selection){
var rng=this._window.document.selection.createRange();
if(rng.collapse){
rng.collapse(_6ff);
rng.select();
}
}else{
if(this._window.getSelection){
var _701=this._window.getSelection();
if(!_701.isCollapsed){
if(_6ff){
_701.collapseToStart();
}else{
_701.collapseToEnd();
}
}
}
}
}};
Telerik.Web.UI.Editor.Selection.registerClass("Telerik.Web.UI.Editor.Selection",null);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorShortCutManager=function(){
this._shortcuts=[];
};
Telerik.Web.UI.EditorShortCutManager.prototype={addShortCut:function(_702,_703){
var rs=new Telerik.Web.UI.EditorShortCut(_702,_703);
rs.HashValue=this._getShortCutHashValue(rs);
this._shortcuts[rs.HashValue]=rs;
},removeShortCut:function(_705){
var _706=this._findByName(_705);
if(_706){
this._shortcuts[_706.HashValue]=null;
}
},setShortCut:function(_707,_708){
this.removeShortCut(_707);
this.addShortCut(_707,_708);
},isShortCutHit:function(e){
return this._hitTest(e.keyCode,e.ctrlKey,(null!=e.ctrlLeft?e.ctrlLeft:e.ctrlKey),e.shiftKey,(null!=e.shiftLeft?e.shiftLeft:e.shiftKey),e.altKey,(null!=e.altLeft?e.altLeft:e.altKey));
},_hitTest:function(_70a,_70b,_70c,_70d,_70e,_70f,_710){
var _711=this._getHashValue(_70a,_70b,_70c,_70d,_70e,_70f,_710);
return this._shortcuts[_711];
},_getHashValue:function(_712,_713,_714,_715,_716,_717,_718){
var _719=_712&65535;
var _71a=0;
_71a|=(_713?(1<<0):0);
_71a|=(_715?(1<<2):0);
_71a|=(_717?(1<<4):0);
_719|=(_71a<<16);
return _719;
},_getShortCutHashValue:function(_71b){
return this._getHashValue(_71b.KeyCode,_71b.CtrlKey,_71b.LeftCtrlKey,_71b.ShiftKey,_71b.LeftShiftKey,_71b.AltKey,_71b.LeftAltKey);
},_findByName:function(_71c){
var _71d;
for(var _71e in this._shortcuts){
_71d=this._shortcuts[_71e];
if(null!=_71d&&_71d._name==_71c){
return _71d;
}
}
return null;
}};
Telerik.Web.UI.EditorShortCut=function(_71f,_720){
this._name=_71f;
this.setShortCut(_720);
};
Telerik.Web.UI.EditorShortCut.prototype={CtrlKey:false,LeftCtrlKey:false,ShiftKey:false,LeftShiftKey:false,AltKey:false,LeftAltKey:false,KeyCode:0,get_name:function(){
return this._name;
},set_name:function(_721){
this._name=_721;
},setShortCut:function(_722){
this._parseShortcutString(_722);
},_parseShortcutString:function(_723){
if("string"==typeof (_723)){
this.CtrlKey=false;
this.LeftCtrlKey=false;
this.ShiftKey=false;
this.LeftShiftKey=false;
this.AltKey=false;
this.LeftAltKey=false;
this.KeyCode=0;
_723=_723.replace(/\s*/gi,"");
_723=_723.replace(/\+\+/gi,"+PLUS");
var _724=_723.split("+");
var _725="";
for(var i=0;i<_724.length;i++){
_725=_724[i].toUpperCase();
switch(_725){
case "LCTRL":
this.LeftCtrlKey=true;
case "CTRL":
this.CtrlKey=true;
break;
case "LSHIFT":
this.LeftShiftKey=true;
case "SHIFT":
this.ShiftKey=true;
break;
case "LALT":
this.LeftAltKey=true;
case "ALT":
this.AltKey=true;
break;
case "F1":
this.KeyCode=112;
break;
case "F2":
this.KeyCode=113;
break;
case "F3":
this.KeyCode=114;
break;
case "F4":
this.KeyCode=115;
break;
case "F5":
this.KeyCode=116;
break;
case "F6":
this.KeyCode=117;
break;
case "F7":
this.KeyCode=118;
break;
case "F8":
this.KeyCode=119;
break;
case "F9":
this.KeyCode=120;
break;
case "F10":
this.KeyCode=121;
break;
case "F11":
this.KeyCode=122;
break;
case "F12":
this.KeyCode=123;
break;
case "ENTER":
this.KeyCode=13;
break;
case "HOME":
this.KeyCode=36;
break;
case "END":
this.KeyCode=35;
break;
case "LEFT":
this.KeyCode=37;
break;
case "RIGHT":
this.KeyCode=39;
break;
case "UP":
this.KeyCode=38;
break;
case "DOWN":
this.KeyCode=40;
break;
case "PAGEUP":
this.KeyCode=33;
break;
case "PAGEDOWN":
this.KeyCode=34;
break;
case "SPACE":
this.KeyCode=32;
break;
case "TAB":
this.KeyCode=9;
break;
case "BACK":
this.KeyCode=8;
break;
case "CONTEXT":
this.KeyCode=93;
break;
case "ESCAPE":
case "ESC":
this.KeyCode=27;
break;
case "DELETE":
case "DEL":
this.KeyCode=46;
break;
case "INSERT":
case "INS":
this.KeyCode=45;
break;
case "PLUS":
this.KeyCode="+".charCodeAt(0);
break;
default:
this.KeyCode=_725.charCodeAt(0);
break;
}
}
}else{
throw {description:"Invalid shortcut string"};
}
}};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI._localization=function(){
this._controls={};
};
Telerik.Web.UI._localization.prototype={merge:function(_727,_728,_729){
if(typeof (this._controls[_727])=="undefined"){
this._controls[_727]={};
}
if(typeof (this._controls[_727][_728])=="undefined"){
this._controls[_727][_728]={};
}
var _72a=this._controls[_727][_728];
for(var _72b in _729){
if(typeof (_729[_72b])=="string"){
_72a[_72b]=_729[_72b];
}
}
return _72a;
}};
Telerik.Web.UI._localization.registerClass("Telerik.Web.UI._localization");
Telerik.Web.UI.Localization=new Telerik.Web.UI._localization();
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorCommandEventArgs=function(_72c,tool,_72e){
Telerik.Web.UI.EditorCommandEventArgs.initializeBase(this);
this._name=this._commandName=_72c;
this._tool=tool;
this._value=_72e;
this.value=_72e;
};
Telerik.Web.UI.EditorCommandEventArgs.prototype={get_name:function(){
return this._name;
},get_commandName:function(){
return this._commandName;
},get_tool:function(){
return this._tool;
},get_value:function(){
return this._value;
},set_value:function(val){
this.value=val;
this._value=val;
}};
Telerik.Web.UI.EditorCommandEventArgs.registerClass("Telerik.Web.UI.EditorCommandEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadEditor=function(_730){
Telerik.Web.UI.RadEditor.initializeBase(this,[_730]);
this._rootElement=null;
this._bottomResizer=null;
this._tableElement=null;
this._document=null;
this._contentArea=null;
this._contentAreaElement=null;
this._contentHiddenTextarea=null;
this._contentTextArea=null;
this._contentWindow=null;
this._doctypeString=null;
this._fullPage=null;
this._originalHeight=null;
this._toolJSON=[];
this._contextMenusJSON=[];
this._modulesJSON=[];
this._toolAdapterType="";
this._uniqueID="";
this._skin="";
this._newLineBr=true;
this._autoResizeHeight=false;
this._contentAreaCssFile="";
this._mozillaFlashOverlayImage="FlashManager.gif";
this._stripFormattingOptions=Telerik.Web.UI.StripFormattingOptions.None;
this._editModes=Telerik.Web.UI.EditModes.All;
this._contentFilters=Telerik.Web.UI.EditorFilters.DefaultFilters;
this._mode=Telerik.Web.UI.EditModes.Design;
this._toolbarMode=Telerik.Web.UI.EditorToolbarMode.Default;
this._shortCutManager=new Telerik.Web.UI.EditorShortCutManager();
this._filtersManager=new Telerik.Web.UI.Editor.FiltersManager();
this._commandsManager=new Telerik.Web.UI.Editor.CommandsManager();
if(null!=Telerik.Web.UI.Editor.ModulesManager){
this._modulesManager=new Telerik.Web.UI.Editor.ModulesManager(this);
}
this._resizeExtender=null;
this._toolAdapter=null;
this._localization={};
this._contentAreaEventHandlers={};
this._onToolClickDelegate=Function.createDelegate(this,this._onToolClick);
this._onWindowResizeDelegate=null;
this._dialogOpener=null;
this._saveContentDelegate=null;
this._colors=null;
this._fontNames=null;
this._fontSizes=null;
this._realFontSizes=null;
this._symbols=null;
this._contextMenus=null;
this._snippets=null;
this._cssClasses=null;
this._cssFiles=null;
this._languages=null;
this._paragraphs=null;
this._links=null;
this.isIE=$telerik.isIE;
this.isFirefox=$telerik.isFirefox;
this.isOpera=$telerik.isOpera;
this.isIE7=$telerik.isIE7;
this._spellAllowAddCustom=true;
this._spellCheckJSON={};
this._spellCheckService=null;
this._ajaxSpellCheckScriptReference="";
};
Telerik.Web.UI.RadEditor.prototype={add_spellCheckLoaded:function(_731){
this.get_events().addHandler("spellCheckLoaded",_731);
},remove_spellCheckLoaded:function(_732){
this.get_events().removeHandler("spellCheckLoaded",_732);
},get_ajaxSpellCheck:function(){
return this._ajaxSpellCheck;
},set_ajaxSpellCheck:function(_733){
this._ajaxSpellCheck=_733;
this.raiseEvent("spellCheckLoaded");
},get_ajaxSpellCheckScriptReference:function(){
return this._ajaxSpellCheckScriptReference;
},get_spellAllowAddCustom:function(){
return this._spellAllowAddCustom;
},set_spellAllowAddCustom:function(_734){
this._spellAllowAddCustom=_734;
},get_spellCheckJSON:function(){
return this._spellCheckJSON;
},set_spellCheckJSON:function(_735){
this._spellCheckJSON=_735;
},get_spellCheckService:function(){
if(!this._spellCheckService){
this._spellCheckService=$create(Telerik.Web.UI.SpellCheckService,this.get_spellCheckJSON(),null,null);
this._spellCheckService.add_complete(Function.createDelegate(this,this._responseReceived));
}
return this._spellCheckService;
},startSpellCheck:function(){
this.get_spellCheckService().spellCheck(this.get_html());
},addCustomWord:function(word){
this.get_spellCheckService().addCustomWord(word);
},_responseReceived:function(_737,args){
},raiseEvent:function(_739,args){
if(_739!="selectionChange"||this.get_mode()==Telerik.Web.UI.EditModes.Design){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"raiseEvent",[_739,args]);
}
},initialize:function(){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"initialize");
this.raiseEvent("init",Sys.EventArgs.Empty);
var _73b=$get(this.get_id()+"Wrapper");
this._originalHeight=_73b.style.height;
this._initializeLocalization();
this._addFilters();
this._addDefaultShortCuts();
this._createUI();
this._createTools();
this._makeResizeable(true);
if(true){
var _73c=$get(this.get_id()+"ContentHiddenTextarea");
if(_73c){
_73c.setAttribute("id",this.get_id());
this._contentHiddenTextarea=_73c;
}
this._setContentAreaHtml(this.get_contentHiddenTextareaValue(),true);
}
this._registerClientValidation();
this._registerPostBackHandlers();
if(!this._isEditModeEnabled(Telerik.Web.UI.EditModes.Design)){
if(this._isEditModeEnabled(Telerik.Web.UI.EditModes.Html)){
this.set_mode(Telerik.Web.UI.EditModes.Html);
}else{
this.set_mode(Telerik.Web.UI.EditModes.Preview);
}
}
var _73d=this;
window.setTimeout(function(){
if(_73d.isIE){
if($telerik.isOpera){
return;
}
var area=_73d.get_contentArea();
if(!area){
return;
}
try{
var r=area.createTextRange();
var _740=document.body.createTextRange();
_740.moveStart("textedit",_740.text.length);
_740.collapse(true);
_740.select();
}
catch(e){
}
}
},0);
this._fixIEVisibilityProblems(true);
this._fixMozillaDOMProblems(true);
if(this._modulesManager){
if(!this.isIE){
var _741=$get(this.get_id()+"Module");
_741.style.display="none";
var _742=this;
window.setTimeout(function(){
_742._modulesManager.initialize();
_741.style.display="";
},0);
}else{
this._modulesManager.initialize();
this._updateEditorSize(this._originalHeight);
}
}
if(this.get_autoResizeHeight()&&!this._getInvisibleParent()){
this._makeAutoResizeHeight();
}
this._initialContent=_73d.get_html(true);
this.raiseEvent("load",Sys.EventArgs.Empty);
},dispose:function(){
if(typeof (Sys.WebForms)!="undefined"&&typeof (Sys.WebForms.PageRequestManager)!="undefined"&&this._saveContentDelegate){
var prm=Sys.WebForms.PageRequestManager.getInstance();
if(prm){
prm.remove_initializeRequest(this._saveContentDelegate);
}
prm=null;
}
if(this._contentHiddenTextarea&&this._contentHiddenTextarea.form&&this._saveContentDelegate){
$telerik.removeExternalHandler(this._contentHiddenTextarea.form,"submit",this._saveContentDelegate);
}
if(this._contentAreaElement){
$clearHandlers(this._contentAreaElement);
}
this._detachEvents();
this._fixMozillaDOMProblems(false);
this._fixIEVisibilityProblems(false);
this._makeResizeable(false);
this._onToolClickDelegate=null;
this._onWindowResizeDelegate=null;
this._dialogOpener=null;
this._saveContentDelegate=null;
this._registerModeChangeHandler(false);
Telerik.Web.UI.RadEditor.callBaseMethod(this,"dispose");
},_makeAutoResizeHeight:function(){
if(this._initialContentHeight&&this._initialContentHeight>0){
return;
}
window.setTimeout(Function.createDelegate(this,function(){
this.get_contentArea().style.overflow="hidden";
this._initialContentHeight=this._contentAreaElement.offsetHeight;
var _744=this;
this.attachEventHandler("keydown",function(e){
if(!_744._isKeyUpButton(e)){
_744._resizeContentArea(e);
}
});
this.attachEventHandler("keyup",function(e){
if(_744._isKeyUpButton(e)||(e.keyCode==13&&!_744.isIE)){
_744._resizeContentArea(e);
}
});
this.add_selectionChange(Function.createDelegate(this,this._resizeContentArea));
this._resizeContentArea();
}),0);
},_isKeyUpButton:function(e){
var _748=e.keyCode;
if(_748==8||_748==46){
return true;
}
return false;
},_getCurrentFontSize:function(){
var o=this.getSelectedElement();
var _74a=parseInt($telerik.getCurrentStyle(o,"fontSize"));
return _74a;
},_resizeContentArea:function(e){
var body=this.isIE?this._document.body:this._document.documentElement;
var _74d=this._contentAreaElement;
var _74e=_74d.parentNode;
var _74f=this._initialContentHeight;
var _750=_74d.offsetHeight;
var _751=body.scrollHeight+(e&&e.keyCode==13&&this.isIE?this._getCurrentFontSize():0);
if(_751==_750){
return;
}
if((_74f==_750)&&(_751<=_74f)){
return;
}
var _752=(_751>_74f)?_751:_74f;
_74d.style.height=_752+"px";
if(_751>_750){
_74e.style.height=parseInt(_751)+"px";
}else{
var _753=this.get_element();
var _754=_753.offsetHeight-(_74e.offsetHeight-_74d.offsetHeight);
if(_74d.style.height!="100%"){
_74e.style.height="";
this._updateEditorSize(_754);
}
return;
}
this._updateEditorSize(null,true);
},_makeResizeable:function(_755){
if(this._resizeExtender){
this._resizeExtender.dispose();
this._resizeExtender=null;
}
if(!_755){
return;
}
if(!this._tableElement){
return;
}
if(!this._bottomResizer){
this._bottomResizer=$get(this.get_id()+"BottomResizer");
if(this.isIE&&this._bottomResizer){
this._bottomResizer.style.styleFloat="right";
}
}
var _756={se:this._bottomResizer};
this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._rootElement,_756,this._tableElement);
},_getInvisibleParent:function(){
return Telerik.Web.UI.Editor.Utils.getInvisibleParent(this.get_element());
},_fixIEVisibilityProblems:function(_757){
if(!this.isIE){
return;
}
if(_757){
var _758=this._getInvisibleParent();
if(_758){
this._onIEParentVisibilityChangeDelegate=Function.createDelegate(this,this._onIEParentVisibilityChange);
this._invisibleParent=_758;
$addHandler(this._invisibleParent,"propertychange",this._onIEParentVisibilityChangeDelegate);
}
}else{
if(this._invisibleParent&&this._onIEParentVisibilityChangeDelegate){
$removeHandler(this._invisibleParent,"propertychange",this._onIEParentVisibilityChangeDelegate);
this._onIEParentVisibilityChangeDelegate=null;
this._invisibleParent=null;
}
}
},_fixMozillaDOMProblems:function(_759){
if(this.isIE){
return;
}
if(_759){
var _75a=this._getInvisibleParent();
if(_75a){
this._invisibleParent=_75a;
this._onMozillaParentVisibilityChangeDelegate=Function.createDelegate(this,this._onMozillaParentVisibilityChange);
_75a.addEventListener("DOMAttrModified",this._onMozillaParentVisibilityChangeDelegate,false);
}
this._onMozillaParentNodeChangedDelegate=Function.createDelegate(this,this._onMozillaParentNodeChanged);
document.addEventListener("DOMNodeInserted",this._onMozillaParentNodeChangedDelegate,false);
}else{
if(this._invisibleParent&&this._onMozillaParentVisibilityChangeDelegate){
this._invisibleParent.removeEventListener("DOMAttrModified",this._onMozillaParentVisibilityChangeDelegate,false);
this._onMozillaParentVisibilityChangeDelegate=null;
this._invisibleParent=null;
}
if(this._onMozillaParentNodeChangedDelegate){
document.removeEventListener("DOMNodeInserted",this._onMozillaParentNodeChangedDelegate,false);
this._onMozillaParentNodeChangedDelegate=null;
}
}
},_onIEParentVisibilityChange:function(e){
var e=e.rawEvent;
if(!e){
return;
}
if(e.propertyName=="style.display"){
if(this._invisibleParent.style.display!="none"){
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this._updateEditorSize();
this._fixIEVisibilityProblems(false);
}
}
},_onMozillaParentVisibilityChange:function(e){
if(e.attrName=="style"){
var _75d=e.target;
if(_75d.style.display!="none"){
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this.set_editable(true);
}
}
},_onMozillaParentNodeChanged:function(e){
if(!e.target||!this.get_element()){
return;
}
var _75f=$telerik.isDescendantOrSelf(e.target,this.get_element());
if(_75f){
this.onParentNodeChanged();
}
},onParentNodeChanged:function(){
if(!$telerik.isIE){
var _760=this.get_html(true);
var _761=this.get_contentAreaElement();
this._contentWindow=_761.contentWindow;
this._setContentAreaHtml(_760,true);
this.set_editable(true);
}
},onResizeStart:function(){
this._resizeSelection=this.getSelection().getRange();
},onResizeEnd:function(){
if(!this.isIE){
return;
}
this.setActive();
if(this._resizeSelection){
this.getSelection().selectRange(this._resizeSelection);
this._resizeSelection=null;
}
},_initializeLocalization:function(){
this._localization=Telerik.Web.UI.Localization.merge("RadEditor",this.get_language(),this._localization);
},getSelectedElement:function(){
return this.getSelection().getParentElement();
},getSelection:function(){
return new Telerik.Web.UI.Editor.Selection(this.get_contentWindow());
},getSelectionHtml:function(){
return this.getSelection().getHtml();
},selectElement:function(_762,_763){
if(Telerik.Web.UI.Editor.Utils.selectElement(this.get_contentWindow(),_762)&&false!=_763){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},undo:function(_764){
this._commandsManager.undo(_764);
},redo:function(_765){
this._commandsManager.redo(_765);
},executeCommand:function(_766,_767,_768){
if(!_766.get_window()){
_766.set_window(this.get_contentWindow());
}
if(false!=_767&&!this.isOpera){
this.setFocus();
}
this._commandsManager.execute(_766,_768);
},executeBrowserCommand:function(_769,_76a,_76b,_76c){
var _76d=this._localization[_769];
this.executeCommand(new Telerik.Web.UI.Editor.BrowserCommand(_76d,this._contentWindow,_769,_76b));
this.setActive();
this.setFocus();
if(true==_76c){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},createElement:function(_76e,_76f,_770,sId,_772,_773){
var _774=this._document.createElement(_76e);
if(_76f){
_774.style.width=_76f;
}
if(_770){
_774.style.height=_770;
}
if(null!=sId){
_774.id=sId;
}
if(null!=_772){
_774.name=_772;
}
if(null!=_773){
_774.value=_773;
}
return _774;
},createRestorePoint:function(){
return new Telerik.Web.UI.Editor.RestorePoint(this._contentWindow);
},getToolState:function(_775){
if(_775=="Undo"){
return this.get_commandsManager().isUndoAvailable()?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
}else{
if(_775=="Redo"){
return this.get_commandsManager().isRedoAvailable()?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
}else{
var oCmd=Telerik.Web.UI.Editor.UpdateCommandsArray[_775];
if(oCmd&&oCmd.getState){
return oCmd.getState(this._contentWindow);
}
}
}
},getToolValue:function(_777){
var oCmd=Telerik.Web.UI.Editor.UpdateCommandsArray[_777];
if(oCmd&&oCmd.getValue){
return oCmd.getValue(this._contentWindow);
}else{
if(_777=="RealFontSize"){
var o=this.getSelectedElement();
if(o){
var _77a=null;
try{
_77a=$telerik.getCurrentStyle(o,"fontSize","");
}
catch(exc){
}
if(_77a){
var _77b=parseFloat(_77a);
if(_77b>parseInt(_77a)){
if(_77a.indexOf("px")>-1){
_77a=parseInt(_77a)+"px";
}
}
}
return _77a;
}
}
}
},_addFilters:function(){
var _77c=this.get_filtersManager();
var _77d=this.get_contentFilters();
_77c.clear();
var _77e=_77d&Telerik.Web.UI.EditorFilters.ConvertToXhtml;
_77c.set_enableXhtmlFilter(_77e);
if(_77d&Telerik.Web.UI.EditorFilters.RemoveScripts){
_77c.add(new Telerik.Web.UI.Editor.StripScriptsFilter());
}
_77c.add(new Telerik.Web.UI.Editor.EncodeScriptsFilter());
if(_77d&Telerik.Web.UI.EditorFilters.FixUlBoldItalic){
_77c.add(new Telerik.Web.UI.Editor.FixUlBoldItalic());
}
_77c.add(new Telerik.Web.UI.Editor.FixNestedLists());
if(_77d&Telerik.Web.UI.EditorFilters.ConvertFontToSpan){
_77c.add(new Telerik.Web.UI.Editor.ConvertFontToSpanFilter());
}
if(_77d&Telerik.Web.UI.EditorFilters.FixEnclosingP){
_77c.add(new Telerik.Web.UI.Editor.FixEnclosingP());
}
if($telerik.isIE){
_77c.add(new Telerik.Web.UI.Editor.IEKeepObjectParamsFilter());
_77c.add(new Telerik.Web.UI.Editor.IEKeepCommentsFilter());
_77c.add(new Telerik.Web.UI.Editor.IEFixEmptyParagraphs());
if(_77d&Telerik.Web.UI.EditorFilters.IECleanAnchors){
_77c.add(new Telerik.Web.UI.Editor.IECleanAnchorsFilter());
}
}
if(!$telerik.isIE&&!$telerik.isOpera){
if(!$telerik.isSafari){
_77c.add(new Telerik.Web.UI.Editor.MozillaKeepFlashString(this.get_mozillaFlashOverlayImage()));
_77c.add(new Telerik.Web.UI.Editor.MozillaKeepFlash());
}
_77c.add(new Telerik.Web.UI.Editor.MozillaKeepStylesString());
_77c.add(new Telerik.Web.UI.Editor.MozillaKeepStylesDom());
if(_77d&Telerik.Web.UI.EditorFilters.MozEmStrong){
_77c.add(new Telerik.Web.UI.Editor.MozEmStrongFilter());
}
}
_77c.add(new Telerik.Web.UI.Editor.StripJunkFilter());
if(_77d&Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute){
_77c.add(new Telerik.Web.UI.Editor.MakeUrlsAbsolute());
}
_77c.add(new Telerik.Web.UI.Editor.RemoveExtraBrakes());
if(_77d&Telerik.Web.UI.EditorFilters.IndentHTMLContent){
_77c.add(new Telerik.Web.UI.Editor.IndentHTMLContentFilter());
}
},addShortCut:function(_77f,_780){
if(this._shortCutManager){
this._shortCutManager.addShortCut(_77f,_780);
}
},removeShortCut:function(_781){
if(this._shortCutManager){
this._shortCutManager.removeShortCut(_781);
}
},setShortCut:function(_782,_783){
if(this._shortCutManager){
this._shortCutManager.setShortCut(_782,_783);
}
},_addDefaultShortCuts:function(){
var _784=[["Undo","CTRL+Z"],["Redo","CTRL+Y"],["SelectAll","CTRL+A"],["Copy","CTRL+C"],["Paste","CTRL+V"],["Cut","CTRL+X"],["Bold","CTRL+B"],["Italic","CTRL+I"],["Underline","CTRL+U"],["Copy","CTRL+INS"],["Paste","SHIFT+INS"],["ToggleScreenMode","F11"],["LinkManager","CTRL+K"],["ImageManager","CTRL+G"],["SetToolFocus","F10"]];
for(var i=0;i<_784.length;i++){
this.addShortCut(_784[i][0],_784[i][1]);
}
if(this.isIE){
this.addShortCut("InsertTab","TAB");
}
if(this._newLineBr&&this.isIE){
this.addShortCut("Enter","ENTER");
this.addShortCut("ShiftEnter","SHIFT+ENTER");
this.addShortCut("InsertParagraph","CTRL+ENTER");
}else{
if(this.isFirefox&&!this._newLineBr){
this.addShortCut("EnterParagraphMozilla","ENTER");
}
}
},bubbleKeyEventToBrowser:function(){
this._shortcutHit=false;
},attachEventHandler:function(_786,_787){
if(_786.startsWith("on")){
_786=_786.replace("on","");
}
$telerik.addExternalHandler(this._document,_786,_787);
var _788=this._contentAreaEventHandlers;
if(!_788[_786]){
_788[_786]=[];
}
var _789=_788[_786];
_789[_789.length]=_787;
},detachEventHandler:function(_78a,_78b){
if(_78a.startsWith("on")){
_78a=_78a.replace("on","");
}
$telerik.removeExternalHandler(this._document,_78a,_78b);
},_detachEvents:function(){
var _78c=this._contentAreaEventHandlers;
for(var _78d in _78c){
var _78e=_78c[_78d];
if(_78e.length!=null){
for(var i=0;i<_78e.length;i++){
var _790=_78e[i];
if(typeof (_790)=="function"){
try{
this.detachEventHandler(_78d,_790);
}
catch(e){
}
}
}
_78e=[];
}
}
this._contentAreaEventHandlers={};
this._attachIEBodyHandlers(false);
},get_TopZone:function(){
return $get(this.get_id()+"Top");
},_createTools:function(){
if(!this._toolAdapter){
var _791=this.get_TopZone().firstChild;
var _792=eval(this._toolAdapterType);
this._toolAdapter=$create(_792,{"editor":this,"toolJSON":this.get_toolJSON()},{"toolClick":this._onToolClickDelegate},null,_791);
if(this.isIE){
if(this.get_toolbarMode()==Telerik.Web.UI.EditorToolbarMode.Default){
_791.style.overflow="";
}
this._updateEditorSize();
}
}
},_onToolClick:function(tool,args){
this.fire(tool.get_name(),args);
},getContextMenuByTagName:function(_795){
if(this._toolAdapter&&this._toolAdapter.getContextMenuByTagName){
return this._toolAdapter.getContextMenuByTagName(_795);
}
},getToolByName:function(_796){
if(this._toolAdapter){
return this._toolAdapter.getToolByName(_796);
}
return null;
},getLocalizedString:function(name,_798){
var str=this.get_localization()[name];
if(null==str){
str=this.get_localization()[name.toLowerCase()];
}
if(null==str){
str=_798;
}
return str;
},setFocus:function(){
try{
if(this.get_mode()!=Telerik.Web.UI.EditModes.Html){
this._contentWindow.focus();
}else{
var area=this._getTextArea();
area.focus();
}
}
catch(e){
}
},setActive:function(){
var _79b=this.get_contentArea();
if(_79b&&_79b.setActive){
_79b.setActive();
}
},set_visible:function(_79c){
var _79d=this.get_element();
if(_79d){
_79d.style.display=_79c?"":"none";
}
this.set_editable(_79c);
},enableEditing:function(_79e,_79f,_7a0){
var _7a1=this.get_toolAdapter();
var _7a2=Telerik.Web.UI.EditingOptions;
var _7a3=function(){
};
if(!_79f){
_79f=Telerik.Web.UI.EditingOptions.All;
}
this._editingOptions=_79f;
this._optionalIgnoredTools=_7a0;
if(_79f&_7a2.ContextMenus){
if(_7a1){
_7a1.enableContextMenus(_79e);
}
}
if(_79f&_7a2.EditModes){
if(!_79e){
this._originalEditModeRef=this.set_mode;
this.set_mode=_7a3;
}else{
if(this._originalEditModeRef){
this.set_mode=this._originalEditModeRef;
this._originalEditModeRef=null;
}
}
}
if(_79f&_7a2.Tools){
if(_7a1){
if(!_79e){
_7a1.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Disabled);
if(_7a0){
var _7a4=[];
for(var item in _7a0){
var tool=_7a1.getToolByName(item);
if(tool){
_7a4[_7a4.length]=tool;
}
}
_7a1.setToolState(_7a4);
}
this._originalSetToolStateRef=_7a1.setToolState;
_7a1.setToolState=_7a3;
}else{
_7a1.setToolState=this._originalSetToolStateRef;
this._originalSetToolStateRef=null;
}
}
}
if(_79f&_7a2.Modules){
var _7a7=this._modulesManager;
if(_7a7){
_7a7.setModulesVisible(_79e);
}
}
if(_79f&_7a2.Typing){
if(!_79e){
this._disableTypingDelegate=$telerik.cancelRawEvent;
this.attachEventHandler("keypress",this._disableTypingDelegate);
}else{
if(this._disableTypingDelegate){
this.detachEventHandler("keypress",this._disableTypingDelegate);
this._disableTypingDelegate=null;
}
}
}
if(_79f&_79f.Tab){
if(!_79e){
this.removeShortCut("InsertTab");
}else{
this.setShortCut("InsertTab","TAB");
}
}
if(_79e){
if(_7a1){
_7a1.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Off);
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},set_editable:function(_7a8){
if($telerik.isIE||$telerik.isOpera){
var oEd=this;
window.setTimeout(function(){
try{
oEd._document.body.setAttribute("contentEditable",""+_7a8);
oEd._document.execCommand("2D-Position",false,true);
}
catch(ev){
}
},0);
}else{
var oEd=this;
window.setTimeout(function(){
try{
oEd._document["designMode"]=_7a8?"on":"off";
if(_7a8){
oEd._document.execCommand("UseCSS",false,true);
}
}
catch(e){
}
},0);
}
},get_editable:function(){
if($telerik.isIE||$telerik.isOpera){
return this._document.body.contentEditable;
}else{
return (this._document["designMode"]=="on");
}
},enableContentArea:function(_7aa){
if(this.isIE){
this.get_document().body.setAttribute("contentEditable",""+_7aa);
}
},showExternalDialog:function(url,_7ac,_7ad,_7ae,_7af,_7b0,_7b1,_7b2,_7b3,_7b4,_7b5){
var _7b6=this.getSelection().getRange();
var _7b7=this;
var _7b8=function(_7b9,args){
window.setTimeout(function(){
_7b7.getSelection().selectRange(_7b6);
if(_7af){
var _7bb=_7af(_7b9,args);
if(false==_7bb){
return;
}
_7b7.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7b7.setFocus();
},50);
};
this.get_dialogOpener().openUrl(url,_7ac,_7ad,_7ae,_7b8,_7b0,_7b1,_7b2,_7b3,_7b4,_7b5);
},showDialog:function(_7bc,_7bd,_7be){
this._currentRange=this.getSelection().getRange();
var _7bf=this;
var _7c0=function(_7c1,args){
window.setTimeout(function(){
_7bf.getSelection().selectRange(_7bf._currentRange);
if(_7be){
var oRes=_7be(_7c1,args);
if(false==oRes){
return;
}
_7bf.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7bf.setFocus();
},50);
};
this.get_dialogOpener().open(_7bc,_7bd,_7c0);
if(this.isIE){
var wnd=this.get_dialogOpener()._getDialogContainer(_7bc);
if(!wnd||wnd._DRAG_ATTACHED){
return;
}
wnd._DRAG_ATTACHED=true;
wnd.add_dragEnd(function(){
_7bf.getSelection().selectRange(_7bf._currentRange);
});
}
},_getModeButtonsWrapper:function(){
return this._getChildElement("ModesWrapper");
},_registerModeChangeHandler:function(_7c5){
if(_7c5){
this._onModeButtonClickDelegate=Function.createDelegate(this,this._onModeButtonClick);
$addHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
}else{
if(this._onModeButtonClickDelegate){
$removeHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
this._onModeButtonClickDelegate=null;
}
}
},_onModeButtonClick:function(e){
var _7c7=this.get_mode();
var _7c8=Telerik.Web.UI.Editor.Utils.getElementParentByTag(e.target,"LI");
if(_7c8){
var _7c9=Telerik.Web.UI.EditModes;
var _7ca=Sys.UI.DomElement;
var a=_7c8.getElementsByTagName("A")[0];
if(_7ca.containsCssClass(a,"rade_mode_html")){
_7c7=_7c9.Html;
}else{
if(_7ca.containsCssClass(a,"rade_mode_design")){
_7c7=_7c9.Design;
}else{
_7c7=_7c9.Preview;
}
}
}
if(_7c7!=this.get_mode()){
this.set_mode(_7c7);
}
return $telerik.cancelRawEvent(e);
},_changeModeUI:function(mode){
var _7cd=Sys.UI.DomElement;
var _7ce=Telerik.Web.UI.EditModes;
var _7cf="rade_mode_";
switch(mode){
case _7ce.Html:
_7cf+="html";
break;
case _7ce.Design:
_7cf+="design";
break;
case _7ce.Preview:
_7cf+="preview";
break;
}
var _7d0=this._getModeButtonsWrapper();
var as=_7d0.getElementsByTagName("A");
for(var i=0;i<as.length;i++){
var a=as[i];
_7cd.removeCssClass(a,"rade_mode_selected");
if(_7cd.containsCssClass(a,_7cf)){
_7cd.addCssClass(a,"rade_mode_selected");
}
}
},_isEditModeEnabled:function(_7d4){
return _7d4&this._editModes?true:false;
},get_mode:function(){
return this._mode;
},set_mode:function(_7d5){
this._setEditableDelegate=Function.createDelegate(this,function(){
this.remove_editReady(this._setEditableDelegate);
var _7d6=(this._mode==_7d7.Design);
this.set_editable(_7d6);
this.toggleEnhancedEdit(_7d6);
this._setEditableDelegate=null;
});
this.add_editReady(this._setEditableDelegate);
var _7d8=this._mode;
var _7d7=Telerik.Web.UI.EditModes;
if(_7d8==_7d7.Html||_7d5==_7d7.Html){
var html=this.get_html(true);
this._mode=_7d5;
this._showTextArea(this._mode==_7d7.Html);
this.set_html(html);
}else{
this._mode=_7d5;
this._showTextArea(this._mode==_7d7.Html);
}
this._changeModeUI(_7d5);
if(this._mode!=_7d7.Preview){
this.setFocus();
if(this.isFirefox&&!this._document.body){
}else{
this.set_editable(true);
}
if(this._mode==_7d7.Design){
this.toggleEnhancedEdit(true);
}
}else{
this.set_editable(false);
this.toggleEnhancedEdit(false);
}
this.setFocus();
var _7da=this.get_id();
var _7db=$get(_7da+"Wrapper");
var _7dc=_7db.offsetHeight+"px";
this.raiseEvent("modeChange",Sys.EventArgs.Empty);
this._updateEditorSize(_7dc);
},_getTextIframe:function(){
if(!this._textIframe){
var _7dd=this.get_contentAreaElement();
if(_7dd){
this._textIframe=_7dd.cloneNode(true);
this._textIframe.style.position="absolute";
var _7de=this._textIframe.style;
_7de.height="2px";
_7de.width="2px";
_7dd.parentNode.appendChild(this._textIframe);
var doc=this._textIframe.contentWindow.document;
doc.designMode="off";
var _7e0=doc.open("text/html","replace");
var _7e1="<html style='height:100%;'><head><title>New Document</title></head>"+"<body style='overflow:hidden;margin:0px;padding:0px;height:100%'>"+"<textarea style='font:normal 11px Tahoma;color: #000080;border:0px;height:100%;width:100%'>"+"</textarea></body></html>";
if(typeof (_7e0)=="undefined"){
_7e0=doc;
}
_7e0.write(_7e1);
_7e0.close();
}
}
return this._textIframe;
},_getTextArea:function(){
var area=this._getTextIframe();
return area.contentWindow.document.body.firstChild;
},get_textArea:function(){
return this._getTextArea();
},_showTextArea:function(_7e3){
var area=this._getTextIframe();
var _7e5=this.get_contentAreaElement();
if(_7e3){
if($telerik.isSafari){
_7e5.style.width="0px";
_7e5.style.height="0px";
}else{
_7e5.style.display="none";
}
area.style.display="";
area.style.position="";
area.style.height="100%";
area.style.width="100%";
}else{
if($telerik.isSafari){
_7e5.style.width="100%";
_7e5.style.height="100%";
}else{
_7e5.style.display="";
}
area.style.display="none";
}
},_setContentAsText:function(_7e6){
var area=this._getTextArea();
area.value=_7e6;
},_getContentAsText:function(){
var area=this._getTextArea();
var _7e9=area.value;
return _7e9;
},set_html:function(_7ea,_7eb,_7ec){
var _7ed=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_7ed.Html){
var cmd=new Telerik.Web.UI.Editor.GenericCommand(_7eb?_7eb:"Set HTML",this.get_contentWindow());
this._setContentAreaHtml(_7ea);
this.executeCommand(cmd,_7ec);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}else{
this._setContentAsText(_7ea);
}
},get_html:function(_7ef){
var _7f0=null;
var _7f1="";
var mode=this.get_mode();
var _7f3=Telerik.Web.UI.EditModes;
if(mode==_7f3.Html){
return this._getContentAsText();
}else{
if(this.get_fullPage()){
if(this._document){
_7f0=this._document.getElementsByTagName("HTML")[0];
_7f0=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(_7f0);
var _7f4=this._getAllSheets(_7f0);
for(var i=0;i<_7f4.length;i++){
var _7f6=_7f4[i];
var _7f7=_7f6.getAttribute("id");
if(_7f7&&_7f7.indexOf("RADEDITORSTYLESHEET")==0){
_7f6.parentNode.removeChild(_7f6);
}
}
if($telerik.isIE||$telerik.isOpera){
_7f0.getElementsByTagName("BODY")[0].removeAttribute("contentEditable");
}
}
}else{
if(this.get_contentArea()){
if(true==_7ef){
_7f0=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(this.get_contentArea());
if($telerik.isIE||$telerik.isOpera){
_7f0.removeAttribute("contentEditable");
}
}else{
_7f0=this.get_contentArea();
}
}
}
}
if(_7f0){
if(true==_7ef){
_7f1=this.get_filtersManager().getHtmlContent(_7f0);
}else{
_7f1=_7f0.innerHTML;
}
}
if(_7f1.indexOf("<body")==0){
_7f1=_7f1.trim();
_7f1=_7f1.substring(_7f1.indexOf(">")+1,_7f1.length-7);
_7f1=_7f1.trim();
}
if(this.get_fullPage()&&this._doctypeString){
_7f1=this._doctypeString+"\n"+_7f1;
}
return _7f1;
},set_initialContent:function(){
this._initialContent=this.get_html(true);
},get_initialContent:function(){
return this._initialContent;
},get_text:function(){
var _7f8=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_7f8.Html){
var _7f9="";
var _7fa=this.get_contentArea();
if(_7fa){
if(_7fa.innerText){
_7f9=_7fa.innerText;
}else{
if(_7fa.textContent!=null){
_7f9=_7fa.textContent;
}else{
_7f9=_7fa.innerHTML.replace(/<\/?[^>]*>/ig,"");
}
}
}
return _7f9;
}else{
return this._getTextArea().value.replace(/<\/?[^>]*>/ig,"");
}
},_getUniqueStyleSheetId:function(i){
return "RADEDITORSTYLESHEET"+i;
},_getAllSheets:function(oDoc){
if(!oDoc){
alert("RadEditor._getAllSheets called with no document object provided");
}
var _7fd=oDoc.getElementsByTagName("link");
var _7fe=oDoc.getElementsByTagName("style");
var _7ff=[];
for(var x=0;_7fd[x];x++){
var rel=_7fd[x].rel?_7fd[x].rel:_7fd[x].getAttribute("rel");
if(typeof (rel)=="string"&&rel.toLowerCase().indexOf("style")+1){
Array.add(_7ff,_7fd[x]);
}
}
for(var x=0;_7fe[x];x++){
Array.add(_7ff,_7fe[x]);
}
return _7ff;
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _804=str.lastIndexOf(".");
if(_804==-1){
return "";
}
var _805=str.indexOf(" ",_804);
if(-1==_805){
_805=str.indexOf(":",_804);
}
if(-1==_805){
_805=str.length;
}
return str.substring((_804+1),_805);
},_createCssFilterObject:function(){
if(this._cssClassesHash){
return;
}
var _806=this.get_cssClasses();
if(_806&&_806.length>0){
var obj={};
var _808=_806.length;
for(var i=0;i<_808;i++){
var oKey=_806[i][0];
var oVal=_806[i][1];
obj[oKey.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})]=oVal;
}
this._cssClassesHash=obj;
}
},_getFilteredCssClasses:function(_80d){
this._createCssFilterObject();
if(_80d&&this._cssClassesHash){
var _80e=[];
var _80f=_80d.length;
for(var _810=0;_810<_80f;_810++){
var _811=_80d[_810];
if(outAlias=this._checkCssFilter(_811[1].selectorText)){
_811[2]=outAlias;
_80e[_80e.length]=_811;
}
}
return _80e;
}else{
return _80d;
}
},_checkCssFilter:function(_812){
if(!_812||!this._cssClassesHash){
return null;
}
return this._cssClassesHash[_812.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})];
},getCssArray:function(_814){
var _815=this.get_document();
var _816=[];
for(var i=0;i<_815.styleSheets.length;i++){
var _818=_815.styleSheets[i];
this._getStyleSheetRules(_816,_818,_814);
}
_816=this._getFilteredCssClasses(_816);
return _816;
},_getStyleSheetRules:function(_819,_81a,_81b){
var _81c=_81a.href;
if(_81c&&_81c.indexOf("WebResource.axd?")>-1){
return;
}
var _81d=(_81a.rules)?_81a.rules:_81a.cssRules;
if($telerik.isIE&&_81a.imports){
for(var k=0;k<_81a.imports.length;k++){
this._getStyleSheetRules(_819,_81a.imports[k],_81b);
}
}
for(var j=0;j<_81d.length;j++){
var _820=_81d[j];
if(_820&&_820.cssText){
var text=_820.cssText.toLowerCase();
if(text.indexOf("@import")>=0&&_820.parentStyleSheet&&_820.styleSheet&&_820.parentStyleSheet!=_820.styleSheet){
this._getStyleSheetRules(_819,_820.styleSheet,_81b);
continue;
}
}
var str=_820&&_820.selectorText?_820.selectorText:"";
var _823=str.lastIndexOf(".");
if(_823<0){
continue;
}
var _823=str.lastIndexOf(":");
if(_823>0){
continue;
}
var _824=this._getClassName(_820);
_819[_819.length]=[_824,_820];
}
},copyStyleSheets:function(_825,_826){
if(null==_825&&null==_826){
return;
}
var _827=0;
var _828=null;
if(_826.styleSheets.length==0){
if(_826.createStyleSheet){
_826.createStyleSheet();
}else{
css=_826.createElement("style");
css.media="all";
css.type="text/css";
var _829=_826.getElementsByTagName("head")[0];
_829.appendChild(css);
_828=css;
}
}
if(_826.styleSheets[0]){
_828=_826.styleSheets[0];
}
for(var i=0;i<_825.styleSheets.length;i++){
try{
var _82b=_825.styleSheets[i];
var _82c=_82b.href;
var _82d=false;
if($telerik.isFirefox){
if(_82b.ownerNode&&_82b.ownerNode.tagName.toLowerCase()=="style"){
_82d=true;
}
}
if(_82c&&!_82d){
continue;
}
var _82e=(_82b.rules)?_82b.rules:_82b.cssRules;
for(var j=0;j<_82e.length;j++){
var _830=_82e[j];
if(_828.addRule){
var _831=_830.selectorText;
var oCss=_830.style.cssText;
if(oCss&&_831){
_828.addRule(_831,oCss,_827);
}
}else{
if(_828.insertRule){
_828.insertRule(_830.cssText,_827);
}else{
var oCss=_830.selectorText+"{"+_830.style.cssText+"}";
var _833=_826.createTextNode(oCss);
_828.appendChild(_833);
}
}
_827++;
}
}
catch(exc){
}
}
},_setContentAreaHtml:function(_834,_835){
var _836=this.get_filtersManager().getDesignContent(_834);
this.set_contentHiddenTextareaValue(_836);
var _837=null;
if(-1!=_836.toLowerCase().indexOf("<html")){
this.set_fullPage(true);
_837=_836;
var _838=new RegExp("(<!DOCTYPE(.|\\n)*?>)(.|\\n)*?","g");
this._doctypeString=(_837.match(_838))?_837.match(_838)[0]:"";
}else{
this.set_fullPage(false);
}
if(null!=_837||true==_835){
var _839=this;
var _83a=function(){
_83b=false;
try{
_839._document=_839._contentAreaElement.contentWindow.document;
_839._contentWindow=_839._contentAreaElement.contentWindow;
_839._contentArea=_839._document.body;
_839.get_filtersManager().getDesignContentDom(_839.get_contentArea());
var _83c=1;
Telerik.Web.UI.Editor.Utils.addStyleSheet(_839.get_contentAreaCssFile(),_839._document,_839._getUniqueStyleSheetId(0));
var _83d=_839.get_cssFiles();
if(_83d.length>0){
for(var i=0;i<_83d.length;i++){
var _83f=_839._getUniqueStyleSheetId(_83c++);
Telerik.Web.UI.Editor.Utils.addStyleSheet(_83d[i],_839._document,_83f);
}
}else{
if(!_839._fullPage){
_839.copyStyleSheets(document,_839._document);
var _840=_839._getAllSheets(document);
for(var i=0;i<_840.length;i++){
var _83f=_839._getUniqueStyleSheetId(_83c++);
var _841=_840[i];
if(_841.tagName=="LINK"){
var _842=_841.href;
if(_842&&_842.indexOf("WebResource.axd?")>-1){
continue;
}
if(_842){
Telerik.Web.UI.Editor.Utils.addStyleSheet(_841.getAttribute("href"),_839._document,_83f);
}
}else{
if(_841.tagName=="STYLE"){
}
}
}
}
}
var _843=Telerik.Web.UI.Editor.PopupController;
if(_843){
_843.detachFromDocument(_839._document);
_843.attachToDocument(_839._document);
}
_839._initEvents();
if(_839.get_mode()!=Telerik.Web.UI.EditModes.Preview){
_839.set_editable(true);
}else{
_839.set_editable(false);
}
_839.toggleEnhancedEdit(true);
if(_839._document&&_839._document.body){
_839.raiseEvent("editReady",Sys.EventArgs.Empty);
}
}
catch(e){
}
};
if($telerik.isFirefox){
$addHandler(this._contentAreaElement,"load",function(){
if(_83b){
_83a();
}
});
}
if(!_837){
_837="<head><style></style></head><body>"+_836+"</body>";
}
try{
var _844=this._contentAreaElement.contentWindow.document;
if(_844&&_844.body){
var _845=Telerik.Web.UI.Editor.PopupController;
if(_845){
_845.detachFromDocument(_844);
}
}
_844.open();
_844.write(_837);
_844.close();
var _83b=false;
if(_844.body){
_83a();
}else{
_83b=true;
}
}
catch(e){
}
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this._contentArea,_836);
this.get_filtersManager().getDesignContentDom(this.get_contentArea());
}
},_createUI:function(){
if(this._created){
return;
}
this._registerModeChangeHandler(true);
var id=this.get_id();
this._rootElement=$get(id);
this._tableElement=$get(id+"Wrapper");
var _847=$get(id+"Center");
var _848=this.get_contentAreaElement();
_848.style.display="none";
_847.appendChild(_848);
_848.style.height="100%";
_848.style.display="";
this._created=true;
},_updateEditorSize:function(_849,_84a){
var _84b=this._tableElement;
var _84c=_849?_849:_84b.style.height;
if(true==_84a){
_84c=_84b.offsetHeight+"px";
}
if(parseInt(_84c)==0){
return;
}
_84b.style.height=_84c;
if(this.isIE){
this._fixIeHeight(_84b,_84c);
}else{
var _84d=this;
window.setTimeout(function(){
_84d._fixIeHeight(_84b,_84c);
},0);
}
_84b.parentNode.style.height=_84c;
},_fixIeHeight:function(_84e,_84f){
if("CSS1Compat"==document.compatMode){
var _850=(_84e.offsetHeight-parseInt(_84f));
if(_850>0){
var _851=(parseInt(_84e.style.height)-_850);
if(_851>0){
_84e.style.height=_851+"px";
}
}
}
},setSize:function(_852,_853){
var _852=parseInt(_852);
var _853=parseInt(_853);
var _854=this;
var _855=$get(_854.get_id()+"Wrapper");
_855.style.height="";
var _856=_855.parentNode;
_856.style.width=_852+"px";
_856.style.height=_853+"px";
_854._fixIeHeight(_856,_853);
if(_854.isIE){
_855.style.height=_853+"px";
_854._fixIeHeight(_855,_853);
}else{
_855.style.height="100%";
}
},pasteHtml:function(_857,_858,_859,_85a,_85b){
if(!this.get_editable()){
return;
}
var args=new Telerik.Web.UI.EditorCommandEventArgs(_858,null,_857);
if(false==this._executeCommandEvent("pasteHtml",_858,args)){
return;
}
if(_857!=args.get_value()){
_857=args.get_value();
}
var _85d=this.get_localization()[_858];
if(_85d){
_858=_85d;
}
var mode=this.get_mode();
if(Telerik.Web.UI.EditModes.Design==mode){
this.setFocus();
this.executeCommand(new Telerik.Web.UI.Editor.PasteHtmlCommand(_858,this._contentWindow,_857,_859),null,_85b);
if(_85a!=false){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
}else{
if(Telerik.Web.UI.EditModes.Html==mode){
var _85f=this._getTextArea();
if(this.isIE){
_85f.setActive();
var _860=document.selection.createRange();
_860.text=_857;
}else{
if(_85f.setSelectionRange){
var _861=_85f.selectionStart;
var _862=_85f.selectionEnd;
var _863=_85f.value.substring(_861,_862);
var _864=_857;
_85f.value=_85f.value.substring(0,_861)+_864+_85f.value.substring(_862);
_85f.setSelectionRange(_861+_864.length,_861+_864.length);
this.setFocus();
}
}
}
}
},fire:function(_865,args){
if(false==this._executeCommandEvent("commandExecuting",_865,args)){
return;
}
if(this._optionalIgnoredTools&&!this._optionalIgnoredTools[_865]){
return;
}
this.setActive();
this._pendingTextTypeCmd=null;
var _867=Telerik.Web.UI.Editor.CommandList[_865];
var _868=false;
if(_867){
_868=(false!=_867(_865,this,args));
}else{
alert("The command "+_865+" is not implemented yet.");
}
if(_868){
if(!$telerik.isOpera){
this.setFocus();
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
this._executeCommandEvent("commandExecuted",_865,args);
},_executeCommandEvent:function(_869,_86a,args){
if(!args){
args=new Telerik.Web.UI.EditorCommandEventArgs(_86a);
}
this.raiseEvent(_869,args);
if(args.get_cancel&&args.get_cancel()){
return false;
}
return true;
},_onWindowResize:function(){
var _86c=this._getViewportBounds();
this.setSize(_86c.width,_86c.height,false);
},_registerWindowResizeHandler:function(_86d){
if(_86d){
this._onWindowResizeDelegate=Function.createDelegate(this,this._onWindowResize);
$addHandler(window,"resize",this._onWindowResizeDelegate);
}else{
if(this._onWindowResizeDelegate){
$removeHandler(window,"resize",this._onWindowResizeDelegate);
this._onWindowResizeDelegate=null;
}
}
},_getViewportBounds:function(){
var _86e=$telerik.getClientBounds();
var _86f=document.documentElement.scrollLeft||document.body.scrollLeft;
var _870=document.documentElement.scrollTop||document.body.scrollTop;
_86e.scrollLeft=_86f;
_86e.scrollTop=_870;
return _86e;
},_handleParentsWithOverflow:function(_871){
if(false==_871){
if(!this._parentsWithOverflow){
return;
}
var _872=this._parentsWithOverflow;
var _873=_872.length;
for(var i=0;i<_873;i++){
var _875=_872[i];
if(_875[0]){
var node=_875[0];
node.style.overflow=_875[1];
node.style.height=_875[2];
}
}
this._parentsWithOverflow=null;
}else{
this._parentsWithOverflow=[];
var _872=this._parentsWithOverflow;
var _877=this._getRootNode().parentNode;
while(_877&&_877.tagName!="BODY"){
var _878=$telerik.getCurrentStyle(_877,"overflow");
if(_878){
_872[_872.length]=[_877,_877.style.overflow,_877.style.height];
_877.style.overflow="visible";
_877.style.height="auto";
}
_877=_877.parentNode;
}
}
},_getRootNode:function(){
return $get(this.get_id()+"Wrapper").parentNode;
},isFullScreen:function(){
return this._isFullScreen;
},toggleScreenMode:function(){
var _879=this;
if(!_879._isFullScreen){
document.body.scroll="no";
document.body.style.margin="0px";
if(document.documentElement){
document.documentElement.style.overflow="hidden";
}
var _87a=_879._getRootNode();
_879._preFullScreenBounds=$telerik.getBounds(_87a);
_879._handleParentsWithOverflow(true);
_879._onWindowResize();
_879._preFullScreenBrowserRect=_879._getViewportBounds();
var _87b=$telerik.getLocation(_87a);
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_87b.x,_87b.y);
_879._isFullScreen=true;
_879._registerWindowResizeHandler(true);
}else{
_879._registerWindowResizeHandler(false);
document.body.scroll="";
document.documentElement.style.overflow="";
try{
document.body.style.margin="";
}
catch(e){
}
_879._isFullScreen=false;
_879._handleParentsWithOverflow(false);
var _87c=_879._preFullScreenBounds;
_879.setSize(_87c.width,_87c.height,false);
var _87b=_879._preFullScreenBrowserRect;
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_87b.scrollLeft,_87b.scrollTop);
}
_879.set_editable(true);
_879.setFocus();
var _87d=_879.getToolByName("ToggleScreenMode");
if(_87d){
_87d.setOn(_879._isFullScreen);
}
this.raiseEvent("toggleScreenMode",Sys.EventArgs.Empty);
},get_contentHiddenTextareaValue:function(){
if(this._contentHiddenTextarea){
return Telerik.Web.UI.Editor.Utils.decodePostbackContent(this._contentHiddenTextarea.value);
}else{
return "";
}
},set_contentHiddenTextareaValue:function(_87e){
if($telerik.isSafari&&this._contentHiddenTextarea.innerText!=null){
this._contentHiddenTextarea.innerText=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_87e);
}else{
this._contentHiddenTextarea.value=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_87e);
}
},get_localization:function(){
return this._localization;
},get_contentAreaElement:function(){
if(!this._contentAreaElement){
var elem=document.createElement("iframe");
elem.frameBorder="0";
elem.src="javascript:'<html></html>';";
elem.style.width="100%";
elem.style.margin="0px";
elem.style.padding="0px";
this._contentAreaElement=elem;
}
return this._contentAreaElement;
},get_contentArea:function(){
return this._contentArea;
},get_contentTextArea:function(){
return this._contentTextArea;
},get_document:function(){
return this._document;
},get_contentWindow:function(){
return this._contentWindow;
},get_toolAdapter:function(){
return this._toolAdapter;
},set_toolAdapter:function(_880){
this._toolAdapter=_880;
},get_fullPage:function(){
return this._fullPage;
},set_fullPage:function(_881){
this._fullPage=_881;
},get_dialogOpener:function(){
return this._dialogOpener;
},set_dialogOpener:function(_882){
this._dialogOpener=_882;
},get_filtersManager:function(){
return this._filtersManager;
},get_commandsManager:function(){
return this._commandsManager;
},get_modulesManager:function(){
return this._modulesManager;
},get_links:function(){
if(null==this._links){
return [];
}
return this._links;
},set_links:function(_883){
this._links=_883;
},get_language:function(){
if(null==this._language){
return "en-us";
}
return this._language.toLowerCase();
},set_language:function(_884){
this._language=_884;
},get_colors:function(){
if(null==this._colors){
return ["","#ffcccc","#ffcc99","#ffff99","#ffffcc","#99ff99","#99ffff","#ccffff","#ccccff","#ffccff","#cccccc","#ff6666","#ff9966","#ffff66","#ffff33","#66ff99","#33ffff","#66ffff","#9999ff","#ff99ff","#c0c0c0","#ff0000","#ff9900","#ffcc66","#ffff00","#33ff33","#66cccc","#33ccff","#6666cc","#cc66cc","#999999","#cc0000","#FF6600","#FFCC33","#FFCC00","#33CC00","#3366FF","#00CCCC","#6633FF","#CC33CC","#666666","#990000","#cc6600","#cc9933","#999900","#009900","#339999","#3333ff","#6600cc","#993399","#333333","#660000","#993300","#996633","#666600","#006600","#336666","#000099","#333399","#663366","#000000","#330000","#663300","#663333","#333300","#003300","#003333","#000066","#330099","#330033"];
}
return this._colors;
},set_colors:function(_885){
this._colors=_885;
},get_fontNames:function(){
if(null==this._fontNames){
return ["Times New Roman","MS Sans Serif","Tahoma","Verdana","Arial","Courier New"];
}
return this._fontNames;
},set_fontNames:function(_886){
this._fontNames=_886;
},get_fontSizes:function(){
if(null==this._fontSizes){
return [1,2,3,4,5,6,7];
}
return this._fontSizes;
},set_fontSizes:function(_887){
this._fontSizes=_887;
},get_symbols:function(){
if(null==this._symbols){
return ["&#8364;","&#162;","&#163;","&#165;","&#164;","&#169;","&#174;","&#8482;","&#177;","&ne;","&#8776;","&#8804;","&#8805;","&#247;","&#215;","&#8734;","&#189;","&#188;","&#190;","&#178;","&#179;","&#8240;","&#182;","&#167;","&#945;","&#946;","&#916;","&#181;","&#937;","&#8721;","&#216;","&ang;","&#186;","&#171;","&raquo;","&#183;","&#8226;","&#8224;","&#8225;","&#402;"];
}
return this._symbols;
},set_symbols:function(_888){
this._symbols=_888;
},get_realFontSizes:function(){
if(null==this._realFontSizes){
return ["8px","9px","10px","11px","12px","13px","14px","16px","18px","20px","22px","24px","26px","28px","32px","36px","48px","72px"];
}
return this._realFontSizes;
},set_realFontSizes:function(_889){
this._realFontSizes=_889;
},get_contextMenus:function(){
if(null==this._contextMenus){
return [];
}
return this._contextMenus;
},set_contextMenus:function(_88a){
this._contextMenus=_88a;
},get_snippets:function(){
if(null==this._snippets){
return [];
}
return this._snippets;
},set_snippets:function(_88b){
this._snippets=_88b;
},get_cssClasses:function(){
if(null==this._cssClasses){
return [];
}
return this._cssClasses;
},set_cssClasses:function(_88c){
this._cssClasses=_88c;
},get_cssFiles:function(){
if(null==this._cssFiles){
return [];
}
return this._cssFiles;
},set_cssFiles:function(_88d){
this._cssFiles=_88d;
},get_languages:function(){
if(null==this._languages){
return [];
}
return this._languages;
},set_languages:function(_88e){
this._languages=_88e;
},get_paragraphs:function(){
if(null==this._paragraphs){
return [["<p>","Normal"],["<h1>","<h1>Heading 1</h1>"],["<h2>","<h2>Heading 2</h2>"],["<h3>","<h3>Heading 3</h3>"],["<h4>","<h4>Heading 4</h4>"],["<h5>","<h5>Heading 5</h5>"],["<h5>","<dir>Directory List</dir>"],["<menu>","<menu>Menu List</menu>"],["<pre>","<pre>Formatted</pre>"],["<address>","<address>Address</address>"]];
}
return this._paragraphs;
},set_paragraphs:function(_88f){
this._paragraphs=_88f;
},get_autoResizeHeight:function(){
return this._autoResizeHeight;
},set_autoResizeHeight:function(_890){
this._autoResizeHeight=_890;
},get_toolbarMode:function(){
return this._toolbarMode;
},set_toolbarMode:function(_891){
this._toolbarMode=_891;
},get_editModes:function(){
return this._editModes;
},set_editModes:function(_892){
this._editModes=_892;
},get_stripFormattingOptions:function(){
return this._stripFormattingOptions;
},set_stripFormattingOptions:function(_893){
this._stripFormattingOptions=_893;
},get_contentFilters:function(){
return this._contentFilters;
},set_contentFilters:function(_894){
this._contentFilters=_894;
},get_newLineBr:function(){
return this._newLineBr;
},set_newLineBr:function(_895){
this._newLineBr=_895;
},get_contentAreaCssFile:function(){
return this._contentAreaCssFile;
},set_contentAreaCssFile:function(_896){
this._contentAreaCssFile=_896;
},get_mozillaFlashOverlayImage:function(){
return this._mozillaFlashOverlayImage;
},set_mozillaFlashOverlayImage:function(_897){
this._mozillaFlashOverlayImage=_897;
},get_toolAdapterType:function(){
return this._toolAdapterType;
},set_toolAdapterType:function(_898){
this._toolAdapterType=_898;
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_899){
this._toolJSON=_899;
},get_modulesJSON:function(){
return this._modulesJSON;
},set_modulesJSON:function(_89a){
this._modulesJSON=_89a;
},get_contextMenusJSON:function(){
return this._contextMenusJSON;
},set_contextMenusJSON:function(_89b){
this._contextMenusJSON=_89b;
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_89c){
this._uniqueID=_89c;
},get_skin:function(){
if(!this._skin){
return "Default";
}
return this._skin;
},get_qualifiedSkin:function(){
var skin=this.get_skin();
return "radeditor."+skin;
},set_skin:function(_89e){
this._skin=_89e;
},_registerClientValidation:function(){
if(typeof (Page_ClientValidate)=="function"){
var _89f=Page_ClientValidate;
Page_ClientValidate=Function.createDelegate(this,function(_8a0){
var _8a1=this.get_element();
if(_8a1){
var _8a2=this.get_html(true);
this.set_contentHiddenTextareaValue(_8a2);
_8a1.value=_8a2;
_8a1.setAttribute("value",_8a2);
}
_8a1=null;
return _89f(_8a0);
});
}
},_registerPostBackHandlers:function(){
this._saveContentDelegate=Function.createDelegate(this,function(e){
this.raiseEvent("submit",Sys.EventArgs.Empty);
var _8a4=this.get_html(true);
this.set_contentHiddenTextareaValue(_8a4);
});
var _8a5=this._contentHiddenTextarea.form;
$telerik.addExternalHandler(_8a5,"submit",this._saveContentDelegate);
if(typeof (__doPostBack)!="undefined"){
var _8a6=this._saveContentDelegate;
var _8a7=__doPostBack;
__doPostBack=function(_8a8,_8a9){
_8a6();
_8a7(_8a8,_8a9);
};
}
if(typeof (Sys.WebForms)!="undefined"&&typeof (Sys.WebForms.PageRequestManager)!="undefined"){
var prm=Sys.WebForms.PageRequestManager.getInstance();
if(prm){
prm.add_initializeRequest(this._saveContentDelegate);
}
prm=null;
}
_8a5=null;
},toggleEnhancedEdit:function(_8ab){
if(!this.get_document()){
return false;
}
var _8ac=this.get_document().getElementById(this._getUniqueStyleSheetId(0));
if(_8ac){
if(_8ab==null){
_8ab=_8ac.disabled;
}
_8ac.disabled=!_8ab;
var tool=this.getToolByName("ToggleTableBorder");
if(tool){
tool.setOn(_8ab);
}
return _8ab;
}else{
return false;
}
},pasteHyperLink:function(_8ae,_8af){
if($telerik.isIE){
var sel=this.getSelectedElement();
if(sel.tagName=="IMG"&&sel.parentNode&&sel.parentNode.tagName=="A"){
var _8b1=sel.parentNode;
_8b1.parentNode.removeChild(_8b1);
}
if(sel.tagName=="IMG"){
_8ae.innerHTML=Telerik.Web.UI.Editor.Utils.getOuterHtml(sel);
}
}
if($telerik.isOpera){
var sel=this.getSelectedElement();
if(sel.tagName=="A"){
this.fire("Unlink");
}
}
if("DocumentManager"==_8af){
var _8b2=this.getSelection().getText();
if(""!=_8b2.trim()){
_8ae.innerHTML=_8b2;
}
}
var _8b3=Telerik.Web.UI.Editor.Utils.getOuterHtml(_8ae);
this.pasteHtml(_8b3,_8af);
},_saveTypedContent:function(_8b4,_8b5){
if(this._pendingTextTypeCmd){
this._pendingTextTypeCmd.update();
}
if(true!=_8b4){
this._pendingTextTypeCmd=null;
}
},_attachIEBodyHandlers:function(_8b6){
var body=null;
if(this._document&&this._document.body){
body=this._document.body;
}
if(!body){
return;
}
if(_8b6){
this._onResizeStartDelegate=Function.createDelegate(this,this._onResizeStart);
this._onResizeEndDelegate=Function.createDelegate(this,this._onResizeEnd);
this._onDropDelegate=Function.createDelegate(this,this._onDrop);
this._onDragEndDelegate=Function.createDelegate(this,this._onDragEnd);
this._onDragStartDelegate=Function.createDelegate(this,this._onDragStart);
this._onPasteDelegate=Function.createDelegate(this,this._onPaste);
this._onBeforePasteDelegate=Function.createDelegate(this,this._onBeforePaste);
$telerik.addExternalHandler(body,"resizestart",this._onResizeStartDelegate);
$telerik.addExternalHandler(body,"resizeend",this._onResizeEndDelegate);
$telerik.addExternalHandler(body,"drop",this._onDropDelegate);
$telerik.addExternalHandler(body,"dragend",this._onDragEndDelegate);
$telerik.addExternalHandler(body,"dragstart",this._onDragStartDelegate);
if(!this.isIE7){
$telerik.addExternalHandler(body,"paste",this._onPasteDelegate);
}else{
$telerik.addExternalHandler(body,"beforepaste",this._onBeforePasteDelegate);
}
}else{
if(this._onResizeStartDelegate){
$telerik.removeExternalHandler(body,"resizestart",this._onResizeStartDelegate);
}
if(this._onResizeEndDelegate){
$telerik.removeExternalHandler(body,"resizeend",this._onResizeEndDelegate);
}
if(this._onDropDelegate){
$telerik.removeExternalHandler(body,"drop",this._onDropDelegate);
}
if(this._onDragEndDelegate){
$telerik.removeExternalHandler(body,"dragend",this._onDragEndDelegate);
}
if(this._onDragStartDelegate){
$telerik.removeExternalHandler(body,"dragstart",this._onDragStartDelegate);
}
if(!this.isIE7){
if(this._onPasteDelegate){
$telerik.removeExternalHandler(body,"paste",this._onPasteDelegate);
}
}else{
if(this._onBeforePasteDelegate){
$telerik.removeExternalHandler(body,"beforepaste",this._onBeforePasteDelegate);
}
}
this._onResizeStartDelegate=null;
this._onResizeEndDelegate=null;
this._onDropDelegate=null;
this._onDragEndDelegate=null;
this._onDragStartDelegate=null;
this._onPasteDelegate=null;
this._onBeforePasteDelegate=null;
}
},_initEvents:function(){
var _8b8=this;
var _8b9=_8b8.fire;
_8b8.fire=function(_8ba,_8bb){
if(_8ba!="Copy"){
_8b8._saveTypedContent(true,"editor.fire "+_8ba+" executing");
}
_8b9.call(_8b8,_8ba,_8bb);
try{
if(_8ba=="Undo"&&!_8b8.isIE&&_8b8._document.body.toLowerCase().trim()=="<br>"){
_8b8._document.body.innerHTML="<br>";
}
}
catch(e){
}
};
this.attachEventHandler("onclick",function(e){
_8b8._saveTypedContent(false,"Saving typed content because of oclick (somewhere else)");
if(_8b8.getSelectionHtml()){
_8b8._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(_8b8.get_localization()["Typing"],_8b8.get_contentWindow());
_8b8.executeCommand(_8b8._pendingTextTypeCmd,false);
}
});
if(!this.isIE){
this.attachEventHandler("keypress",function(e){
if(_8b8._onKeyPressed(e)){
e.preventDefault();
return false;
}
});
this.attachEventHandler("click",function(e){
if(!_8b8.isFirefox){
return;
}
if(!_8b8.get_editable()){
return;
}
if("on"==_8b8._document["designMode"]){
window.setTimeout(function(){
_8b8.set_editable(true);
_8b8.setFocus();
},100);
}
});
}
this.attachEventHandler("keydown",function(e){
if(_8b8.isOpera){
return _8b8._onKeyDown(e);
}else{
_8b8._onKeyDown(e);
}
});
this.attachEventHandler("onmousedown",function(){
_8b8._saveTypedContent(false,"Saving typed content onmousedown");
});
this.attachEventHandler("keyup",Function.createDelegate(this,this._onKeyUp));
var _8c0=Function.createDelegate(this,function(e){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
});
this.attachEventHandler("mouseup",_8c0);
$telerik.addExternalHandler(document.body,"dragend",Function.createDelegate(this,this._onDocumentDragEnd));
this._attachIEBodyHandlers(true);
},_onKeyDown:function(e){
var _8c3=e.keyCode;
switch(_8c3){
case 46:
if($telerik.isOpera){
this._document.execCommand("Delete");
this.get_contentArea().contentEditable=true;
this._document.designMode="on";
this.get_contentArea().focus();
return $telerik.cancelRawEvent(e);
}
case 8:
this._shortcutHit=false;
if(this.getSelectionHtml()){
this._saveTypedContent(false,"Saving typed content before allowing delete to proceed..");
this._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(this.getLocalizedString("Typing"),this._contentWindow);
this._hasDeleteExecuted=true;
}
if(this.isIE){
var _8c4=this;
var _8c5=function(){
var _8c6=_8c4.getSelectedElement();
if(_8c6&&_8c6.tagName=="EMBED"){
_8c6.setAttribute("hidden","true");
_8c6.setAttribute("id","FileToDelete");
window.setTimeout(function(){
var _8c7=_8c4._document.getElementById("FileToDelete");
if(_8c7.parentNode&&_8c7.parentNode.removeChild){
_8c7.parentNode.removeChild(_8c7);
}
},100);
$telerik.cancelRawEvent(e);
return true;
}
};
var _8c8=_8c5();
if(_8c8){
return false;
}
try{
var _8c9=_8c4._document.selection.createRange();
var _8ca=null;
if(_8c9&&_8c9.duplicate){
_8ca=_8c9.duplicate();
}
if(8==e.keyCode){
_8c9.moveStart("character",-1);
}else{
_8c9.moveEnd("character",1);
}
if(_8c9.parentElement().tagName=="EMBED"){
_8c9.select();
_8c5();
if(_8ca&&_8ca.select){
_8ca.select();
}
}
}
catch(ex){
}
var _8cb=new Telerik.Web.UI.Editor.Selection(this._contentWindow);
if(_8cb&&_8cb.isControl()){
var _8cc=_8cb.getRange();
_8cc.execCommand("Delete");
$telerik.cancelRawEvent(e);
}
}
return;
}
var _8cd=e.target?e.target:e.srcElement;
if(_8cd&&"INPUT"!=_8cd.tagName){
var _8ce=this._shortCutManager.isShortCutHit(e);
if(null!=_8ce&&_8ce.get_name()=="Copy"){
this._shortcutHit=false;
return;
}
this._shortcutHit=(null!=_8ce);
if(this._shortcutHit){
this.fire(_8ce.get_name());
}else{
if(Telerik.Web.UI.Editor.Utils.isCursorMovingKey(e.keyCode)){
if(!this._hasCursorMoved){
this._saveTypedContent(false,"Saving typed content before letting the cursor move");
}
this._hasCursorMoved=true;
return;
}
if(32==e.keyCode||13==e.keyCode||!Telerik.Web.UI.Editor.Utils.isSystemKey(e.keyCode)){
if(this._hasCursorMoved){
this._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(this.getLocalizedString("Typing"),this._contentWindow);
this.executeCommand(this._pendingTextTypeCmd);
this._hasCursorMoved=false;
return;
}
if(!this._pendingTextTypeCmd){
this._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(this.getLocalizedString("Typing"),this._contentWindow);
this.executeCommand(this._pendingTextTypeCmd);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
}
}
if(this._shortcutHit){
if(this.isIE){
var name=_8ce.get_name();
if(name=="Cut"||name=="Paste"){
return;
}
e.keyCode=123;
e.returnValue=!this._shortcutHit;
}
}
}
},_onKeyUp:function(e){
if(this._hasDeleteExecuted){
if(this._pendingTextTypeCmd){
this.executeCommand(this._pendingTextTypeCmd);
}
this._pendingTextTypeCmd=null;
this._hasDeleteExecuted=false;
return;
}
if(this._pendingTextTypeCmd){
return;
}
if(this._pendingCutPasteCommand){
this.executeCommand(this._pendingCutPasteCommand);
this._pendingCutPasteCommand=null;
}
if(this._shortcutHit){
return false;
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
},_onKeyPressed:function(e){
if(this._pendingTextTypeCmd){
}else{
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
if(this._shortcutHit&&!this._pendingCutPasteCommand){
return true;
}
},_insertPastedContent:function(_8d2,_8d3,_8d4,_8d5){
var _8d6=this;
var _8d7=(this.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _8d8=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_8d3,_8d6.get_stripFormattingOptions(),_8d6.get_localization()["askwordcleaning"],_8d7);
if(_8d2){
_8d2.select();
}
if(_8d8){
window.setTimeout(function(){
if(_8d5&&_8d2){
_8d2.select();
}
_8d6.pasteHtml(_8d8);
},5);
return $telerik.cancelRawEvent(_8d4);
}
return true;
},_onPaste:function(_8d9){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _8da=this.createRestorePoint();
var _8db=this.getSelectionHtml()?true:false;
var _8dc=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
return this._insertPastedContent(_8da,_8dc,_8d9,_8db);
},_onBeforePaste:function(_8dd){
if(_8dd){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _8de=new Telerik.Web.UI.Editor.GenericCommand("Paste",this._contentWindow);
var _8df=this._document.getElementById("tmpPasteIE");
if(_8df){
_8df.removeAttribute("id");
return false;
}
var _8e0=this._document.selection.createRange();
var _8e1=Telerik.Web.UI.Editor.Utils.getUniqueID();
if(_8e0.pasteHTML){
_8e0.pasteHTML("&nbsp;<font id='"+_8e1+"'>&nbsp;</font>");
}
var _8e2=Telerik.Web.UI.Editor.Utils.getPasteContainer();
_8e2.innerHTML="";
_8e2.setActive();
var _8e3=this;
window.setTimeout(function(){
var _8e4=_8e2.innerHTML;
var _8e5=(_8e3.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _8e6=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_8e4,_8e3.get_stripFormattingOptions(),_8e3.get_localization()["askwordcleaning"],_8e5);
var _8e7=_8e3._document.getElementById(_8e1);
_8e3.setActive(true);
_8e3._pendingCutPasteCommand=null;
var _8e8=_8e3._document.body.createTextRange();
_8e8.moveToElementText(_8e7);
_8e8.moveStart("character",-1);
_8e8.select();
_8e8.pasteHTML(_8e6);
_8e3.executeCommand(_8de);
_8e3.setActive(true);
_8e3.setFocus(true);
},0);
}else{
}
},_onResizeStart:function(e){
var _8ea=this.getSelectedElement();
if(_8ea==e.srcElement){
var _8eb=this.get_localization()["ResizeCommand"]||"Resize";
this._pendingResizeCmd=new Telerik.Web.UI.Editor.GenericCommand(_8eb,this._contentWindow);
}
},_onResizeEnd:function(e){
if(this._pendingResizeCmd){
this.executeCommand(this._pendingResizeCmd);
}
},_onDragStart:function(e){
var _8ee=this.get_localization()["MoveCommand"]||"Move";
this._pendingMoveCommand=new Telerik.Web.UI.Editor.GenericCommand(_8ee,this.get_contentArea());
this._startRange=null;
if(!e.ctrlKey&&!e.ctrlLeft){
this._startRange=this._contentWindow.document.selection.createRange();
if(this._startRange.length){
var rng=this._contentWindow.document.body.createTextRange();
var _8f0=this._startRange.item(0);
if("IMG"==_8f0.tagName&&"A"==_8f0.parentNode.tagName&&_8f0.parentNode.childNodes.length==1){
_8f0=_8f0.parentNode;
}
rng.moveToElementText(_8f0);
this._startRange=rng;
}
}
},_onDragEnd:function(e){
if(this._pendingMoveCommand){
if(this._startRange){
var _8f2=this._contentWindow.document.selection.createRange();
if(_8f2.length){
var rng=this._contentWindow.document.body.createTextRange();
rng.moveToElementText(_8f2.item(0));
_8f2=rng;
}
try{
if(_8f2.compareEndPoints&&0!=_8f2.compareEndPoints("StartToStart",this._startRange)&&0!=_8f2.compareEndPoints("EndToEnd",this._startRange)){
this._startRange.execCommand("Delete",false,null);
}
}
catch(e){
}
}
this.executeCommand(this._pendingMoveCommand);
this._pendingMoveCommand=null;
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},_onDrop:function(e){
this._saveTypedContent(false,"on drop operation executing");
var _8f5=this.get_localization()["Drop"]||"Drop external content";
this._pendingDockCommand=new Telerik.Web.UI.Editor.GenericCommand(_8f5,this._contentWindow);
},_onDocumentDragEnd:function(e){
if(!this._pendingDockCommand){
return;
}
this.executeCommand(this._pendingDockCommand);
this._pendingDockCommand=null;
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
},add_toggleScreenMode:function(_8f7){
this.get_events().addHandler("toggleScreenMode",_8f7);
},remove_toggleScreenMode:function(_8f8){
this.get_events().removeHandler("toggleScreenMode",_8f8);
},add_modeChange:function(_8f9){
this.get_events().addHandler("modeChange",_8f9);
},remove_modeChange:function(_8fa){
this.get_events().removeHandler("modeChange",_8fa);
},add_load:function(_8fb){
this.get_events().addHandler("load",_8fb);
},remove_load:function(_8fc){
this.get_events().removeHandler("load",_8fc);
},add_init:function(_8fd){
this.get_events().addHandler("init",_8fd);
},remove_init:function(_8fe){
this.get_events().removeHandler("init",_8fe);
},add_selectionChange:function(_8ff){
this.get_events().addHandler("selectionChange",_8ff);
},remove_selectionChange:function(_900){
this.get_events().removeHandler("selectionChange",_900);
},add_commandExecuting:function(_901){
this.get_events().addHandler("commandExecuting",_901);
},remove_commandExecuting:function(_902){
this.get_events().removeHandler("commandExecuting",_902);
},add_commandExecuted:function(_903){
this.get_events().addHandler("commandExecuted",_903);
},remove_commandExecuted:function(_904){
this.get_events().removeHandler("commandExecuted",_904);
},add_submit:function(_905){
this.get_events().addHandler("submit",_905);
},remove_submit:function(_906){
this.get_events().removeHandler("submit",_906);
},add_editReady:function(_907){
this.get_events().addHandler("editReady",_907);
},remove_editReady:function(_908){
this.get_events().removeHandler("editReady",_908);
},add_pasteHtml:function(_909){
this.get_events().addHandler("pasteHtml",_909);
},remove_pasteHtml:function(_90a){
this.get_events().removeHandler("pasteHtml",_90a);
}};
Telerik.Web.UI.RadEditor.registerClass("Telerik.Web.UI.RadEditor",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.EditorToolType=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditorToolType.prototype={Button:1,DropDown:2,SplitButton:4,Separator:8,ToolStrip:16,Custom:32};
Telerik.Web.UI.EditorToolType.registerEnum("Telerik.Web.UI.EditorToolType",false);

