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*('|\")?)(.*?)(\\3)(\\s|(\\/)?>)","ig");
_43=_43.replace(_44,"$2=$3$4$3 originalAttribute=\"$2\" originalPath=\"$4\"$6");
return _43;
},restoreOriginalPathsAndAttributes:function(_45){
var _46=_45.getElementsByTagName("*");
for(var i=0;i<_46.length;i++){
var _48=_46[i];
var _49=_48.getAttribute("originalPath");
var _4a=_48.getAttribute("originalAttribute");
if(_49!=null&&_4a!=null){
_48.removeAttribute("originalPath");
_48.removeAttribute("originalAttribute");
if(_49.toLowerCase().indexOf("mailto:")==0){
continue;
}
_49=_49.replace(window.location.href+"#","#");
_48.removeAttribute(_4a);
var _4b=_48.innerHTML;
_48.setAttribute(_4a,_49);
if(_4b.indexOf("www.")==0&&_48.innerHTML.match("[a-z]+://")){
_48.innerHTML=_4b;
}
}
}
},_encodeHtmlContent:function(_4c,_4d){
var _4e=new Array("%","<",">","!","\"","#","$","&","'","(",")",",",":",";","=","?","[","\\","]","^","`","{","|","}","~","+");
var _4f=_4c;
if(_4d){
for(var i=0;i<_4e.length;i++){
_4f=_4f.replace(new RegExp("\\x"+_4e[i].charCodeAt(0).toString(16),"ig"),"%"+_4e[i].charCodeAt(0).toString(16));
}
}else{
for(var i=_4e.length-1;i>=0;i--){
_4f=_4f.replace(new RegExp("%"+_4e[i].charCodeAt(0).toString(16),"ig"),_4e[i]);
}
}
return _4f;
},encodePostbackContent:function(_51){
return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(_51,true);
},decodePostbackContent:function(_52){
return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(_52,false);
},addStyleSheet:function(url,doc,id){
doc=doc||document;
var _56=doc.createElement("link");
_56.setAttribute("href",url,0);
_56.setAttribute("type","text/css");
if(id){
_56.setAttribute("id",id);
}else{
id="";
}
_56.setAttribute("rel","stylesheet",0);
var _57=doc.getElementsByTagName("head")[0];
if($telerik.isSafari){
var _58=function(){
_57.appendChild(_56);
};
window.setTimeout(_58,200);
}else{
_57.appendChild(_56);
}
},_copyElementsBetweenNodes:function(_59,_5a,_5b){
var _5c=_59.getElementsByTagName(_5b);
var _5d=_5a.getElementsByTagName(_5b);
for(var i=0;i<_5c.length;i++){
switch(_5b){
case "SCRIPT":
_5d[i].text=_5c[i].text;
break;
default:
_5d[i].innerHTML=_5c[i].innerHTML;
break;
}
}
},cloneNodeWithChildren:function(_5f){
if(!_5f){
return null;
}
if($telerik.isIE&&_5f.getElementsByTagName){
var _60=_5f.cloneNode(true);
if(typeof (_60.innerHTML)!="string"){
this.setElementInnerHtml(_60,_5f.innerHTML);
}
this._copyElementsBetweenNodes(_5f,_60,"SCRIPT");
this._copyElementsBetweenNodes(_5f,_60,"MAP");
return _60;
}else{
return _5f.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 _61=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_61;
}};;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(_1,_2,_3){
this.isSafari=$telerik.isSafari;
this.isIE=$telerik.isIE;
this.isOpera=$telerik.isOpera;
this.isFirefox=$telerik.isFirefox;
this._title=_1;
this._window=_2;
this._isExecuted=false;
this._canUnexecute=(_3!=false);
};
Telerik.Web.UI.Editor.CommandBase.prototype={getState:function(_4){
return Telerik.Web.UI.Editor.CommandStates.Off;
},getValue:function(_5){
return null;
},set_window:function(_6){
this._window=_6;
},get_window:function(){
return this._window;
},get_title:function(){
return this._title;
},set_title:function(_7){
this._title=_7;
},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.makeCompatible(Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.CommandBase.registerClass("Telerik.Web.UI.Editor.CommandBase",null);
Telerik.Web.UI.Editor.PasteHtmlCommand=function(_8,_9,_a,_b){
Telerik.Web.UI.Editor.PasteHtmlCommand.initializeBase(this,[(_8||"Insert Html"),_9,true]);
this.HtmlText=_a;
this.SelectText=(true==_b);
};
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 _c=new Telerik.Web.UI.Editor.Selection(this.get_window());
_c.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(_d,_e){
Telerik.Web.UI.Editor.GenericCommand.initializeBase(this,[_d,_e,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(_f,_10){
Telerik.Web.UI.Editor.TextTypeCommand.initializeBase(this,[(_f||"Typing"),_10]);
};
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(_11,_12,_13,_14){
var _15=true;
switch(this.CommandID){
case "Copy":
case "SelectAll":
case "Print":
_15=false;
break;
}
Telerik.Web.UI.Editor.BrowserCommand.initializeBase(this,[(_11||_13),_12,_15]);
this.CommandID=_13;
this.Value=_14;
};
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(_16){
try{
_16=_16||this.get_window();
var _17=_16.document;
if(null==_17){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
var _18=true;
if("Paste"!=this.CommandID){
_18=_17.queryCommandEnabled(this.CommandID);
}else{
if(!$telerik.isIE7){
_18=_17.queryCommandEnabled(this.CommandID);
}
}
if(!this.isOpera&&!_18){
if(!this.isSafari||!this.CommandID=="RealFontSize"){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
}
var _19=null;
if("Paste"!=this.CommandID){
_19=_17.queryCommandState(this.CommandID);
}else{
if(!$telerik.isIE7){
_19=_17.queryCommandState(this.CommandID);
}
}
return _19?Telerik.Web.UI.Editor.CommandStates.On:Telerik.Web.UI.Editor.CommandStates.Off;
}
catch(ex){
return Telerik.Web.UI.Editor.CommandStates.Off;
}
},getValue:function(_1a){
try{
_1a=_1a||this.get_window();
return _1a.document.queryCommandValue(this.CommandID);
}
catch(ex){
}
return null;
},onExecute:function(){
var _1b=this.get_window();
if(!_1b){
return false;
}
var _1c=_1b.document;
if("AbsolutePosition"==this.CommandID){
_1c.execCommand("2D-Position",false,true);
}
var _1d=true;
if(this.CommandID=="BackColor"&&(this.isOpera||this.isFirefox)){
this.CommandID="HiliteColor";
_1d=false;
}
if(this.CommandID=="FontSize"&&this.isSafari){
var _1e=parseInt(this.Value);
switch(_1e){
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{
_1c.execCommand("UseCSS",false,(false!=_1d));
}
catch(e){
}
var _1f=_1c.execCommand(this.CommandID,false,this.Value);
try{
_1c.execCommand("UseCSS",false,true);
}
catch(e){
}
return _1f;
}};
Telerik.Web.UI.Editor.BrowserCommand.registerClass("Telerik.Web.UI.Editor.BrowserCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.StyleRuleCommand=function(_20,_21,_22,_23,_24){
Telerik.Web.UI.Editor.StyleRuleCommand.initializeBase(this,[(_20||sCmdID),_21,true]);
if(!_22){
var _25=new Telerik.Web.UI.Editor.Selection(this._window);
_22=_25.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_22);
this._styleAttributeName=_23;
this._newValue=_24;
};
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 _26=this._nodeBookmark.select();
if(!_26){
return false;
}
if(!this._isExecuted){
this._oldValue=_26.style[this._styleAttributeName];
}
_26.style[this._styleAttributeName]=this._newValue;
this._isExecuted=true;
return true;
},unexecute:function(){
var _27=this._nodeBookmark.select();
_27.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(_28,_29,_2a,_2b,_2c){
Telerik.Web.UI.Editor.AttributeCommand.initializeBase(this,[(_28||sCmdID),_29,true]);
if(!_2a){
var _2d=new Telerik.Web.UI.Editor.Selection(this._window);
_2a=_2d.getParentElement();
}
this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,_2a);
this._attribName=_2b;
this._newValue=_2c;
};
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 _2e=this._nodeBookmark.select();
if(!_2e){
return false;
}
if(!this._isExecuted){
this._oldValue=_2e.getAttribute(this._attribName);
}
if(this._attribName&&this._attribName.toLowerCase()=="name"&&document.all){
_2e.name=this._newValue;
_2e.removeAttribute("name");
_2e.removeAttribute("NAME");
}
var _2f=this._newValue.trim();
if(""==_2f){
_2e.removeAttribute(this._attribName,0);
if("className"==this._attribName){
_2e.removeAttribute("class",0);
}
}else{
_2e[this._attribName]=this._newValue;
if(this._attribName.toLowerCase()=="nowrap"){
_2e.setAttribute(this._attribName,this._newValue);
}
}
this._isExecuted=true;
return true;
},unexecute:function(){
var _30=this._nodeBookmark.select();
_30[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(_1,_2,_3){
Telerik.Web.UI.Editor.ClassNameCommand.initializeBase(this,[(_1||"Classname"),_2,true]);
};
Telerik.Web.UI.Editor.ClassNameCommand.prototype={getValue:function(_4){
_4=_4||this._window;
if($telerik.isIE){
return this._getValueIE(_4);
}else{
return this._getValueMoz(_4);
}
},_getValueIE:function(_5){
var _6=new Telerik.Web.UI.Editor.Selection(_5);
var _7=_6.getParentElement();
if("BODY"==_7.tagName){
return "";
}else{
return (""==_7.className?"":_7.className);
}
},_getValueMoz:function(_8){
if(!_8){
return "";
}
var _9=_8.getSelection();
if(!_9){
return "";
}
if(_9.rangeCount!=1){
return "";
}
var _a=(_9.focusNode.nodeType!=3?_9.focusNode:_9.focusNode.parentNode);
var _b=(_9.anchorNode.nodeType!=3?_9.anchorNode:_9.anchorNode.parentNode);
if(_a!=_b){
return "";
}
var _c=new Telerik.Web.UI.Editor.Selection(_8);
var _d="",_e;
if(null!=_c&&null!=(_e=_c.getParentElement())){
_d=_e.className;
}
return (""==_d?"":_d);
}};
Telerik.Web.UI.Editor.ClassNameCommand.registerClass("Telerik.Web.UI.Editor.ClassNameCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.FormatBlockCommand=function(_f,_10,_11){
Telerik.Web.UI.Editor.FormatBlockCommand.initializeBase(this,[(_f||"Format Block"),_10,true]);
this.FormatValue=_11;
};
Telerik.Web.UI.Editor.FormatBlockCommand.prototype={clone:function(){
return new Telerik.Web.UI.Editor.FormatBlockCommand(this.Title,this._window,this.FormatValue);
},getValue:function(_12){
try{
_12=_12||this._window;
var _13=_12.document.queryCommandValue("FormatBlock");
if(!document.all){
switch(_13){
case "x":
case "":
_13="Normal";
break;
}
}
return _13;
}
catch(ex){
}
return null;
},_isFormatBlockElement:function(_14){
if(!_14||!_14.tagName){
return false;
}
var _15=_14.tagName;
if(_15=="H1"||_15=="H2"||_15=="H3"||_15=="H4"||_15=="H5"||_15=="H6"||_15=="H7"||_15=="ADDRESS"||_15=="PRE"){
return true;
}
},OnExecuteIE:function(){
var _16=this._window.document;
if("<p>"==this.FormatValue.toLowerCase()){
return _16.execCommand("FormatBlock",false,"<p>")&&_16.execCommand("RemoveFormat");
}
var _17=_16.selection.createRange();
var _18=false;
var _19=_17.htmlText.trim();
if(_19&&_19.length>2&&_19.substr(0,2).toLowerCase()=="<p"){
_18=true;
}
if(!_18&&""!=_17.text){
var _1a=this.FormatValue.substring(1,this.FormatValue.length-1);
_16.execCommand("FormatBlock",false,"<p>");
_16.execCommand("RemoveFormat");
var _1b=_16.createElement(_1a);
_1b.innerHTML=_17.htmlText;
_17.pasteHTML(_1b.outerHTML);
return true;
}else{
return _16.execCommand("FormatBlock",false,this.FormatValue);
}
},OnExecuteMoz:function(){
var _1c=this.FormatValue.substring(1,this.FormatValue.length-1);
var _1d=this._window.document;
var _1e=("body"==this.FormatValue.toLowerCase()||"normal"==this.FormatValue.toLowerCase());
var _1f=null;
var _20=_1c.indexOf(" ");
if(_20!=-1){
_1f=_1c.substring(_20+1);
_1c=_1c.substring(0,_20);
}
if(this.isSafari){
if(_1e){
}else{
var _21=_1d.createElement(_1c);
if(_1f){
var _22="";
_22=_1f.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_22.length>0){
_21.className=_22;
}
}
var _23=new Telerik.Web.UI.Editor.Selection(this._window);
_21.innerHTML=_23.getHtml();
var _24=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_21.outerHTML,true);
_24.execute();
}
return;
}
if(_1e){
return _1d.execCommand("FormatBlock",false,"Normal");
}
var _25=this._window.getSelection();
if(_25.rangeCount<1){
return false;
}
var _26=_25.getRangeAt(0);
var _27=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
if(_26.toString()!=""&&!this._isFormatBlockElement(_27)){
try{
var _21=_1d.createElement(_1c);
if(_1f){
var _22="";
_22=_1f.replace(/class\=[\'|\"]?([^\'|^\"]+)[\'|\"]?/gi,"$1");
if(_22.length>0){
_21.className=_22;
}
}
_21.appendChild(_26.extractContents());
_26.insertNode(_21);
return true;
}
catch(ex){
return false;
}
}else{
return _1d.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(_28,_29,_2a,_2b,_2c){
Telerik.Web.UI.Editor.InsertListCommand.initializeBase(this,[(_28||"Insert List"),_29,true]);
this._newLineBr=(_2a==true);
this._commandName=_2b;
this._listType=(_2b=="InsertOrderedList")?"OL":"UL";
this._listStyle=_2c;
this._document=this._window.document;
};
Telerik.Web.UI.Editor.InsertListCommand.prototype={_insertList:function(){
return this._document.execCommand(this._commandName,false,false);
},_pasteHtml:function(_2d){
var _2e=new Telerik.Web.UI.Editor.PasteHtmlCommand(this.Title,this._window,_2d);
_2e.execute();
},_expandSelection:function(_2f,_30,_31){
var _32=_2f.duplicate();
var _33=null;
var _34=null;
for(var i=_30.length-1;i>=0;i--){
_32.moveToElementText(_30[i]);
var _36=_2f.compareEndPoints("StartToStart",_32);
if(-1==_36||0==_36){
if(_31[_30[i].tagName]!=null){
_34=_30[i];
}
}else{
if(_31[_30[i].tagName]!=null){
_33=_30[i];
break;
}
}
}
if(_33){
_32.moveToElementText(_33);
_2f.setEndPoint("StartToEnd",_32);
}else{
var _37=_2f.parentElement();
_32.moveToElementText(_37);
_2f.setEndPoint("StartToStart",_32);
}
if(_34){
_32.moveToElementText(_34);
if("BR"==_34.tagName){
_2f.setEndPoint("EndToEnd",_32);
}else{
_2f.setEndPoint("EndToStart",_32);
}
}else{
var _37=_2f.parentElement();
_32.moveToElementText(_37);
_2f.setEndPoint("EndToEnd",_32);
}
_2f.select();
},_handleEmptyListSelection:function(_38,_39){
var _3a=_38.parentElement();
var _3b=(_3a&&"P"==_3a.tagName.toUpperCase());
var brs=_3a.getElementsByTagName("BR");
if(_3b&&brs.length==0){
return this._insertList();
}else{
var _3d={};
_3d["BR"]="";
_3d["TD"]="";
_3d["OL"]="";
_3d["UL"]="";
_3d["TABLE"]="";
_3d["DIV"]="";
_3d["IMG"]="";
_3d["OBJECT"]="";
var _3e=_38.parentElement().getElementsByTagName("*");
this._expandSelection(_38,_3e,_3d);
if(_38.htmlText){
return this.OnExecuteIE();
}
}
},OnExecuteIE:function(){
if(!this._newLineBr){
return this._insertList();
}
var _3f=new Telerik.Web.UI.Editor.Selection(this._window).getParentElement();
var _40=this._document.selection.createRange();
if("OL"==_3f.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_3f,"OL")!=null||"UL"==_3f.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_3f,"UL")!=null){
return this._insertList();
}else{
if("TD"==_3f.tagName||"TR"==_3f.tagName||"TBODY"==_3f.tagName||"TABLE"==_3f.tagName){
var _40=this._document.selection.createRange();
var _41=_40.parentElement().getElementsByTagName("TD");
for(var i=_41.length-1;i>=0;i--){
brRange=_40.duplicate();
brRange.moveToElementText(_41[i]);
if(_40.inRange(brRange)&&_41[i].innerHTML!=""){
_40.moveToElementText(_41[i]);
}
}
}
}
var _43=this._document.selection;
var _44=this._listType;
if(_43.type=="Control"){
var _45=this._document.body.createTextRange();
_45.moveToElementText(_40(0));
var _46=_45.parentElement();
var _47=_46.tagName.toLowerCase();
if(_47=="table"||_47=="tbody"){
var _48=_46.parentNode.outerHTML;
_46.parentNode.outerHTML="<"+_44+"><LI>"+_48+"</LI></"+_44+">";
}else{
var _48=_45.htmlText;
this._pasteHtml("<"+_44+"><LI>"+_48+"</LI></"+_44+">");
}
}else{
if(_40.htmlText==""){
return this._handleEmptyListSelection(_40,this._commandName);
}
var _49=this._document.createElement("SPAN");
_49.innerHTML=_40.htmlText;
if(_49.getElementsByTagName("P").length>0){
return this._insertList();
}else{
var _4a;
if(_40.parentElement().tagName.toUpperCase()=="LI"){
_4a=_40.parentElement().parentNode;
}else{
_4a=_40.parentElement();
}
if(_4a.tagName.toUpperCase()=="OL"||_4a.tagName.toUpperCase()=="UL"){
var _4b=_4a.tagName.toUpperCase();
if(_44==_4b){
if(this._newLineBr){
var _4c=_40.duplicate();
var _4d=_40.duplicate();
_4d.moveToElementText(_4a);
var _4e=_40.duplicate();
var _4f=_4a.getElementsByTagName("LI");
var _50=0;
var _51=_4f.length-1;
var _52=_40.duplicate();
_52.moveToElementText(_4f[0]);
var _53=_40.duplicate();
_53.moveToElementText(_4f[_4f.length-1]);
_4e.setEndPoint("EndToEnd",_53);
_4e.setEndPoint("StartToStart",_52);
while((_50<_4f.length)&&(_4e.compareEndPoints("StartToStart",_4c)<=0)){
_4e.moveToElementText(_4f[_50]);
_4e.setEndPoint("EndToEnd",_53);
_50++;
}
_50-=2;
while((_51>0)&&(_4e.compareEndPoints("EndToEnd",_4c)>=0)){
_4e.moveToElementText(_4f[_51]);
_4e.setEndPoint("StartToStart",_52);
_51--;
}
_51+=2;
var _54=_40.duplicate();
var _55=_40.duplicate();
_54.moveToElementText(_4f[_50]);
_54.collapse(true);
_54.setEndPoint("StartToStart",_4d);
_55.moveToElementText(_4f[_51]);
_55.collapse(false);
_55.setEndPoint("EndToEnd",_4d);
_40.setEndPoint("StartToEnd",_54);
_40.setEndPoint("EndToStart",_55);
var _56="";
var _57=false;
var _58=false;
if(_54.htmlText.replace(/<(.*?)>/)!=""){
_56+="<"+_4b+">"+_54.htmlText+"</"+_4b+">";
}else{
_57=true;
}
_56+=_40.htmlText.replace(/<LI\/?>/gi,"<BR>").replace(/<\/LI>/gi,"").replace(/^\s*<BR\/?>/gi,"").replace(/<BR\/?>\s*$/gi,"");
if(_55.htmlText.replace(/<(.*?)>/)!=""){
_56+="<"+_4b+">"+_55.htmlText+"</"+_4b+">";
}else{
_58=true;
_56+="<BR>";
}
if(_57&&_58){
_56=_56.replace(new RegExp("</?"+_4b+"/?>","gi"),"").replace(/^\s*<BR\/?>/gi,"");
}
if(_4a.parentNode.childNodes[0]==_4a){
_4d.collapse();
_4a.parentNode.removeChild(_4a,_56);
}else{
_4d.moveStart("character",-1);
}
this._pasteHtml(_56);
}else{
return this._insertList();
}
}else{
return this._insertList();
}
}else{
var _59=_40.duplicate();
_59.collapse(false);
_59.moveEnd("character",1);
if(_59.htmlText.match(/<BR\/?>/gi)){
_40.moveEnd("character",1);
}
var _5a="<"+_44+"><LI>"+_40.htmlText.replace(/(<BR\s*>\s*)*$/gi,"").replace(/<BR\/?>$/gi,"").replace(/<BR\/?>/gi,"</LI><LI>")+"</LI></"+_44+">";
try{
_40.pasteHTML(_5a);
}
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(_1,_2){
Telerik.Web.UI.Editor.TableCommandBase.initializeBase(this,[(_1||"Table Command"),_2,true]);
};
Telerik.Web.UI.Editor.TableCommandBase.prototype={getState:function(_3){
return this.getSelectedCell(_3)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
},getSelectedCell:function(_4){
var _5=new Telerik.Web.UI.Editor.Selection(_4||this._window);
var _6;
if(_5){
_6=_5.getParentElement();
}
while(null!=_6&&_6.tagName!="TD"&&_6.tagName!="TH"&&_6.tagName!="BODY"){
_6=_6.parentNode;
}
if(!_6||!_6.tagName){
return null;
}
return (_6.tagName=="TD"||_6.tagName=="TH"?_6:null);
},getSelectedRow:function(_7){
var _8=new Telerik.Web.UI.Editor.Selection(_7||this._window);
var _9;
if(_8){
_9=_8.getParentElement();
}
if(!_9){
return null;
}
while(null!=_9&&_9.tagName!="TR"&&_9.tagName!="BODY"){
_9=_9.parentNode;
}
return (_9&&_9.tagName=="TR"?_9:null);
},getParentTable:function(_a){
if(!_a){
return null;
}
while(null!=_a&&_a.parentNode!=_a&&"TABLE"!=_a.tagName){
_a=_a.parentNode;
}
return (_a&&_a.tagName=="TABLE"?_a:null);
},getNextSiblingCell:function(_b){
if(!_b){
return null;
}
var _c=_b.parentNode;
var _d=_b.cellIndex+1;
if(0<=_d&&_d<_c.cells.length){
return _c.cells[_d];
}
return null;
},getPreviouseSiblingCell:function(_e){
if(!_e){
return null;
}
var _f=_e.parentNode;
var _10=_e.cellIndex-1;
if(0<=_10&&_10<_f.cells.length){
return _f.cells[_10];
}
return null;
}};
Telerik.Web.UI.Editor.TableCommandBase.registerClass("Telerik.Web.UI.Editor.TableCommandBase",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableInsertRow=function(_11,_12,_13){
Telerik.Web.UI.Editor.TableInsertRow.initializeBase(this,[(_11||"Insert row"),_12,true]);
this._direction=_13||"above";
};
Telerik.Web.UI.Editor.TableInsertRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertRow(this._title,this._window,this._direction);
},getState:function(_14){
return (this.getSelectedRow(_14)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var _15=this.getSelectedCell();
if(!_15){
return false;
}
var row=_15.parentNode;
var _17=row.rowIndex;
if("below"==this._direction){
_17++;
}
var _18=this.getParentTable(row);
if(!_18){
return false;
}
var _19=_18.insertRow(_17);
if(!_19){
return false;
}
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(row,_19);
var _1a;
for(var i=0;i<row.cells.length;i++){
_15=row.cells[i];
_1a=_19.insertCell(-1);
_1a.colSpan=_15.colSpan;
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(_15,_1a);
_1a.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(_1c,_1d){
Telerik.Web.UI.Editor.TableDeleteRow.initializeBase(this,[(_1c||"Delete Row"),_1d,true]);
};
Telerik.Web.UI.Editor.TableDeleteRow.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableDeleteRow(this._title,this._window);
},getState:function(_1e){
return (this.getSelectedRow(_1e)?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(_20,_21,_22){
Telerik.Web.UI.Editor.TableInsertColumn.initializeBase(this,[(_20||"Insert column"),_21,true]);
this._direction=_22||"left";
};
Telerik.Web.UI.Editor.TableInsertColumn.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableInsertColumn(this._title,this._window,this._direction);
},getState:function(_23){
return (this.getSelectedCell(_23)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var _24=this.getSelectedCell();
if(!_24){
return false;
}
var _25=_24.cellIndex;
if("right"==this._direction){
_25++;
}
var _26=this.getParentTable(_24);
if(!_26){
return false;
}
var _27=_26.rows;
var _28;
for(var i=0;i<_27.length;i++){
_28=_27[i].insertCell(_25);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(_24,_28);
_28.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(_2a,_2b,_2c){
Telerik.Web.UI.Editor.TableDeleteColumn.initializeBase(this,[(_2a||"Delete column"),_2b,true]);
};
Telerik.Web.UI.Editor.TableDeleteColumn.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableDeleteColumn.New(this._title,this._window);
},getState:function(_2d){
return (this.getSelectedCell(_2d)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var _2e=this.getSelectedCell();
if(!_2e){
return false;
}
var _2f=_2e.cellIndex;
var _30=this.getParentTable(_2e);
if(!_30){
return false;
}
var _31=_30.rows;
for(var i=0;i<_31.length;i++){
_2e=_31[i].cells[_2f];
if(_2e){
_2e.parentNode.removeChild(_2e);
}
}
return true;
}};
Telerik.Web.UI.Editor.TableDeleteColumn.registerClass("Telerik.Web.UI.Editor.TableDeleteColumn",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeRows=function(_33,_34){
Telerik.Web.UI.Editor.TableMergeRows.initializeBase(this,[(_33||"Merge rows"),_34,true]);
};
Telerik.Web.UI.Editor.TableMergeRows.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeRows.New(this._title,this._window);
},getState:function(_35){
var _36=this.getSelectedCell(_35);
if(null!=_36&&null!=this.getLowerCell(_36)&&1==_36.colSpan){
return Telerik.Web.UI.Editor.CommandStates.Off;
}else{
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
},onExecute:function(){
var _37=this.getSelectedCell();
if(!_37){
return false;
}
var _38=this.getLowerCell(_37);
if(!_38){
return false;
}
if(""!=_38.innerHTML){
if(""!=_37.innerHTML){
_37.innerHTML+="<br>";
}
_37.innerHTML+=_38.innerHTML;
}
_37.rowSpan+=_38.rowSpan;
_38.parentNode.removeChild(_38);
return true;
},getLowerCell:function(_39){
if(!_39){
return null;
}
var _3a=this.getParentTable(_39);
var row=_39.parentNode;
var _3c=_3a.rows[row.rowIndex+_39.rowSpan];
if(!_3c){
return null;
}
var _3d=_3c.cells[_39.cellIndex];
return _3d;
}};
Telerik.Web.UI.Editor.TableMergeRows.registerClass("Telerik.Web.UI.Editor.TableMergeRows",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeColumns=function(_3e,_3f){
Telerik.Web.UI.Editor.TableMergeColumns.initializeBase(this,[(_3e||"Merge columns"),_3f,true]);
};
Telerik.Web.UI.Editor.TableMergeColumns.prototype={clone:function(){
return Telerik.Web.UI.Editor.TableMergeColumns.New(this._title,this._window);
},getState:function(_40){
var _41=this.getSelectedCell(_40);
if(null!=_41&&null!=this.getNextSiblingCell(_41)){
return Telerik.Web.UI.Editor.CommandStates.Off;
}else{
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
},onExecute:function(){
var _42=this.getSelectedCell();
if(null==_42){
return false;
}
var _43=this.getNextSiblingCell(_42);
if(!_43){
return false;
}
_42.colSpan+=_43.colSpan;
if(""!=_43.innerHTML){
if(""!=_42.innerHTML){
_42.innerHTML+="<br>";
}
_42.innerHTML+=_43.innerHTML;
}
_43.parentNode.removeChild(_43);
return true;
}};
Telerik.Web.UI.Editor.TableMergeColumns.registerClass("Telerik.Web.UI.Editor.TableMergeColumns",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableSplitCell=function(_44,_45){
Telerik.Web.UI.Editor.TableSplitCell.initializeBase(this,[(_44||"Split cell"),_45,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(_46){
var _47=this.getSelectedCell(_46);
if(!_47){
return Telerik.Web.UI.Editor.CommandStates.Disabled;
}
return ((_47.colSpan>1||_47.rowSpan>1)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){
var _48=this.getSelectedCell();
if(!_48){
return false;
}
var _49=this.getParentTable(_48);
if(!_49){
return false;
}
var row=_48.parentNode;
var _4b=("THEAD"==row.parentNode.tagName.toUpperCase()?"TH":"TD");
if(_48.colSpan>1){
for(i=1;i<this._newColumns;i++){
var _4c=this._window.document.createElement(_4b);
_4c.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(_48,_4c);
_4c.colSpan=1;
if(_48.cellIndex+1<row.cells.length){
row.insertBefore(_4c,row.cells[_48.cellIndex+1]);
}else{
row.appendChild(_4c);
}
_48.colSpan--;
}
}
if(_48.rowSpan>1){
for(i=1;i<this._newRows;i++){
var _4d=_49.rows[row.rowIndex+_48.rowSpan-1];
if(!_4d||0==_4d.cells.length){
break;
}
var _4c=this._window.document.createElement(_4b);
_4c.innerHTML=this.isIE?"":"&nbsp;";
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(_48,_4c);
_4c.rowSpan=1;
if(_48.cellIndex+1<_4d.cells.length){
_4d.insertBefore(_4c,_4d.cells[_48.cellIndex+1]);
}else{
_4d.appendChild(_4c);
}
_48.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(_4e,_4f){
Telerik.Web.UI.Editor.TableDeleteCell.initializeBase(this,[(_4e||"Delete cell"),_4f,true]);
};
Telerik.Web.UI.Editor.TableDeleteCell.prototype={clone:function(){
return new Telerik.Web.UI.Editor.TableDeleteCell(this._title,this._window);
},onExecute:function(){
var _50=this.getSelectedCell();
if(!_50){
return false;
}
_50.parentNode.removeChild(_50);
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(_1){
Telerik.Web.UI.EditorButton.initializeBase(this,[_1]);
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(_2,_3){
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 "+_3;
var _6=_2.get_element();
ul.appendChild(_6);
li=document.createElement("LI");
li.innerHTML="&nbsp;";
li.className="rade_grip grip_last";
ul.appendChild(li);
return ul;
};
Telerik.Web.UI.EditorButton.getToolRootNode=function(_7){
while(_7&&_7.tagName!="LI"){
_7=_7.parentNode;
}
return _7;
};
Telerik.Web.UI.EditorButton._createButton=function(_8){
var _9=document.createElement("LI");
var a=document.createElement("A");
_9.appendChild(a);
a.className=_8.showText==true?"rade_tool_text":"rade_tool";
var _b=_8["text"];
a.title=_b?_b:_8["name"];
a.href="#";
a.setAttribute("unselectable","on");
if(_8.showIcon!=false){
var _c=document.createElement("SPAN");
_c.className=_8.name;
_c.innerHTML="&nbsp;";
_c.setAttribute("unselectable","on");
a.appendChild(_c);
}
if(_8.showText==true){
var _c=document.createElement("SPAN");
_c.className="rade_button_text";
_c.innerHTML=_8.text?_8.text:_8.name;
_c.setAttribute("unselectable","on");
a.appendChild(_c);
}
return _9;
};
Telerik.Web.UI.EditorButton.createTool=function(_d,_e,_f,_10,_11){
if(!_f){
_f=Telerik.Web.UI.EditorButton;
}
if(!_10){
_10=Telerik.Web.UI.EditorButton._createButton(_d);
if(_f==Telerik.Web.UI.EditorSplitButton||_f.inheritsFrom(Telerik.Web.UI.EditorSplitButton)){
var a=_10.getElementsByTagName("A")[0];
if(a){
Sys.UI.DomElement.addCssClass(a,"rad_splitbutton");
var _13=document.createElement("SPAN");
_13.className="split_arrow";
_13.innerHTML="&nbsp;";
a.appendChild(_13);
}
}else{
if(_f==Telerik.Web.UI.EditorDropDown||_f.inheritsFrom(Telerik.Web.UI.EditorDropDown)){
var a=_10.getElementsByTagName("A")[0];
if(a){
Sys.UI.DomElement.removeCssClass(a,"rade_tool");
Sys.UI.DomElement.addCssClass(a,"rade_dropdown");
a.innerHTML="";
var _13=document.createElement("SPAN");
_13.innerHTML="&nbsp;";
var _14=_d["width"]?_d["width"]:"50px";
_13.style.width=_14;
a.appendChild(_13);
}
}
}
}
var _15=$create(_f,_d,_e,null,_10);
if(_11&&_11.appendChild){
_11.appendChild(_10);
}
return _15;
};
Telerik.Web.UI.EditorButton.prototype={initialize:function(){
var _16=this.getAnchorElement();
if(_16){
if(!_16.title||_16.title.length==0){
_16.title=this.get_text();
}
_16.setAttribute("unselectable","on");
}
var _17=this.getSpanElement();
if(_17){
_17.setAttribute("unselectable","on");
}
if(this._addClickHandler){
var _18=this.get_element();
$addHandlers(_18,{"click":this.click},this);
}
},dispose:function(){
var _19=this.get_element();
if(_19){
$clearHandlers(_19);
}
Telerik.Web.UI.EditorButton.callBaseMethod(this,"dispose");
},click:function(e){
this.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(e);
},add_valueSelected:function(_1b){
this.get_events().addHandler("valueSelected",_1b);
},remove_valueSelected:function(_1c){
this.get_events().removeHandler("valueSelected",_1c);
},raiseEvent:function(_1d,_1e){
var _1f=this.get_events().getHandler(_1d);
if(_1f){
if(!_1e){
_1e=Sys.EventArgs.Empty;
}
_1f(this,_1e);
}
},set_width:function(_20){
var _21=this.getSpanElement();
if(_21){
_21.style.width=_20;
}
},get_width:function(){
return this.get_element().offsetWidth;
},set_height:function(_22){
var _23=this.getSpanElement();
if(_23){
_23.style.height=_22;
}
},get_height:function(){
return this.get_element().offsetHeight;
},isTarget:function(e){
return $telerik.isDescendantOrSelf(this.get_element(),e.target);
},setState:function(_25){
this.set_enabled(_25!=Telerik.Web.UI.Editor.CommandStates.Disabled);
this.setOn(_25==Telerik.Web.UI.Editor.CommandStates.On);
},setFocus:function(){
var _26=this.getAnchorElement();
if(_26&&_26.focus){
_26.focus();
}
},get_addClickHandler:function(){
return this._addClickHandler;
},set_addClickHandler:function(_27){
this._addClickHandler=_27;
},get_attributes:function(){
return this._attributes;
},set_attributes:function(_28){
this._attributes=_28;
},get_autoPostBack:function(){
return this._autoPostBack;
},set_autoPostBack:function(_29){
this._autoPostBack=_29;
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_2a){
if(this._enabled!=_2a){
this._enabled=_2a;
var _2b=this.getAnchorElement();
if(!this._enabled){
this._addAnchorCssClass("rade_tool_disabled");
_2b.setAttribute("disabled","disabled");
}else{
this._removeAnchorCssClass("rade_tool_disabled");
_2b.removeAttribute("disabled");
}
}
},isOn:function(){
return this._isOn;
},setOn:function(_2c){
if(this._isOn!=_2c){
this._isOn=_2c;
if(this._isOn){
this._addAnchorCssClass("rade_tool_selected");
}else{
this._removeAnchorCssClass("rade_tool_selected");
}
}
},get_name:function(){
return this._name;
},set_name:function(_2d){
this._name=_2d;
},get_text:function(){
if(!this._text){
return this.get_name();
}else{
return this._text;
}
},set_text:function(_2e){
if(this._text!=_2e){
this._text=_2e;
if(this.get_showText()){
this.getSpanElement().innerHTML=_2e;
}
}
},get_shortCut:function(){
return this._shortCut;
},set_shortCut:function(_2f){
this._shortCut=_2f;
},get_showIcon:function(){
return this._showIcon;
},set_showIcon:function(_30){
if(this._showIcon!=_30){
this._showIcon=_30;
}
},get_skin:function(){
return this._skin;
},set_skin:function(_31){
this._skin=_31;
},_addAnchorCssClass:function(_32){
Sys.UI.DomElement.addCssClass(this.getAnchorElement(),_32);
},_removeAnchorCssClass:function(_33){
Sys.UI.DomElement.removeCssClass(this.getAnchorElement(),_33);
},get_showText:function(){
return this._showText;
},set_showText:function(_34){
if(this._showText!=_34){
this._showText=_34;
}
},get_type:function(){
return this._type;
},set_type:function(_35){
this._type=_35;
},get_clientTypeName:function(){
return this._clientTypeName;
},set_clientTypeName:function(_36){
this._clientTypeName=_36;
},getAnchorElement:function(){
return this.get_element().firstChild;
},getSpanElement:function(){
var _37=this.getAnchorElement();
var _38=_37.firstChild;
while(_38!=null&&_38.tagName.toLowerCase()!="span"){
_38=_38.nextSibling;
}
return _38;
}};
$telerik.makeCompatible(Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorButton.registerClass("Telerik.Web.UI.EditorButton",Sys.UI.Control);
Telerik.Web.UI.EditorSpinBoxEventArgs=function(_39,_3a){
Telerik.Web.UI.EditorSpinBoxEventArgs.initializeBase(this);
this._newValue=_39;
this._oldValue=_3a;
};
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(_3b){
Telerik.Web.UI.EditorSpinBox.initializeBase(this,[_3b]);
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 _3c=document.createElement("INPUT");
_3c.setAttribute("size","3");
_3c.style.width="30px";
_3c.onclick=function(e){
this.focus();
};
_3c.onkeypress=Function.createDelegate(this,this._onKeyPressHandler);
_3c.onchange=Function.createDelegate(this,this._onChangeHandler);
this._inputElement=_3c;
var _3e=this.get_element();
_3e.appendChild(_3c);
_3e.style.width=this.get_width();
_3e.className=(this.get_skin()+" "+this._className);
},_createPlusMinusList:function(){
var _3f=document.createElement("UL");
this.get_element().appendChild(_3f);
var _40=document.createElement("LI");
Sys.UI.DomElement.addCssClass(_40,"rade_SpinBox_tool rade_sbt_increase");
_3f.appendChild(_40);
var _41=document.createElement("A");
_41.title="Increase";
_41.href="javascript:void(0);";
_41.innerHTML="<span>+</span>";
_41.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
_40.appendChild(_41);
this._increaseButton=_41;
var _40=document.createElement("LI");
Sys.UI.DomElement.addCssClass(_40,"rade_SpinBox_tool rade_sbt_decrease");
_3f.appendChild(_40);
var _41=document.createElement("A");
_41.title="Decrease";
_41.href="javascript:void(0);";
_41.innerHTML="<span>-</span>";
_41.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
_40.appendChild(_41);
this._decreaseButton=_41;
},_executeFunction:function(e,_43,_44){
if(_44){
if(_43.Executed){
_43.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
_43.Executed=true;
var _45=(this._selectedItem!="")?this._selectedItem:this._initialValue;
this._selectedItem=_43.value;
var _46=new Telerik.Web.UI.EditorSpinBoxEventArgs(_43.value,_45);
this.raiseEvent("valueSelected",_46);
},_onPlusMinusClickHandler:function(e){
var _48=null;
if(!e){
_48=window.event.srcElement;
}else{
_48=e.target;
}
if(!_48){
return;
}
var _49=_48.parentNode;
var _4a=this.get_value();
_4a=_4a.replace(/^0+(\d)/ig,"$1");
if(""==_4a){
_4a="0";
}
var _4b=parseInt(_4a);
var _4c=_4b+"";
if(isNaN(_4b)){
return;
}else{
_4c=_4a.substring(_4c.length);
}
if(_49==this._increaseButton){
if(this._enabledIncrease){
_4b++;
}else{
return;
}
}else{
if(_49==this._decreaseButton){
if(this._enabledDecrease){
_4b--;
}else{
return;
}
}else{
_49=null;
}
}
if(_49){
this.set_value(_4b+_4c);
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 _51=this._selectedItem;
var _52=this.get_value();
var _53=new Telerik.Web.UI.EditorSpinBoxEventArgs(_52,_51);
this.raiseEvent("valueSelected",_53);
}
},_isKeyValid:function(e,_55){
try{
if(!_55){
_55=false;
}
if(!e){
e=window.event;
}
var _56=((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(!_55){
_56|=((35<=e.keyCode&&e.keyCode<=40));
}
return _56;
}
catch(ex){
return true;
}
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_57){
if(null==_57){
_57="";
}
this._inputElement.value=_57;
if(this._initialValue==""){
this._initialValue=_57;
}
},get_width:function(){
return this._width;
},set_width:function(_58){
this._width=_58;
var _59=this.get_element();
_59.style.width=this._width;
},get_enabledIncrease:function(){
return this._enabledIncrease;
},set_enabledIncrease:function(_5a){
this._enabledIncrease=_5a;
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(_5b){
this._enabledDecrease=_5b;
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(_5c){
this._visibleInput=_5c;
if(!this._visibleInput){
this._inputElement.style.display="none";
}else{
this._inputElement.style.display="";
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_5d){
this._clientStateFieldID=_5d;
}};
Telerik.Web.UI.EditorSpinBox.registerClass("Telerik.Web.UI.EditorSpinBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorCheckBox=function(_5e){
Telerik.Web.UI.EditorCheckBox.initializeBase(this,[_5e]);
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(_5f){
if(this._inputElement.checked!=_5f){
this._inputElement.checked=_5f;
}
},initialize:function(){
var _60=document.createElement("INPUT");
_60.setAttribute("type","CHECKBOX");
_60.Parent=this;
_60.onclick=function(e){
var oP=this.Parent;
oP._selectedItem=!oP._selectedItem;
this.checked=oP._selectedItem;
oP._selectedItem=this.checked;
oP.raiseEvent("valueSelected");
};
this._inputElement=_60;
this.get_element().appendChild(_60);
}};
Telerik.Web.UI.EditorCheckBox.registerClass("Telerik.Web.UI.EditorCheckBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorTextBox=function(_63){
Telerik.Web.UI.EditorTextBox.initializeBase(this,[_63]);
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(_64){
this._width=_64;
},initialize:function(){
var _65=document.createElement("INPUT");
_65.style.width=this.get_width();
_65.Parent=this;
var _66=this.get_name();
var _67=function(e,_69,_6a){
if(_6a){
if(_69.Executed){
_69.Executed=false;
return $telerik.cancelRawEvent(e);
}
}
_69.Executed=true;
_69.Parent._selectedItem=_69.value;
_69.Parent.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(e);
};
_65.onchange=function(e){
if(!e){
e=window.event;
}
return _67(e,this,true);
};
_65.onclick=function(e){
this.focus();
};
_65.onkeypress=function(e){
if(!e){
e=window.event;
}
if(e.keyCode==13){
return _67(e,this);
}
};
this._inputElement=_65;
this.get_element().appendChild(_65);
},get_selectedItem:function(){
return this._selectedItem;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_6e){
if(null==_6e){
_6e="";
}
this._inputElement.value=_6e;
}};
Telerik.Web.UI.EditorTextBox.registerClass("Telerik.Web.UI.EditorTextBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.ImageDialogCaller=function(_6f){
Telerik.Web.UI.ImageDialogCaller.initializeBase(this,[_6f]);
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 _70=this.get_element();
_70.style.width=parseInt(this._inputElement.style.width)+30+"px";
_70.className=(this.get_skin()+" "+this._className);
},_createInputElement:function(){
var _71=document.createElement("INPUT");
_71.style.width=this.get_width();
this._inputElement=_71;
this.get_element().appendChild(_71);
},_createButton:function(){
var _72=document.createElement("A");
_72.title="Call Image Manager";
_72.href="javascript:void(0);";
_72.onclick=Function.createDelegate(this,this._onButtonClickHandler);
_72.innerHTML="<span>...</span>";
this.get_element().appendChild(_72);
this._pushButton=_72;
},_onButtonClickHandler:function(e){
var _74=this;
var _75=function(_76,_77){
var src="";
var img=_77.Result;
if(img){
src=img.getAttribute("src",2);
}
if(src){
_74._inputElement.value=src;
_74.raiseEvent("valueSelected");
}
};
this._editor.showDialog("ImageManager",{},_75);
},get_editor:function(){
return this._editor;
},set_editor:function(_7a){
this._editor=_7a;
},get_value:function(){
return this._inputElement.value;
},set_value:function(_7b){
if(null==_7b){
_7b="";
}
this._inputElement.value=_7b;
},get_width:function(){
return this._width;
},set_width:function(_7c){
this._width=_7c;
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_7d){
this._clientStateFieldID=_7d;
}};
Telerik.Web.UI.ImageDialogCaller.registerClass("Telerik.Web.UI.ImageDialogCaller",Telerik.Web.UI.EditorButton);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorDropDown=function(_1){
Telerik.Web.UI.EditorDropDown.initializeBase(this,[_1]);
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 _3=false;
if(!this._rendered){
this.render();
_3=true;
}
this.raiseEvent("show");
if(!this._childrenRendered){
this.renderChildren();
this._childrenRendered=true;
_3=true;
}
if(_3){
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 _5=this.resolveActiveIndex(e);
if(_5>-1){
this.set_activeIndex(_5,e);
}
this._cancelEvent(e);
},_cancelEvent:function(e){
if(e){
e.preventDefault();
e.stopPropagation();
e.returnValue=false;
e.cancelBubble=true;
}
},_onPopupClick:function(e){
var _8=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_8>-1){
this._selectedIndex=_8;
this.hide();
this.raiseEvent("valueSelected");
}
},get_activeIndex:function(){
return this._activeIndex;
},set_activeIndex:function(_9,e){
this._activeIndex=_9;
this.selectUIItem(e);
},selectPreviousItem:function(){
var _b=this.get_activeIndex();
if(_b-1>=0){
this.set_activeIndex(_b-1);
}
},selectNextItem:function(){
var _c=this.get_activeIndex();
if(_c+1<this._items.length){
this.set_activeIndex(_c+1);
}
},selectUIItem:function(e,_e){
if(!this._popupElement){
return;
}
var _f=this._popupElement.getElementsByTagName("TD");
var len=_f.length;
var _11=this.get_activeIndex();
var _12=null;
for(var i=0;i<len;i++){
var _14=_f[i];
if(_14.item_index==_11){
_14.className="rade_itemOver";
_12=_14;
}else{
if(_e&&_14.item_index<=_11){
_14.className="rade_itemOver";
}else{
_14.className="";
}
}
}
if(_12&&!e){
this._scrollIntoView(_12,_12.parentNode.parentNode.parentNode.parentNode);
}
return _12;
},_scrollIntoView:function(_15,_16){
if($telerik.isIE||!_16){
var _17=_16;
_17.scrollTop=0;
var _18=_17.getClientRects()[0];
var _19=_18.top;
var _1a=_18.bottom;
var _1b=_15.getClientRects()[0].bottom;
if(_1b==0){
return;
}
while(_1b>_1a||_1b<_19){
var _1c="down";
if(_1b<_19){
_1c="up";
}
_17.doScroll(_1c);
_1b=_15.getClientRects()[0].bottom;
}
}else{
if(_15.scrollIntoView){
_15.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 _1d=this._itemRootElement;
this.renderItemRoot();
_1d.parentNode.replaceChild(this._itemRootElement,_1d);
}
},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 _1e=this._itemRootElement.rows[this._itemRootElement.rows.length-1];
var _1f=_1e.insertCell(-1);
return _1f;
},renderChildren:function(){
for(var i=0;i<this._items.length;i++){
if(0==(i%this._itemsPerRow)){
this.renderNewRow();
}
var _21=this.renderItemContainer();
this.markItemContainer(_21,i);
this.renderChild(_21,this._items[i],i);
}
},renderChild:function(_22,_23,_24){
var _25=document.createElement("span");
if(_23){
var _26=null;
var _27=null;
if(_23 instanceof Array){
_26=_23[1];
_27=_23[2];
}else{
_26=_23;
}
if(_27){
var _28=document.createElement("span");
_28.innerHTML="&nbsp;";
_28.className=_27;
_25.appendChild(_28);
}
if(_26){
_25.innerHTML+=_26;
_25.noWrap=true;
}
}
_22.innerHTML=_25.innerHTML;
},resolveActiveIndex:function(e){
var _2a=e.target;
var _2b=-1;
while(_2a&&_2a!=this._itemRootElement){
if(null!=_2a.item_index){
_2b=_2a.item_index;
break;
}
_2a=_2a.parentNode;
}
return _2b;
},markItemContainer:function(_2c,_2d){
_2c.item_index=_2d;
},_makeAllItemsUnselectable:function(){
if(!this._popupElement){
return;
}
var _2e=this._popupElement.getElementsByTagName("*");
var len=_2e.length;
for(var i=0;i<len;i++){
_2e[i].unselectable="on";
}
},_show:function(){
this.configurePopupPropertiesBeforeShow();
var _31=this._popupElement;
var _32=this.get_sizetofit();
var _33=_31.style.overflow;
if(_32){
_31.style.overflowY="hidden";
}
_31.style.width=this.get_popupwidth();
_31.style.height=this.get_popupheight();
this._itemRootElement.style.width="100%";
this._popupBehavior.show();
if(_32){
_31.style.width=this._getPopupChildrenWidth();
var _34=this._getPopupChildrenHeight();
if(_34!="0px"){
_31.style.height=_34;
}
}
this._popupBehavior.show();
this._getPopupVisibilityController().set_activePopup(this);
_31.style.zIndex="100000";
if(_32){
_31.style.overflowY=_33;
}
this._popupVisible=true;
},_getPopupChildrenWidth:function(){
var _35=this.get_popupElement().childNodes;
var _36=0;
for(var i=0;i<_35.length;i++){
var _38=_35[i].offsetWidth;
if(_38&&_38>_36){
_36=_38;
}
}
return _36+"px";
},_getPopupChildrenHeight:function(){
var _39=this.get_popupElement().childNodes;
var _3a=0;
for(var i=0;i<_39.length;i++){
if(_39[i].offsetHeight){
_3a+=_39[i].offsetHeight;
}
}
return _3a+"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 _3c=window["RadEditor_uniqueSeed"]-window["RadEditor_uniqueIdCounter"];
return "UniqueID"+_3c;
},_createUI:function(){
if(this._popupBehavior){
return;
}
var _3d=this.get_element();
if(!this._popupElement){
var _3e=document.createElement("DIV");
$telerik.addCssClasses(_3e,[this.get_skin(),this._rootPopupClassName,this.get_popupclassname()]);
this._popupElement=_3e;
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":_3d},null,null,this._popupElement);
this.attachEventHandlers();
},_getTable:function(){
var _3f=document.createElement("table");
_3f.border=0;
_3f.cellPadding=0;
_3f.setAttribute("unselectable","on");
_3f.style.cursor="default";
return _3f;
},get_clearSelectedOnShow:function(){
return this._clearSelectedOnShow;
},set_clearSelectedOnShow:function(_40){
this._clearSelectedOnShow=_40;
},get_popupElement:function(){
return this._popupElement;
},get_selectedItem:function(){
if(this._items&&this._selectedIndex>-1){
var _41=this._items[this._selectedIndex];
var _42=((true==this._isArrayCollection)||(_41 instanceof Array))?_41[0]:_41;
return _42;
}
return null;
},get_selectedIndex:function(){
return this._selectedIndex;
},set_selectedIndex:function(_43){
this._selectedIndex=_43;
this.set_activeIndex(_43);
},get_items:function(){
return this._items;
},set_items:function(_44){
this.disposeChildren();
this._items=_44;
},get_itemsperrow:function(){
return this._itemsPerRow;
},set_itemsperrow:function(_45){
this._itemsPerRow=_45;
},get_sizetofit:function(){
return this._sizeToFit;
},set_sizetofit:function(_46){
this._sizeToFit=_46;
},get_popupclassname:function(){
return this._popupClassName;
},set_popupclassname:function(_47){
this._popupClassName=_47;
},get_rootpopupclassname:function(){
return this._rootPopupClassName;
},set_rootpopupclassname:function(_48){
this._rootPopupClassName=_48;
},get_popupwidth:function(){
return this._popupWidth;
},set_popupwidth:function(_49){
this._popupWidth=_49;
},get_popupheight:function(){
return this._popupHeight;
},set_popupheight:function(_4a){
this._popupHeight=_4a;
},add_show:function(_4b){
this.get_events().addHandler("show",_4b);
},remove_show:function(_4c){
this.get_events().removeHandler("show",_4c);
},add_hide:function(_4d){
this.get_events().addHandler("hide",_4d);
},remove_hide:function(_4e){
this.get_events().removeHandler("hide",_4e);
}};
$telerik.makeCompatible(Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.EditorDropDown.registerClass("Telerik.Web.UI.EditorDropDown",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorUpdateableDropDown=function(_4f){
Telerik.Web.UI.EditorUpdateableDropDown.initializeBase(this,[_4f]);
};
Telerik.Web.UI.EditorUpdateableDropDown.prototype={updateValue:function(_50){
if(null==_50){
return;
}
try{
if(!_50){
_50=this.get_text();
}
var _51=this.getSpanElement();
if(_51){
this._value=(""+_50).replace(/\s+/ig,"&nbsp;");
_51.innerHTML=this._value;
}
}
catch(e){
}
},get_value:function(){
if(!this._value||this._value==this.get_text()){
return "";
}
return this._value;
},set_value:function(_52){
this.updateValue(_52);
}};
Telerik.Web.UI.EditorUpdateableDropDown.registerClass("Telerik.Web.UI.EditorUpdateableDropDown",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.EditorSelfUpdateableDropDown=function(_53){
Telerik.Web.UI.EditorSelfUpdateableDropDown.initializeBase(this,[_53]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSelfUpdateableDropDown.prototype={_onPopupClick:function(e){
var _55=this.resolveActiveIndex(e);
this._cancelEvent(e);
if(_55>-1){
this._selectedIndex=_55;
this.hide();
var _56=this.get_selectedItem();
if(_56){
this.updateValue(_56);
}
this.raiseEvent("valueSelected");
}
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_57){
this._clientStateFieldID=_57;
}};
Telerik.Web.UI.EditorSelfUpdateableDropDown.registerClass("Telerik.Web.UI.EditorSelfUpdateableDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorSplitButton=function(_58){
Telerik.Web.UI.EditorSplitButton.initializeBase(this,[_58]);
};
Telerik.Web.UI.EditorSplitButton.prototype={click:function(e){
var _5a=this.isArrowClicked(e.target);
if(_5a){
this.show();
}else{
var _5b=this.get_selectedItem();
if(null==_5b){
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(_5c){
var _5d=this._getArrowElement();
if(_5c==_5d){
return true;
}
return false;
},_getArrowElement:function(){
var _5e=this.getAnchorElement().getElementsByTagName("SPAN");
var _5f=_5e[_5e.length-1];
return _5f;
}};
Telerik.Web.UI.EditorSplitButton.registerClass("Telerik.Web.UI.EditorSplitButton",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorToolStrip=function(_60){
Telerik.Web.UI.EditorToolStrip.initializeBase(this,[_60]);
this._tools=[];
this._udpateHeader=true;
};
Telerik.Web.UI.EditorToolStrip.prototype={selectUIItem:function(e){
for(var i=0;i<this._items.length;i++){
var _63=this._items[i];
if(i==this._activeIndex&&_63.get_enabled()){
_63.setOn(true);
}else{
_63.setOn(false);
if(this.isIE){
var a=_63.getAnchorElement();
if(a){
var _65=a.cloneNode(true);
a.replaceNode(_65);
}
}
}
}
},set_selectedIndex:function(_66){
Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"set_selectedIndex",[_66]);
if(this.get_updateHeader()){
var _67=this.get_selectedItem();
if(!_67||!_67.getSpanElement){
return;
}
var _68=_67.getSpanElement();
if(_68){
var _69=_68.cloneNode(true);
var _6a=this.getSpanElement();
var _6b=_6a.parentNode;
_6b.replaceChild(_69,_6a);
var _6c=_67.getAnchorElement();
if(_6c){
_6b.setAttribute("title",_6c.getAttribute("title"));
}
}
}
},_onPopupClick:function(e){
var _6e=this._resolveSelectedTool(e);
this._cancelEvent(e);
if(_6e){
var _6f=Array.indexOf(this._items,_6e);
if($telerik.isSafari){
this._selectedIndex=_6f;
this.set_activeIndex(_6f);
}else{
this.set_selectedIndex(_6f);
}
this.hide();
this.raiseEvent("valueSelected");
}
},renderItemRoot:function(){
var _70=document.createElement("DIV");
_70.className="rade_tlbVertical";
_70.style.cssFloat="left";
_70.style.width="100%";
this._itemRootElement=_70;
return this._itemRootElement;
},renderChildren:function(){
var _71=this.get_itemsperrow();
var _72=this.get_tools();
var ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
for(var i=0;i<_72.length;i++){
if(_71>1&&i>1&&(i%this.get_itemsperrow()==0)){
ul=document.createElement("UL");
ul.className="rade_toolbar "+this.get_skin();
this._itemRootElement.appendChild(ul);
}
var _75=_72[i];
if(null==_75["showText"]){
_75["showText"]=true;
}
var _76=Telerik.Web.UI.EditorButton.createTool(_75,null,null,null,ul);
this._items[this._items.length]=_76;
}
},_resolveSelectedTool:function(e){
for(var i=0;i<this._items.length;i++){
var _79=this._items[i];
if(_79.isTarget(e)){
if(_79.get_enabled()){
return _79;
}else{
return null;
}
}
}
},get_tools:function(){
return this._tools;
},set_tools:function(_7a){
this._tools=_7a;
},get_updateHeader:function(){
return this._udpateHeader;
},set_updateHeader:function(_7b){
this._udpateHeader=_7b;
}};
$telerik.makeCompatible(Telerik.Web.UI.EditorToolStrip);
Telerik.Web.UI.EditorToolStrip.registerClass("Telerik.Web.UI.EditorToolStrip",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.EditorContextMenu=function(_7c){
Telerik.Web.UI.EditorContextMenu.initializeBase(this,[_7c]);
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 _7d=this._popupBehavior;
_7d.set_positioningMode(Telerik.Web.PositioningMode.Absolute);
var _7e=this.get_parentElement();
if(_7e){
_7d.set_parentElement(_7e);
}
var e=this._eventObject;
if(e){
_7d.set_x(e.clientX+10);
_7d.set_y(e.clientY+10);
}
},set_eventObject:function(_80){
this._eventObject=_80;
},get_tagName:function(){
return this._tagName;
},set_tagName:function(_81){
this._tagName=_81;
},get_parentElement:function(){
return this._parentElement;
},set_parentElement:function(_82){
this._parentElement=_82;
}};
$telerik.makeCompatible(Telerik.Web.UI.EditorContextMenu);
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(_1){
Telerik.Web.UI.Editor.AlignmentSelector.initializeBase(this,[_1]);
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(_2){
switch(_2.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(_3){
if(!this._rendered){
this.render();
}
var _4=this._itemRootElement;
var _5=0;
for(var i=0;i<_4.rows.length;i++){
var _7=false;
for(var j=0;j<_4.rows[i].cells.length;j++){
var _9=_4.rows[i].cells[j];
var _a=this._isAvailable(_5++);
_9.style.visibility=_a?"visible":"hidden";
_7|=_a;
}
if(null!=document.all){
_4.rows[i].style.display=_7?"":"none";
}
}
},_isAvailable:function(_b){
var _c=false;
if(this._items){
var _d=this._items[_b];
_c=((null!=_d)&&(""!=_d[0]||""!=_d[1]));
}
return _c;
},renderChild:function(_e,_f,_10){
var _11=document.createElement("div");
if(_f){
_11.innerHTML="&nbsp;";
_11.className=this._alignmentClassName[_10];
}
_e.appendChild(_11);
},_onDropDownValueSelected:function(){
this.set_selectedIndex(this.get_selectedIndex());
},_selectAlignment:function(_12,_13){
_12=(""==_12||!_12)?"none":_12.toUpperCase();
_13=!_13?"":_13.toUpperCase();
if(this._items){
var _14=-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==_14){
_14=i;
}
if((_12==ha||_12==va)&&(_13==ha||_13==va)){
this.set_selectedIndex(i);
return;
}
}
}
this.set_selectedIndex(_14);
}
},set_selectedIndex:function(_17){
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"set_selectedIndex",[_17]);
var _18=this.getSpanElement();
var _19=this._alignmentClassName[_17];
_18.className=_19;
},setTagName:function(_1a){
this._tagName=_1a;
this._items=this._getLookupTableByTagName(this._tagName);
this.set_selectedIndex(this._noAlignmentIndex);
},updateValue:function(_1b,_1c){
this._selectAlignment(_1b,_1c);
},getAlign:function(){
var _1d=this._items[this._selectedIndex];
var _1e=(_1d?_1d[0]:"");
if("none"==_1e){
_1e="";
}
return _1e;
},getVAlign:function(){
var _1f=this._items[this._selectedIndex];
var _20=(_1f?_1f[1]:"");
if("none"==_20){
_20="";
}
return _20;
},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(_21){
this._clientStateFieldID=_21;
}};
Telerik.Web.UI.Editor.AlignmentSelector.registerClass("Telerik.Web.UI.Editor.AlignmentSelector",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.InsertTableHelper=function(_22){
Telerik.Web.UI.Editor.InsertTableHelper.initializeBase(this,[_22]);
};
Telerik.Web.UI.Editor.InsertTableHelper.prototype={initialize:function(){
var _23=new Array(this.get_itemsperrow()*this.get_itemsperrow());
for(var i=0;i<_23.length;i++){
_23[i]=i;
}
this._items=_23;
},hide:function(){
},renderChild:function(_25,_26,_27){
var _28=document.createElement("div");
_28.innerHTML="&nbsp;";
_25.appendChild(_28);
var dim=this._getDimensionByIndex(_27);
_25.setAttribute("title"," "+dim.rows+" x "+dim.cols+" ");
},_getDimensionByIndex:function(_2a){
var _2b=0;
var _2c=0;
var _2d=this.get_itemsperrow();
for(var i=0;i<this._items.length;i++){
if(i%_2d==0){
_2b++;
_2c=0;
}
_2c++;
if(_2a==i){
break;
}
}
var obj={rows:_2b,cols:_2c};
return obj;
},get_selectedItem:function(){
var _30=this.get_selectedIndex();
return this._getDimensionByIndex(_30);
},selectUIItem:function(e,_32){
var _33=this._popupElement.getElementsByTagName("TD");
var len=_33.length;
var _35=this.get_activeIndex();
var dim=this._getDimensionByIndex(_35);
var _37=dim.cols;
for(var i=0;i<len;i++){
var _39=_33[i];
var _3a=_39.item_index;
if(_3a<=_35&&_39.cellIndex<_37){
_39.className="rade_itemOver";
}else{
_39.className="";
}
}
}};
$telerik.makeCompatible(Telerik.Web.UI.Editor.InsertTableHelper);
Telerik.Web.UI.Editor.InsertTableHelper.registerClass("Telerik.Web.UI.Editor.InsertTableHelper",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.Editor.InsertTable=function(_3b){
Telerik.Web.UI.Editor.InsertTable.initializeBase(this,[_3b]);
};
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 _3c=this.get_tools();
this._longTool=_3c[0];
Array.removeAt(_3c,0);
for(var i=0;i<_3c.length;i++){
_3c[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 _3f=this.getSpanElement();
_3f.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 _40={"skin":this.get_skin(),"itemsperrow":this._tableHelperItemsPerRow,"sizetofit":true};
var _41={"valueSelected":this._onTableHelperValueSelectedDelegate};
var _42=$create(Telerik.Web.UI.Editor.InsertTableHelper,_40,_41,null,document.createElement("DIV"));
_42.set_rootpopupclassname("");
this._tableHelper=_42;
_42.render();
var _43=_42.get_popupElement();
_43.style.display="";
_43.style.visibility="visible";
_43.style.position="";
_43.style.cssFloat="left";
var _44=this.get_popupElement();
_44.insertBefore(_43,_44.firstChild);
},renderChildren:function(){
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"renderChildren");
var _45=this._itemRootElement;
if(this._longTool){
var ul=document.createElement("UL");
_45.insertBefore(ul,_45.firstChild);
this._longTool["showText"]=true;
var _47=Telerik.Web.UI.EditorButton.createTool(this._longTool,null,null,null,ul);
_47.get_element().style.width="auto";
this._items[this._items.length]=_47;
}
}};
$telerik.makeCompatible(Telerik.Web.UI.Editor.InsertTable);
Telerik.Web.UI.Editor.InsertTable.registerClass("Telerik.Web.UI.Editor.InsertTable",Telerik.Web.UI.EditorToolStrip);
Telerik.Web.UI.Editor.ColorPicker=function(_48){
Telerik.Web.UI.Editor.ColorPicker.initializeBase(this,[_48]);
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 _49=this.get_selectedItem();
this.set_color(_49);
},set_color:function(_4a){
if(!_4a){
_4a="";
}
var _4b=this.getSpanElement();
_4b.style.borderBottom="0px";
_4b.style.height="";
if(_4a){
var _4c=_4b.offsetHeight;
if(_4c){
_4b.style.height=(_4c-3)+"px";
}
_4b.style.borderBottom="3px solid "+_4a;
}
this._color=_4a;
},get_color:function(){
return this._color;
},onPopupMouseOver:function(e){
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"onPopupMouseOver",[e]);
var _4e=this.get_activeIndex();
var _4f=this._items[_4e];
if(null==_4f){
return;
}
if(this._infoSpan1){
this._infoSpan1.innerHTML=_4f;
this._infoSpan1.style.backgroundColor=_4f;
}
if(this._infoSpan2){
this._infoSpan2.innerHTML=_4f;
this._infoSpan2.style.color=_4f;
}
},renderFooter:function(){
var _50=document.createElement("div");
_50.className="rade_ColorPickerFooter";
var _51=document.createElement("span");
_51.className="rade_DarkColor";
var _52=document.createElement("span");
_52.className="rade_LightColor";
_51.innerHTML=_52.innerHTML="&nbsp";
_50.appendChild(_51);
_50.appendChild(_52);
this.get_popupElement().appendChild(_50);
this._infoSpan1=_51;
this._infoSpan2=_52;
},renderChild:function(_53,_54,_55){
var _56=document.createElement("div");
if(null!=_54){
_56.style.backgroundColor=_54;
_56.setAttribute("title",_54);
_56.innerHTML="&nbsp;";
}
_53.appendChild(_56);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_57){
this._clientStateFieldID=_57;
}};
Telerik.Web.UI.Editor.ColorPicker.registerClass("Telerik.Web.UI.Editor.ColorPicker",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.UndoRedoDropDown=function(_58){
Telerik.Web.UI.Editor.UndoRedoDropDown.initializeBase(this,[_58]);
};
Telerik.Web.UI.Editor.UndoRedoDropDown.prototype={renderFooter:function(){
},get_selectedItem:function(){
var _59=Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"get_selectedItem");
if(!_59){
_59=1;
}
return _59;
},selectUIItem:function(e,_5b){
return Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"selectUIItem",[e,true]);
}};
$telerik.makeCompatible(Telerik.Web.UI.Editor.UndoRedoDropDown);
Telerik.Web.UI.Editor.UndoRedoDropDown.registerClass("Telerik.Web.UI.Editor.UndoRedoDropDown",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.ApplyClassDropDown=function(_5c){
Telerik.Web.UI.Editor.ApplyClassDropDown.initializeBase(this,[_5c]);
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 _5e="";
if(!tag){
_5e=this._cssClasses["notag"];
}else{
tag=tag.toLowerCase();
var res=this._cssClasses[tag];
_5e=res?res:this._cssClasses["unknown"];
}
var _60=document.createElement("span");
_60.innerHTML="&nbsp;"+tag;
_60.className=_5e;
return _60;
},_getClassTag:function(_61){
var str=_61&&_61.selectorText?_61.selectorText:"";
var _63=str.lastIndexOf(".");
if(_63==0){
return "ALL";
}
var _64=str.lastIndexOf(" ",_63);
return str.substring((_64+1),_63);
},_getClassCss:function(_65){
var re=this._cssClassRegex;
var _67="";
if(null!=_65.cssText){
_67=_65.cssText;
_67=_67.replace(re,"$1");
}else{
_67=_65.style.cssText;
}
return _67;
},_getDisplayName:function(_68){
if(!_68||!_68.selectorText){
return "";
}
var _69=_68.selectorText;
var _6a=_69.indexOf(".");
if(-1==_6a){
_6a=0;
}else{
_6a+=1;
}
var _6b=_69.indexOf(":");
if(-1==_6b){
_6b=_69.length;
}
return _69.substring(_6a,_6b);
},_getClassName:function(_6c){
var str=_6c&&_6c.selectorText?_6c.selectorText:"";
var _6e=str.lastIndexOf(".");
if(_6e==-1){
return "";
}
var _6f=str.indexOf(" ",_6e);
if(-1==_6f){
_6f=str.indexOf(":",_6e);
}
if(-1==_6f){
_6f=str.length;
}
return str.substring((_6e+1),_6f);
},_getChild:function(_70,_71,_72){
var _73=document.createElement("DIV");
if(_71.toLowerCase()=="a"){
_73=document.createElement("A");
_73.href="#";
_73.onmouseover="window.status = ''; return false;";
_73.onclick=new Function("return false;");
_73.style.cursor="default";
}
if(null!=_73.style.cssText){
_73.style.cssText=_70;
}
_73.setAttribute("style",_70);
_73.innerHTML=_72;
_73.style.visibility="visible";
_73.style.marginLeft="0px";
_73.style.overflowX="hidden";
_73.style.position="";
_73.style.cssFloat="";
_73.style.styleFloat="";
return _73;
},set_items:function(_74){
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"set_items",[_74]);
this._items.splice(0,0,["",{cssText:"",selectorText:"Clear Class"}]);
},renderChild:function(_75,_76,_77){
var _78=_76[1];
var _79=this._getClassTag(_78);
var _7a=this._getClassCss(_78);
var _7b=_76[2]?_76[2]:this._getDisplayName(_78);
_75.setAttribute("title",_78.selectorText);
var _7c=this._getClassIcon(_79);
_75.appendChild(_7c);
var div=this._getChild(_7a,_79,_7b);
_75.appendChild(div);
},get_clientStateFieldID:function(){
return this._clientStateFieldID;
},set_clientStateFieldID:function(_7e){
this._clientStateFieldID=_7e;
}};
Telerik.Web.UI.Editor.ApplyClassDropDown.registerClass("Telerik.Web.UI.Editor.ApplyClassDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontNameDropDown=function(_7f){
Telerik.Web.UI.Editor.FontNameDropDown.initializeBase(this,[_7f]);
};
Telerik.Web.UI.Editor.FontNameDropDown.prototype={updateValue:function(_80){
try{
if(!_80){
_80=this.get_text();
}
if(null==_80||"AZBY"==_80){
return;
}
var _81=this.getSpanElement();
if(_81){
this._value=(""+_80).replace(/\s+/ig,"&nbsp;");
_81.innerHTML=this._value;
}
}
catch(e){
}
},renderChildren:function(){
var _82=this._items;
if(_82&&_82[0]&&!(_82[0] instanceof Array)){
for(var i=0;i<_82.length;i++){
var _84=_82[i];
_82[i]=[_84,String.format("<span style='font:normal 13px {0};'>",_84)+_84+"</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(_85){
Telerik.Web.UI.Editor.FontSizeDropDown.initializeBase(this,[_85]);
};
Telerik.Web.UI.Editor.FontSizeDropDown.prototype={renderChildren:function(){
var _86=this._items;
if(_86&&_86[0]&&!(_86[0] instanceof Array)){
for(var i=0;i<_86.length;i++){
var _88=_86[i];
_86[i]=[_88,String.format("<font size={0}>",_88)+_88+"</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(_89){
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.initializeBase(this,[_89]);
};
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 _8c=this._items[i];
this._parseSubtree(_8c,this._itemRootElement);
}
},get_selectedItem:function(){
var _8d=this.FlatLinksArray[this.get_selectedIndex()];
return {innerHTML:_8d.name,href:_8d.href,target:_8d.target,title:_8d.toolTip};
},_parseSubtree:function(_8e,t){
var _90=this._linkCounter;
this.FlatLinksArray[_90]=_8e;
var li=document.createElement("LI");
t.appendChild(li);
var _92=_8e.childLinks&&_8e.childLinks.length;
var _93=document.createElement("SPAN");
_93.innerHTML="&nbsp;";
_93.className=_92?"rade_CustomLinksIcon rade_icon_plus":"rade_CustomLinksIcon rade_icon_empty";
if(_92){
function onclick(e){
var _95=Sys.UI.DomElement.containsCssClass(this,"rade_icon_plus");
var ul=this.parentNode.getElementsByTagName("UL")[0];
if(ul){
ul.style.display=_95?"":"none";
var _97=_95?"rade_icon_plus":"rade_icon_minus";
var _98=_95?"rade_icon_minus":"rade_icon_plus";
Sys.UI.DomElement.removeCssClass(this,_97);
Sys.UI.DomElement.addCssClass(this,_98);
}
return false;
}
$addHandler(_93,"click",onclick);
}
li.appendChild(_93);
var _99=null;
if(_8e.href){
_99=document.createElement("A");
_99.href="#";
_99.innerHTML=_8e.name;
li.appendChild(_99);
this.markItemContainer(_99,this._linkCounter);
}else{
_99=document.createElement("SPAN");
_99.innerHTML=_8e.name;
li.appendChild(_99);
}
this._linkCounter++;
if(_92){
var ul=document.createElement("UL");
li.appendChild(ul);
var _9b=_8e.childLinks;
for(var i=0;i<_8e.childLinks.length;i++){
var _9d=_9b[i];
this._parseSubtree(_9d,ul);
}
ul.style.display="none";
}
}};
$telerik.makeCompatible(Telerik.Web.UI.Editor.InsertCustomLinkDropDown);
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(_1,_2){
var _3=window.frames;
for(var i=0;i<_3.length;i++){
var _5=null;
try{
_5=_3[i].window.document;
}
catch(e){
}
if(!_5){
continue;
}
if(false!=_1){
_2.attachToDocument(_5);
}else{
_2.detachFromDocument(_5);
}
}
}
var _6=Function.createDelegate(null,function(e){
if(e.keyCode==27){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
});
$addHandler(document.body,"keydown",_6);
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",_6);
});
},attachToDocument:function(_8){
$telerik.addExternalHandler(_8,"mousedown",this._hideHandler);
},detachFromDocument:function(_9){
$telerik.removeExternalHandler(_9,"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 _c=this._activePopup.get_popupElement();
if(!this._isMouseOverElement(e,_c)){
this.hideActivePopup();
}
}
},_isMouseOverElement:function(e,_e){
var _f=null;
try{
_f=$telerik.getBounds(_e);
}
catch(e){
return false;
}
if(e&&e.target&&e.target.tagName=="SELECT"&&e.clientX<0){
return true;
}
var _10=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;
var x=e.clientX-2+_10.scrollLeft;
var y=e.clientY-2+_10.scrollTop;
return $telerik.containsPoint(_f,x,y);
},notifyPopupClosed:function(_13){
if(this._activePopup==_13){
this._activePopup=null;
}
},set_activePopup:function(_14){
if(this._activePopup&&(_14!=this._activePopup)){
this._activePopup.hide();
}
this._activePopup=_14;
},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(_1){
Telerik.Web.UI.Editor.DefaultToolAdapter.initializeBase(this,[_1]);
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 _2=this.get_editor();
var _3=this.get_element();
var _4=Telerik.Web.UI.EditorToolbarMode;
var _5=_2.get_toolbarMode();
if(_5!=_4.Default){
_3.style.visibility="hidden";
}
this._initToolbars();
if(_5!=_4.Default){
this._createWindowWrapper();
if(_5==_4.ShowOnFocus){
this._initShowOnFocus();
}else{
if(_5==_4.PageTop){
this._initPageTop();
}else{
if(_5==_4.Floating){
this._initFloating();
}
}
}
_3.style.visibility="visible";
}
},get_toolbarHolder:function(){
return this._toolbarHolder;
},_moveToolbarsToEditor:function(_6){
var _7=this.get_element();
if(!_6){
var _8=this.get_toolbarHolder();
if(!this._fakeToolbarParent){
var _9=_7.ownerDocument.createElement("DIV");
_9.control=_7.control;
_7.parentNode.appendChild(_9);
_7.control=null;
_9.style.display="none";
window.setTimeout(function(){
_8.set_contentElement(_7);
_7.style.display="";
},0);
this._fakeToolbarParent=_9;
}else{
_8.set_contentElement(_7);
}
_7.style.width="100%";
}else{
_7.style.width="";
var _a=this.get_editor().get_TopZone();
_a.appendChild(_7);
}
},_createWindowWrapper:function(){
if(!this._toolbarHolder){
var _b=this.get_editor();
var _c=_b.get_dialogOpener().get_container().clone(_b.get_id()+"_toolbarMode");
_c.set_visibleStatusbar(false);
var _d=this.get_element();
var _e=_d.offsetWidth;
_c.setSize(_e+10,"");
_c.add_show(function(_f,_10){
var _11=_f.get_contentElement();
if(!_11){
return;
}
_11.style.overflow="";
_11.style.height="";
var _12=_11.offsetWidth;
var _13=_11.offsetHeight;
_f.setSize(_12+10,"");
});
this._toolbarHolder=_c;
this._moveToolbarsToEditor(false);
}
return this._toolbarHolder;
},_createFloatingButton:function(){
this._onToggleFloatingToolbarDelegate=Function.createDelegate(this,this._onToggleFloatingToolbar);
var _14=this.get_editor();
var _15=_14.get_skin();
var _16={name:"ToggleFloatingToolbar",addClickHandler:true,skin:_15};
var _17={"valueSelected":this._onToggleFloatingToolbarDelegate};
var _18=Telerik.Web.UI.EditorButton.createTool(_16,_17);
var _19=Telerik.Web.UI.EditorButton.createToolWrapper(_18,_15);
var _1a=$get(_14.get_id()+"Top");
if(_1a){
_1a.appendChild(_19);
}
},_onToggleFloatingToolbar:function(){
var _1b=!this._toolbarHolder.isVisible();
this._showToolbarHolder(_1b);
},_positionToolbarAboveEditor:function(){
var wnd=this._toolbarHolder;
var _1d=this.get_editor();
var _1e=$telerik.getBounds(_1d.get_element());
var x=_1e.x;
var y=_1e.y-wnd.getWindowBounds().height;
wnd.moveTo(x,y);
},_positionOnPageTop:function(){
var wnd=this._toolbarHolder;
var _22=wnd._getViewportBounds();
var x=_22.scrollLeft;
var y=_22.scrollTop;
wnd.moveTo(x,y);
wnd.set_width(_22.width-10);
if(!wnd.isPinned()){
wnd.togglePin();
}
},_showToolbarHolder:function(_25){
if(!_25){
this._toolbarHolder.hide();
return;
}else{
if($telerik.isIE&&!this._editorIEFirstShow){
this._editorIEFirstShow=true;
return;
}
}
if(this.get_editor().isFullScreen()){
return;
}
var _26=Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper;
if(_26==this&&_26._toolbarHolder&&_26._toolbarHolder.isVisible()){
_26._toolbarHolder.setActive(true);
return;
}
if(_26&&_26._showToolbarHolder){
_26._showToolbarHolder(false);
}
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=this;
this._toolbarHolder.show();
var _27=this.get_editor();
var _28=Telerik.Web.UI.EditorToolbarMode;
var _29=_27.get_toolbarMode();
if(_29==_28.ShowOnFocus){
this._positionToolbarAboveEditor();
}else{
if(_29==_28.PageTop){
this._positionOnPageTop();
}else{
if(_29==_28.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 _2c=Telerik.Web.UI.WindowBehaviors;
wnd.set_behaviors(_2c.Resize);
wnd.set_visibleTitlebar(false);
this._initToolbarModeEvents();
},_initToolbarModeEvents:function(){
var _2d=this;
var _2e=function(){
_2d._showToolbarHolder(true);
};
var _2f=this.get_editor();
if(_2f.isIE){
this.get_editor().add_editReady(function(){
_2f.attachEventHandler("beforeeditfocus",_2e);
});
}else{
_2f.add_selectionChange(_2e);
}
_2f.add_modeChange(function(){
_2d._showToolbarHolder(_2d.get_editor().get_mode()==Telerik.Web.UI.EditModes.Design);
});
_2f.add_submit(function(){
_2d._showToolbarHolder(false);
});
_2f.add_toggleScreenMode(function(){
var _30=_2d.get_editor().isFullScreen();
_2d._moveToolbarsToEditor(_30);
var wnd=_2d.get_toolbarHolder();
if(_30){
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 _32=this.get_element();
var _33=_32.parentNode;
var _34=false;
if($telerik.isIE){
var _35=Telerik.Web.UI.Editor.Utils.getInvisibleParent(_33);
_34=(_35!=null);
if(_34){
_32.parentNode.removeChild(_32);
_32.style.position="absolute";
_32.style.top="-5000px";
_32.style.left="-5000px";
document.body.appendChild(_32);
}
}
var _36=this.get_toolJSON();
var _37=this._getToolBarElements();
var _38=[];
for(var i=0;i<_36.length;i++){
var _3a=_36[i];
var _3b=_37[i];
this._initializeToolbar(_3a,_3b);
var _3c=_3a["attributes"];
var _3d=_3c?_3c["dockingzone"]:null;
if(_3d){
_38[_38.length]=[_3d,_3b];
}
}
if(_34){
_32.style.position="";
_32.style.top="";
_32.style.left="";
_32.parentNode.removeChild(_32);
_33.appendChild(_32);
}
var _3e=this.get_editor();
if(_3e.get_toolbarMode()!=Telerik.Web.UI.EditorToolbarMode.Default){
return;
}
var _3f=_3e.get_id();
for(var i=0;i<_38.length;i++){
var _40=_38[i][0];
var _3d=_40.charAt(0).toUpperCase()+_40.substring(1);
var _41=$get(_3f+_3d);
if(!_41){
_41=$get(_40);
}
if(_41){
if(_41.innerHTML=="&nbsp;"){
_41.innerHTML="";
}
_41.appendChild(_38[i][1]);
}
}
},onContextMenu:function(e){
if(!this._contextMenusEnabled){
return;
}
var _43=this.get_editor();
if(_43.get_mode()!=Telerik.Web.UI.EditModes.Design){
return;
}
this.createContextMenus();
var _44=e.srcElement?e.srcElement:e.target;
var _45=_44.tagName;
var _46=this._contextMenus[_45];
if("TH"==_45&&!_46){
_46=this._contextMenus["TD"];
}
var _47="";
if(!_46){
var _48=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_44,"A");
if(!_48){
_48=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_44,"TD");
}
if(!_48){
_48=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_44,"TABLE");
}
if(_48){
_47=_48.tagName;
_44=_48;
}else{
_47="*";
}
_46=this._contextMenus[_47];
}
if(_46&&_45=="IMG"&&_44&&"true"==_44.getAttribute("isflash")){
_46=null;
}
if(!this.isIE&&_47=="*"){
return;
}
if(_46){
_46.set_eventObject(e);
_46.show();
}
return $telerik.cancelRawEvent(e);
},enableContextMenus:function(_49){
this._contextMenusEnabled=_49;
},_initContextMenus:function(){
var _4a=Function.createDelegate(this,this.onContextMenu);
var _4b=this.get_editor();
_4b.add_editReady(function(){
_4b.attachEventHandler("contextmenu",_4a);
});
},createContextMenus:function(){
if(this._contextMenus){
return;
}
this._contextMenus={};
var _4c=this.get_editor();
var _4d=_4c.get_skin();
var _4e=_4c.get_contextMenusJSON();
var _4f={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
for(var i=0;i<_4e.length;i++){
var _51=_4e[i];
_51["sizetofit"]=true;
_51["parentElement"]=_4c.get_contentAreaElement();
_51["skin"]=_4d;
var _52=$create(Telerik.Web.UI.EditorContextMenu,_51,_4f,null,document.createElement("SPAN"));
this._contextMenus[_51.tagName]=_52;
}
},dispose:function(){
var _53=this._getToolBarElements();
for(var i=0;i<_53.length;i++){
$clearHandlers(_53[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 _56=this._tools[0];
window.setTimeout(function(){
if(_56){
_56.setFocus();
}
},100);
return false;
},getContextMenuByTagName:function(_57){
this.createContextMenus();
return this._contextMenus[_57];
},getToolByName:function(_58){
for(var i=0;i<this._tools.length;i++){
var _5a=this._tools[i];
if(_5a&&_5a.get_name()==_58){
return _5a;
}
}
return null;
},setToolState:function(_5b,_5c){
if(!_5b){
_5b=this._tools;
}
var _5d=this.get_editor();
for(var i=0;i<_5b.length;i++){
var _5f=_5b[i];
var _60=_5f.get_name();
if(_5f.setState){
var _61=_5c;
if(null==_61){
_61=_5d.getToolState(_60);
}
if(null!=_61){
_5f.setState(_61);
}
}
if(_5f.updateValue){
_5f.updateValue(_5d.getToolValue(_60));
}
}
},_convertCommandsArray:function(_62){
var _63=[];
for(var i=0;i<_62.length;i++){
_63[i]=[i+1,_62[i].get_title()];
}
return _63;
},_onDropDownHide:function(_65,_66){
var _67=this.get_editor();
_67.enableContentArea(true);
},_onDropDownBeforeShow:function(_68,_69){
var _6a=this.get_editor();
if(Telerik.Web.UI.EditorToolStrip.isInstanceOfType(_68)){
this.setToolState(_68.get_items());
}
if(!_6a.getSelection().isControl()&&!Telerik.Web.UI.EditorContextMenu.isInstanceOfType(_68)){
_6a.enableContentArea(false);
}
var _6b=_68.get_name();
if(_6b=="Undo"){
var _6c=_6a.get_commandsManager().getCommandsToUndo();
_6c=this._convertCommandsArray(_6c);
_68.set_items(_6c);
}else{
if(_6b=="Redo"){
var _6d=_6a.get_commandsManager().getCommandsToRedo();
_6d=this._convertCommandsArray(_6d);
_68.set_items(_6d);
}else{
if(_6b=="ModuleManager"){
var _6e=_6a.get_modulesManager();
if(!_6e){
return;
}
var _6f=_6e.get_modules();
var _70=[];
for(var i=0;i<_6f.length;i++){
var _72=_6f[i];
var _73=_72.get_name();
var _74=_72.get_title();
if(!_74){
_74=_73;
}
cssClass=_72.get_visible()?"rade_module_visible_icon":"rade_module_hidden_icon";
_70[i]=[_73,_74,cssClass];
}
_68.set_items(_70);
}
}
}
var _75=_68.get_items();
if(_75&&_75.length>0){
return;
}
var _76=null;
switch(_6b){
case "ApplyClass":
_76=_6a.getCssArray();
break;
case "FontName":
_76=_6a.get_fontNames();
break;
case "FontSize":
_76=_6a.get_fontSizes();
break;
case "InsertSymbol":
_76=_6a.get_symbols();
break;
case "BackColor":
case "ForeColor":
_76=_6a.get_colors();
break;
case "RealFontSize":
_76=_6a.get_realFontSizes();
break;
case "InsertSnippet":
_76=_6a.get_snippets();
break;
case "Zoom":
_76=["10%","20%","50%","100%","150%","200%","300%","500%"];
break;
case "FormatBlock":
_76=_6a.get_paragraphs();
break;
case "InsertCustomLink":
_76=_6a.get_links();
break;
case "AjaxSpellCheck":
case "SpellCheck":
_76=_6a.get_languages();
break;
}
if(_76){
_68.set_items(_76);
}
},_initializeToolbar:function(_77,_78){
var _79=_78.getElementsByTagName("li");
var _7a=_77.tools;
var _7b=this.get_editor();
var _7c=_7b.get_skin();
var _7d=0;
if(_7a){
var _7e=0;
for(var i=0;i<_7a.length;i++){
var _80=_79[i+1];
_7e+=_80.offsetWidth;
var _81=Telerik.Web.UI.EditorButton;
var _82=_7a[i].type;
var _83=_7a[i].name;
var _84=Telerik.Web.UI.EditorToolType;
var _85=_7a[i];
var _86=null;
var _87=false;
if(_82){
switch(_82){
case _84.Button:
break;
case _84.Separator:
if(!_7d){
_7d+=parseInt($telerik.getCurrentStyle(_80,"marginLeft"));
_7d+=parseInt($telerik.getCurrentStyle(_80,"marginRight"));
}
_7e+=_7d;
_81=null;
break;
case _84.DropDown:
_81=Telerik.Web.UI.EditorDropDown;
_87=true;
if(_83=="FontName"){
_81=Telerik.Web.UI.Editor.FontNameDropDown;
}else{
if(_83=="FontSize"){
_81=Telerik.Web.UI.Editor.FontSizeDropDown;
}else{
if(_83=="FormatBlock"){
_81=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_83=="RealFontSize"){
_81=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_83=="Zoom"){
_81=Telerik.Web.UI.EditorUpdateableDropDown;
}else{
if(_83=="InsertCustomLink"){
_81=Telerik.Web.UI.Editor.InsertCustomLinkDropDown;
}else{
if(_83=="ApplyClass"){
_81=Telerik.Web.UI.Editor.ApplyClassDropDown;
}
}
}
}
}
}
}
break;
case _84.SplitButton:
_81=Telerik.Web.UI.EditorSplitButton;
if(_83=="ForeColor"||_83=="BackColor"){
_81=Telerik.Web.UI.Editor.ColorPicker;
}else{
if(_83=="Undo"||_83=="Redo"){
_81=Telerik.Web.UI.Editor.UndoRedoDropDown;
}
}
_87=true;
break;
case _84.ToolStrip:
if(_83=="InsertTable"){
_81=Telerik.Web.UI.Editor.InsertTable;
}else{
_81=Telerik.Web.UI.EditorToolStrip;
}
_87=true;
break;
case _84.Custom:
break;
}
}
if(_85.attributes){
for(var _88 in _85.attributes){
_85[_88.toLowerCase()]=_85.attributes[_88];
}
}
if(_81){
var _89=null;
if(_87){
_89={"valueSelected":this._onDropDownValueSelectedDelegate,"show":this._onDropDownBeforeShowDelegate,"hide":this._onDropDownHideDelegate};
_85["skin"]=_7c;
}
_86=$create(_81,_85,_89,null,_80);
}
if(_86){
Array.add(this._tools,_86);
var _8a=_86.get_shortCut();
if(_8a){
var _8b=_86.get_name();
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(_86)&&!(Telerik.Web.UI.EditorSplitButton.isInstanceOfType(_86))){
_8b="RadE_ToolAdapter_"+_8b;
Telerik.Web.UI.Editor.CommandList[_8b]=this._toolAdapterDropDownExpander;
}
_7b.setShortCut(_8b,_8a);
}
}
}
var ul=_78;
if(this.isIE&&ul&&_7e){
ul.style.width=(_7e+(_79[0].offsetWidth)*2)+"px";
}
if($telerik.isSafari){
ul.setAttribute("onmousedown","return false;");
}
$addHandlers(_78,{"click":this._onToolAdapterClickDelegate,"keydown":this._onToolAdapterKeyDownDelegate},this);
}
},_toolAdapterDropDownExpander:function(_8d,_8e){
var _8f=_8e.getToolByName(_8d.replace("RadE_ToolAdapter_",""));
_8f.setFocus();
_8f.show();
_8f.selectNextItem();
return false;
},_onEditorModeChange:function(_90,_91){
var _92=Telerik.Web.UI.EditModes;
var _93=_90.get_mode();
this._setEnabled((_93==_92.Design));
},_onEditorSelectionChange:function(_94,_95){
this.setToolState();
},_setEnabled:function(_96){
var _97=this._tools;
for(var i=0;i<_97.length;i++){
var _99=_97[i];
_99.set_enabled(_96);
}
},_registerEditorHandlers:function(){
var _9a=this.get_editor();
_9a.add_selectionChange(this._onEditorSelectionChangeDelegate);
_9a.add_modeChange(this._onEditorModeChangeDelegate);
},_onDropDownValueSelected:function(_9b,_9c){
var _9d=_9b.get_selectedItem();
if(Telerik.Web.UI.EditorButton.isInstanceOfType(_9d)){
this._raiseEditorEvent(_9d,null);
}else{
this._raiseEditorEvent(_9b,_9d);
}
},_onKeyDownHandler:function(e){
var _9f=e.keyCode;
if(9==_9f||37==_9f||39==_9f||121==_9f){
if(Telerik.Web.UI.Editor.PopupController){
Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}
}
if(121==_9f){
var _a0=this.get_editor();
window.setTimeout(function(){
if(_a0){
_a0.setFocus();
}
},100);
if(e.rawEvent){
$telerik.cancelRawEvent(e.rawEvent);
}
return $telerik.cancelRawEvent(e);
}
if(9==_9f){
return;
}
var _a1=this._getSelectedTool(e);
if(!Telerik.Web.UI.EditorButton.isInstanceOfType(_a1)){
return;
}
if(37==_9f||39==_9f){
var _a2=_a1;
while(true){
_a2=(37==_9f)?this._getPreviousTool(_a2):this._getNextTool(_a2);
if(null==_a2){
break;
}
if(_a2.get_enabled()){
break;
}
}
if(_a2&&_a2.get_enabled()){
_a2.setFocus();
}
}
if(13==_9f&&_a1&&!_a1.get_selectedItem){
this._raiseEditorEvent(_a1,null);
return;
}
if(!Telerik.Web.UI.EditorDropDown.isInstanceOfType(_a1)){
return;
}
if(38==_9f||40==_9f){
var _a3=false;
if(!_a1.isExpanded()){
_a1.show();
_a3=true;
}
if(_a3||40==_9f){
_a1.selectNextItem();
}else{
_a1.selectPreviousItem();
}
}else{
if(13==_9f){
_a1.hide();
if(_a1.get_activeIndex){
_a1.set_selectedIndex(_a1.get_activeIndex());
}
this._onDropDownValueSelected(_a1);
}else{
if(27==_9f){
_a1.hide();
}
}
}
},_onToolBarClick:function(e){
var _a5=this._getSelectedTool(e);
if(_a5){
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(_a5)){
_a5.click(e);
}else{
if(false){
}else{
this._raiseEditorEvent(_a5);
}
}
}
var _a6=this.get_editor();
if(_a6.get_mode()!=Telerik.Web.UI.EditModes.Design){
$telerik.cancelRawEvent(e);
}
},_raiseEditorEvent:function(_a7,_a8){
var _a9=this.get_events().getHandler("ToolClick");
if(_a9){
var _aa=_a7.get_name?_a7.get_name():"";
var _ab=new Telerik.Web.UI.EditorCommandEventArgs(_aa,_a7,_a8);
_a9(_a7,_ab);
}
},_getPreviousTool:function(_ac){
var _ad=Array.indexOf(this._tools,_ac);
return this._tools[_ad-1];
},_getNextTool:function(_ae){
var _af=Array.indexOf(this._tools,_ae);
return this._tools[_af+1];
},_getSelectedTool:function(e){
var _b1=Telerik.Web.UI.EditorButton.getToolRootNode(e.target);
if(null==_b1){
return;
}
var _b2=_b1.control;
if(null==_b2){
return;
}
if(_b2.get_enabled&&_b2.get_enabled()==false){
return;
}
if(e&&_b2){
e.preventDefault();
e.stopPropagation();
}
return _b2;
},_getToolBarElements:function(){
var _b3=this.get_element();
var _b4=_b3.getElementsByTagName("ul");
return _b4;
},get_toolbarHolder:function(){
return this._toolbarHolder;
},get_editor:function(){
return this._editor;
},set_editor:function(_b5){
if(this._editor!=_b5){
this._editor=_b5;
}
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_b6){
this._toolJSON=_b6;
},add_toolClick:function(_b7){
this.get_events().addHandler("ToolClick",_b7);
},remove_toolClick:function(_b8){
this.get_events().removeHandler("ToolClick",_b8);
}};
$telerik.makeCompatible(Telerik.Web.UI.Editor.DefaultToolAdapter);
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(_1,_2,_3){
function createSpellCheckEngine(){
if(!_2.get_ajaxSpellCheck()){
var _4={"editor":_2};
var _5=document.createElement("DIV");
var _6=$create(Telerik.Web.UI.Editor.AjaxSpellCheck,_4,null,null,_5);
var _7=_6.get_element();
var _8=$get(_2.get_id()+"Top");
if(_8){
_8.appendChild(_7);
}
_2.set_ajaxSpellCheck(_6);
}
var _9=_2.get_ajaxSpellCheck();
if(_3&&_3.value){
_9.set_language(_3.value);
}
_9.spellCheck();
}
if(typeof (Telerik.Web.UI.Editor.AjaxSpellCheck)=="undefined"){
function OnWebRequestCompleted(_a,_b){
var _c=_a.get_responseData();
Telerik.Web.UI.Editor.Utils.evalScriptCode(_c);
createSpellCheckEngine();
}
var _d=_2.get_ajaxSpellCheckScriptReference();
var _e=new Sys.Net.WebRequest();
_e.set_url(_d);
_e.set_httpVerb("GET");
_e.add_completed(OnWebRequestCompleted);
_e.invoke();
}else{
createSpellCheckEngine();
}
return false;
};
this.ModuleManager=function(_f,_10,_11){
var _12=_11.value;
var _13=_10.get_modulesManager();
if(!_13){
return false;
}
var _14=_13.getModuleByName(_12);
if(_14){
_14.toggleVisibility();
_10._updateEditorSize(null,true);
}
return false;
};
this.ToggleScreenMode=function(_15,_16,_17){
_16.toggleScreenMode();
return false;
};
this.InsertRowAbove=this.InsertRowBelow=function(_18,_19,_1a){
_19.executeCommand(new Telerik.Web.UI.Editor.TableInsertRow(_19.getLocalizedString(_18),null,_18=="InsertRowAbove"?"above":"below"));
};
this.InsertColumnLeft=this.InsertColumnRight=function(_1b,_1c,_1d){
_1c.executeCommand(new Telerik.Web.UI.Editor.TableInsertColumn(_1c.getLocalizedString(_1b),null,_1b=="InsertColumnLeft"?"left":"right"));
};
this.DeleteRow=function(_1e,_1f,_20){
_1f.executeCommand(new Telerik.Web.UI.Editor.TableDeleteRow(_1f.getLocalizedString(_1e)));
};
this.DeleteColumn=function(_21,_22,_23){
_22.executeCommand(new Telerik.Web.UI.Editor.TableDeleteColumn(_22.getLocalizedString(_21)));
};
this.DeleteCell=function(_24,_25,_26){
_25.executeCommand(new Telerik.Web.UI.Editor.TableDeleteCell(_25.getLocalizedString(_24)));
};
this.MergeColumns=function(_27,_28,_29){
_28.executeCommand(new Telerik.Web.UI.Editor.TableMergeColumns(_28.getLocalizedString(_27)));
};
this.MergeRows=function(_2a,_2b,_2c){
_2b.executeCommand(new Telerik.Web.UI.Editor.TableMergeRows(_2b.getLocalizedString(_2a)));
};
this.SplitCell=function(_2d,_2e,_2f){
_2e.executeCommand(new Telerik.Web.UI.Editor.TableSplitCell(_2e.getLocalizedString(_2d)));
};
this.DeleteTable=function(_30,_31,_32){
var _33=_32.value;
if(!_33){
_33=_31.getSelectedElement();
}
if(_33&&"TABLE"!=_33.tagName){
_33=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_33,"TABLE");
}
if(_33){
_31.selectElement(_33);
_31.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(_34,_35,_36){
var _37=_34.substring(10);
var _38=new Telerik.Web.UI.EditorCommandEventArgs(_34,_36.get_tool(),_37);
_35.fire("InsertFormElement",_38);
};
this.StripAll=this.StripCss=this.StripFont=this.StripSpan=this.StripWord=function(_39,_3a,_3b){
var _3c=_39.substring(5);
var _3d=new Telerik.Web.UI.EditorCommandEventArgs(_39,_3b.get_tool(),_3c.toUpperCase());
_3a.fire("FormatStripper",_3d);
};
this.FormatStripper=function(_3e,_3f,_40){
var _41=_40.value;
var _42="";
try{
_42=_3f.getSelectionHtml();
}
catch(e){
}
var _43=_3f.get_document().selection?_3f.get_document().selection:_3f.get_contentWindow().getSelection();
var _44=_43.type?_43.type.toLowerCase()=="none":_43.isCollapsed;
if(_44||_42==""||_3f.get_html()==_42){
var _45=Telerik.Web.UI.Editor.Utils.stripFormatting(_3f.get_html(),_41);
_3f.set_html(_45,_3f.getLocalizedString(_3e)+" "+_41);
}else{
if(_42!=null){
var _45=Telerik.Web.UI.Editor.Utils.stripFormatting(_42,_41);
_3f.pasteHtml(_45,_3e);
}
}
};
this.InsertTable=function(_46,_47,_48){
var _49=_48.value;
if(_49){
var _4a=Telerik.Web.UI.Editor.Utils.createTable(_49.rows,_49.cols);
var _4b=Telerik.Web.UI.Editor.Utils.getOuterHtml(_4a);
_47.pasteHtml(_4b,_46);
}
};
this.InsertTab=function(_4c,_4d,_4e){
var _4f=_4d.getSelectedElement();
if(_4f.tagName=="LI"){
_4d.fire("Indent");
}else{
_4d.pasteHtml(" &nbsp;&nbsp;&nbsp;&nbsp;",_4c);
}
return false;
};
this.SetToolFocus=function(_50,_51,_52){
var _53=_51.get_toolAdapter();
if(_53){
_53.setFocus();
}
return false;
};
this.ViewHtml=function(_54,_55,_56){
alert(_55.get_html(true));
return false;
};
this.Undo=this.Redo=function(_57,_58,_59){
var _5a=_59?_59.value:1;
if(!_5a){
_5a=1;
}
if(_57=="Redo"){
_58.redo(_5a);
}else{
_58.undo(_5a);
}
};
this.PastePlainText=function(_5b,_5c,_5d){
var _5e=function(_5f){
if(_5f){
var _60=_5f.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
_60=Telerik.Web.UI.Editor.Utils.replaceNewLineWithBr(_60);
if(_60){
_5c.pasteHtml(_60,_5b);
}
}
};
if(_5c.isIE){
_5e(window.clipboardData.getData("Text"));
}else{
var _61=function(_62,_63){
_5e(_63.get_content());
};
_5c.showDialog("CleanPasteTextContent",{},_61);
return false;
}
};
this.PasteFromWord=this.PasteFromWordNoFontsNoSizes=this.PasteAsHtml=function(_64,_65,_66){
var _67=function(_68,_69){
var _6a="";
if(_64=="PasteFromWord"){
_6a=Telerik.Web.UI.Editor.Utils.stripFormatting(_68,"WORD");
}else{
if(_64=="PasteFromWordNoFontsNoSizes"){
_6a=Telerik.Web.UI.Editor.Utils.stripFormatting(_68,"WORD_ALL");
}else{
_6a=Telerik.Web.UI.Editor.Utils.convertText2Html(_68);
}
}
if(_69){
_69.select();
}
if(_6a){
_65.pasteHtml(_6a,_64);
}
};
if(_65.isIE){
var _6b=_65.createRestorePoint();
var _6c=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
_67(_6c,_6b);
}else{
var _6d=function(_6e,_6f){
_67(_6f.get_content());
};
_65.showDialog("CleanPasteHtmlContent",{},_6d);
}
};
this.Copy=function(_70,_71,_72){
if(null!=_72){
var _73=window.opera?false:true;
if(_73){
try{
document.queryCommandEnabled(_70);
}
catch(e){
_73=false;
}
}
if(_73){
_71.get_document().execCommand(_70,false,null);
}else{
alert(_71.getLocalizedString("UseCtrlC"));
}
}
};
this.Cut=this.Paste=function(_74,_75,_76){
if(null!=_76){
var _77=window.opera?false:true;
if(_77){
try{
if(!_75.isIE7){
document.queryCommandEnabled(_74);
}
}
catch(e){
_77=false;
}
}
if(_74=="Paste"&&_77&&_75.isIE7){
_75.get_document().body.fireEvent("onbeforepaste");
}
if(_77){
var _78=new Telerik.Web.UI.Editor.GenericCommand(_75.getLocalizedString(_74),_75.get_contentWindow());
_75.get_document().execCommand(_74,false,null);
_75.executeCommand(_78);
}else{
var id=(_74=="Cut"?"UseCtrlX":"UseCtrlV");
alert(_75.getLocalizedString(id));
}
}else{
_75._pendingCutPasteCommand=new Telerik.Web.UI.Editor.GenericCommand(_75.getLocalizedString(_74),_75.get_contentWindow());
}
};
this.InsertParagraph=function(_7a,_7b,_7c){
_7b.executeBrowserCommand(_7a,true,"");
return true;
};
this.FormatBlock=function(_7d,_7e,_7f){
_7e.executeCommand(new Telerik.Web.UI.Editor.FormatBlockCommand(_7e.getLocalizedString(_7d),_7e.get_contentWindow(),_7f.value));
};
this.InsertOrderedList=this.InsertUnorderedList=function(_80,_81,_82){
_81.setFocus();
_81.executeCommand(new Telerik.Web.UI.Editor.InsertListCommand(_81.getLocalizedString(_80),_81.get_contentWindow(),_81.get_newLineBr(),_80,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(_83,_84,_85){
_84.setActive();
var _86="SelectAll"!=_83;
if(_83=="Unlink"&&!_84.isIE){
var _87=_84.getSelectedElement();
if(_87&&_87.tagName=="A"){
_84.selectElement(_87,false);
}
}
_84.executeBrowserCommand(_83,_86,null,null);
return true;
};
this.ForeColor=this.BackColor=this.FontName=this.FontSize=function(_88,_89,_8a){
var _8b=_8a.value;
_89.executeBrowserCommand(_88,true,_8b);
};
this.Zoom=function(_8c,_8d,_8e){
var _8f=_8e.value;
var _90=_8e.get_tool?_8e.get_tool():null;
if(_8f&&_90&&_90.updateValue){
_90.updateValue(_8f);
}
_8d._contentArea.style.zoom=_8f;
return false;
};
this.Print=function(_91,_92,_93){
if(_92.isIE){
_92.get_document().execCommand(_91,false,null);
}else{
if(_92.get_contentWindow().print){
_92.get_contentWindow().print();
}
}
return false;
};
this.InsertSnippet=function(_94,_95,_96){
_95.pasteHtml(_96.value,_94);
};
this.InsertFormElement=function(_97,_98,_99){
var _9a=_99.value;
_9a=_9a.toLowerCase();
var _9b=null;
switch(_9a){
case "form":
_9b=_98.createElement("form","150px","150px");
_9b.innerHTML="&nbsp;";
break;
case "textarea":
_9b=_98.createElement("textarea");
break;
case "select":
_9b=_98.createElement("select","100px","22px");
break;
case "checkbox":
case "radio":
_9b=_98.createElement("input");
_9b.setAttribute("type",_9a);
break;
case "button":
case "reset":
case "submit":
_9b=_98.createElement("input","50px","22px");
_9b.setAttribute("type",_9a);
break;
case "hidden":
case "password":
case "text":
_9b=_98.createElement("input","100px","22px");
_9b.setAttribute("type",_9a);
break;
}
if(_9b){
var id=Telerik.Web.UI.Editor.Utils.getUniqueID();
_9b.setAttribute("id",id);
var _9d=Telerik.Web.UI.Editor.Utils.getOuterHtml(_9b);
_98.pasteHtml(_9d,_97);
var _9e=_98.get_document().getElementById(id);
if(_9e){
_9e.removeAttribute("id");
if(_9e.setActive){
_9e.setActive();
}
return false;
}
}
};
this.InsertGroupbox=this.InsertDate=this.InsertTime=this.InsertSymbol=this.InsertHorizontalRule=function(_9f,_a0,_a1){
var _a2="";
switch(_9f){
case "InsertSymbol":
_a2=_a1.value;
break;
case "InsertHorizontalRule":
_a2="<hr>";
break;
case "InsertDate":
var now=new Date();
_a2="&nbsp;"+now.toLocaleDateString();
break;
case "InsertTime":
var now=new Date();
_a2="&nbsp;"+now.toLocaleTimeString();
break;
default:
_a2="<fieldset style='WIDTH: 200px; HEIGHT: 76px'> <legend>Title</legend>Content... </fieldset> ";
}
_a0.pasteHtml(_a2,_9f);
};
this.ImageManager=function(_a4,_a5,_a6){
var _a7=function(_a8,_a9){
_a5.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(_a9.Result),_a4);
};
var _aa=_a5.getSelectedElement();
if(_aa&&_aa.tagName.toLowerCase()=="img"){
_a5.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_aa.src);
}
_a5.showDialog("ImageManager",{},_a7);
_a5.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.FlashManager=function(_ab,_ac,_ad){
var _ae=function(_af,_b0){
var _b1=_ac._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _b2=_ac._filtersManager.getFilterByName("MozillaKeepFlashString");
var _b3=_b0.Result;
_b3=(_b1)?_b1.getDesignContent(_b3):_b3;
_b3=(_b2)?_b2.getDesignContent(_b3):_b3;
_ac.pasteHtml(_b3,_ab);
};
var _b4={};
var _b5=_ac.getSelectedElement();
if(_b5){
if($telerik.isIE&&_b5.object&&_b5.object.Movie){
var _b6=_b5.object.Movie;
_ac.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_b6);
_b4.selectedItemUrl=_b6;
_b4.selectedObject=_b5;
}
}
_ac.showDialog("FlashManager",_b4,_ae);
_ac.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.MediaManager=function(_b7,_b8,_b9){
var _ba=function(_bb,_bc){
var _bd=_b8._filtersManager.getFilterByName("IEKeepObjectParamsFilter");
var _be=_b8._filtersManager.getFilterByName("MozillaKeepFlashString");
var _bf=_bc.Result;
_bf=(_bd)?_bd.getDesignContent(_bf):_bf;
_bf=(_be)?_be.getDesignContent(_bf):_bf;
_b8.pasteHtml(_bf,_b7);
};
var _c0={};
var _c1=_b8.getSelectedElement();
if(_c1){
if($telerik.isIE&&_c1.object&&_c1.object.FileName){
var _c2=_c1.object.FileName;
_b8.get_dialogOpener().set_additionalQueryString("&PreselectedItemUrl="+_c2);
_c0.selectedItemUrl=_c2;
_c0.selectedObject=_c1;
}
}
_b8.showDialog("MediaManager",_c0,_ba);
_b8.get_dialogOpener().set_additionalQueryString("");
return false;
};
this.TemplateManager=function(_c3,_c4,_c5){
var _c6=function(_c7,_c8){
_c4.pasteHtml(_c8.Result,_c3);
};
_c4.showDialog("TemplateManager",{},_c6);
return false;
};
this.AboutDialog=function(_c9,_ca,_cb){
_ca.showDialog("AboutDialog");
return false;
};
this.Help=function(_cc,_cd,_ce){
_cd.showDialog("Help");
return false;
};
this.PageProperties=function(_cf,_d0,_d1){
var _d2=function(_d3,_d4){
};
var _d5={};
_d5.Editor=_d0;
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_d5,"BODY",_d0,_cf);
_d0.showDialog("PageProperties",_d5,_d2);
return false;
};
this.ImageMapDialog=function(_d6,_d7,_d8){
var _d9=Telerik.Web.UI.Editor.CommandList._getImageMapDialogArgument(_d7);
var _da=function(wnd,_dc){
Telerik.Web.UI.Editor.CommandList._setImageMapProperties(_d7,_dc);
return false;
};
_d7.showDialog("ImageMapDialog",_d9,_da);
return false;
};
this._setImageMapProperties=function(_dd,_de){
if(!_de){
return;
}
var _df=_dd.getSelectedElement();
var _e0;
if(_df&&_df.tagName=="IMG"){
_e0=_df;
if(_de.ImageSrc!=_e0.src){
_e0.src=_de.ImageSrc;
}
}else{
if(!_de.ImageSrc){
return;
}
_dd.pasteHtml("<img src=\""+_de.ImageSrc+"\" id = \"__tmp__\">");
_e0=_dd.get_document().getElementById("__tmp__");
_e0.removeAttribute("id");
if(document.all){
var _e1=_dd.get_document().body.createTextRange();
_e1.collapse();
_e1.moveToElementText(_e0);
_e1.select();
}
}
var _e2=document.createElement("SPAN");
_e2.innerHTML=_de.MapHtml;
var _e3=_e2.getElementsByTagName("map");
if(_e3.length==0){
return;
}
var _e4=_e3[0].innerHTML;
_e2=null;
if(!_e4){
_e0.removeAttribute("useMap");
return;
}
var _e5="";
var map=null;
var _e7=_e0.getAttribute("useMap");
if(_e7){
_e5=_e7.substr(1);
map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_dd,_e5);
}
if(map==null){
var _e8=new Date()-100;
var _e5="rade_img_map_"+_e8;
map=_dd.get_document().createElement("map");
map.id=_e5;
this._setNameAttribute(map,_e5);
map=_dd.get_document().body.appendChild(map);
_e0.setAttribute("useMap","#"+_e5);
_e0.setAttribute("border","0");
}
map.innerHTML=_e4;
};
this._setNameAttribute=function(_e9,_ea){
_e9.removeAttribute("name");
_e9.removeAttribute("NAME");
_e9.name=null;
_e9.name=_ea;
_e9["NAME"]=_ea;
};
this._getImageMapDialogArgument=function(_eb){
var _ec={};
_ec._editor=_eb;
var _ed=_eb.getSelectedElement();
if(_ed&&_ed.tagName=="IMG"){
_ec.ImageSrc=_ed.getAttribute("src",2);
_ec.ImageWidth=(_ed.style.width)?_ed.style.width:_ed.width;
_ec.ImageHeight=(_ed.style.height)?_ed.style.height:_ed.height;
if($telerik.isIE){
var _ee=_eb.get_document().body.createTextRange();
_ee.collapse();
_ee.moveToElementText(_ed);
_ee.select();
}
if(_ed.useMap){
var _ef=_ed.getAttribute("useMap").substr(1);
var map=Telerik.Web.UI.Editor.CommandList._getImageMapByName(_eb,_ef);
if(map!=null){
_ec.ImageMapHTML="<map name = \""+_ef+"\">"+map.innerHTML+"</map>";
}else{
_ec.ImageMapHTML="";
}
_ed.style.width=_ec.ImageWidth;
_ed.style.height=_ec.ImageHeight;
}
}
return _ec;
};
this._getImageMapByName=function(_f1,_f2){
var _f3=_f1.get_document();
var map=_f3.getElementById(_f2);
if(map!=null){
return map;
}
var _f5=_f3.getElementsByTagName("map");
for(var i=0;i<_f5.length;i++){
if(_f5[i].getAttribute("name")==_f2){
return _f5[i];
}
}
return null;
};
this.DocumentManager=function(_f7,_f8,_f9){
var _fa=[];
var _fb=function(_fc,_fd){
_f8.pasteHyperLink(_fd.Result,_f7);
};
var _fe=_f8.get_dialogOpener().get_additionalQueryString();
var _ff=_f8.getSelectedElement();
if(_ff&&_ff.tagName.toLowerCase()=="a"){
_f8.get_dialogOpener().set_additionalQueryString(_fe+"&PreselectedItemUrl="+_ff.href);
}
_f8.showDialog("DocumentManager",_fa,_fb);
_f8.get_dialogOpener().set_additionalQueryString(_fe);
return false;
};
this.TableWizard=function(_100,_101,_102){
var _103=Telerik.Web.UI.Editor.CommandList._getTableArgument(_101,null,true,false);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_103,"TABLE",_101,_100);
var _104=function(_105,args){
_101.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_100);
};
_101.showDialog("TableWizard",_103,_104);
return false;
};
this.SetTableProperties=function(_107,_108,_109){
var _10a=Telerik.Web.UI.Editor.CommandList._getTableArgument(_108,1,false,true);
if(!_10a){
alert(_108.getLocalizedString("tablewarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_10a,"TABLE",_108,_107);
var _10b=Telerik.Web.UI.Editor.CommandList._getParentTable(_108);
var _10c=function(_10d,args){
_108.selectElement(_10b);
_108.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_107);
};
_108.showDialog("TableWizard",_10a,_10c);
return false;
};
this.SetCellProperties=function(_10f,_110,_111){
var _112=Telerik.Web.UI.Editor.CommandList._getTableArgument(_110,2,false,true);
if(!_112){
alert(_110.getLocalizedString("cellwarning"));
return false;
}
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_112,"TABLE",_110,_10f);
var _113=Telerik.Web.UI.Editor.CommandList._getParentTable(_110);
var _114=function(_115,args){
_110.selectElement(_113);
_110.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.tableToModify),_10f);
};
_110.showDialog("TableWizard",_112,_114);
return false;
};
this.FindAndReplace=function(_117,_118,_119){
var _11a={};
_11a._editor=_118;
var _11b=function(_11c,args){
};
_118.showDialog("FindAndReplace",_11a,_11b);
return false;
};
this.StyleBuilder=function(_11e,_11f,_120){
var _121=_11f.getSelectedElement();
_121.Editor=_11f;
var _122=function(_123,args){
_11f.pasteHtml(String.format("<a href={0}>{1}</a> ",args.href,args.text));
};
_11f.showDialog("StyleBuilder",_121,_122);
return false;
};
this.XhtmlValidator=function(_125,_126,_127){
var _128=_126;
var _129=function(_12a,args){
};
_126.showDialog("XhtmlValidator",_128,_129);
return false;
};
this.TrackChangesDialog=function(_12c,_12d,_12e){
var _12f=_12d;
var _130=function(_131,args){
};
_12d.showDialog("TrackChangesDialog",_12f,_130);
};
this.InsertCustomLink=function(_133,_134,args){
var link=args.value;
var _137=String.format("<a href='{1}' title='{3}' target='{2}'>{0}</a>",link.innerHTML,link.href,link.target,link.title);
var _138=Telerik.Web.UI.Editor.CommandList._getParentLink(_134);
if(_138){
var _139=_138.cloneNode(true);
if(link.href){
_139.setAttribute("href",link.href);
}
if(link.target){
_139.setAttribute("target",link.target);
}
if(link.title){
_139.setAttribute("title",link.title);
}
if(!_139.innerHTML){
_139.innerHTML=link.innerHTML;
}
_137=Telerik.Web.UI.Editor.Utils.getOuterHtml(_139);
}
_134.pasteHtml(_137,_133);
};
this._getDialogArguments=function(_13a,_13b,_13c,_13d){
_13a.Colors=_13c.get_colors();
if("TD"==_13b||"TH"==_13b||"TABLE"==_13b){
_13a.CssClasses=_13c.getCssArray("TABLE");
_13a.CellCssClasses=_13c.getCssArray("TD");
}else{
if("A"==_13b||"BODY"==_13b||"IMG"==_13b){
_13a.CssClasses=_13c.getCssArray(_13b);
}
}
_13a.Editor=_13c;
};
this.SetLinkProperties=this.LinkManager=function(_13e,_13f,_140){
var _141=Telerik.Web.UI.Editor.CommandList._getLinkArgument(_13f);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_141,"A",_13f,_13e);
var _142=function(_143,args){
_13f.pasteHyperLink(args.realLink,_13e);
};
_13f.showDialog("LinkManager",_141,_142);
return false;
};
this.SetImageProperties=function(_145,_146,_147){
var _148={};
_148.Element=_146.getSelectedElement();
Telerik.Web.UI.Editor.CommandList._getDialogArguments(_148,"IMG",_146,_145);
var _149=function(_14a,args){
_146.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.Result),_145);
};
_146.showDialog("ImageProperties",_148,_149);
return false;
};
this.FormatCodeBlock=function(_14c,_14d,_14e){
var _14f={dirtyCode:_14d.getSelectionHtml()};
if(_14d.get_document().selection&&_14d.get_document().selection){
var _150=_14d.get_document().selection.type.toLowerCase();
if(_150=="control"||_150=="none"){
_14f.dirtyCode="";
}
}
var _151=function(_152,args){
_14d.pasteHtml(args.get_code(),_14c);
};
_14d.showDialog("FormatCodeBlock",_14f,_151);
return false;
};
this._getDocumentAnchors=function(_154){
var _155=_154.getElementsByTagName("A");
var _156=new Array();
for(var i=0;i<_155.length;i++){
if(_155[i].name){
_156[_156.length]=_155[i];
}
}
return _156;
};
this._getParentLink=function(_158){
_158.setFocus();
var _159=_158.getSelectedElement();
var _15a=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_159,"A");
if(_15a){
_158.selectElement(_15a);
}else{
var _15b="";
if(_159&&_159.tagName=="IMG"){
_15b=Telerik.Web.UI.Editor.Utils.getOuterHtml(_159);
}else{
_15b=_158.getSelection().getHtml();
}
_15a=_158.get_document().createElement("A");
try{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_15a,_15b);
}
catch(e){
_15a.innerHTML=Telerik.Web.UI.Editor.Utils.stripFormatting(_15b,"ALL");
}
}
return _15a;
};
this._getLinkArgument=function(_15c,_15d){
var _15e=Telerik.Web.UI.Editor.CommandList._getParentLink(_15c);
return {selectedTabIndex:_15d?_15d:0,realLink:_15e.cloneNode(true),showText:!Telerik.Web.UI.Editor.Utils.hasHtmlContent(_15e.innerHTML),documentAnchors:Telerik.Web.UI.Editor.CommandList._getDocumentAnchors(_15c.get_document())};
};
this._getParentTable=function(_15f){
_15f.setFocus();
var _160=_15f.getSelectedElement();
var _161=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_160,"TABLE");
return _161;
};
this._getParentCell=function(_162){
_162.setFocus();
var _163=_162.getSelectedElement();
var _164=Telerik.Web.UI.Editor.Utils.getElementParentByTag(_163,"TD");
return _164;
};
this._getTableArgument=function(_165,_166,_167,_168){
var _169;
var _16a=null;
if(_167){
_169=Telerik.Web.UI.Editor.Utils.createTable(2,2,_165._document);
}else{
_169=Telerik.Web.UI.Editor.CommandList._getParentTable(_165);
}
if(!_167&&!_169){
return null;
}
if(_168){
_16a=Telerik.Web.UI.Editor.CommandList._getParentCell(_165);
}
var _16b=_169.cloneNode(true);
var _16c=_169;
return {selectedTabIndex:_166?_166:0,cellToModify:_16a,tableToModify:_16b,originalTable:_16c,tableDocument:(_16b.document)?_16b.document:_165.get_document()};
};
this.EnterParagraphMozilla=function(_16d,_16e,args){
var _170=_16e.getSelectedElement();
if("LI"==_170.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_170,"LI")!=null){
_16e.bubbleKeyEventToBrowser();
return false;
}
var _171=_16e.get_contentWindow();
var oDoc=_171.document;
function checkParent(_173,_174){
_174[_174.length]=_173;
while(_173!=null&&_173.tagName!="P"){
if(_173.tagName=="TD"){
return null;
}
_173=_173.parentNode;
_174[_174.length]=_173;
}
return _173;
}
var _175=_171.getSelection();
var _176=_175.getRangeAt(0);
var _177=_176.cloneRange();
_176.deleteContents();
var _178=_176.startOffset;
var _179=_176.startContainer;
var _17a="";
var _17b=[];
var inP=checkParent(_179,_17b);
if(inP){
var _17d=(inP.innerHTML=="");
var _17e=_176.cloneRange();
_17e.setStart(inP,0);
_17e.setEnd(_179,_178);
var _17f=_17e.cloneContents();
var _180=_176.cloneRange();
_180.setStart(_179,_178);
if(inP.lastChild){
_180.setEndAfter(inP.lastChild);
}else{
_180.setEnd(inP,0);
}
var _181=_180.cloneContents();
_176.selectNode(inP);
_175.removeAllRanges();
_175.addRange(_176);
inP=inP.cloneNode(true);
inP.innerHTML="";
var _182=inP.cloneNode(true);
if(_17d){
_182.innerHTML="&nbsp;";
}else{
_182.appendChild(_17f);
}
endPar=inP.cloneNode(true);
endPar.appendChild(_181);
var newP=inP.cloneNode(true);
var _184=newP;
if(_17b.length>0){
for(var i=_17b.length;i>0;i--){
var _186=_17b[i];
var _187=_186&&_186.cloneNode?_186.cloneNode(false):null;
if(_187&&_187.tagName!="P"){
_184.appendChild(_187);
_184=_187;
}
}
}
_184.innerHTML="&nbsp;";
_184.setAttribute("id","radETempNode");
var _188=oDoc.createElement("div");
_188.appendChild(_182);
_188.appendChild(newP);
if(!_17d){
_188.appendChild(endPar);
}
_17a=_188.innerHTML;
}else{
_17a="<p id='radETempNode'>&nbsp;</p>";
}
_16e.pasteHtml(_17a,"Enter",false,false,false);
oP=oDoc.getElementById("radETempNode");
if(oP){
oP.removeAttribute("id",0);
var _175=_171.getSelection();
var _176=oDoc.createRange();
_176.selectNodeContents(oP);
_175.removeAllRanges();
_175.addRange(_176);
}
var ps=oDoc.getElementsByTagName("P");
for(var i=0;i<ps.length;i++){
var _18a=ps[i].innerHTML;
if(_18a==""||_18a.trim().toLowerCase()=="<br>"){
ps[i].parentNode.removeChild(ps[i]);
}
}
return false;
};
this.Enter=function(_18b,_18c,args){
var _18e=_18c.getSelectedElement();
if("LI"==_18e.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_18e,"LI")!=null){
_18c.bubbleKeyEventToBrowser();
return false;
}
try{
var _18f=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_18c.get_contentWindow());
var _190=_18c.get_document().selection.createRange();
if(_190.pasteHTML){
var tag=_18e.tagName;
if(tag.charAt(0)=="H"&&parseInt(tag.charAt(1))>0){
var _192=_190.duplicate();
_192.moveToElementText(_18e);
_18c.bubbleKeyEventToBrowser();
return false;
}
_190.pasteHTML("<br>");
_190.select();
_190.moveEnd("character",1);
_190.moveStart("character",1);
_190.collapse(false);
}else{
if(_190(0)){
_190.execCommand("Delete");
}
}
_18c.executeCommand(_18f);
}
catch(exc){
alert(exc.message);
}
return false;
};
this.ShiftEnter=function(_193,_194,args){
var _196=_194.getSelectedElement();
if("LI"==_196.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(_196,"LI")!=null){
var _197=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",_194.get_contentWindow());
var _198=_194.get_document().selection.createRange();
_198.pasteHTML("<br>");
_198.select();
_198.moveEnd("character",1);
_198.moveStart("character",1);
_198.collapse(false);
_194.executeCommand(_197);
return false;
}
_194.bubbleKeyEventToBrowser();
return false;
};
this.ToggleTableBorder=function(_199,_19a,args){
_19a.toggleEnhancedEdit();
return false;
};
this.RealFontSize=function(_19c,_19d,args){
var _19f=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_19d);
var _1a0=_19f.markedElements;
var _1a1=_19d.createRestorePoint();
var _1a2=new Telerik.Web.UI.Editor.GenericCommand(_19d.getLocalizedString(_19c),_19d.get_contentWindow());
if(_1a0.length==0){
var _1a3=_19d.getSelection().getParentElement();
if($telerik.isIE&&!_19d.getSelection().getHtml()&&(_1a3.tagName=="FONT"||_1a3.tagName=="SPAN")){
_19d._document.execCommand("RemoveFormat",null,false);
}
_19d.pasteHtml("<font style='font-size:"+args.value+"' id='radERealFont'>&nbsp;</font>",_19c);
var _1a4=_19d._document.getElementById("radERealFont");
_1a4.removeAttribute("id");
if($telerik.isIE){
_19d.selectElement(_1a4);
_19d.getSelection().collapse();
_1a4.innerHTML="";
}else{
if(_19d._contentWindow.getSelection){
var oSel=_19d._contentWindow.getSelection();
var _1a6=_19d.getSelection().getRange();
oSel.removeAllRanges();
if(_1a6&&_1a6.selectNodeContents){
_1a6.selectNodeContents(_1a4);
}
oSel.addRange(_1a6);
}
}
}else{
for(var i=0;i<_1a0.length;i++){
_1a0[i].style.fontSize=args.value;
_1a0[i].removeAttribute("size");
}
if(_1a1){
_1a1.select();
}
_19d.executeCommand(_1a2);
}
};
this.ConvertToUpper=this.ConvertToLower=function(_1a8,_1a9,args){
var _1ab;
var endR;
if($telerik.isIE){
if(_1a9._document.selection.type.toLowerCase()=="control"){
return;
}
var _1ad=_1a9._document.selection.createRange();
_1ab=_1ad.duplicate();
endR=_1ad.duplicate();
_1ab.collapse();
endR.collapse(false);
}
var _1ae=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_1a9);
var _1af=_1ae.markedElements;
var _1b0=_1ae.newElements;
var _1b1=new Telerik.Web.UI.Editor.GenericCommand(_1a9.getLocalizedString(_1a8),_1a9.get_contentWindow());
for(var i=0;i<_1af.length;i++){
changeChildNodesCase(_1af[i]);
}
for(var i=0;i<_1b0.length;i++){
if($telerik.isIE){
_1b0[i].removeNode(false);
}else{
var _1b3=document.createRange();
_1b3.selectNodeContents(_1b0[i]);
_1b0[i].parentNode.replaceChild(_1b3.extractContents(),_1b0[i]);
}
}
if($telerik.isIE){
var _1b4=_1a9._document.selection.createRange();
_1b4.setEndPoint("StartToStart",_1ab);
_1b4.setEndPoint("EndToEnd",endR);
_1b4.select();
}else{
var _1b5=_1a9.get_contentWindow().getSelection();
var rng=_1b5.getRangeAt(0);
rng.collapse(true);
}
_1a9.executeCommand(_1b1);
function changeChildNodesCase(_1b7){
var _1b8=_1b7.childNodes;
for(var i=0;i<_1b8.length;i++){
if(_1b8[i].nodeType==3){
_1b8[i].nodeValue=("ConvertToLower"==_1a8)?_1b8[i].nodeValue.toLowerCase():_1b8[i].nodeValue.toUpperCase();
}else{
if(_1b8[i].nodeType==1&&_1b8[i].tagName.toUpperCase()!="FONT"){
changeChildNodesCase(_1b8[i]);
}
}
}
}
};
this.ApplyClass=function(_1ba,_1bb,args){
var _1bd=args.value;
var _1be=_1bb.get_document();
var _1bf=_1bb.createRestorePoint();
var _1c0=new Telerik.Web.UI.Editor.GenericCommand(_1bb.getLocalizedString(_1ba),_1bb.get_contentWindow());
if(_1bb.isIE){
var _1c1=_1be.selection.createRange();
var _1c2=(_1c1.length>0?_1c1(0):_1c1.parentElement());
if(_1c2.tagName=="LI"){
var _1c3=_1c1.htmlText;
var _1c4=_1c3.match(/<LI\/?>/gi);
var _1c5=_1c4?_1c4.length:0;
if(_1c5>1){
_1c2=_1c2.parentNode;
}else{
if(_1c5==0&&(Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_1c2,_1c1.htmlText))&&_1c2.parentNode.childNodes.length==1){
_1c2=_1c2.parentNode;
}
}
}
if(_1c1.length>0||_1c2.tagName=="OL"||_1c2.tagName=="UL"){
_1c2.className=_1bd;
return;
}
}
var _1c6=Telerik.Web.UI.Editor.CommandList._markEditorSelection(_1bb);
var _1c7=_1c6.markedElements;
if(_1c7.length==0){
var _1c8=_1bb.getSelection().getParentElement();
if($telerik.isIE&&!_1bb.getSelection().getHtml()&&(_1c8.tagName=="FONT"||_1c8.tagName=="SPAN")){
_1bb._document.execCommand("RemoveFormat",null,false);
}
_1bb.pasteHtml("<font class='"+_1bd+"' id='radERealFont'>&nbsp;</font>",_1ba);
var _1c9=_1bb._document.getElementById("radERealFont");
_1c9.removeAttribute("id");
if($telerik.isIE){
_1bb.selectElement(_1c9);
_1bb.getSelection().collapse();
_1c9.innerHTML="";
}else{
if(_1bb._contentWindow.getSelection){
var oSel=_1bb._contentWindow.getSelection();
var _1cb=_1bb.getSelection().getRange();
oSel.removeAllRanges();
if(_1cb&&_1cb.selectNodeContents){
_1cb.selectNodeContents(_1c9);
}
oSel.addRange(_1cb);
}
}
}else{
for(var i=0;i<_1c7.length;i++){
_1c7[i].className=_1bd;
}
if(_1bf){
_1bf.select();
}
_1bb.executeCommand(_1c0);
}
};
this._markEditorSelection=function(_1cd){
if(_1cd.get_html()==""){
return {markedElements:[],newElements:[]};
}
var _1ce="AZBY";
var _1cf="_cm";
var _1d0=[];
var _1d1=[];
var _1d2=[];
var _1d3=$telerik.isSafari?"span":"font";
var _1d4=_1cd._contentArea;
var _1d5=_1cd.getSelection();
if(_1d5.isControl()){
var _1d6=_1d5.getParentElement();
var _1d7=_1cd._document.createElement(_1d3);
_1d7.appendChild(_1d6.cloneNode(true));
_1d6.parentNode.replaceChild(_1d7,_1d6);
return {markedElements:[_1d7],newElements:[_1d7]};
}
if(!$telerik.isSafari){
keepFontNames();
}
if(!$telerik.isIE){
_1d4.ownerDocument.execCommand("UseCSS",false,true);
}
_1d4.ownerDocument.execCommand("FontName",false,_1ce);
var _1d8=_1d4.getElementsByTagName(_1d3);
for(var i=0;i<_1d8.length;i++){
var _1d7=_1d8[i];
if(_1d7.getAttribute("face")==_1ce||_1d7.style.fontFamily==_1ce){
_1d7.removeAttribute("face");
if(_1d7.style.fontFamily==_1ce){
_1d7.style.fontFamily="";
}
_1d1.push(_1d7);
var _1da=_1d7.getElementsByTagName(_1d3);
for(var j=0;j<_1da.length;j++){
var _o=_1da[j];
if(_o.getAttribute("face")!=_1ce){
_1d1.push(_o);
}
}
if(!_1d7.getAttribute(_1cf)){
_1d2.push(_1d7);
}
}
_1d7.removeAttribute(_1cf);
}
if(!$telerik.isSafari){
restoreFontNames();
}
if(!$telerik.isIE){
_1d4.ownerDocument.execCommand("UseCSS",false,false);
}
function keepFontNames(){
var _1dd=_1cd._contentArea.getElementsByTagName(_1d3);
for(var i=0;i<_1dd.length;i++){
var _1df=_1dd[i];
if(_1dd[i].face){
_1df.setAttribute("_face",_1df.face);
_1d0.push(_1df);
}
_1df.setAttribute(_1cf,1);
}
}
function restoreFontNames(){
for(var i=0;i<_1d0.length;i++){
_1d0[i].face=_1d0[i].getAttribute("_face");
_1d0[i].removeAttribute("_face");
}
_1d0=[];
}
return {markedElements:_1d1,newElements:_1d2};
};
})();
if(typeof (RadEditorCommandList)=="undefined"){
var RadEditorCommandList=Telerik.Web.UI.Editor.CommandList;
};Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandsManager=function(_1){
this._commands=[];
this._currentCommandIndex=-1;
};
Telerik.Web.UI.Editor.CommandsManager.prototype={get_commands:function(){
return this._commands;
},execute:function(_2,_3){
if(_2&&_2.execute){
var _4=_2.execute();
if(false==_3){
return false;
}
if(_4&&_2._canUnexecute){
this._clearCommandsToRedo();
Array.add(this._commands,_2);
this._currentCommandIndex=this._commands.length-1;
return true;
}
}
return false;
},undo:function(_5){
if(_5>this._commands.length){
_5=this._commands.length;
}
var _6=0;
var _7=null;
while(0<_5--&&0<=this._currentCommandIndex&&this._currentCommandIndex<this._commands.length){
_7=this._commands[this._currentCommandIndex--];
if(_7){
_7.unexecute();
_6++;
}
}
},redo:function(_8){
if(_8>this._commands.length){
_8=this._commands.length;
}
var _9=0;
var _a=null;
var _b=this._currentCommandIndex+1;
while(0<_8--&&0<=_b&&_b<this._commands.length){
_a=this._commands[_b];
if(_a){
_a.execute();
this._currentCommandIndex=_b;
_9++;
}
_b++;
}
},removeCommandAt:function(_c){
this._commands.splice(_c,1);
if(this._currentCommandIndex>=_c){
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 _d=this._commands[this._currentCommandIndex].clone();
this.execute(_d);
}
},_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={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(_1){
return _1;
},getDesignContent:function(_2){
return _2;
},get_isDom:function(){
return this.IsDom;
},set_isDom:function(_3){
this.IsDom=_3;
},get_enabled:function(){
return this.Enabled;
},set_enabled:function(_4){
this.Enabled=_4;
},get_name:function(){
return this.Name;
},set_name:function(_5){
this.Name=_5;
},get_description:function(){
return this.Description;
},set_description:function(_6){
this.Description=_6;
}};
$telerik.makeCompatible(Telerik.Web.UI.Editor.Filter);
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(_7){
return this._performStripping(_7);
},getDesignContent:function(_8){
return this._performStripping(_8);
},_performStripping:function(_9){
var _a=_9.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
_a=_a.replace(RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
return _a;
}};
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(_b){
var _c=new RegExp("<!"+"--RADEDITORSAVEDTAG_([\\s\\S]*?)--"+">","ig");
var _d=new RegExp("--RADEDITORSAVEDTAGENDING>","ig");
var _e=_b.replace(_c,"<$1>");
_e=_e.replace(_d,"--"+">");
return _e;
},getDesignContent:function(_f){
var _10=function(_11,_12,_13,_14,_15){
var _16=_15.substring(0,_14).lastIndexOf("<!"+"--");
var _17=_15.substring(0,_14).lastIndexOf("--"+">");
if(_16>_17){
_16=_15.substring(_14,_15.length).indexOf("<!"+"--");
_17=_15.substring(_14,_15.length).indexOf("--"+">");
if((_16==-1&&_17>-1)||(_17<_16)){
return _11;
}
}
var _18=_13.replace("--"+">","--RADEDITORSAVEDTAGENDING>");
var _19="<!"+"--RADEDITORSAVEDTAG_"+_12+_18+"--"+">";
return _19;
};
var _1a=new RegExp("<(script|noscript)([\\s\\S]*?<\\/\\1)>","ig");
var _1b=_f.replace(_1a,_10);
return _1b;
}};
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(_1c){
return this._performStripping(_1c);
},_performStripping:function(_1d){
var _1e=_1d;
_1e=_1e.replace(/<BR\s?\/?>\s*<\/(H1|H2|H3|H4|H5|H6|LI|P)/ig,"</$1");
_1e=_1e.replace(/<(H1|H2|H3|H4|H5|H6|LI|P)([^>]*)?><BR\s?\/?>/ig,"<$1 $2>");
return _1e;
}};
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(_1f,_20){
var _21=_1f.getElementsByTagName(_20);
if(!_21){
_21=_1f.ownerDocument.getElementsByTagName(_20);
}
return _21;
},fixLists:function(_22,_23){
var _24=this._getElements(_22,_23);
for(var i=_24.length-1;i>=0;i--){
var _26=_24[i];
var _27=_26.previousSibling;
if(_27&&_27.nodeType==3){
_27=_27.previousSibling;
}
if(_27&&"li"==_26.previousSibling.nodeName.toLowerCase()){
_27.appendChild(_26.cloneNode(true));
var _28=_26.parentNode;
_28.removeChild(_26);
_28=null;
}
}
},getHtmlContent:function(_29){
this.fixLists(_29,"OL");
this.fixLists(_29,"UL");
return _29;
}};
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(_2a,_2b){
var _2c=_2a.getElementsByTagName(_2b);
if(!_2c){
_2c=_2a.ownerDocument.getElementsByTagName(_2b);
}
return _2c;
},_replaceElementWithSpan:function(_2d,_2e,_2f){
var _30=this._getElements(_2d,_2e);
while(_30.length>0){
var _31=_2d.ownerDocument.createElement("span");
_31.style.cssText=_2f;
var _32=_30[0].innerHTML;
if($telerik.isIE&&_32==" "){
_31.innerText=_32;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_31,_32);
}
_30[0].parentNode.replaceChild(_31,_30[0]);
_30=this._getElements(_2d,_2e);
}
},_replaceSpanWithElement:function(_33,_34,_35){
var _36=this._getElements(_33,"span");
var _37=_36.length-1;
while(_37>=0){
var _38=[];
var _39=_36[_37];
for(var i=0;i<_39.childNodes.length;i++){
Array.add(_38,_39.childNodes[i].cloneNode(true));
}
if(_39.style.cssText.toLowerCase()==_35||_39.style.cssText.toLowerCase()==(_35+";")){
var _3b=_33.ownerDocument.createElement(_34);
for(var j=0;j<_38.length;j++){
_3b.appendChild(_38[j]);
}
_39.parentNode.replaceChild(_3b,_36[_37]);
_36=this._getElements(_33,"span");
_37=_36.length-1;
}else{
_37--;
}
}
},getHtmlContent:function(_3d){
this._replaceElementWithSpan(_3d,"u","text-decoration:underline;");
return _3d;
},getDesignContent:function(_3e){
this._replaceSpanWithElement(_3e,"u","text-decoration: underline");
return _3e;
}};
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(_3f){
var _40=new RegExp("<!"+"--RADEDITORSAVEDCOMMENT","ig");
var _41=_3f.replace(_40,"<!--");
return _41;
},getDesignContent:function(_42){
var _43=new RegExp("<!"+"--(\\[[^]]+\\][\\s\\S]*?)-"+"->","ig");
var _44=_42.replace(_43,"<!-"+"-RADEDITORSAVEDCOMMENT$1-"+"->");
return _44;
}};
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(_45){
var _46=new RegExp("<param([\\s\\S]+?)?>","ig");
var _47=new RegExp("<rade_param([\\s>])","ig");
var _48=_45;
if(_46.test(_45)&&_47.test(_45)){
_48=_48.replace(_46,"");
}
_48=_48.replace(_47,"<param$1");
_48=_48.replace(/<\/rade_param>/gi,"");
return _48;
},getDesignContent:function(_49){
var _4a=new RegExp("<param([\\s\\S]+?)/?>","ig");
var _4b=_49.replace(_4a,"<rade_param$1></rade_param><param$1>");
return _4b;
}};
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(_4c){
var _4d=[];
var _4e=_4c.parentNode;
if(_4e!=null){
for(var i=0;i<_4c.childNodes.length;i++){
Array.add(_4d,_4c.childNodes[i].cloneNode(true));
}
for(var i=0;i<_4d.length;i++){
_4e.insertBefore(_4d[i],_4c);
}
_4e.removeChild(_4c);
return _4e;
}
return true;
},getHtmlContent:function(_50){
var _51=null;
if(_50.tagName.toLowerCase()=="html"){
_51=_50.getElementsByTagName("BODY")[0];
}else{
_51=_50;
}
if($telerik.isIE){
if(_51&&(_51.firstChild)&&("P"==_51.firstChild.tagName)&&(_51.childNodes.length==1)&&(_51.innerHTML.substring(0,3).toLowerCase()=="<p>")){
this._removeNode(_51.firstChild);
}
}else{
if(_51&&(_51.childNodes.length==1)&&(_51.firstChild.tagName)&&("br"==_51.firstChild.tagName.toLowerCase())){
_51.innerHTML="";
}
}
return _50;
}};
Telerik.Web.UI.Editor.FixEnclosingP.registerClass("Telerik.Web.UI.Editor.FixEnclosingP",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(_52){
var _53=document.location.href;
var re=new RegExp("(<A[^<>]*?(href)\\s*=\\s*['\"])("+_53+")(\\#[^'\"]*?['\"][^>]*?>)","ig");
var _55=_52.replace(re,"$1$4");
return _55;
}};
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(_56){
var _57=_56.replace(new RegExp("<b(\\s([^>])*?)?>","ig"),"<strong$1>");
_57=_57.replace(new RegExp("</b(\\s([^>])*?)?>","ig"),"</strong$1>");
_57=_57.replace(new RegExp("<i(\\s([^>])*?)?>","ig"),"<em$1>");
_57=_57.replace(new RegExp("</i(\\s([^>])*?)?>","ig"),"</em$1>");
return _57;
},getDesignContent:function(_58){
var _59=_58.replace(new RegExp("<strong(\\s([^>])*?)?>","ig"),"<b$1>");
_59=_59.replace(new RegExp("</strong(\\s([^>])*?)?>","ig"),"</b$1>");
_59=_59.replace(new RegExp("<em(\\s([^>])*?)?>","ig"),"<i$1>");
_59=_59.replace(new RegExp("</em(\\s([^>])*?)?>","ig"),"</i$1>");
return _59;
}};
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(_5a){
var _5b=this;
var _5c=function(_5d,_5e,_5f,_60,_61){
var _62=_61.indexOf("</head>",_60);
if(_62!=-1&&_61.indexOf("<body",_62)!=-1){
return _5d;
}else{
_5b.markerCounter++;
var _63="RadEditorStyleKeeper"+_5b.markerCounter;
var _64="<div id='"+_63+"' style='display:none;'>&nbsp;</div><"+_5e+" reoriginalpositionmarker='"+_63+"'"+_5f;
return _64;
}
};
var _65=new RegExp("<(link|style)([^>]*>)","gi");
var _66=_5a.replace(_65,_5c);
return _66;
}};
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(_67){
var _68=_67.getElementsByTagName("HEAD")[0];
var _69=true;
if(!_68){
_68=_67.ownerDocument.getElementsByTagName("HEAD")[0];
_69=false;
}
if(!_68){
return _67;
}
this._restoreElements(_68,_67,"STYLE");
this._restoreElements(_68,_67,"LINK");
var _6a=_67.getElementsByTagName("DIV");
if(_6a){
for(var j=_6a.length-1;j>=0;j--){
var _6c=_6a[j];
if(_6c.id.indexOf("RadEditorStyleKeeper")==0){
var _6d=_6c.parentNode;
_6d.removeChild(_6c);
}
}
}
_6a=null;
if(_69){
this._removeElements(_68,"STYLE");
this._removeElements(_68,"LINK");
}
this._removeMarkerAttributes(_67,"STYLE");
this._removeMarkerAttributes(_67,"LINK");
return _67;
},_restoreElements:function(_6e,_6f,_70){
var _71;
_71=_6e.getElementsByTagName(_70);
this._divs=_6f.getElementsByTagName("DIV");
var i=0;
while(_71.length>0&&i<_71.length){
this._restoreStyle(_71[i++]);
}
},_restoreStyle:function(_73){
var _74=_73.getAttribute("reoriginalpositionmarker");
if(_74){
j=0;
var _75=null;
while(j<this._divs.length&&!_75){
if(this._divs[j].id==_74){
_75=this._divs[j];
}
j++;
}
if(_75){
var _76=_73.cloneNode(true);
_76.removeAttribute("reoriginalpositionmarker");
var _77=_75.parentNode;
_77.replaceChild(_76,_75);
return true;
}
}
return false;
},_removeElements:function(_78,_79){
var _7a=_78.getElementsByTagName(_79);
if(_7a){
for(var j=_7a.length-1;j>=0;j--){
var _7c=_7a[j];
if(null!=_7c.getAttribute("reoriginalpositionmarker")){
var _7d=_7c.parentNode;
_7d.removeChild(_7c);
}
}
_7a=null;
}
},_removeMarkerAttributes:function(_7e,_7f){
styles=_7e.getElementsByTagName(_7f);
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(_81){
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=_81?_81:"FlashManager.gif";
};
Telerik.Web.UI.Editor.MozillaKeepFlashString.prototype={getDesignContent:function(_82){
var _83=this;
var _84=function(_85,gr1,gr2,gr3,str,_8a){
var _8b=String.format("<img isflash=\"true\" {0} />{1}",gr1,gr2);
_8b=_8b.replace(/\ssrc=/gi,String.format(" src=\"{0}\" flashSrc=",_83._flashImageSrc));
return _8b;
};
var _8c=new RegExp("<embed([^>]*)?>(.*)?(<\\/embed>)?","ig");
var _8d=_82.replace(_8c,_84);
return _8d;
}};
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(_8e){
if(!_8e){
return _8e;
}
var _8f=_8e.getElementsByTagName("IMG");
for(var i=0;i<_8f.length;i++){
var _91=_8f[i];
var _92=_91.getAttribute("isflash");
if(_92!=null){
var _93=_91.getAttribute("flashSrc");
var _94=Telerik.Web.UI.Editor.Utils.getOuterHtml(_91);
_94=_94.replace(/<img/gi,"<embed");
var _95=_91.ownerDocument.createElement("DIV");
_95.innerHTML=_94;
newNode=_95.firstChild;
if(_93){
newNode.src=_93;
if($telerik.isSafari){
newNode.setAttribute("src",_93);
}
}
newNode.removeAttribute("flashSrc");
newNode.removeAttribute("isflash");
var _96=_91.parentNode;
_96.insertBefore(newNode,_91);
_96.removeChild(_91);
i--;
}
}
return _8e;
}};
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(_97){
var _98=_97;
if($telerik.isSafari){
_98=_98.replace(new RegExp(" class=\"khtml-block-placeholder\"","ig"),"");
_98=_98.replace(new RegExp(" class=\"Apple-style-span\"","ig"),"");
_98=_98.replace(new RegExp(" class=\"webkit-block-placeholder\"","ig"),"");
}
if($telerik.isFirefox){
_98=_98.replace(new RegExp("\\s?<br type=\"_moz\" \\/>","ig")," ");
_98=_98.replace(new RegExp(" _moz_[a-z_]*=\"[^\"]*\"","ig"),"");
_98=_98.replace(new RegExp(" type=\"_moz\"","ig"),"");
}
return _98;
}};
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(_9a){
var _9b=_9a.ownerDocument;
var _9c=_9b.createElement("SPAN");
var _9d,_9e,_9f;
var _a0=_9a.getElementsByTagName("FONT");
while(_a0.length>0){
_9e=_a0[0];
_9f=_9e.parentNode;
_9d=_9c.cloneNode(false);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(_9e,_9d,false);
if(_9e.style.cssText&&_9e.style.cssText!=""){
_9d.style.cssText=_9e.style.cssText;
}
if(_9e.className){
_9d.className=_9e.className;
}
if(_9e.face){
_9d.style.fontFamily=_9e.face;
if(_9d.getAttribute("face")!=null){
_9d.removeAttribute("face");
}
}
var _a1=0;
if(_9e.style.fontSize){
_9d.style.fontSize=_9e.style.fontSize;
}else{
if(!isNaN(_a1=parseInt(_9e.size))&&_9e.size!="+0"){
try{
if(_a1<0){
_a1=_a1+4;
}
_9d.style.fontSize=this._fontSizesPx[_a1-1];
}
catch(ex){
_9d.style.fontSize=this._fontSizesPx[3];
}
if(_9d.getAttribute("size")!=null){
_9d.removeAttribute("size");
}
}
}
if(_9e.color){
_9d.style.color=_9e.color;
}
if($telerik.isIE&&_9e.innerHTML==" "){
_9d.innerText=_9e.innerHTML;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_9d,_9e.innerHTML);
}
_9f.replaceChild(_9d,_9e);
_a0=_9a.getElementsByTagName("FONT");
}
return _9a;
},getDesignContent:function(_a2){
var _a3=_a2.ownerDocument;
var _a4=_a3.createElement("FONT");
var _a5,_a6,_a7;
var _a8=_a2.getElementsByTagName("SPAN");
while(_a8.length>0){
_a5=_a8[0];
_a7=_a5.parentNode;
_a6=_a4.cloneNode(false);
Telerik.Web.UI.Editor.Utils.mergeElementAttributes(_a5,_a6,false);
if(_a5.style.cssText&&_a5.style.cssText!=""){
_a6.style.cssText=_a5.style.cssText;
}
if(_a5.className){
_a6.className=_a5.className;
}
if(_a5.style.fontFamily){
_a6.face=_a5.style.fontFamily;
this._removeElementStyleAttribute(_a6,"fontFamily");
}
if(_a5.style.fontSize){
var _a9=3;
var _aa=null;
if(-1!=_a5.style.fontSize.indexOf("px")){
_aa=this._fontSizesRevPx[parseInt(_a5.style.fontSize)];
}
if(typeof (_aa)!="undefined"&&null!=_aa){
_a6.size=_aa+1;
this._removeElementStyleAttribute(_a6,"fontSize");
}
}
if(_a5.style.color){
if($telerik.isIE){
_a6.color=_a5.style.color;
this._removeElementStyleAttribute(_a6,"color");
}
}
if($telerik.isIE&&_a5.innerHTML==" "){
_a6.innerText=_a5.innerHTML;
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_a6,_a5.innerHTML);
}
_a7.replaceChild(_a6,_a5);
_a8=_a2.getElementsByTagName("SPAN");
}
return _a2;
},_removeElementStyleAttribute:function(_ab,_ac){
if(_ab.style&&_ab.style[_ac]){
if(_ab.style.removeAttribute){
_ab.style.removeAttribute(_ac);
}else{
if(_ab.style.removeProperty){
_ac=_ac.replace(/([A-Z])/g,"-$1").toLowerCase();
_ab.style.removeProperty(_ac);
}
}
if(_ab.style[_ac]){
_ab.style[_ac]=null;
}
if(_ab.style.cssText){
}else{
_ab.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(_ad){
if(!_ad){
return "";
}
var sb=new Sys.StringBuilder("");
this._appendNodeXhtml(_ad,sb);
return sb.toString();
},_convertAttribute:function(s){
return String(s).replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
},_getAttributeValue:function(_b0,_b1,sb){
var _b3=_b0.nodeName;
var _b4=_b0.nodeValue;
if($telerik.isIE&&(_b3=="type"||_b3=="value"||_b3=="selected")){
if(!_b4){
return;
}
}else{
if(!_b0.specified){
return;
}
}
var _b5=_b1.tagName;
if(_b3!="style"){
if(!_b4){
return;
}
if(!isNaN(_b4)){
_b4=_b1.getAttribute(_b3);
}
if($telerik.isIE&&(_b3=="href"||_b3=="src")){
_b4=_b1.getAttribute(_b3,2);
}
sb.append(" "+(_b0.expando?_b3:_b3.toLowerCase())+"=\""+this._convertAttribute(_b4)+"\"");
}else{
var _b6=_b1.style.cssText;
if(_b6){
sb.append(" style=\""+this._convertAttribute(_b6.toLowerCase())+"\"");
}
}
},_canHaveChildren:function(_b7){
switch(_b7.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(_b8,sb){
if(_b8.tagName.charAt(0)=="/"){
return;
}
if(_b8.nodeName=="!"){
sb.append(_b8.text);
return;
}
var _ba=_b8.nodeName;
if(_b8.scopeName){
if(_b8.scopeName=="HTML"){
_ba=_ba.toLowerCase();
}else{
_ba=_b8.scopeName+":"+_ba;
}
}else{
_ba=_ba.toLowerCase();
}
sb.append("<"+_ba);
if($telerik.isIE){
if("img"==_ba){
var _bb=document.createElement("IMG");
_bb.mergeAttributes(_b8);
if(_bb.width){
sb.append(" width=\""+_b8.getAttribute("width",2)+"\"");
}
if(_bb.height){
sb.append(" height=\""+_b8.getAttribute("height",2)+"\"");
}
if(_bb.getAttribute("alt").length==0){
sb.append(" alt=\""+_bb.getAttribute("alt")+"\"");
}
}else{
if("area"==_ba||"a"==_ba){
if(_b8.shape){
sb.append(" shape=\""+_b8.shape.toLowerCase()+"\"");
}
if(_b8.coords){
sb.append(" coords=\""+_b8.getAttribute("coords")+"\"");
}
if(_b8.href){
var _bc=_b8.getAttribute("href",2).replace("about:blank","");
_bc=_bc.replace("about:","");
sb.append(" href=\""+_bc+"\"");
_b8.removeAttribute("href",0);
}
}
}
}
try{
var _bd=_b8.attributes;
var l=_bd.length;
for(var i=0;i<l;i++){
this._getAttributeValue(_bd[i],_b8,sb);
}
}
catch(exc){
}
switch(_ba){
case "script":
sb.append(">"+_b8.text+"</"+_ba+">");
break;
case "textarea":
sb.append(">"+_b8.value+"</"+_ba+">");
break;
case "iframe":
sb.append("></iframe>");
break;
case "object":
sb.append(">");
var _c0="";
if(_b8.altHtml){
_c0=_b8.altHtml;
}else{
_c0=_b8.innerHTML;
}
if($telerik.isIE){
_c0=_c0.replace(/\soriginalAttribute="[^"]+"/gi,"");
_c0=_c0.replace(/\soriginalPath="[^"]+"/gi,"");
}
sb.append(_c0);
sb.append("</object>");
break;
case "title":
case "style":
case "comment":
case "noscript":
var _c0=_b8.innerHTML;
if($telerik.isIE&&_c0.length==0){
_c0=_b8.ownerDocument.title;
}
sb.append(">"+_c0+"</"+_ba+">");
break;
default:
if(_b8.hasChildNodes()||(true==_b8.canHaveChildren||(_b8.canHaveChildren==null&&this._canHaveChildren(_b8)))){
sb.append(">");
var cs=_b8.childNodes;
l=cs.length;
for(var i=0;i<l;i++){
this._appendNodeXhtml(cs[i],sb);
}
sb.append("</"+_ba+">");
}else{
sb.append(" />");
}
break;
}
},_appendTextNode:function(_c2,sb){
var _c4=String(_c2.nodeValue);
var _c5=_c2.parentNode.nodeName.toLowerCase();
if(!$telerik.isIE&&(_c5=="style"||_c5=="script")){
sb.append(_c4);
}else{
_c4=_c4.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
if($telerik.isFirefox){
_c4=_c4.replace(/[\u00a0]/g,"&nbsp;");
}
sb.append(_c4);
}
},_appendCDataNode:function(_c6,sb){
sb.append("<![CDA"+"TA[\n"+_c6.nodeValue+"\n]"+"]>");
},_appendCommentNode:function(_c8,sb){
var _ca=_c8.nodeValue;
if(!_ca&&_c8.text){
_ca=_c8.text;
}else{
_ca="<!--"+_ca+"-->";
}
sb.append(_ca);
},_appendNodeXhtml:function(_cb,sb){
if(_cb.uniqueID){
if(this._uniqueIds[_cb.uniqueID]){
return;
}else{
this._uniqueIds[_cb.uniqueID]=true;
}
}
switch(_cb.nodeType){
case 1:
this._appendElementNode(_cb,sb);
break;
case 3:
this._appendTextNode(_cb,sb);
break;
case 4:
this._appendCDataNode(_cb,sb);
break;
case 8:
this._appendCommentNode(_cb,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 _cd="P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION";
var _ce="HTML|HEAD|BODY|STYLE|FORM|TABLE|TBODY|THEAD|TR";
var _cf=_ce+"|UL|OL";
this._ignoreTags=new RegExp("(<PRE[^>]*>|<!--)([\\s\\S]*?)(<\\/PRE>|-->)","gi");
this._tagsNLBefore=new RegExp("<("+_cd+")[^>]*>","gi");
this._tagsNLAfter=new RegExp("<\\/("+_cd+")[^>]*>","gi");
this._tagsNLNoCloseAfter=new RegExp("<(BR|HR)[^>]*\\/?>","gi");
this._tagsNLBeforeAndAfter=new RegExp("<\\/?("+_ce+")[^>]*>","gi");
this._tagsIncIndent=new RegExp("^<("+_cf+")[\\s\\/>]","i");
this._tagsDecIndent=new RegExp("^<\\/("+_cf+")[\\s\\>]","i");
this._shrinkNL=new RegExp("\\s*\\n+\\s*","gi");
};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.prototype={dispose:function(){
this._protectedData=[];
},getHtmlContent:function(_d0){
var _d1=_d0.trim();
if(_d1.indexOf("<body")==0){
_d1=_d1.substring(_d1.indexOf(">")+1,_d1.length-7);
}
this._protectedData=[];
var _d2=this;
var _d3=function(_d4,_d5,_d6,_d7,_d8,_d9){
Array.add(_d2._protectedData,_d6);
return _d5+"RADEDITORFORMATTED_"+_d2._protectedData.length+_d7;
};
_d0=_d0.replace(this._ignoreTags,_d3);
var _da="$&";
if($telerik.isSafari){
_da="$0";
}
_d1=_d1.replace(this._tagsNLBefore,"\n"+_da);
_d1=_d1.replace(this._tagsNLAfter,_da+"\n");
_d1=_d1.replace(this._tagsNLNoCloseAfter,_da+"\n");
_d1=_d1.replace(this._tagsNLBeforeAndAfter,"\n"+_da+"\n");
var _db=_d1.split(this._shrinkNL);
var _dc=new Sys.StringBuilder("");
var _dd="";
for(var i=0;i<_db.length;i++){
var _df=_db[i];
if(_df.length==0){
continue;
}
if(this._tagsDecIndent.test(_df)){
if(_dd.length>this._indentPattern.length){
_dd=_dd.substring(this._indentPattern.length);
}else{
_dd="";
}
}
_dc.append(_dd);
_dc.append(_df);
_dc.append("\n");
if(this._tagsIncIndent.test(_df)){
_dd+=this._indentPattern;
}
}
_d1=_dc.toString();
for(var i=0;i<this._protectedData.length;i++){
var _e0=new RegExp("RADEDITORFORMATTED_"+(i+1));
_d1=_d1.replace(_e0,this._protectedData[i]);
}
return _d1;
}};
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(_e1){
this._updateElements(_e1,"A","href");
this._updateElements(_e1,"AREA","href");
this._updateElements(_e1,"IMG","src");
this._updateElements(_e1,"EMBED","src");
return _e1;
},_getElements:function(_e2,_e3){
var _e4=_e2.getElementsByTagName(_e3);
if(!_e4){
_e4=_e2.ownerDocument.getElementsByTagName(_e3);
}
return _e4;
},_updateElements:function(_e5,_e6,_e7){
var _e8=_e5.ownerDocument.createElement("div");
var _e9=this._getElements(_e5,_e6);
if(_e9){
for(var i=0;i<_e9.length;i++){
if("href"==_e7){
_e8.innerHTML="<a href=\""+_e9[i].getAttribute("href",2).replace(/\"/gi,"%22")+"\">test</a>";
_e9[i].setAttribute("href",_e8.childNodes[0].href);
}else{
_e8.innerHTML="<img src=\""+_e9[i].getAttribute("src",2).replace(/\"/gi,"%22")+"\" />";
_e9[i].setAttribute("src",_e8.childNodes[0].src);
}
}
}
_e8.innerHTML="";
_e8=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(_eb){
this._enableXhtmlFilter=_eb;
},add:function(_ec){
Array.add(this._filters,_ec);
},addAt:function(_ed,_ee){
Array.insert(this._filters,_ee,_ed);
},remove:function(_ef){
Array.remove(this._filters,_ef);
},removeAt:function(_f0){
Array.removeAt(this._filters,_f0);
},getFilterAt:function(_f1){
return this._filters[_f1];
},getFilterByName:function(_f2){
for(var i=0;i<this._filters.length;i++){
var _f4=this._filters[i];
if(_f4&&_f2==_f4.get_name()){
return _f4;
}
}
},getDesignContent:function(_f5){
var _f6=_f5;
for(var i=0;i<this._filters.length;i++){
var _f8=this._filters[i];
if((!_f8.get_isDom())&&(false!=_f8.get_enabled())&&_f8.getDesignContent){
try{
_f6=_f8.getDesignContent(_f6);
}
catch(exc){
alert("Error while executing filter "+_f8.get_name()+" - "+exc.toString());
}
}
}
return _f6;
},getDesignContentDom:function(_f9){
for(var i=0;i<this._filters.length;i++){
var _fb=this._filters[i];
if((_fb.get_isDom())&&(false!=_fb.get_enabled())&&_fb.getDesignContent){
try{
_f9=_fb.getDesignContent(_f9);
}
catch(exc){
alert("Error while executing filter "+_fb.get_name()+" - "+exc.toString());
}
}
}
return _f9;
},getHtmlContent:function(_fc){
for(var i=0;i<this._filters.length;i++){
var _fe=this._filters[i];
if((_fe.get_isDom())&&(false!=_fe.get_enabled())&&_fe.getHtmlContent){
try{
_fc=_fe.getHtmlContent(_fc);
}
catch(exc){
alert("Error while executing filter "+_fe.get_name()+" - "+exc.toString());
}
}
}
var _ff;
if(this.get_enableXhtmlFilter()){
try{
_ff=this._convertToXhtmlFilter.getHtmlContent(_fc);
}
catch(exc){
alert("Error while executing filter XHTML - "+exc.toString());
}
}else{
_ff=_fc.innerHTML;
}
_ff=_ff.replace(/<body\s*\/>/i,"<body></body>");
for(var i=0;i<this._filters.length;i++){
var _fe=this._filters[i];
if((!_fe.get_isDom())&&(false!=_fe.get_enabled())&&_fe.getHtmlContent){
try{
_ff=_fe.getHtmlContent(_ff);
}
catch(exc){
alert("Error while executing filter "+_fe.get_name()+" - "+exc.toString());
}
}
}
return _ff;
}};
$telerik.makeCompatible(Telerik.Web.UI.Editor.FiltersManager);
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(_1){
this.Window=_1;
this.Document=_1.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 _2=this.Document.selection.createRange();
if(_2.length){
this.SourceIndex=_2.item(0).sourceIndex;
}else{
this.StartBookmark=_2.getBookmark();
}
},restore:function(_3){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this.Document.body,this.HtmlText);
this.select(_3);
},select:function(_4){
if(null!=this.SourceIndex){
var _5=this.Document.body.createControlRange();
_5.addElement(this.Document.all(this.SourceIndex));
_5.select();
}else{
if(null!=this.StartBookmark){
var _5=this.Document.body.createTextRange();
_5.moveToBookmark(this.StartBookmark);
_5.select();
if(true==_4&&_5.collapse){
_5.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(_6){
if(_6){
return {anchorNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6.anchorNode),anchorOffset:_6.anchorOffset,focusNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,_6.focusNode),focusOffset:_6.focusOffset,isCollapsed:_6.isCollapsed};
}else{
return {};
}
},_moveToBookmark:function(_7,_8){
var _9=_8.anchorNodeBookmark.select();
var _a=_8.focusNodeBookmark.select();
_7.collapse(_9,_8.anchorOffset);
if(!_8.isCollapsed){
_7.extend(_a,_8.focusOffset);
}
}};
}
Telerik.Web.UI.Editor.RestorePoint.registerClass("Telerik.Web.UI.Editor.RestorePoint",null);
Telerik.Web.UI.Editor.SelectionBookmark=function(_b,_c){
this.Window=_b;
this.NodePath=this._findNodePath(this.Window.document.documentElement,_c);
};
Telerik.Web.UI.Editor.SelectionBookmark.prototype={select:function(){
var _d=this._findNode(this.Window.document.documentElement,this.NodePath);
try{
Telerik.Web.UI.Editor.Utils.selectElement(this.Window,_d);
}
catch(ex){
}
return _d;
},_findNodePath:function(_e,_f){
var n,res;
for(var i=0;i<_e.childNodes.length;i++){
n=_e.childNodes[i];
res=this._findNodePath(n,_f);
if(""!=res){
return ""+i+","+res;
}
if(n==_f){
return ""+i;
}
}
return "";
},_findNode:function(_13,_14){
var arr=_14.split(",");
for(var i=0;i<arr.length;i++){
_13=_13.childNodes[arr[i]];
}
return _13;
}};
Telerik.Web.UI.Editor.SelectionBookmark.registerClass("Telerik.Web.UI.Editor.SelectionBookmark",null);;Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Selection=function(_1){
this._window=_1;
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(_2,_3){
_3=(_3==true);
if($telerik.isIE){
return this._executeIE(_2,_3);
}else{
return this._executeMozilla(_2,_3);
}
},_executeIE:function(_4,_5){
var _6=this._window.document;
var _7=_6.selection;
if(_7.type.toLowerCase()!="none"){
_7.createRange().execCommand("Delete");
}
if(_7.type.toLowerCase()!="none"){
_6.execCommand("Delete");
}
_6.body.setActive();
selRange=_7.createRange();
if(selRange&&selRange.length){
var _8=selRange.item(0);
if(_8&&_8.tagName=="BODY"){
var _9=_8.getElementsByTagName("FORM")[0];
if(_9){
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(_9,_9.innerHTML+_4);
}
}
}else{
var _a=selRange.duplicate();
_a.collapse(true);
_4=Telerik.Web.UI.Editor.Utils.getStoredOriginalPathsAndAttributes(_4);
selRange.pasteHTML(_4);
Telerik.Web.UI.Editor.Utils.restoreOriginalPathsAndAttributes(selRange.parentElement());
if(_5){
_a.setEndPoint("EndToEnd",selRange);
_a.select();
}
}
return true;
},_executeMozilla:function(_b,_c){
var _d=this._window.document;
var _e=_d.createElement("SPAN");
_e.innerHTML=_b;
var _f="radetempnode";
if(this.isOpera){
_e.setAttribute("id",_f);
}
this._insertNodeAtSelection(this._window,_e,true);
if(this.isOpera){
var _10=_d.createRange();
var _11=this._window.getSelection();
var _12=_d.getElementById(_f);
_10.selectNodeContents(_12);
var _13=_10.extractContents();
_10.selectNode(_12);
var _14=_10.extractContents();
_10.insertNode(_13);
_11.addRange(_10);
return true;
}else{
if(!this.isSafari){
var _10=_d.createRange();
_10.selectNodeContents(_e);
var _13=_10.extractContents();
_10.selectNode(_e);
_10.deleteContents();
this._insertNodeAtSelection(this._window,_13,_c);
}
}
return true;
},_insertNodeAtSelection:function(win,_16,_17){
var _18=win.getSelection();
if(this.isSafari){
win.document.execCommand("Delete");
}
var _19=null;
if(_18.getRangeAt){
_19=_18.getRangeAt(0);
}else{
_19=win.document.createRange();
_19.setStart(_18.anchorNode,_18.anchorOffset);
_19.setEnd(_18.focusNode,_18.focusOffset);
}
if(_18.removeAllRanges){
_18.removeAllRanges();
}
_19.deleteContents();
var _1a=this.isSafari?_18.baseNode:_19.startContainer;
var _1b=this.isSafari?_18.baseOffset:_19.startOffset;
if(this.isSafari&&null==_1a){
_1a=win.document.body;
}
_19=win.document.createRange();
if((_16.nodeType==3)&&(_1a.nodeType==3)){
_1a.insertData(_1b,_16.nodeValue);
_19.setEnd(_1a,_1b+_16.length);
if(_17){
_19.setStart(_1a,_1b);
}else{
_19.setStart(_1a,_1b+_16.length);
}
}else{
var _1c;
if(_1a.nodeType==3){
var _1d=_1a;
_1a=_1d.parentNode;
var _1e=_1d.nodeValue;
var _1f=_1e.substr(0,_1b);
var _20=_1e.substr(_1b);
var _21=win.document.createTextNode(_1f);
var _1c=win.document.createTextNode(_20);
_1a.insertBefore(_1c,_1d);
_1a.insertBefore(_16,_1c);
try{
_1a.insertBefore(_21,_16);
}
catch(exc){
}
_1a.removeChild(_1d);
}else{
if(_1a.childNodes.length>0){
_1c=_1a.childNodes[_1b];
_1a.insertBefore(_16,_1c);
}else{
if(_1a.tagName!="BODY"){
_1a=_1a.parentNode;
}
_1a.appendChild(_16);
}
}
try{
if(_17){
_19.setStart(_16,0);
_19.setEnd(_1c,0);
}else{
_19.setEnd(_1c,0);
_19.setStart(_1c,0);
}
}
catch(exc){
}
}
try{
_18.addRange(_19);
}
catch(exc){
}
},selectRange:function(_22){
if(!_22){
return;
}
var _23=this._window;
if(_22.select){
_22.select();
}else{
if(_23.getSelection){
var _24=_23.getSelection();
if(_24.removeAllRanges){
_24.removeAllRanges();
_24.addRange(_22);
}else{
var _25=_22.baseNode;
if(null==_25){
_25=_23.document.body;
}
var _26=_22.extentNode;
if(null==_26){
_26=_23.document.body;
}
_24.setBaseAndExtent(_25,_22.startOffset,_26,_22.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 _27=this._window.getSelection();
if(!_27||_27.rangeCount<1){
return null;
}
var rng=null;
if(_27.getRangeAt){
rng=_27.getRangeAt(0);
}else{
rng=this._window.document.createRange();
rng.setStart(_27.anchorNode,_27.anchorOffset);
rng.setEnd(_27.focusNode,_27.focusOffset);
}
return rng;
}
}
},getParentElement:function(){
var rng=this.getRange();
if(!rng){
return null;
}
if(rng.commonAncestorContainer){
var _2a=this._window.getSelection();
var _2b=rng.startContainer?rng.startContainer:_2a.baseNode;
var _2c=rng.endContainer?rng.endContainer:_2a.extentNode;
var _2d=rng.startOffset!=null?rng.startOffset:_2a.baseOffset;
var _2e=rng.endOffset!=null?rng.endOffset:_2a.extentOffset;
if(_2b==_2c&&(_2e-_2d)==1){
return _2a.anchorNode.childNodes[_2a.anchorOffset];
}else{
if(!rng.commonAncestorContainer.tagName){
if(this._window.document==rng.commonAncestorContainer&&_2a.baseNode){
return _2a.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 _2f=this._window.getSelection();
if(_2f.toString()!=""){
return false;
}
var _30=_2f.focusNode;
if(!_30||_30.nodeType==1){
return false;
}
return (_30.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 _33=this._window.getSelection();
var rng=null;
if(null==_33){
return "";
}
if(_33.getRangeAt&&typeof (_33.rangeCount)!="undefined"&&_33.rangeCount==0){
return "";
}
if(_33.getRangeAt){
rng=_33.getRangeAt(0);
var _34=this._window.document.createElement("div");
var _35=rng.cloneContents();
if(_35){
_34.appendChild(_35);
return _34.innerHTML;
}else{
return "";
}
}else{
return _33;
}
}else{
return "";
}
}
},collapse:function(_36){
_36=(_36==true);
if(this._window.document.selection){
var rng=this._window.document.selection.createRange();
if(rng.collapse){
rng.collapse(_36);
rng.select();
}
}else{
if(this._window.getSelection){
var _38=this._window.getSelection();
if(!_38.isCollapsed){
if(_36){
_38.collapseToStart();
}else{
_38.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(_1,_2){
var rs=new Telerik.Web.UI.EditorShortCut(_1,_2);
rs.HashValue=this._getShortCutHashValue(rs);
this._shortcuts[rs.HashValue]=rs;
},removeShortCut:function(_4){
var _5=this._findByName(_4);
if(_5){
this._shortcuts[_5.HashValue]=null;
}
},setShortCut:function(_6,_7){
this.removeShortCut(_6);
this.addShortCut(_6,_7);
},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(_9,_a,_b,_c,_d,_e,_f){
var _10=this._getHashValue(_9,_a,_b,_c,_d,_e,_f);
return this._shortcuts[_10];
},_getHashValue:function(_11,_12,_13,_14,_15,_16,_17){
var _18=_11&65535;
var _19=0;
_19|=(_12?(1<<0):0);
_19|=(_14?(1<<2):0);
_19|=(_16?(1<<4):0);
_18|=(_19<<16);
return _18;
},_getShortCutHashValue:function(_1a){
return this._getHashValue(_1a.KeyCode,_1a.CtrlKey,_1a.LeftCtrlKey,_1a.ShiftKey,_1a.LeftShiftKey,_1a.AltKey,_1a.LeftAltKey);
},_findByName:function(_1b){
var _1c;
for(var _1d in this._shortcuts){
_1c=this._shortcuts[_1d];
if(null!=_1c&&_1c._name==_1b){
return _1c;
}
}
return null;
}};
Telerik.Web.UI.EditorShortCut=function(_1e,_1f){
this._name=_1e;
this.setShortCut(_1f);
};
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(_20){
this._name=_20;
},setShortCut:function(_21){
this._parseShortcutString(_21);
},_parseShortcutString:function(_22){
if("string"==typeof (_22)){
this.CtrlKey=false;
this.LeftCtrlKey=false;
this.ShiftKey=false;
this.LeftShiftKey=false;
this.AltKey=false;
this.LeftAltKey=false;
this.KeyCode=0;
_22=_22.replace(/\s*/gi,"");
_22=_22.replace(/\+\+/gi,"+PLUS");
var _23=_22.split("+");
var _24="";
for(var i=0;i<_23.length;i++){
_24=_23[i].toUpperCase();
switch(_24){
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=_24.charCodeAt(0);
break;
}
}
}else{
throw {description:"Invalid shortcut string"};
}
}};
$telerik.makeCompatible(Telerik.Web.UI.EditorShortCutManager);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI._localization=function(){
this._controls={};
};
Telerik.Web.UI._localization.prototype={merge:function(_1,_2,_3){
if(typeof (this._controls[_1])=="undefined"){
this._controls[_1]={};
}
if(typeof (this._controls[_1][_2])=="undefined"){
this._controls[_1][_2]={};
}
var _4=this._controls[_1][_2];
for(var _5 in _3){
if(typeof (_3[_5])=="string"){
_4[_5]=_3[_5];
}
}
return _4;
}};
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(_1,_2,_3){
Telerik.Web.UI.EditorCommandEventArgs.initializeBase(this);
this._name=this._commandName=_1;
this._tool=_2;
this._value=_3;
this.value=_3;
};
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(_4){
this.value=_4;
this._value=_4;
}};
$telerik.makeCompatible(Telerik.Web.UI.EditorCommandEventArgs);
Telerik.Web.UI.EditorCommandEventArgs.registerClass("Telerik.Web.UI.EditorCommandEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadEditor=function(_5){
Telerik.Web.UI.RadEditor.initializeBase(this,[_5]);
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(_6){
this.get_events().addHandler("spellCheckLoaded",_6);
},remove_spellCheckLoaded:function(_7){
this.get_events().removeHandler("spellCheckLoaded",_7);
},get_ajaxSpellCheck:function(){
return this._ajaxSpellCheck;
},set_ajaxSpellCheck:function(_8){
this._ajaxSpellCheck=_8;
this.raiseEvent("spellCheckLoaded");
},get_ajaxSpellCheckScriptReference:function(){
return this._ajaxSpellCheckScriptReference;
},get_spellAllowAddCustom:function(){
return this._spellAllowAddCustom;
},set_spellAllowAddCustom:function(_9){
this._spellAllowAddCustom=_9;
},get_spellCheckJSON:function(){
return this._spellCheckJSON;
},set_spellCheckJSON:function(_a){
this._spellCheckJSON=_a;
},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(_b){
this.get_spellCheckService().addCustomWord(_b);
},_responseReceived:function(_c,_d){
},raiseEvent:function(_e,_f){
if(_e!="selectionChange"||this.get_mode()==Telerik.Web.UI.EditModes.Design){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"raiseEvent",[_e,_f]);
}
},initialize:function(){
Telerik.Web.UI.RadEditor.callBaseMethod(this,"initialize");
this.raiseEvent("init",Sys.EventArgs.Empty);
var _10=$get(this.get_id()+"Wrapper");
this._originalHeight=_10.style.height;
this._initializeLocalization();
this._addFilters();
this._addDefaultShortCuts();
this._createUI();
this._createTools();
this._makeResizeable(true);
if(true){
var _11=$get(this.get_id()+"ContentHiddenTextarea");
if(_11){
_11.setAttribute("id",this.get_id());
this._contentHiddenTextarea=_11;
}
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 _12=this;
window.setTimeout(function(){
if(_12.isIE){
if($telerik.isOpera){
return;
}
var _13=_12.get_contentArea();
if(!_13){
return;
}
try{
var r=_13.createTextRange();
var _15=document.body.createTextRange();
_15.moveStart("textedit",_15.text.length);
_15.collapse(true);
_15.select();
}
catch(e){
}
}
},0);
this._fixIEVisibilityProblems(true);
this._fixMozillaDOMProblems(true);
if(this._modulesManager){
if(!this.isIE){
var _16=$get(this.get_id()+"Module");
_16.style.display="none";
var _17=this;
window.setTimeout(function(){
_17._modulesManager.initialize();
_16.style.display="";
},0);
}else{
this._modulesManager.initialize();
this._updateEditorSize(this._originalHeight);
}
}
if(this.get_autoResizeHeight()&&!this._getInvisibleParent()){
this._makeAutoResizeHeight();
}
this._initialContent=_12.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 _19=this;
this.attachEventHandler("keydown",function(e){
if(!_19._isKeyUpButton(e)){
_19._resizeContentArea(e);
}
});
this.attachEventHandler("keyup",function(e){
if(_19._isKeyUpButton(e)||(e.keyCode==13&&!_19.isIE)){
_19._resizeContentArea(e);
}
});
this.add_selectionChange(Function.createDelegate(this,this._resizeContentArea));
this._resizeContentArea();
}),0);
},_isKeyUpButton:function(e){
var _1d=e.keyCode;
if(_1d==8||_1d==46){
return true;
}
return false;
},_getCurrentFontSize:function(){
var o=this.getSelectedElement();
var _1f=parseInt($telerik.getCurrentStyle(o,"fontSize"));
return _1f;
},_resizeContentArea:function(e){
var _21=this.isIE?this._document.body:this._document.documentElement;
var _22=this._contentAreaElement;
var _23=_22.parentNode;
var _24=this._initialContentHeight;
var _25=_22.offsetHeight;
var _26=_21.scrollHeight+(e&&e.keyCode==13&&this.isIE?this._getCurrentFontSize():0);
if(_26==_25){
return;
}
if((_24==_25)&&(_26<=_24)){
return;
}
var _27=(_26>_24)?_26:_24;
_22.style.height=_27+"px";
if(_26>_25){
_23.style.height=parseInt(_26)+"px";
}else{
var _28=this.get_element();
var _29=_28.offsetHeight-(_23.offsetHeight-_22.offsetHeight);
if(_22.style.height!="100%"){
_23.style.height="";
this._updateEditorSize(_29);
}
return;
}
this._updateEditorSize(null,true);
},_makeResizeable:function(_2a){
if(this._resizeExtender){
this._resizeExtender.dispose();
this._resizeExtender=null;
}
if(!_2a){
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 _2b={se:this._bottomResizer};
this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._rootElement,_2b,this._tableElement);
},_getInvisibleParent:function(){
return Telerik.Web.UI.Editor.Utils.getInvisibleParent(this.get_element());
},_fixIEVisibilityProblems:function(_2c){
if(!this.isIE){
return;
}
if(_2c){
var _2d=this._getInvisibleParent();
if(_2d){
this._onIEParentVisibilityChangeDelegate=Function.createDelegate(this,this._onIEParentVisibilityChange);
this._invisibleParent=_2d;
$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(_2e){
if(this.isIE){
return;
}
if(_2e){
var _2f=this._getInvisibleParent();
if(_2f){
this._invisibleParent=_2f;
this._onMozillaParentVisibilityChangeDelegate=Function.createDelegate(this,this._onMozillaParentVisibilityChange);
_2f.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 _32=e.target;
if(_32.style.display!="none"){
if(this.get_autoResizeHeight()){
this._makeAutoResizeHeight();
}
this.set_editable(true);
}
}
},_onMozillaParentNodeChanged:function(e){
if(!e.target||!this.get_element()){
return;
}
var _34=$telerik.isDescendantOrSelf(e.target,this.get_element());
if(_34){
this.onParentNodeChanged();
}
},onParentNodeChanged:function(){
if(!$telerik.isIE){
var _35=this.get_html(true);
var _36=this.get_contentAreaElement();
this._contentWindow=_36.contentWindow;
this._setContentAreaHtml(_35,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(_37,_38){
if(Telerik.Web.UI.Editor.Utils.selectElement(this.get_contentWindow(),_37)&&false!=_38){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},undo:function(_39){
this._commandsManager.undo(_39);
},redo:function(_3a){
this._commandsManager.redo(_3a);
},executeCommand:function(_3b,_3c,_3d){
if(!_3b.get_window()){
_3b.set_window(this.get_contentWindow());
}
if(false!=_3c&&!this.isOpera){
this.setFocus();
}
this._commandsManager.execute(_3b,_3d);
},executeBrowserCommand:function(_3e,_3f,_40,_41){
var _42=this._localization[_3e];
this.executeCommand(new Telerik.Web.UI.Editor.BrowserCommand(_42,this._contentWindow,_3e,_40));
this.setActive();
this.setFocus();
if(true==_41){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},createElement:function(_43,_44,_45,sId,_47,_48){
var _49=this._document.createElement(_43);
if(_44){
_49.style.width=_44;
}
if(_45){
_49.style.height=_45;
}
if(null!=sId){
_49.id=sId;
}
if(null!=_47){
_49.name=_47;
}
if(null!=_48){
_49.value=_48;
}
return _49;
},createRestorePoint:function(){
return new Telerik.Web.UI.Editor.RestorePoint(this._contentWindow);
},getToolState:function(_4a){
if(_4a=="Undo"){
return this.get_commandsManager().isUndoAvailable()?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
}else{
if(_4a=="Redo"){
return this.get_commandsManager().isRedoAvailable()?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
}else{
var _4b=Telerik.Web.UI.Editor.UpdateCommandsArray[_4a];
if(_4b&&_4b.getState){
return _4b.getState(this._contentWindow);
}
}
}
},getToolValue:function(_4c){
var _4d=Telerik.Web.UI.Editor.UpdateCommandsArray[_4c];
if(_4d&&_4d.getValue){
return _4d.getValue(this._contentWindow);
}else{
if(_4c=="RealFontSize"){
var o=this.getSelectedElement();
if(o){
var _4f=null;
try{
_4f=$telerik.getCurrentStyle(o,"fontSize","");
}
catch(exc){
}
if(_4f){
var _50=parseFloat(_4f);
if(_50>parseInt(_4f)){
if(_4f.indexOf("px")>-1){
_4f=parseInt(_4f)+"px";
}
}
}
return _4f;
}
}
}
},_addFilters:function(){
var _51=this.get_filtersManager();
var _52=this.get_contentFilters();
_51.clear();
var _53=_52&Telerik.Web.UI.EditorFilters.ConvertToXhtml;
_51.set_enableXhtmlFilter(_53);
if(_52&Telerik.Web.UI.EditorFilters.RemoveScripts){
_51.add(new Telerik.Web.UI.Editor.StripScriptsFilter());
}
_51.add(new Telerik.Web.UI.Editor.EncodeScriptsFilter());
if(_52&Telerik.Web.UI.EditorFilters.FixUlBoldItalic){
_51.add(new Telerik.Web.UI.Editor.FixUlBoldItalic());
}
_51.add(new Telerik.Web.UI.Editor.FixNestedLists());
if(_52&Telerik.Web.UI.EditorFilters.ConvertFontToSpan){
_51.add(new Telerik.Web.UI.Editor.ConvertFontToSpanFilter());
}
if(_52&Telerik.Web.UI.EditorFilters.FixEnclosingP){
_51.add(new Telerik.Web.UI.Editor.FixEnclosingP());
}
if($telerik.isIE){
_51.add(new Telerik.Web.UI.Editor.IEKeepObjectParamsFilter());
_51.add(new Telerik.Web.UI.Editor.IEKeepCommentsFilter());
if(_52&Telerik.Web.UI.EditorFilters.IECleanAnchors){
_51.add(new Telerik.Web.UI.Editor.IECleanAnchorsFilter());
}
}
if(!$telerik.isIE&&!$telerik.isOpera){
if(!$telerik.isSafari){
_51.add(new Telerik.Web.UI.Editor.MozillaKeepFlashString(this.get_mozillaFlashOverlayImage()));
_51.add(new Telerik.Web.UI.Editor.MozillaKeepFlash());
}
_51.add(new Telerik.Web.UI.Editor.MozillaKeepStylesString());
_51.add(new Telerik.Web.UI.Editor.MozillaKeepStylesDom());
if(_52&Telerik.Web.UI.EditorFilters.MozEmStrong){
_51.add(new Telerik.Web.UI.Editor.MozEmStrongFilter());
}
}
_51.add(new Telerik.Web.UI.Editor.StripJunkFilter());
if(_52&Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute){
_51.add(new Telerik.Web.UI.Editor.MakeUrlsAbsolute());
}
_51.add(new Telerik.Web.UI.Editor.RemoveExtraBrakes());
if(_52&Telerik.Web.UI.EditorFilters.IndentHTMLContent){
_51.add(new Telerik.Web.UI.Editor.IndentHTMLContentFilter());
}
},addShortCut:function(_54,_55){
if(this._shortCutManager){
this._shortCutManager.addShortCut(_54,_55);
}
},removeShortCut:function(_56){
if(this._shortCutManager){
this._shortCutManager.removeShortCut(_56);
}
},setShortCut:function(_57,_58){
if(this._shortCutManager){
this._shortCutManager.setShortCut(_57,_58);
}
},_addDefaultShortCuts:function(){
var _59=[["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<_59.length;i++){
this.addShortCut(_59[i][0],_59[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(_5b,_5c){
if(_5b.startsWith("on")){
_5b=_5b.replace("on","");
}
$telerik.addExternalHandler(this._document,_5b,_5c);
var _5d=this._contentAreaEventHandlers;
if(!_5d[_5b]){
_5d[_5b]=[];
}
var _5e=_5d[_5b];
_5e[_5e.length]=_5c;
},detachEventHandler:function(_5f,_60){
if(_5f.startsWith("on")){
_5f=_5f.replace("on","");
}
$telerik.removeExternalHandler(this._document,_5f,_60);
},_detachEvents:function(){
var _61=this._contentAreaEventHandlers;
for(var _62 in _61){
var _63=_61[_62];
if(_63.length!=null){
for(var i=0;i<_63.length;i++){
var _65=_63[i];
if(typeof (_65)=="function"){
try{
this.detachEventHandler(_62,_65);
}
catch(e){
}
}
}
_63=[];
}
}
this._contentAreaEventHandlers={};
this._attachIEBodyHandlers(false);
},get_TopZone:function(){
return $get(this.get_id()+"Top");
},_createTools:function(){
if(!this._toolAdapter){
var _66=this.get_TopZone().firstChild;
var _67=eval(this._toolAdapterType);
this._toolAdapter=$create(_67,{"editor":this,"toolJSON":this.get_toolJSON()},{"toolClick":this._onToolClickDelegate},null,_66);
if(this.isIE){
if(this.get_toolbarMode()==Telerik.Web.UI.EditorToolbarMode.Default){
_66.style.overflow="";
}
this._updateEditorSize();
}
}
},_onToolClick:function(_68,_69){
this.fire(_68.get_name(),_69);
},getContextMenuByTagName:function(_6a){
if(this._toolAdapter&&this._toolAdapter.getContextMenuByTagName){
return this._toolAdapter.getContextMenuByTagName(_6a);
}
},getToolByName:function(_6b){
if(this._toolAdapter){
return this._toolAdapter.getToolByName(_6b);
}
return null;
},getLocalizedString:function(_6c,_6d){
var str=this.get_localization()[_6c];
if(null==str){
str=this.get_localization()[_6c.toLowerCase()];
}
if(null==str){
str=_6d;
}
return str;
},setFocus:function(){
try{
if(this.get_mode()!=Telerik.Web.UI.EditModes.Html){
this._contentWindow.focus();
}else{
var _6f=this._getTextArea();
_6f.focus();
}
}
catch(e){
}
},setActive:function(){
var _70=this.get_contentArea();
if(_70&&_70.setActive){
_70.setActive();
}
},set_visible:function(_71){
var _72=this.get_element();
if(_72){
_72.style.display=_71?"":"none";
}
this.set_editable(_71);
},enableEditing:function(_73,_74,_75){
var _76=this.get_toolAdapter();
var _77=Telerik.Web.UI.EditingOptions;
var _78=function(){
};
if(!_74){
_74=Telerik.Web.UI.EditingOptions.All;
}
this._editingOptions=_74;
this._optionalIgnoredTools=_75;
if(_74&_77.ContextMenus){
if(_76){
_76.enableContextMenus(_73);
}
}
if(_74&_77.EditModes){
if(!_73){
this._originalEditModeRef=this.set_mode;
this.set_mode=_78;
}else{
if(this._originalEditModeRef){
this.set_mode=this._originalEditModeRef;
this._originalEditModeRef=null;
}
}
}
if(_74&_77.Tools){
if(_76){
if(!_73){
_76.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Disabled);
if(_75){
var _79=[];
for(var _7a in _75){
var _7b=_76.getToolByName(_7a);
if(_7b){
_79[_79.length]=_7b;
}
}
_76.setToolState(_79);
}
this._originalSetToolStateRef=_76.setToolState;
_76.setToolState=_78;
}else{
_76.setToolState=this._originalSetToolStateRef;
this._originalSetToolStateRef=null;
}
}
}
if(_74&_77.Modules){
var _7c=this._modulesManager;
if(_7c){
_7c.setModulesVisible(_73);
}
}
if(_74&_77.Typing){
if(!_73){
this._disableTypingDelegate=$telerik.cancelRawEvent;
this.attachEventHandler("keypress",this._disableTypingDelegate);
}else{
if(this._disableTypingDelegate){
this.detachEventHandler("keypress",this._disableTypingDelegate);
this._disableTypingDelegate=null;
}
}
}
if(_74&_74.Tab){
if(!_73){
this.removeShortCut("InsertTab");
}else{
this.setShortCut("InsertTab","TAB");
}
}
if(_73){
if(_76){
_76.setToolState(null,Telerik.Web.UI.Editor.CommandStates.Off);
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
},set_editable:function(_7d){
if($telerik.isIE||$telerik.isOpera){
var oEd=this;
window.setTimeout(function(){
try{
oEd._document.body.setAttribute("contentEditable",""+_7d);
oEd._document.execCommand("2D-Position",false,true);
}
catch(ev){
}
},0);
}else{
var oEd=this;
window.setTimeout(function(){
try{
oEd._document["designMode"]=_7d?"on":"off";
if(_7d){
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(_7f){
if(this.isIE){
this.get_document().body.setAttribute("contentEditable",""+_7f);
}
},showExternalDialog:function(url,_81,_82,_83,_84,_85,_86,_87,_88,_89,_8a){
var _8b=this.getSelection().getRange();
var _8c=this;
var _8d=function(_8e,_8f){
window.setTimeout(function(){
_8c.getSelection().selectRange(_8b);
if(_84){
var _90=_84(_8e,_8f);
if(false==_90){
return;
}
_8c.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_8c.setFocus();
},50);
};
this.get_dialogOpener().openUrl(url,_81,_82,_83,_8d,_85,_86,_87,_88,_89,_8a);
},showDialog:function(_91,_92,_93){
this._currentRange=this.getSelection().getRange();
var _94=this;
var _95=function(_96,_97){
window.setTimeout(function(){
_94.getSelection().selectRange(_94._currentRange);
if(_93){
var _98=_93(_96,_97);
if(false==_98){
return;
}
_94.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
_94.setFocus();
},50);
};
this.get_dialogOpener().open(_91,_92,_95);
if(this.isIE){
var wnd=this.get_dialogOpener()._getDialogContainer(_91);
if(!wnd||wnd._DRAG_ATTACHED){
return;
}
wnd._DRAG_ATTACHED=true;
wnd.add_dragEnd(function(){
_94.getSelection().selectRange(_94._currentRange);
});
}
},_getModeButtonsWrapper:function(){
return this._getChildElement("ModesWrapper");
},_registerModeChangeHandler:function(_9a){
if(_9a){
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 _9c=this.get_mode();
var _9d=Telerik.Web.UI.Editor.Utils.getElementParentByTag(e.target,"LI");
if(_9d){
var _9e=Telerik.Web.UI.EditModes;
var _9f=Sys.UI.DomElement;
var a=_9d.getElementsByTagName("A")[0];
if(_9f.containsCssClass(a,"rade_mode_html")){
_9c=_9e.Html;
}else{
if(_9f.containsCssClass(a,"rade_mode_design")){
_9c=_9e.Design;
}else{
_9c=_9e.Preview;
}
}
}
if(_9c!=this.get_mode()){
this.set_mode(_9c);
}
return $telerik.cancelRawEvent(e);
},_changeModeUI:function(_a1){
var _a2=Sys.UI.DomElement;
var _a3=Telerik.Web.UI.EditModes;
var _a4="rade_mode_";
switch(_a1){
case _a3.Html:
_a4+="html";
break;
case _a3.Design:
_a4+="design";
break;
case _a3.Preview:
_a4+="preview";
break;
}
var _a5=this._getModeButtonsWrapper();
var as=_a5.getElementsByTagName("A");
for(var i=0;i<as.length;i++){
var a=as[i];
_a2.removeCssClass(a,"rade_mode_selected");
if(_a2.containsCssClass(a,_a4)){
_a2.addCssClass(a,"rade_mode_selected");
}
}
},_isEditModeEnabled:function(_a9){
return _a9&this._editModes?true:false;
},get_mode:function(){
return this._mode;
},set_mode:function(_aa){
this._setEditableDelegate=Function.createDelegate(this,function(){
this.remove_editReady(this._setEditableDelegate);
var _ab=(this._mode==_ac.Design);
this.set_editable(_ab);
this.toggleEnhancedEdit(_ab);
this._setEditableDelegate=null;
});
this.add_editReady(this._setEditableDelegate);
var _ad=this._mode;
var _ac=Telerik.Web.UI.EditModes;
if(_ad==_ac.Html||_aa==_ac.Html){
var _ae=this.get_html(true);
this._mode=_aa;
this._showTextArea(this._mode==_ac.Html);
this.set_html(_ae);
}else{
this._mode=_aa;
this._showTextArea(this._mode==_ac.Html);
}
this._changeModeUI(_aa);
if(this._mode!=_ac.Preview){
this.setFocus();
if(this.isFirefox&&!this._document.body){
}else{
this.set_editable(true);
}
if(this._mode==_ac.Design){
this.toggleEnhancedEdit(true);
}
}else{
this.set_editable(false);
this.toggleEnhancedEdit(false);
}
this.setFocus();
var _af=this.get_id();
var _b0=$get(_af+"Wrapper");
var _b1=_b0.offsetHeight+"px";
this.raiseEvent("modeChange",Sys.EventArgs.Empty);
this._updateEditorSize(_b1);
},_getTextIframe:function(){
if(!this._textIframe){
var _b2=this.get_contentAreaElement();
if(_b2){
this._textIframe=_b2.cloneNode(true);
this._textIframe.style.position="absolute";
var _b3=this._textIframe.style;
_b3.height="2px";
_b3.width="2px";
_b2.parentNode.appendChild(this._textIframe);
var doc=this._textIframe.contentWindow.document;
doc.designMode="off";
var _b5=doc.open("text/html","replace");
var _b6="<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 (_b5)=="undefined"){
_b5=doc;
}
_b5.write(_b6);
_b5.close();
}
}
return this._textIframe;
},_getTextArea:function(){
var _b7=this._getTextIframe();
return _b7.contentWindow.document.body.firstChild;
},get_textArea:function(){
return this._getTextArea();
},_showTextArea:function(_b8){
var _b9=this._getTextIframe();
var _ba=this.get_contentAreaElement();
if(_b8){
if($telerik.isSafari){
_ba.style.width="0px";
_ba.style.height="0px";
}else{
_ba.style.display="none";
}
_b9.style.display="";
_b9.style.position="";
_b9.style.height="100%";
_b9.style.width="100%";
}else{
if($telerik.isSafari){
_ba.style.width="100%";
_ba.style.height="100%";
}else{
_ba.style.display="";
}
_b9.style.display="none";
}
},_setContentAsText:function(_bb){
var _bc=this._getTextArea();
_bc.value=_bb;
},_getContentAsText:function(){
var _bd=this._getTextArea();
var _be=_bd.value;
return _be;
},set_html:function(_bf,_c0,_c1){
var _c2=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_c2.Html){
var cmd=new Telerik.Web.UI.Editor.GenericCommand(_c0?_c0:"Set HTML",this.get_contentWindow());
this._setContentAreaHtml(_bf);
this.executeCommand(cmd,_c1);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}else{
this._setContentAsText(_bf);
}
},get_html:function(_c4){
var _c5=null;
var _c6="";
var _c7=this.get_mode();
var _c8=Telerik.Web.UI.EditModes;
if(_c7==_c8.Html){
return this._getContentAsText();
}else{
if(this._fullPage){
if(this._document){
_c5=this._document.getElementsByTagName("HTML")[0];
_c5=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(_c5);
var _c9=this._getAllSheets(_c5);
for(var i=0;i<_c9.length;i++){
var _cb=_c9[i];
var _cc=_cb.getAttribute("id");
if(_cc&&_cc.indexOf("RADEDITORSTYLESHEET")==0){
_cb.parentNode.removeChild(_cb);
}
}
if($telerik.isIE||$telerik.isOpera){
_c5.getElementsByTagName("BODY")[0].removeAttribute("contentEditable");
}
}
}else{
if(this.get_contentArea()){
if(true==_c4){
_c5=Telerik.Web.UI.Editor.Utils.cloneNodeWithChildren(this.get_contentArea());
if($telerik.isIE||$telerik.isOpera){
_c5.removeAttribute("contentEditable");
}
}else{
_c5=this.get_contentArea();
}
}
}
}
if(_c5){
if(true==_c4){
_c6=this.get_filtersManager().getHtmlContent(_c5);
}else{
_c6=_c5.innerHTML;
}
}
if(_c6.indexOf("<body")==0){
_c6=_c6.trim();
_c6=_c6.substring(_c6.indexOf(">")+1,_c6.length-7);
_c6=_c6.trim();
}
if(this._fullPage&&this._doctypeString){
_c6=this._doctypeString+"\n"+_c6;
}
return _c6;
},set_initialContent:function(){
this._initialContent=this.get_html(true);
},get_initialContent:function(){
return this._initialContent;
},get_text:function(){
var _cd=Telerik.Web.UI.EditModes;
if(this.get_mode()!=_cd.Html){
var _ce="";
var _cf=this.get_contentArea();
if(_cf){
if(_cf.innerText){
_ce=_cf.innerText;
}else{
if(_cf.textContent!=null){
_ce=_cf.textContent;
}else{
_ce=_cf.innerHTML.replace(/<\/?[^>]*>/ig,"");
}
}
}
return _ce;
}else{
return this._getTextArea().value.replace(/<\/?[^>]*>/ig,"");
}
},_getUniqueStyleSheetId:function(i){
return "RADEDITORSTYLESHEET"+i;
},_getAllSheets:function(_d1){
if(!_d1){
alert("RadEditor._getAllSheets called with no document object provided");
}
var _d2=_d1.getElementsByTagName("link");
var _d3=_d1.getElementsByTagName("style");
var _d4=[];
for(var x=0;_d2[x];x++){
var rel=_d2[x].rel?_d2[x].rel:_d2[x].getAttribute("rel");
if(typeof (rel)=="string"&&rel.toLowerCase().indexOf("style")+1){
Array.add(_d4,_d2[x]);
}
}
for(var x=0;_d3[x];x++){
Array.add(_d4,_d3[x]);
}
return _d4;
},_getClassName:function(_d7){
var str=_d7&&_d7.selectorText?_d7.selectorText:"";
var _d9=str.lastIndexOf(".");
if(_d9==-1){
return "";
}
var _da=str.indexOf(" ",_d9);
if(-1==_da){
_da=str.indexOf(":",_d9);
}
if(-1==_da){
_da=str.length;
}
return str.substring((_d9+1),_da);
},_createCssFilterObject:function(){
if(this._cssClassesHash){
return;
}
var _db=this.get_cssClasses();
if(_db&&_db.length>0){
var obj={};
var _dd=_db.length;
for(var i=0;i<_dd;i++){
var _df=_db[i][0];
var _e0=_db[i][1];
obj[_df.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})]=_e0;
}
this._cssClassesHash=obj;
}
},_getFilteredCssClasses:function(_e2){
this._createCssFilterObject();
if(_e2&&this._cssClassesHash){
var _e3=[];
var _e4=_e2.length;
for(var _e5=0;_e5<_e4;_e5++){
var _e6=_e2[_e5];
if(outAlias=this._checkCssFilter(_e6[1].selectorText)){
_e6[2]=outAlias;
_e3[_e3.length]=_e6;
}
}
return _e3;
}else{
return _e2;
}
},_checkCssFilter:function(_e7){
if(!_e7||!this._cssClassesHash){
return null;
}
return this._cssClassesHash[_e7.replace(/(.*?)\./ig,function($1){
return $1.toUpperCase();
})];
},getCssArray:function(_e9){
var _ea=this.get_document();
var _eb=[];
for(var i=0;i<_ea.styleSheets.length;i++){
var _ed=_ea.styleSheets[i];
this._getStyleSheetRules(_eb,_ed,_e9);
}
_eb=this._getFilteredCssClasses(_eb);
return _eb;
},_getStyleSheetRules:function(_ee,_ef,_f0){
var _f1=_ef.href;
if(_f1&&_f1.indexOf("WebResource.axd?")>-1){
return;
}
var _f2=(_ef.rules)?_ef.rules:_ef.cssRules;
if($telerik.isIE&&_ef.imports){
for(var k=0;k<_ef.imports.length;k++){
this._getStyleSheetRules(_ee,_ef.imports[k],_f0);
}
}
for(var j=0;j<_f2.length;j++){
var _f5=_f2[j];
if(_f5&&_f5.cssText){
var _f6=_f5.cssText.toLowerCase();
if(_f6.indexOf("@import")>=0&&_f5.parentStyleSheet&&_f5.styleSheet&&_f5.parentStyleSheet!=_f5.styleSheet){
this._getStyleSheetRules(_ee,_f5.styleSheet,_f0);
continue;
}
}
var str=_f5&&_f5.selectorText?_f5.selectorText:"";
var _f8=str.lastIndexOf(".");
if(_f8<0){
continue;
}
var _f8=str.lastIndexOf(":");
if(_f8>0){
continue;
}
var _f9=this._getClassName(_f5);
_ee[_ee.length]=[_f9,_f5];
}
},copyStyleSheets:function(_fa,_fb){
if(null==_fa&&null==_fb){
return;
}
var _fc=0;
var _fd=null;
if(_fb.styleSheets.length==0){
if(_fb.createStyleSheet){
_fb.createStyleSheet();
}else{
css=_fb.createElement("style");
css.media="all";
css.type="text/css";
var _fe=_fb.getElementsByTagName("head")[0];
_fe.appendChild(css);
_fd=css;
}
}
if(_fb.styleSheets[0]){
_fd=_fb.styleSheets[0];
}
for(var i=0;i<_fa.styleSheets.length;i++){
try{
var _100=_fa.styleSheets[i];
var _101=_100.href;
var _102=false;
if($telerik.isFirefox){
if(_100.ownerNode&&_100.ownerNode.tagName.toLowerCase()=="style"){
_102=true;
}
}
if(_101&&!_102){
continue;
}
var _103=(_100.rules)?_100.rules:_100.cssRules;
for(var j=0;j<_103.length;j++){
var _105=_103[j];
if(_fd.addRule){
var _106=_105.selectorText;
var oCss=_105.style.cssText;
if(oCss&&_106){
_fd.addRule(_106,oCss,_fc);
}
}else{
if(_fd.insertRule){
_fd.insertRule(_105.cssText,_fc);
}else{
var oCss=_105.selectorText+"{"+_105.style.cssText+"}";
var _108=_fb.createTextNode(oCss);
_fd.appendChild(_108);
}
}
_fc++;
}
}
catch(exc){
}
}
},_setContentAreaHtml:function(_109,_10a){
var _10b=this.get_filtersManager().getDesignContent(_109);
this.set_contentHiddenTextareaValue(_10b);
var _10c=null;
if(-1!=_10b.toLowerCase().indexOf("<html")){
this._fullPage=true;
_10c=_10b;
var _10d=new RegExp("(<!DOCTYPE(.|\\n)*?>)(.|\\n)*?","g");
this._doctypeString=(_10c.match(_10d))?_10c.match(_10d)[0]:"";
}else{
this._fullPage=false;
}
if(null!=_10c||true==_10a){
var _10e=this;
var _10f=function(){
_110=false;
try{
_10e._document=_10e._contentAreaElement.contentWindow.document;
_10e._contentWindow=_10e._contentAreaElement.contentWindow;
_10e._contentArea=_10e._document.body;
_10e.get_filtersManager().getDesignContentDom(_10e.get_contentArea());
var _111=1;
Telerik.Web.UI.Editor.Utils.addStyleSheet(_10e.get_contentAreaCssFile(),_10e._document,_10e._getUniqueStyleSheetId(0));
var _112=_10e.get_cssFiles();
if(_112.length>0){
for(var i=0;i<_112.length;i++){
var _114=_10e._getUniqueStyleSheetId(_111++);
Telerik.Web.UI.Editor.Utils.addStyleSheet(_112[i],_10e._document,_114);
}
}else{
if(!_10e._fullPage){
_10e.copyStyleSheets(document,_10e._document);
var _115=_10e._getAllSheets(document);
for(var i=0;i<_115.length;i++){
var _114=_10e._getUniqueStyleSheetId(_111++);
var _116=_115[i];
if(_116.tagName=="LINK"){
var _117=_116.href;
if(_117&&_117.indexOf("WebResource.axd?")>-1){
continue;
}
if(_117){
Telerik.Web.UI.Editor.Utils.addStyleSheet(_116.getAttribute("href"),_10e._document,_114);
}
}else{
if(_116.tagName=="STYLE"){
}
}
}
}
}
var _118=Telerik.Web.UI.Editor.PopupController;
if(_118){
_118.detachFromDocument(_10e._document);
_118.attachToDocument(_10e._document);
}
_10e._initEvents();
if(_10e.get_mode()!=Telerik.Web.UI.EditModes.Preview){
_10e.set_editable(true);
}else{
_10e.set_editable(false);
}
_10e.toggleEnhancedEdit(true);
if(_10e._document&&_10e._document.body){
_10e.raiseEvent("editReady",Sys.EventArgs.Empty);
}
}
catch(e){
}
};
if($telerik.isFirefox){
$addHandler(this._contentAreaElement,"load",function(){
if(_110){
_10f();
}
});
}
if(!_10c){
_10c="<head><style></style></head><body>"+_10b+"</body>";
}
try{
var _119=this._contentAreaElement.contentWindow.document;
if(_119&&_119.body){
var _11a=Telerik.Web.UI.Editor.PopupController;
if(_11a){
_11a.detachFromDocument(_119);
}
}
_119.open();
_119.write(_10c);
_119.close();
var _110=false;
if(_119.body){
_10f();
}else{
_110=true;
}
}
catch(e){
}
}else{
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this._contentArea,_10b);
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 _11c=$get(id+"Center");
var _11d=this.get_contentAreaElement();
_11d.style.display="none";
_11c.appendChild(_11d);
_11d.style.height="100%";
_11d.style.display="";
this._created=true;
},_updateEditorSize:function(_11e,_11f){
var _120=this._tableElement;
var _121=_11e?_11e:_120.style.height;
if(true==_11f){
_121=_120.offsetHeight+"px";
}
if(parseInt(_121)==0){
return;
}
_120.style.height=_121;
if(this.isIE){
this._fixIeHeight(_120,_121);
}else{
var _122=this;
window.setTimeout(function(){
_122._fixIeHeight(_120,_121);
},0);
}
_120.parentNode.style.height=_121;
},_fixIeHeight:function(_123,_124){
if("CSS1Compat"==document.compatMode){
var _125=(_123.offsetHeight-parseInt(_124));
if(_125>0){
var _126=(parseInt(_123.style.height)-_125);
if(_126>0){
_123.style.height=_126+"px";
}
}
}
},setSize:function(_127,_128){
var _127=parseInt(_127);
var _128=parseInt(_128);
var _129=this;
var _12a=$get(_129.get_id()+"Wrapper");
_12a.style.height="";
var _12b=_12a.parentNode;
_12b.style.width=_127+"px";
_12b.style.height=_128+"px";
_129._fixIeHeight(_12b,_128);
if(_129.isIE){
_12a.style.height=_128+"px";
_129._fixIeHeight(_12a,_128);
}else{
_12a.style.height="100%";
}
},pasteHtml:function(_12c,_12d,_12e,_12f,_130){
if(!this.get_editable()){
return;
}
var args=new Telerik.Web.UI.EditorCommandEventArgs(_12d,null,_12c);
if(false==this._executeCommandEvent("pasteHtml",_12d,args)){
return;
}
if(_12c!=args.get_value()){
_12c=args.get_value();
}
var _132=this.get_localization()[_12d];
if(_132){
_12d=_132;
}
var mode=this.get_mode();
if(Telerik.Web.UI.EditModes.Design==mode){
this.setFocus();
this.executeCommand(new Telerik.Web.UI.Editor.PasteHtmlCommand(_12d,this._contentWindow,_12c,_12e),null,_130);
if(_12f!=false){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
}else{
if(Telerik.Web.UI.EditModes.Html==mode){
var _134=this._getTextArea();
if(this.isIE){
_134.setActive();
var _135=document.selection.createRange();
_135.text=_12c;
}else{
if(_134.setSelectionRange){
var _136=_134.selectionStart;
var _137=_134.selectionEnd;
var _138=_134.value.substring(_136,_137);
var _139=_12c;
_134.value=_134.value.substring(0,_136)+_139+_134.value.substring(_137);
_134.setSelectionRange(_136+_139.length,_136+_139.length);
this.setFocus();
}
}
}
}
},fire:function(_13a,args){
if(false==this._executeCommandEvent("commandExecuting",_13a,args)){
return;
}
if(this._optionalIgnoredTools&&!this._optionalIgnoredTools[_13a]){
return;
}
this.setActive();
this._pendingTextTypeCmd=null;
var _13c=Telerik.Web.UI.Editor.CommandList[_13a];
var _13d=false;
if(_13c){
_13d=(false!=_13c(_13a,this,args));
}else{
alert("The command "+_13a+" is not implemented yet.");
}
if(_13d){
if(!$telerik.isOpera){
this.setFocus();
}
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}
this._executeCommandEvent("commandExecuted",_13a,args);
},_executeCommandEvent:function(_13e,_13f,args){
if(!args){
args=new Telerik.Web.UI.EditorCommandEventArgs(_13f);
}
this.raiseEvent(_13e,args);
if(args.get_cancel&&args.get_cancel()){
return false;
}
return true;
},_onWindowResize:function(){
var _141=this._getViewportBounds();
this.setSize(_141.width,_141.height,false);
},_registerWindowResizeHandler:function(_142){
if(_142){
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 _143=$telerik.getClientBounds();
var _144=document.documentElement.scrollLeft||document.body.scrollLeft;
var _145=document.documentElement.scrollTop||document.body.scrollTop;
_143.scrollLeft=_144;
_143.scrollTop=_145;
return _143;
},_handleParentsWithOverflow:function(_146){
if(false==_146){
if(!this._parentsWithOverflow){
return;
}
var _147=this._parentsWithOverflow;
var _148=_147.length;
for(var i=0;i<_148;i++){
var _14a=_147[i];
if(_14a[0]){
var node=_14a[0];
node.style.overflow=_14a[1];
node.style.height=_14a[2];
}
}
this._parentsWithOverflow=null;
}else{
this._parentsWithOverflow=[];
var _147=this._parentsWithOverflow;
var _14c=this._getRootNode().parentNode;
while(_14c&&_14c.tagName!="BODY"){
var _14d=$telerik.getCurrentStyle(_14c,"overflow");
if(_14d){
_147[_147.length]=[_14c,_14c.style.overflow,_14c.style.height];
_14c.style.overflow="visible";
_14c.style.height="auto";
}
_14c=_14c.parentNode;
}
}
},_getRootNode:function(){
return $get(this.get_id()+"Wrapper").parentNode;
},isFullScreen:function(){
return this._isFullScreen;
},toggleScreenMode:function(){
var _14e=this;
if(!_14e._isFullScreen){
document.body.scroll="no";
document.body.style.margin="0px";
if(document.documentElement){
document.documentElement.style.overflow="hidden";
}
var _14f=_14e._getRootNode();
_14e._preFullScreenBounds=$telerik.getBounds(_14f);
_14e._handleParentsWithOverflow(true);
_14e._onWindowResize();
_14e._preFullScreenBrowserRect=_14e._getViewportBounds();
var _150=$telerik.getLocation(_14f);
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_150.x,_150.y);
_14e._isFullScreen=true;
_14e._registerWindowResizeHandler(true);
}else{
_14e._registerWindowResizeHandler(false);
document.body.scroll="";
document.documentElement.style.overflow="";
try{
document.body.style.margin="";
}
catch(e){
}
_14e._isFullScreen=false;
_14e._handleParentsWithOverflow(false);
var _151=_14e._preFullScreenBounds;
_14e.setSize(_151.width,_151.height,false);
var _150=_14e._preFullScreenBrowserRect;
Telerik.Web.UI.Editor.Utils.restoreBrowserPosition(_150.scrollLeft,_150.scrollTop);
}
_14e.set_editable(true);
_14e.setFocus();
var _152=_14e.getToolByName("ToggleScreenMode");
if(_152){
_152.setOn(_14e._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(_153){
if($telerik.isSafari&&this._contentHiddenTextarea.innerText!=null){
this._contentHiddenTextarea.innerText=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_153);
}else{
this._contentHiddenTextarea.value=Telerik.Web.UI.Editor.Utils.encodePostbackContent(_153);
}
},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(_155){
this._toolAdapter=_155;
},get_fullPage:function(){
return this._fullPage;
},set_fullPage:function(_156){
this._fullPage=_156;
},get_dialogOpener:function(){
return this._dialogOpener;
},set_dialogOpener:function(_157){
this._dialogOpener=_157;
},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(_158){
this._links=_158;
},get_language:function(){
if(null==this._language){
return "en-us";
}
return this._language.toLowerCase();
},set_language:function(_159){
this._language=_159;
},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(_15a){
this._colors=_15a;
},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(_15b){
this._fontNames=_15b;
},get_fontSizes:function(){
if(null==this._fontSizes){
return [1,2,3,4,5,6,7];
}
return this._fontSizes;
},set_fontSizes:function(_15c){
this._fontSizes=_15c;
},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(_15d){
this._symbols=_15d;
},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(_15e){
this._realFontSizes=_15e;
},get_contextMenus:function(){
if(null==this._contextMenus){
return [];
}
return this._contextMenus;
},set_contextMenus:function(_15f){
this._contextMenus=_15f;
},get_snippets:function(){
if(null==this._snippets){
return [];
}
return this._snippets;
},set_snippets:function(_160){
this._snippets=_160;
},get_cssClasses:function(){
if(null==this._cssClasses){
return [];
}
return this._cssClasses;
},set_cssClasses:function(_161){
this._cssClasses=_161;
},get_cssFiles:function(){
if(null==this._cssFiles){
return [];
}
return this._cssFiles;
},set_cssFiles:function(_162){
this._cssFiles=_162;
},get_languages:function(){
if(null==this._languages){
return [];
}
return this._languages;
},set_languages:function(_163){
this._languages=_163;
},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(_164){
this._paragraphs=_164;
},get_autoResizeHeight:function(){
return this._autoResizeHeight;
},set_autoResizeHeight:function(_165){
this._autoResizeHeight=_165;
},get_toolbarMode:function(){
return this._toolbarMode;
},set_toolbarMode:function(_166){
this._toolbarMode=_166;
},get_editModes:function(){
return this._editModes;
},set_editModes:function(_167){
this._editModes=_167;
},get_stripFormattingOptions:function(){
return this._stripFormattingOptions;
},set_stripFormattingOptions:function(_168){
this._stripFormattingOptions=_168;
},get_contentFilters:function(){
return this._contentFilters;
},set_contentFilters:function(_169){
this._contentFilters=_169;
},get_newLineBr:function(){
return this._newLineBr;
},set_newLineBr:function(_16a){
this._newLineBr=_16a;
},get_contentAreaCssFile:function(){
return this._contentAreaCssFile;
},set_contentAreaCssFile:function(_16b){
this._contentAreaCssFile=_16b;
},get_mozillaFlashOverlayImage:function(){
return this._mozillaFlashOverlayImage;
},set_mozillaFlashOverlayImage:function(_16c){
this._mozillaFlashOverlayImage=_16c;
},get_toolAdapterType:function(){
return this._toolAdapterType;
},set_toolAdapterType:function(_16d){
this._toolAdapterType=_16d;
},get_toolJSON:function(){
return this._toolJSON;
},set_toolJSON:function(_16e){
this._toolJSON=_16e;
},get_modulesJSON:function(){
return this._modulesJSON;
},set_modulesJSON:function(_16f){
this._modulesJSON=_16f;
},get_contextMenusJSON:function(){
return this._contextMenusJSON;
},set_contextMenusJSON:function(_170){
this._contextMenusJSON=_170;
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_171){
this._uniqueID=_171;
},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(_173){
this._skin=_173;
},_registerClientValidation:function(){
if(typeof (Page_ClientValidate)=="function"){
var _174=Page_ClientValidate;
Page_ClientValidate=Function.createDelegate(this,function(_175){
var _176=this.get_element();
if(_176){
var _177=this.get_html(true);
this.set_contentHiddenTextareaValue(_177);
_176.value=_177;
_176.setAttribute("value",_177);
}
_176=null;
return _174(_175);
});
}
},_registerPostBackHandlers:function(){
this._saveContentDelegate=Function.createDelegate(this,function(e){
this.raiseEvent("submit",Sys.EventArgs.Empty);
var _179=this.get_html(true);
this.set_contentHiddenTextareaValue(_179);
});
var _17a=this._contentHiddenTextarea.form;
$telerik.addExternalHandler(_17a,"submit",this._saveContentDelegate);
if(typeof (__doPostBack)!="undefined"){
var _17b=this._saveContentDelegate;
var _17c=__doPostBack;
__doPostBack=function(_17d,_17e){
_17b();
_17c(_17d,_17e);
};
}
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;
}
_17a=null;
},toggleEnhancedEdit:function(_180){
if(!this.get_document()){
return false;
}
var _181=this.get_document().getElementById(this._getUniqueStyleSheetId(0));
if(_181){
if(_180==null){
_180=_181.disabled;
}
_181.disabled=!_180;
var tool=this.getToolByName("ToggleTableBorder");
if(tool){
tool.setOn(_180);
}
return _180;
}else{
return false;
}
},pasteHyperLink:function(_183,_184){
if($telerik.isIE){
var sel=this.getSelectedElement();
if(sel.tagName=="IMG"&&sel.parentNode&&sel.parentNode.tagName=="A"){
var _186=sel.parentNode;
_186.parentNode.removeChild(_186);
}
if(sel.tagName=="IMG"){
_183.innerHTML=Telerik.Web.UI.Editor.Utils.getOuterHtml(sel);
}
}
if($telerik.isOpera){
var sel=this.getSelectedElement();
if(sel.tagName=="A"){
this.fire("Unlink");
}
}
if("DocumentManager"==_184){
var _187=this.getSelection().getText();
if(""!=_187.trim()){
_183.innerHTML=_187;
}
}
var _188=Telerik.Web.UI.Editor.Utils.getOuterHtml(_183);
this.pasteHtml(_188,_184);
},_saveTypedContent:function(_189,_18a){
if(this._pendingTextTypeCmd){
this._pendingTextTypeCmd.update();
}
if(true!=_189){
this._pendingTextTypeCmd=null;
}
},_attachIEBodyHandlers:function(_18b){
var body=null;
if(this._document&&this._document.body){
body=this._document.body;
}
if(!body){
return;
}
if(_18b){
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 _18d=this;
var _18e=_18d.fire;
_18d.fire=function(_18f,_190){
if(_18f!="Copy"){
_18d._saveTypedContent(true,"editor.fire "+_18f+" executing");
}
_18e.call(_18d,_18f,_190);
try{
if(_18f=="Undo"&&!_18d.isIE&&_18d._document.body.toLowerCase().trim()=="<br>"){
_18d._document.body.innerHTML="<br>";
}
}
catch(e){
}
};
this.attachEventHandler("onclick",function(e){
_18d._saveTypedContent(false,"Saving typed content because of oclick (somewhere else)");
if(_18d.getSelectionHtml()){
_18d._pendingTextTypeCmd=new Telerik.Web.UI.Editor.TextTypeCommand(_18d.get_localization()["Typing"],_18d.get_contentWindow());
_18d.executeCommand(_18d._pendingTextTypeCmd,false);
}
});
if(!this.isIE){
this.attachEventHandler("keypress",function(e){
if(_18d._onKeyPressed(e)){
e.preventDefault();
return false;
}
});
this.attachEventHandler("click",function(e){
if(!_18d.isFirefox){
return;
}
if(!_18d.get_editable()){
return;
}
if("on"==_18d._document["designMode"]){
window.setTimeout(function(){
_18d.set_editable(true);
_18d.setFocus();
},100);
}
});
}
this.attachEventHandler("keydown",function(e){
if(_18d.isOpera){
return _18d._onKeyDown(e);
}else{
_18d._onKeyDown(e);
}
});
this.attachEventHandler("onmousedown",function(){
_18d._saveTypedContent(false,"Saving typed content onmousedown");
});
this.attachEventHandler("keyup",Function.createDelegate(this,this._onKeyUp));
var _195=Function.createDelegate(this,function(e){
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
});
this.attachEventHandler("mouseup",_195);
$telerik.addExternalHandler(document.body,"dragend",Function.createDelegate(this,this._onDocumentDragEnd));
this._attachIEBodyHandlers(true);
},_onKeyDown:function(e){
var _198=e.keyCode;
switch(_198){
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 _199=this;
var _19a=function(){
var _19b=_199.getSelectedElement();
if(_19b&&_19b.tagName=="EMBED"){
_19b.setAttribute("hidden","true");
_19b.setAttribute("id","FileToDelete");
window.setTimeout(function(){
var _19c=_199._document.getElementById("FileToDelete");
if(_19c.parentNode&&_19c.parentNode.removeChild){
_19c.parentNode.removeChild(_19c);
}
},100);
$telerik.cancelRawEvent(e);
return true;
}
};
var _19d=_19a();
if(_19d){
return false;
}
try{
var _19e=_199._document.selection.createRange();
var _19f=null;
if(_19e&&_19e.duplicate){
_19f=_19e.duplicate();
}
if(8==e.keyCode){
_19e.moveStart("character",-1);
}else{
_19e.moveEnd("character",1);
}
if(_19e.parentElement().tagName=="EMBED"){
_19e.select();
_19a();
if(_19f&&_19f.select){
_19f.select();
}
}
}
catch(ex){
}
var _1a0=new Telerik.Web.UI.Editor.Selection(this._contentWindow);
if(_1a0&&_1a0.isControl()){
var _1a1=_1a0.getRange();
_1a1.execCommand("Delete");
$telerik.cancelRawEvent(e);
}
}
return;
}
var _1a2=e.target?e.target:e.srcElement;
if(_1a2&&"INPUT"!=_1a2.tagName){
var _1a3=this._shortCutManager.isShortCutHit(e);
if(null!=_1a3&&_1a3.get_name()=="Copy"){
this._shortcutHit=false;
return;
}
this._shortcutHit=(null!=_1a3);
if(this._shortcutHit){
this.fire(_1a3.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=_1a3.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(_1a7,_1a8,_1a9,_1aa){
var _1ab=this;
var _1ac=(this.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _1ad=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_1a8,_1ab.get_stripFormattingOptions(),_1ab.get_localization()["askwordcleaning"],_1ac);
if(_1a7){
_1a7.select();
}
if(_1ad){
window.setTimeout(function(){
if(_1aa&&_1a7){
_1a7.select();
}
_1ab.pasteHtml(_1ad);
},5);
return $telerik.cancelRawEvent(_1a9);
}
return true;
},_onPaste:function(_1ae){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _1af=this.createRestorePoint();
var _1b0=this.getSelectionHtml()?true:false;
var _1b1=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
return this._insertPastedContent(_1af,_1b1,_1ae,_1b0);
},_onBeforePaste:function(_1b2){
if(_1b2){
if(this.get_stripFormattingOptions()==Telerik.Web.UI.StripFormattingOptions.NoneSupressCleanMessage){
return;
}
var _1b3=new Telerik.Web.UI.Editor.GenericCommand("Paste",this._contentWindow);
var _1b4=this._document.getElementById("tmpPasteIE");
if(_1b4){
_1b4.removeAttribute("id");
return false;
}
var _1b5=this._document.selection.createRange();
var _1b6=Telerik.Web.UI.Editor.Utils.getUniqueID();
if(_1b5.pasteHTML){
_1b5.pasteHTML("&nbsp;<font id='"+_1b6+"'>&nbsp;</font>");
}
var _1b7=Telerik.Web.UI.Editor.Utils.getPasteContainer();
_1b7.innerHTML="";
_1b7.setActive();
var _1b8=this;
window.setTimeout(function(){
var _1b9=_1b7.innerHTML;
var _1ba=(_1b8.get_contentFilters()&Telerik.Web.UI.EditorFilters.RemoveScripts)>0;
var _1bb=Telerik.Web.UI.Editor.Utils.cleanPastedContent(_1b9,_1b8.get_stripFormattingOptions(),_1b8.get_localization()["askwordcleaning"],_1ba);
var _1bc=_1b8._document.getElementById(_1b6);
_1b8.setActive(true);
_1b8._pendingCutPasteCommand=null;
var _1bd=_1b8._document.body.createTextRange();
_1bd.moveToElementText(_1bc);
_1bd.moveStart("character",-1);
_1bd.select();
_1bd.pasteHTML(_1bb);
_1b8.executeCommand(_1b3);
_1b8.setActive(true);
_1b8.setFocus(true);
},0);
}else{
}
},_onResizeStart:function(e){
var _1bf=this.getSelectedElement();
if(_1bf==e.srcElement){
var _1c0=this.get_localization()["ResizeCommand"]||"Resize";
this._pendingResizeCmd=new Telerik.Web.UI.Editor.GenericCommand(_1c0,this._contentWindow);
}
},_onResizeEnd:function(e){
if(this._pendingResizeCmd){
this.executeCommand(this._pendingResizeCmd);
}
},_onDragStart:function(e){
var _1c3=this.get_localization()["MoveCommand"]||"Move";
this._pendingMoveCommand=new Telerik.Web.UI.Editor.GenericCommand(_1c3,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 _1c5=this._startRange.item(0);
if("IMG"==_1c5.tagName&&"A"==_1c5.parentNode.tagName&&_1c5.parentNode.childNodes.length==1){
_1c5=_1c5.parentNode;
}
rng.moveToElementText(_1c5);
this._startRange=rng;
}
}
},_onDragEnd:function(e){
if(this._pendingMoveCommand){
if(this._startRange){
var _1c7=this._contentWindow.document.selection.createRange();
if(_1c7.length){
var rng=this._contentWindow.document.body.createTextRange();
rng.moveToElementText(_1c7.item(0));
_1c7=rng;
}
try{
if(_1c7.compareEndPoints&&0!=_1c7.compareEndPoints("StartToStart",this._startRange)&&0!=_1c7.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 _1ca=this.get_localization()["Drop"]||"Drop external content";
this._pendingDockCommand=new Telerik.Web.UI.Editor.GenericCommand(_1ca,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(_1cc){
this.get_events().addHandler("toggleScreenMode",_1cc);
},remove_toggleScreenMode:function(_1cd){
this.get_events().removeHandler("toggleScreenMode",_1cd);
},add_modeChange:function(_1ce){
this.get_events().addHandler("modeChange",_1ce);
},remove_modeChange:function(_1cf){
this.get_events().removeHandler("modeChange",_1cf);
},add_load:function(_1d0){
this.get_events().addHandler("load",_1d0);
},remove_load:function(_1d1){
this.get_events().removeHandler("load",_1d1);
},add_init:function(_1d2){
this.get_events().addHandler("init",_1d2);
},remove_init:function(_1d3){
this.get_events().removeHandler("init",_1d3);
},add_selectionChange:function(_1d4){
this.get_events().addHandler("selectionChange",_1d4);
},remove_selectionChange:function(_1d5){
this.get_events().removeHandler("selectionChange",_1d5);
},add_commandExecuting:function(_1d6){
this.get_events().addHandler("commandExecuting",_1d6);
},remove_commandExecuting:function(_1d7){
this.get_events().removeHandler("commandExecuting",_1d7);
},add_commandExecuted:function(_1d8){
this.get_events().addHandler("commandExecuted",_1d8);
},remove_commandExecuted:function(_1d9){
this.get_events().removeHandler("commandExecuted",_1d9);
},add_submit:function(_1da){
this.get_events().addHandler("submit",_1da);
},remove_submit:function(_1db){
this.get_events().removeHandler("submit",_1db);
},add_editReady:function(_1dc){
this.get_events().addHandler("editReady",_1dc);
},remove_editReady:function(_1dd){
this.get_events().removeHandler("editReady",_1dd);
},add_pasteHtml:function(_1de){
this.get_events().addHandler("pasteHtml",_1de);
},remove_pasteHtml:function(_1df){
this.get_events().removeHandler("pasteHtml",_1df);
}};
$telerik.makeCompatible(Telerik.Web.UI.RadEditor);
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);;