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));
}
catch(e){
}
var _8c=_89.execCommand(this.CommandID,false,this.Value);
try{
_89.execCommand("UseCSS",false,true);
}
catch(e){
}
return _8c;
}};
Telerik.Web.UI.Editor.BrowserCommand.registerClass("Telerik.Web.UI.Editor.BrowserCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.StyleRuleCommand=function(_8d,_8e,_8f,_90,_91){
Telerik.Web.UI.Editor.StyleRuleCommand.initializeBase(this,[(_8d||sCmdID),_8e,true]);
if(!_8f){
var _92=new Telerik.Web.UI.Editor.Selection(this._window);
_8f=_92.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_8f);
this._styleAttributeName=_90;
this._newValue=_91;
};
Telerik.Web.UI.Editor.StyleRuleCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.StyleRuleCommand(this._title,this._window,null,this._styleAttributeName,this._newValue);
},execute:function(){
var _93=this._nodeBookmark.select();
if(!_93){
return false;
}
if(!this._isExecuted){
this._oldValue=_93.style[this._styleAttributeName];
}
_93.style[this._styleAttributeName]=this._newValue;
this._isExecuted=true;
return true;
},unexecute:function(){
var _94=this._nodeBookmark.select();
_94.style[this._styleAttributeName]=this._oldValue;
}};
Telerik.Web.UI.Editor.StyleRuleCommand.registerClass("Telerik.Web.UI.Editor.StyleRuleCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.AttributeCommand=function(_95,_96,_97,_98,_99){
Telerik.Web.UI.Editor.AttributeCommand.initializeBase(this,[(_95||sCmdID),_96,true]);
if(!_97){
var _9a=new Telerik.Web.UI.Editor.Selection(this._window);
_97=_9a.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_97);
this._attribName=_98;
this._newValue=_99;
};
Telerik.Web.UI.Editor.AttributeCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.AttributeCommand(this._title,this._window,null,this._attribName,this._newValue);
},execute:function(){
var _9b=this._nodeBookmark.select();
if(!_9b){
return false;
}
if(!this._isExecuted){
this._oldValue=_9b.getAttribute(this._attribName);
}
if(this._attribName&&this._attribName.toLowerCase()=="name"&&document.all){
_9b.name=this._newValue;
_9b.removeAttribute("name");
_9b.removeAttribute("NAME");
}
var _9c=this._newValue.trim();
if(""==_9c){
_9b.removeAttribute(this._attribName,0);
if("className"==this._attribName){
_9b.removeAttribute("class",0);
}
}else{
_9b[this._attribName]=this._newValue;
if(this._attribName.toLowerCase()=="nowrap"){
_9b.setAttribute(this._attribName,this._newValue);
}
}
this._isExecuted=true;
return true;
},unexecute:function(){
var _9d=this._nodeBookmark.select();
_9d[this._attribName]=this._oldValue;
}};
Telerik.Web.UI.Editor.AttributeCommand.registerClass("Telerik.Web.UI.Editor.AttributeCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.ClassNameCommand=function(_9e,_9f,_a0){
Telerik.Web.UI.Editor.ClassNameCommand.initializeBase(this,[(_9e||"Classname"),_9f,true]);
};
Telerik.Web.UI.Editor.ClassNameCommand.prototype={getValue:function(_a1){
_a1=_a1||this._window;
if($telerik.isIE){
return this._getValueIE(_a1);
}else{
return this._getValueMoz(_a1);
}
},_getValueIE:function(_a2){
var _a3=new Telerik.Web.UI.Editor.Selection(_a2);
var _a4=_a3.getParentElement();
if("BODY"==_a4.tagName){
return "";
}else{
return (""==_a4.className?"":_a4.className);
}
},_getValueMoz:function(_a5){
if(!_a5){
return "";
}
var _a6=_a5.getSelection();
if(!_a6){
return "";
}
if(_a6.rangeCount!=1){
return "";
}
var _a7=(_a6.focusNode.nodeType!=3?_a6.focusNode:_a6.focusNode.parentNode);
var _a8=(_a6.anchorNode.nodeType!=3?_a6.anchorNode:_a6.anchorNode.parentNode);
if(_a7!=_a8){
return "";
}
var _a9=new Telerik.Web.UI.Editor.Selection(_a5);
var _aa="",_ab;
if(null!=_a9&&null!=(_ab=_a9.getParentElement())){
_aa=_ab.className;
}
return (""==_aa?"":_aa);
}};
Telerik.Web.UI.Editor.ClassNameCommand.registerClass("Telerik.Web.UI.Editor.ClassNameCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.FormatBlockCommand=function(_ac,_ad,_ae){
Telerik.Web.UI.Editor.FormatBlockCommand.initializeBase(this,[(_ac||"Format Block"),_ad,true]);
this.FormatValue=_ae;
};
Telerik.Web.UI.Editor.FormatBlockCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.FormatBlockCommand(this.Title,this._window,this.FormatValue);
},getValue:function(_af){
try{
_af=_af||this._window;
var _b0=_af.document.queryCommandValue("FormatBlock");
if(!document.all){
switch(_b0){
case "x":
case "":
_b0="Normal";
break;
}
}
return _b0;
}
catch(ex){
}
return null;
},_isFormatBlockElement:function(_b1){
if(!_b1||!_b1.tagName){
return false;
}
var _b2=_b1.tagName;
if(_b2=="H1"||_b2=="H2"||_b2=="H3"||_b2=="H4"||_b2=="H5"||_b2=="H6"||_b2=="H7"||_b2=="ADDRESS"||_b2=="PRE"){
return true;
}
},OnExecuteIE:function(){
var _b3=this._window.document;
if("<p>"==this.FormatValue.toLowerCase()){
return _b3.execCommand("FormatBlock",false,"<p>")&&_b3.execCommand("RemoveFormat");
}
var _b4=_b3.selection.createRange();
var _b5=false;
var _b6=_b4.htmlText.trim();
if(_b6&&_b6.length>2&&_b6.substr(0,2).toLowerCase()=="<p"){
_b5=true;
}
if(!_b5&&""!=_b4.text){
var _b7=this.FormatValue.substring(1,this.FormatValue.length-1);
_b3.execCommand("FormatBlock",false,"<p>");
_b3.execCommand("RemoveFormat");
var _b8=_b3.createElement(_b7);
_b8.innerHTML=_b4.htmlText;
_b4.pasteHTML(_b8.outerHTML);
return true;
}else{
return _b3.execCommand("FormatBlock",false,this.FormatValue);
}
},OnExecuteMoz:function(){
var _b9=this.FormatValue.substring(1,this.FormatValue.length-1);
var _ba=this._window.document;
var _bb=("body"==this.FormatValue.toLowerCase()||"normal"==this.FormatValue.toLowerCase());
var _bc=null;
var _bd=_b9.indexOf(" ");
if(_bd!=-1){
_bc=_b9.substring(_bd+1);
_b9=_b9.substring(0,_bd);
}
if(this.isSafari){
if(_bb){
}else{
var _be=_ba.createElement(_b9);
if(_bc){
var _bf="";
_bf=_bc.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_bf.length>0){
_be.className=_bf;
}
}
var _c0=new Telerik.Web.UI.Editor.Selection(this._window);
_be.innerHTML=_c0.getHtml();
var _c1=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_be.outerHTML,true);
_c1.execute();
}
return;
}
if(_bb){
return _ba.execCommand("FormatBlock",false,"Normal");
}
var _c2=this._window.getSelection();
if(_c2.rangeCount<1){
return false;
}
var _c3=_c2.getRangeAt(0);
var _c4=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
if(_c3.toString()!=""&&!this._isFormatBlockElement(_c4)){
try{
var _be=_ba.createElement(_b9);
if(_bc){
var _bf="";
_bf=_bc.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_bf.length>0){
_be.className=_bf;
}
}
_be.appendChild(_c3.extractContents());
_c3.insertNode(_be);
return true;
}
catch(ex){
return false;
}
}else{
return _ba.execCommand("FormatBlock",false,this.FormatValue);
}
return false;
}};
Telerik.Web.UI.Editor.FormatBlockCommand.registerClass("Telerik.Web.UI.Editor.FormatBlockCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.InsertListCommand=function(_c5,_c6,_c7,_c8,_c9){
Telerik.Web.UI.Editor.InsertListCommand.initializeBase(this,[(_c5||"Insert List"),_c6,true]);
this._newLineBr=(_c7==true);
this._commandName=_c8;
this._listType=(_c8=="InsertOrderedList")?"OL":"UL";
this._listStyle=_c9;
this._document=this._window.document;
};
Telerik.Web.UI.Editor.InsertListCommand.prototype={_insertList:function(){
return this._document.execCommand(this._commandName,false,false);
},_pasteHtml:function(_ca){
var _cb=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_ca);
_cb.execute();
},_expandSelection:function(_cc,_cd,_ce){
var _cf=_cc.duplicate();
var _d0=null;
var _d1=null;
for(var i=_cd.length-1;i>=0;i--){
_cf.moveToElementText(_cd[i]);
var _d3=_cc.compareEndPoints("StartToStart",_cf);
if(-1==_d3||0==_d3){
if(_ce[_cd[i].tagName]!=null){
_d1=_cd[i];
}
}else{
if(_ce[_cd[i].tagName]!=null){
_d0=_cd[i];
break;
}
}
}
if(_d0){
_cf.moveToElementText(_d0);
_cc.setEndPoint("StartToEnd",_cf);
}else{
var _d4=_cc.parentElement();
_cf.moveToElementText(_d4);
_cc.setEndPoint("StartToStart",_cf);
}
if(_d1){
_cf.moveToElementText(_d1);
if("BR"==_d1.tagName){
_cc.setEndPoint("EndToEnd",_cf);
}else{
_cc.setEndPoint("EndToStart",_cf);
}
}else{
var _d4=_cc.parentElement();
_cf.moveToElementText(_d4);
_cc.setEndPoint("EndToEnd",_cf);
}
_cc.select();
},_handleEmptyListSelection:function(_d5,_d6){
var _d7=_d5.parentElement();
var _d8=(_d7&&"P"==_d7.tagName.toUpperCase());
var brs=_d7.getElementsByTagName("BR");
if(_d8&&brs.length==0){
return this._insertList();
}else{
var _da={};
_da["BR"]="";
_da["TD"]="";
_da["OL"]="";
_da["UL"]="";
_da["TABLE"]="";
_da["DIV"]="";
_da["IMG"]="";
_da["OBJECT"]="";
var _db=_d5.parentElement().getElementsByTagName("*");
this._expandSelection(_d5,_db,_da);
if(_d5.htmlText){
return this.OnExecuteIE();
}
}
},OnExecuteIE:function(){
if(!this._newLineBr){
return this._insertList();
}
var _dc=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
var _dd=this._document.selection.createRange();
if("OL"==_dc.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_dc,"OL")!=null||"UL"==_dc.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_dc,"UL")!=null){
return this._insertList();
}else{
if("TD"==_dc.tagName||"TR"==_dc.tagName||"TBODY"==_dc.tagName||"TABLE"==_dc.tagName){
var _dd=this._document.selection.createRange();
var _de=_dd.parentElement().getElementsByTagName("TD");
for(var i=_de.length-1;i>=0;i--){
brRange=_dd.duplicate();
brRange.moveToElementText(_de[i]);
if(_dd.inRange(brRange)&&_de[i].innerHTML!=""){
_dd.moveToElementText(_de[i]);
}
}
}
}
var _e0=this._document.selection;
var _e1=this._listType;
if(_e0.type=="Control"){
var _e2=this._document.body.createTextRange();
_e2.moveToElementText(_dd(0));
var _e3=_e2.parentElement();
var _e4=_e3.tagName.toLowerCase();
if(_e4=="table"||_e4=="tbody"){
var _e5=_e3.parentNode.outerHTML;
_e3.parentNode.outerHTML="<"+_e1+"><LI>"+_e5+"</LI></"+_e1+">";
}else{
var _e5=_e2.htmlText;
this._pasteHtml("<"+_e1+"><LI>"+_e5+"</LI></"+_e1+">");
}
}else{
if(_dd.htmlText==""){
return this._handleEmptyListSelection(_dd,this._commandName);
}
var _e6=this._document.createElement("SPAN");
_e6.innerHTML=_dd.htmlText;
if(_e6.getElementsByTagName("P").length>0){
return this._insertList();
}else{
var _e7;
if(_dd.parentElement().tagName.toUpperCase()=="LI"){
_e7=_dd.parentElement().parentNode;
}else{
_e7=_dd.parentElement();
}
if(_e7.tagName.toUpperCase()=="OL"||_e7.tagName.toUpperCase()=="UL"){
var _e8=_e7.tagName.toUpperCase();
if(_e1==_e8){
if(this._newLineBr){
var _e9=_dd.duplicate();
var _ea=_dd.duplicate();
_ea.moveToElementText(_e7);
var _eb=_dd.duplicate();
var _ec=_e7.getElementsByTagName("LI");
var _ed=0;
var _ee=_ec.length-1;
var _ef=_dd.duplicate();
_ef.moveToElementText(_ec[0]);
var _f0=_dd.duplicate();
_f0.moveToElementText(_ec[_ec.length-1]);
_eb.setEndPoint("EndToEnd",_f0);
_eb.setEndPoint("StartToStart",_ef);
while((_ed<_ec.length)&&(_eb.compareEndPoints("StartToStart",_e9)<=0)){
_eb.moveToElementText(_ec[_ed]);
_eb.setEndPoint("EndToEnd",_f0);
_ed++;
}
_ed-=2;
while((_ee>0)&&(_eb.compareEndPoints("EndToEnd",_e9)>=0)){
_eb.moveToElementText(_ec[_ee]);
_eb.setEndPoint("StartToStart",_ef);
_ee--;
}
_ee+=2;
var _f1=_dd.duplicate();
var _f2=_dd.duplicate();
_f1.moveToElementText(_ec[_ed]);
_f1.collapse(true);
_f1.setEndPoint("StartToStart",_ea);
_f2.moveToElementText(_ec[_ee]);
_f2.collapse(false);
_f2.setEndPoint("EndToEnd",_ea);
_dd.setEndPoint("StartToEnd",_f1);
_dd.setEndPoint("EndToStart",_f2);
var _f3="";
var _f4=false;
var _f5=false;
if(_f1.htmlText.replace(/<(.*?)>/)!=""){
_f3+="<"+_e8+">"+_f1.htmlText+"</"+_e8+">";
}else{
_f4=true;
}
_f3+=_dd.htmlText.replace(/<LI\/?>/gi,"<BR>").replace(/<\/LI>/gi,"").replace(/^\s*<BR\/?>/gi,"").replace(/<BR\/?>\s*$/gi,"");
if(_f2.htmlText.replace(/<(.*?)>/)!=""){
_f3+="<"+_e8+">"+_f2.htmlText+"</"+_e8+">";
}else{
_f5=true;
_f3+="<BR>";
}
if(_f4&&_f5){
_f3=_f3.replace(new RegExp("</?"+_e8+"/?>","gi"),"").replace(/^\s*<BR\/?>/gi,"");
}
if(_e7.parentNode.childNodes[0]==_e7){
_ea.collapse();
_e7.parentNode.removeChild(_e7,_f3);
}else{
_ea.moveStart("character",-1);
}
this._pasteHtml(_f3);
}else{
return this._insertList();
}
}else{
return this._insertList();
}
}else{
var _f6=_dd.duplicate();
_f6.collapse(false);
_f6.moveEnd("character",1);
if(_f6.htmlText.match(/<BR\/?>/gi)){
_dd.moveEnd("character",1);
}
var _f7="<"+_e1+"><LI>"+_dd.htmlText.replace(/(<BR\s*>\s*)*$/gi,"").replace(/<BR\/?>$/gi,"").replace(/<BR\/?>/gi,"</LI><LI>")+"</LI></"+_e1+">";
try{
_dd.pasteHTML(_f7);
}
catch(e){
}
}
}
}
return true;
},OnExecuteMoz:function(){
return this._insertList();
}};
Telerik.Web.UI.Editor.InsertListCommand.registerClass("Telerik.Web.UI.Editor.InsertListCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableCommandBase=function(_f8,_f9){
Telerik.Web.UI.Editor.TableCommandBase.initializeBase(this,[(_f8||"Table Command"),_f9,true]);
};
Telerik.Web.UI.Editor.TableCommandBase.prototype={getState:function(_fa){
return this.getSelectedCell(_fa)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
},getSelectedCell:function(_fb){
var _fc=new Telerik.Web.UI.Editor.Selection(_fb||this._window);
var _fd;
if(_fc){
_fd=_fc.getParentElement();
}
while(null!=_fd&&_fd.tagName!="TD"&&_fd.tagName!="TH"&&_fd.tagName!="BODY"){
_fd=_fd.parentNode;
}
if(!_fd||!_fd.tagName){
return null;
}
return (_fd.tagName=="TD"||_fd.tagName=="TH"?_fd:null);
},getSelectedRow:function(_fe){
var _ff=new Telerik.Web.UI.Editor.Selection(_fe||this._window);
var _100;
if(_ff){
_100=_ff.getParentElement();
}
if(!_100){
return null;
}
while(null!=_100&&_100.tagName!="TR"&&_100.tagName!="BODY"){
_100=_100.parentNode;
}
return (_100&&_100.tagName=="TR"?_100:null);
},getParentTable:function(_101){
if(!_101){
return null;
}
while(null!=_101&&_101.parentNode!=_101&&"TABLE"!=_101.tagName){
_101=_101.parentNode;
}
return (_101&&_101.tagName=="TABLE"?_101:null);
}};
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="rade_SpinBox";
_18c.insertRow(-1);
var _18d=_18c.rows[0].insertCell(-1);
var _18e=document.createElement("INPUT");
_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);
_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=document.createElement("A");
_192.title="Increase";
_192.href="javascript:void(0);";
_192.innerHTML="Increase";
_192.className="rade_SpinBoxIncrease";
_192.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
this._increaseButton=_192;
_191.appendChild(_192);
_190.insertRow(-1);
_191=_190.rows[1].insertCell(-1);
_192=document.createElement("A");
_192.title="Decrease";
_192.href="javascript:void(0);";
_192.innerHTML="Decrease";
_192.className="rade_SpinBoxDecrease";
_192.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
this._decreaseButton=_192;
_191.appendChild(_192);
_18d.appendChild(_190);
var _193=this.get_element();
_193.appendChild(_18c);
_193.style.width=this.get_width();
},_executeFunction:function(e,elem,_196){
if(_196){
if(elem.Executed){
elem.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
elem.Executed=true;
var _197=(this._selectedItem!="")?this._selectedItem:this._initialValue;
this._selectedItem=elem.value;
var _198=new Telerik.Web.UI.EditorSpinBoxEventArgs(elem.value,_197);
this.raiseEvent("valueSelected",_198);
},_onPlusMinusClickHandler:function(e){
var _19a=null;
if(!e){
_19a=window.event.srcElement;
}else{
_19a=e.target;
}
if(!_19a){
return;
}
var _19b=this.get_value();
_19b=_19b.replace(/^0+(\d)/ig,"$1");
if(""==_19b){
_19b="0";
}
var _19c=parseInt(_19b);
var _19d=_19c+"";
if(isNaN(_19c)){
return;
}else{
_19d=_19b.substring(_19d.length);
}
if(_19a==this._increaseButton){
if(this._enabledIncrease){
_19c++;
}else{
return;
}
}else{
if(_19a==this._decreaseButton){
if(this._enabledDecrease){
_19c--;
}else{
return;
}
}else{
_19a=null;
}
}
if(_19a){
this.set_value(_19c+_19d);
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 _1a2=this._selectedItem;
var _1a3=this.get_value();
var _1a4=new Telerik.Web.UI.EditorSpinBoxEventArgs(_1a3,_1a2);
this.raiseEvent("valueSelected",_1a4);
}
},_isKeyValid:function(e,_1a6){
try{
if(!_1a6){
_1a6=false;
}
if(!e){
e=window.event;
}
var _1a7=((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(!_1a6){
_1a7|=((35<=e.keyCode&&e.keyCode<=40));
}
return _1a7;
}
catch(ex){
return true;
}
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1a8){
if(null==_1a8){
_1a8="";
}
this._inputElement.value=_1a8;
if(this._initialValue==""){
this._initialValue=_1a8;
}
},get_width:function(){
return this._width;
},set_width:function(_1a9){
this._width=_1a9;
var _1aa=this.get_element();
_1aa.style.width=this._width;
},get_enabledIncrease:function(){
return this._enabledIncrease;
},set_enabledIncrease:function(_1ab){
this._enabledIncrease=_1ab;
if(!this._enabledIncrease){
Sys.UI.DomElement.addCssClass(this._increaseButton,"disabled-button");
}else{
Sys.UI.DomElement.removeCssClass(this._increaseButton,"disabled-button");
}
},get_enabledDecrease:function(){
return this._enabledDecrease;
},set_enabledDecrease:function(_1ac){
this._enabledDecrease=_1ac;
if(!this._enabledDecrease){
Sys.UI.DomElement.addCssClass(this._decreaseButton,"disabled-button");
}else{
Sys.UI.DomElement.removeCssClass(this._decreaseButton,"disabled-button");
}
},get_visibleInput:function(){
return this._visibleInput;
},set_visibleInput:function(_1ad){
this._visibleInput=_1ad;
if(!this._visibleInput){
this._inputElement.style.display="none";
}else{
this._inputElement.style.display="";
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1ae){
this._clientStateFieldID=_1ae;
}};
Telerik.Web.UI.EditorSpinBox.registerClass("Telerik.Web.UI.EditorSpinBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorCheckBox=function(_1af){
Telerik.Web.UI.EditorCheckBox.initializeBase(this,[_1af]);
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(_1b0){
if(this._inputElement.checked!=_1b0){
this._inputElement.checked=_1b0;
}
},initialize:function(){
var _1b1=document.createElement("INPUT");
_1b1.setAttribute("type","CHECKBOX");
_1b1.Parent=this;
_1b1.onclick=function(e){
var oP=this.Parent;
oP._selectedItem=!oP._selectedItem;
this.checked=oP._selectedItem;
oP._selectedItem=this.checked;
oP.raiseEvent("valueSelected");
};
this._inputElement=_1b1;
this.get_element().appendChild(_1b1);
}};
Telerik.Web.UI.EditorCheckBox.registerClass("Telerik.Web.UI.EditorCheckBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorTextBox=function(_1b4){
Telerik.Web.UI.EditorTextBox.initializeBase(this,[_1b4]);
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(_1b5){
this._width=_1b5;
},initialize:function(){
var _1b6=document.createElement("INPUT");
_1b6.style.width=this.get_width();
_1b6.Parent=this;
var _1b7=this.get_name();
var _1b8=function(e,elem,_1bb){
if(_1bb){
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);
};
_1b6.onchange=function(e){
if(!e){
e=window.event;
}
return _1b8(e,this,true);
};
_1b6.onclick=function(e){
this.focus();
};
_1b6.onkeypress=function(e){
if(!e){
e=window.event;
}
if(e.keyCode==13){
return _1b8(e,this);
}
};
this._inputElement=_1b6;
this.get_element().appendChild(_1b6);
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1bf){
if(null==_1bf){
_1bf="";
}
this._inputElement.value=_1bf;
}};
Telerik.Web.UI.EditorTextBox.registerClass("Telerik.Web.UI.EditorTextBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.ImageDialogCaller=function(_1c0){
Telerik.Web.UI.ImageDialogCaller.initializeBase(this,[_1c0]);
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 _1c1=this.get_element();
_1c1.style.width=parseInt(this._inputElement.style.width)+30+"px";
_1c1.className=(this.get_skin()+" "+this._className);
},_createInputElement:function(){
var _1c2=document.createElement("INPUT");
_1c2.style.width=this.get_width();
this._inputElement=_1c2;
this.get_element().appendChild(_1c2);
},_createButton:function(){
var _1c3=document.createElement("A");
_1c3.title="Call Image Manager";
_1c3.href="javascript:void(0);";
_1c3.onclick=Function.createDelegate(this,this._onButtonClickHandler);
_1c3.innerHTML="<span>...</span>";
this.get_element().appendChild(_1c3);
this._pushButton=_1c3;
},_onButtonClickHandler:function(e){
var _1c5=this;
var _1c6=function(_1c7,args){
var src="";
var img=args.Result;
if(img){
src=img.getAttribute("src",2);
}
if(src){
_1c5._inputElement.value=src;
_1c5.raiseEvent("valueSelected");
}
};
var args={editor:this.get_editor()};
this._editor.showDialog("ImageManager",args,_1c6);
},get_editor:function(){
return this._editor;
},set_editor:function(_1cc){
this._editor=_1cc;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1cd){
if(null==_1cd){
_1cd="";
}
this._inputElement.value=_1cd;
},get_width:function(){
return this._width;
},set_width:function(_1ce){
this._width=_1ce;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1cf){
this._clientStateFieldID=_1cf;
}};
Telerik.Web.UI.ImageDialogCaller.registerClass("Telerik.Web.UI.ImageDialogCaller",Telerik.Web.UI.EditorButton);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorDropDown=function(_1d0){
Telerik.Web.UI.EditorDropDown.initializeBase(this,[_1d0]);
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 _1d2=false;
if(!this._rendered){
this.render();
_1d2=true;
}
this.raiseEvent("show");
if(!this._childrenRendered){
this.renderChildren();
this._childrenRendered=true;
_1d2=true;
}
if(_1d2){
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 _1d4=this.resolveActiveIndex(e);
if(_1d4>-1){
this.set_activeIndex(_1d4,e);
}
this._cancelEvent(e);
},_cancelEvent:function(e){
if(e){
e.preventDefault();
e.stopPropagation();
e.returnValue=false;
e.cancelBubble=true;
}
},_onPopupClick:function(e){
var _1d7=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_1d7>-1){
this._selectedIndex=_1d7;
this.hide();
this.raiseEvent("valueSelected");
}
},get_activeIndex:function(){
return this._activeIndex;
},set_activeIndex:function(_1d8,e){
this._activeIndex=_1d8;
this.selectUIItem(e);
},selectPreviousItem:function(){
var _1da=this.get_activeIndex();
if(_1da-1>=0){
this.set_activeIndex(_1da-1);
}
},selectNextItem:function(){
var _1db=this.get_activeIndex();
if(_1db+1<this._items.length){
this.set_activeIndex(_1db+1);
}
},selectUIItem:function(e,_1dd){
if(!this._popupElement){
return;
}
var _1de=this._popupElement.getElementsByTagName("TD");
var len=_1de.length;
var _1e0=this.get_activeIndex();
var _1e1=null;
for(var i=0;i<len;i++){
var _1e3=_1de[i];
if(_1e3.item_index==_1e0){
_1e3.className="rade_itemOver";
_1e1=_1e3;
}else{
if(_1dd&&_1e3.item_index<=_1e0){
_1e3.className="rade_itemOver";
}else{
_1e3.className="";
}
}
}
if(_1e1&&!e){
this._scrollIntoView(_1e1,_1e1.parentNode.parentNode.parentNode.parentNode);
}
return _1e1;
},_scrollIntoView:function(_1e4,_1e5){
if($telerik.isIE||!_1e5){
var _1e6=_1e5;
_1e6.scrollTop=0;
var _1e7=_1e6.getClientRects()[0];
var _1e8=_1e7.top;
var _1e9=_1e7.bottom;
var _1ea=_1e4.getClientRects()[0].bottom;
if(_1ea==0){
return;
}
while(_1ea>_1e9||_1ea<_1e8){
var _1eb="down";
if(_1ea<_1e8){
_1eb="up";
}
_1e6.doScroll(_1eb);
_1ea=_1e4.getClientRects()[0].bottom;
}
}else{
if(_1e4.scrollIntoView){
_1e4.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 _1ec=this._itemRootElement;
this.renderItemRoot();
_1ec.parentNode.replaceChild(this._itemRootElement,_1ec);
}
},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 _1ed=this._itemRootElement.rows[this._itemRootElement.rows.length-1];
var cell=_1ed.insertCell(-1);
return cell;
},renderChildren:function(){
for(var i=0;i<this._items.length;i++){
if(0==(i%this._itemsPerRow)){
this.renderNewRow();
}
var _1f0=this.renderItemContainer();
this.markItemContainer(_1f0,i);
this.renderChild(_1f0,this._items[i],i);
}
},renderChild:function(_1f1,_1f2,_1f3){
var _1f4=document.createElement("span");
if(_1f2){
var _1f5=null;
var _1f6=null;
if(_1f2 instanceof Array){
_1f5=_1f2[1];
_1f6=_1f2[2];
}else{
_1f5=_1f2;
}
if(_1f6){
var _1f7=document.createElement("span");
_1f7.innerHTML="&nbsp;";
_1f7.className=_1f6;
_1f4.appendChild(_1f7);
}
if(_1f5){
_1f4.innerHTML+=_1f5;
_1f4.noWrap=true;
}
}
_1f1.innerHTML=_1f4.innerHTML;
},resolveActiveIndex:function(e){
var _1f9=e.target;
var _1fa=-1;
while(_1f9&&_1f9!=this._itemRootElement){
if(null!=_1f9.item_index){
_1fa=_1f9.item_index;
break;
}
_1f9=_1f9.parentNode;
}
return _1fa;
},markItemContainer:function(_1fb,_1fc){
_1fb.item_index=_1fc;
},_makeAllItemsUnselectable:function(){
if(!this._popupElement){
return;
}
this._popupElement.setAttribute("unselectable","on");
var _1fd=this._popupElement.getElementsByTagName("*");
var len=_1fd.length;
for(var i=0;i<len;i++){
_1fd[i].unselectable="on";
}
},_show:function(){
this.configurePopupPropertiesBeforeShow();
var _200=this._popupElement;
var _201=this.get_sizetofit();
var _202=_200.style.overflow;
if(_201){
_200.style.overflowY="hidden";
}
_200.style.width=this.get_popupwidth();
_200.style.height=this.get_popupheight();
this._itemRootElement.style.width="100%";
this._popupBehavior.show();
if(_201){
_200.style.width=this._getPopupChildrenWidth();
var _203=this._getPopupChildrenHeight();
if(_203!="0px"){
_200.style.height=_203;
}
}
this._popupBehavior.show();
this._getPopupVisibilityController().set_activePopup(this);
_200.style.zIndex="100000";
if(_201){
_200.style.overflowY=_202;
}
this._popupVisible=true;
},_getPopupChildrenWidth:function(){
var _204=this.get_popupElement().childNodes;
var _205=0;
for(var i=0;i<_204.length;i++){
var _207=_204[i].offsetWidth;
if(_207&&_207>_205){
_205=_207;
}
}
return _205+"px";
},_getPopupChildrenHeight:function(){
var _208=this.get_popupElement().childNodes;
var _209=0;
for(var i=0;i<_208.length;i++){
if(_208[i].offsetHeight){
_209+=_208[i].offsetHeight;
}
}
return _209+"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 _20b=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_20b;
},_createUI:function(){
if(this._popupBehavior){
return;
}
var _20c=this.get_element();
if(!this._popupElement){
var _20d=document.createElement("DIV");
$telerik.addCssClasses(_20d,[this.get_skin(),this._rootPopupClassName,this.get_popupclassname()]);
this._popupElement=_20d;
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":_20c},null,null,this._popupElement);
this.attachEventHandlers();
},_getTable:function(){
var _20e=document.createElement("table");
_20e.border=0;
_20e.cellPadding=0;
_20e.setAttribute("unselectable","on");
_20e.style.cursor="default";
return _20e;
},get_clearSelectedOnShow:function(){
return this._clearSelectedOnShow;
},set_clearSelectedOnShow:function(_20f){
this._clearSelectedOnShow=_20f;
},get_popupElement:function(){
return this._popupElement;
},get_selectedItem:function(){
if(this._items&&this._selectedIndex>-1){
var item=this._items[this._selectedIndex];
var _211=((true==this._isArrayCollection)||(item instanceof Array))?item[0]:item;
return _211;
}
return null;
},get_selectedIndex:function(){
return this._selectedIndex;
},set_selectedIndex:function(_212){
this._selectedIndex=_212;
this.set_activeIndex(_212);
},get_items:function(){
return this._items;
},set_items:function(_213){
this.disposeChildren();
this._items=_213;
},get_itemsperrow:function(){
return this._itemsPerRow;
},set_itemsperrow:function(_214){
this._itemsPerRow=_214;
},get_sizetofit:function(){
return this._sizeToFit;
},set_sizetofit:function(_215){
this._sizeToFit=_215;
},get_popupclassname:function(){
return this._popupClassName;
},set_popupclassname:function(_216){
this._popupClassName=_216;
},get_rootpopupclassname:function(){
return this._rootPopupClassName;
},set_rootpopupclassname:function(_217){
this._rootPopupClassName=_217;
},get_popupwidth:function(){
return this._popupWidth;
},set_popupwidth:function(_218){
this._popupWidth=_218;
},get_popupheight:function(){
return this._popupHeight;
},set_popupheight:function(_219){
this._popupHeight=_219;
},add_show:function(_21a){
this.get_events().addHandler("show",_21a);
},remove_show:function(_21b){
this.get_events().removeHandler("show",_21b);
},add_hide:function(_21c){
this.get_events().addHandler("hide",_21c);
},remove_hide:function(_21d){
this.get_events().removeHandler("hide",_21d);
}};
Telerik.Web.UI.EditorDropDown.registerClass("Telerik.Web.UI.EditorDropDown",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorUpdateableDropDown=function(_21e){
Telerik.Web.UI.EditorUpdateableDropDown.initializeBase(this,[_21e]);
};
Telerik.Web.UI.EditorUpdateableDropDown.prototype={updateValue:function(oVal){
if(null==oVal){
return;
}
try{
if(!oVal){
oVal=this.get_text();
}
var _220=this.getSpanElement();
if(_220){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_220.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(_222){
Telerik.Web.UI.EditorSelfUpdateableDropDown.initializeBase(this,[_222]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSelfUpdateableDropDown.prototype={_onPopupClick:function(e){
var _224=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_224>-1){
this._selectedIndex=_224;
this.hide();
var _225=this.get_selectedItem();
if(_225){
this.updateValue(_225);
}
this.raiseEvent("valueSelected");
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_226){
this._clientStateFieldID=_226;
}};
Telerik.Web.UI.EditorSelfUpdateableDropDown.registerClass("Telerik.Web.UI.EditorSelfUpdateableDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorSplitButton=function(_227){
Telerik.Web.UI.EditorSplitButton.initializeBase(this,[_227]);
};
Telerik.Web.UI.EditorSplitButton.prototype={click:function(e){
var _229=this.isArrowClicked(e.target);
if(_229){
this.show();
}else{
var _22a=this.get_selectedItem();
if(null==_22a){
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(_22b){
var _22c=this._getArrowElement();
if(_22b==_22c){
return true;
}
return false;
},_getArrowElement:function(){
var _22d=this.getAnchorElement().getElementsByTagName("SPAN");
var _22e=_22d[_22d.length-1];
return _22e;
}};
Telerik.Web.UI.EditorSplitButton.registerClass("Telerik.Web.UI.EditorSplitButton",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorToolStrip=function(_22f){
Telerik.Web.UI.EditorToolStrip.initializeBase(this,[_22f]);
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(_235){
Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"set_selectedIndex",[_235]);
if(this.get_updateHeader()){
var tool=this.get_selectedItem();
if(!tool||!tool.getSpanElement){
return;
}
var span=tool.getSpanElement();
if(span){
var _238=span.cloneNode(true);
var _239=this.getSpanElement();
var _23a=_239.parentNode;
_23a.replaceChild(_238,_239);
var _23b=tool.getAnchorElement();
if(_23b){
_23a.setAttribute("title",_23b.getAttribute("title"));
}
}
}
},_onPopupClick:function(e){
var tool=this._resolveSelectedTool(e);
this._cancelEvent(e);
if(tool){
var _23e=Array.indexOf(this._items,tool);
if($telerik.isSafari){
this._selectedIndex=_23e;
this.set_activeIndex(_23e);
}else{
this.set_selectedIndex(_23e);
}
this.hide();
this.raiseEvent("valueSelected");
}
},renderItemRoot:function(){
var _23f=document.createElement("DIV");
_23f.className="rade_tlbVertical";
_23f.style.cssFloat="left";
_23f.style.width="100%";
this._itemRootElement=_23f;
return this._itemRootElement;
},renderChildren:function(){
var _240=this.get_itemsperrow();
var _241=this.get_tools();
var ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
for(var i=0;i<_241.length;i++){
if(_240>1&&i>1&&(i%this.get_itemsperrow()==0)){
ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
}
var _244=_241[i];
if(null==_244["showText"]){
_244["showText"]=true;
}
var tool=Telerik.Web.UI.EditorButton.createTool(_244,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(_249){
this._tools=_249;
},get_updateHeader:function(){
return this._udpateHeader;
},set_updateHeader:function(_24a){
this._udpateHeader=_24a;
}};
Telerik.Web.UI.EditorToolStrip.registerClass("Telerik.Web.UI.EditorToolStrip",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.EditorContextMenu=function(_24b){
Telerik.Web.UI.EditorContextMenu.initializeBase(this,[_24b]);
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 _24c=this._popupBehavior;
_24c.set_positioningMode(Telerik.Web.PositioningMode.Absolute);
var _24d=this.get_parentElement();
if(_24d){
_24c.set_parentElement(_24d);
}
var e=this._eventObject;
if(e){
_24c.set_x(e.clientX+10);
_24c.set_y(e.clientY+10);
}
},set_eventObject:function(_24f){
this._eventObject=_24f;
},get_tagName:function(){
return this._tagName;
},set_tagName:function(_250){
this._tagName=_250;
},get_parentElement:function(){
return this._parentElement;
},set_parentElement:function(_251){
this._parentElement=_251;
}};
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(_252){
Telerik.Web.UI.Editor.AlignmentSelector.initializeBase(this,[_252]);
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(_253){
switch(_253.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(_254){
if(!this._rendered){
this.render();
}
var _255=this._itemRootElement;
var _256=0;
for(var i=0;i<_255.rows.length;i++){
var _258=false;
for(var j=0;j<_255.rows[i].cells.length;j++){
var cell=_255.rows[i].cells[j];
var _25b=this._isAvailable(_256++);
cell.style.visibility=_25b?"visible":"hidden";
_258|=_25b;
}
if(null!=document.all){
_255.rows[i].style.display=_258?"":"none";
}
}
},_isAvailable:function(_25c){
var _25d=false;
if(this._items){
var _25e=this._items[_25c];
_25d=((null!=_25e)&&(""!=_25e[0]||""!=_25e[1]));
}
return _25d;
},renderChild:function(_25f,_260,_261){
var _262=document.createElement("div");
if(_260){
_262.innerHTML="&nbsp;";
_262.className=this._alignmentClassName[_261];
}
_25f.appendChild(_262);
},_onDropDownValueSelected:function(){
this.set_selectedIndex(this.get_selectedIndex());
},_selectAlignment:function(_263,_264){
_263=(""==_263||!_263)?"none":_263.toUpperCase();
_264=!_264?"":_264.toUpperCase();
if(this._items){
var _265=-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==_265){
_265=i;
}
if((_263==ha||_263==va)&&(_264==ha||_264==va)){
this.set_selectedIndex(i);
return;
}
}
}
this.set_selectedIndex(_265);
}
},set_selectedIndex:function(_268){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"set_selectedIndex",[_268]);
var span=this.getSpanElement();
var _26a=this._alignmentClassName[_268];
span.className=_26a;
},setTagName:function(_26b){
this._tagName=_26b;
this._items=this._getLookupTableByTagName(this._tagName);
this.set_selectedIndex(this._noAlignmentIndex);
},updateValue:function(_26c,_26d){
this._selectAlignment(_26c,_26d);
},getAlign:function(){
var _26e=this._items[this._selectedIndex];
var _26f=(_26e?_26e[0]:"");
if("none"==_26f){
_26f="";
}
return _26f;
},getVAlign:function(){
var _270=this._items[this._selectedIndex];
var _271=(_270?_270[1]:"");
if("none"==_271){
_271="";
}
return _271;
},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(_272){
this._clientStateFieldID=_272;
}};
Telerik.Web.UI.Editor.AlignmentSelector.registerClass("Telerik.Web.UI.Editor.AlignmentSelector",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.InsertTableHelper=function(_273){
Telerik.Web.UI.Editor.InsertTableHelper.initializeBase(this,[_273]);
};
Telerik.Web.UI.Editor.InsertTableHelper.prototype={initialize:function(){
var _274=new Array(this.get_itemsperrow()*this.get_itemsperrow());
for(var i=0;i<_274.length;i++){
_274[i]=i;
}
this._items=_274;
},hide:function(){
},renderChild:function(_276,_277,_278){
var oDiv=document.createElement("div");
oDiv.innerHTML="&nbsp;";
_276.appendChild(oDiv);
var dim=this._getDimensionByIndex(_278);
_276.setAttribute("title"," "+dim.rows+" x "+dim.cols+" ");
},_getDimensionByIndex:function(_27b){
var _27c=0;
var _27d=0;
var _27e=this.get_itemsperrow();
for(var i=0;i<this._items.length;i++){
if(i%_27e==0){
_27c++;
_27d=0;
}
_27d++;
if(_27b==i){
break;
}
}
var obj={rows:_27c,cols:_27d};
return obj;
},get_selectedItem:function(){
var _281=this.get_selectedIndex();
return this._getDimensionByIndex(_281);
},selectUIItem:function(e,_283){
var _284=this._popupElement.getElementsByTagName("TD");
var len=_284.length;
var _286=this.get_activeIndex();
var dim=this._getDimensionByIndex(_286);
var cols=dim.cols;
for(var i=0;i<len;i++){
var _28a=_284[i];
var _28b=_28a.item_index;
if(_28b<=_286&&_28a.cellIndex<cols){
_28a.className="rade_itemOver";
}else{
_28a.className="";
}
}
}};
Telerik.Web.UI.Editor.InsertTableHelper.registerClass("Telerik.Web.UI.Editor.InsertTableHelper",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.Editor.InsertTable=function(_28c){
Telerik.Web.UI.Editor.InsertTable.initializeBase(this,[_28c]);
};
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 _28d=this.get_tools();
this._longTool=_28d[0];
Array.removeAt(_28d,0);
for(var i=0;i<_28d.length;i++){
_28d[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 _292={"valueSelected":this._onTableHelperValueSelectedDelegate};
var tool=$create(Telerik.Web.UI.Editor.InsertTableHelper,args,_292,null,document.createElement("DIV"));
tool.set_rootpopupclassname("");
this._tableHelper=tool;
tool.render();
var _294=tool.get_popupElement();
_294.style.display="";
_294.style.visibility="visible";
_294.style.position="";
_294.style.cssFloat="left";
var _295=this.get_popupElement();
_295.insertBefore(_294,_295.firstChild);
},renderChildren:function(){
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"renderChildren");
var _296=this._itemRootElement;
if(this._longTool){
var ul=document.createElement("UL");
_296.insertBefore(ul,_296.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(_299){
Telerik.Web.UI.Editor.ColorPicker.initializeBase(this,[_299]);
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 _29a=this.get_selectedItem();
this.set_color(_29a);
},set_color:function(_29b){
if(!_29b){
_29b="";
}
var _29c=this.getSpanElement();
_29c.style.borderBottom="0px";
_29c.style.height="";
if(_29b){
var _29d=_29c.offsetHeight;
if(_29d){
_29c.style.height=(_29d-3)+"px";
}
_29c.style.borderBottom="3px solid "+_29b;
}
this._color=_29b;
},get_color:function(){
return this._color;
},onPopupMouseOver:function(e){
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"onPopupMouseOver",[e]);
var _29f=this.get_activeIndex();
var _2a0=this._items[_29f];
if(null==_2a0){
return;
}
if(this._infoSpan1){
this._infoSpan1.innerHTML=_2a0;
this._infoSpan1.style.backgroundColor=_2a0;
}
if(this._infoSpan2){
this._infoSpan2.innerHTML=_2a0;
this._infoSpan2.style.color=_2a0;
}
},renderFooter:function(){
var oDiv=document.createElement("div");
oDiv.className="rade_ColorPickerFooter";
var _2a2=document.createElement("span");
_2a2.className="rade_DarkColor";
var _2a3=document.createElement("span");
_2a3.className="rade_LightColor";
_2a2.innerHTML=_2a3.innerHTML="&nbsp";
oDiv.appendChild(_2a2);
oDiv.appendChild(_2a3);
this.get_popupElement().appendChild(oDiv);
this._infoSpan1=_2a2;
this._infoSpan2=_2a3;
},renderChild:function(_2a4,_2a5,_2a6){
var oDiv=document.createElement("div");
if(null!=_2a5){
oDiv.style.backgroundColor=_2a5;
oDiv.setAttribute("title",_2a5);
oDiv.innerHTML="&nbsp;";
}
_2a4.appendChild(oDiv);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_2a8){
this._clientStateFieldID=_2a8;
}};
Telerik.Web.UI.Editor.ColorPicker.registerClass("Telerik.Web.UI.Editor.ColorPicker",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.UndoRedoDropDown=function(_2a9){
Telerik.Web.UI.Editor.UndoRedoDropDown.initializeBase(this,[_2a9]);
};
Telerik.Web.UI.Editor.UndoRedoDropDown.prototype={renderFooter:function(){
},get_selectedItem:function(){
var _2aa=Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"get_selectedItem");
if(!_2aa){
_2aa=1;
}
return _2aa;
},selectUIItem:function(e,_2ac){
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(_2ad){
Telerik.Web.UI.Editor.ApplyClassDropDown.initializeBase(this,[_2ad]);
this._popupClassName="rade_ApplyClass";
this._onValueSelectedDelegate=null;
this._clientStateFieldID=null;
this._isArrayCollection=true;
};
Telerik.Web.UI.Editor.ApplyClassDropDown.prototype={initialize:function(){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"initialize");
this._onValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this.add_valueSelected(this._onValueSelectedDelegate);
this._cssClassRegex=/[^\{]*\{([^\}]+)\}/gi;
this._cssClasses={a:"rade_class_a",img:"rade_class_img",table:"rade_class_table",td:"rade_class_td",all:"rade_class_all",unknown:"rade_class_unknown"};
},dispose:function(){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"dispose");
this.remove_valueSelected(this._onValueSelectedDelegate);
},_onDropDownValueSelected:function(){
this.updateValue(this.get_selectedItem());
},_getClassIcon:function(tag){
var _2af="";
if(!tag){
_2af=this._cssClasses["notag"];
}else{
tag=tag.toLowerCase();
var res=this._cssClasses[tag];
_2af=res?res:this._cssClasses["unknown"];
}
var _2b1=document.createElement("span");
_2b1.innerHTML="&nbsp;"+tag;
_2b1.className=_2af;
return _2b1;
},_getClassTag:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2b4=str.lastIndexOf(".");
if(_2b4==0){
return "ALL";
}
var _2b5=str.lastIndexOf(" ",_2b4);
return str.substring((_2b5+1),_2b4);
},_getClassCss:function(_2b6){
var re=this._cssClassRegex;
var oCss="";
if(null!=_2b6.cssText){
oCss=_2b6.cssText;
oCss=oCss.replace(re,"$1");
}else{
oCss=_2b6.style.cssText;
}
return oCss;
},_getDisplayName:function(rule){
if(!rule||!rule.selectorText){
return "";
}
var _2ba=rule.selectorText;
var _2bb=_2ba.indexOf(".");
if(-1==_2bb){
_2bb=0;
}else{
_2bb+=1;
}
var _2bc=_2ba.indexOf(":");
if(-1==_2bc){
_2bc=_2ba.length;
}
return _2ba.substring(_2bb,_2bc);
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2bf=str.lastIndexOf(".");
if(_2bf==-1){
return "";
}
var _2c0=str.indexOf(" ",_2bf);
if(-1==_2c0){
_2c0=str.indexOf(":",_2bf);
}
if(-1==_2c0){
_2c0=str.length;
}
return str.substring((_2bf+1),_2c0);
},_getChild:function(_2c1,_2c2,_2c3){
var elem=document.createElement("DIV");
if(_2c2.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=_2c1;
}
elem.setAttribute("style",_2c1);
elem.innerHTML=_2c3;
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(_2c5){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"set_items",[_2c5]);
this._items.splice(0,0,["",{cssText:"",selectorText:"Clear Class"}]);
},renderChild:function(cell,_2c7,_2c8){
var _2c9=_2c7[1];
var oTag=this._getClassTag(_2c9);
var oCss=this._getClassCss(_2c9);
var _2cc=_2c7[2]?_2c7[2]:this._getDisplayName(_2c9);
cell.setAttribute("title",_2c9.selectorText);
var _2cd=this._getClassIcon(oTag);
cell.appendChild(_2cd);
var div=this._getChild(oCss,oTag,_2cc);
cell.appendChild(div);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_2cf){
this._clientStateFieldID=_2cf;
}};
Telerik.Web.UI.Editor.ApplyClassDropDown.registerClass("Telerik.Web.UI.Editor.ApplyClassDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontNameDropDown=function(_2d0){
Telerik.Web.UI.Editor.FontNameDropDown.initializeBase(this,[_2d0]);
};
Telerik.Web.UI.Editor.FontNameDropDown.prototype={updateValue:function(oVal){
try{
if(!oVal){
oVal=this.get_text();
}
if(null==oVal||"AZBY"==oVal){
return;
}
var _2d2=this.getSpanElement();
if(_2d2){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_2d2.innerHTML=this._value;
}
}
catch(e){
}
},renderChildren:function(){
var _2d3=this._items;
if(_2d3&&_2d3[0]&&!(_2d3[0] instanceof Array)){
for(var i=0;i<_2d3.length;i++){
var item=_2d3[i];
_2d3[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(_2d6){
Telerik.Web.UI.Editor.FontSizeDropDown.initializeBase(this,[_2d6]);
};
Telerik.Web.UI.Editor.FontSizeDropDown.prototype={renderChildren:function(){
var _2d7=this._items;
if(_2d7&&_2d7[0]&&!(_2d7[0] instanceof Array)){
for(var i=0;i<_2d7.length;i++){
var item=_2d7[i];
_2d7[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(_2da){
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.initializeBase(this,[_2da]);
};
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 _2de=this.FlatLinksArray[this.get_selectedIndex()];
return {innerHTML:_2de.name,href:_2de.href,target:_2de.target,title:_2de.toolTip};
},_parseSubtree:function(_2df,t){
var _2e1=this._linkCounter;
this.FlatLinksArray[_2e1]=_2df;
var li=document.createElement("LI");
t.appendChild(li);
var _2e3=_2df.childLinks&&_2df.childLinks.length;
var span=document.createElement("SPAN");
span.innerHTML="&nbsp;";
span.className=_2e3?"rade_CustomLinksIcon rade_icon_plus":"rade_CustomLinksIcon rade_icon_empty";
if(_2e3){
function onclick(e){
var _2e6=Sys.UI.DomElement.containsCssClass(this,"rade_icon_plus");
var ul=this.parentNode.getElementsByTagName("UL")[0];
if(ul){
ul.style.display=_2e6?"":"none";
var _2e8=_2e6?"rade_icon_plus":"rade_icon_minus";
var _2e9=_2e6?"rade_icon_minus":"rade_icon_plus";
Sys.UI.DomElement.removeCssClass(this,_2e8);
Sys.UI.DomElement.addCssClass(this,_2e9);
}
return false;
}
$addHandler(span,"click",onclick);
}
li.appendChild(span);
var _2ea=null;
if(_2df.href){
_2ea=document.createElement("A");
_2ea.href="#";
_2ea.innerHTML=_2df.name;
li.appendChild(_2ea);
this.markItemContainer(_2ea,this._linkCounter);
}else{
_2ea=document.createElement("SPAN");
_2ea.innerHTML=_2df.name;
li.appendChild(_2ea);
}
this._linkCounter++;
if(_2e3){
var ul=document.createElement("UL");
li.appendChild(ul);
var _2ec=_2df.childLinks;
for(var i=0;i<_2df.childLinks.length;i++){
var _2ee=_2ec[i];
this._parseSubtree(_2ee,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(_2ef,_2f0){
var _2f1=window.frames;
for(var i=0;i<_2f1.length;i++){
var _2f3=null;
try{
_2f3=_2f1[i].window.document;
}
catch(e){
}
if(!_2f3){
continue;
}
try{
if(false!=_2ef){
_2f0.attachToDocument(_2f3);
}else{
_2f0.detachFromDocument(_2f3);
}
}
catch(e){
}
}
}
var _2f4=Function.createDelegate(null,function(e){
if(e.keyCode==27){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
});
$addHandler(document.body,"keydown",_2f4);
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",_2f4);
});
},attachToDocument:function(_2f6){
$telerik.addExternalHandler(_2f6,"mousedown",this._hideHandler);
},detachFromDocument:function(_2f7){
$telerik.removeExternalHandler(_2f7,"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 _2fa=this._activePopup.get_popupElement();
if(!this._isMouseOverElement(e,_2fa)){
this.hideActivePopup();
}
}
},_isMouseOverElement:function(e,_2fc){
var rect=null;
try{
rect=$telerik.getBounds(_2fc);
}
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(_301){
if(this._activePopup==_301){
this._activePopup=null;
}
},set_activePopup:function(_302){
if(this._activePopup&&(_302!=this._activePopup)){
this._activePopup.hide();
}
this._activePopup=_302;
},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(_303){
Telerik.Web.UI.Editor.DefaultToolAdapter.initializeBase(this,[_303]);
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 _304=Telerik.Web.UI.EditorToolbarMode;
var _305=this.get_editor();
switch(_305.get_toolbarMode()){
case _304.Default:
_305.add_firstShow(Function.createDelegate(this,function(){
this._hookToolbarJson2Html();
var _306=this.get_editor();
var _307=_306.get_element().style.height;
_306._updateEditorSize(_307);
}));
break;
case _304.Floating:
this._createFloatingButton();
break;
case _304.PageTop:
case _304.ShowOnFocus:
this._hookToolbarModeEventHandlers();
break;
}
},_hookToolbarJson2Html:function(){
if(this._initializedToolbars){
return;
}
this._initializedToolbars=true;
var _308=this.get_toolJSON();
var _309=this._getToolBarElements();
var _30a=[];
for(var i=0;i<_308.length;i++){
var json=_308[i];
var _30d=_309[i];
this._initializeToolbar(json,_30d);
var _30e=json["attributes"];
var zone=_30e?_30e["dockingzone"]:null;
if(zone){
_30a[_30a.length]=[zone,_30d];
}
}
if($telerik.isIE){
var elem=this.get_element();
elem.style.height="";
}
var _311=this.get_editor();
var _312=_311.get_id();
for(var i=0;i<_30a.length;i++){
var _313=_30a[i][0];
var zone=_313.charAt(0).toUpperCase()+_313.substring(1);
var _314=$get(_312+zone);
if(!_314){
_314=$get(_313);
}
if(_314){
if(_314.innerHTML=="&nbsp;"){
_314.innerHTML="";
}
_314.appendChild(_30a[i][1]);
}
}
},_initNonDefaultToolbarMode:function(){
var _315=this.get_editor();
var _316=Telerik.Web.UI.EditorToolbarMode;
var _317=_315.get_toolbarMode();
if(_317==_316.ShowOnFocus){
var wnd=this._toolbarHolder;
var _319=Telerik.Web.UI.WindowBehaviors;
wnd.set_behaviors(_319.Resize);
wnd.set_visibleTitlebar(false);
}else{
if(_317==_316.PageTop){
var wnd=this._toolbarHolder;
wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);
wnd.set_visibleTitlebar(false);
}
}
var _31a=this.get_element();
_31a.style.visibility="visible";
},_showToolbarHolder:function(_31b){
if(!_31b){
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 _31c=Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper;
if(_31c==this&&_31c._toolbarHolder&&_31c._toolbarHolder.isVisible()){
_31c.get_toolbarHolder().setActive(true);
return;
}
if(_31c&&_31c._showToolbarHolder){
_31c._showToolbarHolder(false);
}
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=this;
this.get_window();
this._initNonDefaultToolbarMode();
this._toolbarHolder.show();
},_positionWindow:function(){
var _31d=Telerik.Web.UI.EditorToolbarMode;
var _31e=this.get_editor();
var _31f=_31e.get_toolbarMode();
if(_31f==_31d.ShowOnFocus){
this._positionToolbarAboveEditor();
}else{
if(_31f==_31d.PageTop){
this._positionOnPageTop();
}else{
if(_31f==_31d.Floating){
if(!this._wasShown){
this._positionToolbarAboveEditor();
this._wasShown=true;
}
}
}
}
},get_window:function(){
if(!this._toolbarHolder){
var _320=this.get_editor();
var _321=_320.get_dialogOpener();
if(!_321){
return;
}
var wnd=_321.get_container().clone(_320.get_id()+"_toolbarMode");
wnd.set_visibleStatusbar(false);
var _323=this.get_element();
var _324=_323.offsetWidth;
wnd.setSize(_324+10,"");
wnd.add_show(Function.createDelegate(this,function(_325,args){
var _327=_325.get_contentElement();
if(!_327){
return;
}
var _328=_325.get_popupElement();
_328.style.zIndex="10000";
this._hookToolbarJson2Html();
_327.style.overflow="";
_327.style.height="";
var _329=_327.offsetWidth;
_327.style.width=_329+"px";
var _32a=_320.get_toolsWidth();
if(!_32a){
var _32b=_325.getWindowBounds();
_32a=_32b.width;
}
_325.setSize(_32a,"");
_327.style.width="100%";
this._positionWindow();
}));
this._toolbarHolder=wnd;
this._moveToolbarsToEditor(false);
}
return this._toolbarHolder;
},_moveToolbarsToEditor:function(_32c){
var _32d=this.get_element();
if(!_32c){
if(!this._fakeToolbarParentCreated){
var div=_32d.ownerDocument.createElement("DIV");
div.control=_32d.control;
_32d.parentNode.appendChild(div);
this._fakeToolbarParentCreated=true;
_32d.control=null;
var _32f=div.style;
_32f.height=_32f.fontSize=_32f.lineHeight="1px";
_32f.border="1px solid red";
_32f.visibility="hidden";
if(!$telerik.isIE){
_32f.display="none";
}
}
var wnd=this.get_toolbarHolder();
wnd.set_contentElement(_32d);
_32d.style.width="100%";
}else{
_32d.style.width="";
var _331=this.get_editor().get_TopZone();
_331.appendChild(_32d);
}
},_positionToolbarAboveEditor:function(){
var wnd=this._toolbarHolder;
var _333=this.get_editor();
var _334=$telerik.getBounds(_333.get_element());
var x=_334.x;
var _336=$telerik.getBounds(wnd.get_popupElement()).height;
var y=_334.y-_336;
wnd.moveTo(x,y);
},_positionOnPageTop:function(){
var wnd=this._toolbarHolder;
var _339=wnd._getViewportBounds();
var x=_339.scrollLeft;
var y=_339.scrollTop;
wnd.moveTo(x,y);
wnd.set_width("");
if(!wnd.isPinned()){
wnd.togglePin();
}
},_createFloatingButton:function(){
this._onToggleFloatingToolbarDelegate=Function.createDelegate(this,this._onToggleFloatingToolbar);
var _33c=this.get_editor();
var skin=_33c.get_skin();
var _33e={name:"ToggleFloatingToolbar",addClickHandler:true,skin:skin};
var _33f={"valueSelected":this._onToggleFloatingToolbarDelegate};
var _340=Telerik.Web.UI.EditorButton.createTool(_33e,_33f);
var _341=Telerik.Web.UI.EditorButton.createToolWrapper(_340,skin);
var _342=$get(_33c.get_id()+"Top");
if(_342){
_342.appendChild(_341);
}
},_onToggleFloatingToolbar:function(){
var _343=!this._toolbarHolder||!this._toolbarHolder.isVisible();
this._showToolbarHolder(_343);
},_hookToolbarModeEventHandlers:function(){
var _344=this;
var _345=function(){
_344._showToolbarHolder(true);
};
var _346=this.get_editor();
if(_346.isIE){
this.get_editor().add_editReady(function(){
_346.attachEventHandler("beforeeditfocus",_345);
});
}else{
_346.add_selectionChange(_345);
}
_346.add_modeChange(function(){
_344._showToolbarHolder(_344.get_editor().get_mode()==Telerik.Web.UI.EditModes.Design);
});
_346.add_submit(function(){
_344._showToolbarHolder(false);
});
_346.add_toggleScreenMode(function(){
var _347=_344.get_editor().isFullScreen();
_344._moveToolbarsToEditor(_347);
var wnd=_344.get_toolbarHolder();
if(_347){
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 _34a=this.get_editor();
if(_34a.get_mode()!=Telerik.Web.UI.EditModes.Design){
return;
}
this.createContextMenus();
var _34b=e.srcElement?e.srcElement:e.target;
var _34c=_34b.tagName;
var _34d=this._contextMenus[_34c];
if("TH"==_34c&&!_34d){
_34d=this._contextMenus["TD"];
}
var _34e="";
if(!_34d){
var _34f=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_34b,"A");
if(!_34f){
_34f=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_34b,"TD");
}
if(!_34f){
_34f=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_34b,"TABLE");
}
if(_34f){
_34e=_34f.tagName;
_34b=_34f;
}else{
_34e="*";
}
_34d=this._contextMenus[_34e];
}
if(_34d&&_34c=="IMG"&&_34b&&"true"==_34b.getAttribute("isflash")){
_34d=null;
}
if(!this.isIE&&_34e=="*"){
return;
}
if(_34d){
_34d.set_eventObject(e);
_34d.show();
}
return $telerik.cancelRawEvent(e);
},enableContextMenus:function(_350){
this._contextMenusEnabled=_350;
},_initContextMenus:function(){
var _351=Function.createDelegate(this,this.onContextMenu);
var _352=this.get_editor();
_352.add_editReady(function(){
_352.attachEventHandler("contextmenu",_351);
});
},createContextMenus:function(){
if(this._contextMenus){
return;
}
this._contextMenus={};
var _353=this.get_editor();
var skin=_353.get_skin();
var _355=_353.get_contextMenusJSON();
var _356={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
for(var i=0;i<_355.length;i++){
var args=_355[i];
args["sizetofit"]=true;
args["parentElement"]=_353.get_contentAreaElement();
args["skin"]=skin;
var tool=$create(Telerik.Web.UI.EditorContextMenu,args,_356,null,document.createElement("SPAN"));
this._contextMenus[args.tagName]=tool;
}
},dispose:function(){
var _35a=this._getToolBarElements();
for(var i=0;i<_35a.length;i++){
$clearHandlers(_35a[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(_35e){
this.createContextMenus();
return this._contextMenus[_35e];
},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(_362,_363){
if(!_362){
_362=this._tools;
}
var _364=this.get_editor();
for(var i=0;i<_362.length;i++){
var _366=_362[i];
var _367=_366.get_name();
if(_366.setState){
var _368=_363;
if(null==_368){
_368=_364.getToolState(_367);
}
if(null!=_368){
_366.setState(_368);
}
}
if(_366.updateValue){
_366.updateValue(_364.getToolValue(_367));
}
}
},_convertCommandsArray:function(_369){
var _36a=[];
for(var i=0;i<_369.length;i++){
_36a[i]=[i+1,_369[i].get_title()];
}
return _36a;
},_onDropDownHide:function(_36c,args){
var _36e=this.get_editor();
_36e.enableContentArea(true);
},_onDropDownBeforeShow:function(_36f,args){
var _371=this.get_editor();
if(Telerik.Web.UI.EditorToolStrip.isInstanceOfType(_36f)){
this.setToolState(_36f.get_items());
}
if(!_371.getSelection().isControl()&&!Telerik.Web.UI.EditorContextMenu.isInstanceOfType(_36f)){
_371.enableContentArea(false);
}
var _372=_36f.get_name();
if(_372=="Undo"){
var _373=_371.get_commandsManager().getCommandsToUndo();
_373=this._convertCommandsArray(_373);
_36f.set_items(_373);
}else{
if(_372=="Redo"){
var _374=_371.get_commandsManager().getCommandsToRedo();
_374=this._convertCommandsArray(_374);
_36f.set_items(_374);
}else{
if(_372=="ModuleManager"){
var _375=_371.get_modulesManager();
if(!_375){
return;
}
var _376=_375.get_modules();
var _377=[];
for(var i=0;i<_376.length;i++){
var _379=_376[i];
var name=_379.get_name();
var _37b=_379.get_title();
if(!_37b){
_37b=name;
}
cssClass=_379.get_visible()?"rade_module_visible_icon":"rade_module_hidden_icon";
_377[i]=[name,_37b,cssClass];
}
_36f.set_items(_377);
}
}
}
var _37c=_36f.get_items();
if(_37c&&_37c.length>0){
return;
}
var _37d=null;
switch(_372){
case "ApplyClass":
_37d=_371.getCssArray();
break;
case "FontName":
_37d=_371.get_fontNames();
break;
case "FontSize":
_37d=_371.get_fontSizes();
break;
case "InsertSymbol":
_37d=_371.get_symbols();
break;
case "BackColor":
case "ForeColor":
_37d=_371.get_colors();
break;
case "RealFontSize":
_37d=_371.get_realFontSizes();
break;
case "InsertSnippet":
_37d=_371.get_snippets();
break;
case "Zoom":
_37d=["10%","20%","50%","100%","150%","200%","300%","500%"];
break;
case "FormatBlock":
_37d=_371.get_paragraphs();
break;
case "InsertCustomLink":
_37d=_371.get_links();
break;
case "AjaxSpellCheck":
case "SpellCheck":
_37d=_371.get_languages();
break;
}
if(_37d){
_36f.set_items(_37d);
}
},_initializeToolbar:function(_37e,_37f){
var _380=_37f.getElementsByTagName("li");
var _381=_37e.tools;
var _382=this.get_editor();
var skin=_382.get_skin();
var _384=0;
if(_381){
var _385=0;
for(var i=0;i<_381.length;i++){
var _387=_380[i+1];
_385+=_387.offsetWidth;
var _388=Telerik.Web.UI.EditorButton;
var _389=_381[i].type;
var _38a=_381[i].name;
var _38b=Telerik.Web.UI.EditorToolType;
var args=_381[i];
var tool=null;
var _38e=false;
if(_389){
switch(_389){
case _38b.Button:
break;
case _38b.Separator:
if(!_384){
_384+=parseInt($telerik.getCurrentStyle(_387,"marginLeft"));
_384+=parseInt($telerik.getCurrentStyle(_387,"marginRight"));
}
_385+=_384;
_388=null;
break;
case _38b.DropDown:
_388=Telerik.Web.UI.EditorDropDown;
_38e=true;
if(_38a=="FontName"){
_388=Telerik.Web.UI.Editor.FontNameDropDown;
}else{
if(_38a=="FontSize"){
_388=Telerik.Web.UI.Editor.FontSizeDropDown;
}else{
if(_38a=="FormatBlock"){
_388=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_38a=="RealFontSize"){
_388=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_38a=="Zoom"){
_388=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_38a=="InsertCustomLink"){
_388=Telerik.Web.UI.Editor.InsertCustomLinkDropDown;
}else{
if(_38a=="ApplyClass"){
_388=Telerik.Web.UI.Editor.ApplyClassDropDown;
}
}
}
}
}
}
}
break;
case _38b.SplitButton:
_388=Telerik.Web.UI.EditorSplitButton;
if(_38a=="ForeColor"||_38a=="BackColor"){
_388=Telerik.Web.UI.Editor.ColorPicker;
}else{
if(_38a=="Undo"||_38a=="Redo"){
_388=Telerik.Web.UI.Editor.UndoRedoDropDown;
}
}
_38e=true;
break;
case _38b.ToolStrip:
if(_38a=="InsertTable"){
_388=Telerik.Web.UI.Editor.InsertTable;
}else{
_388=Telerik.Web.UI.EditorToolStrip;
}
_38e=true;
break;
case _38b.Custom:
break;
}
}
if(args.attributes){
for(var item in args.attributes){
args[item.toLowerCase()]=args.attributes[item];
}
}
if(_388){
var _390=null;
if(_38e){
_390={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
args["skin"]=skin;
}
tool=$create(_388,args,_390,null,_387);
}
if(tool){
Array.add(this._tools,tool);
var _391=tool.get_shortCut();
if(_391){
var _392=tool.get_name();
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(tool)&&!(Telerik.Web.UI.EditorSplitButton.isInstanceOfType(tool))){
_392="RadE_ToolAdapter_"+_392;
Telerik.Web.UI.Editor.CommandList[_392]=this._toolAdapterDropDownExpander;
}
_382.setShortCut(_392,_391);
}
}
}
var ul=_37f;
if(this.isIE&&ul&&_385){
ul.style.width=(_385+(_380[0].offsetWidth)*2)+"px";
}
if($telerik.isSafari){
ul.setAttribute("onmousedown","return false;");
}
$addHandlers(_37f,{"click":this._onToolAdapterClickDelegate,"keydown":this._onToolAdapterKeyDownDelegate},this);
}
},_toolAdapterDropDownExpander:function(_394,_395){
var tool=_395.getToolByName(_394.replace("RadE_ToolAdapter_",""));
tool.setFocus();
tool.show();
tool.selectNextItem();
return false;
},_onEditorModeChange:function(_397,args){
var _399=Telerik.Web.UI.EditModes;
var mode=_397.get_mode();
this._setEnabled((mode==_399.Design));
},_onEditorSelectionChange:function(_39b,args){
this.setToolState();
},_setEnabled:function(_39d){
var _39e=this._tools;
for(var i=0;i<_39e.length;i++){
var tool=_39e[i];
tool.set_enabled(_39d);
}
},_registerEditorHandlers:function(){
var _3a1=this.get_editor();
_3a1.add_selectionChange(this._onEditorSelectionChangeDelegate);
_3a1.add_modeChange(this._onEditorModeChangeDelegate);
},_onBodyClick:function(){
if(this._preventToolbarFromHiding){
this._preventToolbarFromHiding=false;
return;
}
this._showToolbarHolder(false);
},_onDropDownValueSelected:function(_3a2,args){
this._preventToolbarFromHiding=true;
var _3a4=_3a2.get_selectedItem();
if(Telerik.Web.UI.EditorButton.isInstanceOfType(_3a4)){
this._raiseEditorEvent(_3a4,null);
}else{
this._raiseEditorEvent(_3a2,_3a4);
}
},_onKeyDownHandler:function(e){
var _3a6=e.keyCode;
if(9==_3a6||37==_3a6||39==_3a6||121==_3a6){
if(Telerik.Web.UI.Editor.PopupController){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
}
if(121==_3a6){
var _3a7=this.get_editor();
window.setTimeout(function(){
if(_3a7){
_3a7.setFocus();
}
},100);
if(e.rawEvent){
$telerik.cancelRawEvent(e.rawEvent);
}
return $telerik.cancelRawEvent(e);
}
if(9==_3a6){
return;
}
var _3a8=this._getSelectedTool(e);
if(!Telerik.Web.UI.EditorButton.isInstanceOfType(_3a8)){
return;
}
if(37==_3a6||39==_3a6){
var tool=_3a8;
while(true){
tool=(37==_3a6)?this._getPreviousTool(tool):this._getNextTool(tool);
if(null==tool){
break;
}
if(tool.get_enabled()){
break;
}
}
if(tool&&tool.get_enabled()){
tool.setFocus();
}
}
if(13==_3a6&&_3a8&&!_3a8.get_selectedItem){
this._raiseEditorEvent(_3a8,null);
return;
}
if(!Telerik.Web.UI.EditorDropDown.isInstanceOfType(_3a8)){
return;
}
if(38==_3a6||40==_3a6){
var _3aa=false;
if(!_3a8.isExpanded()){
_3a8.show();
_3aa=true;
}
if(_3aa||40==_3a6){
_3a8.selectNextItem();
}else{
_3a8.selectPreviousItem();
}
}else{
if(13==_3a6){
_3a8.hide();
if(_3a8.get_activeIndex){
_3a8.set_selectedIndex(_3a8.get_activeIndex());
}
this._onDropDownValueSelected(_3a8);
}else{
if(27==_3a6){
_3a8.hide();
}
}
}
},_onToolBarClick:function(e){
var _3ac=this._getSelectedTool(e);
if(_3ac){
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(_3ac)){
_3ac.click(e);
}else{
if(false){
}else{
this._raiseEditorEvent(_3ac);
}
}
}
var _3ad=this.get_editor();
if(_3ad.get_mode()!=Telerik.Web.UI.EditModes.Design){
$telerik.cancelRawEvent(e);
}
},_raiseEditorEvent:function(tool,_3af){
var _3b0=this.get_events().getHandler("ToolClick");
if(_3b0){
var _3b1=tool.get_name?tool.get_name():"";
var _3b2=new Telerik.Web.UI.EditorCommandEventArgs(_3b1,tool,_3af);
_3b0(tool,_3b2);
}
},_getPreviousTool:function(tool){
var _3b4=Array.indexOf(this._tools,tool);
return this._tools[_3b4-1];
},_getNextTool:function(tool){
var _3b6=Array.indexOf(this._tools,tool);
return this._tools[_3b6+1];
},_getSelectedTool:function(e){
var _3b8=Telerik.Web.UI.EditorButton.getToolRootNode(e.target);
if(null==_3b8){
return;
}
var _3b9=_3b8.control;
if(null==_3b9){
return;
}
if(_3b9.get_enabled&&_3b9.get_enabled()==false){
return;
}
if(e&&_3b9){
e.preventDefault();
e.stopPropagation();
}
return _3b9;
},_getToolBarElements:function(){
var _3ba=this.get_element();
var _3bb=_3ba.getElementsByTagName("ul");
return _3bb;
},get_tools:function(){
return this._tools;
},get_toolbarHolder:function(){
return this.get_window();
},get_editor:function(){
return this._editor;
},set_editor:function(_3bc){
if(this._editor!=_3bc){
this._editor=_3bc;
}
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_3bd){
this._toolJSON=_3bd;
},add_toolClick:function(_3be){
this.get_events().addHandler("ToolClick",_3be);
},remove_toolClick:function(_3bf){
this.get_events().removeHandler("ToolClick",_3bf);
}};
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(_3c0,_3c1,args){
function createSpellCheckEngine(){
if(!_3c1.get_ajaxSpellCheck()){
var _3c3={"editor":_3c1};
var _3c4=document.createElement("DIV");
var _3c5=$create(Telerik.Web.UI.Editor.AjaxSpellCheck,_3c3,null,null,_3c4);
var _3c6=_3c5.get_element();
var _3c7=$get(_3c1.get_id()+"Top");
if(_3c7){
_3c7.appendChild(_3c6);
}
_3c1.set_ajaxSpellCheck(_3c5);
}
var _3c8=_3c1.get_ajaxSpellCheck();
if(args&&args.value){
_3c8.set_language(args.value);
}
_3c8.spellCheck();
}
if(typeof (Telerik.Web.UI.Editor.AjaxSpellCheck)=="undefined"){
function OnWebRequestCompleted(_3c9,_3ca){
var _3cb=_3c9.get_responseData();
Telerik.Web.UI.Editor.Utils.evalScriptCode(_3cb);
createSpellCheckEngine();
}
var _3cc=_3c1.get_ajaxSpellCheckScriptReference();
var _3cd=new Sys.Net.WebRequest();
_3cd.set_url(_3cc);
_3cd.set_httpVerb("GET");
_3cd.add_completed(OnWebRequestCompleted);
_3cd.invoke();
}else{
createSpellCheckEngine();
}
return false;
};
this.ModuleManager=function(_3ce,_3cf,args){
var _3d1=args.value;
var _3d2=_3cf.get_modulesManager();
if(!_3d2){
return false;
}
var _3d3=_3d2.getModuleByName(_3d1);
if(_3d3){
_3d3.toggleVisibility();
_3cf._updateEditorSize(null,true);
}
return false;
};
this.ToggleScreenMode=function(_3d4,_3d5,args){
_3d5.toggleScreenMode();
return false;
};
this.InsertRowAbove=this.InsertRowBelow=function(_3d7,_3d8,args){
_3d8.executeCommand(new Telerik.Web.UI.Editor.TableInsertRow(_3d8.getLocalizedString(_3d7),null,_3d7=="InsertRowAbove"?"above":"below"));
};
this.InsertColumnLeft=this.InsertColumnRight=function(_3da,_3db,args){
_3db.executeCommand(new Telerik.Web.UI.Editor.TableInsertColumn(_3db.getLocalizedString(_3da),null,_3da=="InsertColumnLeft"?"left":"right"));
};
this.DeleteRow=function(_3dd,_3de,args){
_3de.executeCommand(new Telerik.Web.UI.Editor.TableDeleteRow(_3de.getLocalizedString(_3dd)));
};
this.DeleteColumn=function(_3e0,_3e1,args){
_3e1.executeCommand(new Telerik.Web.UI.Editor.TableDeleteColumn(_3e1.getLocalizedString(_3e0)));
};
this.DeleteCell=function(_3e3,_3e4,args){
_3e4.executeCommand(new Telerik.Web.UI.Editor.TableDeleteCell(_3e4.getLocalizedString(_3e3)));
};
this.MergeColumns=function(_3e6,_3e7,args){
_3e7.executeCommand(new Telerik.Web.UI.Editor.TableMergeColumns(_3e7.getLocalizedString(_3e6)));
};
this.MergeRows=function(_3e9,_3ea,args){
_3ea.executeCommand(new Telerik.Web.UI.Editor.TableMergeRows(_3ea.getLocalizedString(_3e9)));
};
this.SplitCell=function(_3ec,_3ed,args){
_3ed.executeCommand(new Telerik.Web.UI.Editor.TableSplitCell(_3ed.getLocalizedString(_3ec)));
};
this.DeleteTable=function(_3ef,_3f0,args){
var _3f2=args.value;
if(!_3f2){
_3f2=_3f0.getSelectedElement();
}
if(_3f2&&"TABLE"!=_3f2.tagName){
_3f2=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_3f2,"TABLE");
}
if(_3f2){
_3f0.selectElement(_3f2);
_3f0.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(_3f3,_3f4,args){
var _3f6=_3f3.substring(10);
var _3f7=new Telerik.Web.UI.EditorCommandEventArgs(_3f3,args.get_tool(),_3f6);
_3f4.fire("InsertFormElement",_3f7);
};
this.StripAll=this.StripCss=this.StripFont=this.StripSpan=this.StripWord=function(_3f8,_3f9,args){
var _3fb=_3f8.substring(5);
var _3fc=new Telerik.Web.UI.EditorCommandEventArgs(_3f8,args.get_tool(),_3fb.toUpperCase());
_3f9.fire("FormatStripper",_3fc);
};
this.FormatStripper=function(_3fd,_3fe,args){
var _400=args.value;
var _401="";
try{
_401=_3fe.getSelectionHtml();
}
catch(e){
}
var oSel=_3fe.get_document().selection?_3fe.get_document().selection:_3fe.get_contentWindow().getSelection();
var _403=oSel.type?oSel.type.toLowerCase()=="none":oSel.isCollapsed;
if(_403||_401==""||_3fe.get_html()==_401){
var _404=Telerik.Web.UI.Editor.Utils.stripFormatting(_3fe.get_html(),_400);
_3fe.set_html(_404,_3fe.getLocalizedString(_3fd)+" "+_400);
}else{
if(_401!=null){
var _404=Telerik.Web.UI.Editor.Utils.stripFormatting(_401,_400);
_3fe.pasteHtml(_404,_3fd);
}
}
};
this.InsertTable=function(_405,_406,args){
var _408=args.value;
if(_408){
var _409=Telerik.Web.UI.Editor.Utils.createTable(_408.rows,_408.cols);
var _40a=Telerik.Web.UI.Editor.Utils.getOuterHtml(_409);
_406.pasteHtml(_40a,_405);
}
};
this.InsertTab=function(_40b,_40c,_40d){
var _40e=_40c.getSelectedElement();
if(_40e.tagName=="LI"){
_40c.fire("Indent");
}else{
_40c.pasteHtml(" &nbsp;&nbsp;&nbsp;&nbsp;",_40b);
}
return false;
};
this.SetToolFocus=function(_40f,_410,_411){
var _412=_410.get_toolAdapter();
if(_412){
_412.setFocus();
}
return false;
};
this.ViewHtml=function(_413,_414,_415){
alert(_414.get_html(true));
return false;
};
this.Undo=this.Redo=function(_416,_417,args){
var _419=args?args.value:1;
if(!_419){
_419=1;
}
if(_416=="Redo"){
_417.redo(_419);
}else{
_417.undo(_419);
}
};
this.PastePlainText=function(_41a,_41b,_41c){
var _41d=function(_41e){
if(_41e){
var _41f=_41e.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
_41f=Telerik.Web.UI.Editor.Utils.replaceNewLineWithBr(_41f);
if(_41f){
_41b.pasteHtml(_41f,_41a);
}
}
};
if(_41b.isIE){
_41d(window.clipboardData.getData("Text"));
}else{
var _420=function(_421,args){
_41d(args.get_content());
};
_41b.showDialog("CleanPasteTextContent",{},_420);
return false;
}
};
this.PasteFromWord=this.PasteFromWordNoFontsNoSizes=this.PasteAsHtml=function(_423,_424,_425){
var _426=function(_427,_428){
var _429="";
if(_423=="PasteFromWord"){
_429=Telerik.Web.UI.Editor.Utils.stripFormatting(_427,"WORD");
}else{
if(_423=="PasteFromWordNoFontsNoSizes"){
_429=Telerik.Web.UI.Editor.Utils.stripFormatting(_427,"WORD_ALL");
}else{
_429=Telerik.Web.UI.Editor.Utils.convertText2Html(_427);
}
}
if(_428){
_428.select();
}
if(_429){
_424.pasteHtml(_429,_423);
}
};
if(_424.isIE){
var _42a=_424.createRestorePoint();
var _42b=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
_426(_42b,_42a);
}else{
var _42c=function(_42d,args){
_426(args.get_content());
};
_424.showDialog("CleanPasteHtmlContent",{},_42c);
}
};
this.Copy=function(_42f,_430,args){
if(null!=args){
var _432=window.opera?false:true;
if(_432){
try{
document.queryCommandEnabled(_42f);
}
catch(e){
_432=false;
}
}
if(_432){
_430.get_document().execCommand(_42f,false,null);
}else{
alert(_430.getLocalizedString("UseCtrlC"));
}
}
};
this.Cut=this.Paste=function(_433,_434,args){
if(null!=args){
var _436=window.opera?false:true;
if(_436){
try{
if(!_434.isIE7){
document.queryCommandEnabled(_433);
}
}
catch(e){
_436=false;
}
}
if(_433=="Paste"&&_436&&_434.isIE7){
_434.get_document().body.fireEvent("onbeforepaste");
}
if(_436){
var oCmd=new Telerik.Web.UI.Editor.GenericCommand(_434.getLocalizedString(_433),_434.get_contentWindow());
_434.get_document().execCommand(_433,false,null);
_434.executeCommand(oCmd);
}else{
var id=(_433=="Cut"?"UseCtrlX":"UseCtrlV");
alert(_434.getLocalizedString(id));
}
}else{
_434._pendingCutPasteCommand=new Telerik.Web.UI.Editor.GenericCommand(_434.getLocalizedString(_433),_434.get_contentWindow());
}
};
this.InsertParagraph=function(_439,_43a,_43b){
_43a.executeBrowserCommand(_439,true,"");
return true;
};
this.FormatBlock=function(_43c,_43d,args){
_43d.executeCommand(new Telerik.Web.UI.Editor.FormatBlockCommand(_43d.getLocalizedString(_43c),_43d.get_contentWindow(),args.value));
};
this.InsertOrderedList=this.InsertUnorderedList=function(_43f,_440,args){
_440.setFocus();
_440.executeCommand(new Telerik.Web.UI.Editor.InsertListCommand(_440.getLocalizedString(_43f),_440.get_contentWindow(),_440.get_newLineBr(),_43f,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(_442,_443,_444){
_443.setActive();
var _445="SelectAll"!=_442;
if(_442=="Unlink"&&!_443.isIE){
var elem=_443.getSelectedElement();
if(elem&&elem.tagName=="A"){
_443.selectElement(elem,false);
}
}
_443.executeBrowserCommand(_442,_445,null,null);
return true;
};
this.ForeColor=this.BackColor=this.FontName=this.FontSize=function(_447,_448,args){
var _44a=args.value;
_448.executeBrowserCommand(_447,true,_44a);
};
this.Zoom=function(_44b,_44c,args){
var _44e=args.value;
var tool=args.get_tool?args.get_tool():null;
if(_44e&&tool&&tool.updateValue){
tool.updateValue(_44e);
}
_44c._contentArea.style.zoom=_44e;
return false;
};
this.Print=function(_450,_451,args){
if(_451.isIE){
_451.get_document().execCommand(_450,false,null);
}else{
if(_451.get_contentWindow().print){
_451.get_contentWindow().print();
}
}
return false;
};
this.InsertSnippet=function(_453,_454,args){
_454.pasteHtml(args.value,_453);
};
this.InsertFormElement=function(_456,_457,args){
var _459=args.value;
_459=_459.toLowerCase();
var _45a=null;
switch(_459){
case "form":
_45a=_457.createElement("form","150px","150px");
_45a.innerHTML="&nbsp;";
break;
case "textarea":
_45a=_457.createElement("textarea");
break;
case "select":
_45a=_457.createElement("select","100px","22px");
break;
case "checkbox":
case "radio":
_45a=_457.createElement("input");
_45a.setAttribute("type",_459);
break;
case "button":
case "reset":
case "submit":
_45a=_457.createElement("input","50px","22px");
_45a.setAttribute("type",_459);
break;
case "hidden":
case "password":
case "text":
_45a=_457.createElement("input","100px","22px");
_45a.setAttribute("type",_459);
break;
}
if(_45a){
var id=Telerik.Web.UI.Editor.Utils.getUniqueID();
_45a.setAttribute("id",id);
var html=Telerik.Web.UI.Editor.Utils.getOuterHtml(_45a);
_457.pasteHtml(html,_456);
var _45d=_457.get_document().getElementById(id);
if(_45d){
_45d.removeAttribute("id");
if(_45d.setActive){
_45d.setActive();
}
return false;
}
}
};
this.InsertGroupbox=this.InsertDate=this.InsertTime=this.InsertSymbol=this.InsertHorizontalRule=function(_45e,_45f,args){
var _461="";
switch(_45e){
case "InsertSymbol":
_461=args.value;
break;
case "InsertHorizontalRule":
_461="<hr>";
break;
case "InsertDate":
var now=new Date();
_461="&nbsp;"+now.toLocaleDateString();
break;
case "InsertTime":
var now=new Date();
_461="&nbsp;"+now.toLocaleTimeString();
break;
default:
_461="<fieldset style='WIDTH: 200px; HEIGHT: 76px'> <legend>Title</legend>Content... </fieldset> ";
}
_45f.pasteHtml(_461,_45e);
};
this.ImageManager=function(_463,_464,_465){
var _466=function(_467,args){
_464.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_463);
};
var _469=_464.get_dialogOpener().get_additionalQueryString();
var _46a=_464.getSelectedElement();
if(_46a&&_46a.tagName.toLowerCase()=="img"){
_464.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_46a.src));
}
var args={editor:_464};
_464.showDialog("ImageManager",args,_466);
_464.get_dialogOpener().set_additionalQueryString(_469);
return false;
};
this.SilverlightManager=function(_46c,_46d,_46e){
var _46f=function(_470,args){
var html=args.Result;
var _473=_46d._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _474=_46d._filtersManager.getFilterByName("MozillaKeepFlashString");
html=(_473)?_473.getDesignContent(html):html;
html=(_474)?_474.getDesignContent(html):html;
_46d.pasteHtml(html,_46c);
};
var _475={};
var _476=_46d.get_dialogOpener().get_additionalQueryString();
var _477=_46d.getSelectedElement();
if(_477){
if($telerik.isIE&&_477.object&&_477.object.Movie){
var _478=_477.object.Movie;
_46d.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_478));
_475.selectedItemUrl=_478;
_475.selectedObject=_477;
}
}
_46d.showDialog("SilverlightManager",_475,_46f);
_46d.get_dialogOpener().set_additionalQueryString(_476);
return false;
};
this.FlashManager=function(_479,_47a,_47b){
var _47c=function(_47d,args){
var _47f=_47a._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _480=_47a._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_47f)?_47f.getDesignContent(html):html;
html=(_480)?_480.getDesignContent(html):html;
_47a.pasteHtml(html,_479);
};
var _482={};
var _483=_47a.get_dialogOpener().get_additionalQueryString();
var _484=_47a.getSelectedElement();
if(_484){
if($telerik.isIE&&_484.object&&_484.object.Movie){
var _485=_484.object.Movie;
_47a.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_485));
_482.selectedItemUrl=_485;
_482.selectedObject=_484;
}
}
_47a.showDialog("FlashManager",_482,_47c);
_47a.get_dialogOpener().set_additionalQueryString(_483);
return false;
};
this.MediaManager=function(_486,_487,_488){
var _489=function(_48a,args){
var _48c=_487._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _48d=_487._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_48c)?_48c.getDesignContent(html):html;
html=(_48d)?_48d.getDesignContent(html):html;
_487.pasteHtml(html,_486);
};
var _48f={};
var _490=_487.get_dialogOpener().get_additionalQueryString();
var _491=_487.getSelectedElement();
if(_491){
if($telerik.isIE&&_491.object&&_491.object.FileName){
var _492=_491.object.FileName;
_487.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+encodeURIComponent(_492));
_48f.selectedItemUrl=_492;
_48f.selectedObject=_491;
}
}
_487.showDialog("MediaManager",_48f,_489);
_487.get_dialogOpener().set_additionalQueryString(_490);
return false;
};
this.TemplateManager=function(_493,_494,_495){
var _496=function(_497,args){
_494.pasteHtml(args.Result,_493);
};
_494.showDialog("TemplateManager",{},_496);
return false;
};
this.AboutDialog=function(_499,_49a,_49b){
_49a.showDialog("AboutDialog");
return false;
};
this.Help=function(_49c,_49d,_49e){
_49d.showDialog("Help");
return false;
};
this.PageProperties=function(_49f,_4a0,_4a1){
var _4a2=function(_4a3,args){
};
var _4a5={};
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4a5,"BODY",_4a0,_49f);
_4a0.showDialog("PageProperties",_4a5,_4a2);
return false;
};
this.ImageMapDialog=function(_4a6,_4a7,args){
var _4a9=Telerik.Web.UI.Editor.CommandList._getImageMapDialogArgument(_4a7);
var _4aa=function(wnd,_4ac){
Telerik.Web.UI.Editor.CommandList._setImageMapProperties(_4a7,_4ac);
return false;
};
_4a7.showDialog("ImageMapDialog",_4a9,_4aa);
return false;
};
this._setImageMapProperties=function(_4ad,args){
if(!args){
return;
}
var _4af=_4ad.getSelectedElement();
var _4b0;
if(_4af&&_4af.tagName=="IMG"){
_4b0=_4af;
if(args.ImageSrc!=_4b0.src){
_4b0.src=args.ImageSrc;
}
}else{
if(!args.ImageSrc){
return;
}
_4ad.pasteHtml("<img src=\""+args.ImageSrc+"\" id = \"__tmp__\">");
_4b0=_4ad.get_document().getElementById("__tmp__");
_4b0.removeAttribute("id");
if(document.all){
var oRng=_4ad.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_4b0);
oRng.select();
}
}
var _4b2=document.createElement("SPAN");
_4b2.innerHTML=args.MapHtml;
var _4b3=_4b2.getElementsByTagName("map");
if(_4b3.length==0){
return;
}
var _4b4=_4b3[0].innerHTML;
_4b2=null;
if(!_4b4){
_4b0.removeAttribute("useMap");
return;
}
var _4b5="";
var map=null;
var _4b7=_4b0.getAttribute("useMap");
if(_4b7){
_4b5=_4b7.substr(1);
map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_4ad,_4b5);
}
if(map==null){
var _4b8=new Date()-100;
var _4b5="rade_img_map_"+_4b8;
map=_4ad.get_document().createElement("map");
map.id=_4b5;
this._setNameAttribute(map,_4b5);
map=_4ad.get_document().body.appendChild(map);
_4b0.setAttribute("useMap","#"+_4b5);
_4b0.setAttribute("border","0");
}
map.innerHTML=_4b4;
};
this._setNameAttribute=function(_4b9,name){
_4b9.removeAttribute("name");
_4b9.removeAttribute("NAME");
_4b9.name=null;
_4b9.name=name;
_4b9["NAME"]=name;
};
this._getImageMapDialogArgument=function(_4bb){
var _4bc={};
_4bc._editor=_4bb;
var _4bd=_4bb.getSelectedElement();
if(_4bd&&_4bd.tagName=="IMG"){
_4bc.ImageSrc=_4bd.getAttribute("src",2);
_4bc.ImageWidth=(_4bd.style.width)?_4bd.style.width:_4bd.width;
_4bc.ImageHeight=(_4bd.style.height)?_4bd.style.height:_4bd.height;
if($telerik.isIE){
var oRng=_4bb.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_4bd);
oRng.select();
}
if(_4bd.useMap){
var _4bf=_4bd.getAttribute("useMap").substr(1);
var map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_4bb,_4bf);
if(map!=null){
_4bc.ImageMapHTML="<map name = \""+_4bf+"\">"+map.innerHTML+"</map>";
}else{
_4bc.ImageMapHTML="";
}
_4bd.style.width=_4bc.ImageWidth;
_4bd.style.height=_4bc.ImageHeight;
}
}
return _4bc;
};
this._getImageMapByName=function(_4c1,_4c2){
var _4c3=_4c1.get_document();
var map=_4c3.getElementById(_4c2);
if(map!=null){
return map;
}
var maps=_4c3.getElementsByTagName("map");
for(var i=0;i<maps.length;i++){
if(maps[i].getAttribute("name")==_4c2){
return maps[i];
}
}
return null;
};
this.DocumentManager=function(_4c7,_4c8,_4c9){
var _4ca={};
var _4cb=function(_4cc,args){
_4c8.pasteHyperLink(args.Result,_4c7);
};
var _4ce=_4c8.get_dialogOpener().get_additionalQueryString();
var _4cf=_4c8.getSelectedElement();
if(_4cf&&_4cf.tagName.toLowerCase()=="a"){
_4c8.get_dialogOpener().set_additionalQueryString(_4ce+"&PreselectedItemUrl="+encodeURIComponent(_4cf.href));
}
_4c8.showDialog("DocumentManager",_4ca,_4cb);
_4c8.get_dialogOpener().set_additionalQueryString(_4ce);
return false;
};
this.TableWizard=function(_4d0,_4d1,_4d2){
var _4d3=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4d1,null,true,false);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4d3,"TABLE",_4d1,_4d0);
var _4d4=function(_4d5,args){
_4d1.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4d0);
};
_4d1.showDialog("TableWizard",_4d3,_4d4);
return false;
};
this.SetTableProperties=function(_4d7,_4d8,_4d9){
var _4da=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4d8,1,false,true);
if(!_4da){
alert(_4d8.getLocalizedString("tablewarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4da,"TABLE",_4d8,_4d7);
var _4db=Telerik.Web.UI.Editor.CommandList._getParentTable(_4d8);
var _4dc=function(_4dd,args){
_4d8.selectElement(_4db);
_4d8.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4d7);
};
if(_4d8.get_document().selection&&_4d8.get_document().selection.empty){
_4d8.get_document().selection.empty();
}
_4d8.showDialog("TableWizard",_4da,_4dc);
return false;
};
this.SetCellProperties=function(_4df,_4e0,_4e1){
var _4e2=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4e0,2,false,true);
if(!_4e2){
alert(_4e0.getLocalizedString("cellwarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4e2,"TABLE",_4e0,_4df);
var _4e3=Telerik.Web.UI.Editor.CommandList._getParentTable(_4e0);
var _4e4=function(_4e5,args){
_4e0.selectElement(_4e3);
_4e0.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4df);
};
_4e0.showDialog("TableWizard",_4e2,_4e4);
return false;
};
this.FindAndReplace=function(_4e7,_4e8,_4e9){
var _4ea={};
_4ea._editor=_4e8;
var _4eb=function(_4ec,args){
};
_4e8.showDialog("FindAndReplace",_4ea,_4eb);
return false;
};
this.StyleBuilder=function(_4ee,_4ef,_4f0){
var _4f1=function(_4f2,args){
_4ef.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_4ee);
};
var _4f4={};
var _4f5=_4ef.getSelection();
var _4f6=_4f5.getParentElement();
if(!_4f5.isControl()){
var _4f7=_4f5.getHtml();
if(_4f7!=""||(_4f6&&_4f6.tagName&&_4f6.tagName.toLowerCase()=="body")){
var _4f8=_4ef.createElement("span");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_4f8,_4f7);
_4f6=_4f8;
}else{
_4ef.selectElement(_4f6,false);
}
}
_4f4.htmlElement=_4f6;
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4f4,"*",_4ef,_4ee);
_4f4.fontNames=_4ef.get_fontNames();
_4ef.showDialog("StyleBuilder",_4f4,_4f1);
return false;
};
this.XhtmlValidator=function(_4f9,_4fa,_4fb){
var _4fc=_4fa;
var _4fd=function(_4fe,args){
};
_4fa.showDialog("XhtmlValidator",_4fc,_4fd);
return false;
};
this.TrackChangesDialog=function(_500,_501,_502){
var _503=_501;
var _504=function(_505,args){
};
_501.showDialog("TrackChangesDialog",_503,_504);
};
this.InsertCustomLink=function(_507,_508,args){
var link=args.value;
var _50b=String.format("<a href='{1}' title='{3}' target='{2}'>{0}</a>",link.innerHTML,link.href,link.target,link.title);
var _50c=Telerik.Web.UI.Editor.CommandList._getParentLink(_508);
if(_50c){
var _50d=_50c.cloneNode(true);
if(link.href){
_50d.setAttribute("href",link.href);
}
if(link.target){
_50d.setAttribute("target",link.target);
}
if(link.title){
_50d.setAttribute("title",link.title);
}
if(!_50d.innerHTML){
_50d.innerHTML=link.innerHTML;
}
_50b=Telerik.Web.UI.Editor.Utils.getOuterHtml(_50d);
}
_508.pasteHtml(_50b,_507);
};
this._getDialogArguments=function(_50e,_50f,_510,_511){
_50e.Colors=_510.get_colors();
if("TD"==_50f||"TH"==_50f||"TABLE"==_50f){
_50e.CssClasses=_510.getCssArray("TABLE");
_50e.CellCssClasses=_510.getCssArray("TD");
}else{
if("A"==_50f||"BODY"==_50f||"IMG"==_50f){
_50e.CssClasses=_510.getCssArray(_50f);
}
}
_50e.Editor=_510;
};
this.SetLinkProperties=this.LinkManager=function(_512,_513,_514){
var _515=Telerik.Web.UI.Editor.CommandList._getLinkArgument(_513);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_515,"A",_513,_512);
var _516=function(_517,args){
_513.pasteHyperLink(args.realLink,_512);
};
_513.showDialog("LinkManager",_515,_516);
return false;
};
this.SetImageProperties=function(_519,_51a,_51b){
var _51c=_51a.getSelectedElement();
if(_51c.nodeName.toLowerCase()!="img"){
return false;
}
var _51d={};
_51d.Element=_51c;
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_51d,"IMG",_51a,_519);
var _51e=function(_51f,args){
if(_51c&&_51c.parentNode){
_51c.parentNode.replaceChild(args.Result,_51c);
}else{
_51a.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_519);
}
};
_51a.showDialog("ImageProperties",_51d,_51e);
return false;
};
this.FormatCodeBlock=function(_521,_522,_523){
var _524={dirtyCode:_522.getSelectionHtml()};
if(_522.get_document().selection&&_522.get_document().selection){
var _525=_522.get_document().selection.type.toLowerCase();
if(_525=="control"||_525=="none"){
_524.dirtyCode="";
}
}
var _526=function(_527,args){
_522.pasteHtml(args.get_code(),_521);
};
_522.showDialog("FormatCodeBlock",_524,_526);
return false;
};
this._getDocumentAnchors=function(_529){
var _52a=_529.getElementsByTagName("A");
var _52b=new Array();
for(var i=0;i<_52a.length;i++){
if(_52a[i].name){
_52b[_52b.length]=_52a[i];
}
}
return _52b;
};
this._getParentLink=function(_52d){
_52d.setFocus();
var _52e=_52d.getSelectedElement();
var _52f=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_52e,"A");
if(_52f){
_52d.selectElement(_52f);
}else{
var _530="";
if(_52e&&_52e.tagName=="IMG"){
_530=Telerik.Web.UI.Editor.Utils.getOuterHtml(_52e);
}else{
_530=_52d.getSelection().getHtml();
}
_52f=_52d.get_document().createElement("A");
try{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_52f,_530);
}
catch(e){
_52f.innerHTML=Telerik.Web.UI.Editor.Utils.stripFormatting(_530,"ALL");
}
}
return _52f;
};
this._getLinkArgument=function(_531,_532){
var _533=Telerik.Web.UI.Editor.CommandList._getParentLink(_531);
var _534=_533.innerHTML;
var _535=!_534?false:_534.match(/</);
if($telerik.isIE&&_535){
if(_534.trim().toLowerCase()=="<p>&nbsp;</p>"){
_533.innerHTML=" ";
_535=false;
}
}
return {selectedTabIndex:_532?_532:0,realLink:_533.cloneNode(true),showText:!_535,documentAnchors:Telerik.Web.UI.Editor.CommandList._getDocumentAnchors(_531.get_document())};
};
this._getParentTable=function(_536){
_536.setFocus();
var _537=_536.getSelectedElement();
var _538=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_537,"TABLE");
return _538;
};
this._getParentCell=function(_539){
_539.setFocus();
var _53a=_539.getSelectedElement();
var _53b=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_53a,"TD");
return _53b;
};
this._getTableArgument=function(_53c,_53d,_53e,_53f){
var _540;
var _541=null;
if(_53e){
_540=Telerik.Web.UI.Editor.Utils.createTable(2,2,_53c._document);
}else{
_540=Telerik.Web.UI.Editor.CommandList._getParentTable(_53c);
}
if(!_53e&&!_540){
return null;
}
if(_53f){
_541=Telerik.Web.UI.Editor.CommandList._getParentCell(_53c);
}
var _542=_540.cloneNode(true);
var _543=_540;
return {selectedTabIndex:_53d?_53d:0,cellToModify:_541,tableToModify:_542,originalTable:_543,tableDocument:(_542.document)?_542.document:_53c.get_document()};
};
this.EnterParagraphMozilla=function(_544,_545,args){
var _547=_545.getSelectedElement();
if("LI"==_547.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_547,"LI")!=null){
_545.bubbleKeyEventToBrowser();
return false;
}
var _548=_545.get_contentWindow();
var oDoc=_548.document;
function checkParent(_54a,_54b){
_54b[_54b.length]=_54a;
while(_54a!=null&&_54a.tagName!="P"){
if(_54a.tagName=="TD"){
return null;
}
_54a=_54a.parentNode;
_54b[_54b.length]=_54a;
}
return _54a;
}
var _54c=_548.getSelection();
var _54d=_54c.getRangeAt(0);
var _54e=_54d.cloneRange();
_54d.deleteContents();
var _54f=_54d.startOffset;
var _550=_54d.startContainer;
var _551="";
var _552=[];
var inP=checkParent(_550,_552);
if(inP){
var _554=(inP.innerHTML=="");
var _555=_54d.cloneRange();
_555.setStart(inP,0);
_555.setEnd(_550,_54f);
var _556=_555.cloneContents();
var _557=_54d.cloneRange();
_557.setStart(_550,_54f);
if(inP.lastChild){
_557.setEndAfter(inP.lastChild);
}else{
_557.setEnd(inP,0);
}
var _558=_557.cloneContents();
_54d.selectNode(inP);
_54c.removeAllRanges();
_54c.addRange(_54d);
inP=inP.cloneNode(true);
inP.innerHTML="";
var _559=inP.cloneNode(true);
if(_554){
_559.innerHTML="&nbsp;";
}else{
_559.appendChild(_556);
}
endPar=inP.cloneNode(true);
endPar.appendChild(_558);
var newP=inP.cloneNode(true);
var _55b=newP;
if(_552.length>0){
for(var i=_552.length;i>0;i--){
var _55d=_552[i];
var _55e=_55d&&_55d.cloneNode?_55d.cloneNode(false):null;
if(_55e&&_55e.tagName!="P"){
_55b.appendChild(_55e);
_55b=_55e;
}
}
}
_55b.innerHTML="&nbsp;";
_55b.setAttribute("id","radETempNode");
var _55f=oDoc.createElement("div");
_55f.appendChild(_559);
_55f.appendChild(newP);
if(!_554){
_55f.appendChild(endPar);
}
_551=_55f.innerHTML;
}else{
_551="<p id='radETempNode'>&nbsp;</p>";
}
_545.pasteHtml(_551,"Enter",false,false,false);
oP=oDoc.getElementById("radETempNode");
if(oP){
oP.removeAttribute("id",0);
var _54c=_548.getSelection();
var _54d=oDoc.createRange();
_54d.selectNodeContents(oP);
_54c.removeAllRanges();
_54c.addRange(_54d);
}
var ps=oDoc.getElementsByTagName("P");
for(var i=0;i<ps.length;i++){
var _561=ps[i].innerHTML;
if(_561==""||_561.trim().toLowerCase()=="<br>"){
ps[i].parentNode.removeChild(ps[i]);
}
}
return false;
};
this.Enter=function(_562,_563,args){
var _565=_563.getSelectedElement();
if("LI"==_565.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_565,"LI")!=null){
_563.bubbleKeyEventToBrowser();
return false;
}
try{
var _566=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_563.get_contentWindow());
var _567=_563.get_document().selection.createRange();
if(_567.pasteHTML){
var tag=_565.tagName;
if(tag.charAt(0)=="H"&&parseInt(tag.charAt(1))>0){
var _569=_567.duplicate();
_569.moveToElementText(_565);
_563.bubbleKeyEventToBrowser();
return false;
}
_567.pasteHTML("<br>");
_567.select();
_567.moveEnd("character",1);
_567.moveStart("character",1);
_567.collapse(false);
}else{
if(_567(0)){
_567.execCommand("Delete");
}
}
_563.executeCommand(_566);
}
catch(exc){
alert(exc.message);
}
return false;
};
this.ShiftEnter=function(_56a,_56b,args){
var _56d=_56b.getSelectedElement();
if("LI"==_56d.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_56d,"LI")!=null){
var _56e=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_56b.get_contentWindow());
var _56f=_56b.get_document().selection.createRange();
_56f.pasteHTML("<br>");
_56f.select();
_56f.moveEnd("character",1);
_56f.moveStart("character",1);
_56f.collapse(false);
_56b.executeCommand(_56e);
return false;
}
_56b.bubbleKeyEventToBrowser();
return false;
};
this.ToggleTableBorder=function(_570,_571,args){
_571.toggleEnhancedEdit();
return false;
};
this.RealFontSize=function(_573,_574,args){
var _576=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_574);
var _577=_576.markedElements;
var _578=_574.createRestorePoint();
var _579=new Telerik.Web.UI.Editor.GenericCommand(_574.getLocalizedString(_573),_574.get_contentWindow());
if(_577.length==0){
var _57a=_574.getSelection().getParentElement();
if($telerik.isIE&&!_574.getSelection().getHtml()&&(_57a.tagName=="FONT"||_57a.tagName=="SPAN")){
_574._document.execCommand("RemoveFormat",null,false);
}
_574.pasteHtml("<font style='font-size:"+args.value+"' id='radERealFont'>&nbsp;</font>",_573);
var _57b=_574._document.getElementById("radERealFont");
_57b.removeAttribute("id");
if($telerik.isIE){
_574.selectElement(_57b);
_574.getSelection().collapse();
_57b.innerHTML="";
}else{
if(_574._contentWindow.getSelection){
var oSel=_574._contentWindow.getSelection();
var _57d=_574.getSelection().getRange();
oSel.removeAllRanges();
if(_57d&&_57d.selectNodeContents){
_57d.selectNodeContents(_57b);
}
oSel.addRange(_57d);
}
}
}else{
for(var i=0;i<_577.length;i++){
_577[i].style.fontSize=args.value;
_577[i].removeAttribute("size");
}
if(_578){
_578.select();
}
_574.executeCommand(_579);
}
};
this.ConvertToUpper=this.ConvertToLower=function(_57f,_580,args){
var _582;
var endR;
if($telerik.isIE){
if(_580._document.selection.type.toLowerCase()=="control"){
return;
}
var _584=_580._document.selection.createRange();
_582=_584.duplicate();
endR=_584.duplicate();
_582.collapse();
endR.collapse(false);
}
var _585=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_580);
var _586=_585.markedElements;
var _587=_585.newElements;
var _588=new Telerik.Web.UI.Editor.GenericCommand(_580.getLocalizedString(_57f),_580.get_contentWindow());
for(var i=0;i<_586.length;i++){
changeChildNodesCase(_586[i]);
}
for(var i=0;i<_587.length;i++){
if($telerik.isIE){
_587[i].removeNode(false);
}else{
var _58a=document.createRange();
_58a.selectNodeContents(_587[i]);
_587[i].parentNode.replaceChild(_58a.extractContents(),_587[i]);
}
}
if($telerik.isIE){
var _58b=_580._document.selection.createRange();
_58b.setEndPoint("StartToStart",_582);
_58b.setEndPoint("EndToEnd",endR);
_58b.select();
}else{
var _58c=_580.get_contentWindow().getSelection();
var rng=_58c.getRangeAt(0);
rng.collapse(true);
}
_580.executeCommand(_588);
function changeChildNodesCase(_58e){
var _58f=_58e.childNodes;
for(var i=0;i<_58f.length;i++){
if(_58f[i].nodeType==3){
_58f[i].nodeValue=("ConvertToLower"==_57f)?_58f[i].nodeValue.toLowerCase():_58f[i].nodeValue.toUpperCase();
}else{
if(_58f[i].nodeType==1&&_58f[i].tagName.toUpperCase()!="FONT"){
changeChildNodesCase(_58f[i]);
}
}
}
}
};
this.ApplyClass=function(_591,_592,args){
var _594=args.value;
var _595=_592.get_document();
var _596=_592.createRestorePoint();
var _597=new Telerik.Web.UI.Editor.GenericCommand(_592.getLocalizedString(_591),_592.get_contentWindow());
if(_592.isIE){
var _598=_595.selection.createRange();
var _599=(_598.length>0?_598(0):_598.parentElement());
if(_599.tagName=="LI"){
var _59a=_598.htmlText;
var _59b=_59a.match(/<LI\/?>/gi);
var _59c=_59b?_59b.length:0;
if(_59c>1){
_599=_599.parentNode;
}else{
if(_59c==0&&(Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_599,_598.htmlText))&&_599.parentNode.childNodes.length==1){
_599=_599.parentNode;
}
}
}
if(_598.length>0||_599.tagName=="OL"||_599.tagName=="UL"){
_599.className=_594;
return;
}
}
var _59d=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_592);
var _59e=_59d.markedElements;
if(_59e.length==0){
var _59f=_592.getSelection().getParentElement();
if($telerik.isIE&&!_592.getSelection().getHtml()&&(_59f.tagName=="FONT"||_59f.tagName=="SPAN")){
_592._document.execCommand("RemoveFormat",null,false);
}
_592.pasteHtml("<font class='"+_594+"' id='radERealFont'>&nbsp;</font>",_591);
var _5a0=_592._document.getElementById("radERealFont");
_5a0.removeAttribute("id");
if($telerik.isIE){
_592.selectElement(_5a0);
_592.getSelection().collapse();
_5a0.innerHTML="";
}else{
if(_592._contentWindow.getSelection){
var oSel=_592._contentWindow.getSelection();
var _5a2=_592.getSelection().getRange();
oSel.removeAllRanges();
if(_5a2&&_5a2.selectNodeContents){
_5a2.selectNodeContents(_5a0);
}
oSel.addRange(_5a2);
}
}
}else{
for(var i=0;i<_59e.length;i++){
_59e[i].className=_594;
}
if(_596){
_596.select();
}
_592.executeCommand(_597);
}
};
this._markEditorSelection=function(_5a4){
if(_5a4.get_html()==""){
return {markedElements:[],newElements:[]};
}
var _5a5="AZBY";
var _5a6="_cm";
var _5a7=[];
var _5a8=[];
var _5a9=[];
var _5aa=$telerik.isSafari?"span":"font";
var _5ab=_5a4._contentArea;
var _5ac=_5a4.getSelection();
if(_5ac.isControl()){
var _5ad=_5ac.getParentElement();
var _5ae=_5a4._document.createElement(_5aa);
_5ae.appendChild(_5ad.cloneNode(true));
_5ad.parentNode.replaceChild(_5ae,_5ad);
return {markedElements:[_5ae],newElements:[_5ae]};
}
if(!$telerik.isSafari){
keepFontNames();
}
if(!$telerik.isIE){
_5ab.ownerDocument.execCommand("UseCSS",false,true);
}
_5ab.ownerDocument.execCommand("FontName",false,_5a5);
var _5af=_5ab.getElementsByTagName(_5aa);
for(var i=0;i<_5af.length;i++){
var _5ae=_5af[i];
if(_5ae.getAttribute("face")==_5a5||_5ae.style.fontFamily==_5a5){
_5ae.removeAttribute("face");
if(_5ae.style.fontFamily==_5a5){
_5ae.style.fontFamily="";
}
_5a8.push(_5ae);
var _5b1=_5ae.getElementsByTagName(_5aa);
for(var j=0;j<_5b1.length;j++){
var _o=_5b1[j];
if(_o.getAttribute("face")!=_5a5){
_5a8.push(_o);
}
}
if(!_5ae.getAttribute(_5a6)){
_5a9.push(_5ae);
}
}
_5ae.removeAttribute(_5a6);
}
if(!$telerik.isSafari){
restoreFontNames();
}
if(!$telerik.isIE){
_5ab.ownerDocument.execCommand("UseCSS",false,false);
}
function keepFontNames(){
var _5b4=_5a4._contentArea.getElementsByTagName(_5aa);
for(var i=0;i<_5b4.length;i++){
var _5b6=_5b4[i];
if(_5b4[i].face){
_5b6.setAttribute("_face",_5b6.face);
_5a7.push(_5b6);
}
_5b6.setAttribute(_5a6,1);
}
}
function restoreFontNames(){
for(var i=0;i<_5a7.length;i++){
_5a7[i].face=_5a7[i].getAttribute("_face");
_5a7[i].removeAttribute("_face");
}
_5a7=[];
}
return {markedElements:_5a8,newElements:_5a9};
};
})();
if(typeof (RadEditorCommandList)=="undefined"){
var RadEditorCommandList=Telerik.Web.UI.Editor.CommandList;
}
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandsManager=function(_5b8){
this._commands=[];
this._currentCommandIndex=-1;
};
Telerik.Web.UI.Editor.CommandsManager.prototype={get_commands:function(){
return this._commands;
},execute:function(_5b9,_5ba){
if(_5b9&&_5b9.execute){
var _5bb=_5b9.execute();
if(false==_5ba){
return false;
}
if(_5bb&&_5b9._canUnexecute){
this._clearCommandsToRedo();
Array.add(this._commands,_5b9);
this._currentCommandIndex=this._commands.length-1;
return true;
}
}
return false;
},undo:function(_5bc){
if(_5bc>this._commands.length){
_5bc=this._commands.length;
}
var _5bd=0;
var _5be=null;
while(0<_5bc--&&0<=this._currentCommandIndex&&this._currentCommandIndex<this._commands.length){
_5be=this._commands[this._currentCommandIndex--];
if(_5be){
_5be.unexecute();
_5bd++;
}
}
},redo:function(_5bf){
if(_5bf>this._commands.length){
_5bf=this._commands.length;
}
var _5c0=0;
var _5c1=null;
var _5c2=this._currentCommandIndex+1;
while(0<_5bf--&&0<=_5c2&&_5c2<this._commands.length){
_5c1=this._commands[_5c2];
if(_5c1){
_5c1.execute();
this._currentCommandIndex=_5c2;
_5c0++;
}
_5c2++;
}
},removeCommandAt:function(_5c3){
this._commands.splice(_5c3,1);
if(this._currentCommandIndex>=_5c3){
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 _5c4=this._commands[this._currentCommandIndex].clone();
this.execute(_5c4);
}
},_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(_5c5){
return _5c5;
},getDesignContent:function(_5c6){
return _5c6;
},get_isDom:function(){
return this.IsDom;
},set_isDom:function(_5c7){
this.IsDom=_5c7;
},get_enabled:function(){
return this.Enabled;
},set_enabled:function(_5c8){
this.Enabled=_5c8;
},get_name:function(){
return this.Name;
},set_name:function(_5c9){
this.Name=_5c9;
},get_description:function(){
return this.Description;
},set_description:function(_5ca){
this.Description=_5ca;
}};
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(_5cb){
return this._performStripping(_5cb);
},getDesignContent:function(_5cc){
return this._performStripping(_5cc);
},_performStripping:function(_5cd){
var _5ce=_5cd.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
_5ce=_5ce.replace(RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
return _5ce;
}};
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(_5cf){
var _5d0=new RegExp("<!"+"--RADEDITORSAVEDTAG_([\\s\\S]*?)--"+">","ig");
var _5d1=new RegExp("--RADEDITORSAVEDTAGENDING>","ig");
var _5d2=_5cf.replace(_5d0,"<$1>");
_5d2=_5d2.replace(_5d1,"--"+">");
return _5d2;
},getDesignContent:function(_5d3){
var _5d4=function(_5d5,_5d6,_5d7,_5d8,_5d9){
var _5da=_5d9.substring(0,_5d8).lastIndexOf("<!"+"--");
var _5db=_5d9.substring(0,_5d8).lastIndexOf("--"+">");
if(_5da>_5db){
_5da=_5d9.substring(_5d8,_5d9.length).indexOf("<!"+"--");
_5db=_5d9.substring(_5d8,_5d9.length).indexOf("--"+">");
if((_5da==-1&&_5db>-1)||(_5db<_5da)){
return _5d5;
}
}
var _5dc=_5d7.replace("--"+">","--RADEDITORSAVEDTAGENDING>");
var _5dd="<!"+"--RADEDITORSAVEDTAG_"+_5d6+_5dc+"--"+">";
return _5dd;
};
var _5de=new RegExp("<(script|noscript)([\\s\\S]*?<\\/\\1)>","ig");
var _5df=_5d3.replace(_5de,_5d4);
return _5df;
}};
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(_5e0){
return this._performStripping(_5e0);
},_performStripping:function(_5e1){
var _5e2=_5e1;
_5e2=_5e2.replace(/<BR\s?\/?>\s*<\/(H1|H2|H3|H4|H5|H6|LI|P)/ig,"</$1");
_5e2=_5e2.replace(/<(H1|H2|H3|H4|H5|H6|LI|P)([^>]*)?><BR\s?\/?>/ig,"<$1 $2>");
return _5e2;
}};
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(_5e3,_5e4){
var _5e5=_5e3.getElementsByTagName(_5e4);
if(!_5e5){
_5e5=_5e3.ownerDocument.getElementsByTagName(_5e4);
}
return _5e5;
},fixLists:function(_5e6,_5e7){
var _5e8=this._getElements(_5e6,_5e7);
for(var i=_5e8.length-1;i>=0;i--){
var list=_5e8[i];
var _5eb=list.previousSibling;
if(_5eb&&_5eb.nodeType==3){
_5eb=_5eb.previousSibling;
}
if(_5eb&&"li"==list.previousSibling.nodeName.toLowerCase()){
_5eb.appendChild(list.cloneNode(true));
var _5ec=list.parentNode;
_5ec.removeChild(list);
_5ec=null;
}
}
},getHtmlContent:function(_5ed){
this.fixLists(_5ed,"OL");
this.fixLists(_5ed,"UL");
return _5ed;
}};
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(_5ee,_5ef){
var _5f0=_5ee.getElementsByTagName(_5ef);
if(!_5f0){
_5f0=_5ee.ownerDocument.getElementsByTagName(_5ef);
}
return _5f0;
},_replaceElementWithSpan:function(_5f1,_5f2,_5f3){
var _5f4=this._getElements(_5f1,_5f2);
while(_5f4.length>0){
var _5f5=_5f1.ownerDocument.createElement("span");
_5f5.style.cssText=_5f3;
var _5f6=_5f4[0].innerHTML;
if($telerik.isIE&&_5f6==" "){
_5f5.innerText=_5f6;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_5f5,_5f6);
}
_5f4[0].parentNode.replaceChild(_5f5,_5f4[0]);
_5f4=this._getElements(_5f1,_5f2);
}
},_replaceSpanWithElement:function(_5f7,_5f8,_5f9){
var _5fa=this._getElements(_5f7,"span");
var _5fb=_5fa.length-1;
while(_5fb>=0){
var _5fc=[];
var _5fd=_5fa[_5fb];
for(var i=0;i<_5fd.childNodes.length;i++){
Array.add(_5fc,_5fd.childNodes[i].cloneNode(true));
}
if(_5fd.style.cssText.toLowerCase()==_5f9||_5fd.style.cssText.toLowerCase()==(_5f9+";")){
var _5ff=_5f7.ownerDocument.createElement(_5f8);
for(var j=0;j<_5fc.length;j++){
_5ff.appendChild(_5fc[j]);
}
_5fd.parentNode.replaceChild(_5ff,_5fa[_5fb]);
_5fa=this._getElements(_5f7,"span");
_5fb=_5fa.length-1;
}else{
_5fb--;
}
}
},getHtmlContent:function(_601){
this._replaceElementWithSpan(_601,"u","text-decoration:underline;");
return _601;
},getDesignContent:function(_602){
this._replaceSpanWithElement(_602,"u","text-decoration: underline");
return _602;
}};
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(_603){
var _604=new RegExp("<!"+"--RADEDITORSAVEDCOMMENT","ig");
var _605=_603.replace(_604,"<!--");
return _605;
},getDesignContent:function(_606){
var _607=new RegExp("<!"+"--(\\[[^]]+\\][\\s\\S]*?)-"+"->","ig");
var _608=_606.replace(_607,"<!-"+"-RADEDITORSAVEDCOMMENT$1-"+"->");
return _608;
}};
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(_609){
var _60a=new RegExp("<param([\\s\\S]+?)?>","ig");
var _60b=new RegExp("<rade_param([\\s>])","ig");
var _60c=_609;
if(_60a.test(_609)&&_60b.test(_609)){
_60c=_60c.replace(_60a,"");
}
_60c=_60c.replace(_60b,"<param$1");
_60c=_60c.replace(/<\/rade_param>/gi,"");
return _60c;
},getDesignContent:function(_60d){
var _60e=new RegExp("<param([\\s\\S]+?)/?>","ig");
var _60f=_60d.replace(_60e,"<rade_param$1></rade_param><param$1>");
return _60f;
}};
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 _611=node.parentNode;
if(_611!=null){
while(node.childNodes&&node.childNodes.length>0){
_611.insertBefore(node.childNodes[0],node);
}
_611.removeChild(node);
return _611;
}
return true;
},getHtmlContent:function(_612){
var _613=null;
if(_612.tagName.toLowerCase()=="html"){
_613=_612.getElementsByTagName("BODY")[0];
}else{
_613=_612;
}
if($telerik.isIE){
if(_613&&(_613.firstChild)&&("P"==_613.firstChild.tagName)&&(_613.childNodes.length==1)&&(_613.innerHTML.substring(0,3).toLowerCase()=="<p>")){
this._removeNode(_613.firstChild);
}
}else{
if(_613&&(_613.childNodes.length==1)&&(_613.firstChild.tagName)&&("br"==_613.firstChild.tagName.toLowerCase())){
_613.innerHTML="";
}
}
return _612;
}};
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(_614){
var re=new RegExp("(<p[^>]*>)(<\\/p>)","ig");
var _616=_614.replace(re,"$1&nbsp;$2");
return _616;
}};
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(_617){
var _618=document.location.href;
var re=new RegExp("(<A[^<>]*?(href)\\s*=\\s*['\"])("+_618+")(\\#[^'\"]*?['\"][^>]*?>)","ig");
var _61a=_617.replace(re,"$1$4");
return _61a;
}};
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(_61b){
var _61c=_61b.replace(new RegExp("<b(\\s([^>])*?)?>","ig"),"<strong$1>");
_61c=_61c.replace(new RegExp("</b(\\s([^>])*?)?>","ig"),"</strong$1>");
_61c=_61c.replace(new RegExp("<i(\\s([^>])*?)?>","ig"),"<em$1>");
_61c=_61c.replace(new RegExp("</i(\\s([^>])*?)?>","ig"),"</em$1>");
return _61c;
},getDesignContent:function(_61d){
var _61e=_61d.replace(new RegExp("<strong(\\s([^>])*?)?>","ig"),"<b$1>");
_61e=_61e.replace(new RegExp("</strong(\\s([^>])*?)?>","ig"),"</b$1>");
_61e=_61e.replace(new RegExp("<em(\\s([^>])*?)?>","ig"),"<i$1>");
_61e=_61e.replace(new RegExp("</em(\\s([^>])*?)?>","ig"),"</i$1>");
return _61e;
}};
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(_61f){
var self=this;
var _621=function(_622,_623,_624,_625,_626){
var _627=_626.indexOf("</head>",_625);
if(_627!=-1&&_626.indexOf("<body",_627)!=-1){
return _622;
}else{
self.markerCounter++;
var _628="RadEditorStyleKeeper"+self.markerCounter;
var _629="<div id='"+_628+"' style='display:none;'>&nbsp;</div><"+_623+" reoriginalpositionmarker='"+_628+"'"+_624;
return _629;
}
};
var _62a=new RegExp("<(link|style)([^>]*>)","gi");
var _62b=_61f.replace(_62a,_621);
return _62b;
}};
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(_62c){
var _62d=_62c.getElementsByTagName("HEAD")[0];
var _62e=true;
if(!_62d){
_62d=_62c.ownerDocument.getElementsByTagName("HEAD")[0];
_62e=false;
}
if(!_62d){
return _62c;
}
this._restoreElements(_62d,_62c,"STYLE");
this._restoreElements(_62d,_62c,"LINK");
var divs=_62c.getElementsByTagName("DIV");
if(divs){
for(var j=divs.length-1;j>=0;j--){
var _631=divs[j];
if(_631.id.indexOf("RadEditorStyleKeeper")==0){
var _632=_631.parentNode;
_632.removeChild(_631);
}
}
}
divs=null;
if(_62e){
this._removeElements(_62d,"STYLE");
this._removeElements(_62d,"LINK");
}
this._removeMarkerAttributes(_62c,"STYLE");
this._removeMarkerAttributes(_62c,"LINK");
return _62c;
},_restoreElements:function(_633,_634,_635){
var _636;
_636=_633.getElementsByTagName(_635);
this._divs=_634.getElementsByTagName("DIV");
var i=0;
while(_636.length>0&&i<_636.length){
this._restoreStyle(_636[i++]);
}
},_restoreStyle:function(_638){
var _639=_638.getAttribute("reoriginalpositionmarker");
if(_639){
j=0;
var _63a=null;
while(j<this._divs.length&&!_63a){
if(this._divs[j].id==_639){
_63a=this._divs[j];
}
j++;
}
if(_63a){
var _63b=_638.cloneNode(true);
_63b.removeAttribute("reoriginalpositionmarker");
var _63c=_63a.parentNode;
_63c.replaceChild(_63b,_63a);
return true;
}
}
return false;
},_removeElements:function(_63d,_63e){
var _63f=_63d.getElementsByTagName(_63e);
if(_63f){
for(var j=_63f.length-1;j>=0;j--){
var _641=_63f[j];
if(null!=_641.getAttribute("reoriginalpositionmarker")){
var _642=_641.parentNode;
_642.removeChild(_641);
}
}
_63f=null;
}
},_removeMarkerAttributes:function(_643,_644){
styles=_643.getElementsByTagName(_644);
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(_646){
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=_646?_646:"FlashManager.gif";
};
Telerik.Web.UI.Editor.MozillaKeepFlashString.prototype={getDesignContent:function(_647){
var _648=this;
var _649=function(_64a,gr1,gr2,gr3,str,_64f){
var _650=String.format("<img isflash=\"true\" {0} />{1}",gr1,gr2);
_650=_650.replace(/\ssrc=/gi,String.format(" src=\"{0}\" flashSrc=",_648._flashImageSrc));
return _650;
};
var _651=new RegExp("<embed([^>]*)?>(.*)?(<\\/embed>)?","ig");
var _652=_647.replace(_651,_649);
return _652;
}};
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(_653){
if(!_653){
return _653;
}
var _654=_653.getElementsByTagName("IMG");
for(var i=0;i<_654.length;i++){
var _656=_654[i];
var _657=_656.getAttribute("isflash");
if(_657!=null){
var _658=_656.getAttribute("flashSrc");
var _659=Telerik.Web.UI.Editor.Utils.getOuterHtml(_656);
_659=_659.replace(/<img/gi,"<embed");
var oDiv=_656.ownerDocument.createElement("DIV");
oDiv.innerHTML=_659;
newNode=oDiv.firstChild;
if(_658){
newNode.src=_658;
if($telerik.isSafari){
newNode.setAttribute("src",_658);
}
}
newNode.removeAttribute("flashSrc");
newNode.removeAttribute("isflash");
var _65b=_656.parentNode;
_65b.insertBefore(newNode,_656);
_65b.removeChild(_656);
i--;
}
}
return _653;
}};
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(_65c){
var html=_65c;
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(_65f){
var _660=_65f.ownerDocument;
var _661=_660.createElement("SPAN");
var span,font,_664;
var _665=_65f.getElementsByTagName("FONT");
while(_665.length>0){
font=_665[0];
_664=font.parentNode;
span=_661.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);
}
_664.replaceChild(span,font);
_665=_65f.getElementsByTagName("FONT");
}
return _65f;
},getDesignContent:function(_667){
var _668=_667.ownerDocument;
var _669=_668.createElement("FONT");
var span,font,_66c;
var _66d=_667.getElementsByTagName("SPAN");
while(_66d.length>0){
span=_66d[0];
_66c=span.parentNode;
font=_669.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 _66f=null;
if(-1!=span.style.fontSize.indexOf("px")){
_66f=this._fontSizesRevPx[parseInt(span.style.fontSize)];
}
if(typeof (_66f)!="undefined"&&null!=_66f){
font.size=_66f+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);
}
_66c.replaceChild(font,span);
_66d=_667.getElementsByTagName("SPAN");
}
return _667;
},_fixColorValue:function(_670){
if(_670.toLowerCase().indexOf("rgb")!=-1){
var _671="#";
var _672=function(val){
var _674=parseInt(val,10).toString(16);
_671=_671+(_674.length==1?"0"+_674:_674);
return val;
};
_670=_670.replace(/(\d+)/gi,_672);
_672=null;
return _671;
}else{
return _670;
}
},_removeElementStyleAttribute:function(_675,_676){
if(_675.style&&_675.style[_676]){
if(_675.style.removeAttribute){
_675.style.removeAttribute(_676);
}else{
if(_675.style.removeProperty){
_676=_676.replace(/([A-Z])/g,"-$1").toLowerCase();
_675.style.removeProperty(_676);
}
}
if(_675.style[_676]){
_675.style[_676]=null;
}
if(_675.style.cssText){
}else{
_675.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(_677){
if(!_677){
return "";
}
var sb=new Sys.StringBuilder("");
this._appendNodeXhtml(_677,sb);
return sb.toString();
},_convertAttribute:function(s){
return String(s).replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
},_getAttributeValue:function(_67a,_67b,sb){
var name=_67a.nodeName;
var _67e=_67a.nodeValue;
if(name!="style"){
if($telerik.isIE&&(name=="type"||name=="value"||name=="selected")){
if(!_67e){
return;
}
}else{
if(!_67a.specified){
if($telerik.isIE&&_67e==""&&typeof (_67b[name])=="string"&&_67b[name]!=""){
_67e=_67b[name];
}else{
return;
}
}
}
if(!_67e){
return;
}
if(!isNaN(_67e)){
_67e=_67b.getAttribute(name);
}
if($telerik.isIE&&(name=="href"||name=="src")){
_67e=_67b.getAttribute(name,2);
}
sb.append(" "+(_67a.expando?name:name.toLowerCase())+"=\""+this._convertAttribute(_67e)+"\"");
}else{
var _67f=_67b.style.cssText;
if(_67f){
sb.append(" style=\""+this._convertAttribute(_67f.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 _685=node.getAttribute("href",2);
if(_685){
_685=_685.replace("about:blank","");
_685=_685.replace("about:","");
_685=_685.replace(/&amp;/gi,"&").replace(/&/gi,"&amp;");
sb.append(" href=\""+_685+"\"");
node.removeAttribute("href",0);
}
}
}
}
try{
var _686=node.attributes;
var l=_686.length;
for(var i=0;i<l;i++){
this._getAttributeValue(_686[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 _689="";
if(node.altHtml){
_689=node.altHtml;
}else{
_689=node.innerHTML;
}
if($telerik.isIE){
_689=_689.replace(/\soriginalAttribute="[^"]+"/gi,"");
_689=_689.replace(/\soriginalPath="[^"]+"/gi,"");
}
sb.append(_689);
sb.append("</object>");
break;
case "title":
case "style":
case "comment":
case "noscript":
var _689=node.innerHTML;
if($telerik.isIE&&_689.length==0){
_689=node.ownerDocument.title;
}
sb.append(">"+_689+"</"+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 _68d=String(node.nodeValue);
var _68e=node.parentNode.nodeName.toLowerCase();
if(!$telerik.isIE&&(_68e=="style"||_68e=="script")){
sb.append(_68d);
}else{
_68d=_68d.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
if($telerik.isFirefox){
_68d=_68d.replace(/[\u00a0]/g,"&nbsp;");
}
sb.append(_68d);
}
},_appendCDataNode:function(node,sb){
sb.append("<![CDA"+"TA[\n"+node.nodeValue+"\n]"+"]>");
},_appendCommentNode:function(node,sb){
var _693=node.nodeValue;
if(!_693&&node.text){
_693=node.text;
}else{
_693="<!--"+_693+"-->";
}
sb.append(_693);
},_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 _696="P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION";
var _697="HTML|HEAD|BODY|STYLE|FORM|TABLE|TBODY|THEAD|TR";
var _698=_697+"|UL|OL";
this._ignoreTags=new RegExp("(<PRE[^>]*>|<!--|<SCRIPT[^>]*>)([\\s\\S]*?)(<\\/PRE>|-->|<\\/SCRIPT>)","gi");
this._tagsNLBefore=new RegExp("<("+_696+")[^>]*>","gi");
this._tagsNLAfter=new RegExp("<\\/("+_696+")[^>]*>","gi");
this._tagsNLNoCloseAfter=new RegExp("<(BR|HR)[^>]*\\/?>","gi");
this._tagsNLBeforeAndAfter=new RegExp("<\\/?("+_697+")[^>]*>","gi");
this._tagsIncIndent=new RegExp("^<("+_698+")[\\s\\/>]","i");
this._tagsDecIndent=new RegExp("^<\\/("+_698+")[\\s\\>]","i");
this._shrinkNL=new RegExp("\\s*\\n+\\s*","gi");
};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.prototype={dispose:function(){
this._protectedData=[];
},getHtmlContent:function(html){
var _69a=html.trim();
if(_69a.indexOf("<body")==0){
_69a=_69a.substring(_69a.indexOf(">")+1,_69a.length-7);
}
this._protectedData=[];
var self=this;
var _69c=function(_69d,_69e,_69f,_6a0,_6a1,_6a2){
Array.add(self._protectedData,_69f);
return _69e+"RADEDITORFORMATTED_"+self._protectedData.length+_6a0;
};
_69a=_69a.replace(this._ignoreTags,_69c);
var _6a3="$&";
if($telerik.isSafari){
_6a3="$0";
}
_69a=_69a.replace(this._tagsNLBefore,"\n"+_6a3);
_69a=_69a.replace(this._tagsNLAfter,_6a3+"\n");
_69a=_69a.replace(this._tagsNLNoCloseAfter,_6a3+"\n");
_69a=_69a.replace(this._tagsNLBeforeAndAfter,"\n"+_6a3+"\n");
var _6a4=_69a.split(this._shrinkNL);
var _6a5=new Sys.StringBuilder("");
var _6a6="";
for(var i=0;i<_6a4.length;i++){
var line=_6a4[i];
if(line.length==0){
continue;
}
if(this._tagsDecIndent.test(line)){
if(_6a6.length>this._indentPattern.length){
_6a6=_6a6.substring(this._indentPattern.length);
}else{
_6a6="";
}
}
_6a5.append(_6a6);
_6a5.append(line);
_6a5.append("\n");
if(this._tagsIncIndent.test(line)){
_6a6+=this._indentPattern;
}
}
_69a=_6a5.toString();
for(var i=0;i<this._protectedData.length;i++){
var _6a9=new RegExp("RADEDITORFORMATTED_"+(i+1));
var _6aa=this._protectedData[i].replace(/\$/gi,"$$$$");
_69a=_69a.replace(_6a9,_6aa);
}
return _69a;
}};
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(_6ab){
this._updateElements(_6ab,"A","href");
this._updateElements(_6ab,"AREA","href");
this._updateElements(_6ab,"IMG","src");
this._updateElements(_6ab,"EMBED","src");
return _6ab;
},_getElements:function(_6ac,_6ad){
var _6ae=_6ac.getElementsByTagName(_6ad);
if(!_6ae){
_6ae=_6ac.ownerDocument.getElementsByTagName(_6ad);
}
return _6ae;
},_updateElements:function(_6af,_6b0,_6b1){
var _6b2=_6af.ownerDocument.createElement("div");
var _6b3=this._getElements(_6af,_6b0);
if(_6b3){
for(var i=0;i<_6b3.length;i++){
var _6b5=_6b3[i].getAttribute(_6b1,2);
if("href"==_6b1&&_6b5){
_6b2.innerHTML="<a href=\""+_6b5.replace(/\"/gi,"%22")+"\">test</a>";
if($telerik.isIE){
var _6b6=_6b3[i].innerHTML;
}
_6b3[i].setAttribute("href",_6b2.childNodes[0].href);
if($telerik.isIE){
if((_6b6.indexOf("www.")==0&&_6b3[i].innerHTML.match("[a-z]+://"))||(_6b6.indexOf("mailto:")==-1&&_6b3[i].innerHTML.match("mailto:"))){
_6b3[i].innerHTML=_6b6;
}
}
}else{
if("src"==_6b1&&_6b5){
_6b2.innerHTML="<img src=\""+_6b5.replace(/\"/gi,"%22")+"\" />";
_6b3[i].setAttribute("src",_6b2.childNodes[0].src);
}
}
}
}
_6b2.innerHTML="";
_6b2=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(_6b7){
this._enableXhtmlFilter=_6b7;
},add:function(_6b8){
Array.add(this._filters,_6b8);
},addAt:function(_6b9,_6ba){
Array.insert(this._filters,_6ba,_6b9);
},remove:function(_6bb){
Array.remove(this._filters,_6bb);
},removeAt:function(_6bc){
Array.removeAt(this._filters,_6bc);
},getFilterAt:function(_6bd){
return this._filters[_6bd];
},getFilterByName:function(name){
for(var i=0;i<this._filters.length;i++){
var _6c0=this._filters[i];
if(_6c0&&name==_6c0.get_name()){
return _6c0;
}
}
},getDesignContent:function(_6c1){
var _6c2=_6c1;
for(var i=0;i<this._filters.length;i++){
var _6c4=this._filters[i];
if((!_6c4.get_isDom())&&(false!=_6c4.get_enabled())&&_6c4.getDesignContent){
try{
_6c2=_6c4.getDesignContent(_6c2);
}
catch(exc){
alert("Error while executing filter "+_6c4.get_name()+" - "+exc.toString());
}
}
}
return _6c2;
},getDesignContentDom:function(_6c5){
for(var i=0;i<this._filters.length;i++){
var _6c7=this._filters[i];
if((_6c7.get_isDom())&&(false!=_6c7.get_enabled())&&_6c7.getDesignContent){
try{
_6c5=_6c7.getDesignContent(_6c5);
}
catch(exc){
alert("Error while executing filter "+_6c7.get_name()+" - "+exc.toString());
}
}
}
return _6c5;
},getHtmlContent:function(_6c8){
for(var i=0;i<this._filters.length;i++){
var _6ca=this._filters[i];
if((_6ca.get_isDom())&&(false!=_6ca.get_enabled())&&_6ca.getHtmlContent){
try{
_6c8=_6ca.getHtmlContent(_6c8);
}
catch(exc){
alert("Error while executing filter "+_6ca.get_name()+" - "+exc.toString());
}
}
}
var _6cb;
if(this.get_enableXhtmlFilter()){
try{
_6cb=this._convertToXhtmlFilter.getHtmlContent(_6c8);
}
catch(exc){
alert("Error while executing filter XHTML - "+exc.toString());
}
}else{
_6cb=_6c8.innerHTML;
}
_6cb=_6cb.replace(/<body\s*\/>/i,"<body></body>");
for(var i=0;i<this._filters.length;i++){
var _6ca=this._filters[i];
if((!_6ca.get_isDom())&&(false!=_6ca.get_enabled())&&_6ca.getHtmlContent){
try{
_6cb=_6ca.getHtmlContent(_6cb);
}
catch(exc){
alert("Error while executing filter "+_6ca.get_name()+" - "+exc.toString());
}
}
}
return _6cb;
}};
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(_6cc){
this.Window=_6cc;
this.Document=_6cc.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 _6cd=this.Document.selection.createRange();
if(_6cd.length){
this.SourceIndex=_6cd.item(0).sourceIndex;
}else{
this.StartBookmark=_6cd.getBookmark();
}
},restore:function(_6ce){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this.Document.body,this.HtmlText);
this.select(_6ce);
},select:function(_6cf){
if(null!=this.SourceIndex){
var _6d0=this.Document.body.createControlRange();
_6d0.addElement(this.Document.all(this.SourceIndex));
_6d0.select();
}else{
if(null!=this.StartBookmark){
var _6d0=this.Document.body.createTextRange();
_6d0.moveToBookmark(this.StartBookmark);
_6d0.select();
if(true==_6cf&&_6d0.collapse){
_6d0.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(_6d1){
if(_6d1){
return {anchorNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6d1.anchorNode),anchorOffset:_6d1.anchorOffset,focusNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6d1.focusNode),focusOffset:_6d1.focusOffset,isCollapsed:_6d1.isCollapsed};
}else{
return {};
}
},_moveToBookmark:function(_6d2,_6d3){
var _6d4=_6d3.anchorNodeBookmark.select();
var _6d5=_6d3.focusNodeBookmark.select();
_6d2.collapse(_6d4,_6d3.anchorOffset);
if(!_6d3.isCollapsed){
_6d2.extend(_6d5,_6d3.focusOffset);
}
}};
}
Telerik.Web.UI.Editor.RestorePoint.registerClass("Telerik.Web.UI.Editor.RestorePoint",null);
Telerik.Web.UI.Editor.SelectionBookmark=function(_6d6,node){
this.Window=_6d6;
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(_6d9,node){
var n,res;
for(var i=0;i<_6d9.childNodes.length;i++){
n=_6d9.childNodes[i];
res=this._findNodePath(n,node);
if(""!=res){
return ""+i+","+res;
}
if(n==node){
return ""+i;
}
}
return "";
},_findNode:function(_6de,_6df){
var arr=_6df.split(",");
for(var i=0;i<arr.length;i++){
_6de=_6de.childNodes[arr[i]];
}
return _6de;
}};
Telerik.Web.UI.Editor.SelectionBookmark.registerClass("Telerik.Web.UI.Editor.SelectionBookmark",null);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Selection=function(_6e2){
this._window=_6e2;
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(_6e3,_6e4){
_6e4=(_6e4==true);
if($telerik.isIE){
return this._executeIE(_6e3,_6e4);
}else{
return this._executeMozilla(_6e3,_6e4);
}
},_executeIE:function(_6e5,_6e6){
var _6e7=this._window.document;
var _6e8=_6e7.selection;
if(_6e8.type.toLowerCase()!="none"){
_6e8.createRange().execCommand("Delete");
}
if(_6e8.type.toLowerCase()!="none"){
_6e7.execCommand("Delete");
}
_6e7.body.setActive();
selRange=_6e8.createRange();
if(selRange&&selRange.length){
var _6e9=selRange.item(0);
if(_6e9&&_6e9.tagName=="BODY"){
var _6ea=_6e9.getElementsByTagName("FORM")[0];
if(_6ea){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_6ea,_6ea.innerHTML+_6e5);
}
}
}else{
var _6eb=selRange.duplicate();
_6eb.collapse(true);
_6e5=Telerik.Web.UI.Editor.Utils.getStoredOriginalPathsAndAttributes(_6e5);
selRange.pasteHTML(_6e5);
Telerik.Web.UI.Editor.Utils.restoreOriginalPathsAndAttributes(selRange.parentElement());
if(_6e6){
_6eb.setEndPoint("EndToEnd",selRange);
_6eb.select();
}
}
return true;
},_executeMozilla:function(_6ec,_6ed){
var oDoc=this._window.document;
var _6ef=oDoc.createElement("SPAN");
_6ef.innerHTML=_6ec;
var _6f0="radetempnode";
if(this.isOpera){
_6ef.setAttribute("id",_6f0);
}
this._insertNodeAtSelection(this._window,_6ef,true);
if(this.isOpera){
var _6f1=oDoc.createRange();
var _6f2=this._window.getSelection();
var span=oDoc.getElementById(_6f0);
_6f1.selectNodeContents(span);
var _6f4=_6f1.extractContents();
_6f1.selectNode(span);
var _6f5=_6f1.extractContents();
_6f1.insertNode(_6f4);
_6f2.addRange(_6f1);
return true;
}else{
if(!this.isSafari){
var _6f1=oDoc.createRange();
_6f1.selectNodeContents(_6ef);
var _6f4=_6f1.extractContents();
_6f1.selectNode(_6ef);
_6f1.deleteContents();
this._insertNodeAtSelection(this._window,_6f4,_6ed);
}
}
return true;
},_insertNodeAtSelection:function(win,_6f7,_6f8){
var _6f9=win.getSelection();
if(_6f9.rangeCount==0){
win.document.body.appendChild(_6f7);
return;
}
var _6fa=null;
if(_6f9.getRangeAt){
_6fa=_6f9.getRangeAt(0);
}else{
_6fa=win.document.createRange();
_6fa.setStart(_6f9.anchorNode,_6f9.anchorOffset);
_6fa.setEnd(_6f9.focusNode,_6f9.focusOffset);
}
if(_6f9.removeAllRanges){
_6f9.removeAllRanges();
}
_6fa.deleteContents();
var _6fb=$telerik.isSafari&&!$telerik.isSafari3?_6f9.baseNode:_6fa.startContainer;
var _6fc=$telerik.isSafari&&!$telerik.isSafari3?_6f9.baseOffset:_6fa.startOffset;
if($telerik.isSafari&&null==_6fb){
_6fb=win.document.body;
}
_6fa=win.document.createRange();
if((_6f7.nodeType==3)&&(_6fb.nodeType==3)){
_6fb.insertData(_6fc,_6f7.nodeValue);
_6fa.setEnd(_6fb,_6fc+_6f7.length);
if(_6f8){
_6fa.setStart(_6fb,_6fc);
}else{
_6fa.setStart(_6fb,_6fc+_6f7.length);
}
}else{
var _6fd;
if(_6fb.nodeType==3){
var _6fe=_6fb;
_6fb=_6fe.parentNode;
var _6ff=_6fe.nodeValue;
var _700=_6ff.substr(0,_6fc);
var _701=_6ff.substr(_6fc);
var _702=win.document.createTextNode(_700);
var _6fd=win.document.createTextNode(_701);
_6fb.insertBefore(_6fd,_6fe);
_6fb.insertBefore(_6f7,_6fd);
try{
_6fb.insertBefore(_702,_6f7);
}
catch(exc){
}
_6fb.removeChild(_6fe);
}else{
if(_6fb.childNodes.length>0){
_6fd=_6fb.childNodes[_6fc];
_6fb.insertBefore(_6f7,_6fd);
}else{
if(_6fb.tagName!="BODY"){
_6fb=_6fb.parentNode;
}
_6fb.appendChild(_6f7);
}
}
try{
if(_6f8){
_6fa.setStart(_6f7,0);
_6fa.setEnd(_6fd,0);
}else{
_6fa.setEnd(_6fd,0);
_6fa.setStart(_6fd,0);
}
}
catch(exc){
}
}
try{
_6f9.addRange(_6fa);
}
catch(exc){
}
},selectRange:function(_703){
if(!_703){
return;
}
var _704=this._window;
if(_703.select){
_703.select();
}else{
if(_704.getSelection){
var _705=_704.getSelection();
if(_705.removeAllRanges){
_705.removeAllRanges();
_705.addRange(_703);
}else{
var base=_703.baseNode;
if(null==base){
base=_704.document.body;
}
var _707=_703.extentNode;
if(null==_707){
_707=_704.document.body;
}
_705.setBaseAndExtent(base,_703.startOffset,_707,_703.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 _708=this._window.getSelection();
if(!_708||_708.rangeCount<1){
return null;
}
var rng=null;
if(_708.getRangeAt){
rng=_708.getRangeAt(0);
}else{
rng=this._window.document.createRange();
rng.setStart(_708.anchorNode,_708.anchorOffset);
rng.setEnd(_708.focusNode,_708.focusOffset);
}
return rng;
}
}
},getParentElement:function(){
var rng=this.getRange();
if(!rng){
return null;
}
if(rng.commonAncestorContainer){
var _70b=this._window.getSelection();
var _70c=rng.startContainer?rng.startContainer:_70b.baseNode;
var _70d=rng.endContainer?rng.endContainer:_70b.extentNode;
var _70e=rng.startOffset!=null?rng.startOffset:_70b.baseOffset;
var _70f=rng.endOffset!=null?rng.endOffset:_70b.extentOffset;
if(_70c==_70d&&(_70f-_70e)==1){
return _70b.anchorNode.childNodes[_70b.anchorOffset];
}else{
if(!rng.commonAncestorContainer.tagName){
if(this._window.document==rng.commonAncestorContainer&&_70b.baseNode){
return _70b.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 _711=oSel.focusNode;
if(!_711||_711.nodeType==1){
return false;
}
return (_711.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 _714=this._window.getSelection();
var rng=null;
if(null==_714){
return "";
}
if(_714.getRangeAt&&typeof (_714.rangeCount)!="undefined"&&_714.rangeCount==0){
return "";
}
if(_714.getRangeAt){
rng=_714.getRangeAt(0);
var _715=this._window.document.createElement("div");
var _716=rng.cloneContents();
if(_716){
_715.appendChild(_716);
return _715.innerHTML;
}else{
return "";
}
}else{
return _714;
}
}else{
return "";
}
}
},collapse:function(_717){
_717=(_717==true);
if(this._window.document.selection){
var rng=this._window.document.selection.createRange();
if(rng.collapse){
rng.collapse(_717);
rng.select();
}
}else{
if(this._window.getSelection){
var _719=this._window.getSelection();
if(!_719.isCollapsed){
if(_717){
_719.collapseToStart();
}else{
_719.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(_71a,_71b){
var rs=new Telerik.Web.UI.EditorShortCut(_71a,_71b);
rs.HashValue=this._getShortCutHashValue(rs);
this._shortcuts[rs.HashValue]=rs;
},removeShortCut:function(_71d){
var _71e=this._findByName(_71d);
if(_71e){
this._shortcuts[_71e.HashValue]=null;
}
},setShortCut:function(_71f,_720){
this.removeShortCut(_71f);
this.addShortCut(_71f,_720);
},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(_722,_723,_724,_725,_726,_727,_728){
var _729=this._getHashValue(_722,_723,_724,_725,_726,_727,_728);
return this._shortcuts[_729];
},_getHashValue:function(_72a,_72b,_72c,_72d,_72e,_72f,_730){
var _731=_72a&65535;
var _732=0;
_732|=(_72b?(1<<0):0);
_732|=(_72d?(1<<2):0);
_732|=(_72f?(1<<4):0);
_731|=(_732<<16);
return _731;
},_getShortCutHashValue:function(_733){
return this._getHashValue(_733.KeyCode,_733.CtrlKey,_733.LeftCtrlKey,_733.ShiftKey,_733.LeftShiftKey,_733.AltKey,_733.LeftAltKey);
},_findByName:function(_734){
var _735;
for(var _736 in this._shortcuts){
_735=this._shortcuts[_736];
if(null!=_735&&_735._name==_734){
return _735;
}
}
return null;
}};
Telerik.Web.UI.EditorShortCut=function(_737,_738){
this._name=_737;
this.setShortCut(_738);
};
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(_739){
this._name=_739;
},setShortCut:function(_73a){
this._parseShortcutString(_73a);
},_parseShortcutString:function(_73b){
if("string"==typeof (_73b)){
this.CtrlKey=false;
this.LeftCtrlKey=false;
this.ShiftKey=false;
this.LeftShiftKey=false;
this.AltKey=false;
this.LeftAltKey=false;
this.KeyCode=0;
_73b=_73b.replace(/\s*/gi,"");
_73b=_73b.replace(/\+\+/gi,"+PLUS");
var _73c=_73b.split("+");
var _73d="";
for(var i=0;i<_73c.length;i++){
_73d=_73c[i].toUpperCase();
switch(_73d){
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=_73d.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(_73f,_740,_741){
if(typeof (this._controls[_73f])=="undefined"){
this._controls[_73f]={};
}
if(typeof (this._controls[_73f][_740])=="undefined"){
this._controls[_73f][_740]={};
}
var _742=this._controls[_73f][_740];
for(var _743 in _741){
if(typeof (_741[_743])=="string"){
_742[_743]=_741[_743];
}
}
return _742;
}};
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(_744,tool,_746){
Telerik.Web.UI.EditorCommandEventArgs.initializeBase(this);
this._name=this._commandName=_744;
this._tool=tool;
this._value=_746;
this.value=_746;
};
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(_748){
Telerik.Web.UI.RadEditor.initializeBase(this,[_748]);
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(_749){
this.get_events().addHandler("spellCheckLoaded",_749);
},remove_spellCheckLoaded:function(_74a){
this.get_events().removeHandler("spellCheckLoaded",_74a);
},get_ajaxSpellCheck:function(){
return this._ajaxSpellCheck;
},set_ajaxSpellCheck:function(_74b){
this._ajaxSpellCheck=_74b;
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(_74d){
this._spellAllowAddCustom=_74d;
},get_spellCheckJSON:function(){
return this._spellCheckJSON;
},set_spellCheckJSON:function(_74e){
this._spellCheckJSON=_74e;
},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(_750,args){
},raiseEvent:function(_752,args){
if(_752!="selectionChange"||this.get_mode()==Telerik.Web.UI.EditModes.Design){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"raiseEvent",[_752,args]);
}
},_initializeToolProvider:function(){
var _754=this;
var _755=_754.get_toolProviderID();
if(_755&&$find(_755)){
var _756=$find(_755);
var _757=_756.get_dialogOpener();
_754.set_dialogOpener(_757);
var _758=_756.get_contextMenusJSON();
if(_758&&_758.concat){
_754.set_contextMenusJSON(_758.concat([]));
}
var _759=_756.get_modulesJSON();
if(_759&&_759.concat){
_754.set_modulesJSON(_759.concat([]));
}
var root=this.get_toolContainer();
root.innerHTML="";
this._toolJSON=[];
var html=_756.get_toolHTML();
root.innerHTML=html;
var json=_756.get_toolJSON().concat([]);
this.set_toolJSON(json);
if(_756.get_spellCheckJSON){
_754.set_spellCheckJSON(_756.get_spellCheckJSON());
}
if(_756.get_ajaxSpellCheckScriptReference){
var ref=_756.get_ajaxSpellCheckScriptReference();
if(ref){
_754.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 _75f=this;
window.setTimeout(function(){
if($telerik.isIE){
var area=_75f.get_contentArea();
if(!area){
return;
}
try{
var _761=Telerik.Web.UI.Editor.Utils.storeBrowserPosition();
var r=area.createTextRange();
var _763=document.body.createTextRange();
if(_761&&_761.y>0){
_763.moveToElementText(_75f.get_contentAreaElement());
}else{
_763.moveStart("textedit",_763.text.length);
}
_763.collapse(true);
_763.select();
if(_761&&_761.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 _764=this.get_mainTable();
this._originalHeight=_764.style.height;
this._initializeLocalization();
this._addFilters();
this._addDefaultShortCuts();
this._createUI();
this._createTools();
this._makeResizeable(true);
var _765=$get(this.get_id()+"ContentHiddenTextarea");
if(_765){
_765.setAttribute("id",this.get_id());
this._contentHiddenTextarea=_765;
}
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 _766=$get(this.get_id()+"Module");
_766.style.display="none";
var _767=this;
window.setTimeout(function(){
_767._modulesManager.initialize();
_766.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 _769=this.get_element().getAttribute("accessKey");
if(_769){
this.get_element().removeAttribute("accessKey");
var _76a=document.createElement("input");
_76a.setAttribute("name",this.get_id()+"EditorAccessKey");
_76a.setAttribute("type","text");
_76a.setAttribute("id",this.get_id()+"EditorAccessKey");
_76a.setAttribute("accessKey",_769);
this._accessKeyTextbox=_76a;
$addHandlers(this._accessKeyTextbox,{"focus":this.setFocus},this);
var _76b=document.createElement("div");
_76b.style.width="0px";
_76b.style.height="0px";
_76b.style.overflow="hidden";
_76b.appendChild(this._accessKeyTextbox);
this.get_element().appendChild(_76b);
}
},_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 _76c=this;
this.attachEventHandler("keydown",function(e){
if(!_76c._isKeyUpButton(e)){
_76c._resizeContentArea(e);
}
});
this.attachEventHandler("keyup",function(e){
if(_76c._isKeyUpButton(e)||(e.keyCode==13&&!_76c.isIE)){
_76c._resizeContentArea(e);
}
});
this.add_selectionChange(Function.createDelegate(this,this._resizeContentArea));
this._resizeContentArea();
}),0);
},_isKeyUpButton:function(e){
var _770=e.keyCode;
if(_770==8||_770==46){
return true;
}
return false;
},_getCurrentFontSize:function(){
var o=this.getSelectedElement();
var _772=parseInt($telerik.getCurrentStyle(o,"fontSize"));
return _772;
},_resizeContentArea:function(e){
var body=this.isIE?this._document.body:this._document.documentElement;
var _775=this._contentAreaElement;
var _776=_775.parentNode;
var _777=this._initialContentHeight;
var _778=_775.offsetHeight;
var _779=body.scrollHeight+(e&&e.keyCode==13&&this.isIE?this._getCurrentFontSize():0);
if(_779==_778){
return;
}
if((_777==_778)&&(_779<=_777)){
return;
}
var _77a=(_779>_777)?_779:_777;
_775.style.height=_77a+"px";
if(_779>_778){
_776.style.height=parseInt(_779)+"px";
}else{
var _77b=this.get_element();
var _77c=_77b.offsetHeight-(_776.offsetHeight-_775.offsetHeight);
if(_775.style.height!="100%"){
_776.style.height="";
this._updateEditorSize(_77c);
}
return;
}
this._updateEditorSize(null,true);
},_makeResizeable:function(_77d){
if(this._resizeExtender){
this._resizeExtender.dispose();
this._resizeExtender=null;
}
if(!_77d){
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 _77e={se:this._bottomResizer};
this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._rootElement,_77e,this._tableElement);
},_getInvisibleParent:function(){
return Telerik.Web.UI.Editor.Utils.getInvisibleParent(this.get_element());
},isVisible:function(){
return (this._getInvisibleParent()==null);
},_fixIEVisibilityProblems:function(_77f){
if(!this.isIE){
return;
}
if(_77f){
var _780=this._getInvisibleParent();
if(_780){
this._onIEParentVisibilityChangeDelegate=Function.createDelegate(this,this._onIEParentVisibilityChange);
this._invisibleParent=_780;
$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(_781){
if(this.isIE){
return;
}
if(_781){
var _782=this._getInvisibleParent();
if(_782){
this._invisibleParent=_782;
this._onMozillaParentVisibilityChangeDelegate=Function.createDelegate(this,this._onMozillaParentVisibilityChange);
_782.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 _784=$telerik.getCurrentStyle(this._invisibleParent,"display");
if(_784!="none"){
this.raiseEvent("firstShow");
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this._updateEditorSize();
this._fixIEVisibilityProblems(false);
}
}
},_onMozillaParentVisibilityChange:function(e){
if(e.attrName=="style"||e.attrName=="class"){
var _786=e.target;
if((e.currentTarget==e.originalTarget)&&"none"!=$telerik.getCurrentStyle(_786,"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 _788=$telerik.isDescendantOrSelf(e.target,this.get_element());
if(_788){
this.onParentNodeChanged();
}
},onParentNodeChanged:function(){
if(!$telerik.isIE){
var _789=this.get_html(true);
var _78a=this.get_contentAreaElement();
this._contentWindow=_78a.contentWindow;
this._setContentAreaHtml(_789,true);
this.set_editable(true);
}
},onResizeStart:function(){
this._resizeSelection=this.getSelection().getRange();
},onResizeEnd:function(){
if(!this.isIE){
return;
}
this.setActive();
if(this._resizeSelection){
var _78b=this._resizeSelection.parentElement();
if(_78b&&(this.get_document()==_78b.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(_78c,_78d){
if(Telerik.Web.UI.Editor.Utils.selectElement(this.get_contentWindow(),_78c)&&false!=_78d){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},undo:function(_78e){
this._commandsManager.undo(_78e);
},redo:function(_78f){
this._commandsManager.redo(_78f);
},executeCommand:function(_790,_791,_792){
if(!_790.get_window()){
_790.set_window(this.get_contentWindow());
}
if(false!=_791&&!this.isOpera){
this.setFocus();
}
this._commandsManager.execute(_790,_792);
},executeBrowserCommand:function(_793,_794,_795,_796){
var _797=this._localization[_793];
this.executeCommand(new Telerik.Web.UI.Editor.BrowserCommand(_797,this._contentWindow,_793,_795));
this.setActive();
this.setFocus();
if(true==_796){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},createElement:function(_798,_799,_79a,sId,_79c,_79d){
var _79e=this._document.createElement(_798);
if(_799){
_79e.style.width=_799;
}
if(_79a){
_79e.style.height=_79a;
}
if(null!=sId){
_79e.id=sId;
}
if(null!=_79c){
_79e.name=_79c;
}
if(null!=_79d){
_79e.value=_79d;
}
return _79e;
},createRestorePoint:function(){
return new Telerik.Web.UI.Editor.RestorePoint(this._contentWindow);
},getToolState:function(_79f){
if(_79f=="Undo"){
return this.get_commandsManager().isUndoAvailable()?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
}else{
if(_79f=="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[_79f];
if(oCmd&&oCmd.getState){
return oCmd.getState(this._contentWindow);
}
}
}
},getToolValue:function(_7a1){
var oCmd=Telerik.Web.UI.Editor.UpdateCommandsArray[_7a1];
if(oCmd&&oCmd.getValue){
return oCmd.getValue(this._contentWindow);
}else{
if(_7a1=="RealFontSize"){
var o=this.getSelectedElement();
if(o){
var _7a4=null;
try{
_7a4=$telerik.getCurrentStyle(o,"fontSize","");
}
catch(exc){
}
if(_7a4){
var _7a5=parseFloat(_7a4);
if(_7a5>parseInt(_7a4)){
if(_7a4.indexOf("px")>-1){
_7a4=parseInt(_7a4)+"px";
}
}
}
return _7a4;
}
}
}
},_addFilters:function(){
var _7a6=this.get_filtersManager();
var _7a7=this.get_contentFilters();
var _7a8=Telerik.Web.UI.EditorFilters;
_7a6.clear();
var _7a9=_7a7&_7a8.ConvertToXhtml;
_7a6.set_enableXhtmlFilter(_7a9);
if(_7a7&_7a8.RemoveScripts){
_7a6.add(new Telerik.Web.UI.Editor.StripScriptsFilter());
}
if(_7a7&_7a8.EncodeScripts){
_7a6.add(new Telerik.Web.UI.Editor.EncodeScriptsFilter());
}
if(_7a7&_7a8.FixUlBoldItalic){
_7a6.add(new Telerik.Web.UI.Editor.FixUlBoldItalic());
}
_7a6.add(new Telerik.Web.UI.Editor.FixNestedLists());
if(_7a7&_7a8.ConvertFontToSpan){
_7a6.add(new Telerik.Web.UI.Editor.ConvertFontToSpanFilter());
}
if(_7a7&_7a8.FixEnclosingP){
_7a6.add(new Telerik.Web.UI.Editor.FixEnclosingP());
}
if($telerik.isIE){
_7a6.add(new Telerik.Web.UI.Editor.IEKeepObjectParamsFilter());
_7a6.add(new Telerik.Web.UI.Editor.IEKeepCommentsFilter());
_7a6.add(new Telerik.Web.UI.Editor.IEFixEmptyParagraphs());
if(_7a7&_7a8.IECleanAnchors){
_7a6.add(new Telerik.Web.UI.Editor.IECleanAnchorsFilter());
}
}
if(!$telerik.isIE&&!$telerik.isOpera){
if(!$telerik.isSafari){
_7a6.add(new Telerik.Web.UI.Editor.MozillaKeepFlashString(this.get_mozillaFlashOverlayImage()));
_7a6.add(new Telerik.Web.UI.Editor.MozillaKeepFlash());
}
_7a6.add(new Telerik.Web.UI.Editor.MozillaKeepStylesString());
_7a6.add(new Telerik.Web.UI.Editor.MozillaKeepStylesDom());
if(_7a7&_7a8.MozEmStrong){
_7a6.add(new Telerik.Web.UI.Editor.MozEmStrongFilter());
}
}
_7a6.add(new Telerik.Web.UI.Editor.StripJunkFilter());
if(_7a7&_7a8.MakeUrlsAbsolute){
_7a6.add(new Telerik.Web.UI.Editor.MakeUrlsAbsolute());
}
_7a6.add(new Telerik.Web.UI.Editor.RemoveExtraBrakes());
if(_7a7&_7a8.IndentHTMLContent){
_7a6.add(new Telerik.Web.UI.Editor.IndentHTMLContentFilter());
}
},addShortCut:function(_7aa,_7ab){
if(this._shortCutManager){
this._shortCutManager.addShortCut(_7aa,_7ab);
}
},removeShortCut:function(_7ac){
if(this._shortCutManager){
this._shortCutManager.removeShortCut(_7ac);
}
},setShortCut:function(_7ad,_7ae){
if(this._shortCutManager){
this._shortCutManager.setShortCut(_7ad,_7ae);
}
},_addDefaultShortCuts:function(){
var _7af=[["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<_7af.length;i++){
this.addShortCut(_7af[i][0],_7af[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(_7b1,_7b2){
if(_7b1.startsWith("on")){
_7b1=_7b1.replace("on","");
}
$telerik.addExternalHandler(this._document,_7b1,_7b2);
var _7b3=this._contentAreaEventHandlers;
if(!_7b3[_7b1]){
_7b3[_7b1]=[];
}
var _7b4=_7b3[_7b1];
_7b4[_7b4.length]=_7b2;
},detachEventHandler:function(_7b5,_7b6){
if(_7b5.startsWith("on")){
_7b5=_7b5.replace("on","");
}
$telerik.removeExternalHandler(this._document,_7b5,_7b6);
},_detachEvents:function(){
var _7b7=this._contentAreaEventHandlers;
for(var _7b8 in _7b7){
var _7b9=_7b7[_7b8];
if(_7b9.length!=null){
for(var i=0;i<_7b9.length;i++){
var _7bb=_7b9[i];
if(typeof (_7bb)=="function"){
try{
this.detachEventHandler(_7b8,_7bb);
}
catch(e){
}
}
}
_7b9=[];
}
}
this._contentAreaEventHandlers={};
this._attachIEBodyHandlers(false);
},get_TopZone:function(){
return $get(this.get_id()+"Top");
},_createTools:function(){
if(!this._toolAdapter){
var _7bc=this.get_toolContainer();
var _7bd=eval(this._toolAdapterType);
this._toolAdapter=$create(_7bd,{"editor":this,"toolJSON":this.get_toolJSON()},{"toolClick":this._onToolClickDelegate},null,_7bc);
if(this.isIE){
if(this.get_toolbarMode()==Telerik.Web.UI.EditorToolbarMode.Default){
_7bc.style.overflow="";
}
this._updateEditorSize();
}
}
},_onToolClick:function(tool,args){
this.fire(tool.get_name(),args);
},getContextMenuByTagName:function(_7c0){
if(this._toolAdapter&&this._toolAdapter.getContextMenuByTagName){
return this._toolAdapter.getContextMenuByTagName(_7c0);
}
},getToolByName:function(_7c1){
if(this._toolAdapter){
return this._toolAdapter.getToolByName(_7c1);
}
return null;
},getLocalizedString:function(name,_7c3){
var str=this.get_localization()[name];
if(null==str){
str=this.get_localization()[name.toLowerCase()];
}
if(null==str){
str=_7c3;
}
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 _7c6=this.get_contentArea();
if(_7c6&&_7c6.setActive){
_7c6.setActive();
}
},set_visible:function(_7c7){
var _7c8=this.get_element();
if(_7c8){
_7c8.style.display=_7c7?"":"none";
}
this.set_editable(_7c7);
},enableEditing:function(_7c9,_7ca,_7cb){
var _7cc=this.get_toolAdapter();
var _7cd=Telerik.Web.UI.EditingOptions;
var _7ce=function(){
};
if(!_7ca){
_7ca=Telerik.Web.UI.EditingOptions.All;
}
this._editingOptions=_7ca;
this._optionalIgnoredTools=_7cb;
if(_7ca&_7cd.ContextMenus){
if(_7cc){
_7cc.enableContextMenus(_7c9);
}
}
if(_7ca&_7cd.EditModes){
if(!_7c9){
this._originalEditModeRef=this.set_mode;
this.set_mode=_7ce;
}else{
if(this._originalEditModeRef){
this.set_mode=this._originalEditModeRef;
this._originalEditModeRef=null;
}
}
}
if(_7ca&_7cd.Tools){
if(_7cc){
if(!_7c9){
_7cc.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Disabled);
if(_7cb){
var _7cf=[];
for(var item in _7cb){
var tool=_7cc.getToolByName(item);
if(tool){
_7cf[_7cf.length]=tool;
}
}
_7cc.setToolState(_7cf);
}
this._originalSetToolStateRef=_7cc.setToolState;
_7cc.setToolState=_7ce;
}else{
_7cc.setToolState=this._originalSetToolStateRef;
this._originalSetToolStateRef=null;
}
}
}
if(_7ca&_7cd.Modules){
var _7d2=this._modulesManager;
if(_7d2){
_7d2.setModulesVisible(_7c9);
}
}
if(_7ca&_7cd.Typing){
if(!_7c9){
this._disableTypingDelegate=$telerik.cancelRawEvent;
this.attachEventHandler("keypress",this._disableTypingDelegate);
}else{
if(this._disableTypingDelegate){
this.detachEventHandler("keypress",this._disableTypingDelegate);
this._disableTypingDelegate=null;
}
}
}
if(_7ca&_7ca.Tab){
if(!_7c9){
this.removeShortCut("InsertTab");
}else{
this.setShortCut("InsertTab","TAB");
}
}
if(_7c9){
if(_7cc){
_7cc.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Off);
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},set_editable:function(_7d3){
if($telerik.isIE||$telerik.isOpera){
var oEd=this;
window.setTimeout(function(){
try{
oEd._document.body.setAttribute("contentEditable",""+_7d3);
oEd._document.execCommand("2D-Position",false,true);
}
catch(ev){
}
},0);
}else{
var oEd=this;
window.setTimeout(function(){
try{
oEd._document["designMode"]=_7d3?"on":"off";
if(_7d3){
oEd._document.execCommand("UseCSS",false,true);
}
}
catch(e){
}
},0);
}
},get_editable:function(){
if($telerik.isIE||$telerik.isOpera){
return this._document.body.contentEditable;
}else{
return (this._document["designMode"]=="on");
}
},enableContentArea:function(_7d5){
if(this.isIE){
this.get_document().body.setAttribute("contentEditable",""+_7d5);
}
},showExternalDialog:function(url,_7d7,_7d8,_7d9,_7da,_7db,_7dc,_7dd,_7de,_7df,_7e0){
var _7e1=this.getSelection().getRange();
var _7e2=this;
var _7e3=function(_7e4,args){
window.setTimeout(function(){
_7e2.getSelection().selectRange(_7e1);
if(_7da){
var _7e6=_7da(_7e4,args);
if(false==_7e6){
return;
}
_7e2.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7e2.setFocus();
},50);
};
this.get_dialogOpener().openUrl(url,_7d7,_7d8,_7d9,_7e3,_7db,_7dc,_7dd,_7de,_7df,_7e0);
},showDialog:function(_7e7,_7e8,_7e9){
this._currentRange=this.getSelection().getRange();
var _7ea=this;
var _7eb=function(_7ec,args){
window.setTimeout(function(){
_7ea.getSelection().selectRange(_7ea._currentRange);
if(_7e9){
var oRes=_7e9(_7ec,args);
if(false==oRes){
return;
}
_7ea.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7ea.setFocus();
},50);
};
this.get_dialogOpener().open(_7e7,_7e8,_7eb);
if(this.isIE){
var wnd=this.get_dialogOpener()._getDialogContainer(_7e7);
if(!wnd||wnd._DRAG_ATTACHED){
return;
}
wnd._DRAG_ATTACHED=true;
wnd.add_dragEnd(function(){
_7ea.getSelection().selectRange(_7ea._currentRange);
});
}
},_getModeButtonsWrapper:function(){
return this._getChildElement("ModesWrapper");
},_registerModeChangeHandler:function(_7f0){
if(_7f0){
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 _7f2=this.get_mode();
var _7f3=Telerik.Web.UI.Editor.Utils.getElementParentByTag(e.target,"LI");
if(_7f3){
var _7f4=Telerik.Web.UI.EditModes;
var _7f5=Sys.UI.DomElement;
var a=_7f3.getElementsByTagName("A")[0];
if(_7f5.containsCssClass(a,"rade_mode_html")){
_7f2=_7f4.Html;
}else{
if(_7f5.containsCssClass(a,"rade_mode_design")){
_7f2=_7f4.Design;
}else{
_7f2=_7f4.Preview;
}
}
}
if(_7f2!=this.get_mode()){
this.set_mode(_7f2);
}
return $telerik.cancelRawEvent(e);
},_changeModeUI:function(mode){
var _7f8=Sys.UI.DomElement;
var _7f9=Telerik.Web.UI.EditModes;
var _7fa="rade_mode_";
switch(mode){
case _7f9.Html:
_7fa+="html";
break;
case _7f9.Design:
_7fa+="design";
break;
case _7f9.Preview:
_7fa+="preview";
break;
}
var _7fb=this._getModeButtonsWrapper();
var as=_7fb.getElementsByTagName("A");
for(var i=0;i<as.length;i++){
var a=as[i];
_7f8.removeCssClass(a,"rade_mode_selected");
if(_7f8.containsCssClass(a,_7fa)){
_7f8.addCssClass(a,"rade_mode_selected");
}
}
},_isEditModeEnabled:function(_7ff){
return _7ff&this._editModes?true:false;
},get_mode:function(){
return this._mode;
},set_mode:function(_800){
this._setEditableDelegate=Function.createDelegate(this,function(){
this.remove_editReady(this._setEditableDelegate);
var _801=(this._mode==_802.Design);
this.set_editable(_801);
this.toggleEnhancedEdit(_801);
this._setEditableDelegate=null;
});
this.add_editReady(this._setEditableDelegate);
var _803=this._mode;
var _802=Telerik.Web.UI.EditModes;
if(_803==_802.Html||_800==_802.Html){
var html=this.get_html(true);
this._mode=_800;
this._showTextArea(this._mode==_802.Html);
this.set_html(html);
}else{
this._mode=_800;
this._showTextArea(this._mode==_802.Html);
}
this._changeModeUI(_800);
if(this._mode!=_802.Preview){
this.setFocus();
if(this.isFirefox&&(!this._document||!this._document.body)){
}else{
this.set_editable(true);
}
if(this._mode==_802.Design){
this.toggleEnhancedEdit(true);
}
}else{
this.set_editable(false);
this.toggleEnhancedEdit(false);
}
this.setFocus();
var _805=this.get_id();
var _806=this.get_mainTable();
var _807=_806.offsetHeight+"px";
this.raiseEvent("modeChange",Sys.EventArgs.Empty);
this._updateEditorSize(_807);
},_getTextIframe:function(){
if(!this._textIframe){
var _808=this.get_contentAreaElement();
if(_808){
this._textIframe=_808.cloneNode(true);
this._textIframe.style.position="absolute";
var _809=this._textIframe.style;
_809.height="2px";
_809.width="2px";
_808.parentNode.appendChild(this._textIframe);
var doc=this._textIframe.contentWindow.document;
doc.designMode="off";
var _80b=doc.open("text/html","replace");
var _80c="<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 (_80b)=="undefined"){
_80b=doc;
}
_80b.write(_80c);
_80b.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(_80e){
var area=this._getTextIframe();
var _810=this.get_contentAreaElement();
if(_80e){
if($telerik.isSafari){
_810.style.width="0px";
_810.style.height="0px";
}else{
_810.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){
_810.style.width="100%";
_810.style.height="100%";
}else{
_810.style.display="";
}
area.style.display="none";
}
},_setContentAsText:function(_811){
var area=this._getTextArea();
if(area){
area.value=_811;
}
},_getContentAsText:function(){
var area=this._getTextArea();
if(area&&area.value){
var _814=area.value;
return _814;
}
return "";
},set_html:function(_815,_816,_817){
var _818=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_818.Html){
var cmd=new Telerik.Web.UI.Editor.GenericCommand(_816?_816:"Set HTML",this.get_contentWindow());
this._setContentAreaHtml(_815);
this.executeCommand(cmd,_817);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}else{
this._setContentAsText(_815);
}
},get_html:function(_81a){
var _81b=null;
var _81c="";
var mode=this.get_mode();
var _81e=Telerik.Web.UI.EditModes;
if(mode==_81e.Html){
return this._getContentAsText();
}else{
if(this.get_fullPage()){
if(this._document){
_81b=this._document.getElementsByTagName("HTML")[0];
_81b=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(_81b);
var _81f=this._getAllSheets(_81b);
for(var i=0;i<_81f.length;i++){
var _821=_81f[i];
var _822=_821.getAttribute("id");
if(_822&&_822.indexOf("RADEDITORSTYLESHEET")==0){
_821.parentNode.removeChild(_821);
}
}
if($telerik.isIE||$telerik.isOpera){
_81b.getElementsByTagName("BODY")[0].removeAttribute("contentEditable");
}
}
}else{
if(this.get_contentArea()){
if(true==_81a){
_81b=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(this.get_contentArea());
if($telerik.isIE||$telerik.isOpera){
_81b.removeAttribute("contentEditable");
}
}else{
_81b=this.get_contentArea();
}
}
}
}
if(_81b){
if(true==_81a){
_81c=this.get_filtersManager().getHtmlContent(_81b);
}else{
_81c=_81b.innerHTML;
}
}
if(_81c.indexOf("<body")==0){
_81c=_81c.trim();
_81c=_81c.substring(_81c.indexOf(">")+1,_81c.length-7);
_81c=_81c.trim();
}
if(this.get_fullPage()&&this._doctypeString){
_81c=this._doctypeString+"\n"+_81c;
}
return _81c;
},set_initialContent:function(){
this._initialContent=this.get_html(true);
},get_initialContent:function(){
return this._initialContent;
},get_text:function(){
var _823=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_823.Html){
var _824="";
var _825=this.get_contentArea();
if(_825){
if(_825.innerText){
_824=_825.innerText;
}else{
if(_825.textContent!=null){
_824=_825.textContent;
}else{
_824=_825.innerHTML.replace(/<\/?[^>]*>/ig,"");
}
}
}
return _824;
}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 _828=oDoc.getElementsByTagName("link");
var _829=oDoc.getElementsByTagName("style");
var _82a=[];
for(var x=0;_828[x];x++){
var rel=_828[x].rel?_828[x].rel:_828[x].getAttribute("rel");
if(typeof (rel)=="string"&&rel.toLowerCase().indexOf("style")+1){
Array.add(_82a,_828[x]);
}
}
for(var x=0;_829[x];x++){
Array.add(_82a,_829[x]);
}
return _82a;
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _82f=str.lastIndexOf(".");
if(_82f==-1){
return "";
}
var _830=str.indexOf(" ",_82f);
if(-1==_830){
_830=str.indexOf(":",_82f);
}
if(-1==_830){
_830=str.length;
}
return str.substring((_82f+1),_830);
},_createCssFilterObject:function(){
if(this._cssClassesHash){
return;
}
var _831=this.get_cssClasses();
if(_831&&_831.length>0){
var obj={};
var _833=_831.length;
for(var i=0;i<_833;i++){
var oKey=_831[i][0];
var oVal=_831[i][1];
obj[oKey.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})]=oVal;
}
this._cssClassesHash=obj;
}
},_getFilteredCssClasses:function(_838){
this._createCssFilterObject();
if(_838&&this._cssClassesHash){
var _839=[];
var _83a=_838.length;
for(var _83b=0;_83b<_83a;_83b++){
var _83c=_838[_83b];
if(outAlias=this._checkCssFilter(_83c[1].selectorText)){
_83c[2]=outAlias;
_839[_839.length]=_83c;
}
}
return _839;
}else{
return _838;
}
},_checkCssFilter:function(_83d){
if(!_83d||!this._cssClassesHash){
return null;
}
return this._cssClassesHash[_83d.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})];
},getCssArray:function(_83f){
var _840=this.get_document();
var _841=[];
for(var i=0;i<_840.styleSheets.length;i++){
var _843=_840.styleSheets[i];
this._getStyleSheetRules(_841,_843,_83f);
}
_841=this._getFilteredCssClasses(_841);
return _841;
},_getStyleSheetRules:function(_844,_845,_846){
var _847=_845.href;
if(_847&&_847.indexOf("WebResource.axd?")>-1){
return;
}
var _848=(_845.rules)?_845.rules:_845.cssRules;
if($telerik.isIE&&_845.imports){
for(var k=0;k<_845.imports.length;k++){
this._getStyleSheetRules(_844,_845.imports[k],_846);
}
}
for(var j=0;j<_848.length;j++){
var _84b=_848[j];
if(_84b&&_84b.cssText){
var text=_84b.cssText.toLowerCase();
if(text.indexOf("@import")>=0&&_84b.parentStyleSheet&&_84b.styleSheet&&_84b.parentStyleSheet!=_84b.styleSheet){
this._getStyleSheetRules(_844,_84b.styleSheet,_846);
continue;
}
}
var str=_84b&&_84b.selectorText?_84b.selectorText:"";
var _84e=str.lastIndexOf(".");
if(_84e<0){
continue;
}
var _84e=str.lastIndexOf(":");
if(_84e>0){
continue;
}
var _84f=this._getClassName(_84b);
_844[_844.length]=[_84f,_84b];
}
},copyStyleSheets:function(_850,_851){
if(null==_850&&null==_851){
return;
}
var _852=0;
var _853=null;
if(_851.styleSheets.length==0){
if(_851.createStyleSheet){
_851.createStyleSheet();
}else{
css=_851.createElement("style");
css.media="all";
css.type="text/css";
var _854=_851.getElementsByTagName("head")[0];
_854.appendChild(css);
_853=css;
}
}
if(_851.styleSheets[0]){
_853=_851.styleSheets[0];
}
for(var i=0;i<_850.styleSheets.length;i++){
try{
var _856=_850.styleSheets[i];
var _857=_856.href;
var _858=false;
if($telerik.isFirefox){
if(_856.ownerNode&&_856.ownerNode.tagName.toLowerCase()=="style"){
_858=true;
}
}
if(_857&&!_858){
continue;
}
var _859=(_856.rules)?_856.rules:_856.cssRules;
for(var j=0;j<_859.length;j++){
var _85b=_859[j];
if(_853.addRule){
var _85c=_85b.selectorText;
var oCss=_85b.style.cssText;
if(oCss&&_85c){
_853.addRule(_85c,oCss,_852);
}
}else{
if(_853.insertRule){
_853.insertRule(_85b.cssText,_852);
}else{
var oCss=_85b.selectorText+"{"+_85b.style.cssText+"}";
var _85e=_851.createTextNode(oCss);
_853.appendChild(_85e);
}
}
_852++;
}
}
catch(exc){
}
}
},_setContentAreaHtml:function(_85f,_860){
var _861=this.get_filtersManager().getDesignContent(_85f);
this.set_contentHiddenTextareaValue(_861);
var _862=null;
if(-1!=_861.toLowerCase().indexOf("<html")){
this.set_fullPage(true);
_862=_861;
var _863=new RegExp("(<!DOCTYPE(.|\\n)*?>)(.|\\n)*?","g");
this._doctypeString=(_862.match(_863))?_862.match(_863)[0]:"";
}else{
this.set_fullPage(false);
}
if(null!=_862||true==_860){
var _864=this;
var _865=function(){
_866=false;
try{
_864._document=_864._contentAreaElement.contentWindow.document;
_864._contentWindow=_864._contentAreaElement.contentWindow;
_864._contentArea=_864._document.body;
_864.get_filtersManager().getDesignContentDom(_864.get_contentArea());
var _867=1;
Telerik.Web.UI.Editor.Utils.addStyleSheet(_864.get_contentAreaCssFile(),_864._document,_864._getUniqueStyleSheetId(0));
var _868=_864.get_cssFiles();
if(_868.length>0){
for(var i=0;i<_868.length;i++){
var _86a=_864._getUniqueStyleSheetId(_867++);
Telerik.Web.UI.Editor.Utils.addStyleSheet(_868[i],_864._document,_86a);
}
}else{
if(!_864._fullPage){
_864.copyStyleSheets(document,_864._document);
var _86b=_864._getAllSheets(document);
for(var i=0;i<_86b.length;i++){
var _86a=_864._getUniqueStyleSheetId(_867++);
var _86c=_86b[i];
if(_86c.tagName=="LINK"){
var _86d=_86c.href;
if(_86d&&_86d.indexOf("WebResource.axd?")>-1){
continue;
}
if(_86d){
Telerik.Web.UI.Editor.Utils.addStyleSheet(_86c.getAttribute("href"),_864._document,_86a);
}
}else{
if(_86c.tagName=="STYLE"){
}
}
}
}
}
var _86e=Telerik.Web.UI.Editor.PopupController;
if(_86e){
_86e.detachFromDocument(_864._document);
_86e.attachToDocument(_864._document);
}
_864._initEvents();
if(_864.isVisible()){
_864.raiseEvent("firstShow");
}
if(_864.get_mode()!=Telerik.Web.UI.EditModes.Preview){
_864.set_editable(true);
}else{
_864.set_editable(false);
}
_864.toggleEnhancedEdit(true);
if(_864._document&&_864._document.body){
_864.raiseEvent("editReady",Sys.EventArgs.Empty);
}
}
catch(e){
}
};
if($telerik.isFirefox){
$addHandler(this._contentAreaElement,"load",function(){
if(_866){
_865();
}
});
}
if(!_862){
_862="<head><style></style></head><body>"+_861+"</body>";
}
try{
var _86f=this._contentAreaElement.contentWindow.document;
_86f.open();
_86f.write(_862);
_86f.close();
var _866=false;
if(_86f.body){
_865();
}else{
_866=true;
}
}
catch(e){
}
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this._contentArea,_861);
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 _871=$get(id+"Center");
var _872=this.get_contentAreaElement();
_872.style.display="none";
var _873=_871.offsetHeight;
_871.appendChild(_872);
_872.style.height="100%";
_872.style.display="";
if(!$telerik.isIE&&_873<160&&_871.offsetHeight>_873+2){
_871.style.height=_873+"px";
}
this._created=true;
},_updateEditorSize:function(_874,_875){
var _876=this._tableElement;
var _877=_874?_874:_876.style.height;
if(true==_875){
_877=_876.offsetHeight+"px";
}
if(parseInt(_877)==0){
return;
}
_877=parseInt(_877)+"px";
_876.style.height=_877;
if(this.isIE){
this._fixIeHeight(_876,_877);
}else{
}
_876.parentNode.style.height=_877;
},_fixIeHeight:function(_878,_879){
if("CSS1Compat"==document.compatMode){
var _87a=(_878.offsetHeight-parseInt(_879));
if(_87a>0){
var _87b=(parseInt(_878.style.height)-_87a);
if(_87b>0){
_878.style.height=_87b+"px";
}
}
}
},setSize:function(_87c,_87d){
var _87c=parseInt(_87c);
var _87d=parseInt(_87d);
var _87e=this;
var _87f=this.get_mainTable();
_87f.style.height="";
var _880=_87f.parentNode;
_880.style.width=_87c+"px";
_880.style.height=_87d+"px";
_87e._fixIeHeight(_880,_87d);
if(_87e.isIE){
_87f.style.height=_87d+"px";
_87e._fixIeHeight(_87f,_87d);
}else{
_87f.style.height="100%";
}
},pasteHtml:function(_881,_882,_883,_884,_885){
if(!this.get_editable()){
return;
}
var args=new Telerik.Web.UI.EditorCommandEventArgs(_882,null,_881);
if(false==this._executeCommandEvent("pasteHtml",_882,args)){
return;
}
if(_881!=args.get_value()){
_881=args.get_value();
}
var _887=this.get_localization()[_882];
if(_887){
_882=_887;
}
var mode=this.get_mode();
if(Telerik.Web.UI.EditModes.Design==mode){
this.setFocus();
this.executeCommand(new Telerik.Web.UI.Editor.PasteHtmlCommand(_882,this._contentWindow,_881,_883),null,_885);
if(_884!=false){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
}else{
if(Telerik.Web.UI.EditModes.Html==mode){
var _889=this._getTextArea();
if(this.isIE){
_889.setActive();
var _88a=document.selection.createRange();
_88a.text=_881;
}else{
if(_889.setSelectionRange){
var _88b=_889.selectionStart;
var _88c=_889.selectionEnd;
var _88d=_889.value.substring(_88b,_88c);
var _88e=_881;
_889.value=_889.value.substring(0,_88b)+_88e+_889.value.substring(_88c);
_889.setSelectionRange(_88b+_88e.length,_88b+_88e.length);
this.setFocus();
}
}
}
}
},fire:function(_88f,args){
if(false==this._executeCommandEvent("commandExecuting",_88f,args)){
return;
}
if(this._optionalIgnoredTools&&!this._optionalIgnoredTools[_88f]){
return;
}
this.setActive();
this._pendingTextTypeCmd=null;
var _891=Telerik.Web.UI.Editor.CommandList[_88f];
var _892=false;
if(_891){
_892=(false!=_891(_88f,this,args));
}else{
alert("The command "+_88f+" is not implemented yet.");
}
if(_892){
if(!$telerik.isOpera){
this.setFocus();
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
this._executeCommandEvent("commandExecuted",_88f,args);
},_executeCommandEvent:function(_893,_894,args){
if(!args){
args=new Telerik.Web.UI.EditorCommandEventArgs(_894);
}
this.raiseEvent(_893,args);
if(args.get_cancel&&args.get_cancel()){
return false;
}
return true;
},_onWindowResize:function(){
var _896=this._getViewportBounds();
this.setSize(_896.width,_896.height,false);
},_registerWindowResizeHandler:function(_897){
if(_897){
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 _898=$telerik.getClientBounds();
var _899=document.documentElement.scrollLeft||document.body.scrollLeft;
var _89a=document.documentElement.scrollTop||document.body.scrollTop;
_898.scrollLeft=_899;
_898.scrollTop=_89a;
return _898;
},_handleParentsWithOverflow:function(_89b){
if(false==_89b){
if(!this._parentsWithOverflow){
return;
}
var _89c=this._parentsWithOverflow;
var _89d=_89c.length;
for(var i=0;i<_89d;i++){
var _89f=_89c[i];
if(_89f[0]){
var _8a0=_89f[0].style;
_8a0.overflow=_89f[1];
_8a0.height=_89f[2];
_8a0.tableLayout=_89f[3];
_8a0.position=_89f[4];
}
}
this._parentsWithOverflow=null;
}else{
this._parentsWithOverflow=[];
var _89c=this._parentsWithOverflow;
var _8a1=this._getRootNode().parentNode;
while(_8a1&&_8a1.tagName!="BODY"){
var _8a0=_8a1.style;
_89c[_89c.length]=[_8a1,_8a0.overflow,_8a0.height,_8a0.tableLayout,_8a0.position];
_8a1.style.position="static";
_8a1.style.tableLayout="auto";
_8a1.style.overflow="visible";
_8a1.style.height="auto";
_8a1=_8a1.parentNode;
}
}
},_getRootNode:function(){
return this.get_mainTable().parentNode;
},isFullScreen:function(){
return this._isFullScreen;
},toggleScreenMode:function(){
var _8a2=this;
if(!_8a2._isFullScreen){
_8a2._preFullScreenBodyStyle=[document.body.scroll,document.body.style.margin,""];
document.body.scroll="no";
document.body.style.margin="0px";
if(document.documentElement){
_8a2._preFullScreenBodyStyle[2]=document.documentElement.style.overflow;
document.documentElement.style.overflow="hidden";
}
var _8a3=_8a2._getRootNode();
_8a2._preFullScreenBounds=$telerik.getBounds(_8a3);
_8a2._handleParentsWithOverflow(true);
_8a2._onWindowResize();
_8a2._preFullScreenBrowserRect=_8a2._getViewportBounds();
var _8a4=$telerik.getLocation(_8a3);
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_8a4.x,_8a4.y);
_8a2._isFullScreen=true;
_8a2._registerWindowResizeHandler(true);
}else{
_8a2._registerWindowResizeHandler(false);
document.body.scroll=_8a2._preFullScreenBodyStyle[0];
try{
document.body.style.margin=_8a2._preFullScreenBodyStyle[1];
}
catch(e){
}
document.documentElement.style.overflow=_8a2._preFullScreenBodyStyle[2];
_8a2._isFullScreen=false;
_8a2._handleParentsWithOverflow(false);
var _8a5=_8a2._preFullScreenBounds;
_8a2.setSize(_8a5.width,_8a5.height,false);
var _8a4=_8a2._preFullScreenBrowserRect;
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_8a4.scrollLeft,_8a4.scrollTop);
}
_8a2.set_editable(true);
_8a2.setFocus();
var _8a6=_8a2.getToolByName("ToggleScreenMode");
if(_8a6){
_8a6.setOn(_8a2._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(_8a7){
if($telerik.isSafari&&this._contentHiddenTextarea.innerText!=null){
this._contentHiddenTextarea.innerText=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_8a7);
}else{
this._contentHiddenTextarea.value=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_8a7);
}
},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(_8a9){
this._toolAdapter=_8a9;
},get_fullPage:function(){
return this._fullPage;
},set_fullPage:function(_8aa){
this._fullPage=_8aa;
},get_dialogOpener:function(){
return this._dialogOpener;
},set_dialogOpener:function(_8ab){
this._dialogOpener=_8ab;
},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(_8ac){
this._links=_8ac;
},get_language:function(){
if(null==this._language){
return "en-us";
}
return this._language.toLowerCase();
},set_language:function(_8ad){
this._language=_8ad;
},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(_8ae){
this._colors=_8ae;
},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(_8af){
this._fontNames=_8af;
},get_fontSizes:function(){
if(null==this._fontSizes){
return [1,2,3,4,5,6,7];
}
return this._fontSizes;
},set_fontSizes:function(_8b0){
this._fontSizes=_8b0;
},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(_8b1){
this._symbols=_8b1;
},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(_8b2){
this._realFontSizes=_8b2;
},get_contextMenus:function(){
if(null==this._contextMenus){
return [];
}
return this._contextMenus;
},set_contextMenus:function(_8b3){
this._contextMenus=_8b3;
},get_snippets:function(){
if(null==this._snippets){
return [];
}
return this._snippets;
},set_snippets:function(_8b4){
this._snippets=_8b4;
},get_cssClasses:function(){
if(null==this._cssClasses){
return [];
}
return this._cssClasses;
},set_cssClasses:function(_8b5){
this._cssClasses=_8b5;
},get_cssFiles:function(){
if(null==this._cssFiles){
return [];
}
return this._cssFiles;
},set_cssFiles:function(_8b6){
this._cssFiles=_8b6;
},get_languages:function(){
if(null==this._languages){
return [];
}
return this._languages;
},set_languages:function(_8b7){
this._languages=_8b7;
},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(_8b8){
this._paragraphs=_8b8;
},get_toolsWidth:function(){
return this._toolsWidth;
},set_toolsWidth:function(_8b9){
this._toolsWidth=_8b9;
},get_toolProviderID:function(){
return this._toolProviderID;
},set_toolProviderID:function(_8ba){
this._toolProviderID=_8ba;
},get_autoResizeHeight:function(){
return this._autoResizeHeight;
},set_autoResizeHeight:function(_8bb){
this._autoResizeHeight=_8bb;
},get_toolbarMode:function(){
return this._toolbarMode;
},set_toolbarMode:function(_8bc){
this._toolbarMode=_8bc;
},get_editModes:function(){
return this._editModes;
},set_editModes:function(_8bd){
this._editModes=_8bd;
},get_stripFormattingOptions:function(){
return this._stripFormattingOptions;
},set_stripFormattingOptions:function(_8be){
this._stripFormattingOptions=_8be;
},get_contentFilters:function(){
return this._contentFilters;
},set_contentFilters:function(_8bf){
this._contentFilters=_8bf;
},get_newLineBr:function(){
return this._newLineBr;
},set_newLineBr:function(_8c0){
this._newLineBr=_8c0;
},get_contentAreaCssFile:function(){
return this._contentAreaCssFile;
},set_contentAreaCssFile:function(_8c1){
this._contentAreaCssFile=_8c1;
},get_mozillaFlashOverlayImage:function(){
return this._mozillaFlashOverlayImage;
},set_mozillaFlashOverlayImage:function(_8c2){
this._mozillaFlashOverlayImage=_8c2;
},get_toolAdapterType:function(){
return this._toolAdapterType;
},set_toolAdapterType:function(_8c3){
this._toolAdapterType=_8c3;
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_8c4){
this._toolJSON=_8c4;
},get_modulesJSON:function(){
return this._modulesJSON;
},set_modulesJSON:function(_8c5){
this._modulesJSON=_8c5;
},get_contextMenusJSON:function(){
return this._contextMenusJSON;
},set_contextMenusJSON:function(_8c6){
this._contextMenusJSON=_8c6;
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_8c7){
this._uniqueID=_8c7;
},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(_8c9){
this._skin=_8c9;
},_registerClientValidation:function(){
if(typeof (Page_ClientValidate)=="function"){
var _8ca=Page_ClientValidate;
Page_ClientValidate=Function.createDelegate(this,function(_8cb){
var _8cc=this.get_element();
if(_8cc){
var _8cd=this.get_html(true);
this.set_contentHiddenTextareaValue(_8cd);
_8cc.value=_8cd;
_8cc.setAttribute("value",_8cd);
}
_8cc=null;
return _8ca(_8cb);
});
}
},saveContent:function(){
if(this._saveContentDelegate){
this.raiseEvent("submit",Sys.EventArgs.Empty);
var _8ce=this.get_html(true);
this.set_contentHiddenTextareaValue(_8ce);
}
},_registerPostBackHandlers:function(){
this._saveContentDelegate=Function.createDelegate(this,this.saveContent);
var _8cf=this._contentHiddenTextarea.form;
$telerik.addExternalHandler(_8cf,"submit",this._saveContentDelegate);
if(typeof (__doPostBack)!="undefined"){
var _8d0=this._saveContentDelegate;
var _8d1=__doPostBack;
__doPostBack=function(_8d2,_8d3){
_8d0();
_8d1(_8d2,_8d3);
};
}
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;
}
_8cf=null;
},toggleEnhancedEdit:function(_8d5){
if(!this.get_document()){
return false;
}
var _8d6=this.get_document().getElementById(this._getUniqueStyleSheetId(0));
if(_8d6){
if(_8d5==null){
_8d5=_8d6.disabled;
}
_8d6.disabled=!_8d5;
var tool=this.getToolByName("ToggleTableBorder");
if(tool){
tool.setOn(_8d5);
}
return _8d5;
}else{
return false;
}
},pasteHyperLink:function(_8d8,_8d9){
if($telerik.isIE){
var sel=this.getSelectedElement();
if(sel.tagName=="IMG"&&sel.parentNode&&sel.parentNode.tagName=="A"){
var _8db=sel.parentNode;
_8db.parentNode.removeChild(_8db);
}
if(sel.tagName=="IMG"){
_8d8.innerHTML=Telerik.Web.UI.Editor.Utils.getOuterHtml(sel);
}
}
if($telerik.isOpera){
var sel=this.getSelectedElement();
if(sel.tagName=="A"){
this.fire("Unlink");
}
}
if("DocumentManager"==_8d9){
var _8dc=this.getSelection().getText();
if(""!=_8dc.trim()){
_8d8.innerHTML=_8dc;
}
}
var _8dd=Telerik.Web.UI.Editor.Utils.getOuterHtml(_8d8);
this.pasteHtml(_8dd,_8d9);
},_saveTypedContent:function(_8de,_8df){
if(this._pendingTextTypeCmd){
this._pendingTextTypeCmd.update();
}
if(true!=_8de){
this._pendingTextTypeCmd=null;
}
},_attachIEBodyHandlers:function(_8e0){
var body=null;
if(this._document&&this._document.body){
body=this._document.body;
}
if(!body){
return;
}
if(_8e0){
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 _8e2=this;
var _8e3=_8e2.fire;
_8e2.fire=function(_8e4,_8e5){
if(_8e4!="Copy"){
_8e2._saveTypedContent(true,"editor.fire "+_8e4+" executing");
}
_8e3.call(_8e2,_8e4,_8e5);
try{
if(_8e4=="Undo"&&!_8e2.isIE&&_8e2._document.body.innerHTML.toLowerCase().trim()=="<br>"){
_8e2._document.body.innerHTML="<br>";
}
}
catch(e){
}
};
this.attachEventHandler("onclick",function(e){
_8e2._saveTypedContent(false,"Saving typed content because of oclick (somewhere else)");
if(_8e2.getSelectionHtml()){
_8e2._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(_8e2.get_localization()["Typing"],_8e2.get_contentWindow());
_8e2.executeCommand(_8e2._pendingTextTypeCmd,false);
}
});
if(!this.isIE){
this.attachEventHandler("keypress",function(e){
if(_8e2._onKeyPressed(e)){
e.preventDefault();
return false;
}
});
this.attachEventHandler("click",function(e){
if(!_8e2.isFirefox){
return;
}
if(!_8e2.get_editable()){
return;
}
if("on"==_8e2._document["designMode"]){
window.setTimeout(function(){
_8e2.set_editable(true);
_8e2.setFocus();
},100);
}
});
}
this.attachEventHandler("keydown",function(e){
if(_8e2.isOpera){
return _8e2._onKeyDown(e);
}else{
_8e2._onKeyDown(e);
}
});
this.attachEventHandler("onmousedown",function(){
_8e2._saveTypedContent(false,"Saving typed content onmousedown");
});
this.attachEventHandler("keyup",Function.createDelegate(this,this._onKeyUp));
var _8ea=Function.createDelegate(this,function(e){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
});
this.attachEventHandler("mouseup",_8ea);
$telerik.addExternalHandler(document.body,"dragend",Function.createDelegate(this,this._onDocumentDragEnd));
this._attachIEBodyHandlers(true);
},_onKeyDown:function(e){
var _8ed=e.keyCode;
switch(_8ed){
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 _8ee=this;
var _8ef=function(){
var _8f0=_8ee.getSelectedElement();
if(_8f0&&_8f0.tagName=="EMBED"){
_8f0.setAttribute("hidden","true");
_8f0.setAttribute("id","FileToDelete");
window.setTimeout(function(){
var _8f1=_8ee._document.getElementById("FileToDelete");
if(_8f1.parentNode&&_8f1.parentNode.removeChild){
_8f1.parentNode.removeChild(_8f1);
}
},100);
$telerik.cancelRawEvent(e);
return true;
}
};
var _8f2=_8ef();
if(_8f2){
return false;
}
try{
var _8f3=_8ee._document.selection.createRange();
var _8f4=null;
if(_8f3&&_8f3.duplicate){
_8f4=_8f3.duplicate();
}
if(8==e.keyCode){
_8f3.moveStart("character",-1);
}else{
_8f3.moveEnd("character",1);
}
if(_8f3.parentElement().tagName=="EMBED"){
_8f3.select();
_8ef();
if(_8f4&&_8f4.select){
_8f4.select();
}
}
}
catch(ex){
}
var _8f5=new Telerik.Web.UI.Editor.Selection(this._contentWindow);
if(_8f5&&_8f5.isControl()){
var _8f6=_8f5.getRange();
_8f6.execCommand("Delete");
$telerik.cancelRawEvent(e);
}
}
return;
}
var _8f7=e.target?e.target:e.srcElement;
if(_8f7&&"INPUT"!=_8f7.tagName){
var _8f8=this._shortCutManager.isShortCutHit(e);
if(null!=_8f8&&_8f8.get_name()=="Copy"){
this._shortcutHit=false;
return;
}
this._shortcutHit=(null!=_8f8);
if(this._shortcutHit){
this.fire(_8f8.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=_8f8.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(_8fc,_8fd,_8fe,_8ff){
var _900=this;
var _901=(this.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _902=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_8fd,_900.get_stripFormattingOptions(),_900.get_localization()["askwordcleaning"],_901);
if(_8fc){
_8fc.select();
}
if(_902){
window.setTimeout(function(){
if(_8ff&&_8fc){
_8fc.select();
}
_900.pasteHtml(_902);
},5);
return $telerik.cancelRawEvent(_8fe);
}
return true;
},_onPaste:function(_903){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _904=this.createRestorePoint();
var _905=this.getSelectionHtml()?true:false;
var _906=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
return this._insertPastedContent(_904,_906,_903,_905);
},_onBeforePaste:function(_907){
if(_907){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _908=new Telerik.Web.UI.Editor.GenericCommand("Paste",this._contentWindow);
var _909=this.getSelection().getRange();
var _90a=Telerik.Web.UI.Editor.Utils.getUniqueID();
if(_909.pasteHTML){
_909.pasteHTML("&nbsp;<font id='"+_90a+"'>&nbsp;</font>");
}else{
this.pasteHtml("&nbsp;<font id='"+_90a+"'>&nbsp;</font>");
}
var _90b=Telerik.Web.UI.Editor.Utils.getPasteContainer();
_90b.innerHTML="";
if(_90b.setActive){
_90b.setActive();
}else{
_90b.focus();
}
var _90c=this;
window.setTimeout(function(){
var _90d=_90b.innerHTML;
var _90e=(_90c.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _90f=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_90d,_90c.get_stripFormattingOptions(),_90c.get_localization()["askwordcleaning"],_90e);
var _910=_90c._document.getElementById(_90a);
_90c.setActive(true);
_90c._pendingCutPasteCommand=null;
if(_90c._document.body.createTextRange){
var _911=_90c._document.body.createTextRange();
_911.moveToElementText(_910);
_911.moveStart("character",-1);
_911.select();
_911.pasteHTML(_90f);
}else{
_90c.getSelection().selectRange(_911);
_90c.pasteHtml(_90f);
}
_90c.executeCommand(_908);
_90c.setActive(true);
_90c.setFocus(true);
},0);
}else{
}
},_onResizeStart:function(e){
var _913=this.getSelectedElement();
if(_913==e.srcElement){
var _914=this.get_localization()["ResizeCommand"]||"Resize";
this._pendingResizeCmd=new Telerik.Web.UI.Editor.GenericCommand(_914,this._contentWindow);
}
},_onResizeEnd:function(e){
if(this._pendingResizeCmd){
this.executeCommand(this._pendingResizeCmd);
}
},_onDragStart:function(e){
var _917=this.get_localization()["MoveCommand"]||"Move";
this._pendingMoveCommand=new Telerik.Web.UI.Editor.GenericCommand(_917,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 _919=this._startRange.item(0);
if("IMG"==_919.tagName&&"A"==_919.parentNode.tagName&&_919.parentNode.childNodes.length==1){
_919=_919.parentNode;
}
rng.moveToElementText(_919);
this._startRange=rng;
}
}
},_onDragEnd:function(e){
if(this._pendingMoveCommand){
if(this._startRange){
var _91b=this._contentWindow.document.selection.createRange();
if(_91b.length){
var rng=this._contentWindow.document.body.createTextRange();
rng.moveToElementText(_91b.item(0));
_91b=rng;
}
try{
if(_91b.compareEndPoints&&0!=_91b.compareEndPoints("StartToStart",this._startRange)&&0!=_91b.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 _91e=this.get_localization()["Drop"]||"Drop external content";
this._pendingDockCommand=new Telerik.Web.UI.Editor.GenericCommand(_91e,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(_920){
this.get_events().addHandler("toggleScreenMode",_920);
},remove_toggleScreenMode:function(_921){
this.get_events().removeHandler("toggleScreenMode",_921);
},add_modeChange:function(_922){
this.get_events().addHandler("modeChange",_922);
},remove_modeChange:function(_923){
this.get_events().removeHandler("modeChange",_923);
},add_load:function(_924){
this.get_events().addHandler("load",_924);
},remove_load:function(_925){
this.get_events().removeHandler("load",_925);
},add_init:function(_926){
this.get_events().addHandler("init",_926);
},remove_init:function(_927){
this.get_events().removeHandler("init",_927);
},add_selectionChange:function(_928){
this.get_events().addHandler("selectionChange",_928);
},remove_selectionChange:function(_929){
this.get_events().removeHandler("selectionChange",_929);
},add_commandExecuting:function(_92a){
this.get_events().addHandler("commandExecuting",_92a);
},remove_commandExecuting:function(_92b){
this.get_events().removeHandler("commandExecuting",_92b);
},add_commandExecuted:function(_92c){
this.get_events().addHandler("commandExecuted",_92c);
},remove_commandExecuted:function(_92d){
this.get_events().removeHandler("commandExecuted",_92d);
},add_submit:function(_92e){
this.get_events().addHandler("submit",_92e);
},remove_submit:function(_92f){
this.get_events().removeHandler("submit",_92f);
},add_editReady:function(_930){
this.get_events().addHandler("editReady",_930);
},remove_editReady:function(_931){
this.get_events().removeHandler("editReady",_931);
},add_pasteHtml:function(_932){
this.get_events().addHandler("pasteHtml",_932);
},remove_pasteHtml:function(_933){
this.get_events().removeHandler("pasteHtml",_933);
},add_firstShow:function(_934){
this.get_events().addHandler("firstShow",_934);
},remove_firstShow:function(_935){
this.get_events().removeHandler("firstShow",_935);
}};
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);

