Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Utils={getInvisibleParent:function(_1){
while(_1!=document){
if("none"==$telerik.getCurrentStyle(_1,"display","")){
return _1;
}
_1=_1.parentNode;
}
return null;
},evalScriptCode:function(_2){
var _3=$telerik.isSafari;
if(_3){
_2=_2.replace(/^\s*<!--((.|\n)*)-->\s*$/mi,"$1");
}
var _4=document.createElement("script");
_4.setAttribute("type","text/javascript");
if(_3){
_4.appendChild(document.createTextNode(_2));
}else{
_4.text=_2;
}
var _5=document.getElementsByTagName("head")[0];
_5.appendChild(_4);
if(_3){
_4.innerHTML="";
}else{
_4.parentNode.removeChild(_4);
}
},cleanPastedContent:function(_6,_7,_8,_9){
var _a=_6;
if(_7==Telerik.Web.UI.StripFormattingOptions.None){
if((_6.match(/style="[^"]*?mso[^"]*?"/ig)||_6.match(/class="?[^"]*?mso[^"]*?"?/ig))&&confirm(_8)){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD");
}
}else{
if(_7&Telerik.Web.UI.StripFormattingOptions.All){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"ALL");
}else{
if(_7&Telerik.Web.UI.StripFormattingOptions.AllExceptNewLines){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"ALL_NO_BRAKES");
}else{
if(_7&Telerik.Web.UI.StripFormattingOptions.MSWordRemoveAll){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD_ALL");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.MSWordNoFonts){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD_NO_FONTS");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.MSWord){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"WORD");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.Css){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"CSS");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.Font){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"FONT");
}
if(_7&Telerik.Web.UI.StripFormattingOptions.Span){
_6=Telerik.Web.UI.Editor.Utils.stripFormatting(_6,"SPAN");
}
_a=_6;
}
}
}
if(null!=_9&&false==_9){
_a=Telerik.Web.UI.Editor.Utils.stripFormatting(_a,"SCRIPT");
}
return _a;
},isCursorMovingKey:function(_b){
if(_b>=33&&_b<=40){
return true;
}
return false;
},isSystemKey:function(_c){
if(_c>=112&&_c<=123){
return true;
}
if(_c>=8&&_c<=27){
return true;
}
if(_c>=32&&_c<=46){
return true;
}
if(_c==93){
return true;
}
return false;
},storeBrowserPosition:function(){
var _d=document.body;
var _e=document.documentElement;
this._browserTop=_d.scrollTop>_e.scrollTop?_d.scrollTop:_e.scrollTop;
this._browserLeft=_d.scrollLeft>_e.scrollLeft?_d.scrollTop:_e.scrollLeft;
},restoreBrowserPosition:function(_f,top){
try{
if(null==_f){
_f=this._browserLeft;
}
if(null==top){
top=this._browserTop;
}
var _11=document.body;
var _12=document.documentElement;
_11.scrollTop=top;
_11.scrollLeft=_f;
_12.scrollTop=top;
_12.scrollLeft=_f;
}
catch(ex){
}
},_getPasteIframe:function(){
if(!this._pasteIframe){
this._pasteIframe=document.createElement("IFRAME");
var _13=this._pasteIframe.style;
_13.width="1px";
_13.height="1px";
_13.border="0px solid red";
_13.overflow="hidden";
_13.position="absolute";
document.body.appendChild(this._pasteIframe);
var doc=this._pasteIframe.contentWindow.document;
var _15=doc.open("text/html","replace");
var _16="<html><head><title>New Document</title></head>"+"<body contentEditable='true' style='overflow:hidden;margin:0px;padding:0px;height:100%'>"+"</html>";
_15.write(_16);
_15.close();
}
return this._pasteIframe;
},getPasteContainer:function(){
var _17=this._getPasteIframe();
return _17.contentWindow.document.body;
},getClipboardAsHtml:function(){
var div=this.getPasteContainer();
div.innerHTML="";
div.setActive();
document.execCommand("Paste",null);
var _19=div.innerHTML;
div.innerHTML="";
return _19;
},stripFormatting:function(_1a,_1b){
switch(_1b){
case "ALL":
_1a=_1a.replace(/<\/?[^>]*>/ig,"");
break;
case "ALL_NO_BRAKES":
_1a=_1a.replace(/<BR(\s[^>]*)?\/?>/ig,"~RADEDITORBRAKE~");
_1a=_1a.replace(/<\/?[^>]*>/ig,"");
_1a=_1a.replace(/~RADEDITORBRAKE~/ig,"<br/>");
_1a=_1a.replace(/\n/ig,"<br/>");
_1a=_1a.replace(/\r/ig,"");
break;
case "WORD":
case "WORD_ALL":
case "WORD_NO_FONTS":
_1a=this.stripWordFormatting(_1a,_1b);
break;
case "CSS":
_1a=_1a.replace(new RegExp("(<[^>]+) class=[^ |^>]*([^>]*>)","ig"),"$1 $2");
_1a=_1a.replace(/(<[^>]+) style="[^"]*"([^>]*>)/ig,"$1 $2");
break;
case "FONT":
_1a=_1a.replace(/<\/?font[^>]*>/ig,"");
break;
case "SPAN":
_1a=_1a.replace(/<\/?span[^>]*>/ig,"");
break;
case "SCRIPT":
_1a=_1a.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
_1a=_1a.replace(new RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
break;
default:
break;
}
return _1a;
},replaceNewLineWithBr:function(_1c){
try{
_1c=_1c.replace(/\n/g,"<br>");
return _1c;
}
catch(exc){
}
},convertText2Html:function(_1d){
try{
_1d=_1d.replace(/</g,"&lt;");
_1d=_1d.replace(/>/g,"&gt;");
_1d=_1d.replace(/\n/g,"<br>");
return _1d;
}
catch(exc){
}
},clearWordAttributesInElement:function(_1e,_1f){
var _20=$telerik.isIE?_1e.all:_1e.getElementsByTagName("*");
for(var i=0;i<_20.length;i++){
var _22=_20[i];
var _23=new RegExp("mso","gi");
if(_22.nodeType==1){
if(_23.exec(_22.className)){
_22.className="";
}
_22.removeAttribute("lang","",0);
_22.removeAttribute("stylw","",0);
_22.style.cssText=_22.style.cssText.replace(/(([\w-]*?mso[\w-]*?):(.+?)([;^$]|$))/gi,"");
if($telerik.isIE){
_22.style.removeAttribute("tab-stops",0);
_22.style.removeAttribute("textIndent",0);
}
if($telerik.isIE&&(_1f=="WORD_NO_FONTS"||_1f=="WORD_ALL")){
_22.style.removeAttribute("fontFamily",0);
_22.removeAttribute("face",0);
}
for(j=_22.attributes.length-1;j>=0;j--){
var _24=_22.attributes[j];
if("null"!=_24.value&&""!=_24.value){
if(_23.exec(_24.name)||_23.exec(_24.value)){
_22.removeAttribute(_24.name);
}
}
}
}
}
},stripWordFormatting:function(_25,_26){
if(_26=="WORD_ALL"){
var _27=/<SPAN[^>]*?>([\s\S]*?)<\/SPAN[^>]*?>/ig;
while(_25.match(_27)){
_25=_25.replace(_27,"$1");
}
var _28=/<FONT[^>]*?>([\s\S]*?)<\/FONT[^>]*?>/ig;
while(_25.match(_28)){
_25=_25.replace(_28,"$1");
}
}
_25=_25.replace(/<span>([^<>]+)<\/span>/gi,"<span EditorSaved='true'>$1</span>");
_25=_25.replace(/<font>([^<>]+)<\/font>/gi,"<font EditorSaved='true'>$1</font>");
var _29=document.createElement("DIV");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_29,_25);
this.clearWordAttributesInElement(_29,_26);
var _2a=_29.innerHTML;
_2a=_2a.replace(/\t/g," ");
_2a=_2a.replace(/<\/?\w+:[^>]*>/gi,"");
_2a=_2a.replace(/<\\?\??xml[^>]>/gi,"");
_2a=_2a.replace(/<p>&nbsp;<\/p>/gi,"<BR><BR>");
_2a=_2a.replace(/[ ]+/g," ");
_2a=_2a.replace(/<(\/)?strong>/ig,"<$1B>");
_2a=_2a.replace(/<(\/)?em>/ig,"<$1I>");
_2a=_2a.replace(/^\s/i,"");
_2a=_2a.replace(/\s$/i,"");
_2a=_2a.replace(/<o:[pP]>&nbsp;<\/o:[pP]>/gi,"");
_2a=_2a.replace(/<st1:.*?>/gi,"");
_2a=_2a.replace(/<font>([^<>]+)<\/font>/gi,"$1");
_2a=_2a.replace(/<span>([^<>]+)<\/span>/gi,"$1");
_2a=_2a.replace(/[\s]+EditorSaved=[\'\"]true[\'\"]/gi,"");
_2a=_2a.replace(/<\?xml[^>]*>/ig,"");
_2a=_2a.replace(/<\/?[a-z]+:[^>]*>/ig,"");
_2a=_2a.replace(/style=(""|'')/ig,"");
_2a=_2a.replace(/class=(""|'')/ig,"");
_2a=_2a.replace(/v:shape="[^"]+"/ig,"");
_2a=_2a.replace(/<span[^>]*>\s*<\/span[^>]*>/ig," ");
_2a=_2a.replace(/<font[^>]*>\s*<\/font[^>]*>/ig," ");
_2a=_2a.replace(/\s+/ig," ");
_2a=_2a.replace(/<span><span>/ig,"<span>");
_2a=_2a.replace(/<\/span><\/span>/ig,"</span>");
return _2a;
},createTable:function(_2b,_2c,_2d){
if(!_2d){
_2d=document;
}
var _2e=_2d.createElement("TABLE");
for(var r=0;r<_2b;r++){
oRow=_2e.insertRow(-1);
for(var c=0;c<_2c;c++){
oCell=oRow.insertCell(-1);
oCell.innerHTML="&nbsp;";
}
}
return _2e;
},mergeElementAttributes:function(_31,_32,_33){
if(!_31||!_32){
return;
}
if(_31.mergeAttributes){
_32.mergeAttributes(_31,_33);
}else{
for(var ac=0;ac<_31.attributes.length;ac++){
var _35=_31.attributes[ac].nodeValue;
_32.setAttribute(_31.attributes[ac].nodeName,_35);
}
if(""==_32.getAttribute("style")){
_32.removeAttribute("style");
}
}
},getElementParentByTag:function(_36,_37){
if(null==_36){
return null;
}
if(null==_37){
return _36;
}
try{
while(_36&&null!=_36.tagName&&_36.tagName!=_37){
_36=_36.parentNode;
}
return ((_36.tagName==_37)?_36:null);
}
catch(e){
return null;
}
},selectElement:function(_38,_39){
if(!_39){
return;
}
var _3a=_38.document;
if($telerik.isIE){
var _3b;
switch(_39.tagName){
case "TABLE":
case "IMG":
case "HR":
case "INPUT":
_3b=_3a.body.createControlRange();
_3b.add(_39);
break;
case "UL":
case "OL":
_3b=_3a.body.createTextRange();
_3b.moveToElementText(_39);
var _3c=_3b.parentElement();
if(_3c.tagName!="UL"||_3c.tagName!="OL"){
_3b.moveEnd("character",-1);
}
break;
default:
_3b=_3a.body.createTextRange();
_3b.moveToElementText(_39);
break;
}
if(_3b){
_3b.select();
return true;
}
}else{
if(_38.getSelection){
var _3b=_3a.createRange();
_3b.selectNode(_39);
if(window.opera){
_3b.selectNodeContents(_39);
}
var _3d=_38.getSelection();
if($telerik.isSafari){
_3d.setBaseAndExtent(_3b.startContainer,_3b.startOffset,_3b.endContainer,_3b.endOffset);
}else{
_3d.removeAllRanges();
_3d.addRange(_3b);
}
return true;
}
}
return false;
},getOuterHtml:function(_3e){
return $telerik.getOuterHtml(_3e);
},hasHtmlContent:function(_3f){
if(!_3f||!_3f.match){
return _3f;
}
return _3f.match(/</);
},setElementInnerHtml:function(_40,_41){
var _42=$telerik.isIE?this.getStoredOriginalPathsAndAttributes(_41):_41;
_40.innerHTML="<span>&nbsp;</span>"+_42;
_40.removeChild(_40.firstChild);
if($telerik.isIE){
this.restoreOriginalPathsAndAttributes(_40);
}
},getStoredOriginalPathsAndAttributes:function(_43){
var _44=new RegExp("(href|src)\\s*=\\s*('|\")?(.+?)(\\2)([^<]*?>)","ig");
var _45=function(_46,g1,g2,g3,g4,g5,_4c,_4d){
if(!g2){
g2="";
g3=g3+g5;
var _4e=g3.match(/(\s|>)/gi);
if(_4e){
var _4f=_4e.index;
g5=g3.substring(_4f,g3.length);
g3=g3.substring(0,_4f);
}else{
return _46;
}
}
return g1+"="+g2+g3+g2+" originalAttribute=\""+g1+"\" originalPath=\""+g3+"\""+g5;
};
_43=_43.replace(_44,_45);
var _50=new RegExp("(<!--[\\s\\S]*?) originalAttribute=\"(href|src)\" originalPath=\"[^\"]+\"([\\s\\S]*?-->)","ig");
_43=_43.replace(_50,"$1$3");
return _43;
},restoreOriginalPathsAndAttributes:function(_51){
var _52=_51.getElementsByTagName("*");
for(var i=0;i<_52.length;i++){
var _54=_52[i];
var _55=_54.getAttribute("originalPath");
var _56=_54.getAttribute("originalAttribute");
if(_55!=null&&_56!=null){
_54.removeAttribute("originalPath");
_54.removeAttribute("originalAttribute");
if(_55.toLowerCase().indexOf("mailto:")==0){
continue;
}
_55=_55.replace(window.location.href+"#","#");
_54.removeAttribute(_56);
var _57=_54.innerHTML;
_54.setAttribute(_56,_55);
if(_57.indexOf("www.")==0&&_54.innerHTML.match("[a-z]+://")){
_54.innerHTML=_57;
}
}
}
},_encodeHtmlContent:function(_58,_59){
var _5a=new Array("%","<",">","!","\"","#","$","&","'","(",")",",",":",";","=","?","[","\\","]","^","`","{","|","}","~","+");
var _5b=_58;
if(_59){
for(var i=0;i<_5a.length;i++){
_5b=_5b.replace(new RegExp("\\x"+_5a[i].charCodeAt(0).toString(16),"ig"),"%"+_5a[i].charCodeAt(0).toString(16));
}
}else{
for(var i=_5a.length-1;i>=0;i--){
_5b=_5b.replace(new RegExp("%"+_5a[i].charCodeAt(0).toString(16),"ig"),_5a[i]);
}
}
return _5b;
},encodePostbackContent:function(_5d){
return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(_5d,true);
},decodePostbackContent:function(_5e){
return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(_5e,false);
},addStyleSheet:function(url,doc,id){
doc=doc||document;
var _62=doc.createElement("link");
_62.setAttribute("href",url,0);
_62.setAttribute("type","text/css");
if(id){
_62.setAttribute("id",id);
}else{
id="";
}
_62.setAttribute("rel","stylesheet",0);
var _63=doc.getElementsByTagName("head")[0];
if($telerik.isSafari){
var _64=function(){
_63.appendChild(_62);
};
window.setTimeout(_64,200);
}else{
_63.appendChild(_62);
}
},_copyElementsBetweenNodes:function(_65,_66,_67){
var _68=_65.getElementsByTagName(_67);
var _69=_66.getElementsByTagName(_67);
for(var i=0;i<_68.length;i++){
switch(_67){
case "script":
case "title":
_69[i].text=_68[i].text;
break;
case "style":
if(_69[i].innerHTML!=_68[i].innerHTML){
_69[i].styleSheet.cssText=_68[i].styleSheet.cssText;
}
break;
default:
_69[i].innerHTML=_68[i].innerHTML;
break;
}
}
},cloneNodeWithChildren:function(_6b){
if(!_6b){
return null;
}
if($telerik.isIE&&_6b.getElementsByTagName){
var _6c=_6b.cloneNode(true);
if(typeof (_6c.innerHTML)!="string"){
this.setElementInnerHtml(_6c,_6b.innerHTML);
}
this._copyElementsBetweenNodes(_6b,_6c,"script");
this._copyElementsBetweenNodes(_6b,_6c,"map");
this._copyElementsBetweenNodes(_6b,_6c,"style");
this._copyElementsBetweenNodes(_6b,_6c,"title");
return _6c;
}else{
return _6b.cloneNode(true);
}
},getUniqueID:function(){
if(!window["RadEditor_uniqueSeed"]){
window["RadEditor_uniqueSeed"]=new Date()-101;
}
if(!window["RadEditor_uniqueIdCounter"]){
window["RadEditor_uniqueIdCounter"]=1;
}else{
window["RadEditor_uniqueIdCounter"]++;
}
var _6d=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_6d;
}};
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandStates=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.Editor.CommandStates.prototype={Disabled:-1,Off:0,On:1};
Telerik.Web.UI.Editor.CommandStates.registerEnum("Telerik.Web.UI.Editor.CommandStates",false);
Telerik.Web.UI.Editor.CommandBase=function(_6e,_6f,_70){
this.isSafari=$telerik.isSafari;
this.isIE=$telerik.isIE;
this.isOpera=$telerik.isOpera;
this.isFirefox=$telerik.isFirefox;
this._title=_6e;
this._window=_6f;
this._isExecuted=false;
this._canUnexecute=(_70!=false);
};
Telerik.Web.UI.Editor.CommandBase.prototype={getState:function(_71){
return Telerik.Web.UI.Editor.CommandStates.Off;
},getValue:function(_72){
return null;
},set_window:function(_73){
this._window=_73;
},get_window:function(){
return this._window;
},get_title:function(){
return this._title;
},set_title:function(_74){
this._title=_74;
},execute:function(){
this._isExecuted=false;
if(null==this.onExecute||null==this.get_window()){
return false;
}
try{
if(!this.RestorePoint1){
this.RestorePoint1=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
}else{
this.RestorePoint1.select();
}
return (this._isExecuted=this.onExecute());
}
catch(ex){
}
return false;
},onExecute:function(){
if(this.isIE&&null!=this.OnExecuteIE){
return this.OnExecuteIE();
}else{
if(null!=window.getSelection&&null!=this.OnExecuteMoz){
return this.OnExecuteMoz();
}
}
return false;
},unexecute:function(){
try{
if(this._canUnexecute&&this._isExecuted){
this.RestorePoint1.restore();
}
}
catch(ex){
}
}};
Telerik.Web.UI.Editor.CommandBase.registerClass("Telerik.Web.UI.Editor.CommandBase",null);
Telerik.Web.UI.Editor.PasteHtmlCommand=function(_75,_76,_77,_78){
Telerik.Web.UI.Editor.PasteHtmlCommand.initializeBase(this,[(_75||"Insert Html"),_76,true]);
this.HtmlText=_77;
this.SelectText=(true==_78);
};
Telerik.Web.UI.Editor.PasteHtmlCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.PasteHtmlCommand(this.get_title(),this.get_window(),this.HtmlText);
},onExecute:function(){
var sel=new Telerik.Web.UI.Editor.Selection(this.get_window());
sel.pasteHtml(this.HtmlText,this.SelectText);
return true;
}};
Telerik.Web.UI.Editor.PasteHtmlCommand.registerClass("Telerik.Web.UI.Editor.PasteHtmlCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.GenericCommand=function(_7a,_7b){
Telerik.Web.UI.Editor.GenericCommand.initializeBase(this,[_7a,_7b,true]);
this.RestorePoint1=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
};
Telerik.Web.UI.Editor.GenericCommand.prototype={execute:function(){
if(null==this.RestorePoint2){
this.RestorePoint2=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
}else{
this.RestorePoint2.restore();
}
return true;
},unexecute:function(){
this.RestorePoint1.restore(true);
}};
Telerik.Web.UI.Editor.GenericCommand.registerClass("Telerik.Web.UI.Editor.GenericCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TextTypeCommand=function(_7c,_7d){
Telerik.Web.UI.Editor.TextTypeCommand.initializeBase(this,[(_7c||"Typing"),_7d]);
};
Telerik.Web.UI.Editor.TextTypeCommand.prototype={update:function(){
if(this.RestorePoint2){
this.RestorePoint2.update();
}
}};
Telerik.Web.UI.Editor.TextTypeCommand.registerClass("Telerik.Web.UI.Editor.TextTypeCommand",Telerik.Web.UI.Editor.GenericCommand);
Telerik.Web.UI.Editor.BrowserCommand=function(_7e,_7f,_80,_81){
var _82=true;
switch(this.CommandID){
case "Copy":
case "SelectAll":
case "Print":
_82=false;
break;
}
Telerik.Web.UI.Editor.BrowserCommand.initializeBase(this,[(_7e||_80),_7f,_82]);
this.CommandID=_80;
this.Value=_81;
};
Telerik.Web.UI.Editor.BrowserCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.BrowserCommand(this._title,this.get_window(),this.CommandID,this.Value);
},getState:function(_83){
try{
_83=_83||this.get_window();
var _84=_83.document;
if(null==_84){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
var _85=true;
if("Paste"!=this.CommandID){
_85=_84.queryCommandEnabled(this.CommandID);
}else{
if(!$telerik.isIE7){
_85=_84.queryCommandEnabled(this.CommandID);
}
}
if(!this.isOpera&&!_85){
if(!this.isSafari||!this.CommandID=="RealFontSize"){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
}
var _86=null;
if("Paste"!=this.CommandID){
_86=_84.queryCommandState(this.CommandID);
}else{
if(!$telerik.isIE7){
_86=_84.queryCommandState(this.CommandID);
}
}
return _86?Telerik.Web.UI.Editor.CommandStates.On:Telerik.Web.UI.Editor.CommandStates.Off;
}
catch(ex){
return Telerik.Web.UI.Editor.CommandStates.Off;
}
},getValue:function(_87){
try{
_87=_87||this.get_window();
return _87.document.queryCommandValue(this.CommandID);
}
catch(ex){
}
return null;
},onExecute:function(){
var _88=this.get_window();
if(!_88){
return false;
}
var _89=_88.document;
if("AbsolutePosition"==this.CommandID){
_89.execCommand("2D-Position",false,true);
}
var _8a=true;
if(this.CommandID=="BackColor"&&(this.isOpera||this.isFirefox)){
this.CommandID="HiliteColor";
_8a=false;
}
if(this.CommandID=="FontSize"&&this.isSafari&&!$telerik.isSafari3){
var _8b=parseInt(this.Value);
switch(_8b){
case 1:
this.Value="8pt";
break;
case 2:
this.Value="10pt";
break;
case 3:
this.Value="12pt";
break;
case 4:
this.Value="14pt";
break;
case 5:
this.Value="18pt";
break;
case 6:
this.Value="24pt";
break;
case 7:
this.Value="36pt";
break;
}
}
try{
_89.execCommand("UseCSS",false,(false!=_8a));
}
catch(e){
}
var _8c=_89.execCommand(this.CommandID,false,this.Value);
try{
_89.execCommand("UseCSS",false,true);
}
catch(e){
}
return _8c;
}};
Telerik.Web.UI.Editor.BrowserCommand.registerClass("Telerik.Web.UI.Editor.BrowserCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.StyleRuleCommand=function(_8d,_8e,_8f,_90,_91){
Telerik.Web.UI.Editor.StyleRuleCommand.initializeBase(this,[(_8d||sCmdID),_8e,true]);
if(!_8f){
var _92=new Telerik.Web.UI.Editor.Selection(this._window);
_8f=_92.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_8f);
this._styleAttributeName=_90;
this._newValue=_91;
};
Telerik.Web.UI.Editor.StyleRuleCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.StyleRuleCommand(this._title,this._window,null,this._styleAttributeName,this._newValue);
},execute:function(){
var _93=this._nodeBookmark.select();
if(!_93){
return false;
}
if(!this._isExecuted){
this._oldValue=_93.style[this._styleAttributeName];
}
_93.style[this._styleAttributeName]=this._newValue;
this._isExecuted=true;
return true;
},unexecute:function(){
var _94=this._nodeBookmark.select();
_94.style[this._styleAttributeName]=this._oldValue;
}};
Telerik.Web.UI.Editor.StyleRuleCommand.registerClass("Telerik.Web.UI.Editor.StyleRuleCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.AttributeCommand=function(_95,_96,_97,_98,_99){
Telerik.Web.UI.Editor.AttributeCommand.initializeBase(this,[(_95||sCmdID),_96,true]);
if(!_97){
var _9a=new Telerik.Web.UI.Editor.Selection(this._window);
_97=_9a.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_97);
this._attribName=_98;
this._newValue=_99;
};
Telerik.Web.UI.Editor.AttributeCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.AttributeCommand(this._title,this._window,null,this._attribName,this._newValue);
},execute:function(){
var _9b=this._nodeBookmark.select();
if(!_9b){
return false;
}
if(!this._isExecuted){
this._oldValue=_9b.getAttribute(this._attribName);
}
if(this._attribName&&this._attribName.toLowerCase()=="name"&&document.all){
_9b.name=this._newValue;
_9b.removeAttribute("name");
_9b.removeAttribute("NAME");
}
var _9c=this._newValue.trim();
if(""==_9c){
_9b.removeAttribute(this._attribName,0);
if("className"==this._attribName){
_9b.removeAttribute("class",0);
}
}else{
_9b[this._attribName]=this._newValue;
if(this._attribName.toLowerCase()=="nowrap"){
_9b.setAttribute(this._attribName,this._newValue);
}
}
this._isExecuted=true;
return true;
},unexecute:function(){
var _9d=this._nodeBookmark.select();
_9d[this._attribName]=this._oldValue;
}};
Telerik.Web.UI.Editor.AttributeCommand.registerClass("Telerik.Web.UI.Editor.AttributeCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.ClassNameCommand=function(_9e,_9f,_a0){
Telerik.Web.UI.Editor.ClassNameCommand.initializeBase(this,[(_9e||"Classname"),_9f,true]);
};
Telerik.Web.UI.Editor.ClassNameCommand.prototype={getValue:function(_a1){
_a1=_a1||this._window;
if($telerik.isIE){
return this._getValueIE(_a1);
}else{
return this._getValueMoz(_a1);
}
},_getValueIE:function(_a2){
var _a3=new Telerik.Web.UI.Editor.Selection(_a2);
var _a4=_a3.getParentElement();
if("BODY"==_a4.tagName){
return "";
}else{
return (""==_a4.className?"":_a4.className);
}
},_getValueMoz:function(_a5){
if(!_a5){
return "";
}
var _a6=_a5.getSelection();
if(!_a6){
return "";
}
if(_a6.rangeCount!=1){
return "";
}
var _a7=(_a6.focusNode.nodeType!=3?_a6.focusNode:_a6.focusNode.parentNode);
var _a8=(_a6.anchorNode.nodeType!=3?_a6.anchorNode:_a6.anchorNode.parentNode);
if(_a7!=_a8){
return "";
}
var _a9=new Telerik.Web.UI.Editor.Selection(_a5);
var _aa="",_ab;
if(null!=_a9&&null!=(_ab=_a9.getParentElement())){
_aa=_ab.className;
}
return (""==_aa?"":_aa);
}};
Telerik.Web.UI.Editor.ClassNameCommand.registerClass("Telerik.Web.UI.Editor.ClassNameCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.FormatBlockCommand=function(_ac,_ad,_ae){
Telerik.Web.UI.Editor.FormatBlockCommand.initializeBase(this,[(_ac||"Format Block"),_ad,true]);
this.FormatValue=_ae;
};
Telerik.Web.UI.Editor.FormatBlockCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.FormatBlockCommand(this.Title,this._window,this.FormatValue);
},getValue:function(_af){
try{
_af=_af||this._window;
var _b0=_af.document.queryCommandValue("FormatBlock");
if(!document.all){
switch(_b0){
case "x":
case "":
_b0="Normal";
break;
}
}
return _b0;
}
catch(ex){
}
return null;
},_isFormatBlockElement:function(_b1){
if(!_b1||!_b1.tagName){
return false;
}
var _b2=_b1.tagName;
if(_b2=="H1"||_b2=="H2"||_b2=="H3"||_b2=="H4"||_b2=="H5"||_b2=="H6"||_b2=="H7"||_b2=="ADDRESS"||_b2=="PRE"){
return true;
}
},OnExecuteIE:function(){
var _b3=this._window.document;
if("<p>"==this.FormatValue.toLowerCase()){
return _b3.execCommand("FormatBlock",false,"<p>")&&_b3.execCommand("RemoveFormat");
}
var _b4=_b3.selection.createRange();
var _b5=false;
var _b6=_b4.htmlText.trim();
if(_b6&&_b6.length>2&&_b6.substr(0,2).toLowerCase()=="<p"){
_b5=true;
}
if(!_b5&&""!=_b4.text){
var _b7=this.FormatValue.substring(1,this.FormatValue.length-1);
_b3.execCommand("FormatBlock",false,"<p>");
_b3.execCommand("RemoveFormat");
var _b8=_b3.createElement(_b7);
_b8.innerHTML=_b4.htmlText;
_b4.pasteHTML(_b8.outerHTML);
return true;
}else{
return _b3.execCommand("FormatBlock",false,this.FormatValue);
}
},OnExecuteMoz:function(){
var _b9=this.FormatValue.substring(1,this.FormatValue.length-1);
var _ba=this._window.document;
var _bb=("body"==this.FormatValue.toLowerCase()||"normal"==this.FormatValue.toLowerCase());
var _bc=null;
var _bd=_b9.indexOf(" ");
if(_bd!=-1){
_bc=_b9.substring(_bd+1);
_b9=_b9.substring(0,_bd);
}
if(this.isSafari){
if(_bb){
}else{
var _be=_ba.createElement(_b9);
if(_bc){
var _bf="";
_bf=_bc.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_bf.length>0){
_be.className=_bf;
}
}
var _c0=new Telerik.Web.UI.Editor.Selection(this._window);
_be.innerHTML=_c0.getHtml();
var _c1=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_be.outerHTML,true);
_c1.execute();
}
return;
}
if(_bb){
return _ba.execCommand("FormatBlock",false,"Normal");
}
var _c2=this._window.getSelection();
if(_c2.rangeCount<1){
return false;
}
var _c3=_c2.getRangeAt(0);
var _c4=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
if(_c3.toString()!=""&&!this._isFormatBlockElement(_c4)){
try{
var _be=_ba.createElement(_b9);
if(_bc){
var _bf="";
_bf=_bc.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_bf.length>0){
_be.className=_bf;
}
}
_be.appendChild(_c3.extractContents());
_c3.insertNode(_be);
return true;
}
catch(ex){
return false;
}
}else{
return _ba.execCommand("FormatBlock",false,this.FormatValue);
}
return false;
}};
Telerik.Web.UI.Editor.FormatBlockCommand.registerClass("Telerik.Web.UI.Editor.FormatBlockCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.InsertListCommand=function(_c5,_c6,_c7,_c8,_c9){
Telerik.Web.UI.Editor.InsertListCommand.initializeBase(this,[(_c5||"Insert List"),_c6,true]);
this._newLineBr=(_c7==true);
this._commandName=_c8;
this._listType=(_c8=="InsertOrderedList")?"OL":"UL";
this._listStyle=_c9;
this._document=this._window.document;
};
Telerik.Web.UI.Editor.InsertListCommand.prototype={_insertList:function(){
return this._document.execCommand(this._commandName,false,false);
},_pasteHtml:function(_ca){
var _cb=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_ca);
_cb.execute();
},_expandSelection:function(_cc,_cd,_ce){
var _cf=_cc.duplicate();
var _d0=null;
var _d1=null;
for(var i=_cd.length-1;i>=0;i--){
_cf.moveToElementText(_cd[i]);
var _d3=_cc.compareEndPoints("StartToStart",_cf);
if(-1==_d3||0==_d3){
if(_ce[_cd[i].tagName]!=null){
_d1=_cd[i];
}
}else{
if(_ce[_cd[i].tagName]!=null){
_d0=_cd[i];
break;
}
}
}
if(_d0){
_cf.moveToElementText(_d0);
_cc.setEndPoint("StartToEnd",_cf);
}else{
var _d4=_cc.parentElement();
_cf.moveToElementText(_d4);
_cc.setEndPoint("StartToStart",_cf);
}
if(_d1){
_cf.moveToElementText(_d1);
if("BR"==_d1.tagName){
_cc.setEndPoint("EndToEnd",_cf);
}else{
_cc.setEndPoint("EndToStart",_cf);
}
}else{
var _d4=_cc.parentElement();
_cf.moveToElementText(_d4);
_cc.setEndPoint("EndToEnd",_cf);
}
_cc.select();
},_handleEmptyListSelection:function(_d5,_d6){
var _d7=_d5.parentElement();
var _d8=(_d7&&"P"==_d7.tagName.toUpperCase());
var brs=_d7.getElementsByTagName("BR");
if(_d8&&brs.length==0){
return this._insertList();
}else{
var _da={};
_da["BR"]="";
_da["TD"]="";
_da["OL"]="";
_da["UL"]="";
_da["TABLE"]="";
_da["DIV"]="";
_da["IMG"]="";
_da["OBJECT"]="";
var _db=_d5.parentElement().getElementsByTagName("*");
this._expandSelection(_d5,_db,_da);
if(_d5.htmlText){
return this.OnExecuteIE();
}
}
},OnExecuteIE:function(){
if(!this._newLineBr){
return this._insertList();
}
var _dc=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
var _dd=this._document.selection.createRange();
if("OL"==_dc.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_dc,"OL")!=null||"UL"==_dc.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_dc,"UL")!=null){
return this._insertList();
}else{
if("TD"==_dc.tagName||"TR"==_dc.tagName||"TBODY"==_dc.tagName||"TABLE"==_dc.tagName){
var _dd=this._document.selection.createRange();
var _de=_dd.parentElement().getElementsByTagName("TD");
for(var i=_de.length-1;i>=0;i--){
brRange=_dd.duplicate();
brRange.moveToElementText(_de[i]);
if(_dd.inRange(brRange)&&_de[i].innerHTML!=""){
_dd.moveToElementText(_de[i]);
}
}
}
}
var _e0=this._document.selection;
var _e1=this._listType;
if(_e0.type=="Control"){
var _e2=this._document.body.createTextRange();
_e2.moveToElementText(_dd(0));
var _e3=_e2.parentElement();
var _e4=_e3.tagName.toLowerCase();
if(_e4=="table"||_e4=="tbody"){
var _e5=_e3.parentNode.outerHTML;
_e3.parentNode.outerHTML="<"+_e1+"><LI>"+_e5+"</LI></"+_e1+">";
}else{
var _e5=_e2.htmlText;
this._pasteHtml("<"+_e1+"><LI>"+_e5+"</LI></"+_e1+">");
}
}else{
if(_dd.htmlText==""){
return this._handleEmptyListSelection(_dd,this._commandName);
}
var _e6=this._document.createElement("SPAN");
_e6.innerHTML=_dd.htmlText;
if(_e6.getElementsByTagName("P").length>0){
return this._insertList();
}else{
var _e7;
if(_dd.parentElement().tagName.toUpperCase()=="LI"){
_e7=_dd.parentElement().parentNode;
}else{
_e7=_dd.parentElement();
}
if(_e7.tagName.toUpperCase()=="OL"||_e7.tagName.toUpperCase()=="UL"){
var _e8=_e7.tagName.toUpperCase();
if(_e1==_e8){
if(this._newLineBr){
var _e9=_dd.duplicate();
var _ea=_dd.duplicate();
_ea.moveToElementText(_e7);
var _eb=_dd.duplicate();
var _ec=_e7.getElementsByTagName("LI");
var _ed=0;
var _ee=_ec.length-1;
var _ef=_dd.duplicate();
_ef.moveToElementText(_ec[0]);
var _f0=_dd.duplicate();
_f0.moveToElementText(_ec[_ec.length-1]);
_eb.setEndPoint("EndToEnd",_f0);
_eb.setEndPoint("StartToStart",_ef);
while((_ed<_ec.length)&&(_eb.compareEndPoints("StartToStart",_e9)<=0)){
_eb.moveToElementText(_ec[_ed]);
_eb.setEndPoint("EndToEnd",_f0);
_ed++;
}
_ed-=2;
while((_ee>0)&&(_eb.compareEndPoints("EndToEnd",_e9)>=0)){
_eb.moveToElementText(_ec[_ee]);
_eb.setEndPoint("StartToStart",_ef);
_ee--;
}
_ee+=2;
var _f1=_dd.duplicate();
var _f2=_dd.duplicate();
_f1.moveToElementText(_ec[_ed]);
_f1.collapse(true);
_f1.setEndPoint("StartToStart",_ea);
_f2.moveToElementText(_ec[_ee]);
_f2.collapse(false);
_f2.setEndPoint("EndToEnd",_ea);
_dd.setEndPoint("StartToEnd",_f1);
_dd.setEndPoint("EndToStart",_f2);
var _f3="";
var _f4=false;
var _f5=false;
if(_f1.htmlText.replace(/<(.*?)>/)!=""){
_f3+="<"+_e8+">"+_f1.htmlText+"</"+_e8+">";
}else{
_f4=true;
}
_f3+=_dd.htmlText.replace(/<LI\/?>/gi,"<BR>").replace(/<\/LI>/gi,"").replace(/^\s*<BR\/?>/gi,"").replace(/<BR\/?>\s*$/gi,"");
if(_f2.htmlText.replace(/<(.*?)>/)!=""){
_f3+="<"+_e8+">"+_f2.htmlText+"</"+_e8+">";
}else{
_f5=true;
_f3+="<BR>";
}
if(_f4&&_f5){
_f3=_f3.replace(new RegExp("</?"+_e8+"/?>","gi"),"").replace(/^\s*<BR\/?>/gi,"");
}
if(_e7.parentNode.childNodes[0]==_e7){
_ea.collapse();
_e7.parentNode.removeChild(_e7,_f3);
}else{
_ea.moveStart("character",-1);
}
this._pasteHtml(_f3);
}else{
return this._insertList();
}
}else{
return this._insertList();
}
}else{
var _f6=_dd.duplicate();
_f6.collapse(false);
_f6.moveEnd("character",1);
if(_f6.htmlText.match(/<BR\/?>/gi)){
_dd.moveEnd("character",1);
}
var _f7="<"+_e1+"><LI>"+_dd.htmlText.replace(/(<BR\s*>\s*)*$/gi,"").replace(/<BR\/?>$/gi,"").replace(/<BR\/?>/gi,"</LI><LI>")+"</LI></"+_e1+">";
try{
_dd.pasteHTML(_f7);
}
catch(e){
}
}
}
}
return true;
},OnExecuteMoz:function(){
return this._insertList();
}};
Telerik.Web.UI.Editor.InsertListCommand.registerClass("Telerik.Web.UI.Editor.InsertListCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableCommandBase=function(_f8,_f9){
Telerik.Web.UI.Editor.TableCommandBase.initializeBase(this,[(_f8||"Table Command"),_f9,true]);
};
Telerik.Web.UI.Editor.TableCommandBase.prototype={getState:function(_fa){
return this.getSelectedCell(_fa)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
},getSelectedCell:function(_fb){
var _fc=new Telerik.Web.UI.Editor.Selection(_fb||this._window);
var _fd;
if(_fc){
_fd=_fc.getParentElement();
}
while(null!=_fd&&_fd.tagName!="TD"&&_fd.tagName!="TH"&&_fd.tagName!="BODY"){
_fd=_fd.parentNode;
}
if(!_fd||!_fd.tagName){
return null;
}
return (_fd.tagName=="TD"||_fd.tagName=="TH"?_fd:null);
},getSelectedRow:function(_fe){
var _ff=new Telerik.Web.UI.Editor.Selection(_fe||this._window);
var _100;
if(_ff){
_100=_ff.getParentElement();
}
if(!_100){
return null;
}
while(null!=_100&&_100.tagName!="TR"&&_100.tagName!="BODY"){
_100=_100.parentNode;
}
return (_100&&_100.tagName=="TR"?_100:null);
},getParentTable:function(_101){
if(!_101){
return null;
}
while(null!=_101&&_101.parentNode!=_101&&"TABLE"!=_101.tagName){
_101=_101.parentNode;
}
return (_101&&_101.tagName=="TABLE"?_101:null);
},getNextSiblingCell:function(cell){
if(!cell){
return null;
}
var row=cell.parentNode;
var _104=cell.cellIndex+1;
if(0<=_104&&_104<row.cells.length){
return row.cells[_104];
}
return null;
},getPreviouseSiblingCell:function(cell){
if(!cell){
return null;
}
var row=cell.parentNode;
var _107=cell.cellIndex-1;
if(0<=_107&&_107<row.cells.length){
return row.cells[_107];
}
return null;
}};
Telerik.Web.UI.Editor.TableCommandBase.registerClass("Telerik.Web.UI.Editor.TableCommandBase",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableInsertRow=function(_108,_109,_10a){
Telerik.Web.UI.Editor.TableInsertRow.initializeBase(this,[(_108||"Insert row"),_109,true]);
this._direction=_10a||"above";
};
Telerik.Web.UI.Editor.TableInsertRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertRow(this._title,this._window,this._direction);
},getState:function(_10b){
return (this.getSelectedRow(_10b)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var row=cell.parentNode;
var _10e=row.rowIndex;
if("below"==this._direction){
_10e++;
}
var _10f=this.getParentTable(row);
if(!_10f){
return false;
}
var _110=_10f.insertRow(_10e);
if(!_110){
return false;
}
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(row,_110);
var _111;
for(var i=0;i<row.cells.length;i++){
cell=row.cells[i];
_111=_110.insertCell(-1);
_111.colSpan=cell.colSpan;
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_111);
_111.innerHTML=this.isIE?"":"&nbsp;";
}
return true;
}};
Telerik.Web.UI.Editor.TableInsertRow.registerClass("Telerik.Web.UI.Editor.TableInsertRow",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteRow=function(_113,_114){
Telerik.Web.UI.Editor.TableDeleteRow.initializeBase(this,[(_113||"Delete Row"),_114,true]);
};
Telerik.Web.UI.Editor.TableDeleteRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableDeleteRow(this._title,this._window);
},getState:function(_115){
return (this.getSelectedRow(_115)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var row=this.getSelectedRow();
if(!row){
return false;
}
row.parentNode.removeChild(row);
return true;
}};
Telerik.Web.UI.Editor.TableDeleteRow.registerClass("Telerik.Web.UI.Editor.TableDeleteRow",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableInsertColumn=function(_117,_118,_119){
Telerik.Web.UI.Editor.TableInsertColumn.initializeBase(this,[(_117||"Insert column"),_118,true]);
this._direction=_119||"left";
};
Telerik.Web.UI.Editor.TableInsertColumn.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertColumn(this._title,this._window,this._direction);
},getState:function(_11a){
return (this.getSelectedCell(_11a)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _11c=cell.cellIndex;
if("right"==this._direction){
_11c++;
}
var _11d=this.getParentTable(cell);
if(!_11d){
return false;
}
var rows=_11d.rows;
var _11f;
for(var i=0;i<rows.length;i++){
_11f=rows[i].insertCell(_11c);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_11f);
_11f.innerHTML=this.isIE?"":"&nbsp;";
}
return true;
}};
Telerik.Web.UI.Editor.TableInsertColumn.registerClass("Telerik.Web.UI.Editor.TableInsertColumn",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteColumn=function(_121,_122,_123){
Telerik.Web.UI.Editor.TableDeleteColumn.initializeBase(this,[(_121||"Delete column"),_122,true]);
};
Telerik.Web.UI.Editor.TableDeleteColumn.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableDeleteColumn.New(this._title,this._window);
},getState:function(_124){
return (this.getSelectedCell(_124)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _126=cell.cellIndex;
var _127=this.getParentTable(cell);
if(!_127){
return false;
}
var rows=_127.rows;
for(var i=0;i<rows.length;i++){
cell=rows[i].cells[_126];
if(cell){
cell.parentNode.removeChild(cell);
}
}
return true;
}};
Telerik.Web.UI.Editor.TableDeleteColumn.registerClass("Telerik.Web.UI.Editor.TableDeleteColumn",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeRows=function(_12a,_12b){
Telerik.Web.UI.Editor.TableMergeRows.initializeBase(this,[(_12a||"Merge rows"),_12b,true]);
};
Telerik.Web.UI.Editor.TableMergeRows.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeRows.New(this._title,this._window);
},getState:function(_12c){
var cell=this.getSelectedCell(_12c);
if(null!=cell&&null!=this.getLowerCell(cell)&&1==cell.colSpan){
return Telerik.Web.UI.Editor.CommandStates.Off;
}else{
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _12f=this.getLowerCell(cell);
if(!_12f){
return false;
}
if(""!=_12f.innerHTML){
if(""!=cell.innerHTML){
cell.innerHTML+="<br>";
}
cell.innerHTML+=_12f.innerHTML;
}
cell.rowSpan+=_12f.rowSpan;
_12f.parentNode.removeChild(_12f);
return true;
},getLowerCell:function(cell){
if(!cell){
return null;
}
var _131=this.getParentTable(cell);
var row=cell.parentNode;
var _133=_131.rows[row.rowIndex+cell.rowSpan];
if(!_133){
return null;
}
var _134=_133.cells[cell.cellIndex];
return _134;
}};
Telerik.Web.UI.Editor.TableMergeRows.registerClass("Telerik.Web.UI.Editor.TableMergeRows",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeColumns=function(_135,_136){
Telerik.Web.UI.Editor.TableMergeColumns.initializeBase(this,[(_135||"Merge columns"),_136,true]);
};
Telerik.Web.UI.Editor.TableMergeColumns.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeColumns.New(this._title,this._window);
},getState:function(_137){
var cell=this.getSelectedCell(_137);
if(null!=cell&&null!=this.getNextSiblingCell(cell)){
return Telerik.Web.UI.Editor.CommandStates.Off;
}else{
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
},onExecute:function(){
var cell=this.getSelectedCell();
if(null==cell){
return false;
}
var _13a=this.getNextSiblingCell(cell);
if(!_13a){
return false;
}
cell.colSpan+=_13a.colSpan;
if(""!=_13a.innerHTML){
if(""!=cell.innerHTML){
cell.innerHTML+="<br>";
}
cell.innerHTML+=_13a.innerHTML;
}
_13a.parentNode.removeChild(_13a);
return true;
}};
Telerik.Web.UI.Editor.TableMergeColumns.registerClass("Telerik.Web.UI.Editor.TableMergeColumns",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableSplitCell=function(_13b,_13c){
Telerik.Web.UI.Editor.TableSplitCell.initializeBase(this,[(_13b||"Split cell"),_13c,true]);
this._newRows=2;
this._newColumns=2;
};
Telerik.Web.UI.Editor.TableSplitCell.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableSplitCell(this._title,this._window);
},getState:function(_13d){
var cell=this.getSelectedCell(_13d);
if(!cell){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
return ((cell.colSpan>1||cell.rowSpan>1)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
var _140=this.getParentTable(cell);
if(!_140){
return false;
}
var row=cell.parentNode;
var _142=("THEAD"==row.parentNode.tagName.toUpperCase()?"TH":"TD");
if(cell.colSpan>1){
for(i=1;i<this._newColumns;i++){
var _143=this._window.document.createElement(_142);
_143.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_143);
_143.colSpan=1;
if(cell.cellIndex+1<row.cells.length){
row.insertBefore(_143,row.cells[cell.cellIndex+1]);
}else{
row.appendChild(_143);
}
cell.colSpan--;
}
}
if(cell.rowSpan>1){
for(i=1;i<this._newRows;i++){
var _144=_140.rows[row.rowIndex+cell.rowSpan-1];
if(!_144||0==_144.cells.length){
break;
}
var _143=this._window.document.createElement(_142);
_143.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(cell,_143);
_143.rowSpan=1;
if(cell.cellIndex+1<_144.cells.length){
_144.insertBefore(_143,_144.cells[cell.cellIndex+1]);
}else{
_144.appendChild(_143);
}
cell.rowSpan--;
}
}
return true;
}};
Telerik.Web.UI.Editor.TableSplitCell.registerClass("Telerik.Web.UI.Editor.TableSplitCell",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteCell=function(_145,_146){
Telerik.Web.UI.Editor.TableDeleteCell.initializeBase(this,[(_145||"Delete cell"),_146,true]);
};
Telerik.Web.UI.Editor.TableDeleteCell.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableDeleteCell(this._title,this._window);
},onExecute:function(){
var cell=this.getSelectedCell();
if(!cell){
return false;
}
cell.parentNode.removeChild(cell);
return true;
}};
Telerik.Web.UI.Editor.TableDeleteCell.registerClass("Telerik.Web.UI.Editor.TableDeleteCell",Telerik.Web.UI.Editor.TableCommandBase);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorButton=function(_148){
Telerik.Web.UI.EditorButton.initializeBase(this,[_148]);
this._attributes={};
this._autoPostBack=false;
this._enabled=true;
this._name="";
this._text="";
this._shortCut="";
this._showIcon=true;
this._showText=false;
this._clientTypeName="Telerik.Web.UI.EditorButton";
this._isOn=false;
this._skin="";
this._addClickHandler=false;
};
Telerik.Web.UI.EditorButton.createToolWrapper=function(_149,skin){
var ul=document.createElement("UL");
var li=document.createElement("LI");
li.innerHTML="&nbsp;";
li.className="rade_grip grip_first";
ul.appendChild(li);
ul.className="rade_toolbar "+skin;
var _14d=_149.get_element();
ul.appendChild(_14d);
li=document.createElement("LI");
li.innerHTML="&nbsp;";
li.className="rade_grip grip_last";
ul.appendChild(li);
return ul;
};
Telerik.Web.UI.EditorButton.getToolRootNode=function(_14e){
while(_14e&&_14e.tagName!="LI"){
_14e=_14e.parentNode;
}
return _14e;
};
Telerik.Web.UI.EditorButton._createButton=function(_14f){
var _150=document.createElement("LI");
var a=document.createElement("A");
_150.appendChild(a);
a.className=_14f.showText==true?"rade_tool_text":"rade_tool";
var text=_14f["text"];
a.title=text?text:_14f["name"];
a.href="#";
a.setAttribute("unselectable","on");
if(_14f.showIcon!=false){
var span=document.createElement("SPAN");
span.className=_14f.name;
span.innerHTML="&nbsp;";
span.setAttribute("unselectable","on");
a.appendChild(span);
}
if(_14f.showText==true){
var span=document.createElement("SPAN");
span.className="rade_button_text";
span.innerHTML=_14f.text?_14f.text:_14f.name;
span.setAttribute("unselectable","on");
a.appendChild(span);
}
return _150;
};
Telerik.Web.UI.EditorButton.createTool=function(_154,_155,type,_157,_158){
if(!type){
type=Telerik.Web.UI.EditorButton;
}
if(!_157){
_157=Telerik.Web.UI.EditorButton._createButton(_154);
if(type==Telerik.Web.UI.EditorSplitButton||type.inheritsFrom(Telerik.Web.UI.EditorSplitButton)){
var a=_157.getElementsByTagName("A")[0];
if(a){
Sys.UI.DomElement.addCssClass(a,"rad_splitbutton");
var span=document.createElement("SPAN");
span.className="split_arrow";
span.innerHTML="&nbsp;";
a.appendChild(span);
}
}else{
if(type==Telerik.Web.UI.EditorDropDown||type.inheritsFrom(Telerik.Web.UI.EditorDropDown)){
var a=_157.getElementsByTagName("A")[0];
if(a){
Sys.UI.DomElement.removeCssClass(a,"rade_tool");
Sys.UI.DomElement.addCssClass(a,"rade_dropdown");
a.innerHTML="";
var span=document.createElement("SPAN");
span.innerHTML="&nbsp;";
var _15b=_154["width"]?_154["width"]:"50px";
span.style.width=_15b;
a.appendChild(span);
}
}
}
}
var tool=$create(type,_154,_155,null,_157);
if(_158&&_158.appendChild){
_158.appendChild(_157);
}
return tool;
};
Telerik.Web.UI.EditorButton.prototype={initialize:function(){
var _15d=this.getAnchorElement();
if(_15d){
if(!_15d.title||_15d.title.length==0){
_15d.title=this.get_text();
}
_15d.setAttribute("unselectable","on");
}
var span=this.getSpanElement();
if(span){
span.setAttribute("unselectable","on");
}
if(this._addClickHandler){
var _15f=this.get_element();
$addHandlers(_15f,{"click":this.click},this);
}
},dispose:function(){
var _160=this.get_element();
if(_160){
$clearHandlers(_160);
}
Telerik.Web.UI.EditorButton.callBaseMethod(this,"dispose");
},click:function(e){
this.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(e);
},add_valueSelected:function(_162){
this.get_events().addHandler("valueSelected",_162);
},remove_valueSelected:function(_163){
this.get_events().removeHandler("valueSelected",_163);
},raiseEvent:function(_164,_165){
var _166=this.get_events().getHandler(_164);
if(_166){
if(!_165){
_165=Sys.EventArgs.Empty;
}
_166(this,_165);
}
},set_width:function(_167){
var span=this.getSpanElement();
if(span){
span.style.width=_167;
}
},get_width:function(){
return this.get_element().offsetWidth;
},set_height:function(_169){
var span=this.getSpanElement();
if(span){
span.style.height=_169;
}
},get_height:function(){
return this.get_element().offsetHeight;
},isTarget:function(e){
return $telerik.isDescendantOrSelf(this.get_element(),e.target);
},setState:function(_16c){
this.set_enabled(_16c!=Telerik.Web.UI.Editor.CommandStates.Disabled);
this.setOn(_16c==Telerik.Web.UI.Editor.CommandStates.On);
},setFocus:function(){
var elem=this.getAnchorElement();
if(elem&&elem.focus){
elem.focus();
}
},get_addClickHandler:function(){
return this._addClickHandler;
},set_addClickHandler:function(_16e){
this._addClickHandler=_16e;
},get_attributes:function(){
return this._attributes;
},set_attributes:function(_16f){
this._attributes=_16f;
},get_autoPostBack:function(){
return this._autoPostBack;
},set_autoPostBack:function(_170){
this._autoPostBack=_170;
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_171){
if(this._enabled!=_171){
this._enabled=_171;
var _172=this.getAnchorElement();
if(!this._enabled){
this._addAnchorCssClass("rade_tool_disabled");
_172.setAttribute("disabled","disabled");
}else{
this._removeAnchorCssClass("rade_tool_disabled");
_172.removeAttribute("disabled");
}
}
},isOn:function(){
return this._isOn;
},setOn:function(_173){
if(this._isOn!=_173){
this._isOn=_173;
if(this._isOn){
this._addAnchorCssClass("rade_tool_selected");
}else{
this._removeAnchorCssClass("rade_tool_selected");
}
}
},get_name:function(){
return this._name;
},set_name:function(_174){
this._name=_174;
},get_text:function(){
if(!this._text){
return this.get_name();
}else{
return this._text;
}
},set_text:function(_175){
if(this._text!=_175){
this._text=_175;
if(this.get_showText()){
this.getSpanElement().innerHTML=_175;
}
}
},get_shortCut:function(){
return this._shortCut;
},set_shortCut:function(_176){
this._shortCut=_176;
},get_showIcon:function(){
return this._showIcon;
},set_showIcon:function(_177){
if(this._showIcon!=_177){
this._showIcon=_177;
}
},get_skin:function(){
return this._skin;
},set_skin:function(_178){
this._skin=_178;
},_addAnchorCssClass:function(_179){
Sys.UI.DomElement.addCssClass(this.getAnchorElement(),_179);
},_removeAnchorCssClass:function(_17a){
Sys.UI.DomElement.removeCssClass(this.getAnchorElement(),_17a);
},get_showText:function(){
return this._showText;
},set_showText:function(_17b){
if(this._showText!=_17b){
this._showText=_17b;
}
},get_type:function(){
return this._type;
},set_type:function(_17c){
this._type=_17c;
},get_clientTypeName:function(){
return this._clientTypeName;
},set_clientTypeName:function(_17d){
this._clientTypeName=_17d;
},getAnchorElement:function(){
var _17e=this.get_element().firstChild;
while(_17e!=null&&(_17e.tagName==null)){
_17e=_17e.nextSibling;
}
return _17e;
},getSpanElement:function(){
var _17f=this.getAnchorElement();
var _180=_17f.firstChild;
while(_180!=null&&(_180.tagName==null||_180.tagName.toLowerCase()!="span")){
_180=_180.nextSibling;
}
return _180;
}};
Telerik.Web.UI.EditorButton.registerClass("Telerik.Web.UI.EditorButton",Sys.UI.Control);
Telerik.Web.UI.EditorSpinBoxEventArgs=function(_181,_182){
Telerik.Web.UI.EditorSpinBoxEventArgs.initializeBase(this);
this._newValue=_181;
this._oldValue=_182;
};
Telerik.Web.UI.EditorSpinBoxEventArgs.prototype={get_oldValue:function(){
return this._oldValue;
},get_newValue:function(){
return this._newValue;
}};
Telerik.Web.UI.EditorSpinBoxEventArgs.registerClass("Telerik.Web.UI.EditorSpinBoxEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.EditorSpinBox=function(_183){
Telerik.Web.UI.EditorSpinBox.initializeBase(this,[_183]);
this._width="50px";
this._className="rade_SpinBox";
this._selectedItem="";
this._initialValue="";
this._visibleInput=true;
this._enabledIncrease=true;
this._enabledDecrease=true;
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSpinBox.prototype={dispose:function(){
this._inputElement.onchange=null;
this._inputElement.onkeypress=null;
this._inputElement.onclick=null;
this._inputElement=null;
this._increaseButton.onclick=null;
this._increaseButton=null;
this._decreaseButton.onclick=null;
this._decreaseButton=null;
Telerik.Web.UI.EditorSpinBox.callBaseMethod(this,"dispose");
},initialize:function(){
this._createInputElement();
this._createPlusMinusList();
},_createInputElement:function(){
var _184=document.createElement("INPUT");
_184.setAttribute("size","3");
_184.style.width="30px";
_184.onclick=function(e){
this.focus();
};
_184.onkeypress=Function.createDelegate(this,this._onKeyPressHandler);
_184.onchange=Function.createDelegate(this,this._onChangeHandler);
this._inputElement=_184;
var _186=this.get_element();
_186.appendChild(_184);
_186.style.width=this.get_width();
_186.className=(this.get_skin()+" "+this._className);
},_createPlusMinusList:function(){
var _187=document.createElement("UL");
this.get_element().appendChild(_187);
var _188=document.createElement("LI");
Sys.UI.DomElement.addCssClass(_188,"rade_SpinBox_tool rade_sbt_increase");
_187.appendChild(_188);
var _189=document.createElement("A");
_189.title="Increase";
_189.href="javascript:void(0);";
_189.innerHTML="<span>+</span>";
_189.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
_188.appendChild(_189);
this._increaseButton=_189;
var _188=document.createElement("LI");
Sys.UI.DomElement.addCssClass(_188,"rade_SpinBox_tool rade_sbt_decrease");
_187.appendChild(_188);
var _189=document.createElement("A");
_189.title="Decrease";
_189.href="javascript:void(0);";
_189.innerHTML="<span>-</span>";
_189.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
_188.appendChild(_189);
this._decreaseButton=_189;
},_executeFunction:function(e,elem,_18c){
if(_18c){
if(elem.Executed){
elem.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
elem.Executed=true;
var _18d=(this._selectedItem!="")?this._selectedItem:this._initialValue;
this._selectedItem=elem.value;
var _18e=new Telerik.Web.UI.EditorSpinBoxEventArgs(elem.value,_18d);
this.raiseEvent("valueSelected",_18e);
},_onPlusMinusClickHandler:function(e){
var _190=null;
if(!e){
_190=window.event.srcElement;
}else{
_190=e.target;
}
if(!_190){
return;
}
var _191=_190.parentNode;
var _192=this.get_value();
_192=_192.replace(/^0+(\d)/ig,"$1");
if(""==_192){
_192="0";
}
var _193=parseInt(_192);
var _194=_193+"";
if(isNaN(_193)){
return;
}else{
_194=_192.substring(_194.length);
}
if(_191==this._increaseButton){
if(this._enabledIncrease){
_193++;
}else{
return;
}
}else{
if(_191==this._decreaseButton){
if(this._enabledDecrease){
_193--;
}else{
return;
}
}else{
_191=null;
}
}
if(_191){
this.set_value(_193+_194);
this._executeFunction(e,this._inputElement);
}
},_onChangeHandler:function(e){
if(!e){
e=window.event;
}
this._executeFunction(e,this._inputElement);
},_onKeyPressHandler:function(e){
if(!e){
e=window.event;
}
if(e.keyCode==13){
this._executeFunction(e,this._inputElement);
return $telerik.cancelRawEvent(e);
}
},_onKeyDownHandler:function(e){
if(!e){
var e=window.event;
}
e.returnValue=this._isKeyValid(e);
},_onKeyUpHandler:function(e){
if(!e){
var e=window.event;
}
if(this._isKeyValid(e,true)){
var _199=this._selectedItem;
var _19a=this.get_value();
var _19b=new Telerik.Web.UI.EditorSpinBoxEventArgs(_19a,_199);
this.raiseEvent("valueSelected",_19b);
}
},_isKeyValid:function(e,_19d){
try{
if(!_19d){
_19d=false;
}
if(!e){
e=window.event;
}
var _19e=((48<=e.keyCode&&e.keyCode<=57)||(96<=e.keyCode&&e.keyCode<=105)||(13==e.keyCode)||(8==e.keyCode)||(46==e.keyCode)||(9==e.keyCode));
if(!_19d){
_19e|=((35<=e.keyCode&&e.keyCode<=40));
}
return _19e;
}
catch(ex){
return true;
}
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_19f){
if(null==_19f){
_19f="";
}
this._inputElement.value=_19f;
if(this._initialValue==""){
this._initialValue=_19f;
}
},get_width:function(){
return this._width;
},set_width:function(_1a0){
this._width=_1a0;
var _1a1=this.get_element();
_1a1.style.width=this._width;
},get_enabledIncrease:function(){
return this._enabledIncrease;
},set_enabledIncrease:function(_1a2){
this._enabledIncrease=_1a2;
if(!this._enabledIncrease){
Sys.UI.DomElement.addCssClass(this._increaseButton,"disabled-button");
}else{
Sys.UI.DomElement.removeCssClass(this._increaseButton,"disabled-button");
}
},get_enabledDecrease:function(){
return this._enabledDecrease;
},set_enabledDecrease:function(_1a3){
this._enabledDecrease=_1a3;
if(!this._enabledDecrease){
Sys.UI.DomElement.addCssClass(this._decreaseButton,"disabled-button");
}else{
Sys.UI.DomElement.removeCssClass(this._decreaseButton,"disabled-button");
}
},get_visibleInput:function(){
return this._visibleInput;
},set_visibleInput:function(_1a4){
this._visibleInput=_1a4;
if(!this._visibleInput){
this._inputElement.style.display="none";
}else{
this._inputElement.style.display="";
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1a5){
this._clientStateFieldID=_1a5;
}};
Telerik.Web.UI.EditorSpinBox.registerClass("Telerik.Web.UI.EditorSpinBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorCheckBox=function(_1a6){
Telerik.Web.UI.EditorCheckBox.initializeBase(this,[_1a6]);
this._selectedItem=false;
};
Telerik.Web.UI.EditorCheckBox.prototype={dispose:function(){
this._inputElement.onclick=null;
this._inputElement.Parent=null;
this._inputElement=null;
Telerik.Web.UI.EditorCheckBox.callBaseMethod(this,"dispose");
},get_selectedItem:function(){
return this._selectedItem;
},set_value:function(_1a7){
if(this._inputElement.checked!=_1a7){
this._inputElement.checked=_1a7;
}
},initialize:function(){
var _1a8=document.createElement("INPUT");
_1a8.setAttribute("type","CHECKBOX");
_1a8.Parent=this;
_1a8.onclick=function(e){
var oP=this.Parent;
oP._selectedItem=!oP._selectedItem;
this.checked=oP._selectedItem;
oP._selectedItem=this.checked;
oP.raiseEvent("valueSelected");
};
this._inputElement=_1a8;
this.get_element().appendChild(_1a8);
}};
Telerik.Web.UI.EditorCheckBox.registerClass("Telerik.Web.UI.EditorCheckBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorTextBox=function(_1ab){
Telerik.Web.UI.EditorTextBox.initializeBase(this,[_1ab]);
this._width="110px";
this._selectedItem="";
};
Telerik.Web.UI.EditorTextBox.prototype={dispose:function(){
this._inputElement.onchange=null;
this._inputElement.onkeypress=null;
this._inputElement.onclick=null;
this._inputElement.Parent=null;
this._inputElement=null;
Telerik.Web.UI.EditorTextBox.callBaseMethod(this,"dispose");
},get_width:function(){
return this._width;
},set_width:function(_1ac){
this._width=_1ac;
},initialize:function(){
var _1ad=document.createElement("INPUT");
_1ad.style.width=this.get_width();
_1ad.Parent=this;
var _1ae=this.get_name();
var _1af=function(e,elem,_1b2){
if(_1b2){
if(elem.Executed){
elem.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
elem.Executed=true;
elem.Parent._selectedItem=elem.value;
elem.Parent.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(e);
};
_1ad.onchange=function(e){
if(!e){
e=window.event;
}
return _1af(e,this,true);
};
_1ad.onclick=function(e){
this.focus();
};
_1ad.onkeypress=function(e){
if(!e){
e=window.event;
}
if(e.keyCode==13){
return _1af(e,this);
}
};
this._inputElement=_1ad;
this.get_element().appendChild(_1ad);
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1b6){
if(null==_1b6){
_1b6="";
}
this._inputElement.value=_1b6;
}};
Telerik.Web.UI.EditorTextBox.registerClass("Telerik.Web.UI.EditorTextBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.ImageDialogCaller=function(_1b7){
Telerik.Web.UI.ImageDialogCaller.initializeBase(this,[_1b7]);
this._width="150px";
this._className="rade_ImageDialogCaller";
this._editor=null;
this._clientStateFieldID=null;
};
Telerik.Web.UI.ImageDialogCaller.prototype={dispose:function(){
this._inputElement=null;
this._pushButton.onclick=null;
this._pushButton=null;
this._editor=null;
Telerik.Web.UI.ImageDialogCaller.callBaseMethod(this,"dispose");
},initialize:function(){
this._createInputElement();
this._createButton();
var _1b8=this.get_element();
_1b8.style.width=parseInt(this._inputElement.style.width)+30+"px";
_1b8.className=(this.get_skin()+" "+this._className);
},_createInputElement:function(){
var _1b9=document.createElement("INPUT");
_1b9.style.width=this.get_width();
this._inputElement=_1b9;
this.get_element().appendChild(_1b9);
},_createButton:function(){
var _1ba=document.createElement("A");
_1ba.title="Call Image Manager";
_1ba.href="javascript:void(0);";
_1ba.onclick=Function.createDelegate(this,this._onButtonClickHandler);
_1ba.innerHTML="<span>...</span>";
this.get_element().appendChild(_1ba);
this._pushButton=_1ba;
},_onButtonClickHandler:function(e){
var _1bc=this;
var _1bd=function(_1be,args){
var src="";
var img=args.Result;
if(img){
src=img.getAttribute("src",2);
}
if(src){
_1bc._inputElement.value=src;
_1bc.raiseEvent("valueSelected");
}
};
this._editor.showDialog("ImageManager",{},_1bd);
},get_editor:function(){
return this._editor;
},set_editor:function(_1c2){
this._editor=_1c2;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_1c3){
if(null==_1c3){
_1c3="";
}
this._inputElement.value=_1c3;
},get_width:function(){
return this._width;
},set_width:function(_1c4){
this._width=_1c4;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_1c5){
this._clientStateFieldID=_1c5;
}};
Telerik.Web.UI.ImageDialogCaller.registerClass("Telerik.Web.UI.ImageDialogCaller",Telerik.Web.UI.EditorButton);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorDropDown=function(_1c6){
Telerik.Web.UI.EditorDropDown.initializeBase(this,[_1c6]);
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 _1c8=false;
if(!this._rendered){
this.render();
_1c8=true;
}
this.raiseEvent("show");
if(!this._childrenRendered){
this.renderChildren();
this._childrenRendered=true;
_1c8=true;
}
if(_1c8){
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 _1ca=this.resolveActiveIndex(e);
if(_1ca>-1){
this.set_activeIndex(_1ca,e);
}
this._cancelEvent(e);
},_cancelEvent:function(e){
if(e){
e.preventDefault();
e.stopPropagation();
e.returnValue=false;
e.cancelBubble=true;
}
},_onPopupClick:function(e){
var _1cd=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_1cd>-1){
this._selectedIndex=_1cd;
this.hide();
this.raiseEvent("valueSelected");
}
},get_activeIndex:function(){
return this._activeIndex;
},set_activeIndex:function(_1ce,e){
this._activeIndex=_1ce;
this.selectUIItem(e);
},selectPreviousItem:function(){
var _1d0=this.get_activeIndex();
if(_1d0-1>=0){
this.set_activeIndex(_1d0-1);
}
},selectNextItem:function(){
var _1d1=this.get_activeIndex();
if(_1d1+1<this._items.length){
this.set_activeIndex(_1d1+1);
}
},selectUIItem:function(e,_1d3){
if(!this._popupElement){
return;
}
var _1d4=this._popupElement.getElementsByTagName("TD");
var len=_1d4.length;
var _1d6=this.get_activeIndex();
var _1d7=null;
for(var i=0;i<len;i++){
var _1d9=_1d4[i];
if(_1d9.item_index==_1d6){
_1d9.className="rade_itemOver";
_1d7=_1d9;
}else{
if(_1d3&&_1d9.item_index<=_1d6){
_1d9.className="rade_itemOver";
}else{
_1d9.className="";
}
}
}
if(_1d7&&!e){
this._scrollIntoView(_1d7,_1d7.parentNode.parentNode.parentNode.parentNode);
}
return _1d7;
},_scrollIntoView:function(_1da,_1db){
if($telerik.isIE||!_1db){
var _1dc=_1db;
_1dc.scrollTop=0;
var _1dd=_1dc.getClientRects()[0];
var _1de=_1dd.top;
var _1df=_1dd.bottom;
var _1e0=_1da.getClientRects()[0].bottom;
if(_1e0==0){
return;
}
while(_1e0>_1df||_1e0<_1de){
var _1e1="down";
if(_1e0<_1de){
_1e1="up";
}
_1dc.doScroll(_1e1);
_1e0=_1da.getClientRects()[0].bottom;
}
}else{
if(_1da.scrollIntoView){
_1da.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 _1e2=this._itemRootElement;
this.renderItemRoot();
_1e2.parentNode.replaceChild(this._itemRootElement,_1e2);
}
},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 _1e3=this._itemRootElement.rows[this._itemRootElement.rows.length-1];
var cell=_1e3.insertCell(-1);
return cell;
},renderChildren:function(){
for(var i=0;i<this._items.length;i++){
if(0==(i%this._itemsPerRow)){
this.renderNewRow();
}
var _1e6=this.renderItemContainer();
this.markItemContainer(_1e6,i);
this.renderChild(_1e6,this._items[i],i);
}
},renderChild:function(_1e7,_1e8,_1e9){
var _1ea=document.createElement("span");
if(_1e8){
var _1eb=null;
var _1ec=null;
if(_1e8 instanceof Array){
_1eb=_1e8[1];
_1ec=_1e8[2];
}else{
_1eb=_1e8;
}
if(_1ec){
var _1ed=document.createElement("span");
_1ed.innerHTML="&nbsp;";
_1ed.className=_1ec;
_1ea.appendChild(_1ed);
}
if(_1eb){
_1ea.innerHTML+=_1eb;
_1ea.noWrap=true;
}
}
_1e7.innerHTML=_1ea.innerHTML;
},resolveActiveIndex:function(e){
var _1ef=e.target;
var _1f0=-1;
while(_1ef&&_1ef!=this._itemRootElement){
if(null!=_1ef.item_index){
_1f0=_1ef.item_index;
break;
}
_1ef=_1ef.parentNode;
}
return _1f0;
},markItemContainer:function(_1f1,_1f2){
_1f1.item_index=_1f2;
},_makeAllItemsUnselectable:function(){
if(!this._popupElement){
return;
}
var _1f3=this._popupElement.getElementsByTagName("*");
var len=_1f3.length;
for(var i=0;i<len;i++){
_1f3[i].unselectable="on";
}
},_show:function(){
this.configurePopupPropertiesBeforeShow();
var _1f6=this._popupElement;
var _1f7=this.get_sizetofit();
var _1f8=_1f6.style.overflow;
if(_1f7){
_1f6.style.overflowY="hidden";
}
_1f6.style.width=this.get_popupwidth();
_1f6.style.height=this.get_popupheight();
this._itemRootElement.style.width="100%";
this._popupBehavior.show();
if(_1f7){
_1f6.style.width=this._getPopupChildrenWidth();
var _1f9=this._getPopupChildrenHeight();
if(_1f9!="0px"){
_1f6.style.height=_1f9;
}
}
this._popupBehavior.show();
this._getPopupVisibilityController().set_activePopup(this);
_1f6.style.zIndex="100000";
if(_1f7){
_1f6.style.overflowY=_1f8;
}
this._popupVisible=true;
},_getPopupChildrenWidth:function(){
var _1fa=this.get_popupElement().childNodes;
var _1fb=0;
for(var i=0;i<_1fa.length;i++){
var _1fd=_1fa[i].offsetWidth;
if(_1fd&&_1fd>_1fb){
_1fb=_1fd;
}
}
return _1fb+"px";
},_getPopupChildrenHeight:function(){
var _1fe=this.get_popupElement().childNodes;
var _1ff=0;
for(var i=0;i<_1fe.length;i++){
if(_1fe[i].offsetHeight){
_1ff+=_1fe[i].offsetHeight;
}
}
return _1ff+"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 _201=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_201;
},_createUI:function(){
if(this._popupBehavior){
return;
}
var _202=this.get_element();
if(!this._popupElement){
var _203=document.createElement("DIV");
$telerik.addCssClasses(_203,[this.get_skin(),this._rootPopupClassName,this.get_popupclassname()]);
this._popupElement=_203;
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":_202},null,null,this._popupElement);
this.attachEventHandlers();
},_getTable:function(){
var _204=document.createElement("table");
_204.border=0;
_204.cellPadding=0;
_204.setAttribute("unselectable","on");
_204.style.cursor="default";
return _204;
},get_clearSelectedOnShow:function(){
return this._clearSelectedOnShow;
},set_clearSelectedOnShow:function(_205){
this._clearSelectedOnShow=_205;
},get_popupElement:function(){
return this._popupElement;
},get_selectedItem:function(){
if(this._items&&this._selectedIndex>-1){
var item=this._items[this._selectedIndex];
var _207=((true==this._isArrayCollection)||(item instanceof Array))?item[0]:item;
return _207;
}
return null;
},get_selectedIndex:function(){
return this._selectedIndex;
},set_selectedIndex:function(_208){
this._selectedIndex=_208;
this.set_activeIndex(_208);
},get_items:function(){
return this._items;
},set_items:function(_209){
this.disposeChildren();
this._items=_209;
},get_itemsperrow:function(){
return this._itemsPerRow;
},set_itemsperrow:function(_20a){
this._itemsPerRow=_20a;
},get_sizetofit:function(){
return this._sizeToFit;
},set_sizetofit:function(_20b){
this._sizeToFit=_20b;
},get_popupclassname:function(){
return this._popupClassName;
},set_popupclassname:function(_20c){
this._popupClassName=_20c;
},get_rootpopupclassname:function(){
return this._rootPopupClassName;
},set_rootpopupclassname:function(_20d){
this._rootPopupClassName=_20d;
},get_popupwidth:function(){
return this._popupWidth;
},set_popupwidth:function(_20e){
this._popupWidth=_20e;
},get_popupheight:function(){
return this._popupHeight;
},set_popupheight:function(_20f){
this._popupHeight=_20f;
},add_show:function(_210){
this.get_events().addHandler("show",_210);
},remove_show:function(_211){
this.get_events().removeHandler("show",_211);
},add_hide:function(_212){
this.get_events().addHandler("hide",_212);
},remove_hide:function(_213){
this.get_events().removeHandler("hide",_213);
}};
Telerik.Web.UI.EditorDropDown.registerClass("Telerik.Web.UI.EditorDropDown",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorUpdateableDropDown=function(_214){
Telerik.Web.UI.EditorUpdateableDropDown.initializeBase(this,[_214]);
};
Telerik.Web.UI.EditorUpdateableDropDown.prototype={updateValue:function(oVal){
if(null==oVal){
return;
}
try{
if(!oVal){
oVal=this.get_text();
}
var _216=this.getSpanElement();
if(_216){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_216.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(_218){
Telerik.Web.UI.EditorSelfUpdateableDropDown.initializeBase(this,[_218]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSelfUpdateableDropDown.prototype={_onPopupClick:function(e){
var _21a=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_21a>-1){
this._selectedIndex=_21a;
this.hide();
var _21b=this.get_selectedItem();
if(_21b){
this.updateValue(_21b);
}
this.raiseEvent("valueSelected");
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_21c){
this._clientStateFieldID=_21c;
}};
Telerik.Web.UI.EditorSelfUpdateableDropDown.registerClass("Telerik.Web.UI.EditorSelfUpdateableDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorSplitButton=function(_21d){
Telerik.Web.UI.EditorSplitButton.initializeBase(this,[_21d]);
};
Telerik.Web.UI.EditorSplitButton.prototype={click:function(e){
var _21f=this.isArrowClicked(e.target);
if(_21f){
this.show();
}else{
var _220=this.get_selectedItem();
if(null==_220){
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(_221){
var _222=this._getArrowElement();
if(_221==_222){
return true;
}
return false;
},_getArrowElement:function(){
var _223=this.getAnchorElement().getElementsByTagName("SPAN");
var _224=_223[_223.length-1];
return _224;
}};
Telerik.Web.UI.EditorSplitButton.registerClass("Telerik.Web.UI.EditorSplitButton",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorToolStrip=function(_225){
Telerik.Web.UI.EditorToolStrip.initializeBase(this,[_225]);
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(_22b){
Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"set_selectedIndex",[_22b]);
if(this.get_updateHeader()){
var tool=this.get_selectedItem();
if(!tool||!tool.getSpanElement){
return;
}
var span=tool.getSpanElement();
if(span){
var _22e=span.cloneNode(true);
var _22f=this.getSpanElement();
var _230=_22f.parentNode;
_230.replaceChild(_22e,_22f);
var _231=tool.getAnchorElement();
if(_231){
_230.setAttribute("title",_231.getAttribute("title"));
}
}
}
},_onPopupClick:function(e){
var tool=this._resolveSelectedTool(e);
this._cancelEvent(e);
if(tool){
var _234=Array.indexOf(this._items,tool);
if($telerik.isSafari){
this._selectedIndex=_234;
this.set_activeIndex(_234);
}else{
this.set_selectedIndex(_234);
}
this.hide();
this.raiseEvent("valueSelected");
}
},renderItemRoot:function(){
var _235=document.createElement("DIV");
_235.className="rade_tlbVertical";
_235.style.cssFloat="left";
_235.style.width="100%";
this._itemRootElement=_235;
return this._itemRootElement;
},renderChildren:function(){
var _236=this.get_itemsperrow();
var _237=this.get_tools();
var ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
for(var i=0;i<_237.length;i++){
if(_236>1&&i>1&&(i%this.get_itemsperrow()==0)){
ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
}
var _23a=_237[i];
if(null==_23a["showText"]){
_23a["showText"]=true;
}
var tool=Telerik.Web.UI.EditorButton.createTool(_23a,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(_23f){
this._tools=_23f;
},get_updateHeader:function(){
return this._udpateHeader;
},set_updateHeader:function(_240){
this._udpateHeader=_240;
}};
Telerik.Web.UI.EditorToolStrip.registerClass("Telerik.Web.UI.EditorToolStrip",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.EditorContextMenu=function(_241){
Telerik.Web.UI.EditorContextMenu.initializeBase(this,[_241]);
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 _242=this._popupBehavior;
_242.set_positioningMode(Telerik.Web.PositioningMode.Absolute);
var _243=this.get_parentElement();
if(_243){
_242.set_parentElement(_243);
}
var e=this._eventObject;
if(e){
_242.set_x(e.clientX+10);
_242.set_y(e.clientY+10);
}
},set_eventObject:function(_245){
this._eventObject=_245;
},get_tagName:function(){
return this._tagName;
},set_tagName:function(_246){
this._tagName=_246;
},get_parentElement:function(){
return this._parentElement;
},set_parentElement:function(_247){
this._parentElement=_247;
}};
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(_248){
Telerik.Web.UI.Editor.AlignmentSelector.initializeBase(this,[_248]);
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(_249){
switch(_249.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(_24a){
if(!this._rendered){
this.render();
}
var _24b=this._itemRootElement;
var _24c=0;
for(var i=0;i<_24b.rows.length;i++){
var _24e=false;
for(var j=0;j<_24b.rows[i].cells.length;j++){
var cell=_24b.rows[i].cells[j];
var _251=this._isAvailable(_24c++);
cell.style.visibility=_251?"visible":"hidden";
_24e|=_251;
}
if(null!=document.all){
_24b.rows[i].style.display=_24e?"":"none";
}
}
},_isAvailable:function(_252){
var _253=false;
if(this._items){
var _254=this._items[_252];
_253=((null!=_254)&&(""!=_254[0]||""!=_254[1]));
}
return _253;
},renderChild:function(_255,_256,_257){
var _258=document.createElement("div");
if(_256){
_258.innerHTML="&nbsp;";
_258.className=this._alignmentClassName[_257];
}
_255.appendChild(_258);
},_onDropDownValueSelected:function(){
this.set_selectedIndex(this.get_selectedIndex());
},_selectAlignment:function(_259,_25a){
_259=(""==_259||!_259)?"none":_259.toUpperCase();
_25a=!_25a?"":_25a.toUpperCase();
if(this._items){
var _25b=-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==_25b){
_25b=i;
}
if((_259==ha||_259==va)&&(_25a==ha||_25a==va)){
this.set_selectedIndex(i);
return;
}
}
}
this.set_selectedIndex(_25b);
}
},set_selectedIndex:function(_25e){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"set_selectedIndex",[_25e]);
var span=this.getSpanElement();
var _260=this._alignmentClassName[_25e];
span.className=_260;
},setTagName:function(_261){
this._tagName=_261;
this._items=this._getLookupTableByTagName(this._tagName);
this.set_selectedIndex(this._noAlignmentIndex);
},updateValue:function(_262,_263){
this._selectAlignment(_262,_263);
},getAlign:function(){
var _264=this._items[this._selectedIndex];
var _265=(_264?_264[0]:"");
if("none"==_265){
_265="";
}
return _265;
},getVAlign:function(){
var _266=this._items[this._selectedIndex];
var _267=(_266?_266[1]:"");
if("none"==_267){
_267="";
}
return _267;
},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(_268){
this._clientStateFieldID=_268;
}};
Telerik.Web.UI.Editor.AlignmentSelector.registerClass("Telerik.Web.UI.Editor.AlignmentSelector",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.InsertTableHelper=function(_269){
Telerik.Web.UI.Editor.InsertTableHelper.initializeBase(this,[_269]);
};
Telerik.Web.UI.Editor.InsertTableHelper.prototype={initialize:function(){
var _26a=new Array(this.get_itemsperrow()*this.get_itemsperrow());
for(var i=0;i<_26a.length;i++){
_26a[i]=i;
}
this._items=_26a;
},hide:function(){
},renderChild:function(_26c,_26d,_26e){
var oDiv=document.createElement("div");
oDiv.innerHTML="&nbsp;";
_26c.appendChild(oDiv);
var dim=this._getDimensionByIndex(_26e);
_26c.setAttribute("title"," "+dim.rows+" x "+dim.cols+" ");
},_getDimensionByIndex:function(_271){
var _272=0;
var _273=0;
var _274=this.get_itemsperrow();
for(var i=0;i<this._items.length;i++){
if(i%_274==0){
_272++;
_273=0;
}
_273++;
if(_271==i){
break;
}
}
var obj={rows:_272,cols:_273};
return obj;
},get_selectedItem:function(){
var _277=this.get_selectedIndex();
return this._getDimensionByIndex(_277);
},selectUIItem:function(e,_279){
var _27a=this._popupElement.getElementsByTagName("TD");
var len=_27a.length;
var _27c=this.get_activeIndex();
var dim=this._getDimensionByIndex(_27c);
var cols=dim.cols;
for(var i=0;i<len;i++){
var _280=_27a[i];
var _281=_280.item_index;
if(_281<=_27c&&_280.cellIndex<cols){
_280.className="rade_itemOver";
}else{
_280.className="";
}
}
}};
Telerik.Web.UI.Editor.InsertTableHelper.registerClass("Telerik.Web.UI.Editor.InsertTableHelper",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.Editor.InsertTable=function(_282){
Telerik.Web.UI.Editor.InsertTable.initializeBase(this,[_282]);
};
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 _283=this.get_tools();
this._longTool=_283[0];
Array.removeAt(_283,0);
for(var i=0;i<_283.length;i++){
_283[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 _288={"valueSelected":this._onTableHelperValueSelectedDelegate};
var tool=$create(Telerik.Web.UI.Editor.InsertTableHelper,args,_288,null,document.createElement("DIV"));
tool.set_rootpopupclassname("");
this._tableHelper=tool;
tool.render();
var _28a=tool.get_popupElement();
_28a.style.display="";
_28a.style.visibility="visible";
_28a.style.position="";
_28a.style.cssFloat="left";
var _28b=this.get_popupElement();
_28b.insertBefore(_28a,_28b.firstChild);
},renderChildren:function(){
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"renderChildren");
var _28c=this._itemRootElement;
if(this._longTool){
var ul=document.createElement("UL");
_28c.insertBefore(ul,_28c.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(_28f){
Telerik.Web.UI.Editor.ColorPicker.initializeBase(this,[_28f]);
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 _290=this.get_selectedItem();
this.set_color(_290);
},set_color:function(_291){
if(!_291){
_291="";
}
var _292=this.getSpanElement();
_292.style.borderBottom="0px";
_292.style.height="";
if(_291){
var _293=_292.offsetHeight;
if(_293){
_292.style.height=(_293-3)+"px";
}
_292.style.borderBottom="3px solid "+_291;
}
this._color=_291;
},get_color:function(){
return this._color;
},onPopupMouseOver:function(e){
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"onPopupMouseOver",[e]);
var _295=this.get_activeIndex();
var _296=this._items[_295];
if(null==_296){
return;
}
if(this._infoSpan1){
this._infoSpan1.innerHTML=_296;
this._infoSpan1.style.backgroundColor=_296;
}
if(this._infoSpan2){
this._infoSpan2.innerHTML=_296;
this._infoSpan2.style.color=_296;
}
},renderFooter:function(){
var oDiv=document.createElement("div");
oDiv.className="rade_ColorPickerFooter";
var _298=document.createElement("span");
_298.className="rade_DarkColor";
var _299=document.createElement("span");
_299.className="rade_LightColor";
_298.innerHTML=_299.innerHTML="&nbsp";
oDiv.appendChild(_298);
oDiv.appendChild(_299);
this.get_popupElement().appendChild(oDiv);
this._infoSpan1=_298;
this._infoSpan2=_299;
},renderChild:function(_29a,_29b,_29c){
var oDiv=document.createElement("div");
if(null!=_29b){
oDiv.style.backgroundColor=_29b;
oDiv.setAttribute("title",_29b);
oDiv.innerHTML="&nbsp;";
}
_29a.appendChild(oDiv);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_29e){
this._clientStateFieldID=_29e;
}};
Telerik.Web.UI.Editor.ColorPicker.registerClass("Telerik.Web.UI.Editor.ColorPicker",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.UndoRedoDropDown=function(_29f){
Telerik.Web.UI.Editor.UndoRedoDropDown.initializeBase(this,[_29f]);
};
Telerik.Web.UI.Editor.UndoRedoDropDown.prototype={renderFooter:function(){
},get_selectedItem:function(){
var _2a0=Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"get_selectedItem");
if(!_2a0){
_2a0=1;
}
return _2a0;
},selectUIItem:function(e,_2a2){
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(_2a3){
Telerik.Web.UI.Editor.ApplyClassDropDown.initializeBase(this,[_2a3]);
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 _2a5="";
if(!tag){
_2a5=this._cssClasses["notag"];
}else{
tag=tag.toLowerCase();
var res=this._cssClasses[tag];
_2a5=res?res:this._cssClasses["unknown"];
}
var _2a7=document.createElement("span");
_2a7.innerHTML="&nbsp;"+tag;
_2a7.className=_2a5;
return _2a7;
},_getClassTag:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2aa=str.lastIndexOf(".");
if(_2aa==0){
return "ALL";
}
var _2ab=str.lastIndexOf(" ",_2aa);
return str.substring((_2ab+1),_2aa);
},_getClassCss:function(_2ac){
var re=this._cssClassRegex;
var oCss="";
if(null!=_2ac.cssText){
oCss=_2ac.cssText;
oCss=oCss.replace(re,"$1");
}else{
oCss=_2ac.style.cssText;
}
return oCss;
},_getDisplayName:function(rule){
if(!rule||!rule.selectorText){
return "";
}
var _2b0=rule.selectorText;
var _2b1=_2b0.indexOf(".");
if(-1==_2b1){
_2b1=0;
}else{
_2b1+=1;
}
var _2b2=_2b0.indexOf(":");
if(-1==_2b2){
_2b2=_2b0.length;
}
return _2b0.substring(_2b1,_2b2);
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _2b5=str.lastIndexOf(".");
if(_2b5==-1){
return "";
}
var _2b6=str.indexOf(" ",_2b5);
if(-1==_2b6){
_2b6=str.indexOf(":",_2b5);
}
if(-1==_2b6){
_2b6=str.length;
}
return str.substring((_2b5+1),_2b6);
},_getChild:function(_2b7,_2b8,_2b9){
var elem=document.createElement("DIV");
if(_2b8.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=_2b7;
}
elem.setAttribute("style",_2b7);
elem.innerHTML=_2b9;
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(_2bb){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"set_items",[_2bb]);
this._items.splice(0,0,["",{cssText:"",selectorText:"Clear Class"}]);
},renderChild:function(cell,_2bd,_2be){
var _2bf=_2bd[1];
var oTag=this._getClassTag(_2bf);
var oCss=this._getClassCss(_2bf);
var _2c2=_2bd[2]?_2bd[2]:this._getDisplayName(_2bf);
cell.setAttribute("title",_2bf.selectorText);
var _2c3=this._getClassIcon(oTag);
cell.appendChild(_2c3);
var div=this._getChild(oCss,oTag,_2c2);
cell.appendChild(div);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_2c5){
this._clientStateFieldID=_2c5;
}};
Telerik.Web.UI.Editor.ApplyClassDropDown.registerClass("Telerik.Web.UI.Editor.ApplyClassDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontNameDropDown=function(_2c6){
Telerik.Web.UI.Editor.FontNameDropDown.initializeBase(this,[_2c6]);
};
Telerik.Web.UI.Editor.FontNameDropDown.prototype={updateValue:function(oVal){
try{
if(!oVal){
oVal=this.get_text();
}
if(null==oVal||"AZBY"==oVal){
return;
}
var _2c8=this.getSpanElement();
if(_2c8){
this._value=(""+oVal).replace(/\s+/ig,"&nbsp;");
_2c8.innerHTML=this._value;
}
}
catch(e){
}
},renderChildren:function(){
var _2c9=this._items;
if(_2c9&&_2c9[0]&&!(_2c9[0] instanceof Array)){
for(var i=0;i<_2c9.length;i++){
var item=_2c9[i];
_2c9[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(_2cc){
Telerik.Web.UI.Editor.FontSizeDropDown.initializeBase(this,[_2cc]);
};
Telerik.Web.UI.Editor.FontSizeDropDown.prototype={renderChildren:function(){
var _2cd=this._items;
if(_2cd&&_2cd[0]&&!(_2cd[0] instanceof Array)){
for(var i=0;i<_2cd.length;i++){
var item=_2cd[i];
_2cd[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(_2d0){
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.initializeBase(this,[_2d0]);
};
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 _2d4=this.FlatLinksArray[this.get_selectedIndex()];
return {innerHTML:_2d4.name,href:_2d4.href,target:_2d4.target,title:_2d4.toolTip};
},_parseSubtree:function(_2d5,t){
var _2d7=this._linkCounter;
this.FlatLinksArray[_2d7]=_2d5;
var li=document.createElement("LI");
t.appendChild(li);
var _2d9=_2d5.childLinks&&_2d5.childLinks.length;
var span=document.createElement("SPAN");
span.innerHTML="&nbsp;";
span.className=_2d9?"rade_CustomLinksIcon rade_icon_plus":"rade_CustomLinksIcon rade_icon_empty";
if(_2d9){
function onclick(e){
var _2dc=Sys.UI.DomElement.containsCssClass(this,"rade_icon_plus");
var ul=this.parentNode.getElementsByTagName("UL")[0];
if(ul){
ul.style.display=_2dc?"":"none";
var _2de=_2dc?"rade_icon_plus":"rade_icon_minus";
var _2df=_2dc?"rade_icon_minus":"rade_icon_plus";
Sys.UI.DomElement.removeCssClass(this,_2de);
Sys.UI.DomElement.addCssClass(this,_2df);
}
return false;
}
$addHandler(span,"click",onclick);
}
li.appendChild(span);
var _2e0=null;
if(_2d5.href){
_2e0=document.createElement("A");
_2e0.href="#";
_2e0.innerHTML=_2d5.name;
li.appendChild(_2e0);
this.markItemContainer(_2e0,this._linkCounter);
}else{
_2e0=document.createElement("SPAN");
_2e0.innerHTML=_2d5.name;
li.appendChild(_2e0);
}
this._linkCounter++;
if(_2d9){
var ul=document.createElement("UL");
li.appendChild(ul);
var _2e2=_2d5.childLinks;
for(var i=0;i<_2d5.childLinks.length;i++){
var _2e4=_2e2[i];
this._parseSubtree(_2e4,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(_2e5,_2e6){
var _2e7=window.frames;
for(var i=0;i<_2e7.length;i++){
var _2e9=null;
try{
_2e9=_2e7[i].window.document;
}
catch(e){
}
if(!_2e9){
continue;
}
if(false!=_2e5){
_2e6.attachToDocument(_2e9);
}else{
_2e6.detachFromDocument(_2e9);
}
}
}
var _2ea=Function.createDelegate(null,function(e){
if(e.keyCode==27){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
});
$addHandler(document.body,"keydown",_2ea);
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",_2ea);
});
},attachToDocument:function(_2ec){
$telerik.addExternalHandler(_2ec,"mousedown",this._hideHandler);
},detachFromDocument:function(_2ed){
$telerik.removeExternalHandler(_2ed,"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 _2f0=this._activePopup.get_popupElement();
if(!this._isMouseOverElement(e,_2f0)){
this.hideActivePopup();
}
}
},_isMouseOverElement:function(e,_2f2){
var rect=null;
try{
rect=$telerik.getBounds(_2f2);
}
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(_2f7){
if(this._activePopup==_2f7){
this._activePopup=null;
}
},set_activePopup:function(_2f8){
if(this._activePopup&&(_2f8!=this._activePopup)){
this._activePopup.hide();
}
this._activePopup=_2f8;
},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(_2f9){
Telerik.Web.UI.Editor.DefaultToolAdapter.initializeBase(this,[_2f9]);
this._editor=null;
this._toolJSON=[];
this._tools=[];
this._contextMenusEnabled=true;
this.isIE=$telerik.isIE;
this._editorIEFirstShow=false;
};
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=null;
Telerik.Web.UI.Editor.DefaultToolAdapter.prototype={initialize:function(){
this._onEditorSelectionChangeDelegate=Function.createDelegate(this,this._onEditorSelectionChange);
this._onEditorModeChangeDelegate=Function.createDelegate(this,this._onEditorModeChange);
this._onToolAdapterClickDelegate=Function.createDelegate(this,this._onToolBarClick);
this._onToolAdapterKeyDownDelegate=Function.createDelegate(this,this._onKeyDownHandler);
this._onDropDownValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this._onDropDownBeforeShowDelegate=Function.createDelegate(this,this._onDropDownBeforeShow);
this._onDropDownHideDelegate=Function.createDelegate(this,this._onDropDownHide);
this._initToolbarMode();
this._initContextMenus();
this._registerEditorHandlers();
},_initToolbarMode:function(){
var _2fa=this.get_editor();
var _2fb=this.get_element();
var _2fc=Telerik.Web.UI.EditorToolbarMode;
var _2fd=_2fa.get_toolbarMode();
if(_2fd!=_2fc.Default){
_2fb.style.visibility="hidden";
}
this._initToolbars();
if(_2fd!=_2fc.Default){
this._createWindowWrapper();
if(_2fd==_2fc.ShowOnFocus){
this._initShowOnFocus();
}else{
if(_2fd==_2fc.PageTop){
this._initPageTop();
}else{
if(_2fd==_2fc.Floating){
this._initFloating();
}
}
}
_2fb.style.visibility="visible";
}
},get_toolbarHolder:function(){
return this._toolbarHolder;
},_moveToolbarsToEditor:function(_2fe){
var _2ff=this.get_element();
if(!_2fe){
var wnd=this.get_toolbarHolder();
if(!this._fakeToolbarParent){
var div=_2ff.ownerDocument.createElement("DIV");
div.control=_2ff.control;
_2ff.parentNode.appendChild(div);
_2ff.control=null;
div.style.display="none";
window.setTimeout(function(){
wnd.set_contentElement(_2ff);
_2ff.style.display="";
},0);
this._fakeToolbarParent=div;
}else{
wnd.set_contentElement(_2ff);
}
_2ff.style.width="100%";
}else{
_2ff.style.width="";
var _302=this.get_editor().get_TopZone();
_302.appendChild(_2ff);
}
},_createWindowWrapper:function(){
if(!this._toolbarHolder){
var _303=this.get_editor();
var wnd=_303.get_dialogOpener().get_container().clone(_303.get_id()+"_toolbarMode");
wnd.set_visibleStatusbar(false);
var _305=this.get_element();
var _306=_305.offsetWidth;
wnd.setSize(_306+10,"");
wnd.add_show(function(_307,args){
var _309=_307.get_contentElement();
if(!_309){
return;
}
_309.style.overflow="";
_309.style.height="";
var _30a=_309.offsetWidth;
var _30b=_309.offsetHeight;
_307.setSize(_30a+10,"");
});
this._toolbarHolder=wnd;
this._moveToolbarsToEditor(false);
}
return this._toolbarHolder;
},_createFloatingButton:function(){
this._onToggleFloatingToolbarDelegate=Function.createDelegate(this,this._onToggleFloatingToolbar);
var _30c=this.get_editor();
var skin=_30c.get_skin();
var _30e={name:"ToggleFloatingToolbar",addClickHandler:true,skin:skin};
var _30f={"valueSelected":this._onToggleFloatingToolbarDelegate};
var _310=Telerik.Web.UI.EditorButton.createTool(_30e,_30f);
var _311=Telerik.Web.UI.EditorButton.createToolWrapper(_310,skin);
var _312=$get(_30c.get_id()+"Top");
if(_312){
_312.appendChild(_311);
}
},_onToggleFloatingToolbar:function(){
var _313=!this._toolbarHolder.isVisible();
this._showToolbarHolder(_313);
},_positionToolbarAboveEditor:function(){
var wnd=this._toolbarHolder;
var _315=this.get_editor();
var _316=$telerik.getBounds(_315.get_element());
var x=_316.x;
var y=_316.y-wnd.getWindowBounds().height;
wnd.moveTo(x,y);
},_positionOnPageTop:function(){
var wnd=this._toolbarHolder;
var _31a=wnd._getViewportBounds();
var x=_31a.scrollLeft;
var y=_31a.scrollTop;
wnd.moveTo(x,y);
wnd.set_width(_31a.width-10);
if(!wnd.isPinned()){
wnd.togglePin();
}
},_showToolbarHolder:function(_31d){
if(!_31d){
this._toolbarHolder.hide();
return;
}else{
if($telerik.isIE&&!this._editorIEFirstShow){
this._editorIEFirstShow=true;
return;
}
}
if(this.get_editor().isFullScreen()){
return;
}
var _31e=Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper;
if(_31e==this&&_31e._toolbarHolder&&_31e._toolbarHolder.isVisible()){
_31e._toolbarHolder.setActive(true);
return;
}
if(_31e&&_31e._showToolbarHolder){
_31e._showToolbarHolder(false);
}
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=this;
this._toolbarHolder.show();
var _31f=this.get_editor();
var _320=Telerik.Web.UI.EditorToolbarMode;
var _321=_31f.get_toolbarMode();
if(_321==_320.ShowOnFocus){
this._positionToolbarAboveEditor();
}else{
if(_321==_320.PageTop){
this._positionOnPageTop();
}else{
if(_321==_320.Floating){
if(!this._wasShown){
this._positionToolbarAboveEditor();
this._wasShown=true;
}
}
}
}
},_initFloating:function(){
this._createFloatingButton();
},_initPageTop:function(){
var wnd=this._toolbarHolder;
wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);
wnd.set_visibleTitlebar(false);
this._initToolbarModeEvents();
},_initShowOnFocus:function(){
var wnd=this._toolbarHolder;
var _324=Telerik.Web.UI.WindowBehaviors;
wnd.set_behaviors(_324.Resize);
wnd.set_visibleTitlebar(false);
this._initToolbarModeEvents();
},_initToolbarModeEvents:function(){
var _325=this;
var _326=function(){
_325._showToolbarHolder(true);
};
var _327=this.get_editor();
if(_327.isIE){
this.get_editor().add_editReady(function(){
_327.attachEventHandler("beforeeditfocus",_326);
});
}else{
_327.add_selectionChange(_326);
}
_327.add_modeChange(function(){
_325._showToolbarHolder(_325.get_editor().get_mode()==Telerik.Web.UI.EditModes.Design);
});
_327.add_submit(function(){
_325._showToolbarHolder(false);
});
_327.add_toggleScreenMode(function(){
var _328=_325.get_editor().isFullScreen();
_325._moveToolbarsToEditor(_328);
var wnd=_325.get_toolbarHolder();
if(_328){
wnd.hide();
}else{
wnd.show();
}
});
this._bodyClickDelegate=Function.createDelegate(this,this._onBodyClick);
$addHandler(document.body,"click",this._bodyClickDelegate);
},_onBodyClick:function(){
this._showToolbarHolder(false);
},_disposeToolbarModeHandlers:function(){
if(this._bodyClickDelegate){
$removeHandler(document.body,"click",this._bodyClickDelegate);
this._bodyClickDelegate=null;
}
},_initToolbars:function(){
var root=this.get_element();
var _32b=root.parentNode;
var _32c=false;
if($telerik.isIE){
var _32d=Telerik.Web.UI.Editor.Utils.getInvisibleParent(_32b);
_32c=(_32d!=null);
if(_32c){
root.parentNode.removeChild(root);
root.style.position="absolute";
root.style.top="-5000px";
root.style.left="-5000px";
document.body.appendChild(root);
}
}
var _32e=this.get_toolJSON();
var _32f=this._getToolBarElements();
var _330=[];
for(var i=0;i<_32e.length;i++){
var json=_32e[i];
var _333=_32f[i];
this._initializeToolbar(json,_333);
var _334=json["attributes"];
var zone=_334?_334["dockingzone"]:null;
if(zone){
_330[_330.length]=[zone,_333];
}
}
if(_32c){
root.style.position="";
root.style.top="";
root.style.left="";
root.parentNode.removeChild(root);
_32b.appendChild(root);
}
var _336=this.get_editor();
if(_336.get_toolbarMode()!=Telerik.Web.UI.EditorToolbarMode.Default){
return;
}
var _337=_336.get_id();
for(var i=0;i<_330.length;i++){
var _338=_330[i][0];
var zone=_338.charAt(0).toUpperCase()+_338.substring(1);
var _339=$get(_337+zone);
if(!_339){
_339=$get(_338);
}
if(_339){
if(_339.innerHTML=="&nbsp;"){
_339.innerHTML="";
}
_339.appendChild(_330[i][1]);
}
}
},onContextMenu:function(e){
if(!this._contextMenusEnabled){
return;
}
var _33b=this.get_editor();
if(_33b.get_mode()!=Telerik.Web.UI.EditModes.Design){
return;
}
this.createContextMenus();
var _33c=e.srcElement?e.srcElement:e.target;
var _33d=_33c.tagName;
var _33e=this._contextMenus[_33d];
if("TH"==_33d&&!_33e){
_33e=this._contextMenus["TD"];
}
var _33f="";
if(!_33e){
var _340=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_33c,"A");
if(!_340){
_340=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_33c,"TD");
}
if(!_340){
_340=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_33c,"TABLE");
}
if(_340){
_33f=_340.tagName;
_33c=_340;
}else{
_33f="*";
}
_33e=this._contextMenus[_33f];
}
if(_33e&&_33d=="IMG"&&_33c&&"true"==_33c.getAttribute("isflash")){
_33e=null;
}
if(!this.isIE&&_33f=="*"){
return;
}
if(_33e){
_33e.set_eventObject(e);
_33e.show();
}
return $telerik.cancelRawEvent(e);
},enableContextMenus:function(_341){
this._contextMenusEnabled=_341;
},_initContextMenus:function(){
var _342=Function.createDelegate(this,this.onContextMenu);
var _343=this.get_editor();
_343.add_editReady(function(){
_343.attachEventHandler("contextmenu",_342);
});
},createContextMenus:function(){
if(this._contextMenus){
return;
}
this._contextMenus={};
var _344=this.get_editor();
var skin=_344.get_skin();
var _346=_344.get_contextMenusJSON();
var _347={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
for(var i=0;i<_346.length;i++){
var args=_346[i];
args["sizetofit"]=true;
args["parentElement"]=_344.get_contentAreaElement();
args["skin"]=skin;
var tool=$create(Telerik.Web.UI.EditorContextMenu,args,_347,null,document.createElement("SPAN"));
this._contextMenus[args.tagName]=tool;
}
},dispose:function(){
var _34b=this._getToolBarElements();
for(var i=0;i<_34b.length;i++){
$clearHandlers(_34b[i]);
}
this._tools=[];
this._disposeToolbarModeHandlers();
var wnd=this.get_toolbarHolder();
if(wnd&&wnd.dispose){
wnd.dispose();
}
Telerik.Web.UI.Editor.DefaultToolAdapter.callBaseMethod(this,"dispose");
},setFocus:function(){
var tool=this._tools[0];
window.setTimeout(function(){
if(tool){
tool.setFocus();
}
},100);
return false;
},getContextMenuByTagName:function(_34f){
this.createContextMenus();
return this._contextMenus[_34f];
},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(_353,_354){
if(!_353){
_353=this._tools;
}
var _355=this.get_editor();
for(var i=0;i<_353.length;i++){
var _357=_353[i];
var _358=_357.get_name();
if(_357.setState){
var _359=_354;
if(null==_359){
_359=_355.getToolState(_358);
}
if(null!=_359){
_357.setState(_359);
}
}
if(_357.updateValue){
_357.updateValue(_355.getToolValue(_358));
}
}
},_convertCommandsArray:function(_35a){
var _35b=[];
for(var i=0;i<_35a.length;i++){
_35b[i]=[i+1,_35a[i].get_title()];
}
return _35b;
},_onDropDownHide:function(_35d,args){
var _35f=this.get_editor();
_35f.enableContentArea(true);
},_onDropDownBeforeShow:function(_360,args){
var _362=this.get_editor();
if(Telerik.Web.UI.EditorToolStrip.isInstanceOfType(_360)){
this.setToolState(_360.get_items());
}
if(!_362.getSelection().isControl()&&!Telerik.Web.UI.EditorContextMenu.isInstanceOfType(_360)){
_362.enableContentArea(false);
}
var _363=_360.get_name();
if(_363=="Undo"){
var _364=_362.get_commandsManager().getCommandsToUndo();
_364=this._convertCommandsArray(_364);
_360.set_items(_364);
}else{
if(_363=="Redo"){
var _365=_362.get_commandsManager().getCommandsToRedo();
_365=this._convertCommandsArray(_365);
_360.set_items(_365);
}else{
if(_363=="ModuleManager"){
var _366=_362.get_modulesManager();
if(!_366){
return;
}
var _367=_366.get_modules();
var _368=[];
for(var i=0;i<_367.length;i++){
var _36a=_367[i];
var name=_36a.get_name();
var _36c=_36a.get_title();
if(!_36c){
_36c=name;
}
cssClass=_36a.get_visible()?"rade_module_visible_icon":"rade_module_hidden_icon";
_368[i]=[name,_36c,cssClass];
}
_360.set_items(_368);
}
}
}
var _36d=_360.get_items();
if(_36d&&_36d.length>0){
return;
}
var _36e=null;
switch(_363){
case "ApplyClass":
_36e=_362.getCssArray();
break;
case "FontName":
_36e=_362.get_fontNames();
break;
case "FontSize":
_36e=_362.get_fontSizes();
break;
case "InsertSymbol":
_36e=_362.get_symbols();
break;
case "BackColor":
case "ForeColor":
_36e=_362.get_colors();
break;
case "RealFontSize":
_36e=_362.get_realFontSizes();
break;
case "InsertSnippet":
_36e=_362.get_snippets();
break;
case "Zoom":
_36e=["10%","20%","50%","100%","150%","200%","300%","500%"];
break;
case "FormatBlock":
_36e=_362.get_paragraphs();
break;
case "InsertCustomLink":
_36e=_362.get_links();
break;
case "AjaxSpellCheck":
case "SpellCheck":
_36e=_362.get_languages();
break;
}
if(_36e){
_360.set_items(_36e);
}
},_initializeToolbar:function(_36f,_370){
var _371=_370.getElementsByTagName("li");
var _372=_36f.tools;
var _373=this.get_editor();
var skin=_373.get_skin();
var _375=0;
if(_372){
var _376=0;
for(var i=0;i<_372.length;i++){
var _378=_371[i+1];
_376+=_378.offsetWidth;
var _379=Telerik.Web.UI.EditorButton;
var _37a=_372[i].type;
var _37b=_372[i].name;
var _37c=Telerik.Web.UI.EditorToolType;
var args=_372[i];
var tool=null;
var _37f=false;
if(_37a){
switch(_37a){
case _37c.Button:
break;
case _37c.Separator:
if(!_375){
_375+=parseInt($telerik.getCurrentStyle(_378,"marginLeft"));
_375+=parseInt($telerik.getCurrentStyle(_378,"marginRight"));
}
_376+=_375;
_379=null;
break;
case _37c.DropDown:
_379=Telerik.Web.UI.EditorDropDown;
_37f=true;
if(_37b=="FontName"){
_379=Telerik.Web.UI.Editor.FontNameDropDown;
}else{
if(_37b=="FontSize"){
_379=Telerik.Web.UI.Editor.FontSizeDropDown;
}else{
if(_37b=="FormatBlock"){
_379=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_37b=="RealFontSize"){
_379=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_37b=="Zoom"){
_379=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_37b=="InsertCustomLink"){
_379=Telerik.Web.UI.Editor.InsertCustomLinkDropDown;
}else{
if(_37b=="ApplyClass"){
_379=Telerik.Web.UI.Editor.ApplyClassDropDown;
}
}
}
}
}
}
}
break;
case _37c.SplitButton:
_379=Telerik.Web.UI.EditorSplitButton;
if(_37b=="ForeColor"||_37b=="BackColor"){
_379=Telerik.Web.UI.Editor.ColorPicker;
}else{
if(_37b=="Undo"||_37b=="Redo"){
_379=Telerik.Web.UI.Editor.UndoRedoDropDown;
}
}
_37f=true;
break;
case _37c.ToolStrip:
if(_37b=="InsertTable"){
_379=Telerik.Web.UI.Editor.InsertTable;
}else{
_379=Telerik.Web.UI.EditorToolStrip;
}
_37f=true;
break;
case _37c.Custom:
break;
}
}
if(args.attributes){
for(var item in args.attributes){
args[item.toLowerCase()]=args.attributes[item];
}
}
if(_379){
var _381=null;
if(_37f){
_381={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
args["skin"]=skin;
}
tool=$create(_379,args,_381,null,_378);
}
if(tool){
Array.add(this._tools,tool);
var _382=tool.get_shortCut();
if(_382){
var _383=tool.get_name();
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(tool)&&!(Telerik.Web.UI.EditorSplitButton.isInstanceOfType(tool))){
_383="RadE_ToolAdapter_"+_383;
Telerik.Web.UI.Editor.CommandList[_383]=this._toolAdapterDropDownExpander;
}
_373.setShortCut(_383,_382);
}
}
}
var ul=_370;
if(this.isIE&&ul&&_376){
ul.style.width=(_376+(_371[0].offsetWidth)*2)+"px";
}
if($telerik.isSafari){
ul.setAttribute("onmousedown","return false;");
}
$addHandlers(_370,{"click":this._onToolAdapterClickDelegate,"keydown":this._onToolAdapterKeyDownDelegate},this);
}
},_toolAdapterDropDownExpander:function(_385,_386){
var tool=_386.getToolByName(_385.replace("RadE_ToolAdapter_",""));
tool.setFocus();
tool.show();
tool.selectNextItem();
return false;
},_onEditorModeChange:function(_388,args){
var _38a=Telerik.Web.UI.EditModes;
var mode=_388.get_mode();
this._setEnabled((mode==_38a.Design));
},_onEditorSelectionChange:function(_38c,args){
this.setToolState();
},_setEnabled:function(_38e){
var _38f=this._tools;
for(var i=0;i<_38f.length;i++){
var tool=_38f[i];
tool.set_enabled(_38e);
}
},_registerEditorHandlers:function(){
var _392=this.get_editor();
_392.add_selectionChange(this._onEditorSelectionChangeDelegate);
_392.add_modeChange(this._onEditorModeChangeDelegate);
},_onDropDownValueSelected:function(_393,args){
var _395=_393.get_selectedItem();
if(Telerik.Web.UI.EditorButton.isInstanceOfType(_395)){
this._raiseEditorEvent(_395,null);
}else{
this._raiseEditorEvent(_393,_395);
}
},_onKeyDownHandler:function(e){
var _397=e.keyCode;
if(9==_397||37==_397||39==_397||121==_397){
if(Telerik.Web.UI.Editor.PopupController){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
}
if(121==_397){
var _398=this.get_editor();
window.setTimeout(function(){
if(_398){
_398.setFocus();
}
},100);
if(e.rawEvent){
$telerik.cancelRawEvent(e.rawEvent);
}
return $telerik.cancelRawEvent(e);
}
if(9==_397){
return;
}
var _399=this._getSelectedTool(e);
if(!Telerik.Web.UI.EditorButton.isInstanceOfType(_399)){
return;
}
if(37==_397||39==_397){
var tool=_399;
while(true){
tool=(37==_397)?this._getPreviousTool(tool):this._getNextTool(tool);
if(null==tool){
break;
}
if(tool.get_enabled()){
break;
}
}
if(tool&&tool.get_enabled()){
tool.setFocus();
}
}
if(13==_397&&_399&&!_399.get_selectedItem){
this._raiseEditorEvent(_399,null);
return;
}
if(!Telerik.Web.UI.EditorDropDown.isInstanceOfType(_399)){
return;
}
if(38==_397||40==_397){
var _39b=false;
if(!_399.isExpanded()){
_399.show();
_39b=true;
}
if(_39b||40==_397){
_399.selectNextItem();
}else{
_399.selectPreviousItem();
}
}else{
if(13==_397){
_399.hide();
if(_399.get_activeIndex){
_399.set_selectedIndex(_399.get_activeIndex());
}
this._onDropDownValueSelected(_399);
}else{
if(27==_397){
_399.hide();
}
}
}
},_onToolBarClick:function(e){
var _39d=this._getSelectedTool(e);
if(_39d){
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(_39d)){
_39d.click(e);
}else{
if(false){
}else{
this._raiseEditorEvent(_39d);
}
}
}
var _39e=this.get_editor();
if(_39e.get_mode()!=Telerik.Web.UI.EditModes.Design){
$telerik.cancelRawEvent(e);
}
},_raiseEditorEvent:function(tool,_3a0){
var _3a1=this.get_events().getHandler("ToolClick");
if(_3a1){
var _3a2=tool.get_name?tool.get_name():"";
var _3a3=new Telerik.Web.UI.EditorCommandEventArgs(_3a2,tool,_3a0);
_3a1(tool,_3a3);
}
},_getPreviousTool:function(tool){
var _3a5=Array.indexOf(this._tools,tool);
return this._tools[_3a5-1];
},_getNextTool:function(tool){
var _3a7=Array.indexOf(this._tools,tool);
return this._tools[_3a7+1];
},_getSelectedTool:function(e){
var _3a9=Telerik.Web.UI.EditorButton.getToolRootNode(e.target);
if(null==_3a9){
return;
}
var _3aa=_3a9.control;
if(null==_3aa){
return;
}
if(_3aa.get_enabled&&_3aa.get_enabled()==false){
return;
}
if(e&&_3aa){
e.preventDefault();
e.stopPropagation();
}
return _3aa;
},_getToolBarElements:function(){
var _3ab=this.get_element();
var _3ac=_3ab.getElementsByTagName("ul");
return _3ac;
},get_toolbarHolder:function(){
return this._toolbarHolder;
},get_editor:function(){
return this._editor;
},set_editor:function(_3ad){
if(this._editor!=_3ad){
this._editor=_3ad;
}
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_3ae){
this._toolJSON=_3ae;
},add_toolClick:function(_3af){
this.get_events().addHandler("ToolClick",_3af);
},remove_toolClick:function(_3b0){
this.get_events().removeHandler("ToolClick",_3b0);
}};
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(_3b1,_3b2,args){
function createSpellCheckEngine(){
if(!_3b2.get_ajaxSpellCheck()){
var _3b4={"editor":_3b2};
var _3b5=document.createElement("DIV");
var _3b6=$create(Telerik.Web.UI.Editor.AjaxSpellCheck,_3b4,null,null,_3b5);
var _3b7=_3b6.get_element();
var _3b8=$get(_3b2.get_id()+"Top");
if(_3b8){
_3b8.appendChild(_3b7);
}
_3b2.set_ajaxSpellCheck(_3b6);
}
var _3b9=_3b2.get_ajaxSpellCheck();
if(args&&args.value){
_3b9.set_language(args.value);
}
_3b9.spellCheck();
}
if(typeof (Telerik.Web.UI.Editor.AjaxSpellCheck)=="undefined"){
function OnWebRequestCompleted(_3ba,_3bb){
var _3bc=_3ba.get_responseData();
Telerik.Web.UI.Editor.Utils.evalScriptCode(_3bc);
createSpellCheckEngine();
}
var _3bd=_3b2.get_ajaxSpellCheckScriptReference();
var _3be=new Sys.Net.WebRequest();
_3be.set_url(_3bd);
_3be.set_httpVerb("GET");
_3be.add_completed(OnWebRequestCompleted);
_3be.invoke();
}else{
createSpellCheckEngine();
}
return false;
};
this.ModuleManager=function(_3bf,_3c0,args){
var _3c2=args.value;
var _3c3=_3c0.get_modulesManager();
if(!_3c3){
return false;
}
var _3c4=_3c3.getModuleByName(_3c2);
if(_3c4){
_3c4.toggleVisibility();
_3c0._updateEditorSize(null,true);
}
return false;
};
this.ToggleScreenMode=function(_3c5,_3c6,args){
_3c6.toggleScreenMode();
return false;
};
this.InsertRowAbove=this.InsertRowBelow=function(_3c8,_3c9,args){
_3c9.executeCommand(new Telerik.Web.UI.Editor.TableInsertRow(_3c9.getLocalizedString(_3c8),null,_3c8=="InsertRowAbove"?"above":"below"));
};
this.InsertColumnLeft=this.InsertColumnRight=function(_3cb,_3cc,args){
_3cc.executeCommand(new Telerik.Web.UI.Editor.TableInsertColumn(_3cc.getLocalizedString(_3cb),null,_3cb=="InsertColumnLeft"?"left":"right"));
};
this.DeleteRow=function(_3ce,_3cf,args){
_3cf.executeCommand(new Telerik.Web.UI.Editor.TableDeleteRow(_3cf.getLocalizedString(_3ce)));
};
this.DeleteColumn=function(_3d1,_3d2,args){
_3d2.executeCommand(new Telerik.Web.UI.Editor.TableDeleteColumn(_3d2.getLocalizedString(_3d1)));
};
this.DeleteCell=function(_3d4,_3d5,args){
_3d5.executeCommand(new Telerik.Web.UI.Editor.TableDeleteCell(_3d5.getLocalizedString(_3d4)));
};
this.MergeColumns=function(_3d7,_3d8,args){
_3d8.executeCommand(new Telerik.Web.UI.Editor.TableMergeColumns(_3d8.getLocalizedString(_3d7)));
};
this.MergeRows=function(_3da,_3db,args){
_3db.executeCommand(new Telerik.Web.UI.Editor.TableMergeRows(_3db.getLocalizedString(_3da)));
};
this.SplitCell=function(_3dd,_3de,args){
_3de.executeCommand(new Telerik.Web.UI.Editor.TableSplitCell(_3de.getLocalizedString(_3dd)));
};
this.DeleteTable=function(_3e0,_3e1,args){
var _3e3=args.value;
if(!_3e3){
_3e3=_3e1.getSelectedElement();
}
if(_3e3&&"TABLE"!=_3e3.tagName){
_3e3=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_3e3,"TABLE");
}
if(_3e3){
_3e1.selectElement(_3e3);
_3e1.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(_3e4,_3e5,args){
var _3e7=_3e4.substring(10);
var _3e8=new Telerik.Web.UI.EditorCommandEventArgs(_3e4,args.get_tool(),_3e7);
_3e5.fire("InsertFormElement",_3e8);
};
this.StripAll=this.StripCss=this.StripFont=this.StripSpan=this.StripWord=function(_3e9,_3ea,args){
var _3ec=_3e9.substring(5);
var _3ed=new Telerik.Web.UI.EditorCommandEventArgs(_3e9,args.get_tool(),_3ec.toUpperCase());
_3ea.fire("FormatStripper",_3ed);
};
this.FormatStripper=function(_3ee,_3ef,args){
var _3f1=args.value;
var _3f2="";
try{
_3f2=_3ef.getSelectionHtml();
}
catch(e){
}
var oSel=_3ef.get_document().selection?_3ef.get_document().selection:_3ef.get_contentWindow().getSelection();
var _3f4=oSel.type?oSel.type.toLowerCase()=="none":oSel.isCollapsed;
if(_3f4||_3f2==""||_3ef.get_html()==_3f2){
var _3f5=Telerik.Web.UI.Editor.Utils.stripFormatting(_3ef.get_html(),_3f1);
_3ef.set_html(_3f5,_3ef.getLocalizedString(_3ee)+" "+_3f1);
}else{
if(_3f2!=null){
var _3f5=Telerik.Web.UI.Editor.Utils.stripFormatting(_3f2,_3f1);
_3ef.pasteHtml(_3f5,_3ee);
}
}
};
this.InsertTable=function(_3f6,_3f7,args){
var _3f9=args.value;
if(_3f9){
var _3fa=Telerik.Web.UI.Editor.Utils.createTable(_3f9.rows,_3f9.cols);
var _3fb=Telerik.Web.UI.Editor.Utils.getOuterHtml(_3fa);
_3f7.pasteHtml(_3fb,_3f6);
}
};
this.InsertTab=function(_3fc,_3fd,_3fe){
var _3ff=_3fd.getSelectedElement();
if(_3ff.tagName=="LI"){
_3fd.fire("Indent");
}else{
_3fd.pasteHtml(" &nbsp;&nbsp;&nbsp;&nbsp;",_3fc);
}
return false;
};
this.SetToolFocus=function(_400,_401,_402){
var _403=_401.get_toolAdapter();
if(_403){
_403.setFocus();
}
return false;
};
this.ViewHtml=function(_404,_405,_406){
alert(_405.get_html(true));
return false;
};
this.Undo=this.Redo=function(_407,_408,args){
var _40a=args?args.value:1;
if(!_40a){
_40a=1;
}
if(_407=="Redo"){
_408.redo(_40a);
}else{
_408.undo(_40a);
}
};
this.PastePlainText=function(_40b,_40c,_40d){
var _40e=function(_40f){
if(_40f){
var _410=_40f.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
_410=Telerik.Web.UI.Editor.Utils.replaceNewLineWithBr(_410);
if(_410){
_40c.pasteHtml(_410,_40b);
}
}
};
if(_40c.isIE){
_40e(window.clipboardData.getData("Text"));
}else{
var _411=function(_412,args){
_40e(args.get_content());
};
_40c.showDialog("CleanPasteTextContent",{},_411);
return false;
}
};
this.PasteFromWord=this.PasteFromWordNoFontsNoSizes=this.PasteAsHtml=function(_414,_415,_416){
var _417=function(_418,_419){
var _41a="";
if(_414=="PasteFromWord"){
_41a=Telerik.Web.UI.Editor.Utils.stripFormatting(_418,"WORD");
}else{
if(_414=="PasteFromWordNoFontsNoSizes"){
_41a=Telerik.Web.UI.Editor.Utils.stripFormatting(_418,"WORD_ALL");
}else{
_41a=Telerik.Web.UI.Editor.Utils.convertText2Html(_418);
}
}
if(_419){
_419.select();
}
if(_41a){
_415.pasteHtml(_41a,_414);
}
};
if(_415.isIE){
var _41b=_415.createRestorePoint();
var _41c=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
_417(_41c,_41b);
}else{
var _41d=function(_41e,args){
_417(args.get_content());
};
_415.showDialog("CleanPasteHtmlContent",{},_41d);
}
};
this.Copy=function(_420,_421,args){
if(null!=args){
var _423=window.opera?false:true;
if(_423){
try{
document.queryCommandEnabled(_420);
}
catch(e){
_423=false;
}
}
if(_423){
_421.get_document().execCommand(_420,false,null);
}else{
alert(_421.getLocalizedString("UseCtrlC"));
}
}
};
this.Cut=this.Paste=function(_424,_425,args){
if(null!=args){
var _427=window.opera?false:true;
if(_427){
try{
if(!_425.isIE7){
document.queryCommandEnabled(_424);
}
}
catch(e){
_427=false;
}
}
if(_424=="Paste"&&_427&&_425.isIE7){
_425.get_document().body.fireEvent("onbeforepaste");
}
if(_427){
var oCmd=new Telerik.Web.UI.Editor.GenericCommand(_425.getLocalizedString(_424),_425.get_contentWindow());
_425.get_document().execCommand(_424,false,null);
_425.executeCommand(oCmd);
}else{
var id=(_424=="Cut"?"UseCtrlX":"UseCtrlV");
alert(_425.getLocalizedString(id));
}
}else{
_425._pendingCutPasteCommand=new Telerik.Web.UI.Editor.GenericCommand(_425.getLocalizedString(_424),_425.get_contentWindow());
}
};
this.InsertParagraph=function(_42a,_42b,_42c){
_42b.executeBrowserCommand(_42a,true,"");
return true;
};
this.FormatBlock=function(_42d,_42e,args){
_42e.executeCommand(new Telerik.Web.UI.Editor.FormatBlockCommand(_42e.getLocalizedString(_42d),_42e.get_contentWindow(),args.value));
};
this.InsertOrderedList=this.InsertUnorderedList=function(_430,_431,args){
_431.setFocus();
_431.executeCommand(new Telerik.Web.UI.Editor.InsertListCommand(_431.getLocalizedString(_430),_431.get_contentWindow(),_431.get_newLineBr(),_430,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(_433,_434,_435){
_434.setActive();
var _436="SelectAll"!=_433;
if(_433=="Unlink"&&!_434.isIE){
var elem=_434.getSelectedElement();
if(elem&&elem.tagName=="A"){
_434.selectElement(elem,false);
}
}
_434.executeBrowserCommand(_433,_436,null,null);
return true;
};
this.ForeColor=this.BackColor=this.FontName=this.FontSize=function(_438,_439,args){
var _43b=args.value;
_439.executeBrowserCommand(_438,true,_43b);
};
this.Zoom=function(_43c,_43d,args){
var _43f=args.value;
var tool=args.get_tool?args.get_tool():null;
if(_43f&&tool&&tool.updateValue){
tool.updateValue(_43f);
}
_43d._contentArea.style.zoom=_43f;
return false;
};
this.Print=function(_441,_442,args){
if(_442.isIE){
_442.get_document().execCommand(_441,false,null);
}else{
if(_442.get_contentWindow().print){
_442.get_contentWindow().print();
}
}
return false;
};
this.InsertSnippet=function(_444,_445,args){
_445.pasteHtml(args.value,_444);
};
this.InsertFormElement=function(_447,_448,args){
var _44a=args.value;
_44a=_44a.toLowerCase();
var _44b=null;
switch(_44a){
case "form":
_44b=_448.createElement("form","150px","150px");
_44b.innerHTML="&nbsp;";
break;
case "textarea":
_44b=_448.createElement("textarea");
break;
case "select":
_44b=_448.createElement("select","100px","22px");
break;
case "checkbox":
case "radio":
_44b=_448.createElement("input");
_44b.setAttribute("type",_44a);
break;
case "button":
case "reset":
case "submit":
_44b=_448.createElement("input","50px","22px");
_44b.setAttribute("type",_44a);
break;
case "hidden":
case "password":
case "text":
_44b=_448.createElement("input","100px","22px");
_44b.setAttribute("type",_44a);
break;
}
if(_44b){
var id=Telerik.Web.UI.Editor.Utils.getUniqueID();
_44b.setAttribute("id",id);
var html=Telerik.Web.UI.Editor.Utils.getOuterHtml(_44b);
_448.pasteHtml(html,_447);
var _44e=_448.get_document().getElementById(id);
if(_44e){
_44e.removeAttribute("id");
if(_44e.setActive){
_44e.setActive();
}
return false;
}
}
};
this.InsertGroupbox=this.InsertDate=this.InsertTime=this.InsertSymbol=this.InsertHorizontalRule=function(_44f,_450,args){
var _452="";
switch(_44f){
case "InsertSymbol":
_452=args.value;
break;
case "InsertHorizontalRule":
_452="<hr>";
break;
case "InsertDate":
var now=new Date();
_452="&nbsp;"+now.toLocaleDateString();
break;
case "InsertTime":
var now=new Date();
_452="&nbsp;"+now.toLocaleTimeString();
break;
default:
_452="<fieldset style='WIDTH: 200px; HEIGHT: 76px'> <legend>Title</legend>Content... </fieldset> ";
}
_450.pasteHtml(_452,_44f);
};
this.ImageManager=function(_454,_455,_456){
var _457=function(_458,args){
_455.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_454);
};
var _45a=_455.getSelectedElement();
if(_45a&&_45a.tagName.toLowerCase()=="img"){
_455.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_45a.src);
}
var args={editor:_455};
_455.showDialog("ImageManager",args,_457);
_455.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.SilverlightManager=function(_45c,_45d,_45e){
var _45f=function(_460,args){
var html=args.Result;
var _463=_45d._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _464=_45d._filtersManager.getFilterByName("MozillaKeepFlashString");
html=(_463)?_463.getDesignContent(html):html;
html=(_464)?_464.getDesignContent(html):html;
_45d.pasteHtml(html,_45c);
};
var _465={};
var _466=_45d.getSelectedElement();
if(_466){
if($telerik.isIE&&_466.object&&_466.object.Movie){
var _467=_466.object.Movie;
_45d.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_467);
_465.selectedItemUrl=_467;
_465.selectedObject=_466;
}
}
_45d.showDialog("SilverlightManager",_465,_45f);
_45d.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.FlashManager=function(_468,_469,_46a){
var _46b=function(_46c,args){
var _46e=_469._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _46f=_469._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_46e)?_46e.getDesignContent(html):html;
html=(_46f)?_46f.getDesignContent(html):html;
_469.pasteHtml(html,_468);
};
var _471={};
var _472=_469.getSelectedElement();
if(_472){
if($telerik.isIE&&_472.object&&_472.object.Movie){
var _473=_472.object.Movie;
_469.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_473);
_471.selectedItemUrl=_473;
_471.selectedObject=_472;
}
}
_469.showDialog("FlashManager",_471,_46b);
_469.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.MediaManager=function(_474,_475,_476){
var _477=function(_478,args){
var _47a=_475._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _47b=_475._filtersManager.getFilterByName("MozillaKeepFlashString");
var html=args.Result;
html=(_47a)?_47a.getDesignContent(html):html;
html=(_47b)?_47b.getDesignContent(html):html;
_475.pasteHtml(html,_474);
};
var _47d={};
var _47e=_475.getSelectedElement();
if(_47e){
if($telerik.isIE&&_47e.object&&_47e.object.FileName){
var _47f=_47e.object.FileName;
_475.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_47f);
_47d.selectedItemUrl=_47f;
_47d.selectedObject=_47e;
}
}
_475.showDialog("MediaManager",_47d,_477);
_475.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.TemplateManager=function(_480,_481,_482){
var _483=function(_484,args){
_481.pasteHtml(args.Result,_480);
};
_481.showDialog("TemplateManager",{},_483);
return false;
};
this.AboutDialog=function(_486,_487,_488){
_487.showDialog("AboutDialog");
return false;
};
this.Help=function(_489,_48a,_48b){
_48a.showDialog("Help");
return false;
};
this.PageProperties=function(_48c,_48d,_48e){
var _48f=function(_490,args){
};
var _492={};
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_492,"BODY",_48d,_48c);
_48d.showDialog("PageProperties",_492,_48f);
return false;
};
this.ImageMapDialog=function(_493,_494,args){
var _496=Telerik.Web.UI.Editor.CommandList._getImageMapDialogArgument(_494);
var _497=function(wnd,_499){
Telerik.Web.UI.Editor.CommandList._setImageMapProperties(_494,_499);
return false;
};
_494.showDialog("ImageMapDialog",_496,_497);
return false;
};
this._setImageMapProperties=function(_49a,args){
if(!args){
return;
}
var _49c=_49a.getSelectedElement();
var _49d;
if(_49c&&_49c.tagName=="IMG"){
_49d=_49c;
if(args.ImageSrc!=_49d.src){
_49d.src=args.ImageSrc;
}
}else{
if(!args.ImageSrc){
return;
}
_49a.pasteHtml("<img src=\""+args.ImageSrc+"\" id = \"__tmp__\">");
_49d=_49a.get_document().getElementById("__tmp__");
_49d.removeAttribute("id");
if(document.all){
var oRng=_49a.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_49d);
oRng.select();
}
}
var _49f=document.createElement("SPAN");
_49f.innerHTML=args.MapHtml;
var _4a0=_49f.getElementsByTagName("map");
if(_4a0.length==0){
return;
}
var _4a1=_4a0[0].innerHTML;
_49f=null;
if(!_4a1){
_49d.removeAttribute("useMap");
return;
}
var _4a2="";
var map=null;
var _4a4=_49d.getAttribute("useMap");
if(_4a4){
_4a2=_4a4.substr(1);
map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_49a,_4a2);
}
if(map==null){
var _4a5=new Date()-100;
var _4a2="rade_img_map_"+_4a5;
map=_49a.get_document().createElement("map");
map.id=_4a2;
this._setNameAttribute(map,_4a2);
map=_49a.get_document().body.appendChild(map);
_49d.setAttribute("useMap","#"+_4a2);
_49d.setAttribute("border","0");
}
map.innerHTML=_4a1;
};
this._setNameAttribute=function(_4a6,name){
_4a6.removeAttribute("name");
_4a6.removeAttribute("NAME");
_4a6.name=null;
_4a6.name=name;
_4a6["NAME"]=name;
};
this._getImageMapDialogArgument=function(_4a8){
var _4a9={};
_4a9._editor=_4a8;
var _4aa=_4a8.getSelectedElement();
if(_4aa&&_4aa.tagName=="IMG"){
_4a9.ImageSrc=_4aa.getAttribute("src",2);
_4a9.ImageWidth=(_4aa.style.width)?_4aa.style.width:_4aa.width;
_4a9.ImageHeight=(_4aa.style.height)?_4aa.style.height:_4aa.height;
if($telerik.isIE){
var oRng=_4a8.get_document().body.createTextRange();
oRng.collapse();
oRng.moveToElementText(_4aa);
oRng.select();
}
if(_4aa.useMap){
var _4ac=_4aa.getAttribute("useMap").substr(1);
var map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_4a8,_4ac);
if(map!=null){
_4a9.ImageMapHTML="<map name = \""+_4ac+"\">"+map.innerHTML+"</map>";
}else{
_4a9.ImageMapHTML="";
}
_4aa.style.width=_4a9.ImageWidth;
_4aa.style.height=_4a9.ImageHeight;
}
}
return _4a9;
};
this._getImageMapByName=function(_4ae,_4af){
var _4b0=_4ae.get_document();
var map=_4b0.getElementById(_4af);
if(map!=null){
return map;
}
var maps=_4b0.getElementsByTagName("map");
for(var i=0;i<maps.length;i++){
if(maps[i].getAttribute("name")==_4af){
return maps[i];
}
}
return null;
};
this.DocumentManager=function(_4b4,_4b5,_4b6){
var _4b7={};
var _4b8=function(_4b9,args){
_4b5.pasteHyperLink(args.Result,_4b4);
};
var _4bb=_4b5.get_dialogOpener().get_additionalQueryString();
var _4bc=_4b5.getSelectedElement();
if(_4bc&&_4bc.tagName.toLowerCase()=="a"){
_4b5.get_dialogOpener().set_additionalQueryString(_4bb+"&PreselectedItemUrl="+_4bc.href);
}
_4b5.showDialog("DocumentManager",_4b7,_4b8);
_4b5.get_dialogOpener().set_additionalQueryString(_4bb);
return false;
};
this.TableWizard=function(_4bd,_4be,_4bf){
var _4c0=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4be,null,true,false);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4c0,"TABLE",_4be,_4bd);
var _4c1=function(_4c2,args){
_4be.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4bd);
};
_4be.showDialog("TableWizard",_4c0,_4c1);
return false;
};
this.SetTableProperties=function(_4c4,_4c5,_4c6){
var _4c7=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4c5,1,false,true);
if(!_4c7){
alert(_4c5.getLocalizedString("tablewarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4c7,"TABLE",_4c5,_4c4);
var _4c8=Telerik.Web.UI.Editor.CommandList._getParentTable(_4c5);
var _4c9=function(_4ca,args){
_4c5.selectElement(_4c8);
_4c5.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4c4);
};
_4c5.showDialog("TableWizard",_4c7,_4c9);
return false;
};
this.SetCellProperties=function(_4cc,_4cd,_4ce){
var _4cf=Telerik.Web.UI.Editor.CommandList._getTableArgument(_4cd,2,false,true);
if(!_4cf){
alert(_4cd.getLocalizedString("cellwarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4cf,"TABLE",_4cd,_4cc);
var _4d0=Telerik.Web.UI.Editor.CommandList._getParentTable(_4cd);
var _4d1=function(_4d2,args){
_4cd.selectElement(_4d0);
_4cd.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_4cc);
};
_4cd.showDialog("TableWizard",_4cf,_4d1);
return false;
};
this.FindAndReplace=function(_4d4,_4d5,_4d6){
var _4d7={};
_4d7._editor=_4d5;
var _4d8=function(_4d9,args){
};
_4d5.showDialog("FindAndReplace",_4d7,_4d8);
return false;
};
this.StyleBuilder=function(_4db,_4dc,_4dd){
var _4de=function(_4df,args){
_4dc.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_4db);
};
var _4e1={};
var _4e2=_4dc.getSelection();
var _4e3=_4e2.getParentElement();
if(!_4e2.isControl()){
var _4e4=_4e2.getHtml();
if(_4e4!=""||(_4e3&&_4e3.tagName&&_4e3.tagName.toLowerCase()=="body")){
var _4e5=_4dc.createElement("span");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_4e5,_4e4);
_4e3=_4e5;
}else{
_4dc.selectElement(_4e3,false);
}
}
_4e1.htmlElement=_4e3;
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_4e1,"*",_4dc,_4db);
_4e1.fontNames=_4dc.get_fontNames();
_4dc.showDialog("StyleBuilder",_4e1,_4de);
return false;
};
this.XhtmlValidator=function(_4e6,_4e7,_4e8){
var _4e9=_4e7;
var _4ea=function(_4eb,args){
};
_4e7.showDialog("XhtmlValidator",_4e9,_4ea);
return false;
};
this.TrackChangesDialog=function(_4ed,_4ee,_4ef){
var _4f0=_4ee;
var _4f1=function(_4f2,args){
};
_4ee.showDialog("TrackChangesDialog",_4f0,_4f1);
};
this.InsertCustomLink=function(_4f4,_4f5,args){
var link=args.value;
var _4f8=String.format("<a href='{1}' title='{3}' target='{2}'>{0}</a>",link.innerHTML,link.href,link.target,link.title);
var _4f9=Telerik.Web.UI.Editor.CommandList._getParentLink(_4f5);
if(_4f9){
var _4fa=_4f9.cloneNode(true);
if(link.href){
_4fa.setAttribute("href",link.href);
}
if(link.target){
_4fa.setAttribute("target",link.target);
}
if(link.title){
_4fa.setAttribute("title",link.title);
}
if(!_4fa.innerHTML){
_4fa.innerHTML=link.innerHTML;
}
_4f8=Telerik.Web.UI.Editor.Utils.getOuterHtml(_4fa);
}
_4f5.pasteHtml(_4f8,_4f4);
};
this._getDialogArguments=function(_4fb,_4fc,_4fd,_4fe){
_4fb.Colors=_4fd.get_colors();
if("TD"==_4fc||"TH"==_4fc||"TABLE"==_4fc){
_4fb.CssClasses=_4fd.getCssArray("TABLE");
_4fb.CellCssClasses=_4fd.getCssArray("TD");
}else{
if("A"==_4fc||"BODY"==_4fc||"IMG"==_4fc){
_4fb.CssClasses=_4fd.getCssArray(_4fc);
}
}
_4fb.Editor=_4fd;
};
this.SetLinkProperties=this.LinkManager=function(_4ff,_500,_501){
var _502=Telerik.Web.UI.Editor.CommandList._getLinkArgument(_500);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_502,"A",_500,_4ff);
var _503=function(_504,args){
_500.pasteHyperLink(args.realLink,_4ff);
};
_500.showDialog("LinkManager",_502,_503);
return false;
};
this.SetImageProperties=function(_506,_507,_508){
var _509={};
_509.Element=_507.getSelectedElement();
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_509,"IMG",_507,_506);
var _50a=function(_50b,args){
_507.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_506);
};
_507.showDialog("ImageProperties",_509,_50a);
return false;
};
this.FormatCodeBlock=function(_50d,_50e,_50f){
var _510={dirtyCode:_50e.getSelectionHtml()};
if(_50e.get_document().selection&&_50e.get_document().selection){
var _511=_50e.get_document().selection.type.toLowerCase();
if(_511=="control"||_511=="none"){
_510.dirtyCode="";
}
}
var _512=function(_513,args){
_50e.pasteHtml(args.get_code(),_50d);
};
_50e.showDialog("FormatCodeBlock",_510,_512);
return false;
};
this._getDocumentAnchors=function(_515){
var _516=_515.getElementsByTagName("A");
var _517=new Array();
for(var i=0;i<_516.length;i++){
if(_516[i].name){
_517[_517.length]=_516[i];
}
}
return _517;
};
this._getParentLink=function(_519){
_519.setFocus();
var _51a=_519.getSelectedElement();
var _51b=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_51a,"A");
if(_51b){
_519.selectElement(_51b);
}else{
var _51c="";
if(_51a&&_51a.tagName=="IMG"){
_51c=Telerik.Web.UI.Editor.Utils.getOuterHtml(_51a);
}else{
_51c=_519.getSelection().getHtml();
}
_51b=_519.get_document().createElement("A");
try{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_51b,_51c);
}
catch(e){
_51b.innerHTML=Telerik.Web.UI.Editor.Utils.stripFormatting(_51c,"ALL");
}
}
return _51b;
};
this._getLinkArgument=function(_51d,_51e){
var _51f=Telerik.Web.UI.Editor.CommandList._getParentLink(_51d);
return {selectedTabIndex:_51e?_51e:0,realLink:_51f.cloneNode(true),showText:!Telerik.Web.UI.Editor.Utils.hasHtmlContent(_51f.innerHTML),documentAnchors:Telerik.Web.UI.Editor.CommandList._getDocumentAnchors(_51d.get_document())};
};
this._getParentTable=function(_520){
_520.setFocus();
var _521=_520.getSelectedElement();
var _522=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_521,"TABLE");
return _522;
};
this._getParentCell=function(_523){
_523.setFocus();
var _524=_523.getSelectedElement();
var _525=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_524,"TD");
return _525;
};
this._getTableArgument=function(_526,_527,_528,_529){
var _52a;
var _52b=null;
if(_528){
_52a=Telerik.Web.UI.Editor.Utils.createTable(2,2,_526._document);
}else{
_52a=Telerik.Web.UI.Editor.CommandList._getParentTable(_526);
}
if(!_528&&!_52a){
return null;
}
if(_529){
_52b=Telerik.Web.UI.Editor.CommandList._getParentCell(_526);
}
var _52c=_52a.cloneNode(true);
var _52d=_52a;
return {selectedTabIndex:_527?_527:0,cellToModify:_52b,tableToModify:_52c,originalTable:_52d,tableDocument:(_52c.document)?_52c.document:_526.get_document()};
};
this.EnterParagraphMozilla=function(_52e,_52f,args){
var _531=_52f.getSelectedElement();
if("LI"==_531.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_531,"LI")!=null){
_52f.bubbleKeyEventToBrowser();
return false;
}
var _532=_52f.get_contentWindow();
var oDoc=_532.document;
function checkParent(_534,_535){
_535[_535.length]=_534;
while(_534!=null&&_534.tagName!="P"){
if(_534.tagName=="TD"){
return null;
}
_534=_534.parentNode;
_535[_535.length]=_534;
}
return _534;
}
var _536=_532.getSelection();
var _537=_536.getRangeAt(0);
var _538=_537.cloneRange();
_537.deleteContents();
var _539=_537.startOffset;
var _53a=_537.startContainer;
var _53b="";
var _53c=[];
var inP=checkParent(_53a,_53c);
if(inP){
var _53e=(inP.innerHTML=="");
var _53f=_537.cloneRange();
_53f.setStart(inP,0);
_53f.setEnd(_53a,_539);
var _540=_53f.cloneContents();
var _541=_537.cloneRange();
_541.setStart(_53a,_539);
if(inP.lastChild){
_541.setEndAfter(inP.lastChild);
}else{
_541.setEnd(inP,0);
}
var _542=_541.cloneContents();
_537.selectNode(inP);
_536.removeAllRanges();
_536.addRange(_537);
inP=inP.cloneNode(true);
inP.innerHTML="";
var _543=inP.cloneNode(true);
if(_53e){
_543.innerHTML="&nbsp;";
}else{
_543.appendChild(_540);
}
endPar=inP.cloneNode(true);
endPar.appendChild(_542);
var newP=inP.cloneNode(true);
var _545=newP;
if(_53c.length>0){
for(var i=_53c.length;i>0;i--){
var _547=_53c[i];
var _548=_547&&_547.cloneNode?_547.cloneNode(false):null;
if(_548&&_548.tagName!="P"){
_545.appendChild(_548);
_545=_548;
}
}
}
_545.innerHTML="&nbsp;";
_545.setAttribute("id","radETempNode");
var _549=oDoc.createElement("div");
_549.appendChild(_543);
_549.appendChild(newP);
if(!_53e){
_549.appendChild(endPar);
}
_53b=_549.innerHTML;
}else{
_53b="<p id='radETempNode'>&nbsp;</p>";
}
_52f.pasteHtml(_53b,"Enter",false,false,false);
oP=oDoc.getElementById("radETempNode");
if(oP){
oP.removeAttribute("id",0);
var _536=_532.getSelection();
var _537=oDoc.createRange();
_537.selectNodeContents(oP);
_536.removeAllRanges();
_536.addRange(_537);
}
var ps=oDoc.getElementsByTagName("P");
for(var i=0;i<ps.length;i++){
var _54b=ps[i].innerHTML;
if(_54b==""||_54b.trim().toLowerCase()=="<br>"){
ps[i].parentNode.removeChild(ps[i]);
}
}
return false;
};
this.Enter=function(_54c,_54d,args){
var _54f=_54d.getSelectedElement();
if("LI"==_54f.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_54f,"LI")!=null){
_54d.bubbleKeyEventToBrowser();
return false;
}
try{
var _550=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_54d.get_contentWindow());
var _551=_54d.get_document().selection.createRange();
if(_551.pasteHTML){
var tag=_54f.tagName;
if(tag.charAt(0)=="H"&&parseInt(tag.charAt(1))>0){
var _553=_551.duplicate();
_553.moveToElementText(_54f);
_54d.bubbleKeyEventToBrowser();
return false;
}
_551.pasteHTML("<br>");
_551.select();
_551.moveEnd("character",1);
_551.moveStart("character",1);
_551.collapse(false);
}else{
if(_551(0)){
_551.execCommand("Delete");
}
}
_54d.executeCommand(_550);
}
catch(exc){
alert(exc.message);
}
return false;
};
this.ShiftEnter=function(_554,_555,args){
var _557=_555.getSelectedElement();
if("LI"==_557.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_557,"LI")!=null){
var _558=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_555.get_contentWindow());
var _559=_555.get_document().selection.createRange();
_559.pasteHTML("<br>");
_559.select();
_559.moveEnd("character",1);
_559.moveStart("character",1);
_559.collapse(false);
_555.executeCommand(_558);
return false;
}
_555.bubbleKeyEventToBrowser();
return false;
};
this.ToggleTableBorder=function(_55a,_55b,args){
_55b.toggleEnhancedEdit();
return false;
};
this.RealFontSize=function(_55d,_55e,args){
var _560=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_55e);
var _561=_560.markedElements;
var _562=_55e.createRestorePoint();
var _563=new Telerik.Web.UI.Editor.GenericCommand(_55e.getLocalizedString(_55d),_55e.get_contentWindow());
if(_561.length==0){
var _564=_55e.getSelection().getParentElement();
if($telerik.isIE&&!_55e.getSelection().getHtml()&&(_564.tagName=="FONT"||_564.tagName=="SPAN")){
_55e._document.execCommand("RemoveFormat",null,false);
}
_55e.pasteHtml("<font style='font-size:"+args.value+"' id='radERealFont'>&nbsp;</font>",_55d);
var _565=_55e._document.getElementById("radERealFont");
_565.removeAttribute("id");
if($telerik.isIE){
_55e.selectElement(_565);
_55e.getSelection().collapse();
_565.innerHTML="";
}else{
if(_55e._contentWindow.getSelection){
var oSel=_55e._contentWindow.getSelection();
var _567=_55e.getSelection().getRange();
oSel.removeAllRanges();
if(_567&&_567.selectNodeContents){
_567.selectNodeContents(_565);
}
oSel.addRange(_567);
}
}
}else{
for(var i=0;i<_561.length;i++){
_561[i].style.fontSize=args.value;
_561[i].removeAttribute("size");
}
if(_562){
_562.select();
}
_55e.executeCommand(_563);
}
};
this.ConvertToUpper=this.ConvertToLower=function(_569,_56a,args){
var _56c;
var endR;
if($telerik.isIE){
if(_56a._document.selection.type.toLowerCase()=="control"){
return;
}
var _56e=_56a._document.selection.createRange();
_56c=_56e.duplicate();
endR=_56e.duplicate();
_56c.collapse();
endR.collapse(false);
}
var _56f=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_56a);
var _570=_56f.markedElements;
var _571=_56f.newElements;
var _572=new Telerik.Web.UI.Editor.GenericCommand(_56a.getLocalizedString(_569),_56a.get_contentWindow());
for(var i=0;i<_570.length;i++){
changeChildNodesCase(_570[i]);
}
for(var i=0;i<_571.length;i++){
if($telerik.isIE){
_571[i].removeNode(false);
}else{
var _574=document.createRange();
_574.selectNodeContents(_571[i]);
_571[i].parentNode.replaceChild(_574.extractContents(),_571[i]);
}
}
if($telerik.isIE){
var _575=_56a._document.selection.createRange();
_575.setEndPoint("StartToStart",_56c);
_575.setEndPoint("EndToEnd",endR);
_575.select();
}else{
var _576=_56a.get_contentWindow().getSelection();
var rng=_576.getRangeAt(0);
rng.collapse(true);
}
_56a.executeCommand(_572);
function changeChildNodesCase(_578){
var _579=_578.childNodes;
for(var i=0;i<_579.length;i++){
if(_579[i].nodeType==3){
_579[i].nodeValue=("ConvertToLower"==_569)?_579[i].nodeValue.toLowerCase():_579[i].nodeValue.toUpperCase();
}else{
if(_579[i].nodeType==1&&_579[i].tagName.toUpperCase()!="FONT"){
changeChildNodesCase(_579[i]);
}
}
}
}
};
this.ApplyClass=function(_57b,_57c,args){
var _57e=args.value;
var _57f=_57c.get_document();
var _580=_57c.createRestorePoint();
var _581=new Telerik.Web.UI.Editor.GenericCommand(_57c.getLocalizedString(_57b),_57c.get_contentWindow());
if(_57c.isIE){
var _582=_57f.selection.createRange();
var _583=(_582.length>0?_582(0):_582.parentElement());
if(_583.tagName=="LI"){
var _584=_582.htmlText;
var _585=_584.match(/<LI\/?>/gi);
var _586=_585?_585.length:0;
if(_586>1){
_583=_583.parentNode;
}else{
if(_586==0&&(Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_583,_582.htmlText))&&_583.parentNode.childNodes.length==1){
_583=_583.parentNode;
}
}
}
if(_582.length>0||_583.tagName=="OL"||_583.tagName=="UL"){
_583.className=_57e;
return;
}
}
var _587=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_57c);
var _588=_587.markedElements;
if(_588.length==0){
var _589=_57c.getSelection().getParentElement();
if($telerik.isIE&&!_57c.getSelection().getHtml()&&(_589.tagName=="FONT"||_589.tagName=="SPAN")){
_57c._document.execCommand("RemoveFormat",null,false);
}
_57c.pasteHtml("<font class='"+_57e+"' id='radERealFont'>&nbsp;</font>",_57b);
var _58a=_57c._document.getElementById("radERealFont");
_58a.removeAttribute("id");
if($telerik.isIE){
_57c.selectElement(_58a);
_57c.getSelection().collapse();
_58a.innerHTML="";
}else{
if(_57c._contentWindow.getSelection){
var oSel=_57c._contentWindow.getSelection();
var _58c=_57c.getSelection().getRange();
oSel.removeAllRanges();
if(_58c&&_58c.selectNodeContents){
_58c.selectNodeContents(_58a);
}
oSel.addRange(_58c);
}
}
}else{
for(var i=0;i<_588.length;i++){
_588[i].className=_57e;
}
if(_580){
_580.select();
}
_57c.executeCommand(_581);
}
};
this._markEditorSelection=function(_58e){
if(_58e.get_html()==""){
return {markedElements:[],newElements:[]};
}
var _58f="AZBY";
var _590="_cm";
var _591=[];
var _592=[];
var _593=[];
var _594=$telerik.isSafari?"span":"font";
var _595=_58e._contentArea;
var _596=_58e.getSelection();
if(_596.isControl()){
var _597=_596.getParentElement();
var _598=_58e._document.createElement(_594);
_598.appendChild(_597.cloneNode(true));
_597.parentNode.replaceChild(_598,_597);
return {markedElements:[_598],newElements:[_598]};
}
if(!$telerik.isSafari){
keepFontNames();
}
if(!$telerik.isIE){
_595.ownerDocument.execCommand("UseCSS",false,true);
}
_595.ownerDocument.execCommand("FontName",false,_58f);
var _599=_595.getElementsByTagName(_594);
for(var i=0;i<_599.length;i++){
var _598=_599[i];
if(_598.getAttribute("face")==_58f||_598.style.fontFamily==_58f){
_598.removeAttribute("face");
if(_598.style.fontFamily==_58f){
_598.style.fontFamily="";
}
_592.push(_598);
var _59b=_598.getElementsByTagName(_594);
for(var j=0;j<_59b.length;j++){
var _o=_59b[j];
if(_o.getAttribute("face")!=_58f){
_592.push(_o);
}
}
if(!_598.getAttribute(_590)){
_593.push(_598);
}
}
_598.removeAttribute(_590);
}
if(!$telerik.isSafari){
restoreFontNames();
}
if(!$telerik.isIE){
_595.ownerDocument.execCommand("UseCSS",false,false);
}
function keepFontNames(){
var _59e=_58e._contentArea.getElementsByTagName(_594);
for(var i=0;i<_59e.length;i++){
var _5a0=_59e[i];
if(_59e[i].face){
_5a0.setAttribute("_face",_5a0.face);
_591.push(_5a0);
}
_5a0.setAttribute(_590,1);
}
}
function restoreFontNames(){
for(var i=0;i<_591.length;i++){
_591[i].face=_591[i].getAttribute("_face");
_591[i].removeAttribute("_face");
}
_591=[];
}
return {markedElements:_592,newElements:_593};
};
})();
if(typeof (RadEditorCommandList)=="undefined"){
var RadEditorCommandList=Telerik.Web.UI.Editor.CommandList;
}
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandsManager=function(_5a2){
this._commands=[];
this._currentCommandIndex=-1;
};
Telerik.Web.UI.Editor.CommandsManager.prototype={get_commands:function(){
return this._commands;
},execute:function(_5a3,_5a4){
if(_5a3&&_5a3.execute){
var _5a5=_5a3.execute();
if(false==_5a4){
return false;
}
if(_5a5&&_5a3._canUnexecute){
this._clearCommandsToRedo();
Array.add(this._commands,_5a3);
this._currentCommandIndex=this._commands.length-1;
return true;
}
}
return false;
},undo:function(_5a6){
if(_5a6>this._commands.length){
_5a6=this._commands.length;
}
var _5a7=0;
var _5a8=null;
while(0<_5a6--&&0<=this._currentCommandIndex&&this._currentCommandIndex<this._commands.length){
_5a8=this._commands[this._currentCommandIndex--];
if(_5a8){
_5a8.unexecute();
_5a7++;
}
}
},redo:function(_5a9){
if(_5a9>this._commands.length){
_5a9=this._commands.length;
}
var _5aa=0;
var _5ab=null;
var _5ac=this._currentCommandIndex+1;
while(0<_5a9--&&0<=_5ac&&_5ac<this._commands.length){
_5ab=this._commands[_5ac];
if(_5ab){
_5ab.execute();
this._currentCommandIndex=_5ac;
_5aa++;
}
_5ac++;
}
},removeCommandAt:function(_5ad){
this._commands.splice(_5ad,1);
if(this._currentCommandIndex>=_5ad){
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 _5ae=this._commands[this._currentCommandIndex].clone();
this.execute(_5ae);
}
},_clearCommandsToRedo:function(){
if(this.isRedoAvailable()){
this._commands.splice(this._currentCommandIndex+1,this._commands.length-this._currentCommandIndex);
}
}};
Telerik.Web.UI.Editor.CommandsManager.registerClass("Telerik.Web.UI.Editor.CommandsManager",null);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditingOptions=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditingOptions.prototype={Typing:1,Tools:2,ContextMenus:4,Tab:8,Modules:16,EditModes:32,All:63};
Telerik.Web.UI.EditingOptions.registerEnum("Telerik.Web.UI.EditingOptions",false);
Telerik.Web.UI.StripFormattingOptions=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.StripFormattingOptions.prototype={None:0,NoneSupressCleanMessage:1,MSWord:2,MSWordNoFonts:4,MSWordRemoveAll:8,Css:16,Font:32,Span:64,AllExceptNewLines:128,All:256};
Telerik.Web.UI.StripFormattingOptions.registerEnum("Telerik.Web.UI.StripFormattingOptions",false);
Telerik.Web.UI.EditModes=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditModes.prototype={Design:1,Html:2,Preview:4,All:7};
Telerik.Web.UI.EditModes.registerEnum("Telerik.Web.UI.EditModes",false);
Telerik.Web.UI.EditorToolbarMode=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditorToolbarMode.prototype={Default:1,Floating:2,PageTop:4,ShowOnFocus:8};
Telerik.Web.UI.EditorToolbarMode.registerEnum("Telerik.Web.UI.EditorToolbarMode",false);
Telerik.Web.UI.EditorFilters=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.EditorFilters.prototype={None:0,RemoveScripts:1,MakeUrlsAbsolute:2,FixUlBoldItalic:4,FixEnclosingP:8,IECleanAnchors:16,MozEmStrong:32,ConvertFontToSpan:64,ConvertToXhtml:128,IndentHTMLContent:256,DefaultFilters:65533};
Telerik.Web.UI.EditorFilters.registerEnum("Telerik.Web.UI.EditorFilters",false);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Filter=function(){
Telerik.Web.UI.Editor.Filter.initializeBase(this);
this.IsDom=false;
this.Enabled=false;
this.Name="RadEditor filter";
this.Description="RadEditor filter description";
};
Telerik.Web.UI.Editor.Filter.prototype={dispose:function(){
},getHtmlContent:function(_5af){
return _5af;
},getDesignContent:function(_5b0){
return _5b0;
},get_isDom:function(){
return this.IsDom;
},set_isDom:function(_5b1){
this.IsDom=_5b1;
},get_enabled:function(){
return this.Enabled;
},set_enabled:function(_5b2){
this.Enabled=_5b2;
},get_name:function(){
return this.Name;
},set_name:function(_5b3){
this.Name=_5b3;
},get_description:function(){
return this.Description;
},set_description:function(_5b4){
this.Description=_5b4;
}};
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(_5b5){
return this._performStripping(_5b5);
},getDesignContent:function(_5b6){
return this._performStripping(_5b6);
},_performStripping:function(_5b7){
var _5b8=_5b7.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
_5b8=_5b8.replace(RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
return _5b8;
}};
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(_5b9){
var _5ba=new RegExp("<!"+"--RADEDITORSAVEDTAG_([\\s\\S]*?)--"+">","ig");
var _5bb=new RegExp("--RADEDITORSAVEDTAGENDING>","ig");
var _5bc=_5b9.replace(_5ba,"<$1>");
_5bc=_5bc.replace(_5bb,"--"+">");
return _5bc;
},getDesignContent:function(_5bd){
var _5be=function(_5bf,_5c0,_5c1,_5c2,_5c3){
var _5c4=_5c3.substring(0,_5c2).lastIndexOf("<!"+"--");
var _5c5=_5c3.substring(0,_5c2).lastIndexOf("--"+">");
if(_5c4>_5c5){
_5c4=_5c3.substring(_5c2,_5c3.length).indexOf("<!"+"--");
_5c5=_5c3.substring(_5c2,_5c3.length).indexOf("--"+">");
if((_5c4==-1&&_5c5>-1)||(_5c5<_5c4)){
return _5bf;
}
}
var _5c6=_5c1.replace("--"+">","--RADEDITORSAVEDTAGENDING>");
var _5c7="<!"+"--RADEDITORSAVEDTAG_"+_5c0+_5c6+"--"+">";
return _5c7;
};
var _5c8=new RegExp("<(script|noscript)([\\s\\S]*?<\\/\\1)>","ig");
var _5c9=_5bd.replace(_5c8,_5be);
return _5c9;
}};
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(_5ca){
return this._performStripping(_5ca);
},_performStripping:function(_5cb){
var _5cc=_5cb;
_5cc=_5cc.replace(/<BR\s?\/?>\s*<\/(H1|H2|H3|H4|H5|H6|LI|P)/ig,"</$1");
_5cc=_5cc.replace(/<(H1|H2|H3|H4|H5|H6|LI|P)([^>]*)?><BR\s?\/?>/ig,"<$1 $2>");
return _5cc;
}};
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(_5cd,_5ce){
var _5cf=_5cd.getElementsByTagName(_5ce);
if(!_5cf){
_5cf=_5cd.ownerDocument.getElementsByTagName(_5ce);
}
return _5cf;
},fixLists:function(_5d0,_5d1){
var _5d2=this._getElements(_5d0,_5d1);
for(var i=_5d2.length-1;i>=0;i--){
var list=_5d2[i];
var _5d5=list.previousSibling;
if(_5d5&&_5d5.nodeType==3){
_5d5=_5d5.previousSibling;
}
if(_5d5&&"li"==list.previousSibling.nodeName.toLowerCase()){
_5d5.appendChild(list.cloneNode(true));
var _5d6=list.parentNode;
_5d6.removeChild(list);
_5d6=null;
}
}
},getHtmlContent:function(_5d7){
this.fixLists(_5d7,"OL");
this.fixLists(_5d7,"UL");
return _5d7;
}};
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(_5d8,_5d9){
var _5da=_5d8.getElementsByTagName(_5d9);
if(!_5da){
_5da=_5d8.ownerDocument.getElementsByTagName(_5d9);
}
return _5da;
},_replaceElementWithSpan:function(_5db,_5dc,_5dd){
var _5de=this._getElements(_5db,_5dc);
while(_5de.length>0){
var _5df=_5db.ownerDocument.createElement("span");
_5df.style.cssText=_5dd;
var _5e0=_5de[0].innerHTML;
if($telerik.isIE&&_5e0==" "){
_5df.innerText=_5e0;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_5df,_5e0);
}
_5de[0].parentNode.replaceChild(_5df,_5de[0]);
_5de=this._getElements(_5db,_5dc);
}
},_replaceSpanWithElement:function(_5e1,_5e2,_5e3){
var _5e4=this._getElements(_5e1,"span");
var _5e5=_5e4.length-1;
while(_5e5>=0){
var _5e6=[];
var _5e7=_5e4[_5e5];
for(var i=0;i<_5e7.childNodes.length;i++){
Array.add(_5e6,_5e7.childNodes[i].cloneNode(true));
}
if(_5e7.style.cssText.toLowerCase()==_5e3||_5e7.style.cssText.toLowerCase()==(_5e3+";")){
var _5e9=_5e1.ownerDocument.createElement(_5e2);
for(var j=0;j<_5e6.length;j++){
_5e9.appendChild(_5e6[j]);
}
_5e7.parentNode.replaceChild(_5e9,_5e4[_5e5]);
_5e4=this._getElements(_5e1,"span");
_5e5=_5e4.length-1;
}else{
_5e5--;
}
}
},getHtmlContent:function(_5eb){
this._replaceElementWithSpan(_5eb,"u","text-decoration:underline;");
return _5eb;
},getDesignContent:function(_5ec){
this._replaceSpanWithElement(_5ec,"u","text-decoration: underline");
return _5ec;
}};
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(_5ed){
var _5ee=new RegExp("<!"+"--RADEDITORSAVEDCOMMENT","ig");
var _5ef=_5ed.replace(_5ee,"<!--");
return _5ef;
},getDesignContent:function(_5f0){
var _5f1=new RegExp("<!"+"--(\\[[^]]+\\][\\s\\S]*?)-"+"->","ig");
var _5f2=_5f0.replace(_5f1,"<!-"+"-RADEDITORSAVEDCOMMENT$1-"+"->");
return _5f2;
}};
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(_5f3){
var _5f4=new RegExp("<param([\\s\\S]+?)?>","ig");
var _5f5=new RegExp("<rade_param([\\s>])","ig");
var _5f6=_5f3;
if(_5f4.test(_5f3)&&_5f5.test(_5f3)){
_5f6=_5f6.replace(_5f4,"");
}
_5f6=_5f6.replace(_5f5,"<param$1");
_5f6=_5f6.replace(/<\/rade_param>/gi,"");
return _5f6;
},getDesignContent:function(_5f7){
var _5f8=new RegExp("<param([\\s\\S]+?)/?>","ig");
var _5f9=_5f7.replace(_5f8,"<rade_param$1></rade_param><param$1>");
return _5f9;
}};
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 _5fb=node.parentNode;
if(_5fb!=null){
while(node.childNodes&&node.childNodes.length>0){
_5fb.insertBefore(node.childNodes[0],node);
}
_5fb.removeChild(node);
return _5fb;
}
return true;
},getHtmlContent:function(_5fc){
var _5fd=null;
if(_5fc.tagName.toLowerCase()=="html"){
_5fd=_5fc.getElementsByTagName("BODY")[0];
}else{
_5fd=_5fc;
}
if($telerik.isIE){
if(_5fd&&(_5fd.firstChild)&&("P"==_5fd.firstChild.tagName)&&(_5fd.childNodes.length==1)&&(_5fd.innerHTML.substring(0,3).toLowerCase()=="<p>")){
this._removeNode(_5fd.firstChild);
}
}else{
if(_5fd&&(_5fd.childNodes.length==1)&&(_5fd.firstChild.tagName)&&("br"==_5fd.firstChild.tagName.toLowerCase())){
_5fd.innerHTML="";
}
}
return _5fc;
}};
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(_5fe){
var re=new RegExp("(<p[^>]*>)(<\\/p>)","ig");
var _600=_5fe.replace(re,"$1&nbsp;$2");
return _600;
}};
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(_601){
var _602=document.location.href;
var re=new RegExp("(<A[^<>]*?(href)\\s*=\\s*['\"])("+_602+")(\\#[^'\"]*?['\"][^>]*?>)","ig");
var _604=_601.replace(re,"$1$4");
return _604;
}};
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(_605){
var _606=_605.replace(new RegExp("<b(\\s([^>])*?)?>","ig"),"<strong$1>");
_606=_606.replace(new RegExp("</b(\\s([^>])*?)?>","ig"),"</strong$1>");
_606=_606.replace(new RegExp("<i(\\s([^>])*?)?>","ig"),"<em$1>");
_606=_606.replace(new RegExp("</i(\\s([^>])*?)?>","ig"),"</em$1>");
return _606;
},getDesignContent:function(_607){
var _608=_607.replace(new RegExp("<strong(\\s([^>])*?)?>","ig"),"<b$1>");
_608=_608.replace(new RegExp("</strong(\\s([^>])*?)?>","ig"),"</b$1>");
_608=_608.replace(new RegExp("<em(\\s([^>])*?)?>","ig"),"<i$1>");
_608=_608.replace(new RegExp("</em(\\s([^>])*?)?>","ig"),"</i$1>");
return _608;
}};
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(_609){
var self=this;
var _60b=function(_60c,_60d,_60e,_60f,_610){
var _611=_610.indexOf("</head>",_60f);
if(_611!=-1&&_610.indexOf("<body",_611)!=-1){
return _60c;
}else{
self.markerCounter++;
var _612="RadEditorStyleKeeper"+self.markerCounter;
var _613="<div id='"+_612+"' style='display:none;'>&nbsp;</div><"+_60d+" reoriginalpositionmarker='"+_612+"'"+_60e;
return _613;
}
};
var _614=new RegExp("<(link|style)([^>]*>)","gi");
var _615=_609.replace(_614,_60b);
return _615;
}};
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(_616){
var _617=_616.getElementsByTagName("HEAD")[0];
var _618=true;
if(!_617){
_617=_616.ownerDocument.getElementsByTagName("HEAD")[0];
_618=false;
}
if(!_617){
return _616;
}
this._restoreElements(_617,_616,"STYLE");
this._restoreElements(_617,_616,"LINK");
var divs=_616.getElementsByTagName("DIV");
if(divs){
for(var j=divs.length-1;j>=0;j--){
var _61b=divs[j];
if(_61b.id.indexOf("RadEditorStyleKeeper")==0){
var _61c=_61b.parentNode;
_61c.removeChild(_61b);
}
}
}
divs=null;
if(_618){
this._removeElements(_617,"STYLE");
this._removeElements(_617,"LINK");
}
this._removeMarkerAttributes(_616,"STYLE");
this._removeMarkerAttributes(_616,"LINK");
return _616;
},_restoreElements:function(_61d,_61e,_61f){
var _620;
_620=_61d.getElementsByTagName(_61f);
this._divs=_61e.getElementsByTagName("DIV");
var i=0;
while(_620.length>0&&i<_620.length){
this._restoreStyle(_620[i++]);
}
},_restoreStyle:function(_622){
var _623=_622.getAttribute("reoriginalpositionmarker");
if(_623){
j=0;
var _624=null;
while(j<this._divs.length&&!_624){
if(this._divs[j].id==_623){
_624=this._divs[j];
}
j++;
}
if(_624){
var _625=_622.cloneNode(true);
_625.removeAttribute("reoriginalpositionmarker");
var _626=_624.parentNode;
_626.replaceChild(_625,_624);
return true;
}
}
return false;
},_removeElements:function(_627,_628){
var _629=_627.getElementsByTagName(_628);
if(_629){
for(var j=_629.length-1;j>=0;j--){
var _62b=_629[j];
if(null!=_62b.getAttribute("reoriginalpositionmarker")){
var _62c=_62b.parentNode;
_62c.removeChild(_62b);
}
}
_629=null;
}
},_removeMarkerAttributes:function(_62d,_62e){
styles=_62d.getElementsByTagName(_62e);
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(_630){
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=_630?_630:"FlashManager.gif";
};
Telerik.Web.UI.Editor.MozillaKeepFlashString.prototype={getDesignContent:function(_631){
var _632=this;
var _633=function(_634,gr1,gr2,gr3,str,_639){
var _63a=String.format("<img isflash=\"true\" {0} />{1}",gr1,gr2);
_63a=_63a.replace(/\ssrc=/gi,String.format(" src=\"{0}\" flashSrc=",_632._flashImageSrc));
return _63a;
};
var _63b=new RegExp("<embed([^>]*)?>(.*)?(<\\/embed>)?","ig");
var _63c=_631.replace(_63b,_633);
return _63c;
}};
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(_63d){
if(!_63d){
return _63d;
}
var _63e=_63d.getElementsByTagName("IMG");
for(var i=0;i<_63e.length;i++){
var _640=_63e[i];
var _641=_640.getAttribute("isflash");
if(_641!=null){
var _642=_640.getAttribute("flashSrc");
var _643=Telerik.Web.UI.Editor.Utils.getOuterHtml(_640);
_643=_643.replace(/<img/gi,"<embed");
var oDiv=_640.ownerDocument.createElement("DIV");
oDiv.innerHTML=_643;
newNode=oDiv.firstChild;
if(_642){
newNode.src=_642;
if($telerik.isSafari){
newNode.setAttribute("src",_642);
}
}
newNode.removeAttribute("flashSrc");
newNode.removeAttribute("isflash");
var _645=_640.parentNode;
_645.insertBefore(newNode,_640);
_645.removeChild(_640);
i--;
}
}
return _63d;
}};
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(_646){
var html=_646;
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(_649){
var _64a=_649.ownerDocument;
var _64b=_64a.createElement("SPAN");
var span,font,_64e;
var _64f=_649.getElementsByTagName("FONT");
while(_64f.length>0){
font=_64f[0];
_64e=font.parentNode;
span=_64b.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);
}
_64e.replaceChild(span,font);
_64f=_649.getElementsByTagName("FONT");
}
return _649;
},getDesignContent:function(_651){
var _652=_651.ownerDocument;
var _653=_652.createElement("FONT");
var span,font,_656;
var _657=_651.getElementsByTagName("SPAN");
while(_657.length>0){
span=_657[0];
_656=span.parentNode;
font=_653.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 _659=null;
if(-1!=span.style.fontSize.indexOf("px")){
_659=this._fontSizesRevPx[parseInt(span.style.fontSize)];
}
if(typeof (_659)!="undefined"&&null!=_659){
font.size=_659+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);
}
_656.replaceChild(font,span);
_657=_651.getElementsByTagName("SPAN");
}
return _651;
},_fixColorValue:function(_65a){
if(_65a.toLowerCase().indexOf("rgb")!=-1){
var _65b="#";
var _65c=function(val){
var _65e=parseInt(val,10).toString(16);
_65b=_65b+(_65e.length==1?"0"+_65e:_65e);
return val;
};
_65a=_65a.replace(/(\d+)/gi,_65c);
_65c=null;
return _65b;
}else{
return _65a;
}
},_removeElementStyleAttribute:function(_65f,_660){
if(_65f.style&&_65f.style[_660]){
if(_65f.style.removeAttribute){
_65f.style.removeAttribute(_660);
}else{
if(_65f.style.removeProperty){
_660=_660.replace(/([A-Z])/g,"-$1").toLowerCase();
_65f.style.removeProperty(_660);
}
}
if(_65f.style[_660]){
_65f.style[_660]=null;
}
if(_65f.style.cssText){
}else{
_65f.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(_661){
if(!_661){
return "";
}
var sb=new Sys.StringBuilder("");
this._appendNodeXhtml(_661,sb);
return sb.toString();
},_convertAttribute:function(s){
return String(s).replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
},_getAttributeValue:function(_664,_665,sb){
var name=_664.nodeName;
var _668=_664.nodeValue;
if(name!="style"){
if($telerik.isIE&&(name=="type"||name=="value"||name=="selected")){
if(!_668){
return;
}
}else{
if(!_664.specified){
if($telerik.isIE&&_668==""&&typeof (_665[name])=="string"&&_665[name]!=""){
_668=_665[name];
}else{
return;
}
}
}
if(!_668){
return;
}
if(!isNaN(_668)){
_668=_665.getAttribute(name);
}
if($telerik.isIE&&(name=="href"||name=="src")){
_668=_665.getAttribute(name,2);
}
sb.append(" "+(_664.expando?name:name.toLowerCase())+"=\""+this._convertAttribute(_668)+"\"");
}else{
var _669=_665.style.cssText;
if(_669){
sb.append(" style=\""+this._convertAttribute(_669.toLowerCase())+"\"");
}
}
},_canHaveChildren:function(node){
switch(node.tagName.toUpperCase()){
case "AREA":
case "BASE":
case "BASEFONT":
case "COL":
case "FRAME":
case "HR":
case "IMG":
case "BR":
case "INPUT":
case "ISINDEX":
case "LINK":
case "META":
case "PARAM":
return false;
}
return true;
},_appendElementNode:function(node,sb){
if(node.tagName.charAt(0)=="/"){
return;
}
if(node.nodeName=="!"){
sb.append(node.text);
return;
}
var name=node.nodeName;
if(node.scopeName){
if(node.scopeName=="HTML"){
name=name.toLowerCase();
}else{
name=node.scopeName+":"+name;
}
}else{
name=name.toLowerCase();
}
sb.append("<"+name);
if($telerik.isIE){
if("img"==name){
var oImg=document.createElement("IMG");
oImg.mergeAttributes(node);
if(oImg.width){
sb.append(" width=\""+node.getAttribute("width",2)+"\"");
}
if(oImg.height){
sb.append(" height=\""+node.getAttribute("height",2)+"\"");
}
if(oImg.getAttribute("alt").length==0){
sb.append(" alt=\""+oImg.getAttribute("alt")+"\"");
}
}else{
if("area"==name||"a"==name){
if(node.shape){
sb.append(" shape=\""+node.shape.toLowerCase()+"\"");
}
if(node.coords){
sb.append(" coords=\""+node.getAttribute("coords")+"\"");
}
if(node.href){
var _66f=node.getAttribute("href",2).replace("about:blank","");
_66f=_66f.replace("about:","");
_66f=_66f.replace(/&amp;/gi,"&").replace(/&/gi,"&amp;");
sb.append(" href=\""+_66f+"\"");
node.removeAttribute("href",0);
}
}
}
}
try{
var _670=node.attributes;
var l=_670.length;
for(var i=0;i<l;i++){
this._getAttributeValue(_670[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 _673="";
if(node.altHtml){
_673=node.altHtml;
}else{
_673=node.innerHTML;
}
if($telerik.isIE){
_673=_673.replace(/\soriginalAttribute="[^"]+"/gi,"");
_673=_673.replace(/\soriginalPath="[^"]+"/gi,"");
}
sb.append(_673);
sb.append("</object>");
break;
case "title":
case "style":
case "comment":
case "noscript":
var _673=node.innerHTML;
if($telerik.isIE&&_673.length==0){
_673=node.ownerDocument.title;
}
sb.append(">"+_673+"</"+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 _677=String(node.nodeValue);
var _678=node.parentNode.nodeName.toLowerCase();
if(!$telerik.isIE&&(_678=="style"||_678=="script")){
sb.append(_677);
}else{
_677=_677.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
if($telerik.isFirefox){
_677=_677.replace(/[\u00a0]/g,"&nbsp;");
}
sb.append(_677);
}
},_appendCDataNode:function(node,sb){
sb.append("<![CDA"+"TA[\n"+node.nodeValue+"\n]"+"]>");
},_appendCommentNode:function(node,sb){
var _67d=node.nodeValue;
if(!_67d&&node.text){
_67d=node.text;
}else{
_67d="<!--"+_67d+"-->";
}
sb.append(_67d);
},_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 _680="P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION";
var _681="HTML|HEAD|BODY|STYLE|FORM|TABLE|TBODY|THEAD|TR";
var _682=_681+"|UL|OL";
this._ignoreTags=new RegExp("(<PRE[^>]*>|<!--|<SCRIPT[^>]*>)([\\s\\S]*?)(<\\/PRE>|-->|<\\/SCRIPT>)","gi");
this._tagsNLBefore=new RegExp("<("+_680+")[^>]*>","gi");
this._tagsNLAfter=new RegExp("<\\/("+_680+")[^>]*>","gi");
this._tagsNLNoCloseAfter=new RegExp("<(BR|HR)[^>]*\\/?>","gi");
this._tagsNLBeforeAndAfter=new RegExp("<\\/?("+_681+")[^>]*>","gi");
this._tagsIncIndent=new RegExp("^<("+_682+")[\\s\\/>]","i");
this._tagsDecIndent=new RegExp("^<\\/("+_682+")[\\s\\>]","i");
this._shrinkNL=new RegExp("\\s*\\n+\\s*","gi");
};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.prototype={dispose:function(){
this._protectedData=[];
},getHtmlContent:function(html){
var _684=html.trim();
if(_684.indexOf("<body")==0){
_684=_684.substring(_684.indexOf(">")+1,_684.length-7);
}
this._protectedData=[];
var self=this;
var _686=function(_687,_688,_689,_68a,_68b,_68c){
Array.add(self._protectedData,_689);
return _688+"RADEDITORFORMATTED_"+self._protectedData.length+_68a;
};
_684=_684.replace(this._ignoreTags,_686);
var _68d="$&";
if($telerik.isSafari){
_68d="$0";
}
_684=_684.replace(this._tagsNLBefore,"\n"+_68d);
_684=_684.replace(this._tagsNLAfter,_68d+"\n");
_684=_684.replace(this._tagsNLNoCloseAfter,_68d+"\n");
_684=_684.replace(this._tagsNLBeforeAndAfter,"\n"+_68d+"\n");
var _68e=_684.split(this._shrinkNL);
var _68f=new Sys.StringBuilder("");
var _690="";
for(var i=0;i<_68e.length;i++){
var line=_68e[i];
if(line.length==0){
continue;
}
if(this._tagsDecIndent.test(line)){
if(_690.length>this._indentPattern.length){
_690=_690.substring(this._indentPattern.length);
}else{
_690="";
}
}
_68f.append(_690);
_68f.append(line);
_68f.append("\n");
if(this._tagsIncIndent.test(line)){
_690+=this._indentPattern;
}
}
_684=_68f.toString();
for(var i=0;i<this._protectedData.length;i++){
var _693=new RegExp("RADEDITORFORMATTED_"+(i+1));
_684=_684.replace(_693,this._protectedData[i]);
}
return _684;
}};
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(_694){
this._updateElements(_694,"A","href");
this._updateElements(_694,"AREA","href");
this._updateElements(_694,"IMG","src");
this._updateElements(_694,"EMBED","src");
return _694;
},_getElements:function(_695,_696){
var _697=_695.getElementsByTagName(_696);
if(!_697){
_697=_695.ownerDocument.getElementsByTagName(_696);
}
return _697;
},_updateElements:function(_698,_699,_69a){
var _69b=_698.ownerDocument.createElement("div");
var _69c=this._getElements(_698,_699);
if(_69c){
for(var i=0;i<_69c.length;i++){
if("href"==_69a&&_69c[i].getAttribute("href",2)){
_69b.innerHTML="<a href=\""+_69c[i].getAttribute("href",2).replace(/\"/gi,"%22")+"\">test</a>";
_69c[i].setAttribute("href",_69b.childNodes[0].href);
}else{
if("src"==_69a&&_69c[i].getAttribute("src",2)){
_69b.innerHTML="<img src=\""+_69c[i].getAttribute("src",2).replace(/\"/gi,"%22")+"\" />";
_69c[i].setAttribute("src",_69b.childNodes[0].src);
}
}
}
}
_69b.innerHTML="";
_69b=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(_69e){
this._enableXhtmlFilter=_69e;
},add:function(_69f){
Array.add(this._filters,_69f);
},addAt:function(_6a0,_6a1){
Array.insert(this._filters,_6a1,_6a0);
},remove:function(_6a2){
Array.remove(this._filters,_6a2);
},removeAt:function(_6a3){
Array.removeAt(this._filters,_6a3);
},getFilterAt:function(_6a4){
return this._filters[_6a4];
},getFilterByName:function(name){
for(var i=0;i<this._filters.length;i++){
var _6a7=this._filters[i];
if(_6a7&&name==_6a7.get_name()){
return _6a7;
}
}
},getDesignContent:function(_6a8){
var _6a9=_6a8;
for(var i=0;i<this._filters.length;i++){
var _6ab=this._filters[i];
if((!_6ab.get_isDom())&&(false!=_6ab.get_enabled())&&_6ab.getDesignContent){
try{
_6a9=_6ab.getDesignContent(_6a9);
}
catch(exc){
alert("Error while executing filter "+_6ab.get_name()+" - "+exc.toString());
}
}
}
return _6a9;
},getDesignContentDom:function(_6ac){
for(var i=0;i<this._filters.length;i++){
var _6ae=this._filters[i];
if((_6ae.get_isDom())&&(false!=_6ae.get_enabled())&&_6ae.getDesignContent){
try{
_6ac=_6ae.getDesignContent(_6ac);
}
catch(exc){
alert("Error while executing filter "+_6ae.get_name()+" - "+exc.toString());
}
}
}
return _6ac;
},getHtmlContent:function(_6af){
for(var i=0;i<this._filters.length;i++){
var _6b1=this._filters[i];
if((_6b1.get_isDom())&&(false!=_6b1.get_enabled())&&_6b1.getHtmlContent){
try{
_6af=_6b1.getHtmlContent(_6af);
}
catch(exc){
alert("Error while executing filter "+_6b1.get_name()+" - "+exc.toString());
}
}
}
var _6b2;
if(this.get_enableXhtmlFilter()){
try{
_6b2=this._convertToXhtmlFilter.getHtmlContent(_6af);
}
catch(exc){
alert("Error while executing filter XHTML - "+exc.toString());
}
}else{
_6b2=_6af.innerHTML;
}
_6b2=_6b2.replace(/<body\s*\/>/i,"<body></body>");
for(var i=0;i<this._filters.length;i++){
var _6b1=this._filters[i];
if((!_6b1.get_isDom())&&(false!=_6b1.get_enabled())&&_6b1.getHtmlContent){
try{
_6b2=_6b1.getHtmlContent(_6b2);
}
catch(exc){
alert("Error while executing filter "+_6b1.get_name()+" - "+exc.toString());
}
}
}
return _6b2;
}};
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(_6b3){
this.Window=_6b3;
this.Document=_6b3.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 _6b4=this.Document.selection.createRange();
if(_6b4.length){
this.SourceIndex=_6b4.item(0).sourceIndex;
}else{
this.StartBookmark=_6b4.getBookmark();
}
},restore:function(_6b5){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this.Document.body,this.HtmlText);
this.select(_6b5);
},select:function(_6b6){
if(null!=this.SourceIndex){
var _6b7=this.Document.body.createControlRange();
_6b7.addElement(this.Document.all(this.SourceIndex));
_6b7.select();
}else{
if(null!=this.StartBookmark){
var _6b7=this.Document.body.createTextRange();
_6b7.moveToBookmark(this.StartBookmark);
_6b7.select();
if(true==_6b6&&_6b7.collapse){
_6b7.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(_6b8){
if(_6b8){
return {anchorNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6b8.anchorNode),anchorOffset:_6b8.anchorOffset,focusNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6b8.focusNode),focusOffset:_6b8.focusOffset,isCollapsed:_6b8.isCollapsed};
}else{
return {};
}
},_moveToBookmark:function(_6b9,_6ba){
var _6bb=_6ba.anchorNodeBookmark.select();
var _6bc=_6ba.focusNodeBookmark.select();
_6b9.collapse(_6bb,_6ba.anchorOffset);
if(!_6ba.isCollapsed){
_6b9.extend(_6bc,_6ba.focusOffset);
}
}};
}
Telerik.Web.UI.Editor.RestorePoint.registerClass("Telerik.Web.UI.Editor.RestorePoint",null);
Telerik.Web.UI.Editor.SelectionBookmark=function(_6bd,node){
this.Window=_6bd;
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(_6c0,node){
var n,res;
for(var i=0;i<_6c0.childNodes.length;i++){
n=_6c0.childNodes[i];
res=this._findNodePath(n,node);
if(""!=res){
return ""+i+","+res;
}
if(n==node){
return ""+i;
}
}
return "";
},_findNode:function(_6c5,_6c6){
var arr=_6c6.split(",");
for(var i=0;i<arr.length;i++){
_6c5=_6c5.childNodes[arr[i]];
}
return _6c5;
}};
Telerik.Web.UI.Editor.SelectionBookmark.registerClass("Telerik.Web.UI.Editor.SelectionBookmark",null);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Selection=function(_6c9){
this._window=_6c9;
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(_6ca,_6cb){
_6cb=(_6cb==true);
if($telerik.isIE){
return this._executeIE(_6ca,_6cb);
}else{
return this._executeMozilla(_6ca,_6cb);
}
},_executeIE:function(_6cc,_6cd){
var _6ce=this._window.document;
var _6cf=_6ce.selection;
if(_6cf.type.toLowerCase()!="none"){
_6cf.createRange().execCommand("Delete");
}
if(_6cf.type.toLowerCase()!="none"){
_6ce.execCommand("Delete");
}
_6ce.body.setActive();
selRange=_6cf.createRange();
if(selRange&&selRange.length){
var _6d0=selRange.item(0);
if(_6d0&&_6d0.tagName=="BODY"){
var _6d1=_6d0.getElementsByTagName("FORM")[0];
if(_6d1){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_6d1,_6d1.innerHTML+_6cc);
}
}
}else{
var _6d2=selRange.duplicate();
_6d2.collapse(true);
_6cc=Telerik.Web.UI.Editor.Utils.getStoredOriginalPathsAndAttributes(_6cc);
selRange.pasteHTML(_6cc);
Telerik.Web.UI.Editor.Utils.restoreOriginalPathsAndAttributes(selRange.parentElement());
if(_6cd){
_6d2.setEndPoint("EndToEnd",selRange);
_6d2.select();
}
}
return true;
},_executeMozilla:function(_6d3,_6d4){
var oDoc=this._window.document;
var _6d6=oDoc.createElement("SPAN");
_6d6.innerHTML=_6d3;
var _6d7="radetempnode";
if(this.isOpera){
_6d6.setAttribute("id",_6d7);
}
this._insertNodeAtSelection(this._window,_6d6,true);
if(this.isOpera){
var _6d8=oDoc.createRange();
var _6d9=this._window.getSelection();
var span=oDoc.getElementById(_6d7);
_6d8.selectNodeContents(span);
var _6db=_6d8.extractContents();
_6d8.selectNode(span);
var _6dc=_6d8.extractContents();
_6d8.insertNode(_6db);
_6d9.addRange(_6d8);
return true;
}else{
if(!this.isSafari){
var _6d8=oDoc.createRange();
_6d8.selectNodeContents(_6d6);
var _6db=_6d8.extractContents();
_6d8.selectNode(_6d6);
_6d8.deleteContents();
this._insertNodeAtSelection(this._window,_6db,_6d4);
}
}
return true;
},_insertNodeAtSelection:function(win,_6de,_6df){
var _6e0=win.getSelection();
if(_6e0.rangeCount==0){
win.document.body.appendChild(_6de);
return;
}
var _6e1=null;
if(_6e0.getRangeAt){
_6e1=_6e0.getRangeAt(0);
}else{
_6e1=win.document.createRange();
_6e1.setStart(_6e0.anchorNode,_6e0.anchorOffset);
_6e1.setEnd(_6e0.focusNode,_6e0.focusOffset);
}
if(_6e0.removeAllRanges){
_6e0.removeAllRanges();
}
_6e1.deleteContents();
var _6e2=$telerik.isSafari&&!$telerik.isSafari3?_6e0.baseNode:_6e1.startContainer;
var _6e3=$telerik.isSafari&&!$telerik.isSafari3?_6e0.baseOffset:_6e1.startOffset;
if($telerik.isSafari&&null==_6e2){
_6e2=win.document.body;
}
_6e1=win.document.createRange();
if((_6de.nodeType==3)&&(_6e2.nodeType==3)){
_6e2.insertData(_6e3,_6de.nodeValue);
_6e1.setEnd(_6e2,_6e3+_6de.length);
if(_6df){
_6e1.setStart(_6e2,_6e3);
}else{
_6e1.setStart(_6e2,_6e3+_6de.length);
}
}else{
var _6e4;
if(_6e2.nodeType==3){
var _6e5=_6e2;
_6e2=_6e5.parentNode;
var _6e6=_6e5.nodeValue;
var _6e7=_6e6.substr(0,_6e3);
var _6e8=_6e6.substr(_6e3);
var _6e9=win.document.createTextNode(_6e7);
var _6e4=win.document.createTextNode(_6e8);
_6e2.insertBefore(_6e4,_6e5);
_6e2.insertBefore(_6de,_6e4);
try{
_6e2.insertBefore(_6e9,_6de);
}
catch(exc){
}
_6e2.removeChild(_6e5);
}else{
if(_6e2.childNodes.length>0){
_6e4=_6e2.childNodes[_6e3];
_6e2.insertBefore(_6de,_6e4);
}else{
if(_6e2.tagName!="BODY"){
_6e2=_6e2.parentNode;
}
_6e2.appendChild(_6de);
}
}
try{
if(_6df){
_6e1.setStart(_6de,0);
_6e1.setEnd(_6e4,0);
}else{
_6e1.setEnd(_6e4,0);
_6e1.setStart(_6e4,0);
}
}
catch(exc){
}
}
try{
_6e0.addRange(_6e1);
}
catch(exc){
}
},selectRange:function(_6ea){
if(!_6ea){
return;
}
var _6eb=this._window;
if(_6ea.select){
_6ea.select();
}else{
if(_6eb.getSelection){
var _6ec=_6eb.getSelection();
if(_6ec.removeAllRanges){
_6ec.removeAllRanges();
_6ec.addRange(_6ea);
}else{
var base=_6ea.baseNode;
if(null==base){
base=_6eb.document.body;
}
var _6ee=_6ea.extentNode;
if(null==_6ee){
_6ee=_6eb.document.body;
}
_6ec.setBaseAndExtent(base,_6ea.startOffset,_6ee,_6ea.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 _6ef=this._window.getSelection();
if(!_6ef||_6ef.rangeCount<1){
return null;
}
var rng=null;
if(_6ef.getRangeAt){
rng=_6ef.getRangeAt(0);
}else{
rng=this._window.document.createRange();
rng.setStart(_6ef.anchorNode,_6ef.anchorOffset);
rng.setEnd(_6ef.focusNode,_6ef.focusOffset);
}
return rng;
}
}
},getParentElement:function(){
var rng=this.getRange();
if(!rng){
return null;
}
if(rng.commonAncestorContainer){
var _6f2=this._window.getSelection();
var _6f3=rng.startContainer?rng.startContainer:_6f2.baseNode;
var _6f4=rng.endContainer?rng.endContainer:_6f2.extentNode;
var _6f5=rng.startOffset!=null?rng.startOffset:_6f2.baseOffset;
var _6f6=rng.endOffset!=null?rng.endOffset:_6f2.extentOffset;
if(_6f3==_6f4&&(_6f6-_6f5)==1){
return _6f2.anchorNode.childNodes[_6f2.anchorOffset];
}else{
if(!rng.commonAncestorContainer.tagName){
if(this._window.document==rng.commonAncestorContainer&&_6f2.baseNode){
return _6f2.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 _6f8=oSel.focusNode;
if(!_6f8||_6f8.nodeType==1){
return false;
}
return (_6f8.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 _6fb=this._window.getSelection();
var rng=null;
if(null==_6fb){
return "";
}
if(_6fb.getRangeAt&&typeof (_6fb.rangeCount)!="undefined"&&_6fb.rangeCount==0){
return "";
}
if(_6fb.getRangeAt){
rng=_6fb.getRangeAt(0);
var _6fc=this._window.document.createElement("div");
var _6fd=rng.cloneContents();
if(_6fd){
_6fc.appendChild(_6fd);
return _6fc.innerHTML;
}else{
return "";
}
}else{
return _6fb;
}
}else{
return "";
}
}
},collapse:function(_6fe){
_6fe=(_6fe==true);
if(this._window.document.selection){
var rng=this._window.document.selection.createRange();
if(rng.collapse){
rng.collapse(_6fe);
rng.select();
}
}else{
if(this._window.getSelection){
var _700=this._window.getSelection();
if(!_700.isCollapsed){
if(_6fe){
_700.collapseToStart();
}else{
_700.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(_701,_702){
var rs=new Telerik.Web.UI.EditorShortCut(_701,_702);
rs.HashValue=this._getShortCutHashValue(rs);
this._shortcuts[rs.HashValue]=rs;
},removeShortCut:function(_704){
var _705=this._findByName(_704);
if(_705){
this._shortcuts[_705.HashValue]=null;
}
},setShortCut:function(_706,_707){
this.removeShortCut(_706);
this.addShortCut(_706,_707);
},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(_709,_70a,_70b,_70c,_70d,_70e,_70f){
var _710=this._getHashValue(_709,_70a,_70b,_70c,_70d,_70e,_70f);
return this._shortcuts[_710];
},_getHashValue:function(_711,_712,_713,_714,_715,_716,_717){
var _718=_711&65535;
var _719=0;
_719|=(_712?(1<<0):0);
_719|=(_714?(1<<2):0);
_719|=(_716?(1<<4):0);
_718|=(_719<<16);
return _718;
},_getShortCutHashValue:function(_71a){
return this._getHashValue(_71a.KeyCode,_71a.CtrlKey,_71a.LeftCtrlKey,_71a.ShiftKey,_71a.LeftShiftKey,_71a.AltKey,_71a.LeftAltKey);
},_findByName:function(_71b){
var _71c;
for(var _71d in this._shortcuts){
_71c=this._shortcuts[_71d];
if(null!=_71c&&_71c._name==_71b){
return _71c;
}
}
return null;
}};
Telerik.Web.UI.EditorShortCut=function(_71e,_71f){
this._name=_71e;
this.setShortCut(_71f);
};
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(_720){
this._name=_720;
},setShortCut:function(_721){
this._parseShortcutString(_721);
},_parseShortcutString:function(_722){
if("string"==typeof (_722)){
this.CtrlKey=false;
this.LeftCtrlKey=false;
this.ShiftKey=false;
this.LeftShiftKey=false;
this.AltKey=false;
this.LeftAltKey=false;
this.KeyCode=0;
_722=_722.replace(/\s*/gi,"");
_722=_722.replace(/\+\+/gi,"+PLUS");
var _723=_722.split("+");
var _724="";
for(var i=0;i<_723.length;i++){
_724=_723[i].toUpperCase();
switch(_724){
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=_724.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(_726,_727,_728){
if(typeof (this._controls[_726])=="undefined"){
this._controls[_726]={};
}
if(typeof (this._controls[_726][_727])=="undefined"){
this._controls[_726][_727]={};
}
var _729=this._controls[_726][_727];
for(var _72a in _728){
if(typeof (_728[_72a])=="string"){
_729[_72a]=_728[_72a];
}
}
return _729;
}};
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(_72b,tool,_72d){
Telerik.Web.UI.EditorCommandEventArgs.initializeBase(this);
this._name=this._commandName=_72b;
this._tool=tool;
this._value=_72d;
this.value=_72d;
};
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(_72f){
Telerik.Web.UI.RadEditor.initializeBase(this,[_72f]);
this._rootElement=null;
this._bottomResizer=null;
this._tableElement=null;
this._document=null;
this._contentArea=null;
this._contentAreaElement=null;
this._contentHiddenTextarea=null;
this._contentTextArea=null;
this._contentWindow=null;
this._doctypeString=null;
this._fullPage=null;
this._originalHeight=null;
this._toolJSON=[];
this._contextMenusJSON=[];
this._modulesJSON=[];
this._toolAdapterType="";
this._uniqueID="";
this._skin="";
this._newLineBr=true;
this._autoResizeHeight=false;
this._contentAreaCssFile="";
this._mozillaFlashOverlayImage="FlashManager.gif";
this._stripFormattingOptions=Telerik.Web.UI.StripFormattingOptions.None;
this._editModes=Telerik.Web.UI.EditModes.All;
this._contentFilters=Telerik.Web.UI.EditorFilters.DefaultFilters;
this._mode=Telerik.Web.UI.EditModes.Design;
this._toolbarMode=Telerik.Web.UI.EditorToolbarMode.Default;
this._shortCutManager=new Telerik.Web.UI.EditorShortCutManager();
this._filtersManager=new Telerik.Web.UI.Editor.FiltersManager();
this._commandsManager=new Telerik.Web.UI.Editor.CommandsManager();
if(null!=Telerik.Web.UI.Editor.ModulesManager){
this._modulesManager=new Telerik.Web.UI.Editor.ModulesManager(this);
}
this._resizeExtender=null;
this._toolAdapter=null;
this._localization={};
this._contentAreaEventHandlers={};
this._onToolClickDelegate=Function.createDelegate(this,this._onToolClick);
this._onWindowResizeDelegate=null;
this._dialogOpener=null;
this._saveContentDelegate=null;
this._colors=null;
this._fontNames=null;
this._fontSizes=null;
this._realFontSizes=null;
this._symbols=null;
this._contextMenus=null;
this._snippets=null;
this._cssClasses=null;
this._cssFiles=null;
this._languages=null;
this._paragraphs=null;
this._links=null;
this.isIE=$telerik.isIE;
this.isFirefox=$telerik.isFirefox;
this.isOpera=$telerik.isOpera;
this.isIE7=$telerik.isIE7;
this._spellAllowAddCustom=true;
this._spellCheckJSON={};
this._spellCheckService=null;
this._ajaxSpellCheckScriptReference="";
};
Telerik.Web.UI.RadEditor.prototype={add_spellCheckLoaded:function(_730){
this.get_events().addHandler("spellCheckLoaded",_730);
},remove_spellCheckLoaded:function(_731){
this.get_events().removeHandler("spellCheckLoaded",_731);
},get_ajaxSpellCheck:function(){
return this._ajaxSpellCheck;
},set_ajaxSpellCheck:function(_732){
this._ajaxSpellCheck=_732;
this.raiseEvent("spellCheckLoaded");
},get_ajaxSpellCheckScriptReference:function(){
return this._ajaxSpellCheckScriptReference;
},get_spellAllowAddCustom:function(){
return this._spellAllowAddCustom;
},set_spellAllowAddCustom:function(_733){
this._spellAllowAddCustom=_733;
},get_spellCheckJSON:function(){
return this._spellCheckJSON;
},set_spellCheckJSON:function(_734){
this._spellCheckJSON=_734;
},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(_736,args){
},raiseEvent:function(_738,args){
if(_738!="selectionChange"||this.get_mode()==Telerik.Web.UI.EditModes.Design){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"raiseEvent",[_738,args]);
}
},initialize:function(){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"initialize");
this.raiseEvent("init",Sys.EventArgs.Empty);
var _73a=$get(this.get_id()+"Wrapper");
this._originalHeight=_73a.style.height;
this._initializeLocalization();
this._addFilters();
this._addDefaultShortCuts();
this._createUI();
this._createTools();
this._makeResizeable(true);
if(true){
var _73b=$get(this.get_id()+"ContentHiddenTextarea");
if(_73b){
_73b.setAttribute("id",this.get_id());
this._contentHiddenTextarea=_73b;
}
this._setContentAreaHtml(this.get_contentHiddenTextareaValue(),true);
}
this._registerClientValidation();
this._registerPostBackHandlers();
if(!this._isEditModeEnabled(Telerik.Web.UI.EditModes.Design)){
if(this._isEditModeEnabled(Telerik.Web.UI.EditModes.Html)){
this.set_mode(Telerik.Web.UI.EditModes.Html);
}else{
this.set_mode(Telerik.Web.UI.EditModes.Preview);
}
}
var _73c=this;
window.setTimeout(function(){
if(_73c.isIE){
if($telerik.isOpera){
return;
}
var area=_73c.get_contentArea();
if(!area){
return;
}
try{
var r=area.createTextRange();
var _73f=document.body.createTextRange();
_73f.moveStart("textedit",_73f.text.length);
_73f.collapse(true);
_73f.select();
}
catch(e){
}
}
},0);
this._fixIEVisibilityProblems(true);
this._fixMozillaDOMProblems(true);
if(this._modulesManager){
if(!this.isIE){
var _740=$get(this.get_id()+"Module");
_740.style.display="none";
var _741=this;
window.setTimeout(function(){
_741._modulesManager.initialize();
_740.style.display="";
},0);
}else{
this._modulesManager.initialize();
this._updateEditorSize(this._originalHeight);
}
}
if(this.get_autoResizeHeight()&&!this._getInvisibleParent()){
this._makeAutoResizeHeight();
}
this._initialContent=_73c.get_html(true);
this.raiseEvent("load",Sys.EventArgs.Empty);
},dispose:function(){
if(typeof (Sys.WebForms)!="undefined"&&typeof (Sys.WebForms.PageRequestManager)!="undefined"&&this._saveContentDelegate){
var prm=Sys.WebForms.PageRequestManager.getInstance();
if(prm){
prm.remove_initializeRequest(this._saveContentDelegate);
}
prm=null;
}
if(this._contentHiddenTextarea&&this._contentHiddenTextarea.form&&this._saveContentDelegate){
$telerik.removeExternalHandler(this._contentHiddenTextarea.form,"submit",this._saveContentDelegate);
}
if(this._contentAreaElement){
$clearHandlers(this._contentAreaElement);
}
this._detachEvents();
this._fixMozillaDOMProblems(false);
this._fixIEVisibilityProblems(false);
this._makeResizeable(false);
this._onToolClickDelegate=null;
this._onWindowResizeDelegate=null;
this._dialogOpener=null;
this._saveContentDelegate=null;
this._registerModeChangeHandler(false);
Telerik.Web.UI.RadEditor.callBaseMethod(this,"dispose");
},_makeAutoResizeHeight:function(){
if(this._initialContentHeight&&this._initialContentHeight>0){
return;
}
window.setTimeout(Function.createDelegate(this,function(){
this.get_contentArea().style.overflow="hidden";
this._initialContentHeight=this._contentAreaElement.offsetHeight;
var _743=this;
this.attachEventHandler("keydown",function(e){
if(!_743._isKeyUpButton(e)){
_743._resizeContentArea(e);
}
});
this.attachEventHandler("keyup",function(e){
if(_743._isKeyUpButton(e)||(e.keyCode==13&&!_743.isIE)){
_743._resizeContentArea(e);
}
});
this.add_selectionChange(Function.createDelegate(this,this._resizeContentArea));
this._resizeContentArea();
}),0);
},_isKeyUpButton:function(e){
var _747=e.keyCode;
if(_747==8||_747==46){
return true;
}
return false;
},_getCurrentFontSize:function(){
var o=this.getSelectedElement();
var _749=parseInt($telerik.getCurrentStyle(o,"fontSize"));
return _749;
},_resizeContentArea:function(e){
var body=this.isIE?this._document.body:this._document.documentElement;
var _74c=this._contentAreaElement;
var _74d=_74c.parentNode;
var _74e=this._initialContentHeight;
var _74f=_74c.offsetHeight;
var _750=body.scrollHeight+(e&&e.keyCode==13&&this.isIE?this._getCurrentFontSize():0);
if(_750==_74f){
return;
}
if((_74e==_74f)&&(_750<=_74e)){
return;
}
var _751=(_750>_74e)?_750:_74e;
_74c.style.height=_751+"px";
if(_750>_74f){
_74d.style.height=parseInt(_750)+"px";
}else{
var _752=this.get_element();
var _753=_752.offsetHeight-(_74d.offsetHeight-_74c.offsetHeight);
if(_74c.style.height!="100%"){
_74d.style.height="";
this._updateEditorSize(_753);
}
return;
}
this._updateEditorSize(null,true);
},_makeResizeable:function(_754){
if(this._resizeExtender){
this._resizeExtender.dispose();
this._resizeExtender=null;
}
if(!_754){
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 _755={se:this._bottomResizer};
this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._rootElement,_755,this._tableElement);
},_getInvisibleParent:function(){
return Telerik.Web.UI.Editor.Utils.getInvisibleParent(this.get_element());
},_fixIEVisibilityProblems:function(_756){
if(!this.isIE){
return;
}
if(_756){
var _757=this._getInvisibleParent();
if(_757){
this._onIEParentVisibilityChangeDelegate=Function.createDelegate(this,this._onIEParentVisibilityChange);
this._invisibleParent=_757;
$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(_758){
if(this.isIE){
return;
}
if(_758){
var _759=this._getInvisibleParent();
if(_759){
this._invisibleParent=_759;
this._onMozillaParentVisibilityChangeDelegate=Function.createDelegate(this,this._onMozillaParentVisibilityChange);
_759.addEventListener("DOMAttrModified",this._onMozillaParentVisibilityChangeDelegate,false);
}
this._onMozillaParentNodeChangedDelegate=Function.createDelegate(this,this._onMozillaParentNodeChanged);
document.addEventListener("DOMNodeInserted",this._onMozillaParentNodeChangedDelegate,false);
}else{
if(this._invisibleParent&&this._onMozillaParentVisibilityChangeDelegate){
this._invisibleParent.removeEventListener("DOMAttrModified",this._onMozillaParentVisibilityChangeDelegate,false);
this._onMozillaParentVisibilityChangeDelegate=null;
this._invisibleParent=null;
}
if(this._onMozillaParentNodeChangedDelegate){
document.removeEventListener("DOMNodeInserted",this._onMozillaParentNodeChangedDelegate,false);
this._onMozillaParentNodeChangedDelegate=null;
}
}
},_onIEParentVisibilityChange:function(e){
var e=e.rawEvent;
if(!e){
return;
}
if(e.propertyName=="style.display"){
if(this._invisibleParent.style.display!="none"){
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this._updateEditorSize();
this._fixIEVisibilityProblems(false);
}
}
},_onMozillaParentVisibilityChange:function(e){
if(e.attrName=="style"){
var _75c=e.target;
if(_75c.style.display!="none"){
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this.set_editable(true);
}
}
},_onMozillaParentNodeChanged:function(e){
if(!e.target||!this.get_element()){
return;
}
var _75e=$telerik.isDescendantOrSelf(e.target,this.get_element());
if(_75e){
this.onParentNodeChanged();
}
},onParentNodeChanged:function(){
if(!$telerik.isIE){
var _75f=this.get_html(true);
var _760=this.get_contentAreaElement();
this._contentWindow=_760.contentWindow;
this._setContentAreaHtml(_75f,true);
this.set_editable(true);
}
},onResizeStart:function(){
this._resizeSelection=this.getSelection().getRange();
},onResizeEnd:function(){
if(!this.isIE){
return;
}
this.setActive();
if(this._resizeSelection){
this.getSelection().selectRange(this._resizeSelection);
this._resizeSelection=null;
}
},_initializeLocalization:function(){
this._localization=Telerik.Web.UI.Localization.merge("RadEditor",this.get_language(),this._localization);
},getSelectedElement:function(){
return this.getSelection().getParentElement();
},getSelection:function(){
return new Telerik.Web.UI.Editor.Selection(this.get_contentWindow());
},getSelectionHtml:function(){
return this.getSelection().getHtml();
},selectElement:function(_761,_762){
if(Telerik.Web.UI.Editor.Utils.selectElement(this.get_contentWindow(),_761)&&false!=_762){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},undo:function(_763){
this._commandsManager.undo(_763);
},redo:function(_764){
this._commandsManager.redo(_764);
},executeCommand:function(_765,_766,_767){
if(!_765.get_window()){
_765.set_window(this.get_contentWindow());
}
if(false!=_766&&!this.isOpera){
this.setFocus();
}
this._commandsManager.execute(_765,_767);
},executeBrowserCommand:function(_768,_769,_76a,_76b){
var _76c=this._localization[_768];
this.executeCommand(new Telerik.Web.UI.Editor.BrowserCommand(_76c,this._contentWindow,_768,_76a));
this.setActive();
this.setFocus();
if(true==_76b){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},createElement:function(_76d,_76e,_76f,sId,_771,_772){
var _773=this._document.createElement(_76d);
if(_76e){
_773.style.width=_76e;
}
if(_76f){
_773.style.height=_76f;
}
if(null!=sId){
_773.id=sId;
}
if(null!=_771){
_773.name=_771;
}
if(null!=_772){
_773.value=_772;
}
return _773;
},createRestorePoint:function(){
return new Telerik.Web.UI.Editor.RestorePoint(this._contentWindow);
},getToolState:function(_774){
if(_774=="Undo"){
return this.get_commandsManager().isUndoAvailable()?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
}else{
if(_774=="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[_774];
if(oCmd&&oCmd.getState){
return oCmd.getState(this._contentWindow);
}
}
}
},getToolValue:function(_776){
var oCmd=Telerik.Web.UI.Editor.UpdateCommandsArray[_776];
if(oCmd&&oCmd.getValue){
return oCmd.getValue(this._contentWindow);
}else{
if(_776=="RealFontSize"){
var o=this.getSelectedElement();
if(o){
var _779=null;
try{
_779=$telerik.getCurrentStyle(o,"fontSize","");
}
catch(exc){
}
if(_779){
var _77a=parseFloat(_779);
if(_77a>parseInt(_779)){
if(_779.indexOf("px")>-1){
_779=parseInt(_779)+"px";
}
}
}
return _779;
}
}
}
},_addFilters:function(){
var _77b=this.get_filtersManager();
var _77c=this.get_contentFilters();
_77b.clear();
var _77d=_77c&Telerik.Web.UI.EditorFilters.ConvertToXhtml;
_77b.set_enableXhtmlFilter(_77d);
if(_77c&Telerik.Web.UI.EditorFilters.RemoveScripts){
_77b.add(new Telerik.Web.UI.Editor.StripScriptsFilter());
}
_77b.add(new Telerik.Web.UI.Editor.EncodeScriptsFilter());
if(_77c&Telerik.Web.UI.EditorFilters.FixUlBoldItalic){
_77b.add(new Telerik.Web.UI.Editor.FixUlBoldItalic());
}
_77b.add(new Telerik.Web.UI.Editor.FixNestedLists());
if(_77c&Telerik.Web.UI.EditorFilters.ConvertFontToSpan){
_77b.add(new Telerik.Web.UI.Editor.ConvertFontToSpanFilter());
}
if(_77c&Telerik.Web.UI.EditorFilters.FixEnclosingP){
_77b.add(new Telerik.Web.UI.Editor.FixEnclosingP());
}
if($telerik.isIE){
_77b.add(new Telerik.Web.UI.Editor.IEKeepObjectParamsFilter());
_77b.add(new Telerik.Web.UI.Editor.IEKeepCommentsFilter());
_77b.add(new Telerik.Web.UI.Editor.IEFixEmptyParagraphs());
if(_77c&Telerik.Web.UI.EditorFilters.IECleanAnchors){
_77b.add(new Telerik.Web.UI.Editor.IECleanAnchorsFilter());
}
}
if(!$telerik.isIE&&!$telerik.isOpera){
if(!$telerik.isSafari){
_77b.add(new Telerik.Web.UI.Editor.MozillaKeepFlashString(this.get_mozillaFlashOverlayImage()));
_77b.add(new Telerik.Web.UI.Editor.MozillaKeepFlash());
}
_77b.add(new Telerik.Web.UI.Editor.MozillaKeepStylesString());
_77b.add(new Telerik.Web.UI.Editor.MozillaKeepStylesDom());
if(_77c&Telerik.Web.UI.EditorFilters.MozEmStrong){
_77b.add(new Telerik.Web.UI.Editor.MozEmStrongFilter());
}
}
_77b.add(new Telerik.Web.UI.Editor.StripJunkFilter());
if(_77c&Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute){
_77b.add(new Telerik.Web.UI.Editor.MakeUrlsAbsolute());
}
_77b.add(new Telerik.Web.UI.Editor.RemoveExtraBrakes());
if(_77c&Telerik.Web.UI.EditorFilters.IndentHTMLContent){
_77b.add(new Telerik.Web.UI.Editor.IndentHTMLContentFilter());
}
},addShortCut:function(_77e,_77f){
if(this._shortCutManager){
this._shortCutManager.addShortCut(_77e,_77f);
}
},removeShortCut:function(_780){
if(this._shortCutManager){
this._shortCutManager.removeShortCut(_780);
}
},setShortCut:function(_781,_782){
if(this._shortCutManager){
this._shortCutManager.setShortCut(_781,_782);
}
},_addDefaultShortCuts:function(){
var _783=[["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<_783.length;i++){
this.addShortCut(_783[i][0],_783[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(_785,_786){
if(_785.startsWith("on")){
_785=_785.replace("on","");
}
$telerik.addExternalHandler(this._document,_785,_786);
var _787=this._contentAreaEventHandlers;
if(!_787[_785]){
_787[_785]=[];
}
var _788=_787[_785];
_788[_788.length]=_786;
},detachEventHandler:function(_789,_78a){
if(_789.startsWith("on")){
_789=_789.replace("on","");
}
$telerik.removeExternalHandler(this._document,_789,_78a);
},_detachEvents:function(){
var _78b=this._contentAreaEventHandlers;
for(var _78c in _78b){
var _78d=_78b[_78c];
if(_78d.length!=null){
for(var i=0;i<_78d.length;i++){
var _78f=_78d[i];
if(typeof (_78f)=="function"){
try{
this.detachEventHandler(_78c,_78f);
}
catch(e){
}
}
}
_78d=[];
}
}
this._contentAreaEventHandlers={};
this._attachIEBodyHandlers(false);
},get_TopZone:function(){
return $get(this.get_id()+"Top");
},_createTools:function(){
if(!this._toolAdapter){
var _790=this.get_TopZone().firstChild;
var _791=eval(this._toolAdapterType);
this._toolAdapter=$create(_791,{"editor":this,"toolJSON":this.get_toolJSON()},{"toolClick":this._onToolClickDelegate},null,_790);
if(this.isIE){
if(this.get_toolbarMode()==Telerik.Web.UI.EditorToolbarMode.Default){
_790.style.overflow="";
}
this._updateEditorSize();
}
}
},_onToolClick:function(tool,args){
this.fire(tool.get_name(),args);
},getContextMenuByTagName:function(_794){
if(this._toolAdapter&&this._toolAdapter.getContextMenuByTagName){
return this._toolAdapter.getContextMenuByTagName(_794);
}
},getToolByName:function(_795){
if(this._toolAdapter){
return this._toolAdapter.getToolByName(_795);
}
return null;
},getLocalizedString:function(name,_797){
var str=this.get_localization()[name];
if(null==str){
str=this.get_localization()[name.toLowerCase()];
}
if(null==str){
str=_797;
}
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 _79a=this.get_contentArea();
if(_79a&&_79a.setActive){
_79a.setActive();
}
},set_visible:function(_79b){
var _79c=this.get_element();
if(_79c){
_79c.style.display=_79b?"":"none";
}
this.set_editable(_79b);
},enableEditing:function(_79d,_79e,_79f){
var _7a0=this.get_toolAdapter();
var _7a1=Telerik.Web.UI.EditingOptions;
var _7a2=function(){
};
if(!_79e){
_79e=Telerik.Web.UI.EditingOptions.All;
}
this._editingOptions=_79e;
this._optionalIgnoredTools=_79f;
if(_79e&_7a1.ContextMenus){
if(_7a0){
_7a0.enableContextMenus(_79d);
}
}
if(_79e&_7a1.EditModes){
if(!_79d){
this._originalEditModeRef=this.set_mode;
this.set_mode=_7a2;
}else{
if(this._originalEditModeRef){
this.set_mode=this._originalEditModeRef;
this._originalEditModeRef=null;
}
}
}
if(_79e&_7a1.Tools){
if(_7a0){
if(!_79d){
_7a0.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Disabled);
if(_79f){
var _7a3=[];
for(var item in _79f){
var tool=_7a0.getToolByName(item);
if(tool){
_7a3[_7a3.length]=tool;
}
}
_7a0.setToolState(_7a3);
}
this._originalSetToolStateRef=_7a0.setToolState;
_7a0.setToolState=_7a2;
}else{
_7a0.setToolState=this._originalSetToolStateRef;
this._originalSetToolStateRef=null;
}
}
}
if(_79e&_7a1.Modules){
var _7a6=this._modulesManager;
if(_7a6){
_7a6.setModulesVisible(_79d);
}
}
if(_79e&_7a1.Typing){
if(!_79d){
this._disableTypingDelegate=$telerik.cancelRawEvent;
this.attachEventHandler("keypress",this._disableTypingDelegate);
}else{
if(this._disableTypingDelegate){
this.detachEventHandler("keypress",this._disableTypingDelegate);
this._disableTypingDelegate=null;
}
}
}
if(_79e&_79e.Tab){
if(!_79d){
this.removeShortCut("InsertTab");
}else{
this.setShortCut("InsertTab","TAB");
}
}
if(_79d){
if(_7a0){
_7a0.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Off);
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},set_editable:function(_7a7){
if($telerik.isIE||$telerik.isOpera){
var oEd=this;
window.setTimeout(function(){
try{
oEd._document.body.setAttribute("contentEditable",""+_7a7);
oEd._document.execCommand("2D-Position",false,true);
}
catch(ev){
}
},0);
}else{
var oEd=this;
window.setTimeout(function(){
try{
oEd._document["designMode"]=_7a7?"on":"off";
if(_7a7){
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(_7a9){
if(this.isIE){
this.get_document().body.setAttribute("contentEditable",""+_7a9);
}
},showExternalDialog:function(url,_7ab,_7ac,_7ad,_7ae,_7af,_7b0,_7b1,_7b2,_7b3,_7b4){
var _7b5=this.getSelection().getRange();
var _7b6=this;
var _7b7=function(_7b8,args){
window.setTimeout(function(){
_7b6.getSelection().selectRange(_7b5);
if(_7ae){
var _7ba=_7ae(_7b8,args);
if(false==_7ba){
return;
}
_7b6.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7b6.setFocus();
},50);
};
this.get_dialogOpener().openUrl(url,_7ab,_7ac,_7ad,_7b7,_7af,_7b0,_7b1,_7b2,_7b3,_7b4);
},showDialog:function(_7bb,_7bc,_7bd){
this._currentRange=this.getSelection().getRange();
var _7be=this;
var _7bf=function(_7c0,args){
window.setTimeout(function(){
_7be.getSelection().selectRange(_7be._currentRange);
if(_7bd){
var oRes=_7bd(_7c0,args);
if(false==oRes){
return;
}
_7be.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_7be.setFocus();
},50);
};
this.get_dialogOpener().open(_7bb,_7bc,_7bf);
if(this.isIE){
var wnd=this.get_dialogOpener()._getDialogContainer(_7bb);
if(!wnd||wnd._DRAG_ATTACHED){
return;
}
wnd._DRAG_ATTACHED=true;
wnd.add_dragEnd(function(){
_7be.getSelection().selectRange(_7be._currentRange);
});
}
},_getModeButtonsWrapper:function(){
return this._getChildElement("ModesWrapper");
},_registerModeChangeHandler:function(_7c4){
if(_7c4){
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 _7c6=this.get_mode();
var _7c7=Telerik.Web.UI.Editor.Utils.getElementParentByTag(e.target,"LI");
if(_7c7){
var _7c8=Telerik.Web.UI.EditModes;
var _7c9=Sys.UI.DomElement;
var a=_7c7.getElementsByTagName("A")[0];
if(_7c9.containsCssClass(a,"rade_mode_html")){
_7c6=_7c8.Html;
}else{
if(_7c9.containsCssClass(a,"rade_mode_design")){
_7c6=_7c8.Design;
}else{
_7c6=_7c8.Preview;
}
}
}
if(_7c6!=this.get_mode()){
this.set_mode(_7c6);
}
return $telerik.cancelRawEvent(e);
},_changeModeUI:function(mode){
var _7cc=Sys.UI.DomElement;
var _7cd=Telerik.Web.UI.EditModes;
var _7ce="rade_mode_";
switch(mode){
case _7cd.Html:
_7ce+="html";
break;
case _7cd.Design:
_7ce+="design";
break;
case _7cd.Preview:
_7ce+="preview";
break;
}
var _7cf=this._getModeButtonsWrapper();
var as=_7cf.getElementsByTagName("A");
for(var i=0;i<as.length;i++){
var a=as[i];
_7cc.removeCssClass(a,"rade_mode_selected");
if(_7cc.containsCssClass(a,_7ce)){
_7cc.addCssClass(a,"rade_mode_selected");
}
}
},_isEditModeEnabled:function(_7d3){
return _7d3&this._editModes?true:false;
},get_mode:function(){
return this._mode;
},set_mode:function(_7d4){
this._setEditableDelegate=Function.createDelegate(this,function(){
this.remove_editReady(this._setEditableDelegate);
var _7d5=(this._mode==_7d6.Design);
this.set_editable(_7d5);
this.toggleEnhancedEdit(_7d5);
this._setEditableDelegate=null;
});
this.add_editReady(this._setEditableDelegate);
var _7d7=this._mode;
var _7d6=Telerik.Web.UI.EditModes;
if(_7d7==_7d6.Html||_7d4==_7d6.Html){
var html=this.get_html(true);
this._mode=_7d4;
this._showTextArea(this._mode==_7d6.Html);
this.set_html(html);
}else{
this._mode=_7d4;
this._showTextArea(this._mode==_7d6.Html);
}
this._changeModeUI(_7d4);
if(this._mode!=_7d6.Preview){
this.setFocus();
if(this.isFirefox&&!this._document.body){
}else{
this.set_editable(true);
}
if(this._mode==_7d6.Design){
this.toggleEnhancedEdit(true);
}
}else{
this.set_editable(false);
this.toggleEnhancedEdit(false);
}
this.setFocus();
var _7d9=this.get_id();
var _7da=$get(_7d9+"Wrapper");
var _7db=_7da.offsetHeight+"px";
this.raiseEvent("modeChange",Sys.EventArgs.Empty);
this._updateEditorSize(_7db);
},_getTextIframe:function(){
if(!this._textIframe){
var _7dc=this.get_contentAreaElement();
if(_7dc){
this._textIframe=_7dc.cloneNode(true);
this._textIframe.style.position="absolute";
var _7dd=this._textIframe.style;
_7dd.height="2px";
_7dd.width="2px";
_7dc.parentNode.appendChild(this._textIframe);
var doc=this._textIframe.contentWindow.document;
doc.designMode="off";
var _7df=doc.open("text/html","replace");
var _7e0="<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 (_7df)=="undefined"){
_7df=doc;
}
_7df.write(_7e0);
_7df.close();
}
}
return this._textIframe;
},_getTextArea:function(){
var area=this._getTextIframe();
return area.contentWindow.document.body.firstChild;
},get_textArea:function(){
return this._getTextArea();
},_showTextArea:function(_7e2){
var area=this._getTextIframe();
var _7e4=this.get_contentAreaElement();
if(_7e2){
if($telerik.isSafari){
_7e4.style.width="0px";
_7e4.style.height="0px";
}else{
_7e4.style.display="none";
}
area.style.display="";
area.style.position="";
area.style.height="100%";
area.style.width="100%";
}else{
if($telerik.isSafari){
_7e4.style.width="100%";
_7e4.style.height="100%";
}else{
_7e4.style.display="";
}
area.style.display="none";
}
},_setContentAsText:function(_7e5){
var area=this._getTextArea();
area.value=_7e5;
},_getContentAsText:function(){
var area=this._getTextArea();
var _7e8=area.value;
return _7e8;
},set_html:function(_7e9,_7ea,_7eb){
var _7ec=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_7ec.Html){
var cmd=new Telerik.Web.UI.Editor.GenericCommand(_7ea?_7ea:"Set HTML",this.get_contentWindow());
this._setContentAreaHtml(_7e9);
this.executeCommand(cmd,_7eb);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}else{
this._setContentAsText(_7e9);
}
},get_html:function(_7ee){
var _7ef=null;
var _7f0="";
var mode=this.get_mode();
var _7f2=Telerik.Web.UI.EditModes;
if(mode==_7f2.Html){
return this._getContentAsText();
}else{
if(this.get_fullPage()){
if(this._document){
_7ef=this._document.getElementsByTagName("HTML")[0];
_7ef=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(_7ef);
var _7f3=this._getAllSheets(_7ef);
for(var i=0;i<_7f3.length;i++){
var _7f5=_7f3[i];
var _7f6=_7f5.getAttribute("id");
if(_7f6&&_7f6.indexOf("RADEDITORSTYLESHEET")==0){
_7f5.parentNode.removeChild(_7f5);
}
}
if($telerik.isIE||$telerik.isOpera){
_7ef.getElementsByTagName("BODY")[0].removeAttribute("contentEditable");
}
}
}else{
if(this.get_contentArea()){
if(true==_7ee){
_7ef=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(this.get_contentArea());
if($telerik.isIE||$telerik.isOpera){
_7ef.removeAttribute("contentEditable");
}
}else{
_7ef=this.get_contentArea();
}
}
}
}
if(_7ef){
if(true==_7ee){
_7f0=this.get_filtersManager().getHtmlContent(_7ef);
}else{
_7f0=_7ef.innerHTML;
}
}
if(_7f0.indexOf("<body")==0){
_7f0=_7f0.trim();
_7f0=_7f0.substring(_7f0.indexOf(">")+1,_7f0.length-7);
_7f0=_7f0.trim();
}
if(this.get_fullPage()&&this._doctypeString){
_7f0=this._doctypeString+"\n"+_7f0;
}
return _7f0;
},set_initialContent:function(){
this._initialContent=this.get_html(true);
},get_initialContent:function(){
return this._initialContent;
},get_text:function(){
var _7f7=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_7f7.Html){
var _7f8="";
var _7f9=this.get_contentArea();
if(_7f9){
if(_7f9.innerText){
_7f8=_7f9.innerText;
}else{
if(_7f9.textContent!=null){
_7f8=_7f9.textContent;
}else{
_7f8=_7f9.innerHTML.replace(/<\/?[^>]*>/ig,"");
}
}
}
return _7f8;
}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 _7fc=oDoc.getElementsByTagName("link");
var _7fd=oDoc.getElementsByTagName("style");
var _7fe=[];
for(var x=0;_7fc[x];x++){
var rel=_7fc[x].rel?_7fc[x].rel:_7fc[x].getAttribute("rel");
if(typeof (rel)=="string"&&rel.toLowerCase().indexOf("style")+1){
Array.add(_7fe,_7fc[x]);
}
}
for(var x=0;_7fd[x];x++){
Array.add(_7fe,_7fd[x]);
}
return _7fe;
},_getClassName:function(rule){
var str=rule&&rule.selectorText?rule.selectorText:"";
var _803=str.lastIndexOf(".");
if(_803==-1){
return "";
}
var _804=str.indexOf(" ",_803);
if(-1==_804){
_804=str.indexOf(":",_803);
}
if(-1==_804){
_804=str.length;
}
return str.substring((_803+1),_804);
},_createCssFilterObject:function(){
if(this._cssClassesHash){
return;
}
var _805=this.get_cssClasses();
if(_805&&_805.length>0){
var obj={};
var _807=_805.length;
for(var i=0;i<_807;i++){
var oKey=_805[i][0];
var oVal=_805[i][1];
obj[oKey.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})]=oVal;
}
this._cssClassesHash=obj;
}
},_getFilteredCssClasses:function(_80c){
this._createCssFilterObject();
if(_80c&&this._cssClassesHash){
var _80d=[];
var _80e=_80c.length;
for(var _80f=0;_80f<_80e;_80f++){
var _810=_80c[_80f];
if(outAlias=this._checkCssFilter(_810[1].selectorText)){
_810[2]=outAlias;
_80d[_80d.length]=_810;
}
}
return _80d;
}else{
return _80c;
}
},_checkCssFilter:function(_811){
if(!_811||!this._cssClassesHash){
return null;
}
return this._cssClassesHash[_811.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})];
},getCssArray:function(_813){
var _814=this.get_document();
var _815=[];
for(var i=0;i<_814.styleSheets.length;i++){
var _817=_814.styleSheets[i];
this._getStyleSheetRules(_815,_817,_813);
}
_815=this._getFilteredCssClasses(_815);
return _815;
},_getStyleSheetRules:function(_818,_819,_81a){
var _81b=_819.href;
if(_81b&&_81b.indexOf("WebResource.axd?")>-1){
return;
}
var _81c=(_819.rules)?_819.rules:_819.cssRules;
if($telerik.isIE&&_819.imports){
for(var k=0;k<_819.imports.length;k++){
this._getStyleSheetRules(_818,_819.imports[k],_81a);
}
}
for(var j=0;j<_81c.length;j++){
var _81f=_81c[j];
if(_81f&&_81f.cssText){
var text=_81f.cssText.toLowerCase();
if(text.indexOf("@import")>=0&&_81f.parentStyleSheet&&_81f.styleSheet&&_81f.parentStyleSheet!=_81f.styleSheet){
this._getStyleSheetRules(_818,_81f.styleSheet,_81a);
continue;
}
}
var str=_81f&&_81f.selectorText?_81f.selectorText:"";
var _822=str.lastIndexOf(".");
if(_822<0){
continue;
}
var _822=str.lastIndexOf(":");
if(_822>0){
continue;
}
var _823=this._getClassName(_81f);
_818[_818.length]=[_823,_81f];
}
},copyStyleSheets:function(_824,_825){
if(null==_824&&null==_825){
return;
}
var _826=0;
var _827=null;
if(_825.styleSheets.length==0){
if(_825.createStyleSheet){
_825.createStyleSheet();
}else{
css=_825.createElement("style");
css.media="all";
css.type="text/css";
var _828=_825.getElementsByTagName("head")[0];
_828.appendChild(css);
_827=css;
}
}
if(_825.styleSheets[0]){
_827=_825.styleSheets[0];
}
for(var i=0;i<_824.styleSheets.length;i++){
try{
var _82a=_824.styleSheets[i];
var _82b=_82a.href;
var _82c=false;
if($telerik.isFirefox){
if(_82a.ownerNode&&_82a.ownerNode.tagName.toLowerCase()=="style"){
_82c=true;
}
}
if(_82b&&!_82c){
continue;
}
var _82d=(_82a.rules)?_82a.rules:_82a.cssRules;
for(var j=0;j<_82d.length;j++){
var _82f=_82d[j];
if(_827.addRule){
var _830=_82f.selectorText;
var oCss=_82f.style.cssText;
if(oCss&&_830){
_827.addRule(_830,oCss,_826);
}
}else{
if(_827.insertRule){
_827.insertRule(_82f.cssText,_826);
}else{
var oCss=_82f.selectorText+"{"+_82f.style.cssText+"}";
var _832=_825.createTextNode(oCss);
_827.appendChild(_832);
}
}
_826++;
}
}
catch(exc){
}
}
},_setContentAreaHtml:function(_833,_834){
var _835=this.get_filtersManager().getDesignContent(_833);
this.set_contentHiddenTextareaValue(_835);
var _836=null;
if(-1!=_835.toLowerCase().indexOf("<html")){
this.set_fullPage(true);
_836=_835;
var _837=new RegExp("(<!DOCTYPE(.|\\n)*?>)(.|\\n)*?","g");
this._doctypeString=(_836.match(_837))?_836.match(_837)[0]:"";
}else{
this.set_fullPage(false);
}
if(null!=_836||true==_834){
var _838=this;
var _839=function(){
_83a=false;
try{
_838._document=_838._contentAreaElement.contentWindow.document;
_838._contentWindow=_838._contentAreaElement.contentWindow;
_838._contentArea=_838._document.body;
_838.get_filtersManager().getDesignContentDom(_838.get_contentArea());
var _83b=1;
Telerik.Web.UI.Editor.Utils.addStyleSheet(_838.get_contentAreaCssFile(),_838._document,_838._getUniqueStyleSheetId(0));
var _83c=_838.get_cssFiles();
if(_83c.length>0){
for(var i=0;i<_83c.length;i++){
var _83e=_838._getUniqueStyleSheetId(_83b++);
Telerik.Web.UI.Editor.Utils.addStyleSheet(_83c[i],_838._document,_83e);
}
}else{
if(!_838._fullPage){
_838.copyStyleSheets(document,_838._document);
var _83f=_838._getAllSheets(document);
for(var i=0;i<_83f.length;i++){
var _83e=_838._getUniqueStyleSheetId(_83b++);
var _840=_83f[i];
if(_840.tagName=="LINK"){
var _841=_840.href;
if(_841&&_841.indexOf("WebResource.axd?")>-1){
continue;
}
if(_841){
Telerik.Web.UI.Editor.Utils.addStyleSheet(_840.getAttribute("href"),_838._document,_83e);
}
}else{
if(_840.tagName=="STYLE"){
}
}
}
}
}
var _842=Telerik.Web.UI.Editor.PopupController;
if(_842){
_842.detachFromDocument(_838._document);
_842.attachToDocument(_838._document);
}
_838._initEvents();
if(_838.get_mode()!=Telerik.Web.UI.EditModes.Preview){
_838.set_editable(true);
}else{
_838.set_editable(false);
}
_838.toggleEnhancedEdit(true);
if(_838._document&&_838._document.body){
_838.raiseEvent("editReady",Sys.EventArgs.Empty);
}
}
catch(e){
}
};
if($telerik.isFirefox){
$addHandler(this._contentAreaElement,"load",function(){
if(_83a){
_839();
}
});
}
if(!_836){
_836="<head><style></style></head><body>"+_835+"</body>";
}
try{
var _843=this._contentAreaElement.contentWindow.document;
if(_843&&_843.body){
var _844=Telerik.Web.UI.Editor.PopupController;
if(_844){
_844.detachFromDocument(_843);
}
}
_843.open();
_843.write(_836);
_843.close();
var _83a=false;
if(_843.body){
_839();
}else{
_83a=true;
}
}
catch(e){
}
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this._contentArea,_835);
this.get_filtersManager().getDesignContentDom(this.get_contentArea());
}
},_createUI:function(){
if(this._created){
return;
}
this._registerModeChangeHandler(true);
var id=this.get_id();
this._rootElement=$get(id);
this._tableElement=$get(id+"Wrapper");
var _846=$get(id+"Center");
var _847=this.get_contentAreaElement();
_847.style.display="none";
_846.appendChild(_847);
_847.style.height="100%";
_847.style.display="";
this._created=true;
},_updateEditorSize:function(_848,_849){
var _84a=this._tableElement;
var _84b=_848?_848:_84a.style.height;
if(true==_849){
_84b=_84a.offsetHeight+"px";
}
if(parseInt(_84b)==0){
return;
}
_84a.style.height=_84b;
if(this.isIE){
this._fixIeHeight(_84a,_84b);
}else{
var _84c=this;
window.setTimeout(function(){
_84c._fixIeHeight(_84a,_84b);
},0);
}
_84a.parentNode.style.height=_84b;
},_fixIeHeight:function(_84d,_84e){
if("CSS1Compat"==document.compatMode){
var _84f=(_84d.offsetHeight-parseInt(_84e));
if(_84f>0){
var _850=(parseInt(_84d.style.height)-_84f);
if(_850>0){
_84d.style.height=_850+"px";
}
}
}
},setSize:function(_851,_852){
var _851=parseInt(_851);
var _852=parseInt(_852);
var _853=this;
var _854=$get(_853.get_id()+"Wrapper");
_854.style.height="";
var _855=_854.parentNode;
_855.style.width=_851+"px";
_855.style.height=_852+"px";
_853._fixIeHeight(_855,_852);
if(_853.isIE){
_854.style.height=_852+"px";
_853._fixIeHeight(_854,_852);
}else{
_854.style.height="100%";
}
},pasteHtml:function(_856,_857,_858,_859,_85a){
if(!this.get_editable()){
return;
}
var args=new Telerik.Web.UI.EditorCommandEventArgs(_857,null,_856);
if(false==this._executeCommandEvent("pasteHtml",_857,args)){
return;
}
if(_856!=args.get_value()){
_856=args.get_value();
}
var _85c=this.get_localization()[_857];
if(_85c){
_857=_85c;
}
var mode=this.get_mode();
if(Telerik.Web.UI.EditModes.Design==mode){
this.setFocus();
this.executeCommand(new Telerik.Web.UI.Editor.PasteHtmlCommand(_857,this._contentWindow,_856,_858),null,_85a);
if(_859!=false){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
}else{
if(Telerik.Web.UI.EditModes.Html==mode){
var _85e=this._getTextArea();
if(this.isIE){
_85e.setActive();
var _85f=document.selection.createRange();
_85f.text=_856;
}else{
if(_85e.setSelectionRange){
var _860=_85e.selectionStart;
var _861=_85e.selectionEnd;
var _862=_85e.value.substring(_860,_861);
var _863=_856;
_85e.value=_85e.value.substring(0,_860)+_863+_85e.value.substring(_861);
_85e.setSelectionRange(_860+_863.length,_860+_863.length);
this.setFocus();
}
}
}
}
},fire:function(_864,args){
if(false==this._executeCommandEvent("commandExecuting",_864,args)){
return;
}
if(this._optionalIgnoredTools&&!this._optionalIgnoredTools[_864]){
return;
}
this.setActive();
this._pendingTextTypeCmd=null;
var _866=Telerik.Web.UI.Editor.CommandList[_864];
var _867=false;
if(_866){
_867=(false!=_866(_864,this,args));
}else{
alert("The command "+_864+" is not implemented yet.");
}
if(_867){
if(!$telerik.isOpera){
this.setFocus();
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
this._executeCommandEvent("commandExecuted",_864,args);
},_executeCommandEvent:function(_868,_869,args){
if(!args){
args=new Telerik.Web.UI.EditorCommandEventArgs(_869);
}
this.raiseEvent(_868,args);
if(args.get_cancel&&args.get_cancel()){
return false;
}
return true;
},_onWindowResize:function(){
var _86b=this._getViewportBounds();
this.setSize(_86b.width,_86b.height,false);
},_registerWindowResizeHandler:function(_86c){
if(_86c){
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 _86d=$telerik.getClientBounds();
var _86e=document.documentElement.scrollLeft||document.body.scrollLeft;
var _86f=document.documentElement.scrollTop||document.body.scrollTop;
_86d.scrollLeft=_86e;
_86d.scrollTop=_86f;
return _86d;
},_handleParentsWithOverflow:function(_870){
if(false==_870){
if(!this._parentsWithOverflow){
return;
}
var _871=this._parentsWithOverflow;
var _872=_871.length;
for(var i=0;i<_872;i++){
var _874=_871[i];
if(_874[0]){
var node=_874[0];
node.style.overflow=_874[1];
node.style.height=_874[2];
}
}
this._parentsWithOverflow=null;
}else{
this._parentsWithOverflow=[];
var _871=this._parentsWithOverflow;
var _876=this._getRootNode().parentNode;
while(_876&&_876.tagName!="BODY"){
var _877=$telerik.getCurrentStyle(_876,"overflow");
if(_877){
_871[_871.length]=[_876,_876.style.overflow,_876.style.height];
_876.style.overflow="visible";
_876.style.height="auto";
}
_876=_876.parentNode;
}
}
},_getRootNode:function(){
return $get(this.get_id()+"Wrapper").parentNode;
},isFullScreen:function(){
return this._isFullScreen;
},toggleScreenMode:function(){
var _878=this;
if(!_878._isFullScreen){
document.body.scroll="no";
document.body.style.margin="0px";
if(document.documentElement){
document.documentElement.style.overflow="hidden";
}
var _879=_878._getRootNode();
_878._preFullScreenBounds=$telerik.getBounds(_879);
_878._handleParentsWithOverflow(true);
_878._onWindowResize();
_878._preFullScreenBrowserRect=_878._getViewportBounds();
var _87a=$telerik.getLocation(_879);
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_87a.x,_87a.y);
_878._isFullScreen=true;
_878._registerWindowResizeHandler(true);
}else{
_878._registerWindowResizeHandler(false);
document.body.scroll="";
document.documentElement.style.overflow="";
try{
document.body.style.margin="";
}
catch(e){
}
_878._isFullScreen=false;
_878._handleParentsWithOverflow(false);
var _87b=_878._preFullScreenBounds;
_878.setSize(_87b.width,_87b.height,false);
var _87a=_878._preFullScreenBrowserRect;
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_87a.scrollLeft,_87a.scrollTop);
}
_878.set_editable(true);
_878.setFocus();
var _87c=_878.getToolByName("ToggleScreenMode");
if(_87c){
_87c.setOn(_878._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(_87d){
if($telerik.isSafari&&this._contentHiddenTextarea.innerText!=null){
this._contentHiddenTextarea.innerText=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_87d);
}else{
this._contentHiddenTextarea.value=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_87d);
}
},get_localization:function(){
return this._localization;
},get_contentAreaElement:function(){
if(!this._contentAreaElement){
var elem=document.createElement("iframe");
elem.frameBorder="0";
elem.src="javascript:'<html></html>';";
elem.style.width="100%";
elem.style.margin="0px";
elem.style.padding="0px";
this._contentAreaElement=elem;
}
return this._contentAreaElement;
},get_contentArea:function(){
return this._contentArea;
},get_contentTextArea:function(){
return this._contentTextArea;
},get_document:function(){
return this._document;
},get_contentWindow:function(){
return this._contentWindow;
},get_toolAdapter:function(){
return this._toolAdapter;
},set_toolAdapter:function(_87f){
this._toolAdapter=_87f;
},get_fullPage:function(){
return this._fullPage;
},set_fullPage:function(_880){
this._fullPage=_880;
},get_dialogOpener:function(){
return this._dialogOpener;
},set_dialogOpener:function(_881){
this._dialogOpener=_881;
},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(_882){
this._links=_882;
},get_language:function(){
if(null==this._language){
return "en-us";
}
return this._language.toLowerCase();
},set_language:function(_883){
this._language=_883;
},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(_884){
this._colors=_884;
},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(_885){
this._fontNames=_885;
},get_fontSizes:function(){
if(null==this._fontSizes){
return [1,2,3,4,5,6,7];
}
return this._fontSizes;
},set_fontSizes:function(_886){
this._fontSizes=_886;
},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(_887){
this._symbols=_887;
},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(_888){
this._realFontSizes=_888;
},get_contextMenus:function(){
if(null==this._contextMenus){
return [];
}
return this._contextMenus;
},set_contextMenus:function(_889){
this._contextMenus=_889;
},get_snippets:function(){
if(null==this._snippets){
return [];
}
return this._snippets;
},set_snippets:function(_88a){
this._snippets=_88a;
},get_cssClasses:function(){
if(null==this._cssClasses){
return [];
}
return this._cssClasses;
},set_cssClasses:function(_88b){
this._cssClasses=_88b;
},get_cssFiles:function(){
if(null==this._cssFiles){
return [];
}
return this._cssFiles;
},set_cssFiles:function(_88c){
this._cssFiles=_88c;
},get_languages:function(){
if(null==this._languages){
return [];
}
return this._languages;
},set_languages:function(_88d){
this._languages=_88d;
},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(_88e){
this._paragraphs=_88e;
},get_autoResizeHeight:function(){
return this._autoResizeHeight;
},set_autoResizeHeight:function(_88f){
this._autoResizeHeight=_88f;
},get_toolbarMode:function(){
return this._toolbarMode;
},set_toolbarMode:function(_890){
this._toolbarMode=_890;
},get_editModes:function(){
return this._editModes;
},set_editModes:function(_891){
this._editModes=_891;
},get_stripFormattingOptions:function(){
return this._stripFormattingOptions;
},set_stripFormattingOptions:function(_892){
this._stripFormattingOptions=_892;
},get_contentFilters:function(){
return this._contentFilters;
},set_contentFilters:function(_893){
this._contentFilters=_893;
},get_newLineBr:function(){
return this._newLineBr;
},set_newLineBr:function(_894){
this._newLineBr=_894;
},get_contentAreaCssFile:function(){
return this._contentAreaCssFile;
},set_contentAreaCssFile:function(_895){
this._contentAreaCssFile=_895;
},get_mozillaFlashOverlayImage:function(){
return this._mozillaFlashOverlayImage;
},set_mozillaFlashOverlayImage:function(_896){
this._mozillaFlashOverlayImage=_896;
},get_toolAdapterType:function(){
return this._toolAdapterType;
},set_toolAdapterType:function(_897){
this._toolAdapterType=_897;
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_898){
this._toolJSON=_898;
},get_modulesJSON:function(){
return this._modulesJSON;
},set_modulesJSON:function(_899){
this._modulesJSON=_899;
},get_contextMenusJSON:function(){
return this._contextMenusJSON;
},set_contextMenusJSON:function(_89a){
this._contextMenusJSON=_89a;
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_89b){
this._uniqueID=_89b;
},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(_89d){
this._skin=_89d;
},_registerClientValidation:function(){
if(typeof (Page_ClientValidate)=="function"){
var _89e=Page_ClientValidate;
Page_ClientValidate=Function.createDelegate(this,function(_89f){
var _8a0=this.get_element();
if(_8a0){
var _8a1=this.get_html(true);
this.set_contentHiddenTextareaValue(_8a1);
_8a0.value=_8a1;
_8a0.setAttribute("value",_8a1);
}
_8a0=null;
return _89e(_89f);
});
}
},_registerPostBackHandlers:function(){
this._saveContentDelegate=Function.createDelegate(this,function(e){
this.raiseEvent("submit",Sys.EventArgs.Empty);
var _8a3=this.get_html(true);
this.set_contentHiddenTextareaValue(_8a3);
});
var _8a4=this._contentHiddenTextarea.form;
$telerik.addExternalHandler(_8a4,"submit",this._saveContentDelegate);
if(typeof (__doPostBack)!="undefined"){
var _8a5=this._saveContentDelegate;
var _8a6=__doPostBack;
__doPostBack=function(_8a7,_8a8){
_8a5();
_8a6(_8a7,_8a8);
};
}
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;
}
_8a4=null;
},toggleEnhancedEdit:function(_8aa){
if(!this.get_document()){
return false;
}
var _8ab=this.get_document().getElementById(this._getUniqueStyleSheetId(0));
if(_8ab){
if(_8aa==null){
_8aa=_8ab.disabled;
}
_8ab.disabled=!_8aa;
var tool=this.getToolByName("ToggleTableBorder");
if(tool){
tool.setOn(_8aa);
}
return _8aa;
}else{
return false;
}
},pasteHyperLink:function(_8ad,_8ae){
if($telerik.isIE){
var sel=this.getSelectedElement();
if(sel.tagName=="IMG"&&sel.parentNode&&sel.parentNode.tagName=="A"){
var _8b0=sel.parentNode;
_8b0.parentNode.removeChild(_8b0);
}
if(sel.tagName=="IMG"){
_8ad.innerHTML=Telerik.Web.UI.Editor.Utils.getOuterHtml(sel);
}
}
if($telerik.isOpera){
var sel=this.getSelectedElement();
if(sel.tagName=="A"){
this.fire("Unlink");
}
}
if("DocumentManager"==_8ae){
var _8b1=this.getSelection().getText();
if(""!=_8b1.trim()){
_8ad.innerHTML=_8b1;
}
}
var _8b2=Telerik.Web.UI.Editor.Utils.getOuterHtml(_8ad);
this.pasteHtml(_8b2,_8ae);
},_saveTypedContent:function(_8b3,_8b4){
if(this._pendingTextTypeCmd){
this._pendingTextTypeCmd.update();
}
if(true!=_8b3){
this._pendingTextTypeCmd=null;
}
},_attachIEBodyHandlers:function(_8b5){
var body=null;
if(this._document&&this._document.body){
body=this._document.body;
}
if(!body){
return;
}
if(_8b5){
this._onResizeStartDelegate=Function.createDelegate(this,this._onResizeStart);
this._onResizeEndDelegate=Function.createDelegate(this,this._onResizeEnd);
this._onDropDelegate=Function.createDelegate(this,this._onDrop);
this._onDragEndDelegate=Function.createDelegate(this,this._onDragEnd);
this._onDragStartDelegate=Function.createDelegate(this,this._onDragStart);
this._onPasteDelegate=Function.createDelegate(this,this._onPaste);
this._onBeforePasteDelegate=Function.createDelegate(this,this._onBeforePaste);
$telerik.addExternalHandler(body,"resizestart",this._onResizeStartDelegate);
$telerik.addExternalHandler(body,"resizeend",this._onResizeEndDelegate);
$telerik.addExternalHandler(body,"drop",this._onDropDelegate);
$telerik.addExternalHandler(body,"dragend",this._onDragEndDelegate);
$telerik.addExternalHandler(body,"dragstart",this._onDragStartDelegate);
if(!this.isIE7){
$telerik.addExternalHandler(body,"paste",this._onPasteDelegate);
}else{
$telerik.addExternalHandler(body,"beforepaste",this._onBeforePasteDelegate);
}
}else{
if(this._onResizeStartDelegate){
$telerik.removeExternalHandler(body,"resizestart",this._onResizeStartDelegate);
}
if(this._onResizeEndDelegate){
$telerik.removeExternalHandler(body,"resizeend",this._onResizeEndDelegate);
}
if(this._onDropDelegate){
$telerik.removeExternalHandler(body,"drop",this._onDropDelegate);
}
if(this._onDragEndDelegate){
$telerik.removeExternalHandler(body,"dragend",this._onDragEndDelegate);
}
if(this._onDragStartDelegate){
$telerik.removeExternalHandler(body,"dragstart",this._onDragStartDelegate);
}
if(!this.isIE7){
if(this._onPasteDelegate){
$telerik.removeExternalHandler(body,"paste",this._onPasteDelegate);
}
}else{
if(this._onBeforePasteDelegate){
$telerik.removeExternalHandler(body,"beforepaste",this._onBeforePasteDelegate);
}
}
this._onResizeStartDelegate=null;
this._onResizeEndDelegate=null;
this._onDropDelegate=null;
this._onDragEndDelegate=null;
this._onDragStartDelegate=null;
this._onPasteDelegate=null;
this._onBeforePasteDelegate=null;
}
},_initEvents:function(){
var _8b7=this;
var _8b8=_8b7.fire;
_8b7.fire=function(_8b9,_8ba){
if(_8b9!="Copy"){
_8b7._saveTypedContent(true,"editor.fire "+_8b9+" executing");
}
_8b8.call(_8b7,_8b9,_8ba);
try{
if(_8b9=="Undo"&&!_8b7.isIE&&_8b7._document.body.toLowerCase().trim()=="<br>"){
_8b7._document.body.innerHTML="<br>";
}
}
catch(e){
}
};
this.attachEventHandler("onclick",function(e){
_8b7._saveTypedContent(false,"Saving typed content because of oclick (somewhere else)");
if(_8b7.getSelectionHtml()){
_8b7._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(_8b7.get_localization()["Typing"],_8b7.get_contentWindow());
_8b7.executeCommand(_8b7._pendingTextTypeCmd,false);
}
});
if(!this.isIE){
this.attachEventHandler("keypress",function(e){
if(_8b7._onKeyPressed(e)){
e.preventDefault();
return false;
}
});
this.attachEventHandler("click",function(e){
if(!_8b7.isFirefox){
return;
}
if(!_8b7.get_editable()){
return;
}
if("on"==_8b7._document["designMode"]){
window.setTimeout(function(){
_8b7.set_editable(true);
_8b7.setFocus();
},100);
}
});
}
this.attachEventHandler("keydown",function(e){
if(_8b7.isOpera){
return _8b7._onKeyDown(e);
}else{
_8b7._onKeyDown(e);
}
});
this.attachEventHandler("onmousedown",function(){
_8b7._saveTypedContent(false,"Saving typed content onmousedown");
});
this.attachEventHandler("keyup",Function.createDelegate(this,this._onKeyUp));
var _8bf=Function.createDelegate(this,function(e){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
});
this.attachEventHandler("mouseup",_8bf);
$telerik.addExternalHandler(document.body,"dragend",Function.createDelegate(this,this._onDocumentDragEnd));
this._attachIEBodyHandlers(true);
},_onKeyDown:function(e){
var _8c2=e.keyCode;
switch(_8c2){
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 _8c3=this;
var _8c4=function(){
var _8c5=_8c3.getSelectedElement();
if(_8c5&&_8c5.tagName=="EMBED"){
_8c5.setAttribute("hidden","true");
_8c5.setAttribute("id","FileToDelete");
window.setTimeout(function(){
var _8c6=_8c3._document.getElementById("FileToDelete");
if(_8c6.parentNode&&_8c6.parentNode.removeChild){
_8c6.parentNode.removeChild(_8c6);
}
},100);
$telerik.cancelRawEvent(e);
return true;
}
};
var _8c7=_8c4();
if(_8c7){
return false;
}
try{
var _8c8=_8c3._document.selection.createRange();
var _8c9=null;
if(_8c8&&_8c8.duplicate){
_8c9=_8c8.duplicate();
}
if(8==e.keyCode){
_8c8.moveStart("character",-1);
}else{
_8c8.moveEnd("character",1);
}
if(_8c8.parentElement().tagName=="EMBED"){
_8c8.select();
_8c4();
if(_8c9&&_8c9.select){
_8c9.select();
}
}
}
catch(ex){
}
var _8ca=new Telerik.Web.UI.Editor.Selection(this._contentWindow);
if(_8ca&&_8ca.isControl()){
var _8cb=_8ca.getRange();
_8cb.execCommand("Delete");
$telerik.cancelRawEvent(e);
}
}
return;
}
var _8cc=e.target?e.target:e.srcElement;
if(_8cc&&"INPUT"!=_8cc.tagName){
var _8cd=this._shortCutManager.isShortCutHit(e);
if(null!=_8cd&&_8cd.get_name()=="Copy"){
this._shortcutHit=false;
return;
}
this._shortcutHit=(null!=_8cd);
if(this._shortcutHit){
this.fire(_8cd.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=_8cd.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(_8d1,_8d2,_8d3,_8d4){
var _8d5=this;
var _8d6=(this.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _8d7=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_8d2,_8d5.get_stripFormattingOptions(),_8d5.get_localization()["askwordcleaning"],_8d6);
if(_8d1){
_8d1.select();
}
if(_8d7){
window.setTimeout(function(){
if(_8d4&&_8d1){
_8d1.select();
}
_8d5.pasteHtml(_8d7);
},5);
return $telerik.cancelRawEvent(_8d3);
}
return true;
},_onPaste:function(_8d8){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _8d9=this.createRestorePoint();
var _8da=this.getSelectionHtml()?true:false;
var _8db=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
return this._insertPastedContent(_8d9,_8db,_8d8,_8da);
},_onBeforePaste:function(_8dc){
if(_8dc){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _8dd=new Telerik.Web.UI.Editor.GenericCommand("Paste",this._contentWindow);
var _8de=this._document.getElementById("tmpPasteIE");
if(_8de){
_8de.removeAttribute("id");
return false;
}
var _8df=this._document.selection.createRange();
var _8e0=Telerik.Web.UI.Editor.Utils.getUniqueID();
if(_8df.pasteHTML){
_8df.pasteHTML("&nbsp;<font id='"+_8e0+"'>&nbsp;</font>");
}
var _8e1=Telerik.Web.UI.Editor.Utils.getPasteContainer();
_8e1.innerHTML="";
_8e1.setActive();
var _8e2=this;
window.setTimeout(function(){
var _8e3=_8e1.innerHTML;
var _8e4=(_8e2.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _8e5=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_8e3,_8e2.get_stripFormattingOptions(),_8e2.get_localization()["askwordcleaning"],_8e4);
var _8e6=_8e2._document.getElementById(_8e0);
_8e2.setActive(true);
_8e2._pendingCutPasteCommand=null;
var _8e7=_8e2._document.body.createTextRange();
_8e7.moveToElementText(_8e6);
_8e7.moveStart("character",-1);
_8e7.select();
_8e7.pasteHTML(_8e5);
_8e2.executeCommand(_8dd);
_8e2.setActive(true);
_8e2.setFocus(true);
},0);
}else{
}
},_onResizeStart:function(e){
var _8e9=this.getSelectedElement();
if(_8e9==e.srcElement){
var _8ea=this.get_localization()["ResizeCommand"]||"Resize";
this._pendingResizeCmd=new Telerik.Web.UI.Editor.GenericCommand(_8ea,this._contentWindow);
}
},_onResizeEnd:function(e){
if(this._pendingResizeCmd){
this.executeCommand(this._pendingResizeCmd);
}
},_onDragStart:function(e){
var _8ed=this.get_localization()["MoveCommand"]||"Move";
this._pendingMoveCommand=new Telerik.Web.UI.Editor.GenericCommand(_8ed,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 _8ef=this._startRange.item(0);
if("IMG"==_8ef.tagName&&"A"==_8ef.parentNode.tagName&&_8ef.parentNode.childNodes.length==1){
_8ef=_8ef.parentNode;
}
rng.moveToElementText(_8ef);
this._startRange=rng;
}
}
},_onDragEnd:function(e){
if(this._pendingMoveCommand){
if(this._startRange){
var _8f1=this._contentWindow.document.selection.createRange();
if(_8f1.length){
var rng=this._contentWindow.document.body.createTextRange();
rng.moveToElementText(_8f1.item(0));
_8f1=rng;
}
try{
if(_8f1.compareEndPoints&&0!=_8f1.compareEndPoints("StartToStart",this._startRange)&&0!=_8f1.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 _8f4=this.get_localization()["Drop"]||"Drop external content";
this._pendingDockCommand=new Telerik.Web.UI.Editor.GenericCommand(_8f4,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(_8f6){
this.get_events().addHandler("toggleScreenMode",_8f6);
},remove_toggleScreenMode:function(_8f7){
this.get_events().removeHandler("toggleScreenMode",_8f7);
},add_modeChange:function(_8f8){
this.get_events().addHandler("modeChange",_8f8);
},remove_modeChange:function(_8f9){
this.get_events().removeHandler("modeChange",_8f9);
},add_load:function(_8fa){
this.get_events().addHandler("load",_8fa);
},remove_load:function(_8fb){
this.get_events().removeHandler("load",_8fb);
},add_init:function(_8fc){
this.get_events().addHandler("init",_8fc);
},remove_init:function(_8fd){
this.get_events().removeHandler("init",_8fd);
},add_selectionChange:function(_8fe){
this.get_events().addHandler("selectionChange",_8fe);
},remove_selectionChange:function(_8ff){
this.get_events().removeHandler("selectionChange",_8ff);
},add_commandExecuting:function(_900){
this.get_events().addHandler("commandExecuting",_900);
},remove_commandExecuting:function(_901){
this.get_events().removeHandler("commandExecuting",_901);
},add_commandExecuted:function(_902){
this.get_events().addHandler("commandExecuted",_902);
},remove_commandExecuted:function(_903){
this.get_events().removeHandler("commandExecuted",_903);
},add_submit:function(_904){
this.get_events().addHandler("submit",_904);
},remove_submit:function(_905){
this.get_events().removeHandler("submit",_905);
},add_editReady:function(_906){
this.get_events().addHandler("editReady",_906);
},remove_editReady:function(_907){
this.get_events().removeHandler("editReady",_907);
},add_pasteHtml:function(_908){
this.get_events().addHandler("pasteHtml",_908);
},remove_pasteHtml:function(_909){
this.get_events().removeHandler("pasteHtml",_909);
}};
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);

