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;
return {x:this._browserLeft,y:this._browserTop};
},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="";
if(div.setActive){
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);
},setElementInnerHtml:function(_3f,_40){
var _41=$telerik.isIE?this.getStoredOriginalPathsAndAttributes(_40):_40;
_3f.innerHTML="<span>&nbsp;</span>"+_41;
_3f.removeChild(_3f.firstChild);
if($telerik.isIE){
this.restoreOriginalPathsAndAttributes(_3f);
}
},getStoredOriginalPathsAndAttributes:function(_42){
var _43=function(_44,g1,g2,g3,g4,g5,g6,_4b,_4c){
if(!g3){
g3="";
g4=g4+g6;
var _4d=g4.search(/(\s|>)/gi);
if(_4d>0){
g6=g4.substring(_4d,g4.length);
g4=g4.substring(0,_4d);
}else{
return _44;
}
}
return g1+" "+g2+"="+g3+g4+g3+" originalAttribute=\""+g2+"\" originalPath=\""+g4+"\""+g6;
};
var _4e=new RegExp("(<[^>]*?)\\s(href|src)\\s*=\\s*('|\")?(.+?)(\\3)([^<]*?>)","ig");
_42=_42.replace(_4e,_43);
var _4f=new RegExp("(<!--[\\s\\S]*?) originalAttribute=\"(href|src)\" originalPath=\"[^\"]+\"([\\s\\S]*?-->)","ig");
var _50=_42.length+1;
while(_42.length<_50){
_50=_42.length;
_42=_42.replace(_4f,"$1$3");
}
return _42;
},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));
_89.execCommand("styleWithCSS",false,(false==_8a));
}
catch(e){
}
var _8c=_89.execCommand(this.CommandID,false,this.Value);
try{
_89.execCommand("UseCSS",false,true);
_89.execCommand("styleWithCSS",false,false);
}
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);
}};
Telerik.Web.UI.Editor.TableCommandBase.registerClass("Telerik.Web.UI.Editor.TableCommandBase",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableInsertRow=function(_102,_103,_104){
Telerik.Web.UI.Editor.TableInsertRow.initializeBase(this,[(_102||"Insert row"),_103,true]);
this._direction=_104||"above";
};
Telerik.Web.UI.Editor.TableInsertRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertRow(this._title,this._window,this._direction);
},getState:function(_105){
return (this.getSelectedRow(_105)?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 _108=row.rowIndex;
if("below"==this._direction){
_108++;
}
var _109=this.getParentTable(row);
if(!_109){
return false;
}
var _10a=_109.insertRow(_108);
if(!_10a){
return false;
}
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(row,_10a);
var _10b;
for(var i=0;i<row.cells.length;i++){
cell=row.cells[i];
_10b=_10a.insertCell(-1);
_10b.colSpan=cell.colSpan;
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_10b);
_10b.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(_10d,_10e){
Telerik.Web.UI.Editor.TableDeleteRow.initializeBase(this,[(_10d||"Delete Row"),_10e,true]);
};
Telerik.Web.UI.Editor.TableDeleteRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableDeleteRow(this._title,this._window);
},getState:function(_10f){
return (this.getSelectedRow(_10f)?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(_111,_112,_113){
Telerik.Web.UI.Editor.TableInsertColumn.initializeBase(this,[(_111||"Insert column"),_112,true]);
this._direction=_113||"left";
};
Telerik.Web.UI.Editor.TableInsertColumn.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertColumn(this._title,this._window,this._direction);
},getState:function(_114){
return (this.getSelectedCell(_114)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _116=cell.cellIndex;
if("right"==this._direction){
_116++;
}
var _117=this.getParentTable(cell);
if(!_117){
return false;
}
var rows=_117.rows;
var _119;
for(var i=0;i<rows.length;i++){
_119=rows[i].insertCell(_116);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_119);
_119.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(_11b,_11c,_11d){
Telerik.Web.UI.Editor.TableDeleteColumn.initializeBase(this,[(_11b||"Delete column"),_11c,true]);
};
Telerik.Web.UI.Editor.TableDeleteColumn.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableDeleteColumn.New(this._title,this._window);
},getState:function(_11e){
return (this.getSelectedCell(_11e)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _120=cell.cellIndex;
var _121=this.getParentTable(cell);
if(!_121){
return false;
}
var rows=_121.rows;
for(var i=0;i<rows.length;i++){
cell=rows[i].cells[_120];
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(_124,_125){
Telerik.Web.UI.Editor.TableMergeRows.initializeBase(this,[(_124||"Merge rows"),_125,true]);
};
Telerik.Web.UI.Editor.TableMergeRows.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeRows.New(this._title,this._window);
},getState:function(_126){
var cell=this.getSelectedCell(_126);
if(null!=cell){
var _128=this.getLowerCell(cell);
if(null!=_128&&cell.colSpan==_128.colSpan){
return Telerik.Web.UI.Editor.CommandStates.Off;
}
}
return Telerik.Web.UI.Editor.CommandStates.Disabled;
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _12a=this.getLowerCell(cell);
if(!_12a){
return false;
}
if(""!=_12a.innerHTML){
if(""!=cell.innerHTML){
cell.innerHTML+="<br>";
}
cell.innerHTML+=_12a.innerHTML;
}
cell.rowSpan+=_12a.rowSpan;
var row=_12a.parentNode;
row.removeChild(_12a);
if(!row.cells||row.cells.length==0){
for(var i=cell.parentNode.cells.length-1;i>=0;i--){
var _12d=cell.parentNode.cells[i];
if(_12d.rowSpan>1){
_12d.rowSpan--;
}
}
row.parentNode.removeChild(row);
}
return true;
},getLowerCell:function(cell){
if(!cell){
return null;
}
var _12f=this.getParentTable(cell);
var row=cell.parentNode;
var _131=_12f.rows[row.rowIndex+cell.rowSpan];
if(!_131){
return null;
}
var _132=_131.cells[cell.cellIndex];
if(!_132){
for(var i=_131.cells.length-1;i>=0;i--){
if(_131.cells[i].offsetLeft==cell.offsetLeft){
return _131.cells[i];
}
}
}
return _132;
}};
Telerik.Web.UI.Editor.TableMergeRows.registerClass("Telerik.Web.UI.Editor.TableMergeRows",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeColumns=function(_134,_135){
Telerik.Web.UI.Editor.TableMergeColumns.initializeBase(this,[(_134||"Merge columns"),_135,true]);
};
Telerik.Web.UI.Editor.TableMergeColumns.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeColumns.New(this._title,this._window);
},getState:function(_136){
var cell=this.getSelectedCell(_136);
if(null!=cell&&null!=this.getNextSiblingCell(cell)){
return Telerik.Web.UI.Editor.CommandStates.Off;
}else{
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
},getNextSiblingCell:function(cell){
if(!cell){
return null;
}
var row=cell.parentNode;
var _13a=row.cells[cell.cellIndex+1];
if(null!=_13a&&cell.rowSpan==_13a.rowSpan){
return _13a;
}else{
return null;
}
},onExecute:function(){
var cell=this.getSelectedCell();
if(null==cell){
return false;
}
var _13c=this.getNextSiblingCell(cell);
if(!_13c){
return false;
}
cell.colSpan+=_13c.colSpan;
if(""!=_13c.innerHTML){
if(""!=cell.innerHTML){
cell.innerHTML+="<br>";
}
cell.innerHTML+=_13c.innerHTML;
}
_13c.parentNode.removeChild(_13c);
return true;
}};
Telerik.Web.UI.Editor.TableMergeColumns.registerClass("Telerik.Web.UI.Editor.TableMergeColumns",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableSplitCell=function(_13d,_13e){
Telerik.Web.UI.Editor.TableSplitCell.initializeBase(this,[(_13d||"Split cell"),_13e,true]);
};
Telerik.Web.UI.Editor.TableSplitCell.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableSplitCell(this._title,this._window);
},getState:function(_13f){
var cell=this.getSelectedCell(_13f);
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 _142=this.getParentTable(cell);
if(!_142){
return false;
}
var row=cell.parentNode;
var _144=("THEAD"==row.parentNode.tagName.toUpperCase()?"TH":"TD");
if(cell.colSpan>1){
var _145=this._window.document.createElement(_144);
_145.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_145);
_145.colSpan=1;
cell.colSpan--;
var _146=cell.nextSibling;
if(_146){
row.insertBefore(_145,_146);
}else{
row.appendChild(_145);
}
}
if(cell.rowSpan>1){
var _147=_142.rows[row.rowIndex+cell.rowSpan-1];
if(!_147){
return;
}
var _145=this._window.document.createElement(_144);
_145.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_145);
_145.rowSpan=1;
cell.rowSpan--;
var _146=_147.cells[this.getRealCellIndex(cell)];
if(_146){
_147.insertBefore(_145,_146);
}else{
_147.appendChild(_145);
}
}
return true;
},getRealCellIndex:function(cell){
if(!cell){
return 0;
}
var row=cell.parentNode;
var i=0;
var _14b=0;
while(row.cells.length>i&&row.cells[i]!=cell){
var _14c=row.cells[i];
if(_14c.colSpan>1){
_14b+=_14c.colSpan;
}else{
_14b++;
}
i++;
}
return _14b;
}};
Telerik.Web.UI.Editor.TableSplitCell.registerClass("Telerik.Web.UI.Editor.TableSplitCell",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteCell=function(_14d,_14e){
Telerik.Web.UI.Editor.TableDeleteCell.initializeBase(this,[(_14d||"Delete cell"),_14e,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(_150){
Telerik.Web.UI.EditorButton.initializeBase(this,[_150]);
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(_151,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 _155=_151.get_element();
ul.appendChild(_155);
li=document.createElement("LI");
li.innerHTML="&nbsp;";
li.className="rade_grip grip_last";
ul.appendChild(li);
return ul;
};
Telerik.Web.UI.EditorButton.getToolRootNode=function(_156){
while(_156&&_156.tagName!="LI"){
_156=_156.parentNode;
}
return _156;
};
Telerik.Web.UI.EditorButton._createButton=function(_157){
var _158=document.createElement("LI");
var a=document.createElement("A");
_158.appendChild(a);
a.className=_157.showText==true?"rade_tool_text":"rade_tool";
var text=_157["text"];
a.title=text?text:_157["name"];
a.href="#";
a.setAttribute("unselectable","on");
if(_157.showIcon!=false){
var span=document.createElement("SPAN");
span.className=_157.name;
span.innerHTML="&nbsp;";
span.setAttribute("unselectable","on");
a.appendChild(span);
}
if(_157.showText==true){
var span=document.createElement("SPAN");
span.className="rade_button_text";
span.innerHTML=_157.text?_157.text:_157.name;
span.setAttribute("unselectable","on");
a.appendChild(span);
}
return _158;
};
Telerik.Web.UI.EditorButton.createTool=function(_15c,_15d,type,_15f,_160){
if(!type){
type=Telerik.Web.UI.EditorButton;
}
if(!_15f){
_15f=Telerik.Web.UI.EditorButton._createButton(_15c);
if(type==Telerik.Web.UI.EditorSplitButton||type.inheritsFrom(Telerik.Web.UI.EditorSplitButton)){
var a=_15f.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=_15f.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 _163=_15c["width"]?_15c["width"]:"50px";
span.style.width=_163;
a.appendChild(span);
}
}
}
}
var tool=$create(type,_15c,_15d,null,_15f);
if(_160&&_160.appendChild){
_160.appendChild(_15f);
}
return tool;
};
Telerik.Web.UI.EditorButton.prototype={initialize:function(){
var _165=this.getAnchorElement();
if(_165){
if(!_165.title||_165.title.length==0){
_165.title=this.get_text();
}
_165.setAttribute("unselectable","on");
}
var span=this.getSpanElement();
if(span){
span.setAttribute("unselectable","on");
}
if(this._addClickHandler){
var _167=this.get_element();
$addHandlers(_167,{"click":this.click},this);
}
},dispose:function(){
var _168=this.get_element();
if(_168){
$clearHandlers(_168);
}
Telerik.Web.UI.EditorButton.callBaseMethod(this,"dispose");
},click:function(e){
this.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(e);
},add_valueSelected:function(_16a){
this.get_events().addHandler("valueSelected",_16a);
},remove_valueSelected:function(_16b){
this.get_events().removeHandler("valueSelected",_16b);
},raiseEvent:function(_16c,_16d){
var _16e=this.get_events().getHandler(_16c);
if(_16e){
if(!_16d){
_16d=Sys.EventArgs.Empty;
}
_16e(this,_16d);
}
},set_width:function(_16f){
var span=this.getSpanElement();
if(span){
span.style.width=_16f;
}
},get_width:function(){
return this.get_element().offsetWidth;
},set_height:function(_171){
var span=this.getSpanElement();
if(span){
span.style.height=_171;
}
},get_height:function(){
return this.get_element().offsetHeight;
},isTarget:function(e){
return $telerik.isDescendantOrSelf(this.get_element(),e.target);
},setState:function(_174){
this.set_enabled(_174!=Telerik.Web.UI.Editor.CommandStates.Disabled);
this.setOn(_174==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(_176){
this._addClickHandler=_176;
},get_attributes:function(){
return this._attributes;
},set_attributes:function(_177){
this._attributes=_177;
},get_autoPostBack:function(){
return this._autoPostBack;
},set_autoPostBack:function(_178){
this._autoPostBack=_178;
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_179){
if(this._enabled!=_179){
this._enabled=_179;
var _17a=this.getAnchorElement();
if(!this._enabled){
this._addAnchorCssClass("rade_tool_disabled");
_17a.setAttribute("disabled","disabled");
}else{
this._removeAnchorCssClass("rade_tool_disabled");
_17a.removeAttribute("disabled");
}
}
},isOn:function(){
return this._isOn;
},setOn:function(_17b){
if(this._isOn!=_17b){
this._isOn=_17b;
if(this._isOn){
this._addAnchorCssClass("rade_tool_selected");
}else{
this._removeAnchorCssClass("rade_tool_selected");
}
}
},get_name:function(){
return this._name;
},set_name:function(_17c){
this._name=_17c;
},get_text:function(){
if(!this._text){
return this.get_name();
}else{
return this._text;
}
},set_text:function(_17d){
if(this._text!=_17d){
this._text=_17d;
if(this.get_showText()){
this.getSpanElement().innerHTML=_17d;
}
}
},get_shortCut:function(){
return this._shortCut;
},set_shortCut:function(_17e){
this._shortCut=_17e;
},get_showIcon:function(){
return this._showIcon;
},set_showIcon:function(_17f){
if(this._showIcon!=_17f){
this._showIcon=_17f;
}
},get_skin:function(){
return this._skin;
},set_skin:function(_180){
this._skin=_180;
},_addAnchorCssClass:function(_181){
Sys.UI.DomElement.addCssClass(this.getAnchorElement(),_181);
},_removeAnchorCssClass:function(_182){
Sys.UI.DomElement.removeCssClass(this.getAnchorElement(),_182);
},get_showText:function(){
return this._showText;
},set_showText:function(_183){
if(this._showText!=_183){
this._showText=_183;
}
},get_type:function(){
return this._type;
},set_type:function(_184){
this._type=_184;
},get_clientTypeName:function(){
return this._clientTypeName;
},set_clientTypeName:function(_185){
this._clientTypeName=_185;
},getAnchorElement:function(){
var _186=this.get_element().firstChild;
while(_186!=null&&(_186.tagName==null)){
_186=_186.nextSibling;
}
return _186;
},getSpanElement:function(){
var _187=this.getAnchorElement();
var _188=_187.firstChild;
while(_188!=null&&(_188.tagName==null||_188.tagName.toLowerCase()!="span")){
_188=_188.nextSibling;
}
return _188;
}};
Telerik.Web.UI.EditorButton.registerClass("Telerik.Web.UI.EditorButton",Sys.UI.Control);
Telerik.Web.UI.EditorSpinBoxEventArgs=function(_189,_18a){
Telerik.Web.UI.EditorSpinBoxEventArgs.initializeBase(this);
this._newValue=_189;
this._oldValue=_18a;
};
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(_18b){
Telerik.Web.UI.EditorSpinBox.initializeBase(this,[_18b]);
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._createControls();
},_createControls:function(){
var _18c=document.createElement("table");
_18c.cellSpacing=0;
_18c.cellPadding=0;
_18c.className=this.get_visibleInput()?this._className:"rade_TableWizardSpinBox";
_18c.insertRow(-1);
var _18d=_18c.rows[0].insertCell(-1);
var _18e=document.createElement("INPUT");
_18e.className="radfd_skipme";
_18e.type="text";
_18e.onclick=function(e){
this.focus();
};
_18e.onkeypress=Function.createDelegate(this,this._onKeyPressHandler);
_18e.onchange=Function.createDelegate(this,this._onChangeHandler);
this._inputElement=_18e;
_18d.appendChild(_18e);
if(!this.get_visibleInput()){
this.set_visibleInput(false);
}
if(this.get_visibleInput()){
_18d=_18c.rows[0].insertCell(-1);
var _190=document.createElement("table");
_190.cellSpacing=0;
_190.cellPadding=0;
_190.insertRow(-1);
var _191=_190.rows[0].insertCell(-1);
var _192=this._createAnchorElement("Increase");
this._increaseButton=_192;
_191.appendChild(_192);
_190.insertRow(-1);
_191=_190.rows[1].insertCell(-1);
_192=this._createAnchorElement("Decrease");
this._decreaseButton=_192;
_191.appendChild(_192);
_18d.appendChild(_190);
}else{
_18d=_18c.rows[0].insertCell(-1);
var _192=this._createAnchorElement_noinput("Increase");
this._increaseButton=_192;
_18d.appendChild(_192);
_18d=_18c.rows[0].insertCell(-1);
_192=this._createAnchorElement_noinput("Decrease");
this._decreaseButton=_192;
_18d.appendChild(_192);
}
var _193=this.get_element();
_193.appendChild(_18c);
_193.style.width=this.get_width();
},_createAnchorElement:function(_194){
var _195=document.createElement("A");
_195.title=_194;
_195.href="javascript:void(0);";
_195.innerHTML=_194;
_195.className="rade_SpinBox"+_194;
_195.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
return _195;
},_createAnchorElement_noinput:function(_196){
var _197=document.createElement("A");
_197.title=_196;
_197.href="javascript:void(0);";
_197.innerHTML="<span class='rade_TableWizardSpinBox_"+_196+"'>"+_196+"</span>";
_197.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
return _197;
},_executeFunction:function(e,elem,_19a){
if(_19a){
if(elem.Executed){
elem.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
elem.Executed=true;
var _19b=(this._selectedItem!="")?this._selectedItem:this._initialValue;
this._selectedItem=elem.value;
var _19c=new Telerik.Web.UI.EditorSpinBoxEventArgs(elem.value,_19b);
this.raiseEvent("valueSelected",_19c);
},_onPlusMinusClickHandler:function(e){
var _19e=null;
if(!e){
_19e=window.event.srcElement;
}else{
_19e=e.target;
}
while(_19e&&_19e.tagName.toLowerCase()!="a"){
_19e=_19e.parentNode;
}
if(!_19e){
return;
}
var _19f=this.get_value();
_19f=_19f.replace(/^0+(\d)/ig,"$1");
if(""==_19f){
_19f="0";
}
var _1a0=parseInt(_19f);
var _1a1=_1a0+"";
if(isNaN(_1a0)){
return;
}else{
_1a1=_19f.substring(_1a1.length);
}
if(_19e==this._increaseButton){
if(this._enabledIncrease){
_1a0++;
}else{
return;
}
}else{
if(_19e==this._decreaseButton){
if(this._enabledDecrease){
_1a0--;
}else{
return;
}
}else{
_19e=null;
}
}
if(_19e){
this.set_value(_1a0+_1a1);
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 _1a6=this._selectedItem;
var _1a7=this.get_value();
var _1a8=new Telerik.Web.UI.EditorSpinBoxEventArgs(_1a7,_1a6);
this.raiseEvent("valueSelected",_1a8);
}
},_isKeyValid:function(e,_1aa){
try{
if(!_1aa){
_1aa=false;
}
if(!e){
e=window.event;
}
var _1ab=((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(!_1aa){
_1ab|=((35<=e.keyCode&&e.keyCode<=40));
}
return _1ab;
}
catch(ex){
return true;
}
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1ac){
if(null==_1ac){
_1ac="";
}
this._inputElement.value=_1ac;
if(this._initialValue==""){
this._initialValue=_1ac;
}
},get_width:function(){
return this._width;
},set_width:function(_1ad){
this._width=_1ad;
var _1ae=this.get_element();
_1ae.style.width=this._width;
},get_enabledIncrease:function(){
return this._enabledIncrease;
},set_enabledIncrease:function(_1af){
this._enabledIncrease=_1af;
this._setButtonState(this._increaseButton,_1af);
},get_enabledDecrease:function(){
return this._enabledDecrease;
},set_enabledDecrease:function(_1b0){
this._enabledDecrease=_1b0;
this._setButtonState(this._decreaseButton,_1b0);
},_setButtonState:function(_1b1,_1b2){
if(!_1b2){
Sys.UI.DomElement.addCssClass(_1b1,"disabled-button");
}else{
Sys.UI.DomElement.removeCssClass(_1b1,"disabled-button");
}
},get_visibleInput:function(){
return this._visibleInput;
},set_visibleInput:function(_1b3){
this._visibleInput=_1b3;
if(this._inputElement){
if(!this._visibleInput){
this._inputElement.style.display="none";
}else{
this._inputElement.style.display="";
}
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1b4){
this._clientStateFieldID=_1b4;
}};
Telerik.Web.UI.EditorSpinBox.registerClass("Telerik.Web.UI.EditorSpinBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorCheckBox=function(_1b5){
Telerik.Web.UI.EditorCheckBox.initializeBase(this,[_1b5]);
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(_1b6){
if(this._inputElement.checked!=_1b6){
this._inputElement.checked=_1b6;
}
},initialize:function(){
var _1b7=document.createElement("INPUT");
_1b7.setAttribute("type","CHECKBOX");
_1b7.Parent=this;
_1b7.onclick=function(e){
var oP=this.Parent;
oP._selectedItem=!oP._selectedItem;
this.checked=oP._selectedItem;
oP._selectedItem=this.checked;
oP.raiseEvent("valueSelected");
};
this._inputElement=_1b7;
this.get_element().appendChild(_1b7);
}};
Telerik.Web.UI.EditorCheckBox.registerClass("Telerik.Web.UI.EditorCheckBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorTextBox=function(_1ba){
Telerik.Web.UI.EditorTextBox.initializeBase(this,[_1ba]);
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(_1bb){
this._width=_1bb;
},initialize:function(){
var _1bc=document.createElement("INPUT");
_1bc.style.width=this.get_width();
_1bc.Parent=this;
var _1bd=this.get_name();
var _1be=function(e,elem,_1c1){
if(_1c1){
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);
};
_1bc.onchange=function(e){
if(!e){
e=window.event;
}
return _1be(e,this,true);
};
_1bc.onclick=function(e){
this.focus();
};
_1bc.onkeypress=function(e){
if(!e){
e=window.event;
}
if(e.keyCode==13){
return _1be(e,this);
}
};
this._inputElement=_1bc;
this.get_element().appendChild(_1bc);
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1c5){
if(null==_1c5){
_1c5="";
}
this._inputElement.value=_1c5;
}};
Telerik.Web.UI.EditorTextBox.registerClass("Telerik.Web.UI.EditorTextBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.ImageDialogCaller=function(_1c6){
Telerik.Web.UI.ImageDialogCaller.initializeBase(this,[_1c6]);
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 _1c7=this.get_element();
_1c7.style.width=parseInt(this._inputElement.style.width)+30+"px";
_1c7.className=(this.get_skin()+" "+this._className);
},_createInputElement:function(){
var _1c8=document.createElement("INPUT");
_1c8.style.width=this.get_width();
this._inputElement=_1c8;
this.get_element().appendChild(_1c8);
},_createButton:function(){
var _1c9=document.createElement("A");
_1c9.title="Call Image Manager";
_1c9.href="javascript:void(0);";
_1c9.onclick=Function.createDelegate(this,this._onButtonClickHandler);
_1c9.innerHTML="<span>...</span>";
this.get_element().appendChild(_1c9);
this._pushButton=_1c9;
},_onButtonClickHandler:function(e){
var _1cb=this;
var _1cc=function(_1cd,args){
var src="";
var img=args.Result;
if(img){
src=img.getAttribute("src",2);
}
if(src){
_1cb._inputElement.value=src;
_1cb.raiseEvent("valueSelected");
}
};
var args={editor:this.get_editor()};
this._editor.showDialog("ImageManager",args,_1cc);
},get_editor:function(){
return this._editor;
},set_editor:function(_1d2){
this._editor=_1d2;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1d3){
if(null==_1d3){
_1d3="";
}
this._inputElement.value=_1d3;
},get_width:function(){
return this._width;
},set_width:function(_1d4){
this._width=_1d4;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1d5){
this._clientStateFieldID=_1d5;
}};
Telerik.Web.UI.ImageDialogCaller.registerClass("Telerik.Web.UI.ImageDialogCaller",Telerik.Web.UI.EditorButton);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorDropDown=function(_1d6){
Telerik.Web.UI.EditorDropDown.initializeBase(this,[_1d6]);
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 _1d8=false;
if(!this._rendered){
this.render();
_1d8=true;
}
this.raiseEvent("show");
if(!this._childrenRendered){
this.renderChildren();
this._childrenRendered=true;
_1d8=true;
}
if(_1d8){
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 _1da=this.resolveActiveIndex(e);
if(_1da>-1){
this.set_activeIndex(_1da,e);
}
this._cancelEvent(e);
},_cancelEvent:function(e){
if(e){
e.preventDefault();
e.stopPropagation();
e.returnValue=false;
e.cancelBubble=true;
}
},_onPopupClick:function(e){
var _1dd=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_1dd>-1){
this._selectedIndex=_1dd;
this.hide();
this.raiseEvent("valueSelected");
}
},get_activeIndex:function(){
return this._activeIndex;
},set_activeIndex:function(_1de,e){
this._activeIndex=_1de;
this.selectUIItem(e);
},selectPreviousItem:function(){
var _1e0=this.get_activeIndex();
if(_1e0-1>=0){
this.set_activeIndex(_1e0-1);
}
},selectNextItem:function(){
var _1e1=this.get_activeIndex();
if(_1e1+1<this._items.length){
this.set_activeIndex(_1e1+1);
}
},selectUIItem:function(e,_1e3){
if(!this._popupElement){
return;
}
var _1e4=this._popupElement.getElementsByTagName("TD");
var len=_1e4.length;
var _1e6=this.get_activeIndex();
var _1e7=null;
for(var i=0;i<len;i++){
var _1e9=_1e4[i];
if(_1e9.item_index==_1e6){
_1e9.className="rade_itemOver";
_1e7=_1e9;
}else{
if(_1e3&&_1e9.item_index<=_1e6){
_1e9.className="rade_itemOver";
}else{
_1e9.className="";
}
}
}
if(_1e7&&!e){
this._scrollIntoView(_1e7,_1e7.parentNode.parentNode.parentNode.parentNode);
}
return _1e7;
},_scrollIntoView:function(_1ea,_1eb){
if($telerik.isIE||!_1eb){
var _1ec=_1eb;
_1ec.scrollTop=0;
var _1ed=_1ec.getClientRects()[0];
var _1ee=_1ed.top;
var _1ef=_1ed.bottom;
var _1f0=_1ea.getClientRects()[0].bottom;
if(_1f0==0){
return;
}
while(_1f0>_1ef||_1f0<_1ee){
var _1f1="down";
if(_1f0<_1ee){
_1f1="up";
}
_1ec.doScroll(_1f1);
_1f0=_1ea.getClientRects()[0].bottom;
}
}else{
if(_1ea.scrollIntoView){
_1ea.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 _1f2=this._itemRootElement;
this.renderItemRoot();
_1f2.parentNode.replaceChild(this._itemRootElement,_1f2);
}
},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 _1f3=this._itemRootElement.rows[this._itemRootElement.rows.length-1];
var cell=_1f3.insertCell(-1);
return cell;
},renderChildren:function(){
for(var i=0;i<this._items.length;i++){
if(0==(i%this._itemsPerRow)){
this.renderNewRow();
}
var _1f6=this.renderItemContainer();
this.markItemContainer(_1f6,i);
this.renderChild(_1f6,this._items[i],i);
}
},renderChild:function(_1f7,_1f8,_1f9){
var _1fa=document.createElement("span");
if(_1f8){
var _1fb=null;
var _1fc=null;
if(_1f8 instanceof Array){
_1fb=_1f8[1];
_1fc=_1f8[2];
}else{
_1fb=_1f8;
}
if(_1fc){
var _1fd=document.createElement("span");
_1fd.innerHTML="&nbsp;";
_1fd.className=_1fc;
_1fa.appendChild(_1fd);
}
if(_1fb){
_1fa.innerHTML+=_1fb;
_1fa.noWrap=true;
}
}
_1f7.innerHTML=_1fa.innerHTML;
},resolveActiveIndex:function(e){
var _1ff=e.target;
var _200=-1;
while(_1ff&&_1ff!=this._itemRootElement){
if(null!=_1ff.item_index){
_200=_1ff.item_index;
break;
}
_1ff=_1ff.parentNode;
}
return _200;
},markItemContainer:function(_201,_202){
_201.item_index=_202;
},_makeAllItemsUnselectable:function(){
if(!this._popupElement){
return;
}
this._popupElement.setAttribute("unselectable","on");
var _203=this._popupElement.getElementsByTagName("*");
var len=_203.length;
for(var i=0;i<len;i++){
_203[i].unselectable="on";
}
},_show:function(){
this.configurePopupPropertiesBeforeShow();
var _206=this._popupElement;
var _207=this.get_sizetofit();
var _208=_206.style.overflow;
if(_207){
_206.style.overflowY="hidden";
}
_206.style.width=this.get_popupwidth();
_206.style.height=this.get_popupheight();
this._itemRootElement.style.width="100%";
this._popupBehavior.show();
if(_207){
_206.style.width=this._getPopupChildrenWidth();
var _209=this._getPopupChildrenHeight();
if(_209!="0px"){
_206.style.height=_209;
}
}
this._popupBehavior.show();
this._getPopupVisibilityController().set_activePopup(this);
_206.style.zIndex="100000";
if(_207){
_206.style.overflowY=_208;
}
this._popupVisible=true;
},_getPopupChildrenWidth:function(){
var _20a=this.get_popupElement().childNodes;
var _20b=0;
for(var i=0;i<_20a.length;i++){
var _20d=_20a[i].offsetWidth;
if(_20d&&_20d>_20b){
_20b=_20d;
}
}
return _20b+"px";
},_getPopupChildrenHeight:function(){
var _20e=this.get_popupElement().childNodes;
var _20f=0;
for(var i=0;i<_20e.length;i++){
if(_20e[i].offsetHeight){
_20f+=_20e[i].offsetHeight;
}
}
return _20f+"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 _211=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_211;
},_createUI:function(){
if(this._popupBehavior){
return;
}
var _212=this.get_element();
if(!this._popupElement){
var _213=document.createElement("DIV");
$telerik.addCssClasses(_213,[this.get_skin(),this._rootPopupClassName,this.get_popupclassname()]);
this._popupElement=_213;
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":_212},null,null,this._popupElement);
this.attachEventHandlers();
},_getTable:function(){
var _214=document.createElement("table");
_214.border=0;
_214.cellPadding=0;
_214.setAttribute("unselectable","on");
_214.style.cursor="default";
return _214;
},get_clearSelectedOnShow:function(){
return this._clearSelectedOnShow;
},set_clearSelectedOnShow:function(_215){
this._clearSelectedOnShow=_215;
},get_popupElement:function(){
return this._popupElement;
},get_selectedItem:function(){
if(this._items&&this._selectedIndex>-1){
var item=this._items[this._selectedIndex];
var _217=((true==this._isArrayCollection)||(item instanceof Array))?item[0]:item;
return _217;
}
return null;
},get_selectedIndex:function(){
return this._selectedIndex;
},set_selectedIndex:function(_218){
this._selectedIndex=_218;
this.set_activeIndex(_218);
},get_items:function(){
return this._items;
},set_items:function(_219){
this.disposeChildren();
this._items=_219;
},get_itemsperrow:function(){
return this._itemsPerRow;
},set_itemsperrow:function(_21a){
this._itemsPerRow=_21a;
},get_sizetofit:function(){
return this._sizeToFit;
},set_sizetofit:function(_21b){
this._sizeToFit=_21b;
},get_popupclassname:function(){
return this._popupClassName;
},set_popupclassname:function(_21c){
this._popupClassName=_21c;
},get_rootpopupclassname:function(){
return this._rootPopupClassName;
},set_rootpopupclassname:function(_21d){
this._rootPopupClassName=_21d;
},get_popupwidth:function(){
return this._popupWidth;
},set_popupwidth:function(_21e){
this._popupWidth=_21e;
},get_popupheight:function(){
return this._popupHeight;
},set_popupheight:function(_21f){
this._popupHeight=_21f;
},add_show:function(_220){
this.get_events().addHandler("show",_220);
},remove_show:function(_221){
this.get_events().removeHandler("show",_221);
},add_hide:function(_222){
this.get_events().addHandler("hide",_222);
},remove_hide:function(_223){
this.get_events().removeHandler("hide",_223);
}};
Telerik.Web.UI.EditorDropDown.registerClass("Telerik.Web.UI.EditorDropDown",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorUpdateableDropDown=function(_224){
Telerik.Web.UI.EditorUpdateableDropDown.initializeBase(this,[_224]);
};
Telerik.Web.UI.EditorUpdateableDropDown.prototype={updateValue:function(oVal){
if(null==oVal){
return;
}
try{
if(!oVal){
oVal=this.get_text();
}
var _226=this.getSpanElement();
if(_226){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_226.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(_228){
Telerik.Web.UI.EditorSelfUpdateableDropDown.initializeBase(this,[_228]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSelfUpdateableDropDown.prototype={_onPopupClick:function(e){
var _22a=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_22a>-1){
this._selectedIndex=_22a;
this.hide();
var _22b=this.get_selectedItem();
if(_22b){
this.updateValue(_22b);
}
this.raiseEvent("valueSelected");
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_22c){
this._clientStateFieldID=_22c;
}};
Telerik.Web.UI.EditorSelfUpdateableDropDown.registerClass("Telerik.Web.UI.EditorSelfUpdateableDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorSplitButton=function(_22d){
Telerik.Web.UI.EditorSplitButton.initializeBase(this,[_22d]);
};
Telerik.Web.UI.EditorSplitButton.prototype={click:function(e){
var _22f=this.isArrowClicked(e.target);
if(_22f){
this.show();
}else{
var _230=this.get_selectedItem();
if(null==_230){
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(_231){
var _232=this._getArrowElement();
if(_231==_232){
return true;
}
return false;
},_getArrowElement:function(){
var _233=this.getAnchorElement().getElementsByTagName("SPAN");
var _234=_233[_233.length-1];
return _234;
}};
Telerik.Web.UI.EditorSplitButton.registerClass("Telerik.Web.UI.EditorSplitButton",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorToolStrip=function(_235){
Telerik.Web.UI.EditorToolStrip.initializeBase(this,[_235]);
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(_23b){
Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"set_selectedIndex",[_23b]);
if(this.get_updateHeader()){
var tool=this.get_selectedItem();
if(!tool||!tool.getSpanElement){
return;
}
var span=tool.getSpanElement();
if(span){
var _23e=span.cloneNode(true);
var _23f=this.getSpanElement();
var _240=_23f.parentNode;
_240.replaceChild(_23e,_23f);
var _241=tool.getAnchorElement();
if(_241){
_240.setAttribute("title",_241.getAttribute("title"));
}
}
}
},_onPopupClick:function(e){
var tool=this._resolveSelectedTool(e);
this._cancelEvent(e);
if(tool){
var _244=Array.indexOf(this._items,tool);
if($telerik.isSafari){
this._selectedIndex=_244;
this.set_activeIndex(_244);
}else{
this.set_selectedIndex(_244);
}
this.hide();
this.raiseEvent("valueSelected");
}
},renderItemRoot:function(){
var _245=document.createElement("DIV");
_245.className="rade_tlbVertical";
_245.style.cssFloat="left";
_245.style.width="100%";
this._itemRootElement=_245;
return this._itemRootElement;
},renderChildren:function(){
var _246=this.get_itemsperrow();
var _247=this.get_tools();
var ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
for(var i=0;i<_247.length;i++){
if(_246>1&&i>1&&(i%this.get_itemsperrow()==0)){
ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
}
var _24a=_247[i];
if(null==_24a["showText"]){
_24a["showText"]=true;
}
var tool=Telerik.Web.UI.EditorButton.createTool(_24a,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(_24f){
this._tools=_24f;
},get_updateHeader:function(){
return this._udpateHeader;
},set_updateHeader:function(_250){
this._udpateHeader=_250;
}};
Telerik.Web.UI.EditorToolStrip.registerClass("Telerik.Web.UI.EditorToolStrip",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.EditorContextMenu=function(_251){
Telerik.Web.UI.EditorContextMenu.initializeBase(this,[_251]);
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 _252=this._popupBehavior;
_252.set_positioningMode(Telerik.Web.PositioningMode.Absolute);
var _253=this.get_parentElement();
if(_253){
_252.set_parentElement(_253);
}
var e=this._eventObject;
if(e){
_252.set_x(e.clientX+10);
_252.set_y(e.clientY+10);
}
},set_eventObject:function(_255){
this._eventObject=_255;
},get_tagName:function(){
return this._tagName;
},set_tagName:function(_256){
this._tagName=_256;
},get_parentElement:function(){
return this._parentElement;
},set_parentElement:function(_257){
this._parentElement=_257;
}};
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(_258){
Telerik.Web.UI.Editor.AlignmentSelector.initializeBase(this,[_258]);
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(_259){
switch(_259.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(_25a){
if(!this._rendered){
this.render();
}
var _25b=this._itemRootElement;
var _25c=0;
for(var i=0;i<_25b.rows.length;i++){
var _25e=false;
for(var j=0;j<_25b.rows[i].cells.length;j++){
var cell=_25b.rows[i].cells[j];
var _261=this._isAvailable(_25c++);
cell.style.visibility=_261?"visible":"hidden";
_25e|=_261;
}
if(null!=document.all){
_25b.rows[i].style.display=_25e?"":"none";
}
}
},_isAvailable:function(_262){
var _263=false;
if(this._items){
var _264=this._items[_262];
_263=((null!=_264)&&(""!=_264[0]||""!=_264[1]));
}
return _263;
},renderChild:function(_265,_266,_267){
var _268=document.createElement("div");
if(_266){
_268.innerHTML="&nbsp;";
_268.className=this._alignmentClassName[_267];
}
_265.appendChild(_268);
},_onDropDownValueSelected:function(){
this.set_selectedIndex(this.get_selectedIndex());
},_selectAlignment:function(_269,_26a){
_269=(""==_269||!_269)?"none":_269.toUpperCase();
_26a=!_26a?"":_26a.toUpperCase();
if(this._items){
var _26b=-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==_26b){
_26b=i;
}
if((_269==ha||_269==va)&&(_26a==ha||_26a==va)){
this.set_selectedIndex(i);
return;
}
}
}
this.set_selectedIndex(_26b);
}
},set_selectedIndex:function(_26e){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"set_selectedIndex",[_26e]);
var span=this.getSpanElement();
var _270=this._alignmentClassName[_26e];
span.className=_270;
},setTagName:function(_271){
this._tagName=_271;
this._items=this._getLookupTableByTagName(this._tagName);
this.set_selectedIndex(this._noAlignmentIndex);
},updateValue:function(_272,_273){
this._selectAlignment(_272,_273);
},getAlign:function(){
var _274=this._items[this._selectedIndex];
var _275=(_274?_274[0]:"");
if("none"==_275){
_275="";
}
return _275;
},getVAlign:function(){
var _276=this._items[this._selectedIndex];
var _277=(_276?_276[1]:"");
if("none"==_277){
_277="";
}
return _277;
},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(_278){
this._clientStateFieldID=_278;
}};
Telerik.Web.UI.Editor.AlignmentSelector.registerClass("Telerik.Web.UI.Editor.AlignmentSelector",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.InsertTableHelper=function(_279){
Telerik.Web.UI.Editor.InsertTableHelper.initializeBase(this,[_279]);
};
Telerik.Web.UI.Editor.InsertTableHelper.prototype={initialize:function(){
var _27a=new Array(this.get_itemsperrow()*this.get_itemsperrow());
for(var i=0;i<_27a.length;i++){
_27a[i]=i;
}
this._items=_27a;
},hide:function(){
},renderChild:function(_27c,_27d,_27e){
var oDiv=document.createElement("div");
oDiv.innerHTML="&nbsp;";
_27c.appendChild(oDiv);
var dim=this._getDimensionByIndex(_27e);
_27c.setAttribute("title"," "+dim.rows+" x "+dim.cols+" ");
},_getDimensionByIndex:function(_281){
var _282=0;
var _283=0;
var _284=this.get_itemsperrow();
for(var i=0;i<this._items.length;i++){
if(i%_284==0){
_282++;
_283=0;
}
_283++;
if(_281==i){
break;
}
}
var obj={rows:_282,cols:_283};
return obj;
},get_selectedItem:function(){
var _287=this.get_selectedIndex();
return this._getDimensionByIndex(_287);
},selectUIItem:function(e,_289){
var _28a=this._popupElement.getElementsByTagName("TD");
var len=_28a.length;
var _28c=this.get_activeIndex();
var dim=this._getDimensionByIndex(_28c);
var cols=dim.cols;
for(var i=0;i<len;i++){
var _290=_28a[i];
var _291=_290.item_index;
if(_291<=_28c&&_290.cellIndex<cols){
_290.className="rade_itemOver";
}else{
_290.className="";
}
}
}};
Telerik.Web.UI.Editor.InsertTableHelper.registerClass("Telerik.Web.UI.Editor.InsertTableHelper",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.Editor.InsertTable=function(_292){
Telerik.Web.UI.Editor.InsertTable.initializeBase(this,[_292]);
};
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 _293=this.get_tools();
this._longTool=_293[0];
Array.removeAt(_293,0);
for(var i=0;i<_293.length;i++){
_293[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 _298={"valueSelected":this._onTableHelperValueSelectedDelegate};
var tool=$create(Telerik.Web.UI.Editor.InsertTableHelper,args,_298,null,document.createElement("DIV"));
tool.set_rootpopupclassname("");
this._tableHelper=tool;
tool.render();
var _29a=tool.get_popupElement();
_29a.style.display="";
_29a.style.visibility="visible";
_29a.style.position="";
_29a.style.cssFloat="left";
var _29b=this.get_popupElement();
_29b.insertBefore(_29a,_29b.firstChild);
},renderChildren:function(){
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"renderChildren");
var _29c=this._itemRootElement;
if(this._longTool){
var ul=document.createElement("UL");
_29c.insertBefore(ul,_29c.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(_29f){
Telerik.Web.UI.Editor.ColorPicker.initializeBase(this,[_29f]);
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 _2a0=this.get_selectedItem();
this.set_color(_2a0);
},set_color:function(_2a1){
if(!_2a1){
_2a1="";
}
var _2a2=this.getSpanElement();
_2a2.style.borderBottom="0px";
_2a2.style.height="";
if(_2a1){
var _2a3=_2a2.offsetHeight;
if(_2a3){
_2a2.style.height=(_2a3-3)+"px";
}
_2a2.style.borderBottom="3px solid "+_2a1;
}
this._color=_2a1;
},get_color:function(){
return this._color;
},onPopupMouseOver:function(e){
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"onPopupMouseOver",[e]);
var _2a5=this.get_activeIndex();
var _2a6=this._items[_2a5];
if(null==_2a6){
return;
}
if(this._infoSpan1){
this._infoSpan1.innerHTML=_2a6;
this._infoSpan1.style.backgroundColor=_2a6;
}
if(this._infoSpan2){
this._infoSpan2.innerHTML=_2a6;
this._infoSpan2.style.color=_2a6;
}
},renderFooter:function(){
var oDiv=document.createElement("div");
oDiv.className="rade_ColorPickerFooter";
var _2a8=document.createElement("span");
_2a8.className="rade_DarkColor";
var _2a9=document.createElement("span");
_2a9.className="rade_LightColor";
_2a8.innerHTML=_2a9.innerHTML="&nbsp";
oDiv.appendChild(_2a8);
oDiv.appendChild(_2a9);
this.get_popupElement().appendChild(oDiv);
this._infoSpan1=_2a8;
this._infoSpan2=_2a9;
},renderChild:function(_2aa,_2ab,_2ac){
var oDiv=document.createElement("div");
if(null!=_2ab){
oDiv.style.backgroundColor=_2ab;
oDiv.setAttribute("title",_2ab);
oDiv.innerHTML="&nbsp;";
}
_2aa.appendChild(oDiv);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_2ae){
this._clientStateFieldID=_2ae;
}};
Telerik.Web.UI.Editor.ColorPicker.registerClass("Telerik.Web.UI.Editor.ColorPicker",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.UndoRedoDropDown=function(_2af){
Telerik.Web.UI.Editor.UndoRedoDropDown.initializeBase(this,[_2af]);
};
Telerik.Web.UI.Editor.UndoRedoDropDown.prototype={renderFooter:function(){
},get_selectedItem:function(){
var _2b0=Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"get_selectedItem");
if(!_2b0){
_2b0=1;
}
return _2b0;
},selectUIItem:function(e,_2b2){
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(_2b3){
Telerik.Web.UI.Editor.ApplyClassDropDown.initializeBase(this,[_2b3]);
this._popupClassName="rade_ApplyClass";
this._onValueSelectedDelegate=null;
this._clientStateFieldID=null;
this._clearclasstext="Clear Class";
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 _2b5="";
if(!tag){
_2b5=this._cssClasses["notag"];
}else{
tag=tag.toLowerCase();
var res=this._cssClasses[tag];
_2b5=res?res:this._cssClasses["unknown"];
}
var _2b7=document.createElement("span");
_2b7.innerHTML="&nbsp;"+tag;
_2b7.className=_2b5;
return _2b7;
},_getClassTag:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2ba=str.lastIndexOf(".");
if(_2ba==0){
return "ALL";
}
var _2bb=str.lastIndexOf(" ",_2ba);
return str.substring((_2bb+1),_2ba);
},_getClassCss:function(_2bc){
var re=this._cssClassRegex;
var oCss="";
if(null!=_2bc.cssText){
oCss=_2bc.cssText;
oCss=oCss.replace(re,"$1");
}else{
oCss=_2bc.style.cssText;
}
return oCss;
},_getDisplayName:function(rule){
if(!rule||!rule.selectorText){
return "";
}
var _2c0=rule.selectorText;
var _2c1=_2c0.indexOf(".");
if(-1==_2c1){
_2c1=0;
}else{
_2c1+=1;
}
var _2c2=_2c0.indexOf(":");
if(-1==_2c2){
_2c2=_2c0.length;
}
return _2c0.substring(_2c1,_2c2);
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2c5=str.lastIndexOf(".");
if(_2c5==-1){
return "";
}
var _2c6=str.indexOf(" ",_2c5);
if(-1==_2c6){
_2c6=str.indexOf(":",_2c5);
}
if(-1==_2c6){
_2c6=str.length;
}
return str.substring((_2c5+1),_2c6);
},_getChild:function(_2c7,_2c8,_2c9){
var elem=document.createElement("DIV");
if(_2c8.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=_2c7;
}
elem.setAttribute("style",_2c7);
elem.innerHTML=_2c9;
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(_2cb){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"set_items",[_2cb]);
this._items.splice(0,0,["",{cssText:"",selectorText:this.get_clearclasstext()}]);
},renderChild:function(cell,_2cd,_2ce){
var _2cf=_2cd[1];
var oTag=this._getClassTag(_2cf);
var oCss=this._getClassCss(_2cf);
var _2d2=_2cd[2]?_2cd[2]:this._getDisplayName(_2cf);
cell.setAttribute("title",_2cf.selectorText);
var _2d3=this._getClassIcon(oTag);
cell.appendChild(_2d3);
var div=this._getChild(oCss,oTag,_2d2);
cell.appendChild(div);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_2d5){
this._clientStateFieldID=_2d5;
},get_clearclasstext:function(){
return this._clearclasstext;
},set_clearclasstext:function(_2d6){
this._clearclasstext=_2d6;
}};
Telerik.Web.UI.Editor.ApplyClassDropDown.registerClass("Telerik.Web.UI.Editor.ApplyClassDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontNameDropDown=function(_2d7){
Telerik.Web.UI.Editor.FontNameDropDown.initializeBase(this,[_2d7]);
};
Telerik.Web.UI.Editor.FontNameDropDown.prototype={updateValue:function(oVal){
try{
if(!oVal){
oVal=this.get_text();
}
if(null==oVal||"AZBY"==oVal){
return;
}
var _2d9=this.getSpanElement();
if(_2d9){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_2d9.innerHTML=this._value;
}
}
catch(e){
}
},renderChildren:function(){
var _2da=this._items;
if(_2da&&_2da[0]&&!(_2da[0] instanceof Array)){
for(var i=0;i<_2da.length;i++){
var item=_2da[i];
_2da[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(_2dd){
Telerik.Web.UI.Editor.FontSizeDropDown.initializeBase(this,[_2dd]);
};
Telerik.Web.UI.Editor.FontSizeDropDown.prototype={renderChildren:function(){
var _2de=this._items;
if(_2de&&_2de[0]&&!(_2de[0] instanceof Array)){
for(var i=0;i<_2de.length;i++){
var item=_2de[i];
_2de[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(_2e1){
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.initializeBase(this,[_2e1]);
};
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 _2e5=this.FlatLinksArray[this.get_selectedIndex()];
return {innerHTML:_2e5.name,href:_2e5.href,target:_2e5.target,title:_2e5.toolTip};
},_parseSubtree:function(_2e6,t){
var _2e8=this._linkCounter;
this.FlatLinksArray[_2e8]=_2e6;
var li=document.createElement("LI");
t.appendChild(li);
var _2ea=_2e6.childLinks&&_2e6.childLinks.length;
var span=document.createElement("SPAN");
span.innerHTML="&nbsp;";
span.className=_2ea?"rade_CustomLinksIcon rade_icon_plus":"rade_CustomLinksIcon rade_icon_empty";
if(_2ea){
function onclick(e){
var _2ed=Sys.UI.DomElement.containsCssClass(this,"rade_icon_plus");
var ul=this.parentNode.getElementsByTagName("UL")[0];
if(ul){
ul.style.display=_2ed?"":"none";
var _2ef=_2ed?"rade_icon_plus":"rade_icon_minus";
var _2f0=_2ed?"rade_icon_minus":"rade_icon_plus";
Sys.UI.DomElement.removeCssClass(this,_2ef);
Sys.UI.DomElement.addCssClass(this,_2f0);
}
return false;
}
$addHandler(span,"click",onclick);
}
li.appendChild(span);
var _2f1=null;
if(_2e6.href){
_2f1=document.createElement("A");
_2f1.href="#";
_2f1.innerHTML=_2e6.name;
li.appendChild(_2f1);
this.markItemContainer(_2f1,this._linkCounter);
}else{
_2f1=document.createElement("SPAN");
_2f1.innerHTML=_2e6.name;
li.appendChild(_2f1);
}
this._linkCounter++;
if(_2ea){
var ul=document.createElement("UL");
li.appendChild(ul);
var _2f3=_2e6.childLinks;
for(var i=0;i<_2e6.childLinks.length;i++){
var _2f5=_2f3[i];
this._parseSubtree(_2f5,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(_2f6,_2f7){
var _2f8=window.frames;
for(var i=0;i<_2f8.length;i++){
var _2fa=null;
try{
_2fa=_2f8[i].window.document;
}
catch(e){
}
if(!_2fa){
continue;
}
try{
if(false!=_2f6){
_2f7.attachToDocument(_2fa);
}else{
_2f7.detachFromDocument(_2fa);
}
}
catch(e){
}
}
}
var _2fb=Function.createDelegate(null,function(e){
if(e.keyCode==27){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
});
$addHandler(document.body,"keydown",_2fb);
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",_2fb);
});
},attachToDocument:function(_2fd){
$telerik.addExternalHandler(_2fd,"mousedown",this._hideHandler);
},detachFromDocument:function(_2fe){
$telerik.removeExternalHandler(_2fe,"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 _301=this._activePopup.get_popupElement();
if(!this._isMouseOverElement(e,_301)){
this.hideActivePopup();
}
}
},_isMouseOverElement:function(e,_303){
var rect=null;
try{
rect=$telerik.getBounds(_303);
}
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(_308){
if(this._activePopup==_308){
this._activePopup=null;
}
},set_activePopup:function(_309){
if(this._activePopup&&(_309!=this._activePopup)){
this._activePopup.hide();
}
this._activePopup=_309;
},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(_30a){
Telerik.Web.UI.Editor.DefaultToolAdapter.initializeBase(this,[_30a]);
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._initContextMenus();
this._registerEditorHandlers();
var _30b=Telerik.Web.UI.EditorToolbarMode;
var _30c=this.get_editor();
switch(_30c.get_toolbarMode()){
case _30b.Default:
_30c.add_firstShow(Function.createDelegate(this,function(){
this._hookToolbarJson2Html();
var _30d=this.get_editor();
var _30e=_30d.get_element().style.height;
_30d._updateEditorSize(_30e);
}));
break;
case _30b.Floating:
this._createFloatingButton();
break;
case _30b.PageTop:
case _30b.ShowOnFocus:
this._hookToolbarModeEventHandlers();
break;
}
},_hookToolbarJson2Html:function(){
if(this._initializedToolbars){
return;
}
this._initializedToolbars=true;
var _30f=this.get_toolJSON();
var _310=this._getToolBarElements();
var _311=[];
for(var i=0;i<_30f.length;i++){
var json=_30f[i];
var _314=_310[i];
this._initializeToolbar(json,_314);
var _315=json["attributes"];
var zone=_315?_315["dockingzone"]:null;
if(zone){
_311[_311.length]=[zone,_314];
}
}
if($telerik.isIE){
var elem=this.get_element();
elem.style.height="";
}
var _318=this.get_editor();
var _319=_318.get_id();
for(var i=0;i<_311.length;i++){
var _31a=_311[i][0];
var zone=_31a.charAt(0).toUpperCase()+_31a.substring(1);
var _31b=$get(_319+zone);
if(!_31b){
_31b=$get(_31a);
}
if(_31b){
if(_31b.innerHTML=="&nbsp;"){
_31b.innerHTML="";
}
_31b.appendChild(_311[i][1]);
}
}
},_initNonDefaultToolbarMode:function(){
var _31c=this.get_editor();
var _31d=Telerik.Web.UI.EditorToolbarMode;
var _31e=_31c.get_toolbarMode();
if(_31e==_31d.ShowOnFocus){
var wnd=this._toolbarHolder;
var _320=Telerik.Web.UI.WindowBehaviors;
wnd.set_behaviors(_320.Resize);
wnd.set_visibleTitlebar(false);
}else{
if(_31e==_31d.PageTop){
var wnd=this._toolbarHolder;
wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);
wnd.set_visibleTitlebar(false);
}
}
var _321=this.get_element();
_321.style.visibility="visible";
},_showToolbarHolder:function(_322){
if(!_322){
if(this._toolbarHolder){
this._toolbarHolder.hide();
}
return;
}else{
if($telerik.isIE&&!this._editorIEFirstShow){
if(this.get_editor().get_toolbarMode()!=Telerik.Web.UI.EditorToolbarMode.Floating){
this._editorIEFirstShow=true;
return;
}
}
}
if(this.get_editor().isFullScreen()){
return;
}
var _323=Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper;
if(_323==this&&_323._toolbarHolder&&_323._toolbarHolder.isVisible()){
_323.get_toolbarHolder().setActive(true);
return;
}
if(_323&&_323._showToolbarHolder){
_323._showToolbarHolder(false);
}
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=this;
this.get_window();
this._initNonDefaultToolbarMode();
this._toolbarHolder.show();
},_positionWindow:function(){
var _324=Telerik.Web.UI.EditorToolbarMode;
var _325=this.get_editor();
var _326=_325.get_toolbarMode();
if(_326==_324.ShowOnFocus){
this._positionToolbarAboveEditor();
}else{
if(_326==_324.PageTop){
this._positionOnPageTop();
}else{
if(_326==_324.Floating){
if(!this._wasShown){
this._positionToolbarAboveEditor();
this._wasShown=true;
}
}
}
}
},get_window:function(){
if(!this._toolbarHolder){
var _327=this.get_editor();
var _328=_327.get_dialogOpener();
if(!_328){
return;
}
var wnd=_328.get_container().clone(_327.get_id()+"_toolbarMode");
wnd.set_visibleStatusbar(false);
var _32a=this.get_element();
var _32b=_32a.offsetWidth;
wnd.setSize(_32b+10,"");
wnd.add_show(Function.createDelegate(this,function(_32c,args){
var _32e=_32c.get_contentElement();
if(!_32e){
return;
}
var _32f=_32c.get_popupElement();
_32f.style.zIndex="10000";
this._hookToolbarJson2Html();
_32e.style.overflow="";
_32e.style.height="";
var _330=_32e.offsetWidth;
_32e.style.width=_330+"px";
var _331=_327.get_toolsWidth();
if(!_331){
var _332=_32c.getWindowBounds();
_331=_332.width;
}
_32c.setSize(_331,"");
_32e.style.width="100%";
this._positionWindow();
}));
this._toolbarHolder=wnd;
this._moveToolbarsToEditor(false);
}
return this._toolbarHolder;
},_moveToolbarsToEditor:function(_333){
var _334=this.get_element();
if(!_333){
if(!this._fakeToolbarParentCreated){
var div=_334.ownerDocument.createElement("DIV");
div.control=_334.control;
_334.parentNode.appendChild(div);
this._fakeToolbarParentCreated=true;
_334.control=null;
var _336=div.style;
_336.height=_336.fontSize=_336.lineHeight="1px";
_336.border="1px solid red";
_336.visibility="hidden";
if(!$telerik.isIE){
_336.display="none";
}
}
var wnd=this.get_toolbarHolder();
wnd.set_contentElement(_334);
_334.style.width="100%";
}else{
_334.style.width="";
var _338=this.get_editor().get_TopZone();
_338.appendChild(_334);
}
},_positionToolbarAboveEditor:function(){
var wnd=this._toolbarHolder;
var _33a=this.get_editor();
var _33b=$telerik.getBounds(_33a.get_element());
var x=_33b.x;
var _33d=$telerik.getBounds(wnd.get_popupElement()).height;
var y=_33b.y-_33d;
wnd.moveTo(x,y);
},_positionOnPageTop:function(){
var wnd=this._toolbarHolder;
var _340=wnd._getViewportBounds();
var x=_340.scrollLeft;
var y=_340.scrollTop;
wnd.moveTo(x,y);
wnd.set_width("");
if(!wnd.isPinned()){
wnd.togglePin();
}
},_createFloatingButton:function(){
this._onToggleFloatingToolbarDelegate=Function.createDelegate(this,this._onToggleFloatingToolbar);
var _343=this.get_editor();
var skin=_343.get_skin();
var _345={name:"ToggleFloatingToolbar",addClickHandler:true,skin:skin};
var _346={"valueSelected":this._onToggleFloatingToolbarDelegate};
var _347=Telerik.Web.UI.EditorButton.createTool(_345,_346);
var _348=Telerik.Web.UI.EditorButton.createToolWrapper(_347,skin);
var _349=$get(_343.get_id()+"Top");
if(_349){
_349.appendChild(_348);
}
},_onToggleFloatingToolbar:function(){
var _34a=!this._toolbarHolder||!this._toolbarHolder.isVisible();
this._showToolbarHolder(_34a);
},_hookToolbarModeEventHandlers:function(){
var _34b=this;
var _34c=function(){
_34b._showToolbarHolder(true);
};
var _34d=this.get_editor();
if(_34d.isIE){
this.get_editor().add_editReady(function(){
_34d.attachEventHandler("beforeeditfocus",_34c);
});
}else{
_34d.add_selectionChange(_34c);
}
_34d.add_modeChange(function(){
_34b._showToolbarHolder(_34b.get_editor().get_mode()==Telerik.Web.UI.EditModes.Design);
});
_34d.add_submit(function(){
_34b._showToolbarHolder(false);
});
_34d.add_toggleScreenMode(function(){
var _34e=_34b.get_editor().isFullScreen();
_34b._moveToolbarsToEditor(_34e);
var wnd=_34b.get_toolbarHolder();
if(_34e){
wnd.hide();
}else{
wnd.show();
}
});
this._bodyClickDelegate=Function.createDelegate(this,this._onBodyClick);
$addHandler(document.body,"click",this._bodyClickDelegate);
},_disposeToolbarModeHandlers:function(){
if(this._bodyClickDelegate){
$removeHandler(document.body,"click",this._bodyClickDelegate);
this._bodyClickDelegate=null;
}
},onContextMenu:function(e){
if(!this._contextMenusEnabled){
return;
}
var _351=this.get_editor();
if(_351.get_mode()!=Telerik.Web.UI.EditModes.Design){
return;
}
this.createContextMenus();
var _352=e.srcElement?e.srcElement:e.target;
var _353=_352.tagName;
var _354=this._contextMenus[_353];
if("TH"==_353&&!_354){
_354=this._contextMenus["TD"];
}
var _355="";
if(!_354){
var _356=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_352,"A");
if(!_356){
_356=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_352,"TD");
}
if(!_356){
_356=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_352,"TABLE");
}
if(_356){
_355=_356.tagName;
_352=_356;
}else{
_355="*";
}
_354=this._contextMenus[_355];
}
if(_354&&_353=="IMG"&&_352&&"true"==_352.getAttribute("isflash")){
_354=null;
}
if(!this.isIE&&_355=="*"){
return;
}
if(_354){
_354.set_eventObject(e);
_354.show();
}
return $telerik.cancelRawEvent(e);
},enableContextMenus:function(_357){
this._contextMenusEnabled=_357;
},_initContextMenus:function(){
var _358=Function.createDelegate(this,this.onContextMenu);
var _359=this.get_editor();
_359.add_editReady(function(){
_359.attachEventHandler("contextmenu",_358);
});
},createContextMenus:function(){
if(this._contextMenus){
return;
}
this._contextMenus={};
var _35a=this.get_editor();
var skin=_35a.get_skin();
var _35c=_35a.get_contextMenusJSON();
var _35d={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
for(var i=0;i<_35c.length;i++){
var args=_35c[i];
args["sizetofit"]=true;
args["parentElement"]=_35a.get_contentAreaElement();
args["skin"]=skin;
var tool=$create(Telerik.Web.UI.EditorContextMenu,args,_35d,null,document.createElement("SPAN"));
this._contextMenus[args.tagName]=tool;
}
},dispose:function(){
var _361=this._getToolBarElements();
for(var i=0;i<_361.length;i++){
$clearHandlers(_361[i]);
}
this._tools=[];
this._disposeToolbarModeHandlers();
var wnd=this._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(_365){
this.createContextMenus();
return this._contextMenus[_365];
},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(_369,_36a){
if(!_369){
_369=this._tools;
}
var _36b=this.get_editor();
for(var i=0;i<_369.length;i++){
var _36d=_369[i];
var _36e=_36d.get_name();
if(_36d.setState){
var _36f=_36a;
if(null==_36f){
_36f=_36b.getToolState(_36e);
}
if(null!=_36f){
_36d.setState(_36f);
}
}
if(_36d.updateValue){
_36d.updateValue(_36b.getToolValue(_36e));
}
}
},_convertCommandsArray:function(_370){
var _371=[];
for(var i=0;i<_370.length;i++){
_371[i]=[i+1,_370[i].get_title()];
}
return _371;
},_onDropDownHide:function(_373,args){
var _375=this.get_editor();
_375.enableContentArea(true);
},_onDropDownBeforeShow:function(_376,args){
var _378=this.get_editor();
if(Telerik.Web.UI.EditorToolStrip.isInstanceOfType(_376)){
this.setToolState(_376.get_items());
}
if(!_378.getSelection().isControl()&&!Telerik.Web.UI.EditorContextMenu.isInstanceOfType(_376)){
_378.enableContentArea(false);
}
var _379=_376.get_name();
if(_379=="Undo"){
var _37a=_378.get_commandsManager().getCommandsToUndo();
_37a=this._convertCommandsArray(_37a);
_376.set_items(_37a);
}else{
if(_379=="Redo"){
var _37b=_378.get_commandsManager().getCommandsToRedo();
_37b=this._convertCommandsArray(_37b);
_376.set_items(_37b);
}else{
if(_379=="ModuleManager"){
var _37c=_378.get_modulesManager();
if(!_37c){
return;
}
var _37d=_37c.get_modules();
var _37e=[];
for(var i=0;i<_37d.length;i++){
var _380=_37d[i];
var name=_380.get_name();
var _382=_380.get_title();
if(!_382){
_382=name;
}
cssClass=_380.get_visible()?"rade_module_visible_icon":"rade_module_hidden_icon";
_37e[i]=[name,_382,cssClass];
}
_376.set_items(_37e);
}
}
}
var _383=_376.get_items();
if(_383&&_383.length>0){
return;
}
var _384=null;
switch(_379){
case "ApplyClass":
_384=_378.getCssArray();
break;
case "FontName":
_384=_378.get_fontNames();
break;
case "FontSize":
_384=_378.get_fontSizes();
break;
case "InsertSymbol":
_384=_378.get_symbols();
break;
case "BackColor":
case "ForeColor":
_384=_378.get_colors();
break;
case "RealFontSize":
_384=_378.get_realFontSizes();
break;
case "InsertSnippet":
_384=_378.get_snippets();
break;
case "Zoom":
_384=["10%","20%","50%","100%","150%","200%","300%","500%"];
break;
case "FormatBlock":
_384=_378.get_paragraphs();
break;
case "InsertCustomLink":
_384=_378.get_links();
break;
case "AjaxSpellCheck":
case "SpellCheck":
_384=_378.get_languages();
break;
}
if(_384){
_376.set_items(_384);
}
},_initializeToolbar:function(_385,_386){
var _387=_386.getElementsByTagName("li");
var _388=_385.tools;
var _389=this.get_editor();
var skin=_389.get_skin();
var _38b=0;
if(_388){
var _38c=0;
for(var i=0;i<_388.length;i++){
var _38e=_387[i+1];
_38c+=_38e.offsetWidth;
var _38f=Telerik.Web.UI.EditorButton;
var _390=_388[i].type;
var _391=_388[i].name;
var _392=Telerik.Web.UI.EditorToolType;
var args=_388[i];
var tool=null;
var _395=false;
if(_390){
switch(_390){
case _392.Button:
break;
case _392.Separator:
if(!_38b){
_38b+=parseInt($telerik.getCurrentStyle(_38e,"marginLeft"));
_38b+=parseInt($telerik.getCurrentStyle(_38e,"marginRight"));
}
_38c+=_38b;
_38f=null;
break;
case _392.DropDown:
_38f=Telerik.Web.UI.EditorDropDown;
_395=true;
if(_391=="FontName"){
_38f=Telerik.Web.UI.Editor.FontNameDropDown;
}else{
if(_391=="FontSize"){
_38f=Telerik.Web.UI.Editor.FontSizeDropDown;
}else{
if(_391=="FormatBlock"){
_38f=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_391=="RealFontSize"){
_38f=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_391=="Zoom"){
_38f=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_391=="InsertCustomLink"){
_38f=Telerik.Web.UI.Editor.InsertCustomLinkDropDown;
}else{
if(_391=="ApplyClass"){
_38f=Telerik.Web.UI.Editor.ApplyClassDropDown;
}
}
}
}
}
}
}
break;
case _392.SplitButton:
_38f=Telerik.Web.UI.EditorSplitButton;
if(_391=="ForeColor"||_391=="BackColor"){
_38f=Telerik.Web.UI.Editor.ColorPicker;
}else{
if(_391=="Undo"||_391=="Redo"){
_38f=Telerik.Web.UI.Editor.UndoRedoDropDown;
}
}
_395=true;
break;
case _392.ToolStrip:
if(_391=="InsertTable"){
_38f=Telerik.Web.UI.Editor.InsertTable;
}else{
_38f=Telerik.Web.UI.EditorToolStrip;
}
_395=true;
break;
case _392.Custom:
break;
}
}
if(args.attributes){
for(var item in args.attributes){
args[item.toLowerCase()]=args.attributes[item];
}
}
if(_38f){
var _397=null;
if(_395){
_397={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
args["skin"]=skin;
}
tool=$create(_38f,args,_397,null,_38e);
}
if(tool){
Array.add(this._tools,tool);
var _398=tool.get_shortCut();
if(_398){
var _399=tool.get_name();
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(tool)&&!(Telerik.Web.UI.EditorSplitButton.isInstanceOfType(tool))){
_399="RadE_ToolAdapter_"+_399;
Telerik.Web.UI.Editor.CommandList[_399]=this._toolAdapterDropDownExpander;
}
_389.setShortCut(_399,_398);
}
}
}
var ul=_386;
if(this.isIE&&ul&&_38c){
ul.style.width=(_38c+(_387[0].offsetWidth)*2)+"px";
}
if($telerik.isSafari){
ul.setAttribute("onmousedown","return false;");
}
$addHandlers(_386,{"click":this._onToolAdapterClickDelegate,"keydown":this._onToolAdapterKeyDownDelegate},this);
}
},_toolAdapterDropDownExpander:function(_39b,_39c){
var tool=_39c.getToolByName(_39b.replace("RadE_ToolAdapter_",""));
tool.setFocus();
tool.show();
tool.selectNextItem();
return false;
},_onEditorModeChange:function(_39e,args){
var _3a0=Telerik.Web.UI.EditModes;
var mode=_39e.get_mode();
this._setEnabled((mode==_3a0.Design));
},_onEditorSelectionChange:function(_3a2,args){
this.setToolState();
},_setEnabled:function(_3a4){
var _3a5=this._tools;
for(var i=0;i<_3a5.length;i++){
var tool=_3a5[i];
tool.set_enabled(_3a4);
}
},_registerEditorHandlers:function(){
var _3a8=this.get_editor();
_3a8.add_selectionChange(this._onEditorSelectionChangeDelegate);
_3a8.add_modeChange(this._onEditorModeChangeDelegate);
},_onBodyClick:function(){
if(this._preventToolbarFromHiding){
this._preventToolbarFromHiding=false;
return;
}
this._showToolbarHolder(false);
},_onDropDownValueSelected:function(_3a9,args){
this._preventToolbarFromHiding=true;
var _3ab=_3a9.get_selectedItem();
if(Telerik.Web.UI.EditorButton.isInstanceOfType(_3ab)){
this._raiseEditorEvent(_3ab,null);
}else{
this._raiseEditorEvent(_3a9,_3ab);
}
},_onKeyDownHandler:function(e){
var _3ad=e.keyCode;
if(9==_3ad||37==_3ad||39==_3ad||121==_3ad){
if(Telerik.Web.UI.Editor.PopupController){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
}
if(121==_3ad){
var _3ae=this.get_editor();
window.setTimeout(function(){
if(_3ae){
_3ae.setFocus();
}
},100);
if(e.rawEvent){
$telerik.cancelRawEvent(e.rawEvent);
}
return $telerik.cancelRawEvent(e);
}
if(9==_3ad){
return;
}
var _3af=this._getSelectedTool(e);
if(!Telerik.Web.UI.EditorButton.isInstanceOfType(_3af)){
return;
}
if(37==_3ad||39==_3ad){
var tool=_3af;
while(true){
tool=(37==_3ad)?this._getPreviousTool(tool):this._getNextTool(tool);
if(null==tool){
break;
}
if(tool.get_enabled()){
break;
}
}
if(tool&&tool.get_enabled()){
tool.setFocus();
}
}
if(13==_3ad&&_3af&&!_3af.get_selectedItem){
this._raiseEditorEvent(_3af,null);
return;
}
if(!Telerik.Web.UI.EditorDropDown.isInstanceOfType(_3af)){
return;
}
if(38==_3ad||40==_3ad){
var _3b1=false;
if(!_3af.isExpanded()){
_3af.show();
_3b1=true;
}
if(_3b1||40==_3ad){
_3af.selectNextItem();
}else{
_3af.selectPreviousItem();
}
}else{
if(13==_3ad){
_3af.hide();
if(_3af.get_activeIndex){
_3af.set_selectedIndex(_3af.get_activeIndex());
}
this._onDropDownValueSelected(_3af);
}else{
if(27==_3ad){
_3af.hide();
}
}
}
},_onToolBarClick:function(e){
var _3b3=this._getSelectedTool(e);
if(_3b3){
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(_3b3)){
_3b3.click(e);
}else{
if(false){
}else{
this._raiseEditorEvent(_3b3);
}
}
}
var _3b4=this.get_editor();
if(_3b4.get_mode()!=Telerik.Web.UI.EditModes.Design){
$telerik.cancelRawEvent(e);
}
},_raiseEditorEvent:function(tool,_3b6){
var _3b7=this.get_events().getHandler("ToolClick");
if(_3b7){
var _3b8=tool.get_name?tool.get_name():"";
var _3b9=new Telerik.Web.UI.EditorCommandEventArgs(_3b8,tool,_3b6);
_3b7(tool,_3b9);
}
},_getPreviousTool:function(tool){
var _3bb=Array.indexOf(this._tools,tool);
return this._tools[_3bb-1];
},_getNextTool:function(tool){
var _3bd=Array.indexOf(this._tools,tool);
return this._tools[_3bd+1];
},_getSelectedTool:function(e){
var _3bf=Telerik.Web.UI.EditorButton.getToolRootNode(e.target);
if(null==_3bf){
return;
}
var _3c0=_3bf.control;
if(null==_3c0){
return;
}
if(_3c0.get_enabled&&_3c0.get_enabled()==false){
return;
}
if(e&&_3c0){
e.preventDefault();
e.stopPropagation();
}
return _3c0;
},_getToolBarElements:function(){
var _3c1=this.get_element();
var _3c2=_3c1.getElementsByTagName("ul");
return _3c2;
},get_tools:function(){
return this._tools;
},get_toolbarHolder:function(){
return this.get_window();
},get_editor:function(){
return this._editor;
},set_editor:function(_3c3){
if(this._editor!=_3c3){
this._editor=_3c3;
}
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_3c4){
this._toolJSON=_3c4;
},add_toolClick:function(_3c5){
this.get_events().addHandler("ToolClick",_3c5);
},remove_toolClick:function(_3c6){
this.get_events().removeHandler("ToolClick",_3c6);
}};
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(_3c7,_3c8,args){
function createSpellCheckEngine(){
if(!_3c8.get_ajaxSpellCheck()){
var _3ca={"editor":_3c8};
var _3cb=document.createElement("DIV");
var _3cc=$create(Telerik.Web.UI.Editor.AjaxSpellCheck,_3ca,null,null,_3cb);
var _3cd=_3cc.get_element();
var _3ce=$get(_3c8.get_id()+"Top");
if(_3ce){
_3ce.appendChild(_3cd);
}
_3c8.set_ajaxSpellCheck(_3cc);
}
var _3cf=_3c8.get_ajaxSpellCheck();
if(args&&args.value){
_3cf.set_language(args.value);
}
_3cf.spellCheck();
}
if(typeof (Telerik.Web.UI.Editor.AjaxSpellCheck)=="undefined"){
function OnWebRequestCompleted(_3d0,_3d1){
var _3d2=_3d0.get_responseData();
Telerik.Web.UI.Editor.Utils.evalScriptCode(_3d2);
createSpellCheckEngine();
}
var _3d3=_3c8.get_ajaxSpellCheckScriptReference();
var _3d4=new Sys.Net.WebRequest();
_3d4.set_url(_3d3);
_3d4.set_httpVerb("GET");
_3d4.add_completed(OnWebRequestCompleted);
_3d4.invoke();
}else{
createSpellCheckEngine();
}
return false;
};
this.ModuleManager=function(_3d5,_3d6,args){
var _3d8=args.value;
var _3d9=_3d6.get_modulesManager();
if(!_3d9){
return false;
}
var _3da=_3d9.getModuleByName(_3d8);
if(_3da){
_3da.toggleVisibility();
_3d6._updateEditorSize(null,true);
}
return false;
};
this.ToggleScreenMode=function(_3db,_3dc,args){
_3dc.toggleScreenMode();
return false;
};
this.InsertRowAbove=this.InsertRowBelow=function(_3de,_3df,args){
_3df.executeCommand(new Telerik.Web.UI.Editor.TableInsertRow(_3df.getLocalizedString(_3de),null,_3de=="InsertRowAbove"?"above":"below"));
};
this.InsertColumnLeft=this.InsertColumnRight=function(_3e1,_3e2,args){
_3e2.executeCommand(new Telerik.Web.UI.Editor.TableInsertColumn(_3e2.getLocalizedString(_3e1),null,_3e1=="InsertColumnLeft"?"left":"right"));
};
this.DeleteRow=function(_3e4,_3e5,args){
_3e5.executeCommand(new Telerik.Web.UI.Editor.TableDeleteRow(_3e5.getLocalizedString(_3e4)));
};
this.DeleteColumn=function(_3e7,_3e8,args){
_3e8.executeCommand(new Telerik.Web.UI.Editor.TableDeleteColumn(_3e8.getLocalizedString(_3e7)));
};
this.DeleteCell=function(_3ea,_3eb,args){
_3eb.executeCommand(new Telerik.Web.UI.Editor.TableDeleteCell(_3eb.getLocalizedString(_3ea)));
};
this.MergeColumns=function(_3ed,_3ee,args){
_3ee.executeCommand(new Telerik.Web.UI.Editor.TableMergeColumns(_3ee.getLocalizedString(_3ed)));
};
this.MergeRows=function(_3f0,_3f1,args){
_3f1.executeCommand(new Telerik.Web.UI.Editor.TableMergeRows(_3f1.getLocalizedString(_3f0)));
};
this.SplitCell=function(_3f3,_3f4,args){
_3f4.executeCommand(new Telerik.Web.UI.Editor.TableSplitCell(_3f4.getLocalizedString(_3f3)));
};
this.DeleteTable=function(_3f6,_3f7,args){
var _3f9=args.value;
if(!_3f9){
_3f9=_3f7.getSelectedElement();
}
if(_3f9&&"TABLE"!=_3f9.tagName){
_3f9=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_3f9,"TABLE");
}
if(_3f9){
_3f7.selectElement(_3f9);
_3f7.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(_3fa,_3fb,args){
var _3fd=_3fa.substring(10);
var _3fe=new Telerik.Web.UI.EditorCommandEventArgs(_3fa,args.get_tool(),_3fd);
_3fb.fire("InsertFormElement",_3fe);
};
this.StripAll=this.StripCss=this.StripFont=this.StripSpan=this.StripWord=function(_3ff,_400,args){
var _402=_3ff.substring(5);
var _403=new Telerik.Web.UI.EditorCommandEventArgs(_3ff,args.get_tool(),_402.toUpperCase());
_400.fire("FormatStripper",_403);
};
this.FormatStripper=function(_404,_405,args){
var _407=args.value;
var _408="";
try{
_408=_405.getSelectionHtml();
}
catch(e){
}
var oSel=_405.get_document().selection?_405.get_document().selection:_405.get_contentWindow().getSelection();
var _40a=oSel.type?oSel.type.toLowerCase()=="none":oSel.isCollapsed;
if(_40a||_408==""||_405.get_html()==_408){
var _40b=Telerik.Web.UI.Editor.Utils.stripFormatting(_405.get_html(),_407);
_405.set_html(_40b,_405.getLocalizedString(_404)+" "+_407);
}else{
if(_408!=null){
var _40b=Telerik.Web.UI.Editor.Utils.stripFormatting(_408,_407);
_405.pasteHtml(_40b,_404);
}
}
};
this.InsertTable=function(_40c,_40d,args){
var _40f=args.value;
if(_40f){
var _410=Telerik.Web.UI.Editor.Utils.createTable(_40f.rows,_40f.cols);
var _411=Telerik.Web.UI.Editor.Utils.getOuterHtml(_410);
_40d.pasteHtml(_411,_40c);
}
};
this.InsertTab=function(_412,_413,_414){
var _415=_413.getSelectedElement();
if(_415.tagName=="LI"){
_413.fire("Indent");
}else{
_413.pasteHtml(" &nbsp;&nbsp;&nbsp;&nbsp;",_412);
}
return false;
};
this.SetToolFocus=function(_416,_417,_418){
var _419=_417.get_toolAdapter();
if(_419){
_419.setFocus();
}
return false;
};
this.ViewHtml=function(_41a,_41b,_41c){
alert(_41b.get_html(true));
return false;
};
this.Undo=this.Redo=function(_41d,_41e,args){
var _420=args?args.value:1;
if(!_420){
_420=1;
}
if(_41d=="Redo"){
_41e.redo(_420);
}else{
_41e.undo(_420);
}
};
this.PastePlainText=function(_421,_422,_423){
var _424=function(_425){
if(_425){
var _426=_425.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
_426=Telerik.Web.UI.Editor.Utils.replaceNewLineWithBr(_426);
if(_426){
_422.pasteHtml(_426,_421);
}
}
};
if(_422.isIE){
_424(window.clipboardData.getData("Text"));
}else{
var _427=function(_428,args){
_424(args.get_content());
};
_422.showDialog("CleanPasteTextContent",{},_427);
return false;
}
};
this.PasteFromWord=this.PasteFromWordNoFontsNoSizes=this.PasteAsHtml=function(_42a,_42b,_42c){
var _42d=function(_42e,_42f){
var _430="";
if(_42a=="PasteFromWord"){
_430=Telerik.Web.UI.Editor.Utils.stripFormatting(_42e,"WORD");
}else{
if(_42a=="PasteFromWordNoFontsNoSizes"){
_430=Telerik.Web.UI.Editor.Utils.stripFormatting(_42e,"WORD_ALL");
}else{
_430=Telerik.Web.UI.Editor.Utils.convertText2Html(_42e);
}
}
if(_42f){
_42f.select();
}
if(_430){
_42b.pasteHtml(_430,_42a);
}
};
if(_42b.isIE){
var _431=_42b.createRestorePoint();
var _432=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
_42d(_432,_431);
}else{
var _433=function(_434,args){
_42d(args.get_content());
};
_42b.showDialog("CleanPasteHtmlContent",{},_433);
}
};
this.Copy=function(_436,_437,args){
if(null!=args){
var _439=window.opera?false:true;
if(_439){
try{
document.queryCommandEnabled(_436);
}
catch(e){
_439=false;
}
}
if(_439){
_437.get_document().execCommand(_436,false,null);
}else{
alert(_437.getLocalizedString("UseCtrlC"));
}
}
};
this.Cut=this.Paste=function(_43a,_43b,args){
if(null!=args){
var _43d=window.opera?false:true;
if(_43d){
try{
if(!_43b.isIE7){
document.queryCommandEnabled(_43a);
}
}
catch(e){
_43d=false;
}
}
if(_43a=="Paste"&&_43d&&_43b.isIE7){
_43b.get_document().body.fireEvent("onbeforepaste");
}
if(_43d){
var oCmd=new Telerik.Web.UI.Editor.GenericCommand(_43b.getLocalizedString(_43a),_43b.get_contentWindow());
_43b.get_document().execCommand(_43a,false,null);
_43b.executeCommand(oCmd);
}else{
var id=(_43a=="Cut"?"UseCtrlX":"UseCtrlV");
alert(_43b.getLocalizedString(id));
}
}else{
_43b._pendingCutPasteCommand=new Telerik.Web.UI.Editor.GenericCommand(_43b.getLocalizedString(_43a),_43b.get_contentWindow());
}
};
this.InsertParagraph=function(_440,_441,_442){
_441.executeBrowserCommand(_440,true,"");
return true;
};
this.FormatBlock=function(_443,_444,args){
_444.executeCommand(new Telerik.Web.UI.Editor.FormatBlockCommand(_444.getLocalizedString(_443),_444.get_contentWindow(),args.value));
};
this.InsertOrderedList=this.InsertUnorderedList=function(_446,_447,args){
_447.setFocus();
_447.executeCommand(new Telerik.Web.UI.Editor.InsertListCommand(_447.getLocalizedString(_446),_447.get_contentWindow(),_447.get_newLineBr(),_446,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(_449,_44a,_44b){
_44a.setActive();
var _44c="SelectAll"!=_449;
if(_449=="Unlink"&&!_44a.isIE){
var elem=_44a.getSelectedElement();
if(elem&&elem.tagName=="A"){
_44a.selectElement(elem,false);
}
}
_44a.executeBrowserCommand(_449,_44c,null,null);
return true;
};
this.ForeColor=this.BackColor=this.FontName=this.FontSize=function(_44e,_44f,args){
var _451=args.value;
_44f.executeBrowserCommand(_44e,true,_451);
};
this.Zoom=function(_452,_453,args){
var _455=args.value;
var tool=args.get_tool?args.get_tool():null;
if(_455&&tool&&tool.updateValue){
tool.updateValue(_455);
}
_453._contentArea.style.zoom=_455;
return false;
};
this.Print=function(_457,_458,args){
if(_458.isIE){
_458.get_document().execCommand(_457,false,null);
}else{
if(_458.get_contentWindow().print){
_458.get_contentWindow().print();
}
}
return false;
};
this.InsertSnippet=function(_45a,_45b,args){
_45b.pasteHtml(args.value,_45a);
};
this.InsertFormElement=function(_45d,_45e,args){
var _460=args.value;
_460=_460.toLowerCase();
var _461=null;
switch(_460){
case "form":
_461=_45e.createElement("form","150px","150px");
_461.innerHTML="&nbsp;";
break;
case "textarea":
_461=_45e.createElement("textarea");
break;
case "select":
_461=_45e.createElement("select","100px","22px");
break;
case "checkbox":
case "radio":
_461=_45e.createElement("input");
_461.setAttribute("type",_460);
break;
case "button":
case "reset":
case "submit":
_461=_45e.createElement("input","50px","22px");
_461.setAttribute("type",_460);
break;
case "hidden":
case "password":
case "text":
_461=_45e.createElement("input","100px","22px");
_461.setAttribute("type",_460);
break;
}
if(_461){
var id=Telerik.Web.UI.Editor.Utils.getUniqueID();
_461.setAttribute("id",id);
var html=Telerik.Web.UI.Editor.Utils.getOuterHtml(_461);
_45e.pasteHtml(html,_45d);
var _464=_45e.get_document().getElementById(id);
if(_464){
_464.removeAttribute("id");
if(_464.setActive){
_464.setActive();
}
return false;
}
}
};
this.InsertGroupbox=this.InsertDate=this.InsertTime=this.InsertSymbol=this.InsertHorizontalRule=function(_465,_466,args){
var _468="";
switch(_465){
case "InsertSymbol":
_468=args.value;
break;
case "InsertHorizontalRule":
_468="<hr>";
break;
case "InsertDate":
var now=new Date();
_468="&nbsp;"+now.toLocaleDateString();
break;
case "InsertTime":
var now=new Date();
_468="&nbsp;"+now.toLocaleTimeString();
break;
default:
_468="<fieldset style='WIDTH: 200px; HEIGHT: 76px'> <legend>Title</legend>Content... </fieldset> ";
}
_466.pasteHtml(_468,_465);
};
this.ImageManager=function(_46a,_46b,_46c){
var _46d=function(_46e,args){
_46b.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_46a);
};
var _470=_46b.get_dialogOpener().get_additionalQueryString();
var _471=_46b.getSelectedElement();
if(_471&&_471.tagName.toLowerCase()=="img"){
_46b.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_471.src));
}
var args={editor:_46b};
_46b.showDialog("ImageManager",args,_46d);
_46b.get_dialogOpener().set_additionalQueryString(_470);
return false;
};
this.SilverlightManager=function(_473,_474,_475){
var _476=function(_477,args){
var html=args.Result;
var _47a=_474._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _47b=_474._filtersManager.getFilterByName("MozillaKeepFlashString");
html=(_47a)?_47a.getDesignContent(html):html;
html=(_47b)?_47b.getDesignContent(html):html;
_474.pasteHtml(html,_473);
};
var _47c={};
var _47d=_474.get_dialogOpener().get_additionalQueryString();
var _47e=_474.getSelectedElement();
if(_47e){
if($telerik.isIE&&_47e.object&&_47e.object.Movie){
var _47f=_47e.object.Movie;
_474.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_47f));
_47c.selectedItemUrl=_47f;
_47c.selectedObject=_47e;
}
}
_474.showDialog("SilverlightManager",_47c,_476);
_474.get_dialogOpener().set_additionalQueryString(_47d);
return false;
};
this.FlashManager=function(_480,_481,_482){
var _483=function(_484,args){
var _486=_481._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _487=_481._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_486)?_486.getDesignContent(html):html;
html=(_487)?_487.getDesignContent(html):html;
_481.pasteHtml(html,_480);
};
var _489={};
var _48a=_481.get_dialogOpener().get_additionalQueryString();
var _48b=_481.getSelectedElement();
if(_48b){
if($telerik.isIE&&_48b.object&&_48b.object.Movie){
var _48c=_48b.object.Movie;
_481.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_48c));
_489.selectedItemUrl=_48c;
_489.selectedObject=_48b;
}
}
_481.showDialog("FlashManager",_489,_483);
_481.get_dialogOpener().set_additionalQueryString(_48a);
return false;
};
this.MediaManager=function(_48d,_48e,_48f){
var _490=function(_491,args){
var _493=_48e._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _494=_48e._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_493)?_493.getDesignContent(html):html;
html=(_494)?_494.getDesignContent(html):html;
_48e.pasteHtml(html,_48d);
};
var _496={};
var _497=_48e.get_dialogOpener().get_additionalQueryString();
var _498=_48e.getSelectedElement();
if(_498){
if($telerik.isIE&&_498.object&&_498.object.FileName){
var _499=_498.object.FileName;
_48e.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_499));
_496.selectedItemUrl=_499;
_496.selectedObject=_498;
}
}
_48e.showDialog("MediaManager",_496,_490);
_48e.get_dialogOpener().set_additionalQueryString(_497);
return false;
};
this.TemplateManager=function(_49a,_49b,_49c){
var _49d=function(_49e,args){
_49b.pasteHtml(args.Result,_49a);
};
_49b.showDialog("TemplateManager",{},_49d);
return false;
};
this.AboutDialog=function(_4a0,_4a1,_4a2){
_4a1.showDialog("AboutDialog");
return false;
};
this.Help=function(_4a3,_4a4,_4a5){
_4a4.showDialog("Help");
return false;
};
this.PageProperties=function(_4a6,_4a7,_4a8){
var _4a9=function(_4aa,args){
};
var _4ac={};
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4ac,"BODY",_4a7,_4a6);
_4a7.showDialog("PageProperties",_4ac,_4a9);
return false;
};
this.ImageMapDialog=function(_4ad,_4ae,args){
var _4b0=Telerik.Web.UI.Editor.CommandList._getImageMapDialogArgument(_4ae);
var _4b1=function(wnd,_4b3){
Telerik.Web.UI.Editor.CommandList._setImageMapProperties(_4ae,_4b3);
return false;
};
_4ae.showDialog("ImageMapDialog",_4b0,_4b1);
return false;
};
this._setImageMapProperties=function(_4b4,args){
if(!args){
return;
}
var _4b6=_4b4.getSelectedElement();
var _4b7;
if(_4b6&&_4b6.tagName=="IMG"){
_4b7=_4b6;
if(args.ImageSrc!=_4b7.src){
_4b7.src=args.ImageSrc;
}
}else{
if(!args.ImageSrc){
return;
}
_4b4.pasteHtml("<img src=\""+args.ImageSrc+"\" id = \"__tmp__\">");
_4b7=_4b4.get_document().getElementById("__tmp__");
_4b7.removeAttribute("id");
if(document.all){
var oRng=_4b4.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_4b7);
oRng.select();
}
}
var _4b9=document.createElement("SPAN");
_4b9.innerHTML=args.MapHtml;
var _4ba=_4b9.getElementsByTagName("map");
if(_4ba.length==0){
return;
}
var _4bb=_4ba[0].innerHTML;
_4b9=null;
if(!_4bb){
_4b7.removeAttribute("useMap");
return;
}
var _4bc="";
var map=null;
var _4be=_4b7.getAttribute("useMap");
if(_4be){
_4bc=_4be.substr(1);
map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_4b4,_4bc);
}
if(map==null){
var _4bf=new Date()-100;
var _4bc="rade_img_map_"+_4bf;
map=_4b4.get_document().createElement("map");
map.id=_4bc;
this._setNameAttribute(map,_4bc);
map=_4b4.get_document().body.appendChild(map);
_4b7.setAttribute("useMap","#"+_4bc);
_4b7.setAttribute("border","0");
}
map.innerHTML=_4bb;
};
this._setNameAttribute=function(_4c0,name){
_4c0.removeAttribute("name");
_4c0.removeAttribute("NAME");
_4c0.name=null;
_4c0.name=name;
_4c0["NAME"]=name;
};
this._getImageMapDialogArgument=function(_4c2){
var _4c3={};
_4c3._editor=_4c2;
var _4c4=_4c2.getSelectedElement();
if(_4c4&&_4c4.tagName=="IMG"){
_4c3.ImageSrc=_4c4.getAttribute("src",2);
_4c3.ImageWidth=(_4c4.style.width)?_4c4.style.width:_4c4.width;
_4c3.ImageHeight=(_4c4.style.height)?_4c4.style.height:_4c4.height;
if($telerik.isIE){
var oRng=_4c2.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_4c4);
oRng.select();
}
if(_4c4.useMap){
var _4c6=_4c4.getAttribute("useMap").substr(1);
var map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_4c2,_4c6);
if(map!=null){
_4c3.ImageMapHTML="<map name = \""+_4c6+"\">"+map.innerHTML+"</map>";
}else{
_4c3.ImageMapHTML="";
}
_4c4.style.width=_4c3.ImageWidth;
_4c4.style.height=_4c3.ImageHeight;
}
}
return _4c3;
};
this._getImageMapByName=function(_4c8,_4c9){
var _4ca=_4c8.get_document();
var map=_4ca.getElementById(_4c9);
if(map!=null){
return map;
}
var maps=_4ca.getElementsByTagName("map");
for(var i=0;i<maps.length;i++){
if(maps[i].getAttribute("name")==_4c9){
return maps[i];
}
}
return null;
};
this.DocumentManager=function(_4ce,_4cf,_4d0){
var _4d1={};
var _4d2=function(_4d3,args){
_4cf.pasteHyperLink(args.Result,_4ce);
};
var _4d5=_4cf.get_dialogOpener().get_additionalQueryString();
var _4d6=_4cf.getSelectedElement();
if(_4d6&&_4d6.tagName.toLowerCase()=="a"){
_4cf.get_dialogOpener().set_additionalQueryString(_4d5+"&PreselectedItemUrl="+encodeURIComponent(_4d6.href));
}
_4cf.showDialog("DocumentManager",_4d1,_4d2);
_4cf.get_dialogOpener().set_additionalQueryString(_4d5);
return false;
};
this.TableWizard=function(_4d7,_4d8,_4d9){
var _4da=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4d8,null,true,false);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4da,"TABLE",_4d8,_4d7);
var _4db=function(_4dc,args){
_4d8.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4d7);
};
_4d8.showDialog("TableWizard",_4da,_4db);
return false;
};
this.SetTableProperties=function(_4de,_4df,_4e0){
var _4e1=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4df,1,false,true);
if(!_4e1){
alert(_4df.getLocalizedString("tablewarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4e1,"TABLE",_4df,_4de);
var _4e2=Telerik.Web.UI.Editor.CommandList._getParentTable(_4df);
var _4e3=function(_4e4,args){
_4df.selectElement(_4e2);
_4df.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4de);
};
if(_4df.get_document().selection&&_4df.get_document().selection.empty){
_4df.get_document().selection.empty();
}
_4df.showDialog("TableWizard",_4e1,_4e3);
return false;
};
this.SetCellProperties=function(_4e6,_4e7,_4e8){
var _4e9=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4e7,2,false,true);
if(!_4e9){
alert(_4e7.getLocalizedString("cellwarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4e9,"TABLE",_4e7,_4e6);
var _4ea=Telerik.Web.UI.Editor.CommandList._getParentTable(_4e7);
var _4eb=function(_4ec,args){
_4e7.selectElement(_4ea);
_4e7.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4e6);
};
_4e7.showDialog("TableWizard",_4e9,_4eb);
return false;
};
this.FindAndReplace=function(_4ee,_4ef,_4f0){
var _4f1={};
_4f1._editor=_4ef;
var _4f2=function(_4f3,args){
};
_4ef.showDialog("FindAndReplace",_4f1,_4f2);
return false;
};
this.StyleBuilder=function(_4f5,_4f6,_4f7){
var _4f8=function(_4f9,args){
_4f6.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_4f5);
};
var _4fb={};
var _4fc=_4f6.getSelection();
var _4fd=_4fc.getParentElement();
if(!_4fc.isControl()){
var _4fe=_4fc.getHtml();
if(_4fe!=""||(_4fd&&_4fd.tagName&&_4fd.tagName.toLowerCase()=="body")){
var _4ff=_4f6.createElement("span");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_4ff,_4fe);
_4fd=_4ff;
}else{
_4f6.selectElement(_4fd,false);
}
}
_4fb.htmlElement=_4fd;
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4fb,"*",_4f6,_4f5);
_4fb.fontNames=_4f6.get_fontNames();
_4f6.showDialog("StyleBuilder",_4fb,_4f8);
return false;
};
this.XhtmlValidator=function(_500,_501,_502){
var _503=_501;
var _504=function(_505,args){
};
_501.showDialog("XhtmlValidator",_503,_504);
return false;
};
this.TrackChangesDialog=function(_507,_508,_509){
var _50a=_508;
var _50b=function(_50c,args){
};
_508.showDialog("TrackChangesDialog",_50a,_50b);
};
this.InsertCustomLink=function(_50e,_50f,args){
var link=args.value;
var _512=String.format("<a href='{1}' title='{3}' target='{2}'>{0}</a>",link.innerHTML,link.href,link.target,link.title);
var _513=Telerik.Web.UI.Editor.CommandList._getParentLink(_50f);
if(_513){
var _514=_513.cloneNode(true);
if(link.href){
_514.setAttribute("href",link.href);
}
if(link.target){
_514.setAttribute("target",link.target);
}
if(link.title){
_514.setAttribute("title",link.title);
}
if(!_514.innerHTML){
_514.innerHTML=link.innerHTML;
}
_512=Telerik.Web.UI.Editor.Utils.getOuterHtml(_514);
}
_50f.pasteHtml(_512,_50e);
};
this._getDialogArguments=function(_515,_516,_517,_518){
_515.Colors=_517.get_colors();
if("TD"==_516||"TH"==_516||"TABLE"==_516){
_515.CssClasses=_517.getCssArray("TABLE");
_515.CellCssClasses=_517.getCssArray("TD");
}else{
if("A"==_516||"BODY"==_516||"IMG"==_516){
_515.CssClasses=_517.getCssArray(_516);
}
}
_515.Editor=_517;
};
this.SetLinkProperties=this.LinkManager=function(_519,_51a,_51b){
var _51c=Telerik.Web.UI.Editor.CommandList._getLinkArgument(_51a);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_51c,"A",_51a,_519);
var _51d=function(_51e,args){
_51a.pasteHyperLink(args.realLink,_519);
};
_51a.showDialog("LinkManager",_51c,_51d);
return false;
};
this.SetImageProperties=function(_520,_521,_522){
var _523=_521.getSelectedElement();
if(_523.nodeName.toLowerCase()!="img"){
return false;
}
var _524={};
_524.Element=_523;
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_524,"IMG",_521,_520);
var _525=function(_526,args){
if(_523&&_523.parentNode){
_523.parentNode.replaceChild(args.Result,_523);
}else{
_521.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_520);
}
};
_521.showDialog("ImageProperties",_524,_525);
return false;
};
this.FormatCodeBlock=function(_528,_529,_52a){
var _52b={dirtyCode:_529.getSelectionHtml()};
if(_529.get_document().selection&&_529.get_document().selection){
var _52c=_529.get_document().selection.type.toLowerCase();
if(_52c=="control"||_52c=="none"){
_52b.dirtyCode="";
}
}
var _52d=function(_52e,args){
_529.pasteHtml(args.get_code(),_528);
};
_529.showDialog("FormatCodeBlock",_52b,_52d);
return false;
};
this._getDocumentAnchors=function(_530){
var _531=_530.getElementsByTagName("A");
var _532=new Array();
for(var i=0;i<_531.length;i++){
if(_531[i].name){
_532[_532.length]=_531[i];
}
}
return _532;
};
this._getParentLink=function(_534){
_534.setFocus();
var _535=_534.getSelectedElement();
var _536=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_535,"A");
if(_536){
_534.selectElement(_536);
}else{
var _537="";
if(_535&&_535.tagName=="IMG"){
_537=Telerik.Web.UI.Editor.Utils.getOuterHtml(_535);
}else{
_537=_534.getSelection().getHtml();
}
_536=_534.get_document().createElement("A");
try{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_536,_537);
}
catch(e){
_536.innerHTML=Telerik.Web.UI.Editor.Utils.stripFormatting(_537,"ALL");
}
}
return _536;
};
this._getLinkArgument=function(_538,_539){
var _53a=Telerik.Web.UI.Editor.CommandList._getParentLink(_538);
var _53b=_53a.innerHTML;
var _53c=!_53b?false:_53b.match(/</);
if($telerik.isIE&&_53c){
if(_53b.trim().toLowerCase()=="<p>&nbsp;</p>"){
_53a.innerHTML=" ";
_53c=false;
}
}
return {selectedTabIndex:_539?_539:0,realLink:_53a.cloneNode(true),showText:!_53c,documentAnchors:Telerik.Web.UI.Editor.CommandList._getDocumentAnchors(_538.get_document())};
};
this._getParentTable=function(_53d){
_53d.setFocus();
var _53e=_53d.getSelectedElement();
var _53f=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_53e,"TABLE");
return _53f;
};
this._getParentCell=function(_540){
_540.setFocus();
var _541=_540.getSelectedElement();
var _542=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_541,"TD");
return _542;
};
this._getTableArgument=function(_543,_544,_545,_546){
var _547;
var _548=null;
if(_545){
_547=Telerik.Web.UI.Editor.Utils.createTable(2,2,_543._document);
}else{
_547=Telerik.Web.UI.Editor.CommandList._getParentTable(_543);
}
if(!_545&&!_547){
return null;
}
if(_546){
_548=Telerik.Web.UI.Editor.CommandList._getParentCell(_543);
}
var _549=_547.cloneNode(true);
var _54a=_547;
return {selectedTabIndex:_544?_544:0,cellToModify:_548,tableToModify:_549,originalTable:_54a,tableDocument:(_549.document)?_549.document:_543.get_document()};
};
this.EnterParagraphMozilla=function(_54b,_54c,args){
var _54e=_54c.getSelectedElement();
if("LI"==_54e.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_54e,"LI")!=null){
_54c.bubbleKeyEventToBrowser();
return false;
}
var _54f=_54c.get_contentWindow();
var oDoc=_54f.document;
function checkParent(_551,_552){
_552[_552.length]=_551;
while(_551!=null&&_551.tagName!="P"){
if(_551.tagName=="TD"){
return null;
}
_551=_551.parentNode;
_552[_552.length]=_551;
}
return _551;
}
var _553=_54f.getSelection();
var _554=_553.getRangeAt(0);
var _555=_554.cloneRange();
_554.deleteContents();
var _556=_554.startOffset;
var _557=_554.startContainer;
var _558="";
var _559=[];
var inP=checkParent(_557,_559);
if(inP){
var _55b=(inP.innerHTML=="");
var _55c=_554.cloneRange();
_55c.setStart(inP,0);
_55c.setEnd(_557,_556);
var _55d=_55c.cloneContents();
var _55e=_554.cloneRange();
_55e.setStart(_557,_556);
if(inP.lastChild){
_55e.setEndAfter(inP.lastChild);
}else{
_55e.setEnd(inP,0);
}
var _55f=_55e.cloneContents();
_554.selectNode(inP);
_553.removeAllRanges();
_553.addRange(_554);
inP=inP.cloneNode(true);
inP.innerHTML="";
var _560=inP.cloneNode(true);
if(_55b){
_560.innerHTML="&nbsp;";
}else{
_560.appendChild(_55d);
}
endPar=inP.cloneNode(true);
endPar.appendChild(_55f);
var newP=inP.cloneNode(true);
var _562=newP;
if(_559.length>0){
for(var i=_559.length;i>0;i--){
var _564=_559[i];
var _565=_564&&_564.cloneNode?_564.cloneNode(false):null;
if(_565&&_565.tagName!="P"){
_562.appendChild(_565);
_562=_565;
}
}
}
_562.innerHTML="&nbsp;";
_562.setAttribute("id","radETempNode");
var _566=oDoc.createElement("div");
_566.appendChild(_560);
_566.appendChild(newP);
if(!_55b){
_566.appendChild(endPar);
}
_558=_566.innerHTML;
}else{
_558="<p id='radETempNode'>&nbsp;</p>";
}
_54c.pasteHtml(_558,"Enter",false,false,false);
oP=oDoc.getElementById("radETempNode");
if(oP){
oP.removeAttribute("id",0);
var _553=_54f.getSelection();
var _554=oDoc.createRange();
_554.selectNodeContents(oP);
_553.removeAllRanges();
_553.addRange(_554);
}
var ps=oDoc.getElementsByTagName("P");
for(var i=0;i<ps.length;i++){
var _568=ps[i].innerHTML;
if(_568==""||_568.trim().toLowerCase()=="<br>"){
ps[i].parentNode.removeChild(ps[i]);
}
}
return false;
};
this.Enter=function(_569,_56a,args){
var _56c=_56a.getSelectedElement();
if("LI"==_56c.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_56c,"LI")!=null){
_56a.bubbleKeyEventToBrowser();
return false;
}
try{
var _56d=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_56a.get_contentWindow());
var _56e=_56a.get_document().selection.createRange();
if(_56e.pasteHTML){
var tag=_56c.tagName;
if(tag.charAt(0)=="H"&&parseInt(tag.charAt(1))>0){
var _570=_56e.duplicate();
_570.moveToElementText(_56c);
_56a.bubbleKeyEventToBrowser();
return false;
}
_56e.pasteHTML("<br>");
_56e.select();
_56e.moveEnd("character",1);
_56e.moveStart("character",1);
_56e.collapse(false);
}else{
if(_56e(0)){
_56e.execCommand("Delete");
}
}
_56a.executeCommand(_56d);
}
catch(exc){
alert(exc.message);
}
return false;
};
this.ShiftEnter=function(_571,_572,args){
var _574=_572.getSelectedElement();
if("LI"==_574.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_574,"LI")!=null){
var _575=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_572.get_contentWindow());
var _576=_572.get_document().selection.createRange();
_576.pasteHTML("<br>");
_576.select();
_576.moveEnd("character",1);
_576.moveStart("character",1);
_576.collapse(false);
_572.executeCommand(_575);
return false;
}
_572.bubbleKeyEventToBrowser();
return false;
};
this.ToggleTableBorder=function(_577,_578,args){
_578.toggleEnhancedEdit();
return false;
};
this.RealFontSize=function(_57a,_57b,args){
var _57d=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_57b);
var _57e=_57d.markedElements;
var _57f=_57b.createRestorePoint();
var _580=new Telerik.Web.UI.Editor.GenericCommand(_57b.getLocalizedString(_57a),_57b.get_contentWindow());
if(_57e.length==0){
var _581=_57b.getSelection().getParentElement();
if($telerik.isIE&&!_57b.getSelection().getHtml()&&(_581.tagName=="FONT"||_581.tagName=="SPAN")){
_57b._document.execCommand("RemoveFormat",null,false);
}
_57b.pasteHtml("<font style='font-size:"+args.value+"' id='radERealFont'>&nbsp;</font>",_57a);
var _582=_57b._document.getElementById("radERealFont");
_582.removeAttribute("id");
if($telerik.isIE){
_57b.selectElement(_582);
_57b.getSelection().collapse();
_582.innerHTML="";
}else{
if(_57b._contentWindow.getSelection){
var oSel=_57b._contentWindow.getSelection();
var _584=_57b.getSelection().getRange();
oSel.removeAllRanges();
if(_584&&_584.selectNodeContents){
_584.selectNodeContents(_582);
}
oSel.addRange(_584);
}
}
}else{
for(var i=0;i<_57e.length;i++){
_57e[i].style.fontSize=args.value;
_57e[i].removeAttribute("size");
}
if(_57f){
_57f.select();
}
_57b.executeCommand(_580);
}
};
this.ConvertToUpper=this.ConvertToLower=function(_586,_587,args){
var _589;
var endR;
if($telerik.isIE){
if(_587._document.selection.type.toLowerCase()=="control"){
return;
}
var _58b=_587._document.selection.createRange();
_589=_58b.duplicate();
endR=_58b.duplicate();
_589.collapse();
endR.collapse(false);
}
var _58c=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_587);
var _58d=_58c.markedElements;
var _58e=_58c.newElements;
var _58f=new Telerik.Web.UI.Editor.GenericCommand(_587.getLocalizedString(_586),_587.get_contentWindow());
for(var i=0;i<_58d.length;i++){
changeChildNodesCase(_58d[i]);
}
for(var i=0;i<_58e.length;i++){
if($telerik.isIE){
_58e[i].removeNode(false);
}else{
var _591=document.createRange();
_591.selectNodeContents(_58e[i]);
_58e[i].parentNode.replaceChild(_591.extractContents(),_58e[i]);
}
}
if($telerik.isIE){
var _592=_587._document.selection.createRange();
_592.setEndPoint("StartToStart",_589);
_592.setEndPoint("EndToEnd",endR);
_592.select();
}else{
var _593=_587.get_contentWindow().getSelection();
var rng=_593.getRangeAt(0);
rng.collapse(true);
}
_587.executeCommand(_58f);
function changeChildNodesCase(_595){
var _596=_595.childNodes;
for(var i=0;i<_596.length;i++){
if(_596[i].nodeType==3){
_596[i].nodeValue=("ConvertToLower"==_586)?_596[i].nodeValue.toLowerCase():_596[i].nodeValue.toUpperCase();
}else{
if(_596[i].nodeType==1&&_596[i].tagName.toUpperCase()!="FONT"){
changeChildNodesCase(_596[i]);
}
}
}
}
};
this.ApplyClass=function(_598,_599,args){
var _59b=args.value;
var _59c=_599.get_document();
var _59d=_599.createRestorePoint();
var _59e=new Telerik.Web.UI.Editor.GenericCommand(_599.getLocalizedString(_598),_599.get_contentWindow());
if(_599.isIE){
var _59f=_59c.selection.createRange();
var _5a0=(_59f.length>0?_59f(0):_59f.parentElement());
if(_5a0.tagName=="LI"){
var _5a1=_59f.htmlText;
var _5a2=_5a1.match(/<LI\/?>/gi);
var _5a3=_5a2?_5a2.length:0;
if(_5a3>1){
_5a0=_5a0.parentNode;
}else{
if(_5a3==0&&(Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_5a0,_59f.htmlText))&&_5a0.parentNode.childNodes.length==1){
_5a0=_5a0.parentNode;
}
}
}
if(_59f.length>0||_5a0.tagName=="OL"||_5a0.tagName=="UL"){
_5a0.className=_59b;
return;
}
}
var _5a4=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_599);
var _5a5=_5a4.markedElements;
if(_5a5.length==0){
var _5a6=_599.getSelection().getParentElement();
if($telerik.isIE&&!_599.getSelection().getHtml()&&(_5a6.tagName=="FONT"||_5a6.tagName=="SPAN")){
_599._document.execCommand("RemoveFormat",null,false);
}
_599.pasteHtml("<font class='"+_59b+"' id='radERealFont'>&nbsp;</font>",_598);
var _5a7=_599._document.getElementById("radERealFont");
_5a7.removeAttribute("id");
if($telerik.isIE){
_599.selectElement(_5a7);
_599.getSelection().collapse();
_5a7.innerHTML="";
}else{
if(_599._contentWindow.getSelection){
var oSel=_599._contentWindow.getSelection();
var _5a9=_599.getSelection().getRange();
oSel.removeAllRanges();
if(_5a9&&_5a9.selectNodeContents){
_5a9.selectNodeContents(_5a7);
}
oSel.addRange(_5a9);
}
}
}else{
for(var i=0;i<_5a5.length;i++){
_5a5[i].className=_59b;
}
if(_59d){
_59d.select();
}
_599.executeCommand(_59e);
}
};
this._markEditorSelection=function(_5ab){
if(_5ab.get_html()==""){
return {markedElements:[],newElements:[]};
}
var _5ac="AZBY";
var _5ad="_cm";
var _5ae=[];
var _5af=[];
var _5b0=[];
var _5b1=$telerik.isSafari?"span":"font";
var _5b2=_5ab._contentArea;
var _5b3=_5ab.getSelection();
if(_5b3.isControl()){
var _5b4=_5b3.getParentElement();
var _5b5=_5ab._document.createElement(_5b1);
_5b5.appendChild(_5b4.cloneNode(true));
_5b4.parentNode.replaceChild(_5b5,_5b4);
return {markedElements:[_5b5],newElements:[_5b5]};
}
if(!$telerik.isSafari){
keepFontNames();
}
if(!$telerik.isIE){
_5b2.ownerDocument.execCommand("UseCSS",false,true);
_5b2.ownerDocument.execCommand("styleWithCSS",false,false);
}
_5b2.ownerDocument.execCommand("FontName",false,_5ac);
var _5b6=_5b2.getElementsByTagName(_5b1);
for(var i=0;i<_5b6.length;i++){
var _5b5=_5b6[i];
if(_5b5.getAttribute("face")==_5ac||_5b5.style.fontFamily==_5ac){
_5b5.removeAttribute("face");
if(_5b5.style.fontFamily==_5ac){
_5b5.style.fontFamily="";
}
_5af.push(_5b5);
var _5b8=_5b5.getElementsByTagName(_5b1);
for(var j=0;j<_5b8.length;j++){
var _o=_5b8[j];
if(_o.getAttribute("face")!=_5ac){
_5af.push(_o);
}
}
if(!_5b5.getAttribute(_5ad)){
_5b0.push(_5b5);
}
}
_5b5.removeAttribute(_5ad);
}
if(!$telerik.isSafari){
restoreFontNames();
}
if(!$telerik.isIE){
_5b2.ownerDocument.execCommand("UseCSS",false,false);
_5b2.ownerDocument.execCommand("styleWithCSS",false,true);
}
function keepFontNames(){
var _5bb=_5ab._contentArea.getElementsByTagName(_5b1);
for(var i=0;i<_5bb.length;i++){
var _5bd=_5bb[i];
if(_5bb[i].face){
_5bd.setAttribute("_face",_5bd.face);
_5ae.push(_5bd);
}
_5bd.setAttribute(_5ad,1);
}
}
function restoreFontNames(){
for(var i=0;i<_5ae.length;i++){
_5ae[i].face=_5ae[i].getAttribute("_face");
_5ae[i].removeAttribute("_face");
}
_5ae=[];
}
return {markedElements:_5af,newElements:_5b0};
};
})();
if(typeof (RadEditorCommandList)=="undefined"){
var RadEditorCommandList=Telerik.Web.UI.Editor.CommandList;
}
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandsManager=function(_5bf){
this._commands=[];
this._currentCommandIndex=-1;
};
Telerik.Web.UI.Editor.CommandsManager.prototype={get_commands:function(){
return this._commands;
},execute:function(_5c0,_5c1){
if(_5c0&&_5c0.execute){
var _5c2=_5c0.execute();
if(false==_5c1){
return false;
}
if(_5c2&&_5c0._canUnexecute){
this._clearCommandsToRedo();
Array.add(this._commands,_5c0);
this._currentCommandIndex=this._commands.length-1;
return true;
}
}
return false;
},undo:function(_5c3){
if(_5c3>this._commands.length){
_5c3=this._commands.length;
}
var _5c4=0;
var _5c5=null;
while(0<_5c3--&&0<=this._currentCommandIndex&&this._currentCommandIndex<this._commands.length){
_5c5=this._commands[this._currentCommandIndex--];
if(_5c5){
_5c5.unexecute();
_5c4++;
}
}
},redo:function(_5c6){
if(_5c6>this._commands.length){
_5c6=this._commands.length;
}
var _5c7=0;
var _5c8=null;
var _5c9=this._currentCommandIndex+1;
while(0<_5c6--&&0<=_5c9&&_5c9<this._commands.length){
_5c8=this._commands[_5c9];
if(_5c8){
_5c8.execute();
this._currentCommandIndex=_5c9;
_5c7++;
}
_5c9++;
}
},removeCommandAt:function(_5ca){
this._commands.splice(_5ca,1);
if(this._currentCommandIndex>=_5ca){
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 _5cb=this._commands[this._currentCommandIndex].clone();
this.execute(_5cb);
}
},_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,EncodeScripts:512,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(_5cc){
return _5cc;
},getDesignContent:function(_5cd){
return _5cd;
},get_isDom:function(){
return this.IsDom;
},set_isDom:function(_5ce){
this.IsDom=_5ce;
},get_enabled:function(){
return this.Enabled;
},set_enabled:function(_5cf){
this.Enabled=_5cf;
},get_name:function(){
return this.Name;
},set_name:function(_5d0){
this.Name=_5d0;
},get_description:function(){
return this.Description;
},set_description:function(_5d1){
this.Description=_5d1;
}};
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(_5d2){
return this._performStripping(_5d2);
},getDesignContent:function(_5d3){
return this._performStripping(_5d3);
},_performStripping:function(_5d4){
var _5d5=_5d4.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
_5d5=_5d5.replace(RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
return _5d5;
}};
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(_5d6){
var _5d7=new RegExp("<!"+"--RADEDITORSAVEDTAG_([\\s\\S]*?)--"+">","ig");
var _5d8=new RegExp("--RADEDITORSAVEDTAGENDING>","ig");
var _5d9=_5d6.replace(_5d7,"<$1>");
_5d9=_5d9.replace(_5d8,"--"+">");
return _5d9;
},getDesignContent:function(_5da){
var _5db=function(_5dc,_5dd,_5de,_5df,_5e0){
var _5e1=_5e0.substring(0,_5df).lastIndexOf("<!"+"--");
var _5e2=_5e0.substring(0,_5df).lastIndexOf("--"+">");
if(_5e1>_5e2){
_5e1=_5e0.substring(_5df,_5e0.length).indexOf("<!"+"--");
_5e2=_5e0.substring(_5df,_5e0.length).indexOf("--"+">");
if((_5e1==-1&&_5e2>-1)||(_5e2<_5e1)){
return _5dc;
}
}
var _5e3=_5de.replace("--"+">","--RADEDITORSAVEDTAGENDING>");
var _5e4="<!"+"--RADEDITORSAVEDTAG_"+_5dd+_5e3+"--"+">";
return _5e4;
};
var _5e5=new RegExp("<(script|noscript)([\\s\\S]*?<\\/\\1)>","ig");
var _5e6=_5da.replace(_5e5,_5db);
return _5e6;
}};
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(_5e7){
return this._performStripping(_5e7);
},_performStripping:function(_5e8){
var _5e9=_5e8;
_5e9=_5e9.replace(/<BR\s?\/?>\s*<\/(H1|H2|H3|H4|H5|H6|LI|P)/ig,"</$1");
_5e9=_5e9.replace(/<(H1|H2|H3|H4|H5|H6|LI|P)([^>]*)?><BR\s?\/?>/ig,"<$1 $2>");
return _5e9;
}};
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(_5ea,_5eb){
var _5ec=_5ea.getElementsByTagName(_5eb);
if(!_5ec){
_5ec=_5ea.ownerDocument.getElementsByTagName(_5eb);
}
return _5ec;
},fixLists:function(_5ed,_5ee){
var _5ef=this._getElements(_5ed,_5ee);
for(var i=_5ef.length-1;i>=0;i--){
var list=_5ef[i];
var _5f2=list.previousSibling;
if(_5f2&&_5f2.nodeType==3){
_5f2=_5f2.previousSibling;
}
if(_5f2&&"li"==list.previousSibling.nodeName.toLowerCase()){
_5f2.appendChild(list.cloneNode(true));
var _5f3=list.parentNode;
_5f3.removeChild(list);
_5f3=null;
}
}
},getHtmlContent:function(_5f4){
this.fixLists(_5f4,"OL");
this.fixLists(_5f4,"UL");
return _5f4;
}};
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(_5f5,_5f6){
var _5f7=_5f5.getElementsByTagName(_5f6);
if(!_5f7){
_5f7=_5f5.ownerDocument.getElementsByTagName(_5f6);
}
return _5f7;
},_replaceElementWithSpan:function(_5f8,_5f9,_5fa){
var _5fb=this._getElements(_5f8,_5f9);
while(_5fb.length>0){
var _5fc=_5f8.ownerDocument.createElement("span");
_5fc.style.cssText=_5fa;
var _5fd=_5fb[0].innerHTML;
if($telerik.isIE&&_5fd==" "){
_5fc.innerText=_5fd;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_5fc,_5fd);
}
_5fb[0].parentNode.replaceChild(_5fc,_5fb[0]);
_5fb=this._getElements(_5f8,_5f9);
}
},_replaceSpanWithElement:function(_5fe,_5ff,_600){
var _601=this._getElements(_5fe,"span");
var _602=_601.length-1;
while(_602>=0){
var _603=[];
var _604=_601[_602];
for(var i=0;i<_604.childNodes.length;i++){
Array.add(_603,_604.childNodes[i].cloneNode(true));
}
if(_604.style.cssText.toLowerCase()==_600||_604.style.cssText.toLowerCase()==(_600+";")){
var _606=_5fe.ownerDocument.createElement(_5ff);
for(var j=0;j<_603.length;j++){
_606.appendChild(_603[j]);
}
_604.parentNode.replaceChild(_606,_601[_602]);
_601=this._getElements(_5fe,"span");
_602=_601.length-1;
}else{
_602--;
}
}
},getHtmlContent:function(_608){
this._replaceElementWithSpan(_608,"u","text-decoration:underline;");
return _608;
},getDesignContent:function(_609){
this._replaceSpanWithElement(_609,"u","text-decoration: underline");
return _609;
}};
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(_60a){
var _60b=new RegExp("<!"+"--RADEDITORSAVEDCOMMENT","ig");
var _60c=_60a.replace(_60b,"<!--");
return _60c;
},getDesignContent:function(_60d){
var _60e=new RegExp("<!"+"--(\\[[^]]+\\][\\s\\S]*?)-"+"->","ig");
var _60f=_60d.replace(_60e,"<!-"+"-RADEDITORSAVEDCOMMENT$1-"+"->");
return _60f;
}};
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(_610){
var _611=new RegExp("<param([\\s\\S]+?)?>","ig");
var _612=new RegExp("<rade_param([\\s>])","ig");
var _613=_610;
if(_611.test(_610)&&_612.test(_610)){
_613=_613.replace(_611,"");
}
_613=_613.replace(_612,"<param$1");
_613=_613.replace(/<\/rade_param>/gi,"");
return _613;
},getDesignContent:function(_614){
var _615=new RegExp("<param([\\s\\S]+?)/?>","ig");
var _616=_614.replace(_615,"<rade_param$1></rade_param><param$1>");
return _616;
}};
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 _618=node.parentNode;
if(_618!=null){
while(node.childNodes&&node.childNodes.length>0){
_618.insertBefore(node.childNodes[0],node);
}
_618.removeChild(node);
return _618;
}
return true;
},getHtmlContent:function(_619){
var _61a=null;
if(_619.tagName.toLowerCase()=="html"){
_61a=_619.getElementsByTagName("BODY")[0];
}else{
_61a=_619;
}
if($telerik.isIE){
if(_61a&&(_61a.firstChild)&&("P"==_61a.firstChild.tagName)&&(_61a.childNodes.length==1)&&(_61a.innerHTML.substring(0,3).toLowerCase()=="<p>")){
this._removeNode(_61a.firstChild);
}
}else{
if(_61a&&(_61a.childNodes.length==1)&&(_61a.firstChild.tagName)&&("br"==_61a.firstChild.tagName.toLowerCase())){
_61a.innerHTML="";
}
}
return _619;
}};
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(_61b){
var re=new RegExp("(<p[^>]*>)(<\\/p>)","ig");
var _61d=_61b.replace(re,"$1&nbsp;$2");
return _61d;
}};
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(_61e){
var _61f=document.location.href;
var re=new RegExp("(<A[^<>]*?(href)\\s*=\\s*['\"])("+_61f+")(\\#[^'\"]*?['\"][^>]*?>)","ig");
var _621=_61e.replace(re,"$1$4");
return _621;
}};
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(_622){
var _623=_622.replace(new RegExp("<b(\\s([^>])*?)?>","ig"),"<strong$1>");
_623=_623.replace(new RegExp("</b(\\s([^>])*?)?>","ig"),"</strong$1>");
_623=_623.replace(new RegExp("<i(\\s([^>])*?)?>","ig"),"<em$1>");
_623=_623.replace(new RegExp("</i(\\s([^>])*?)?>","ig"),"</em$1>");
return _623;
},getDesignContent:function(_624){
var _625=_624.replace(new RegExp("<strong(\\s([^>])*?)?>","ig"),"<b$1>");
_625=_625.replace(new RegExp("</strong(\\s([^>])*?)?>","ig"),"</b$1>");
_625=_625.replace(new RegExp("<em(\\s([^>])*?)?>","ig"),"<i$1>");
_625=_625.replace(new RegExp("</em(\\s([^>])*?)?>","ig"),"</i$1>");
return _625;
}};
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(_626){
var self=this;
var _628=function(_629,_62a,_62b,_62c,_62d){
var _62e=_62d.indexOf("</head>",_62c);
if(_62e!=-1&&_62d.indexOf("<body",_62e)!=-1){
return _629;
}else{
self.markerCounter++;
var _62f="RadEditorStyleKeeper"+self.markerCounter;
var _630="<div id='"+_62f+"' style='display:none;'>&nbsp;</div><"+_62a+" reoriginalpositionmarker='"+_62f+"'"+_62b;
return _630;
}
};
var _631=new RegExp("<(link|style)([^>]*>)","gi");
var _632=_626.replace(_631,_628);
return _632;
}};
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(_633){
var _634=_633.getElementsByTagName("HEAD")[0];
var _635=true;
if(!_634){
_634=_633.ownerDocument.getElementsByTagName("HEAD")[0];
_635=false;
}
if(!_634){
return _633;
}
this._restoreElements(_634,_633,"STYLE");
this._restoreElements(_634,_633,"LINK");
var divs=_633.getElementsByTagName("DIV");
if(divs){
for(var j=divs.length-1;j>=0;j--){
var _638=divs[j];
if(_638.id.indexOf("RadEditorStyleKeeper")==0){
var _639=_638.parentNode;
_639.removeChild(_638);
}
}
}
divs=null;
if(_635){
this._removeElements(_634,"STYLE");
this._removeElements(_634,"LINK");
}
this._removeMarkerAttributes(_633,"STYLE");
this._removeMarkerAttributes(_633,"LINK");
return _633;
},_restoreElements:function(_63a,_63b,_63c){
var _63d;
_63d=_63a.getElementsByTagName(_63c);
this._divs=_63b.getElementsByTagName("DIV");
var i=0;
while(_63d.length>0&&i<_63d.length){
this._restoreStyle(_63d[i++]);
}
},_restoreStyle:function(_63f){
var _640=_63f.getAttribute("reoriginalpositionmarker");
if(_640){
j=0;
var _641=null;
while(j<this._divs.length&&!_641){
if(this._divs[j].id==_640){
_641=this._divs[j];
}
j++;
}
if(_641){
var _642=_63f.cloneNode(true);
_642.removeAttribute("reoriginalpositionmarker");
var _643=_641.parentNode;
_643.replaceChild(_642,_641);
return true;
}
}
return false;
},_removeElements:function(_644,_645){
var _646=_644.getElementsByTagName(_645);
if(_646){
for(var j=_646.length-1;j>=0;j--){
var _648=_646[j];
if(null!=_648.getAttribute("reoriginalpositionmarker")){
var _649=_648.parentNode;
_649.removeChild(_648);
}
}
_646=null;
}
},_removeMarkerAttributes:function(_64a,_64b){
styles=_64a.getElementsByTagName(_64b);
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(_64d){
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=_64d?_64d:"FlashManager.gif";
};
Telerik.Web.UI.Editor.MozillaKeepFlashString.prototype={getDesignContent:function(_64e){
var _64f=this;
var _650=function(_651,gr1,gr2,gr3,str,_656){
var _657=String.format("<img isflash=\"true\" {0} />{1}",gr1,gr2);
_657=_657.replace(/\ssrc=/gi,String.format(" src=\"{0}\" flashSrc=",_64f._flashImageSrc));
return _657;
};
var _658=new RegExp("<embed([^>]*)?>(.*)?(<\\/embed>)?","ig");
var _659=_64e.replace(_658,_650);
return _659;
}};
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(_65a){
if(!_65a){
return _65a;
}
var _65b=_65a.getElementsByTagName("IMG");
for(var i=0;i<_65b.length;i++){
var _65d=_65b[i];
var _65e=_65d.getAttribute("isflash");
if(_65e!=null){
var _65f=_65d.getAttribute("flashSrc");
var _660=Telerik.Web.UI.Editor.Utils.getOuterHtml(_65d);
_660=_660.replace(/<img/gi,"<embed");
var oDiv=_65d.ownerDocument.createElement("DIV");
oDiv.innerHTML=_660;
newNode=oDiv.firstChild;
if(_65f){
newNode.src=_65f;
if($telerik.isSafari){
newNode.setAttribute("src",_65f);
}
}
newNode.removeAttribute("flashSrc");
newNode.removeAttribute("isflash");
var _662=_65d.parentNode;
_662.insertBefore(newNode,_65d);
_662.removeChild(_65d);
i--;
}
}
return _65a;
}};
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(_663){
var html=_663;
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(_666){
var _667=_666.ownerDocument;
var _668=_667.createElement("SPAN");
var span,font,_66b;
var _66c=_666.getElementsByTagName("FONT");
while(_66c.length>0){
font=_66c[0];
_66b=font.parentNode;
span=_668.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);
}
_66b.replaceChild(span,font);
_66c=_666.getElementsByTagName("FONT");
}
return _666;
},getDesignContent:function(_66e){
var _66f=_66e.ownerDocument;
var _670=_66f.createElement("FONT");
var span,font,_673;
var _674=_66e.getElementsByTagName("SPAN");
while(_674.length>0){
span=_674[0];
_673=span.parentNode;
font=_670.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 _676=null;
if(-1!=span.style.fontSize.indexOf("px")){
_676=this._fontSizesRevPx[parseInt(span.style.fontSize)];
}
if(typeof (_676)!="undefined"&&null!=_676){
font.size=_676+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);
}
_673.replaceChild(font,span);
_674=_66e.getElementsByTagName("SPAN");
}
return _66e;
},_fixColorValue:function(_677){
if(_677.toLowerCase().indexOf("rgb")!=-1){
var _678="#";
var _679=function(val){
var _67b=parseInt(val,10).toString(16);
_678=_678+(_67b.length==1?"0"+_67b:_67b);
return val;
};
_677=_677.replace(/(\d+)/gi,_679);
_679=null;
return _678;
}else{
return _677;
}
},_removeElementStyleAttribute:function(_67c,_67d){
if(_67c.style&&_67c.style[_67d]){
if(_67c.style.removeAttribute){
_67c.style.removeAttribute(_67d);
}else{
if(_67c.style.removeProperty){
_67d=_67d.replace(/([A-Z])/g,"-$1").toLowerCase();
_67c.style.removeProperty(_67d);
}
}
if(_67c.style[_67d]){
_67c.style[_67d]=null;
}
if(_67c.style.cssText){
}else{
_67c.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(_67e){
if(!_67e){
return "";
}
var sb=new Sys.StringBuilder("");
this._appendNodeXhtml(_67e,sb);
return sb.toString();
},_convertAttribute:function(s){
return String(s).replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
},_getAttributeValue:function(_681,_682,sb){
var name=_681.nodeName;
var _685=_681.nodeValue;
if(name!="style"){
if($telerik.isIE&&(name=="type"||name=="value"||name=="selected")){
if(!_685){
return;
}
}else{
if(!_681.specified){
if($telerik.isIE&&_685==""&&typeof (_682[name])=="string"&&_682[name]!=""){
_685=_682[name];
}else{
return;
}
}
}
if(!_685){
return;
}
if(!isNaN(_685)){
_685=_682.getAttribute(name);
}
if($telerik.isIE&&(name=="href"||name=="src")){
_685=_682.getAttribute(name,2);
}
sb.append(" "+(_681.expando?name:name.toLowerCase())+"=\""+this._convertAttribute(_685)+"\"");
}else{
var _686=_682.style.cssText;
if(_686){
sb.append(" style=\""+this._convertAttribute(_686.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")+"\"");
}
var _68c=node.getAttribute("href",2);
if(_68c){
_68c=_68c.replace("about:blank","");
_68c=_68c.replace("about:","");
_68c=_68c.replace(/&amp;/gi,"&").replace(/&/gi,"&amp;");
sb.append(" href=\""+_68c+"\"");
node.removeAttribute("href",0);
}
}
}
}
try{
var _68d=node.attributes;
var l=_68d.length;
for(var i=0;i<l;i++){
this._getAttributeValue(_68d[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 _690="";
if(node.altHtml){
_690=node.altHtml;
}else{
_690=node.innerHTML;
}
if($telerik.isIE){
_690=_690.replace(/\soriginalAttribute="[^"]+"/gi,"");
_690=_690.replace(/\soriginalPath="[^"]+"/gi,"");
}
sb.append(_690);
sb.append("</object>");
break;
case "title":
case "style":
case "comment":
case "noscript":
var _690=node.innerHTML;
if($telerik.isIE&&_690.length==0){
_690=node.ownerDocument.title;
}
sb.append(">"+_690+"</"+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 _694=String(node.nodeValue);
var _695=node.parentNode.nodeName.toLowerCase();
if(!$telerik.isIE&&(_695=="style"||_695=="script")){
sb.append(_694);
}else{
_694=_694.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
if($telerik.isFirefox){
_694=_694.replace(/[\u00a0]/g,"&nbsp;");
}
sb.append(_694);
}
},_appendCDataNode:function(node,sb){
sb.append("<![CDA"+"TA[\n"+node.nodeValue+"\n]"+"]>");
},_appendCommentNode:function(node,sb){
var _69a=node.nodeValue;
if(!_69a&&node.text){
_69a=node.text;
}else{
_69a="<!--"+_69a+"-->";
}
sb.append(_69a);
},_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 _69d="P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION";
var _69e="HTML|HEAD|BODY|STYLE|FORM|TABLE|TBODY|THEAD|TR";
var _69f=_69e+"|UL|OL";
this._ignoreTags=new RegExp("(<PRE[^>]*>|<!--|<SCRIPT[^>]*>)([\\s\\S]*?)(<\\/PRE>|-->|<\\/SCRIPT>)","gi");
this._tagsNLBefore=new RegExp("<("+_69d+")[^>]*>","gi");
this._tagsNLAfter=new RegExp("<\\/("+_69d+")[^>]*>","gi");
this._tagsNLNoCloseAfter=new RegExp("<(BR|HR)[^>]*\\/?>","gi");
this._tagsNLBeforeAndAfter=new RegExp("<\\/?("+_69e+")[^>]*>","gi");
this._tagsIncIndent=new RegExp("^<("+_69f+")[\\s\\/>]","i");
this._tagsDecIndent=new RegExp("^<\\/("+_69f+")[\\s\\>]","i");
this._shrinkNL=new RegExp("\\s*\\n+\\s*","gi");
};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.prototype={dispose:function(){
this._protectedData=[];
},getHtmlContent:function(html){
var _6a1=html.trim();
if(_6a1.indexOf("<body")==0){
_6a1=_6a1.substring(_6a1.indexOf(">")+1,_6a1.length-7);
}
this._protectedData=[];
var self=this;
var _6a3=function(_6a4,_6a5,_6a6,_6a7,_6a8,_6a9){
Array.add(self._protectedData,_6a6);
return _6a5+"RADEDITORFORMATTED_"+self._protectedData.length+_6a7;
};
_6a1=_6a1.replace(this._ignoreTags,_6a3);
var _6aa="$&";
if($telerik.isSafari2){
_6aa="$0";
}
_6a1=_6a1.replace(this._tagsNLBefore,"\n"+_6aa);
_6a1=_6a1.replace(this._tagsNLAfter,_6aa+"\n");
_6a1=_6a1.replace(this._tagsNLNoCloseAfter,_6aa+"\n");
_6a1=_6a1.replace(this._tagsNLBeforeAndAfter,"\n"+_6aa+"\n");
var _6ab=_6a1.split(this._shrinkNL);
var _6ac=new Sys.StringBuilder("");
var _6ad="";
for(var i=0;i<_6ab.length;i++){
var line=_6ab[i];
if(line.length==0){
continue;
}
if(this._tagsDecIndent.test(line)){
if(_6ad.length>this._indentPattern.length){
_6ad=_6ad.substring(this._indentPattern.length);
}else{
_6ad="";
}
}
_6ac.append(_6ad);
_6ac.append(line);
_6ac.append("\n");
if(this._tagsIncIndent.test(line)){
_6ad+=this._indentPattern;
}
}
_6a1=_6ac.toString();
for(var i=0;i<this._protectedData.length;i++){
var _6b0=new RegExp("RADEDITORFORMATTED_"+(i+1));
var _6b1=this._protectedData[i].replace(/\$/gi,"$$$$");
_6a1=_6a1.replace(_6b0,_6b1);
}
return _6a1;
}};
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(_6b2){
this._updateElements(_6b2,"A","href");
this._updateElements(_6b2,"AREA","href");
this._updateElements(_6b2,"IMG","src");
this._updateElements(_6b2,"EMBED","src");
return _6b2;
},_getElements:function(_6b3,_6b4){
var _6b5=_6b3.getElementsByTagName(_6b4);
if(!_6b5){
_6b5=_6b3.ownerDocument.getElementsByTagName(_6b4);
}
return _6b5;
},_updateElements:function(_6b6,_6b7,_6b8){
var _6b9=_6b6.ownerDocument.createElement("div");
var _6ba=this._getElements(_6b6,_6b7);
if(_6ba){
for(var i=0;i<_6ba.length;i++){
var _6bc=_6ba[i].getAttribute(_6b8,2);
if("href"==_6b8&&_6bc){
_6b9.innerHTML="<a href=\""+_6bc.replace(/\"/gi,"%22")+"\">test</a>";
if($telerik.isIE){
var _6bd=_6ba[i].innerHTML;
}
_6ba[i].setAttribute("href",_6b9.childNodes[0].href);
if($telerik.isIE){
if((_6bd.indexOf("www.")==0&&_6ba[i].innerHTML.match("[a-z]+://"))||(_6bd.indexOf("mailto:")==-1&&_6ba[i].innerHTML.match("mailto:"))){
_6ba[i].innerHTML=_6bd;
}
}
}else{
if("src"==_6b8&&_6bc){
_6b9.innerHTML="<img src=\""+_6bc.replace(/\"/gi,"%22")+"\" />";
_6ba[i].setAttribute("src",_6b9.childNodes[0].src);
}
}
}
}
_6b9.innerHTML="";
_6b9=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(_6be){
this._enableXhtmlFilter=_6be;
},add:function(_6bf){
Array.add(this._filters,_6bf);
},addAt:function(_6c0,_6c1){
Array.insert(this._filters,_6c1,_6c0);
},remove:function(_6c2){
Array.remove(this._filters,_6c2);
},removeAt:function(_6c3){
Array.removeAt(this._filters,_6c3);
},getFilterAt:function(_6c4){
return this._filters[_6c4];
},getFilterByName:function(name){
for(var i=0;i<this._filters.length;i++){
var _6c7=this._filters[i];
if(_6c7&&name==_6c7.get_name()){
return _6c7;
}
}
},getDesignContent:function(_6c8){
var _6c9=_6c8;
for(var i=0;i<this._filters.length;i++){
var _6cb=this._filters[i];
if((!_6cb.get_isDom())&&(false!=_6cb.get_enabled())&&_6cb.getDesignContent){
try{
_6c9=_6cb.getDesignContent(_6c9);
}
catch(exc){
alert("Error while executing filter "+_6cb.get_name()+" - "+exc.toString());
}
}
}
return _6c9;
},getDesignContentDom:function(_6cc){
for(var i=0;i<this._filters.length;i++){
var _6ce=this._filters[i];
if((_6ce.get_isDom())&&(false!=_6ce.get_enabled())&&_6ce.getDesignContent){
try{
_6cc=_6ce.getDesignContent(_6cc);
}
catch(exc){
alert("Error while executing filter "+_6ce.get_name()+" - "+exc.toString());
}
}
}
return _6cc;
},getHtmlContent:function(_6cf){
for(var i=0;i<this._filters.length;i++){
var _6d1=this._filters[i];
if((_6d1.get_isDom())&&(false!=_6d1.get_enabled())&&_6d1.getHtmlContent){
try{
_6cf=_6d1.getHtmlContent(_6cf);
}
catch(exc){
alert("Error while executing filter "+_6d1.get_name()+" - "+exc.toString());
}
}
}
var _6d2;
if(this.get_enableXhtmlFilter()){
try{
_6d2=this._convertToXhtmlFilter.getHtmlContent(_6cf);
}
catch(exc){
alert("Error while executing filter XHTML - "+exc.toString());
}
}else{
_6d2=$telerik.getOuterHtml(_6cf);
}
_6d2=_6d2.replace(/<body\s*\/>/i,"<body></body>");
for(var i=0;i<this._filters.length;i++){
var _6d1=this._filters[i];
if((!_6d1.get_isDom())&&(false!=_6d1.get_enabled())&&_6d1.getHtmlContent){
try{
_6d2=_6d1.getHtmlContent(_6d2);
}
catch(exc){
alert("Error while executing filter "+_6d1.get_name()+" - "+exc.toString());
}
}
}
return _6d2;
}};
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(_6d3){
this.Window=_6d3;
this.Document=_6d3.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 _6d4=this.Document.selection.createRange();
if(_6d4.length){
this.SourceIndex=_6d4.item(0).sourceIndex;
}else{
this.StartBookmark=_6d4.getBookmark();
}
},restore:function(_6d5){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this.Document.body,this.HtmlText);
this.select(_6d5);
},select:function(_6d6){
if(null!=this.SourceIndex){
var _6d7=this.Document.body.createControlRange();
_6d7.addElement(this.Document.all(this.SourceIndex));
_6d7.select();
}else{
if(null!=this.StartBookmark){
var _6d7=this.Document.body.createTextRange();
_6d7.moveToBookmark(this.StartBookmark);
_6d7.select();
if(true==_6d6&&_6d7.collapse){
_6d7.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(_6d8){
if(_6d8){
return {anchorNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6d8.anchorNode),anchorOffset:_6d8.anchorOffset,focusNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6d8.focusNode),focusOffset:_6d8.focusOffset,isCollapsed:_6d8.isCollapsed};
}else{
return {};
}
},_moveToBookmark:function(_6d9,_6da){
var _6db=_6da.anchorNodeBookmark.select();
var _6dc=_6da.focusNodeBookmark.select();
_6d9.collapse(_6db,_6da.anchorOffset);
if(!_6da.isCollapsed){
_6d9.extend(_6dc,_6da.focusOffset);
}
}};
}
Telerik.Web.UI.Editor.RestorePoint.registerClass("Telerik.Web.UI.Editor.RestorePoint",null);
Telerik.Web.UI.Editor.SelectionBookmark=function(_6dd,node){
this.Window=_6dd;
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(_6e0,node){
var n,res;
for(var i=0;i<_6e0.childNodes.length;i++){
n=_6e0.childNodes[i];
res=this._findNodePath(n,node);
if(""!=res){
return ""+i+","+res;
}
if(n==node){
return ""+i;
}
}
return "";
},_findNode:function(_6e5,_6e6){
var arr=_6e6.split(",");
for(var i=0;i<arr.length;i++){
_6e5=_6e5.childNodes[arr[i]];
}
return _6e5;
}};
Telerik.Web.UI.Editor.SelectionBookmark.registerClass("Telerik.Web.UI.Editor.SelectionBookmark",null);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Selection=function(_6e9){
this._window=_6e9;
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(_6ea,_6eb){
_6eb=(_6eb==true);
if($telerik.isIE){
return this._executeIE(_6ea,_6eb);
}else{
return this._executeMozilla(_6ea,_6eb);
}
},_executeIE:function(_6ec,_6ed){
var _6ee=this._window.document;
var _6ef=_6ee.selection;
if(_6ef.type.toLowerCase()!="none"){
_6ef.createRange().execCommand("Delete");
}
if(_6ef.type.toLowerCase()!="none"){
_6ee.execCommand("Delete");
}
_6ee.body.setActive();
selRange=_6ef.createRange();
if(selRange&&selRange.length){
var _6f0=selRange.item(0);
if(_6f0&&_6f0.tagName=="BODY"){
var _6f1=_6f0.getElementsByTagName("FORM")[0];
if(_6f1){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_6f1,_6f1.innerHTML+_6ec);
}
}
}else{
var _6f2=selRange.duplicate();
_6f2.collapse(true);
_6ec=Telerik.Web.UI.Editor.Utils.getStoredOriginalPathsAndAttributes(_6ec);
selRange.pasteHTML(_6ec);
Telerik.Web.UI.Editor.Utils.restoreOriginalPathsAndAttributes(selRange.parentElement());
if(_6ed){
_6f2.setEndPoint("EndToEnd",selRange);
_6f2.select();
}
}
return true;
},_executeMozilla:function(_6f3,_6f4){
var oDoc=this._window.document;
var _6f6=oDoc.createElement("SPAN");
_6f6.innerHTML=_6f3;
var _6f7="radetempnode";
if(this.isOpera){
_6f6.setAttribute("id",_6f7);
}
this._insertNodeAtSelection(this._window,_6f6,true);
if(this.isOpera){
var _6f8=oDoc.createRange();
var _6f9=this._window.getSelection();
var span=oDoc.getElementById(_6f7);
_6f8.selectNodeContents(span);
var _6fb=_6f8.extractContents();
_6f8.selectNode(span);
var _6fc=_6f8.extractContents();
_6f8.insertNode(_6fb);
_6f9.addRange(_6f8);
return true;
}else{
if(!this.isSafari){
var _6f8=oDoc.createRange();
_6f8.selectNodeContents(_6f6);
var _6fb=_6f8.extractContents();
_6f8.selectNode(_6f6);
_6f8.deleteContents();
this._insertNodeAtSelection(this._window,_6fb,_6f4);
}
}
return true;
},_insertNodeAtSelection:function(win,_6fe,_6ff){
var _700=win.getSelection();
if(_700.rangeCount==0){
win.document.body.appendChild(_6fe);
return;
}
var _701=null;
if(_700.getRangeAt){
_701=_700.getRangeAt(0);
}else{
_701=win.document.createRange();
_701.setStart(_700.anchorNode,_700.anchorOffset);
_701.setEnd(_700.focusNode,_700.focusOffset);
}
if(_700.removeAllRanges){
_700.removeAllRanges();
}
_701.deleteContents();
var _702=$telerik.isSafari&&!$telerik.isSafari3?_700.baseNode:_701.startContainer;
var _703=$telerik.isSafari&&!$telerik.isSafari3?_700.baseOffset:_701.startOffset;
if($telerik.isSafari&&null==_702){
_702=win.document.body;
}
_701=win.document.createRange();
if((_6fe.nodeType==3)&&(_702.nodeType==3)){
_702.insertData(_703,_6fe.nodeValue);
_701.setEnd(_702,_703+_6fe.length);
if(_6ff){
_701.setStart(_702,_703);
}else{
_701.setStart(_702,_703+_6fe.length);
}
}else{
var _704;
if(_702.nodeType==3){
var _705=_702;
_702=_705.parentNode;
var _706=_705.nodeValue;
var _707=_706.substr(0,_703);
var _708=_706.substr(_703);
var _709=win.document.createTextNode(_707);
var _704=win.document.createTextNode(_708);
_702.insertBefore(_704,_705);
_702.insertBefore(_6fe,_704);
try{
_702.insertBefore(_709,_6fe);
}
catch(exc){
}
_702.removeChild(_705);
}else{
if(_702.childNodes.length>0){
_704=_702.childNodes[_703];
_702.insertBefore(_6fe,_704);
}else{
if(_702.tagName!="BODY"){
_702=_702.parentNode;
}
_702.appendChild(_6fe);
}
}
try{
if(_6ff){
_701.setStart(_6fe,0);
_701.setEnd(_704,0);
}else{
_701.setEnd(_704,0);
_701.setStart(_704,0);
}
}
catch(exc){
}
}
try{
_700.addRange(_701);
}
catch(exc){
}
},selectRange:function(_70a){
if(!_70a){
return;
}
var _70b=this._window;
if(_70a.select){
_70a.select();
}else{
if(_70b.getSelection){
var _70c=_70b.getSelection();
if(_70c.removeAllRanges){
_70c.removeAllRanges();
_70c.addRange(_70a);
}else{
var base=_70a.baseNode;
if(null==base){
base=_70b.document.body;
}
var _70e=_70a.extentNode;
if(null==_70e){
_70e=_70b.document.body;
}
_70c.setBaseAndExtent(base,_70a.startOffset,_70e,_70a.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 _70f=this._window.getSelection();
if(!_70f||_70f.rangeCount<1){
return null;
}
var rng=null;
if(_70f.getRangeAt){
rng=_70f.getRangeAt(0);
}else{
rng=this._window.document.createRange();
rng.setStart(_70f.anchorNode,_70f.anchorOffset);
rng.setEnd(_70f.focusNode,_70f.focusOffset);
}
return rng;
}
}
},getParentElement:function(){
var rng=this.getRange();
if(!rng){
return null;
}
if(rng.commonAncestorContainer){
var _712=this._window.getSelection();
var _713=rng.startContainer?rng.startContainer:_712.baseNode;
var _714=rng.endContainer?rng.endContainer:_712.extentNode;
var _715=rng.startOffset!=null?rng.startOffset:_712.baseOffset;
var _716=rng.endOffset!=null?rng.endOffset:_712.extentOffset;
if(_713==_714&&(_716-_715)==1){
return _712.anchorNode.childNodes[_712.anchorOffset];
}else{
if(!rng.commonAncestorContainer.tagName){
if(this._window.document==rng.commonAncestorContainer&&_712.baseNode){
return _712.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 _718=oSel.focusNode;
if(!_718||_718.nodeType==1){
return false;
}
return (_718.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 _71b=this._window.getSelection();
var rng=null;
if(null==_71b){
return "";
}
if(_71b.getRangeAt&&typeof (_71b.rangeCount)!="undefined"&&_71b.rangeCount==0){
return "";
}
if(_71b.getRangeAt){
rng=_71b.getRangeAt(0);
var _71c=this._window.document.createElement("div");
var _71d=rng.cloneContents();
if(_71d){
_71c.appendChild(_71d);
return _71c.innerHTML;
}else{
return "";
}
}else{
return _71b;
}
}else{
return "";
}
}
},collapse:function(_71e){
_71e=(_71e==true);
if(this._window.document.selection){
var rng=this._window.document.selection.createRange();
if(rng.collapse){
rng.collapse(_71e);
rng.select();
}
}else{
if(this._window.getSelection){
var _720=this._window.getSelection();
if(!_720.isCollapsed){
if(_71e){
_720.collapseToStart();
}else{
_720.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(_721,_722){
var rs=new Telerik.Web.UI.EditorShortCut(_721,_722);
rs.HashValue=this._getShortCutHashValue(rs);
this._shortcuts[rs.HashValue]=rs;
},removeShortCut:function(_724){
var _725=this._findByName(_724);
if(_725){
this._shortcuts[_725.HashValue]=null;
}
},setShortCut:function(_726,_727){
this.removeShortCut(_726);
this.addShortCut(_726,_727);
},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(_729,_72a,_72b,_72c,_72d,_72e,_72f){
var _730=this._getHashValue(_729,_72a,_72b,_72c,_72d,_72e,_72f);
return this._shortcuts[_730];
},_getHashValue:function(_731,_732,_733,_734,_735,_736,_737){
var _738=_731&65535;
var _739=0;
_739|=(_732?(1<<0):0);
_739|=(_734?(1<<2):0);
_739|=(_736?(1<<4):0);
_738|=(_739<<16);
return _738;
},_getShortCutHashValue:function(_73a){
return this._getHashValue(_73a.KeyCode,_73a.CtrlKey,_73a.LeftCtrlKey,_73a.ShiftKey,_73a.LeftShiftKey,_73a.AltKey,_73a.LeftAltKey);
},_findByName:function(_73b){
var _73c;
for(var _73d in this._shortcuts){
_73c=this._shortcuts[_73d];
if(null!=_73c&&_73c._name==_73b){
return _73c;
}
}
return null;
}};
Telerik.Web.UI.EditorShortCut=function(_73e,_73f){
this._name=_73e;
this.setShortCut(_73f);
};
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(_740){
this._name=_740;
},setShortCut:function(_741){
this._parseShortcutString(_741);
},_parseShortcutString:function(_742){
if("string"==typeof (_742)){
this.CtrlKey=false;
this.LeftCtrlKey=false;
this.ShiftKey=false;
this.LeftShiftKey=false;
this.AltKey=false;
this.LeftAltKey=false;
this.KeyCode=0;
_742=_742.replace(/\s*/gi,"");
_742=_742.replace(/\+\+/gi,"+PLUS");
var _743=_742.split("+");
var _744="";
for(var i=0;i<_743.length;i++){
_744=_743[i].toUpperCase();
switch(_744){
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=_744.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(_746,_747,_748){
if(typeof (this._controls[_746])=="undefined"){
this._controls[_746]={};
}
if(typeof (this._controls[_746][_747])=="undefined"){
this._controls[_746][_747]={};
}
var _749=this._controls[_746][_747];
for(var _74a in _748){
if(typeof (_748[_74a])=="string"){
_749[_74a]=_748[_74a];
}
}
return _749;
}};
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(_74b,tool,_74d){
Telerik.Web.UI.EditorCommandEventArgs.initializeBase(this);
this._name=this._commandName=_74b;
this._tool=tool;
this._value=_74d;
this.value=_74d;
};
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(_74f){
Telerik.Web.UI.RadEditor.initializeBase(this,[_74f]);
this._rootElement=null;
this._bottomResizer=null;
this._tableElement=null;
this._document=null;
this._contentArea=null;
this._contentAreaElement=null;
this._contentHiddenTextarea=null;
this._contentWindow=null;
this._doctypeString=null;
this._fullPage=null;
this._originalHeight=null;
this._accessKeyTextbox=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._toolsWidth=null;
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(_750){
this.get_events().addHandler("spellCheckLoaded",_750);
},remove_spellCheckLoaded:function(_751){
this.get_events().removeHandler("spellCheckLoaded",_751);
},get_ajaxSpellCheck:function(){
return this._ajaxSpellCheck;
},set_ajaxSpellCheck:function(_752){
this._ajaxSpellCheck=_752;
this.raiseEvent("spellCheckLoaded");
},get_ajaxSpellCheckScriptReference:function(){
return this._ajaxSpellCheckScriptReference;
},set_ajaxSpellCheckScriptReference:function(val){
this._ajaxSpellCheckScriptReference=val;
},get_spellAllowAddCustom:function(){
return this._spellAllowAddCustom;
},set_spellAllowAddCustom:function(_754){
this._spellAllowAddCustom=_754;
},get_spellCheckJSON:function(){
return this._spellCheckJSON;
},set_spellCheckJSON:function(_755){
this._spellCheckJSON=_755;
},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(_757,args){
},raiseEvent:function(_759,args){
if(_759!="selectionChange"||this.get_mode()==Telerik.Web.UI.EditModes.Design){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"raiseEvent",[_759,args]);
}
},_initializeToolProvider:function(){
var _75b=this;
var _75c=_75b.get_toolProviderID();
if(_75c&&$find(_75c)){
var _75d=$find(_75c);
var _75e=_75d.get_dialogOpener();
_75b.set_dialogOpener(_75e);
var _75f=_75d.get_contextMenusJSON();
if(_75f&&_75f.concat){
_75b.set_contextMenusJSON(_75f.concat([]));
}
var _760=_75d.get_modulesJSON();
if(_760&&_760.concat){
_75b.set_modulesJSON(_760.concat([]));
}
var root=this.get_toolContainer();
root.innerHTML="";
this._toolJSON=[];
var html=_75d.get_toolHTML();
root.innerHTML=html;
var json=_75d.get_toolJSON().concat([]);
this.set_toolJSON(json);
if(_75d.get_spellCheckJSON){
_75b.set_spellCheckJSON(_75d.get_spellCheckJSON());
}
if(_75d.get_ajaxSpellCheckScriptReference){
var ref=_75d.get_ajaxSpellCheckScriptReference();
if(ref){
_75b.set_ajaxSpellCheckScriptReference(ref);
}
}
}
},get_toolHTML:function(){
var div=this.get_toolContainer().cloneNode(true);
return div.innerHTML;
},get_toolContainer:function(){
return this.get_TopZone().firstChild;
},get_mainTable:function(){
return $get(this.get_id()+"Wrapper");
},_ieHookToClientArea:function(){
var _766=this;
window.setTimeout(function(){
if($telerik.isIE){
var area=_766.get_contentArea();
if(!area){
return;
}
try{
var _768=Telerik.Web.UI.Editor.Utils.storeBrowserPosition();
var r=area.createTextRange();
var _76a=document.body.createTextRange();
if(_768&&_768.y>0){
_76a.moveToElementText(_766.get_contentAreaElement());
}else{
_76a.moveStart("textedit",_76a.text.length);
}
_76a.collapse(true);
_76a.select();
if(_768&&_768.y>0){
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition();
}
}
catch(e){
}
}
},0);
},initialize:function(){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"initialize");
this.raiseEvent("init",Sys.EventArgs.Empty);
this._initializeToolProvider();
var _76b=this.get_mainTable();
this._originalHeight=_76b.style.height;
this._initializeLocalization();
this._addFilters();
this._addDefaultShortCuts();
this._createUI();
this._createTools();
this._makeResizeable(true);
var _76c=$get(this.get_id()+"ContentHiddenTextarea");
if(_76c){
_76c.setAttribute("id",this.get_id());
this._contentHiddenTextarea=_76c;
}
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);
}
}
this._ieHookToClientArea();
this._fixIEVisibilityProblems(true);
this._fixMozillaDOMProblems(true);
if(this._modulesManager){
if(!this.isIE){
var _76d=$get(this.get_id()+"Module");
_76d.style.display="none";
var _76e=this;
window.setTimeout(function(){
_76e._modulesManager.initialize();
_76d.style.display="";
},0);
}else{
this._modulesManager.initialize();
this._updateEditorSize(this._originalHeight);
}
}
if(this.get_autoResizeHeight()&&this.isVisible()){
this._makeAutoResizeHeight();
}
this._initialContent=this.get_html(true);
this._applyAccessKey();
this.raiseEvent("load",Sys.EventArgs.Empty);
if(!$telerik.isIE&&!$telerik.isFirefox){
if(!this.isVisible()){
this.raiseEvent("firstShow");
}
}
},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);
if(this._accessKeyTextbox){
$clearHandlers(this._accessKeyTextbox);
this._accessKeyTextbox.removeAttribute("accessKey");
this._accessKeyTextbox=null;
}
Telerik.Web.UI.RadEditor.callBaseMethod(this,"dispose");
},_applyAccessKey:function(){
var _770=this.get_element().getAttribute("accessKey");
if(_770){
this.get_element().removeAttribute("accessKey");
var _771=document.createElement("input");
_771.setAttribute("name",this.get_id()+"EditorAccessKey");
_771.setAttribute("type","text");
_771.setAttribute("id",this.get_id()+"EditorAccessKey");
_771.setAttribute("accessKey",_770);
this._accessKeyTextbox=_771;
$addHandlers(this._accessKeyTextbox,{"focus":this.setFocus},this);
var _772=document.createElement("div");
_772.style.width="0px";
_772.style.height="0px";
_772.style.overflow="hidden";
_772.appendChild(this._accessKeyTextbox);
this.get_element().appendChild(_772);
}
},_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 _773=this;
this.attachEventHandler("keydown",function(e){
if(!_773._isKeyUpButton(e)){
_773._resizeContentArea(e);
}
});
this.attachEventHandler("keyup",function(e){
if(_773._isKeyUpButton(e)||(e.keyCode==13&&!_773.isIE)){
_773._resizeContentArea(e);
}
});
this.add_selectionChange(Function.createDelegate(this,this._resizeContentArea));
this._resizeContentArea();
}),0);
},_isKeyUpButton:function(e){
var _777=e.keyCode;
if(_777==8||_777==46){
return true;
}
return false;
},_getCurrentFontSize:function(){
var o=this.getSelectedElement();
var _779=parseInt($telerik.getCurrentStyle(o,"fontSize"));
return _779;
},_resizeContentArea:function(e){
var body=this.isIE?this._document.body:this._document.documentElement;
var _77c=this._contentAreaElement;
var _77d=_77c.parentNode;
var _77e=this._initialContentHeight;
var _77f=_77c.offsetHeight;
var _780=body.scrollHeight+(e&&e.keyCode==13&&this.isIE?this._getCurrentFontSize():0);
if(_780==_77f){
return;
}
if((_77e==_77f)&&(_780<=_77e)){
return;
}
var _781=(_780>_77e)?_780:_77e;
_77c.style.height=_781+"px";
if(_780>_77f){
_77d.style.height=parseInt(_780)+"px";
}else{
var _782=this.get_element();
var _783=_782.offsetHeight-(_77d.offsetHeight-_77c.offsetHeight);
if(_77c.style.height!="100%"){
_77d.style.height="";
this._updateEditorSize(_783);
}
return;
}
this._updateEditorSize(null,true);
},_makeResizeable:function(_784){
if(this._resizeExtender){
this._resizeExtender.dispose();
this._resizeExtender=null;
}
if(!_784){
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 _785={se:this._bottomResizer};
this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._rootElement,_785,this._tableElement);
},_getInvisibleParent:function(){
return Telerik.Web.UI.Editor.Utils.getInvisibleParent(this.get_element());
},isVisible:function(){
return (this._getInvisibleParent()==null);
},_fixIEVisibilityProblems:function(_786){
if(!this.isIE){
return;
}
if(_786){
var _787=this._getInvisibleParent();
if(_787){
this._onIEParentVisibilityChangeDelegate=Function.createDelegate(this,this._onIEParentVisibilityChange);
this._invisibleParent=_787;
$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(_788){
if(this.isIE){
return;
}
if(_788){
var _789=this._getInvisibleParent();
if(_789){
this._invisibleParent=_789;
this._onMozillaParentVisibilityChangeDelegate=Function.createDelegate(this,this._onMozillaParentVisibilityChange);
_789.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"||e.propertyName=="className"){
var _78b=$telerik.getCurrentStyle(this._invisibleParent,"display");
if(_78b!="none"){
this.raiseEvent("firstShow");
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this._updateEditorSize(this.get_element().style.height);
this._fixIEVisibilityProblems(false);
}
}
},_onMozillaParentVisibilityChange:function(e){
if(e.attrName=="style"||e.attrName=="class"){
var _78d=e.target;
if((e.currentTarget==e.originalTarget)&&"none"!=$telerik.getCurrentStyle(_78d,"display")){
window.setTimeout(Function.createDelegate(this,function(){
if(!this._editorFirstVisible){
this._editorFirstVisible=true;
this.raiseEvent("firstShow");
}
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this.set_editable(true);
}),0);
}
}
},_onMozillaParentNodeChanged:function(e){
if(!e.target||!this.get_element()){
return;
}
var _78f=$telerik.isDescendantOrSelf(e.target,this.get_element());
if(_78f){
this.onParentNodeChanged();
}
},onParentNodeChanged:function(){
if(!$telerik.isIE){
var _790=this.get_html(true);
var _791=this.get_contentAreaElement();
this._contentWindow=_791.contentWindow;
this._setContentAreaHtml(_790,true);
this.set_editable(true);
}
},onResizeStart:function(){
this._resizeSelection=this.getSelection().getRange();
},onResizeEnd:function(){
if(!this.isIE){
return;
}
this.setActive();
if(this._resizeSelection){
var _792=this._resizeSelection.parentElement();
if(_792&&(this.get_document()==_792.ownerDocument)){
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(_793,_794){
if(Telerik.Web.UI.Editor.Utils.selectElement(this.get_contentWindow(),_793)&&false!=_794){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},undo:function(_795){
this._commandsManager.undo(_795);
},redo:function(_796){
this._commandsManager.redo(_796);
},executeCommand:function(_797,_798,_799){
if(!_797.get_window()){
_797.set_window(this.get_contentWindow());
}
if(false!=_798&&!this.isOpera){
this.setFocus();
}
this._commandsManager.execute(_797,_799);
},executeBrowserCommand:function(_79a,_79b,_79c,_79d){
var _79e=this._localization[_79a];
this.executeCommand(new Telerik.Web.UI.Editor.BrowserCommand(_79e,this._contentWindow,_79a,_79c));
this.setActive();
this.setFocus();
if(true==_79d){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},createElement:function(_79f,_7a0,_7a1,sId,_7a3,_7a4){
var _7a5=this._document.createElement(_79f);
if(_7a0){
_7a5.style.width=_7a0;
}
if(_7a1){
_7a5.style.height=_7a1;
}
if(null!=sId){
_7a5.id=sId;
}
if(null!=_7a3){
_7a5.name=_7a3;
}
if(null!=_7a4){
_7a5.value=_7a4;
}
return _7a5;
},createRestorePoint:function(){
return new Telerik.Web.UI.Editor.RestorePoint(this._contentWindow);
},getToolState:function(_7a6){
if(_7a6=="Undo"){
return this.get_commandsManager().isUndoAvailable()?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
}else{
if(_7a6=="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[_7a6];
if(oCmd&&oCmd.getState){
return oCmd.getState(this._contentWindow);
}
}
}
},getToolValue:function(_7a8){
var oCmd=Telerik.Web.UI.Editor.UpdateCommandsArray[_7a8];
if(oCmd&&oCmd.getValue){
return oCmd.getValue(this._contentWindow);
}else{
if(_7a8=="RealFontSize"){
var o=this.getSelectedElement();
if(o){
var _7ab=null;
try{
_7ab=$telerik.getCurrentStyle(o,"fontSize","");
}
catch(exc){
}
if(_7ab){
var _7ac=parseFloat(_7ab);
if(_7ac>parseInt(_7ab)){
if(_7ab.indexOf("px")>-1){
_7ab=parseInt(_7ab)+"px";
}
}
}
return _7ab;
}
}
}
},_addFilters:function(){
var _7ad=this.get_filtersManager();
var _7ae=this.get_contentFilters();
var _7af=Telerik.Web.UI.EditorFilters;
_7ad.clear();
var _7b0=_7ae&_7af.ConvertToXhtml;
_7ad.set_enableXhtmlFilter(_7b0);
if(_7ae&_7af.RemoveScripts){
_7ad.add(new Telerik.Web.UI.Editor.StripScriptsFilter());
}
if(_7ae&_7af.EncodeScripts){
_7ad.add(new Telerik.Web.UI.Editor.EncodeScriptsFilter());
}
if(_7ae&_7af.FixUlBoldItalic){
_7ad.add(new Telerik.Web.UI.Editor.FixUlBoldItalic());
}
_7ad.add(new Telerik.Web.UI.Editor.FixNestedLists());
if(_7ae&_7af.ConvertFontToSpan){
_7ad.add(new Telerik.Web.UI.Editor.ConvertFontToSpanFilter());
}
if(_7ae&_7af.FixEnclosingP){
_7ad.add(new Telerik.Web.UI.Editor.FixEnclosingP());
}
if($telerik.isIE){
_7ad.add(new Telerik.Web.UI.Editor.IEKeepObjectParamsFilter());
_7ad.add(new Telerik.Web.UI.Editor.IEKeepCommentsFilter());
_7ad.add(new Telerik.Web.UI.Editor.IEFixEmptyParagraphs());
if(_7ae&_7af.IECleanAnchors){
_7ad.add(new Telerik.Web.UI.Editor.IECleanAnchorsFilter());
}
}
if(!$telerik.isIE&&!$telerik.isOpera){
if(!$telerik.isSafari){
_7ad.add(new Telerik.Web.UI.Editor.MozillaKeepFlashString(this.get_mozillaFlashOverlayImage()));
_7ad.add(new Telerik.Web.UI.Editor.MozillaKeepFlash());
}
_7ad.add(new Telerik.Web.UI.Editor.MozillaKeepStylesString());
_7ad.add(new Telerik.Web.UI.Editor.MozillaKeepStylesDom());
if(_7ae&_7af.MozEmStrong){
_7ad.add(new Telerik.Web.UI.Editor.MozEmStrongFilter());
}
}
_7ad.add(new Telerik.Web.UI.Editor.StripJunkFilter());
if(_7ae&_7af.MakeUrlsAbsolute){
_7ad.add(new Telerik.Web.UI.Editor.MakeUrlsAbsolute());
}
_7ad.add(new Telerik.Web.UI.Editor.RemoveExtraBrakes());
if(_7ae&_7af.IndentHTMLContent){
_7ad.add(new Telerik.Web.UI.Editor.IndentHTMLContentFilter());
}
},addShortCut:function(_7b1,_7b2){
if(this._shortCutManager){
this._shortCutManager.addShortCut(_7b1,_7b2);
}
},removeShortCut:function(_7b3){
if(this._shortCutManager){
this._shortCutManager.removeShortCut(_7b3);
}
},setShortCut:function(_7b4,_7b5){
if(this._shortCutManager){
this._shortCutManager.setShortCut(_7b4,_7b5);
}
},_addDefaultShortCuts:function(){
var _7b6=[["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<_7b6.length;i++){
this.addShortCut(_7b6[i][0],_7b6[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(_7b8,_7b9){
if(_7b8.startsWith("on")){
_7b8=_7b8.replace("on","");
}
$telerik.addExternalHandler(this._document,_7b8,_7b9);
var _7ba=this._contentAreaEventHandlers;
if(!_7ba[_7b8]){
_7ba[_7b8]=[];
}
var _7bb=_7ba[_7b8];
_7bb[_7bb.length]=_7b9;
},detachEventHandler:function(_7bc,_7bd){
if(_7bc.startsWith("on")){
_7bc=_7bc.replace("on","");
}
$telerik.removeExternalHandler(this._document,_7bc,_7bd);
},_detachEvents:function(){
var _7be=this._contentAreaEventHandlers;
for(var _7bf in _7be){
var _7c0=_7be[_7bf];
if(_7c0.length!=null){
for(var i=0;i<_7c0.length;i++){
var _7c2=_7c0[i];
if(typeof (_7c2)=="function"){
try{
this.detachEventHandler(_7bf,_7c2);
}
catch(e){
}
}
}
_7c0=[];
}
}
this._contentAreaEventHandlers={};
this._attachIEBodyHandlers(false);
},get_TopZone:function(){
return $get(this.get_id()+"Top");
},_createTools:function(){
if(!this._toolAdapter){
var _7c3=this.get_toolContainer();
var _7c4=eval(this._toolAdapterType);
this._toolAdapter=$create(_7c4,{"editor":this,"toolJSON":this.get_toolJSON()},{"toolClick":this._onToolClickDelegate},null,_7c3);
if(this.isIE){
if(this.get_toolbarMode()==Telerik.Web.UI.EditorToolbarMode.Default){
_7c3.style.overflow="";
}
this._updateEditorSize();
}
}
},_onToolClick:function(tool,args){
this.fire(tool.get_name(),args);
},getContextMenuByTagName:function(_7c7){
if(this._toolAdapter&&this._toolAdapter.getContextMenuByTagName){
return this._toolAdapter.getContextMenuByTagName(_7c7);
}
},getToolByName:function(_7c8){
if(this._toolAdapter){
return this._toolAdapter.getToolByName(_7c8);
}
return null;
},getLocalizedString:function(name,_7ca){
var str=this.get_localization()[name];
if(null==str){
str=this.get_localization()[name.toLowerCase()];
}
if(null==str){
str=_7ca;
}
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 _7cd=this.get_contentArea();
if(_7cd&&_7cd.setActive){
_7cd.setActive();
}
},set_visible:function(_7ce){
var _7cf=this.get_element();
if(_7cf){
_7cf.style.display=_7ce?"":"none";
}
this.set_editable(_7ce);
},enableEditing:function(_7d0,_7d1,_7d2){
var _7d3=this.get_toolAdapter();
var _7d4=Telerik.Web.UI.EditingOptions;
var _7d5=function(){
};
if(!_7d1){
_7d1=Telerik.Web.UI.EditingOptions.All;
}
this._editingOptions=_7d1;
this._optionalIgnoredTools=_7d2;
if(_7d1&_7d4.ContextMenus){
if(_7d3){
_7d3.enableContextMenus(_7d0);
}
}
if(_7d1&_7d4.EditModes){
if(!_7d0){
this._originalEditModeRef=this.set_mode;
this.set_mode=_7d5;
}else{
if(this._originalEditModeRef){
this.set_mode=this._originalEditModeRef;
this._originalEditModeRef=null;
}
}
}
if(_7d1&_7d4.Tools){
if(_7d3){
if(!_7d0){
_7d3.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Disabled);
if(_7d2){
var _7d6=[];
for(var item in _7d2){
var tool=_7d3.getToolByName(item);
if(tool){
_7d6[_7d6.length]=tool;
}
}
_7d3.setToolState(_7d6);
}
this._originalSetToolStateRef=_7d3.setToolState;
_7d3.setToolState=_7d5;
}else{
_7d3.setToolState=this._originalSetToolStateRef;
this._originalSetToolStateRef=null;
}
}
}
if(_7d1&_7d4.Modules){
var _7d9=this._modulesManager;
if(_7d9){
_7d9.setModulesVisible(_7d0);
}
}
if(_7d1&_7d4.Typing){
if(!_7d0){
this._disableTypingDelegate=$telerik.cancelRawEvent;
this.attachEventHandler("keypress",this._disableTypingDelegate);
}else{
if(this._disableTypingDelegate){
this.detachEventHandler("keypress",this._disableTypingDelegate);
this._disableTypingDelegate=null;
}
}
}
if(_7d1&_7d1.Tab){
if(!_7d0){
this.removeShortCut("InsertTab");
}else{
this.setShortCut("InsertTab","TAB");
}
}
if(_7d0){
if(_7d3){
_7d3.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Off);
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},set_editable:function(_7da){
if($telerik.isIE||$telerik.isOpera){
var oEd=this;
window.setTimeout(function(){
try{
oEd._document.body.setAttribute("contentEditable",""+_7da);
oEd._document.execCommand("2D-Position",false,true);
}
catch(ev){
}
},0);
}else{
var oEd=this;
window.setTimeout(function(){
try{
oEd._document["designMode"]=_7da?"on":"off";
if(_7da){
oEd._document.execCommand("UseCSS",false,true);
oEd._document.execCommand("styleWithCSS",false,false);
}
}
catch(e){
}
},0);
}
},get_editable:function(){
if($telerik.isIE||$telerik.isOpera){
return this._document.body.contentEditable;
}else{
return (this._document["designMode"]=="on");
}
},enableContentArea:function(_7dc){
if(this.isIE){
this.get_document().body.setAttribute("contentEditable",""+_7dc);
}
},showExternalDialog:function(url,_7de,_7df,_7e0,_7e1,_7e2,_7e3,_7e4,_7e5,_7e6,_7e7){
var _7e8=this.getSelection().getRange();
var _7e9=this;
var _7ea=function(_7eb,args){
window.setTimeout(function(){
_7e9.getSelection().selectRange(_7e8);
if(_7e1){
var _7ed=_7e1(_7eb,args);
if(false==_7ed){
return;
}
_7e9.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7e9.setFocus();
},50);
};
this.get_dialogOpener().openUrl(url,_7de,_7df,_7e0,_7ea,_7e2,_7e3,_7e4,_7e5,_7e6,_7e7);
},showDialog:function(_7ee,_7ef,_7f0){
this._currentRange=this.getSelection().getRange();
var _7f1=this;
var _7f2=function(_7f3,args){
window.setTimeout(function(){
_7f1.getSelection().selectRange(_7f1._currentRange);
if(_7f0){
var oRes=_7f0(_7f3,args);
if(false==oRes){
return;
}
_7f1.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7f1.setFocus();
},50);
};
this.get_dialogOpener().open(_7ee,_7ef,_7f2);
if(this.isIE){
var wnd=this.get_dialogOpener()._getDialogContainer(_7ee);
if(!wnd||wnd._DRAG_ATTACHED){
return;
}
wnd._DRAG_ATTACHED=true;
wnd.add_dragEnd(function(){
_7f1.getSelection().selectRange(_7f1._currentRange);
});
}
},_getModeButtonsWrapper:function(){
return this._getChildElement("ModesWrapper");
},_registerModeChangeHandler:function(_7f7){
if(_7f7){
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 _7f9=this.get_mode();
var _7fa=Telerik.Web.UI.Editor.Utils.getElementParentByTag(e.target,"LI");
if(_7fa){
var _7fb=Telerik.Web.UI.EditModes;
var _7fc=Sys.UI.DomElement;
var a=_7fa.getElementsByTagName("A")[0];
if(_7fc.containsCssClass(a,"rade_mode_html")){
_7f9=_7fb.Html;
}else{
if(_7fc.containsCssClass(a,"rade_mode_design")){
_7f9=_7fb.Design;
}else{
_7f9=_7fb.Preview;
}
}
}
if(_7f9!=this.get_mode()){
this.set_mode(_7f9);
}
return $telerik.cancelRawEvent(e);
},_changeModeUI:function(mode){
var _7ff=Sys.UI.DomElement;
var _800=Telerik.Web.UI.EditModes;
var _801="rade_mode_";
switch(mode){
case _800.Html:
_801+="html";
break;
case _800.Design:
_801+="design";
break;
case _800.Preview:
_801+="preview";
break;
}
var _802=this._getModeButtonsWrapper();
var as=_802.getElementsByTagName("A");
for(var i=0;i<as.length;i++){
var a=as[i];
_7ff.removeCssClass(a,"rade_mode_selected");
if(_7ff.containsCssClass(a,_801)){
_7ff.addCssClass(a,"rade_mode_selected");
}
}
},_isEditModeEnabled:function(_806){
return _806&this._editModes?true:false;
},get_mode:function(){
return this._mode;
},set_mode:function(_807){
this._setEditableDelegate=Function.createDelegate(this,function(){
this.remove_editReady(this._setEditableDelegate);
var _808=(this._mode==_809.Design);
this.set_editable(_808);
this.toggleEnhancedEdit(_808);
this._setEditableDelegate=null;
});
this.add_editReady(this._setEditableDelegate);
var _80a=this._mode;
var _809=Telerik.Web.UI.EditModes;
if(_80a==_809.Html||_807==_809.Html){
var html=this.get_html(true);
this._mode=_807;
this._showTextArea(this._mode==_809.Html);
this.set_html(html);
}else{
this._mode=_807;
this._showTextArea(this._mode==_809.Html);
}
this._changeModeUI(_807);
if(this._mode!=_809.Preview){
this.setFocus();
if(this.isFirefox&&(!this._document||!this._document.body)){
}else{
this.set_editable(true);
}
if(this._mode==_809.Design){
this.toggleEnhancedEdit(true);
}
}else{
this.set_editable(false);
this.toggleEnhancedEdit(false);
}
this.setFocus();
var _80c=this.get_id();
var _80d=this.get_mainTable();
var _80e=_80d.offsetHeight+"px";
this.raiseEvent("modeChange",Sys.EventArgs.Empty);
this._updateEditorSize(_80e);
},_getTextIframe:function(){
if(!this._textIframe){
var _80f=this.get_contentAreaElement();
if(_80f){
this._textIframe=_80f.cloneNode(true);
this._textIframe.style.position="absolute";
var _810=this._textIframe.style;
_810.height="2px";
_810.width="2px";
_80f.parentNode.appendChild(this._textIframe);
var doc=this._textIframe.contentWindow.document;
doc.designMode="off";
var _812=doc.open("text/html","replace");
var _813="<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 (_812)=="undefined"){
_812=doc;
}
_812.write(_813);
_812.close();
}
}
return this._textIframe;
},_getTextArea:function(){
var area=this._getTextIframe();
if(area&&typeof (area.contentWindow)!="unknown"){
return area.contentWindow.document.body.firstChild;
}else{
return null;
}
},get_textArea:function(){
return this._getTextArea();
},_showTextArea:function(_815){
var area=this._getTextIframe();
var _817=this.get_contentAreaElement();
if(_815){
if($telerik.isSafari){
_817.style.width="0px";
_817.style.height="0px";
}else{
_817.style.display="none";
}
area.style.height="";
area.style.display="";
area.style.position="";
if(!$telerik.isFirefox){
window.setTimeout(function(){
area.style.height=area.parentNode.offsetHeight+"px";
},0);
}
area.style.height="100%";
area.style.width="100%";
}else{
if($telerik.isSafari){
_817.style.width="100%";
_817.style.height="100%";
}else{
_817.style.display="";
}
area.style.display="none";
}
},_setContentAsText:function(_818){
var area=this._getTextArea();
if(area){
area.value=_818;
}
},_getContentAsText:function(){
var area=this._getTextArea();
if(area&&area.value){
var _81b=area.value;
return _81b;
}
return "";
},set_html:function(_81c,_81d,_81e){
var _81f=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_81f.Html){
var cmd=new Telerik.Web.UI.Editor.GenericCommand(_81d?_81d:"Set HTML",this.get_contentWindow());
this._setContentAreaHtml(_81c);
this.executeCommand(cmd,_81e);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}else{
this._setContentAsText(_81c);
}
},get_html:function(_821){
var _822=null;
var _823="";
var mode=this.get_mode();
var _825=Telerik.Web.UI.EditModes;
if(mode==_825.Html){
return this._getContentAsText();
}else{
if(this.get_fullPage()){
if(this._document){
_822=this._document.getElementsByTagName("HTML")[0];
_822=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(_822);
var _826=this._getAllSheets(_822);
for(var i=0;i<_826.length;i++){
var _828=_826[i];
var _829=_828.getAttribute("id");
if(_829&&_829.indexOf("RADEDITORSTYLESHEET")==0){
_828.parentNode.removeChild(_828);
}
}
if($telerik.isIE||$telerik.isOpera){
_822.getElementsByTagName("BODY")[0].removeAttribute("contentEditable");
}
}
}else{
if(this.get_contentArea()){
if(true==_821){
_822=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(this.get_contentArea());
if($telerik.isIE||$telerik.isOpera){
_822.removeAttribute("contentEditable");
}
}else{
_822=this.get_contentArea();
}
}
}
}
if(_822){
if(true==_821){
_823=this.get_filtersManager().getHtmlContent(_822);
}else{
_823=_822.innerHTML;
}
}
if(_823.indexOf("<body")==0){
_823=_823.trim();
_823=_823.substring(_823.indexOf(">")+1,_823.length-7);
_823=_823.trim();
}
if(this.get_fullPage()&&this._doctypeString){
_823=this._doctypeString+"\n"+_823;
}
return _823;
},set_initialContent:function(){
this._initialContent=this.get_html(true);
},get_initialContent:function(){
return this._initialContent;
},get_text:function(){
var _82a=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_82a.Html){
var _82b="";
var _82c=this.get_contentArea();
if(_82c){
if(_82c.innerText){
_82b=_82c.innerText;
}else{
if(_82c.textContent!=null){
_82b=_82c.textContent;
}else{
_82b=_82c.innerHTML.replace(/<\/?[^>]*>/ig,"");
}
}
}
return _82b;
}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 _82f=oDoc.getElementsByTagName("link");
var _830=oDoc.getElementsByTagName("style");
var _831=[];
for(var x=0;_82f[x];x++){
var rel=_82f[x].rel?_82f[x].rel:_82f[x].getAttribute("rel");
if(typeof (rel)=="string"&&rel.toLowerCase().indexOf("style")+1){
Array.add(_831,_82f[x]);
}
}
for(var x=0;_830[x];x++){
Array.add(_831,_830[x]);
}
return _831;
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _836=str.lastIndexOf(".");
if(_836==-1){
return "";
}
var _837=str.indexOf(" ",_836);
if(-1==_837){
_837=str.indexOf(":",_836);
}
if(-1==_837){
_837=str.length;
}
return str.substring((_836+1),_837);
},_createCssFilterObject:function(){
if(this._cssClassesHash){
return;
}
var _838=this.get_cssClasses();
if(_838&&_838.length>0){
var obj={};
var _83a=_838.length;
for(var i=0;i<_83a;i++){
var oKey=_838[i][0];
var oVal=_838[i][1];
obj[oKey.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})]=oVal;
}
this._cssClassesHash=obj;
}
},_getFilteredCssClasses:function(_83f){
this._createCssFilterObject();
if(_83f&&this._cssClassesHash){
var _840=[];
var _841=_83f.length;
for(var _842=0;_842<_841;_842++){
var _843=_83f[_842];
if(outAlias=this._checkCssFilter(_843[1].selectorText)){
_843[2]=outAlias;
_840[_840.length]=_843;
}
}
return _840;
}else{
return _83f;
}
},_checkCssFilter:function(_844){
if(!_844||!this._cssClassesHash){
return null;
}
return this._cssClassesHash[_844.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})];
},getCssArray:function(_846){
var _847=this.get_document();
var _848=[];
for(var i=0;i<_847.styleSheets.length;i++){
var _84a=_847.styleSheets[i];
this._getStyleSheetRules(_848,_84a,_846);
}
_848=this._getFilteredCssClasses(_848);
return _848;
},_getStyleSheetRules:function(_84b,_84c,_84d){
var _84e=_84c.href;
if(_84e&&_84e.indexOf("WebResource.axd?")>-1){
return;
}
var _84f=(_84c.rules)?_84c.rules:_84c.cssRules;
if($telerik.isIE&&_84c.imports){
for(var k=0;k<_84c.imports.length;k++){
this._getStyleSheetRules(_84b,_84c.imports[k],_84d);
}
}
for(var j=0;j<_84f.length;j++){
var _852=_84f[j];
if(_852&&_852.cssText){
var text=_852.cssText.toLowerCase();
if(text.indexOf("@import")>=0&&_852.parentStyleSheet&&_852.styleSheet&&_852.parentStyleSheet!=_852.styleSheet){
this._getStyleSheetRules(_84b,_852.styleSheet,_84d);
continue;
}
}
var str=_852&&_852.selectorText?_852.selectorText:"";
var _855=str.lastIndexOf(".");
if(_855<0){
continue;
}
var _855=str.lastIndexOf(":");
if(_855>0){
continue;
}
var _856=this._getClassName(_852);
_84b[_84b.length]=[_856,_852];
}
},copyStyleSheets:function(_857,_858){
if(null==_857&&null==_858){
return;
}
var _859=0;
var _85a=null;
if(_858.styleSheets.length==0){
if(_858.createStyleSheet){
_858.createStyleSheet();
}else{
css=_858.createElement("style");
css.media="all";
css.type="text/css";
var _85b=_858.getElementsByTagName("head")[0];
_85b.appendChild(css);
_85a=css;
}
}
if(_858.styleSheets[0]){
_85a=_858.styleSheets[0];
}
for(var i=0;i<_857.styleSheets.length;i++){
try{
var _85d=_857.styleSheets[i];
var _85e=_85d.href;
var _85f=false;
if($telerik.isFirefox){
if(_85d.ownerNode&&_85d.ownerNode.tagName.toLowerCase()=="style"){
_85f=true;
}
}
if(_85e&&!_85f){
continue;
}
var _860=(_85d.rules)?_85d.rules:_85d.cssRules;
for(var j=0;j<_860.length;j++){
var _862=_860[j];
if(_85a.addRule){
var _863=_862.selectorText;
var oCss=_862.style.cssText;
if(oCss&&_863){
_85a.addRule(_863,oCss,_859);
}
}else{
if(_85a.insertRule){
_85a.insertRule(_862.cssText,_859);
}else{
var oCss=_862.selectorText+"{"+_862.style.cssText+"}";
var _865=_858.createTextNode(oCss);
_85a.appendChild(_865);
}
}
_859++;
}
}
catch(exc){
}
}
},_setContentAreaHtml:function(_866,_867){
var _868=this.get_filtersManager().getDesignContent(_866);
this.set_contentHiddenTextareaValue(_868);
var _869=null;
if(-1!=_868.toLowerCase().indexOf("<html")){
this.set_fullPage(true);
_869=_868;
var _86a=new RegExp("(<!DOCTYPE(.|\\n)*?>)(.|\\n)*?","g");
this._doctypeString=(_869.match(_86a))?_869.match(_86a)[0]:"";
}else{
this.set_fullPage(false);
}
if(null!=_869||true==_867){
var _86b=this;
var _86c=function(){
_86d=false;
try{
_86b._document=_86b._contentAreaElement.contentWindow.document;
_86b._contentWindow=_86b._contentAreaElement.contentWindow;
_86b._contentArea=_86b._document.body;
_86b.get_filtersManager().getDesignContentDom(_86b.get_contentArea());
var _86e=1;
Telerik.Web.UI.Editor.Utils.addStyleSheet(_86b.get_contentAreaCssFile(),_86b._document,_86b._getUniqueStyleSheetId(0));
var _86f=_86b.get_cssFiles();
if(_86f.length>0){
for(var i=0;i<_86f.length;i++){
var _871=_86b._getUniqueStyleSheetId(_86e++);
Telerik.Web.UI.Editor.Utils.addStyleSheet(_86f[i],_86b._document,_871);
}
}else{
if(!_86b._fullPage){
_86b.copyStyleSheets(document,_86b._document);
var _872=_86b._getAllSheets(document);
for(var i=0;i<_872.length;i++){
var _871=_86b._getUniqueStyleSheetId(_86e++);
var _873=_872[i];
if(_873.tagName=="LINK"){
var _874=_873.href;
if(_874&&_874.indexOf("WebResource.axd?")>-1){
continue;
}
if(_874){
Telerik.Web.UI.Editor.Utils.addStyleSheet(_873.getAttribute("href"),_86b._document,_871);
}
}else{
if(_873.tagName=="STYLE"){
}
}
}
}
}
var _875=Telerik.Web.UI.Editor.PopupController;
if(_875){
_875.detachFromDocument(_86b._document);
_875.attachToDocument(_86b._document);
}
_86b._initEvents();
if(_86b.isVisible()){
_86b.raiseEvent("firstShow");
}
if(_86b.get_mode()!=Telerik.Web.UI.EditModes.Preview){
_86b.set_editable(true);
}else{
_86b.set_editable(false);
}
_86b.toggleEnhancedEdit(true);
if(_86b._document&&_86b._document.body){
_86b.raiseEvent("editReady",Sys.EventArgs.Empty);
}
}
catch(e){
}
};
if($telerik.isFirefox){
$addHandler(this._contentAreaElement,"load",function(){
if(_86d){
_86c();
}
});
}
if(!_869){
_869="<head><style></style></head><body>"+_868+"</body>";
}
try{
var _876=this._contentAreaElement.contentWindow.document;
_876.open();
_876.write(_869);
_876.close();
var _86d=false;
if(_876.body){
_86c();
}else{
_86d=true;
}
}
catch(e){
}
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this._contentArea,_868);
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=this.get_mainTable();
var _878=$get(id+"Center");
var _879=this.get_contentAreaElement();
_879.style.display="none";
var _87a=_878.offsetHeight;
_878.appendChild(_879);
_879.style.height="100%";
_879.style.display="";
if(!$telerik.isIE&&_87a<160&&_878.offsetHeight>_87a+2){
_878.style.height=_87a+"px";
}
this._created=true;
},_updateEditorSize:function(_87b,_87c){
var _87d=this._tableElement;
var _87e=_87b?_87b:_87d.style.height;
if(true==_87c){
_87e=_87d.offsetHeight+"px";
}
if(parseInt(_87e)==0){
return;
}
_87e=parseInt(_87e)+"px";
_87d.style.height=_87e;
if(this.isIE){
this._fixIeHeight(_87d,_87e);
}else{
}
_87d.parentNode.style.height=_87e;
},_fixIeHeight:function(_87f,_880){
if("CSS1Compat"==document.compatMode){
var _881=(_87f.offsetHeight-parseInt(_880));
if(_881>0){
var _882=(parseInt(_87f.style.height)-_881);
if(_882>0){
_87f.style.height=_882+"px";
}
}
}
},setSize:function(_883,_884){
var _883=parseInt(_883);
var _884=parseInt(_884);
var _885=this;
var _886=this.get_mainTable();
_886.style.height="";
var _887=_886.parentNode;
_887.style.width=_883+"px";
_887.style.height=_884+"px";
_885._fixIeHeight(_887,_884);
if(_885.isIE){
_886.style.height=_884+"px";
_885._fixIeHeight(_886,_884);
}else{
_886.style.height="100%";
}
},pasteHtml:function(_888,_889,_88a,_88b,_88c){
if(!this.get_editable()){
return;
}
var args=new Telerik.Web.UI.EditorCommandEventArgs(_889,null,_888);
if(false==this._executeCommandEvent("pasteHtml",_889,args)){
return;
}
if(_888!=args.get_value()){
_888=args.get_value();
}
var _88e=this.get_localization()[_889];
if(_88e){
_889=_88e;
}
var mode=this.get_mode();
if(Telerik.Web.UI.EditModes.Design==mode){
this.setFocus();
this.executeCommand(new Telerik.Web.UI.Editor.PasteHtmlCommand(_889,this._contentWindow,_888,_88a),null,_88c);
if(_88b!=false){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
}else{
if(Telerik.Web.UI.EditModes.Html==mode){
var _890=this._getTextArea();
if(this.isIE){
_890.setActive();
var _891=document.selection.createRange();
_891.text=_888;
}else{
if(_890.setSelectionRange){
var _892=_890.selectionStart;
var _893=_890.selectionEnd;
var _894=_890.value.substring(_892,_893);
var _895=_888;
_890.value=_890.value.substring(0,_892)+_895+_890.value.substring(_893);
_890.setSelectionRange(_892+_895.length,_892+_895.length);
this.setFocus();
}
}
}
}
},fire:function(_896,args){
if(false==this._executeCommandEvent("commandExecuting",_896,args)){
return;
}
if(this._optionalIgnoredTools&&!this._optionalIgnoredTools[_896]){
return;
}
this.setActive();
this._pendingTextTypeCmd=null;
var _898=Telerik.Web.UI.Editor.CommandList[_896];
var _899=false;
if(_898){
_899=(false!=_898(_896,this,args));
}else{
alert("The command "+_896+" is not implemented yet.");
}
if(_899){
if(!$telerik.isOpera){
this.setFocus();
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
this._executeCommandEvent("commandExecuted",_896,args);
},_executeCommandEvent:function(_89a,_89b,args){
if(!args){
args=new Telerik.Web.UI.EditorCommandEventArgs(_89b);
}
this.raiseEvent(_89a,args);
if(args.get_cancel&&args.get_cancel()){
return false;
}
return true;
},_onWindowResize:function(){
var _89d=this._getViewportBounds();
this.setSize(_89d.width,_89d.height,false);
},_registerWindowResizeHandler:function(_89e){
if(_89e){
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 _89f=$telerik.getClientBounds();
var _8a0=document.documentElement.scrollLeft||document.body.scrollLeft;
var _8a1=document.documentElement.scrollTop||document.body.scrollTop;
_89f.scrollLeft=_8a0;
_89f.scrollTop=_8a1;
return _89f;
},_handleParentsWithOverflow:function(_8a2){
if(false==_8a2){
if(!this._parentsWithOverflow){
return;
}
var _8a3=this._parentsWithOverflow;
var _8a4=_8a3.length;
for(var i=0;i<_8a4;i++){
var _8a6=_8a3[i];
if(_8a6[0]){
var _8a7=_8a6[0].style;
_8a7.overflow=_8a6[1];
_8a7.height=_8a6[2];
_8a7.tableLayout=_8a6[3];
_8a7.position=_8a6[4];
}
}
this._parentsWithOverflow=null;
}else{
this._parentsWithOverflow=[];
var _8a3=this._parentsWithOverflow;
var _8a8=this._getRootNode().parentNode;
while(_8a8&&_8a8.tagName!="BODY"){
var _8a7=_8a8.style;
_8a3[_8a3.length]=[_8a8,_8a7.overflow,_8a7.height,_8a7.tableLayout,_8a7.position];
_8a8.style.position="static";
_8a8.style.tableLayout="auto";
_8a8.style.overflow="visible";
_8a8.style.height="auto";
_8a8=_8a8.parentNode;
}
}
},_getRootNode:function(){
return this.get_mainTable().parentNode;
},isFullScreen:function(){
return this._isFullScreen;
},toggleScreenMode:function(){
var _8a9=this;
if(!_8a9._isFullScreen){
_8a9._preFullScreenBodyStyle=[document.body.scroll,document.body.style.margin,""];
document.body.scroll="no";
document.body.style.margin="0px";
if(document.documentElement){
_8a9._preFullScreenBodyStyle[2]=document.documentElement.style.overflow;
document.documentElement.style.overflow="hidden";
}
var _8aa=_8a9._getRootNode();
_8a9._preFullScreenBounds=$telerik.getBounds(_8aa);
_8a9._handleParentsWithOverflow(true);
_8a9._onWindowResize();
_8a9._preFullScreenBrowserRect=_8a9._getViewportBounds();
var _8ab=$telerik.getLocation(_8aa);
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_8ab.x,_8ab.y);
_8a9._isFullScreen=true;
_8a9._registerWindowResizeHandler(true);
}else{
_8a9._registerWindowResizeHandler(false);
document.body.scroll=_8a9._preFullScreenBodyStyle[0];
try{
document.body.style.margin=_8a9._preFullScreenBodyStyle[1];
}
catch(e){
}
document.documentElement.style.overflow=_8a9._preFullScreenBodyStyle[2];
_8a9._isFullScreen=false;
_8a9._handleParentsWithOverflow(false);
var _8ac=_8a9._preFullScreenBounds;
_8a9.setSize(_8ac.width,_8ac.height,false);
var _8ab=_8a9._preFullScreenBrowserRect;
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_8ab.scrollLeft,_8ab.scrollTop);
}
_8a9.set_editable(true);
_8a9.setFocus();
var _8ad=_8a9.getToolByName("ToggleScreenMode");
if(_8ad){
_8ad.setOn(_8a9._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(_8ae){
if($telerik.isSafari&&this._contentHiddenTextarea.innerText!=null){
this._contentHiddenTextarea.innerText=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_8ae);
}else{
this._contentHiddenTextarea.value=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_8ae);
}
},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";
elem.setAttribute("id",this.get_id()+"_contentIframe");
this._contentAreaElement=elem;
}
return this._contentAreaElement;
},get_contentArea:function(){
return this._contentArea;
},get_document:function(){
return this._document;
},get_contentWindow:function(){
return this._contentWindow;
},get_toolAdapter:function(){
return this._toolAdapter;
},set_toolAdapter:function(_8b0){
this._toolAdapter=_8b0;
},get_fullPage:function(){
return this._fullPage;
},set_fullPage:function(_8b1){
this._fullPage=_8b1;
},get_dialogOpener:function(){
return this._dialogOpener;
},set_dialogOpener:function(_8b2){
this._dialogOpener=_8b2;
},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(_8b3){
this._links=_8b3;
},get_language:function(){
if(null==this._language){
return "en-us";
}
return this._language.toLowerCase();
},set_language:function(_8b4){
this._language=_8b4;
},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(_8b5){
this._colors=_8b5;
},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(_8b6){
this._fontNames=_8b6;
},get_fontSizes:function(){
if(null==this._fontSizes){
return [1,2,3,4,5,6,7];
}
return this._fontSizes;
},set_fontSizes:function(_8b7){
this._fontSizes=_8b7;
},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(_8b8){
this._symbols=_8b8;
},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(_8b9){
this._realFontSizes=_8b9;
},get_contextMenus:function(){
if(null==this._contextMenus){
return [];
}
return this._contextMenus;
},set_contextMenus:function(_8ba){
this._contextMenus=_8ba;
},get_snippets:function(){
if(null==this._snippets){
return [];
}
return this._snippets;
},set_snippets:function(_8bb){
this._snippets=_8bb;
},get_cssClasses:function(){
if(null==this._cssClasses){
return [];
}
return this._cssClasses;
},set_cssClasses:function(_8bc){
this._cssClasses=_8bc;
},get_cssFiles:function(){
if(null==this._cssFiles){
return [];
}
return this._cssFiles;
},set_cssFiles:function(_8bd){
this._cssFiles=_8bd;
},get_languages:function(){
if(null==this._languages){
return [];
}
return this._languages;
},set_languages:function(_8be){
this._languages=_8be;
},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(_8bf){
this._paragraphs=_8bf;
},get_toolsWidth:function(){
return this._toolsWidth;
},set_toolsWidth:function(_8c0){
this._toolsWidth=_8c0;
},get_toolProviderID:function(){
return this._toolProviderID;
},set_toolProviderID:function(_8c1){
this._toolProviderID=_8c1;
},get_autoResizeHeight:function(){
return this._autoResizeHeight;
},set_autoResizeHeight:function(_8c2){
this._autoResizeHeight=_8c2;
},get_toolbarMode:function(){
return this._toolbarMode;
},set_toolbarMode:function(_8c3){
this._toolbarMode=_8c3;
},get_editModes:function(){
return this._editModes;
},set_editModes:function(_8c4){
this._editModes=_8c4;
},get_stripFormattingOptions:function(){
return this._stripFormattingOptions;
},set_stripFormattingOptions:function(_8c5){
this._stripFormattingOptions=_8c5;
},get_contentFilters:function(){
return this._contentFilters;
},set_contentFilters:function(_8c6){
this._contentFilters=_8c6;
},get_newLineBr:function(){
return this._newLineBr;
},set_newLineBr:function(_8c7){
this._newLineBr=_8c7;
},get_contentAreaCssFile:function(){
return this._contentAreaCssFile;
},set_contentAreaCssFile:function(_8c8){
this._contentAreaCssFile=_8c8;
},get_mozillaFlashOverlayImage:function(){
return this._mozillaFlashOverlayImage;
},set_mozillaFlashOverlayImage:function(_8c9){
this._mozillaFlashOverlayImage=_8c9;
},get_toolAdapterType:function(){
return this._toolAdapterType;
},set_toolAdapterType:function(_8ca){
this._toolAdapterType=_8ca;
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_8cb){
this._toolJSON=_8cb;
},get_modulesJSON:function(){
return this._modulesJSON;
},set_modulesJSON:function(_8cc){
this._modulesJSON=_8cc;
},get_contextMenusJSON:function(){
return this._contextMenusJSON;
},set_contextMenusJSON:function(_8cd){
this._contextMenusJSON=_8cd;
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_8ce){
this._uniqueID=_8ce;
},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(_8d0){
this._skin=_8d0;
},_registerClientValidation:function(){
if(typeof (Page_ClientValidate)=="function"){
var _8d1=Page_ClientValidate;
Page_ClientValidate=Function.createDelegate(this,function(_8d2){
var _8d3=this.get_element();
if(_8d3){
var _8d4=this.get_html(true);
this.set_contentHiddenTextareaValue(_8d4);
_8d3.value=_8d4;
_8d3.setAttribute("value",_8d4);
}
_8d3=null;
return _8d1(_8d2);
});
}
},saveContent:function(){
if(this._saveContentDelegate){
this.raiseEvent("submit",Sys.EventArgs.Empty);
var _8d5=this.get_html(true);
this.set_contentHiddenTextareaValue(_8d5);
}
},_registerPostBackHandlers:function(){
this._saveContentDelegate=Function.createDelegate(this,this.saveContent);
var _8d6=this._contentHiddenTextarea.form;
$telerik.addExternalHandler(_8d6,"submit",this._saveContentDelegate);
if(typeof (__doPostBack)!="undefined"){
var _8d7=this._saveContentDelegate;
var _8d8=__doPostBack;
__doPostBack=function(_8d9,_8da){
_8d7();
_8d8(_8d9,_8da);
};
}
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;
}
_8d6=null;
},toggleEnhancedEdit:function(_8dc){
if(!this.get_document()){
return false;
}
var _8dd=this.get_document().getElementById(this._getUniqueStyleSheetId(0));
if(_8dd){
if(_8dc==null){
_8dc=_8dd.disabled;
}
_8dd.disabled=!_8dc;
var tool=this.getToolByName("ToggleTableBorder");
if(tool){
tool.setOn(_8dc);
}
return _8dc;
}else{
return false;
}
},pasteHyperLink:function(_8df,_8e0){
if($telerik.isIE){
var sel=this.getSelectedElement();
if(sel.tagName=="IMG"&&sel.parentNode&&sel.parentNode.tagName=="A"){
var _8e2=sel.parentNode;
_8e2.parentNode.removeChild(_8e2);
}
if(sel.tagName=="IMG"){
_8df.innerHTML=Telerik.Web.UI.Editor.Utils.getOuterHtml(sel);
}
}
if($telerik.isOpera){
var sel=this.getSelectedElement();
if(sel.tagName=="A"){
this.fire("Unlink");
}
}
if("DocumentManager"==_8e0){
var _8e3=this.getSelection().getText();
if(""!=_8e3.trim()){
_8df.innerHTML=_8e3;
}
}
var _8e4=Telerik.Web.UI.Editor.Utils.getOuterHtml(_8df);
this.pasteHtml(_8e4,_8e0);
},_saveTypedContent:function(_8e5,_8e6){
if(this._pendingTextTypeCmd){
this._pendingTextTypeCmd.update();
}
if(true!=_8e5){
this._pendingTextTypeCmd=null;
}
},_attachIEBodyHandlers:function(_8e7){
var body=null;
if(this._document&&this._document.body){
body=this._document.body;
}
if(!body){
return;
}
if(_8e7){
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){
if(!$telerik.isFirefox){
$telerik.addExternalHandler(body,"paste",this._onPasteDelegate);
}else{
}
}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(!$telerik.isFirefox){
if(this._onPasteDelegate){
$telerik.removeExternalHandler(body,"paste",this._onPasteDelegate);
}
}else{
}
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 _8e9=this;
var _8ea=_8e9.fire;
_8e9.fire=function(_8eb,_8ec){
if(_8eb!="Copy"){
_8e9._saveTypedContent(true,"editor.fire "+_8eb+" executing");
}
_8ea.call(_8e9,_8eb,_8ec);
try{
if(_8eb=="Undo"&&!_8e9.isIE&&_8e9._document.body.innerHTML.toLowerCase().trim()=="<br>"){
_8e9._document.body.innerHTML="<br>";
}
}
catch(e){
}
};
this.attachEventHandler("onclick",function(e){
_8e9._saveTypedContent(false,"Saving typed content because of oclick (somewhere else)");
if(_8e9.getSelectionHtml()){
_8e9._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(_8e9.get_localization()["Typing"],_8e9.get_contentWindow());
_8e9.executeCommand(_8e9._pendingTextTypeCmd,false);
}
});
if(!this.isIE){
this.attachEventHandler("keypress",function(e){
if(_8e9._onKeyPressed(e)){
e.preventDefault();
return false;
}
});
this.attachEventHandler("click",function(e){
if(!_8e9.isFirefox){
return;
}
if(!_8e9.get_editable()){
return;
}
if("on"==_8e9._document["designMode"]){
window.setTimeout(function(){
_8e9.set_editable(true);
_8e9.setFocus();
},100);
}
});
}
this.attachEventHandler("keydown",function(e){
if(_8e9.isOpera){
return _8e9._onKeyDown(e);
}else{
_8e9._onKeyDown(e);
}
});
this.attachEventHandler("onmousedown",function(){
_8e9._saveTypedContent(false,"Saving typed content onmousedown");
});
this.attachEventHandler("keyup",Function.createDelegate(this,this._onKeyUp));
var _8f1=Function.createDelegate(this,function(e){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
});
this.attachEventHandler("mouseup",_8f1);
$telerik.addExternalHandler(document.body,"dragend",Function.createDelegate(this,this._onDocumentDragEnd));
this._attachIEBodyHandlers(true);
},_onKeyDown:function(e){
var _8f4=e.keyCode;
switch(_8f4){
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 _8f5=this;
var _8f6=function(){
var _8f7=_8f5.getSelectedElement();
if(_8f7&&_8f7.tagName=="EMBED"){
_8f7.setAttribute("hidden","true");
_8f7.setAttribute("id","FileToDelete");
window.setTimeout(function(){
var _8f8=_8f5._document.getElementById("FileToDelete");
if(_8f8.parentNode&&_8f8.parentNode.removeChild){
_8f8.parentNode.removeChild(_8f8);
}
},100);
$telerik.cancelRawEvent(e);
return true;
}
};
var _8f9=_8f6();
if(_8f9){
return false;
}
try{
var _8fa=_8f5._document.selection.createRange();
var _8fb=null;
if(_8fa&&_8fa.duplicate){
_8fb=_8fa.duplicate();
}
if(8==e.keyCode){
_8fa.moveStart("character",-1);
}else{
_8fa.moveEnd("character",1);
}
if(_8fa.parentElement().tagName=="EMBED"){
_8fa.select();
_8f6();
if(_8fb&&_8fb.select){
_8fb.select();
}
}
}
catch(ex){
}
var _8fc=new Telerik.Web.UI.Editor.Selection(this._contentWindow);
if(_8fc&&_8fc.isControl()){
var _8fd=_8fc.getRange();
_8fd.execCommand("Delete");
$telerik.cancelRawEvent(e);
}
}
return;
}
var _8fe=e.target?e.target:e.srcElement;
if(_8fe&&"INPUT"!=_8fe.tagName){
var _8ff=this._shortCutManager.isShortCutHit(e);
if(null!=_8ff&&_8ff.get_name()=="Copy"){
this._shortcutHit=false;
return;
}
this._shortcutHit=(null!=_8ff);
if(this._shortcutHit){
this.fire(_8ff.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=_8ff.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(_903,_904,_905,_906){
var _907=this;
var _908=(this.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _909=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_904,_907.get_stripFormattingOptions(),_907.get_localization()["askwordcleaning"],_908);
if(_903){
_903.select();
}
if(_909){
window.setTimeout(function(){
if(_906&&_903){
_903.select();
}
_907.pasteHtml(_909);
},5);
return $telerik.cancelRawEvent(_905);
}
return true;
},_onPaste:function(_90a){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _90b=this.createRestorePoint();
var _90c=this.getSelectionHtml()?true:false;
var _90d=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
return this._insertPastedContent(_90b,_90d,_90a,_90c);
},_onBeforePaste:function(_90e){
if(_90e){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _90f=new Telerik.Web.UI.Editor.GenericCommand("Paste",this._contentWindow);
var _910=this.getSelection().getRange();
var _911=Telerik.Web.UI.Editor.Utils.getUniqueID();
if(_910.pasteHTML){
_910.pasteHTML("&nbsp;<font id='"+_911+"'>&nbsp;</font>");
}else{
this.pasteHtml("&nbsp;<font id='"+_911+"'>&nbsp;</font>");
}
var _912=Telerik.Web.UI.Editor.Utils.getPasteContainer();
_912.innerHTML="";
if(_912.setActive){
_912.setActive();
}else{
_912.focus();
}
var _913=this;
window.setTimeout(function(){
var _914=_912.innerHTML;
var _915=(_913.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _916=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_914,_913.get_stripFormattingOptions(),_913.get_localization()["askwordcleaning"],_915);
var _917=_913._document.getElementById(_911);
_913.setActive(true);
_913._pendingCutPasteCommand=null;
if(_913._document.body.createTextRange){
var _918=_913._document.body.createTextRange();
_918.moveToElementText(_917);
_918.moveStart("character",-1);
_918.select();
_918.pasteHTML(_916);
}else{
_913.getSelection().selectRange(_918);
_913.pasteHtml(_916);
}
_913.executeCommand(_90f);
_913.setActive(true);
_913.setFocus(true);
},0);
}else{
}
},_onResizeStart:function(e){
var _91a=this.getSelectedElement();
if(_91a==e.srcElement){
var _91b=this.get_localization()["ResizeCommand"]||"Resize";
this._pendingResizeCmd=new Telerik.Web.UI.Editor.GenericCommand(_91b,this._contentWindow);
}
},_onResizeEnd:function(e){
if(this._pendingResizeCmd){
this.executeCommand(this._pendingResizeCmd);
}
},_onDragStart:function(e){
var _91e=this.get_localization()["MoveCommand"]||"Move";
this._pendingMoveCommand=new Telerik.Web.UI.Editor.GenericCommand(_91e,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 _920=this._startRange.item(0);
if("IMG"==_920.tagName&&"A"==_920.parentNode.tagName&&_920.parentNode.childNodes.length==1){
_920=_920.parentNode;
}
rng.moveToElementText(_920);
this._startRange=rng;
}
}
},_onDragEnd:function(e){
if(this._pendingMoveCommand){
if(this._startRange){
var _922=this._contentWindow.document.selection.createRange();
if(_922.length){
var rng=this._contentWindow.document.body.createTextRange();
rng.moveToElementText(_922.item(0));
_922=rng;
}
try{
if(_922.compareEndPoints&&0!=_922.compareEndPoints("StartToStart",this._startRange)&&0!=_922.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 _925=this.get_localization()["Drop"]||"Drop external content";
this._pendingDockCommand=new Telerik.Web.UI.Editor.GenericCommand(_925,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(_927){
this.get_events().addHandler("toggleScreenMode",_927);
},remove_toggleScreenMode:function(_928){
this.get_events().removeHandler("toggleScreenMode",_928);
},add_modeChange:function(_929){
this.get_events().addHandler("modeChange",_929);
},remove_modeChange:function(_92a){
this.get_events().removeHandler("modeChange",_92a);
},add_load:function(_92b){
this.get_events().addHandler("load",_92b);
},remove_load:function(_92c){
this.get_events().removeHandler("load",_92c);
},add_init:function(_92d){
this.get_events().addHandler("init",_92d);
},remove_init:function(_92e){
this.get_events().removeHandler("init",_92e);
},add_selectionChange:function(_92f){
this.get_events().addHandler("selectionChange",_92f);
},remove_selectionChange:function(_930){
this.get_events().removeHandler("selectionChange",_930);
},add_commandExecuting:function(_931){
this.get_events().addHandler("commandExecuting",_931);
},remove_commandExecuting:function(_932){
this.get_events().removeHandler("commandExecuting",_932);
},add_commandExecuted:function(_933){
this.get_events().addHandler("commandExecuted",_933);
},remove_commandExecuted:function(_934){
this.get_events().removeHandler("commandExecuted",_934);
},add_submit:function(_935){
this.get_events().addHandler("submit",_935);
},remove_submit:function(_936){
this.get_events().removeHandler("submit",_936);
},add_editReady:function(_937){
this.get_events().addHandler("editReady",_937);
},remove_editReady:function(_938){
this.get_events().removeHandler("editReady",_938);
},add_pasteHtml:function(_939){
this.get_events().addHandler("pasteHtml",_939);
},remove_pasteHtml:function(_93a){
this.get_events().removeHandler("pasteHtml",_93a);
},add_firstShow:function(_93b){
this.get_events().addHandler("firstShow",_93b);
},remove_firstShow:function(_93c){
this.get_events().removeHandler("firstShow",_93c);
}};
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);

