UNPKG

js-pkg

Version:
10 lines 310 kB
/*! * filename: ej.rte.min.js * version : 15.3.0.33 * Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ (function(n){typeof define=="function"&&define.amd?define(["./../common/ej.core.min","./../common/ej.data.min","./../common/ej.scroller.min","./../common/ej.draggable.min","./../common/ej.globalize.min","./ej.button.min","./ej.togglebutton.min","./ej.splitbutton.min","./ej.checkbox.min","./ej.radiobutton.min","./ej.dropdownlist.min","./ej.dialog.min","./ej.toolbar.min","./ej.editor.min","./ej.menu.min","./ej.tab.min","./ej.slider.min","./ej.treeview.min","./ej.uploadbox.min","./ej.splitter.min","./ej.colorpicker.min","./ej.fileexplorer.min","./ej.grid.min","./ej.tooltip.min"],n):n()})(function(){var n,t;(function(n,t,i){t.widget("ejRTE","ej.RTE",{element:null,model:null,_rootCSS:"e-rte",validTags:["textarea"],_addOnPersist:["value","height","width"],_setFirst:!1,_requiresID:!0,_operationHandler:null,angular:{require:["?ngModel","^?form","^?ngModelOptions"]},defaults:{allowEditing:!0,isResponsive:!1,allowKeyboardNavigation:!0,enableTabKeyNavigation:!0,cssClass:"",height:"370",width:"786",enabled:!0,htmlAttributes:null,externalCSS:null,enableXHTML:!1,importSettings:{url:""},exportToPdfSettings:{url:"",fileName:"PdfExport"},exportToWordSettings:{url:"",fileName:"WordExport"},validationRules:null,validationMessage:null,maxLength:7e3,minWidth:"400",maxWidth:null,minHeight:"280",maxHeight:null,showToolbar:!0,showFooter:!1,showHtmlSource:!1,showWordCount:!0,showCharCount:!0,showHtmlTagInfo:!0,showClearAll:!1,iframeAttributes:null,showClearFormat:!0,showContextMenu:!0,showFontOption:!0,autoFocus:!1,enableHtmlEncode:!1,showDimensions:!1,showRoundedCorner:!1,locale:"en-US",name:"",pasteCleanupSettings:{listConversion:!1,cleanCSS:!1,removeStyles:!1,cleanElements:!1},toolbarOverflowMode:"popup",tools:{formatStyle:["format"],edit:[],style:["bold","italic","underline","strikethrough"],alignment:["justifyLeft","justifyCenter","justifyRight","justifyFull"],lists:["unorderedList","orderedList"],indenting:["outdent","indent"],doAction:["undo","redo"],links:["createLink","removeLink"],images:["image"],media:["video"],tables:["createTable","addRowAbove","addRowBelow","addColumnLeft","addColumnRight","deleteRow","deleteColumn","deleteTable"],view:["fullScreen"],customTools:[],print:[],customOrderList:[],customUnOrderList:[],font:[],clipboard:[],clear:[],effects:[],casing:[],importExport:[]},tooltipSettings:{associate:"mouseenter",showShadow:!0,position:{stem:{horizontal:"left",vertical:"top"}},tip:{size:{width:5,height:5}},isBalloon:!1},toolsList:["formatStyle","font","style","effects","alignment","lists","indenting","clipboard","doAction","clear","links","images","media","tables","casing","customTools","view","print","edit","importExport"],colorCode:["000000","FFFFFF","C4C4C4","ADADAD","595959","262626","4f81bd","dbe5f1","b8cce4","95b3d7","366092","244061","c0504d","f2dcdb","e5b9b7","d99694","953734","632423","9bbb59","ebf1dd","d7e3bc","c3d69b","76923c","4f6128","8064a2","e5e0ec","ccc1d9","b2a2c7","5f497a","3f3151","f79646","fdeada","fbd5b5","fac08f","e36c09","974806"],format:[{text:"Paragraph",value:"<p>",spriteCssClass:"e-paragraph"},{text:"Quotation",value:"<blockquote>",spriteCssClass:"e-quotation"},{text:"Heading 1",value:"<h1>",spriteCssClass:"e-h1"},{text:"Heading 2",value:"<h2>",spriteCssClass:"e-h2"},{text:"Heading 3",value:"<h3>",spriteCssClass:"e-h3"},{text:"Heading 4",value:"<h4>",spriteCssClass:"e-h4"},{text:"Heading 5",value:"<h5>",spriteCssClass:"e-h5"},{text:"Heading 6",value:"<h6>",spriteCssClass:"e-h6"}],fontName:[{text:"Segoe UI",value:"Segoe UI"},{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"Courier New,Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"Lucida Console,Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"Times New Roman,Times,serif"},{text:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"8pt"},{text:"2 (10pt)",value:"10pt"},{text:"3 (12pt)",value:"12pt"},{text:"4 (14pt)",value:"14pt"},{text:"5 (18pt)",value:"18pt"},{text:"6 (24pt)",value:"24pt"},{text:"7 (36pt)",value:"36pt"}],tableRows:8,tableColumns:10,colorPaletteRows:6,colorPaletteColumns:6,showCustomTable:!0,value:null,undoStackLimit:50,enableResize:!0,enablePersistence:!1,enableRTL:!1,autoHeight:!1,zoomStep:"0.05",imageBrowser:{filePath:"",extensionAllow:"*.png,*.gif,*.jpg,*.jpeg",ajaxAction:"",ajaxSettings:""},fileBrowser:{filePath:"",extensionAllow:"*.doc,*.docx,*.pdf,*.txt",ajaxAction:""},change:null,execute:null,keydown:null,keyup:null,create:null,destroy:null,contextMenuClick:null,preRender:null,select:null},dataTypes:{enabled:"boolean",autoFocus:"boolean",enableHtmlEncode:"boolean",autoHeight:"boolean",enableXHTML:"boolean",isResponsive:"boolean",enablePersistence:"boolean",showRoundedCorner:"boolean",showCustomTable:"boolean",enableResize:"boolean",importSettings:{url:"string"},exportToPdfSettings:{url:"string",fileName:"string"},exportToWordSettings:{url:"string",fileName:"string"},pasteCleanupSettings:{listConversion:"boolean",cleanCSS:"boolean",removeStyles:"boolean",cleanElements:"boolean"},showDimensions:"boolean",showFontOption:"boolean",showClearFormat:"boolean",showClearAll:"boolean",showHtmlTagInfo:"boolean",showWordCount:"boolean",showCharCount:"boolean",showHtmlSource:"boolean",allowKeyboardNavigation:"boolean",enableTabKeyNavigation:"boolean",allowEditing:"boolean",showToolbar:"boolean",showFooter:"boolean",showContextMenu:"boolean",enableRTL:"boolean",toolsList:"array",colorCode:"array",toolbarOverflowMode:"enum",format:"data",fontName:"data",fontSize:"data",htmlAttributes:"data",iframeAttributes:"data",tools:{formatStyle:"array",font:"array",edit:"array",style:"array",effects:"array",alignment:"array",lists:"array",indenting:"array",clipboard:"array",doAction:"array",clear:"array",links:"array",media:"array",images:"array",tables:"array",casing:"array",customTools:"array",view:"array",print:"array",importExport:"array",customOrderList:"array",customUnOrderList:"array"}},_rteIconsList:{format:"format",bold:"e-bold_01",italic:"e-italic_01",underline:"e-underline_01",strikethrough:"e-strikethrough_01",justifyLeft:"e-align-left_01",justifyCenter:"e-align-center_01",justifyRight:"e-align-right_01",justifyFull:"e-align-justify_01",unorderedList:"e-bullets_01",orderedList:"orderedList",outdent:"outdent",indent:"indent",undo:"undo",redo:"redo",createLink:"e-link_01",removeLink:"e-unlink_01",image:"e-image",video:"e-video",createTable:"e-table_02",addRowAbove:"e-insert-row-above_02",addRowBelow:"e-insert-row-below_02",addColumnLeft:"e-insert-column-left_02",addColumnRight:"e-insert-column-right_02",deleteRow:"e-delete-row_01",deleteColumn:"e-delete-column_01",deleteTable:"deleteTable",fullScreen:"fullScreen",superscript:"e-superscript_01",subscript:"e-subscript_01",upperCase:"e-uppercase_01",lowerCase:"e-lowercase_01",zoomIn:"e-zoom-in",zoomOut:"e-zoom-out",print:"print","import":"e-upload",wordExport:"e-icon e-word-export",pdfExport:"e-icon e-pdf-export",findAndReplace:"findAndReplace",cut:"e-cut_01",copy:"e-copy_02",paste:"e-paste_01",clearFormat:"clearFormat",clearAll:"e-delete_05",fontName:"fontName",fontSize:"fontSize",fontColor:"e-font",backgroundColor:"e-background-color",rteResize:"e-resize-handle",rteSource:"e-file-code",customTableImage:"e-table",resize:"e-full-screen-collapse_01",maximize:"e-full-screen-expand_01",openLink:"",deleteTables:"",insertTable:"",tableProperties:"",imageProperties:""},observables:["value"],value:t.util.valueFunction("value"),_setModel:function(i){var r,f,e,h,o,l,c,u,s;this._isInteraction=!1;for(r in i){switch(r){case"allowEditing":this._enableEdit(i[r]);break;case"autoFocus ":this.model.autoFocus=i[r];i[r]&&this._focus();break;case"showToolbar":i[r]?t.isNullOrUndefined(this._rteToolbar)?this._renderToolBar():(this._rteToolbar.show(),this.model.isResponsive&&this._toolBarObj._reSizeHandler()):this._rteToolbar.hide();break;case"showFooter":this.model.showFooter=i[r];i[r]?t.isNullOrUndefined(this._rteFooter)?this._renderFooter():this._rteFooter.show():this._rteFooter.hide();break;case"pasteCleanupSettings":this.model.pasteCleanupSettings=i[r];t.clipboardCleaner&&(this._pasteCleaner||this._enableContentCleaner(),this._pasteCleaner&&(this._pasteCleaner.filterOptions=i[r]));case"isResponsive":this.model.isResponsive=i[r];this._renderToolBarList();f=n(this._rteIframe).outerHeight();e=n(this._rteToolbar).outerHeight();n(this._rteWapper).height(f+e);t.isNullOrUndefined(n(this._rteFooter))||(h=n(this._rteFooter).outerHeight(),n(this._rteWapper).height(f+h+e));break;case"enabled":this._disabled(i[r]);break;case"height":this.model.height=i[r];this._rteWapper.height(i[r]);break;case"width":this.model.height=i[r];this._rteWapper.css("width",i[r]);break;case"cssClass":this._changeSkin(i[r]);break;case"showHtmlSource":this._footerElement("div.e-rte-source",i[r]);break;case"showHtmlTagInfo":this._footerElement("div.e-rte-htmltaginfo",i[r]);break;case"showWordCount":this.model.showWordCount=i[r];this._createCountElement(i[r],this._wordCount);break;case"showCharCount":this.model.showCharCount=i[r];this._createCountElement(i[r],this._charCount);break;case"tooltipSettings":this.model.tooltipSettings=n.extend(!0,this.model.tooltipSettings,i[r]);this.model.showToolbar&&this._toolBarItems.ejToolbar("option","tooltipSettings",i[r]);this._renderTooltip(this.model.tooltipSettings);break;case"showClearAll":this._footerElement("div.clearAll",i[r]);break;case"showClearFormat":this._footerElement("div.clearFormat",i[r]);break;case"enableResize":this._footerElement("div.e-rte-resize",i[r]);break;case"fontName":this._fontStyleDDL.ejDropDownList({dataSource:i[r]});break;case"fontSize":this._fontSizeDDL.ejDropDownList({dataSource:i[r]});break;case"format":this._formatDDL.ejDropDownList({dataSource:i[r]});break;case"value":t.isPlainObject(i[r])&&(i[r]=null);o=t.util.getVal(i[r]);o!=this._getDocument().body.innerHTML&&(this._getDocument().body.innerHTML=o,l={text:this._getText(),htmlText:this.getHtml()},this._onChange());break;case"showDimensions":this._renderImageDialog();i[r]?(this._imgDialog.find("div.e-rte-imgdimensions").show(),this._imgDialog.find("div.e-rte-videoDimensions").show()):(this._imgDialog.find("div.e-rte-imgdimensions").hide(),this._imgDialog.find("div.e-rte-videoDimensions").hide());break;case"showFontOption":i[r]?this._rteWapper.find("ul.e-rte-fontgroup").show():this._rteWapper.find("ul.e-rte-fontgroup").hide();break;case"locale":this.model.locale=i[r];c=this.model;this.element.ejRTE("destroy").ejRTE(c);break;case"importSettings":this.model.importSettings=n.extend(!0,this.model.importSettings,i[r]);break;case"exportToPdfSettings":this.model.exportToPdfSettings=n.extend(!0,this.model.exportToPdfSettings,i[r]);break;case"exportToWordSettings":this.model.exportToWordSettings=n.extend(!0,this.model.exportToWordSettings,i[r]);break;case"tableRows":this.model.tableRows=i[r];u=this._createTable.find("div.e-rte-table").html("");this._drawTable(u);break;case"iframeAttributes":this._updateIframeSkin(i[r]);break;case"tableColumns":this.model.tableColumns=i[r];u=this._createTable.find("div.e-rte-table").html("");this._drawTable(u);break;case"showCustomTable":this._createCustomTable();s=this._createTable.find("div.customtable-group");i[r]?t.isNullOrUndefined(this._customTableDialog)?this._createCustomTable():s.show():s.hide();break;case"colorPaletteRows":this.model.colorPaletteRows=i[r];this._updateColorPalette();break;case"colorPaletteColumns":this.model.colorPaletteColumns=i[r];this._updateColorPalette();break;case"colorCode":this.model.colorCode=i[r];this._updateColorPalette();break;case"name":this.model.name=i[r];this._checkNameAttr();break;case"showContextMenu":this.model.showContextMenu=i[r];this._showHideContextMenu();break;case"enableRTL":this._enableRTL(i[r]);break;case"htmlAttributes":this._addAttr(i[r]);break;case"showRoundedCorner":this._roundedCorner(i[r]);break;case"validationRules":this.element.closest("form").length!=0&&(this.model.validationRules!=null&&(this.element.rules("remove"),this.model.validationMessage=null),this.model.validationRules=i[r],this.model.validationRules!=null&&(this._initValidator(),this._setValidation()));break;case"validationMessage":this.element.closest("form").length!=0&&(this.model.validationMessage=i[r],this.model.validationRules!=null&&this.model.validationMessage!=null&&(this._initValidator(),this._setValidation()));break;case"autoHeight":this.model.autoHeight=i[r];this._setAutoHeight()}r!="locale"&&this._setIframeHeight()}this._updateCount()},_updateLocalConstant:function(){this._localizedLabels=t.getLocalizedConstants("ej.RTE",this.model.locale)},_enableContentCleaner:function(){t.clipboardCleaner&&!this._isIE8()&&(this._pasteCleaner||(this._pasteCleaner=new t.clipboardCleaner(this._getDocument(),this._iframePaste,this)),this._pasteCleaner.filterOptions=this.model.pasteCleanupSettings)},_init:function(){t.isNullOrUndefined(this.element)||this.element[0].type!="textarea"||(this._updateLocalConstant(),this.element.hide(),this._initialize()._render(),this.model.allowEditing&&this._wireEvents(),this.model.pasteCleanupSettings&&(this.model.pasteCleanupSettings.cleanElements||this.model.pasteCleanupSettings.removeStyles||this.model.pasteCleanupSettings.cleanCSS||this.model.pasteCleanupSettings.listConversion)&&this._enableContentCleaner(),this.model.iframeAttributes!=null&&this._updateIframeSkin(this.model.iframeAttributes),this.model.enabled==!1&&this._disabled(this.model.enabled),this.model.htmlAttributes!=null&&this._addAttr(this.model.htmlAttributes),this.model.autoFocus&&(this._focus(),this._updateToolbarStatus(),this._updateFontOptionStatus(),this._updateFormat()),this.model.enableHtmlEncode&&this.value(this._encode(this._decode(this.value()))),this.model.showToolbar&&(this.disableToolbarItem("removeLink"),t.isNullOrUndefined(this._getWindow())||this._updateIndentStatus()),this.model.enableRTL&&this._enableRTL(!0),this.model.externalCSS&&this._addCssToIframe(this.model.externalCSS),this.wrapper=this._rteWapper,this.model.validationRules!=null&&(this._initValidator(),this._setValidation()),this.model.showContextMenu&&this._showHideContextMenu(),this._isInteraction=!0)},_hideContextMenuByItem:function(t){for(var i=0;i<n(this._textMenuObj.element).children("li").length;i++)n.inArray(n(this._textMenuObj.element.children("li")[i]).attr("id"),t)!=-1?n(this._textMenuObj.element.children("li")[i]).show():n(this._textMenuObj.element.children("li")[i]).hide()},_filterMenuItems:function(i){var r=this._isIE()?this._currentSelNode:this._getSelectedNode(),u=this._saveSelection().commonAncestorContainer;t.isNullOrUndefined(r)||t.isNullOrUndefined(r.tagName)||r.tagName.toLowerCase()!=="img"&&i.target.tagName.toLowerCase()!="img"?!t.isNullOrUndefined(r)&&n(r).closest("table").length?(this._hideContextMenuByItem(n(r).closest("a").length?this._contextType.table_hyper:this._contextType.table),this._contextValidation(u,i)):!t.isNullOrUndefined(r)&&n(r).closest("a").length?(this._hideContextMenuByItem(this._contextType.hyperlink),this._contextValidation(u,i)):this._isIE8()?(this._hideContextMenuByItem(this._contextType.text),this._updateContextMenuItemState(this._getRange().text!=="")):(this._hideContextMenuByItem(this._contextType.text),this._contextValidation(u,i)):(this._hideContextMenuByItem(this._contextType.image),this._updateContextMenuItemState(!0));this._rteIframe.contents().find("body").addClass("e-cursor")},_contextmenuPosition:function(t){var u=(t.clientX==i?0:t.clientX)+this._rteWapper.offset().left,r=(t.clientY==i?0:t.clientY)+this._rteWapper.offset().top+(this._rteToolbar?this._rteToolbar.outerHeight():0),f=this._textMenuObj.element.attr("style","visibility: visible;display:block;").height(),e=this._textMenuObj.element.width();r=r+f<n(document).scrollTop()+n(window).height()?r:r-f<0?r:r-f;u=u+e<n(document).scrollLeft()+n(window).width()?u:u-e;this._textMenuObj.element.attr("style","width:auto;left:"+u+"px;top:"+r+"px;z-index:"+(this._onGetMaxZindex()+1)).focus()},_contextValidation:function(n){var t;this._updateContextMenuItemState(n&&(t=n.nodeValue?n.nodeValue:n.textContent)&&(this._saveSelection().endContainer==this._saveSelection().startContainer?t.substring(this._saveSelection().startOffset,this._saveSelection().endOffset)!=="":!0))},_updateContextMenuItemState:function(n){n?(this._textMenuObj.enableItemByID("cut"),this._textMenuObj.enableItemByID("copy")):(this._textMenuObj.disableItemByID("cut"),this._textMenuObj.disableItemByID("copy"))},_contextMenuClick:function(r){var f=this._rteIframe.data("ejSpellCheck"),e=r.ID?r.ID.toLowerCase():n(r.element).attr("id").toLowerCase(),u,o,s,h,c;this._isIE()&&this._ieSelectionRange&&this.selectRange(this._ieSelectionRange);switch(e){case"cut":!this._isIE()&&this._getValidbrowser(t.browserInfo().name)?this._openAlert(this._getLocalizedLabels("cutAlert")):this._getDocument().execCommand(e,!1,i);this._imgOrg&&this._imgDupDiv&&this._imgBoxMouseMove&&(n(this._imgOrg).css("outline",""),n(this._imgDupDiv).remove(),this._off(n(this._getDocument()),"mousemove",this._imgBoxMouseMove));this._updateCursor();break;case"copy":!this._isIE()&&this._getValidbrowser(t.browserInfo().name)?this._openAlert(this._getLocalizedLabels("copyAlert")):this._getDocument().execCommand(e,!1,i);this.selectRange(this._getRange());break;case"paste":this._isIE()?this._getDocument().execCommand(e,!1,i):this._openAlert(this._getLocalizedLabels("pasteAlert"));break;case"openlink":this._onOpen();break;case"createlink":this._renderLinkDialog();this._linkDialog||this._renderLinkDialog();this._hyperLinkManager(!1);break;case"imageproperties":this._renderImageDialog();this._imgDialog||this._renderImageDialog();this._imageManager();break;case"addcolumnleft":u=this.insertColumn(!0,this._currentSelNode);this._updateCursor(u);break;case"addcolumnright":u=this.insertColumn(!1,this._currentSelNode);this._updateCursor(u);break;case"addrowabove":u=this.insertRow(!0,this._currentSelNode);this._updateCursor(u);break;case"addrowbelow":u=this.insertRow(!1,this._currentSelNode);this._updateCursor(u);break;case"deleterow":this.removeRow(this._currentSelNode);break;case"deletecolumn":this.removeColumn(this._currentSelNode);break;case"deletetable":this.removeTable(n(this._currentSelNode).closest("table"));break;case"tableproperties":this._renderEditTableDialog();this._eTblDialog||this._renderEditTableDialog();this._eTblManager();this._eTblDialog.ejDialog("open");break;case"removelink":this._onUnlink();break;case"add to dictionary":o=this._currentSelNode.innerText.trim();f._currentElement=n("#"+f._id);f.addToDictionary(o);this._ieCursorMaintainance();break;case"ignoreall":s=this._currentSelNode.innerText.trim();h=f.ignoreAll(s,this.getHtml());this.setHtml(h.resultHTML);this._ieCursorMaintainance();break;default:t.isNullOrUndefined(f)||(c=document.createTextNode(r.text),this._currentSelNode.parentNode.insertBefore(c,this._currentSelNode),n(this._currentSelNode).remove())}this._trigger("contextMenuClick",{event:r});this._onChange()},_updateCursor:function(n,t){if(!this._isIE8()){var i=this._getDocument().createRange(),r=this._getRange();n?this._setRange(n,r,!0):t?(i.setStart(t.startContainer,t.startOffset),i.setEnd(t.endContainer,t.endOffset),this.selectRange(i)):(i.setStart(r.startContainer,r.startOffset),i.setEnd(r.startContainer,r.startOffset),this.selectRange(i))}},_loadRules:function(){var t=this.element.data("ejRTE");jQuery.validator.addMethod("contentRequired",function(){return n.trim(t._getText())},"Please specify the value.");jQuery.validator.addMethod("maxWordCount",function(i,r,u){return n.trim(t._getText()).split(/\W+/).length<=u},"Please enter the content with in max word count.");jQuery.validator.addMethod("minWordCount",function(i,r,u){return n.trim(t._getText()).split(/\W+/).length>=u},"Please enter the content with min word count.");jQuery.validator.addMethod("minCharCount",function(n,i,r){return t._getText().length>=r},"Please enter the content with min length.");jQuery.validator.addMethod("maxCharCount",function(n,i,r){return t._getText().length<=r},"Please enter the content with in max length.");this._customRules={required:"contentRequired",maxWordCount:"maxWordCount",minWordCount:"minWordCount",maxlength:"maxCharCount",minlength:"minCharCount",equalTo:"equalTo"}},_initValidator:function(){this._loadRules();this.element.closest("form").data("validator")||this.element.closest("form").validate()},_getRuleData:function(n,t){var i=null;switch(n){case"contentRequired":i={contentRequired:t};break;case"minCharCount":i={minCharCount:t};break;case"maxCharCount":i={maxCharCount:t};break;case"maxWordCount":i={maxWordCount:t};break;case"minWordCount":i={minWordCount:t};break;case"equalTo":i={equalTo:t}}return i},_setValidation:function(){var f,i,o,e,r,u,s;if(this.element.closest("form").length!=0){f=this.element.closest("form").validate();e=this.element.attr("name");f.settings.messages[e]={};for(r in this.model.validationRules)if(u=null,!t.isNullOrUndefined(this.model.validationRules[r])&&this._customRules[r]){if(i=this._customRules[r],o=this.model.validationRules[r],this.element.rules("add",this._getRuleData(i,o)),t.isNullOrUndefined(this.model.validationRules.messages&&this.model.validationRules.messages[i])){f.settings.messages[e][i]=n.validator.messages[i];for(s in this.model.validationMessage)r==s?u=this.model.validationMessage[r]:""}else u=this.model.validationRules.messages[i];f.settings.messages[e][i]=u!=null?u:n.validator.messages[i]}}},_addAttr:function(t){if(t!=null){var i=this;n.map(t,function(n,t){t=="class"?i._rteWapper.addClass(n):t=="name"?i.element.attr(t,n):t=="required"?i.element.attr(t,n):t=="disabled"&&n=="disabled"?i.disable():t=="readOnly"&&n=="readOnly"?i._enableEdit(!1):i._rteWapper.attr(t,n)})}},_addCssToIframe:function(t){for(var i,u=n.isArray(t)?t:t.split(","),r=0;r<u.length;r++)i=document.createElement("link"),i.href=u[r],i.rel="stylesheet",i.type="text/css",this._rteIframe.contents().find("head").append(i)},_disabled:function(n){n!=!0?this.disable():this.enable()},_destroy:function(){this.element.insertBefore(this._rteWapper);t.isNullOrUndefined(this._tooltip)||n(this._rteFooter).ejTooltip("destroy");t.isNullOrUndefined(this._formatDDL)||this._formatDDL.ejDropDownList("destroy");t.isNullOrUndefined(this._fontStyleDDL)||this._fontStyleDDL.ejDropDownList("destroy");t.isNullOrUndefined(this._fontSizeDDL)||this._fontSizeDDL.ejDropDownList("destroy");t.isNullOrUndefined(this._fontColorSplit)||this._fontColorSplit.ejSplitButton("destroy");t.isNullOrUndefined(this._bgColorSplit)||this._bgColorSplit.ejSplitButton("destroy");t.isNullOrUndefined(this._unOrderSplit)||this._unOrderSplit.ejSplitButton("destroy");t.isNullOrUndefined(this._orderSplit)||this._orderSplit.ejSplitButton("destroy");t.isNullOrUndefined(this._customTableDialog)||(t.isNullOrUndefined(this._customTableDialog.find(".e-rte-ddlAlignment"))||this._customTableDialog.find(".e-rte-ddlAlignment").ejDropDownList("destroy"),t.isNullOrUndefined(this._customTableDialog.find(".e-rte-txtBorder"))||this._customTableDialog.find(".e-rte-txtBorder").ejDropDownList("destroy"));t.isNullOrUndefined(this._linkDialog)||n(this._linkDialog).closest("div.e-rte.e-dialog-wrap").remove();t.isNullOrUndefined(this._imgDialog)||(this._imgDialog.find(".e-rte-imgBorderStyle").ejDropDownList("destroy"),n(this._imgDialog).closest("div.e-rte.e-dialog-wrap").remove());t.isNullOrUndefined(this._videoDialog)||n(this._videoDialog).closest("div.e-rte.e-dialog-wrap").remove();t.isNullOrUndefined(this._createTable)||n(this._createTable).closest("div.e-rte.e-dialog-wrap").remove();t.isNullOrUndefined(this._sourceDialog)||n(this._sourceDialog).closest("div.e-dialog-wrap").remove();t.isNullOrUndefined(this._customColor)||n(this._customColor).closest("div.e-dialog-wrap").remove();t.isNullOrUndefined(this._customTableDialog)||n(this._customTableDialog).closest("div.e-rte.e-dialog-wrap").remove();t.isNullOrUndefined(this._customTableDialog)||n(this._customTableDialog).closest("div.e-rte.e-dialog-wrap").remove();t.isNullOrUndefined(this._alertWindow)||n(this._alertWindow).closest("div.e-rte.e-dialog-wrap").remove();t.isNullOrUndefined(this._eTblDialog)||(this._eTblDialog.find(".e-rte-dropdown").ejDropDownList("destroy"),n(this._eTblDialog).closest("div.e-rte.e-dialog-wrap").remove());t.isNullOrUndefined(this._explorerObj)||this._explorerObj.destroy();t.isNullOrUndefined(this._imgPicker)||this._imgPicker.destroy();t.isNullOrUndefined(this._tblborderPicker)||this._tblborderPicker.destroy();t.isNullOrUndefined(this._fileDialog)||n(this._fileDialog).closest("div.e-rte.e-dialog-wrap").remove();this._textMenuObj&&this._textMenuObj.destroy();this._toolBarObj&&this._toolBarObj.destroy();this._rteWapper.remove();n("#"+this._rteId+"customcolor_popup").length>0&&n("#"+this._rteId+"customcolor_popup").remove();n("#"+this._rteId+"customcolor_Presets").length>0&&n("#"+this._rteId+"customcolor_Presets").remove();this.element.show();this.element.focus();this._createTable=null;this._unwireEvents()},_initialize:function(){return this._toolsList=this.model.toolsList,this._rteId=this.element[0].id,this._rteId=this._rteId?this._rteId:"",this._backupArray=[],this._undoRedoPosition=0,this._fontColor="#000000",this._bgColor="#ffffff",this._imgWidth=0,this._imgHeight=0,this._videoWidth=0,this._videoHeight=0,this._keypressFlag=!0,this._styleItems=t.isNullOrUndefined(this.model.tools.style)?[]:this.model.tools.style,this._alignItems=t.isNullOrUndefined(this.model.tools.alignment)?[]:this.model.tools.alignment,this._listItems=t.isNullOrUndefined(this.model.tools.lists)?[]:this.model.tools.lists,this._scriptsItems=t.isNullOrUndefined(this.model.tools.effects)?[]:this.model.tools.effects,this._contextMenu=["cut","copy","paste","|","insertTable",["addColumnLeft","addColumnRight","addRowAbove","addRowBelow"],"|","deleteTables",["deleteRow","deleteColumn","deleteTable"],"|","tableProperties","|","createLink","openLink","removeLink","imageProperties"],this._contextType={text:["cut","copy","paste","createLink"],image:["cut","copy","paste","imageProperties"],hyperlink:["cut","copy","paste","createLink","openLink","removeLink"],table:["cut","copy","paste","insertTable","deleteTables","tableProperties","createLink"],table_hyper:["cut","copy","paste","insertTable","deleteTables","tableProperties","createLink","openLink","removeLink"]},this},_render:function(){this._renderWrapper()._checkNameAttr();this.model.showToolbar&&this._renderToolBar();this._trigger("preRender",this.element);this._renderEditArea();this.model.showFooter&&this._renderFooter();this._setIframeHeight();this._rteWidth=this.model.width;this._rteHeight=this.model.height;this._renderAlertDialog();this._roundedCorner(this.model.showRoundedCorner)},_initContextMenu:function(){for(var r,t,i=[],n=0;n<this._contextMenu.length;n++)if(this._contextMenu[n]!="|")if(typeof this._contextMenu[n]=="object")for(r=n+1,t=0;t<this._contextMenu[n].length;t++)this._contextMenu[n][t]!="|"&&i.push({id:this._contextMenu[n][t],parentId:this._contextMenu[n-1],text:this._getLocalizedLabels(this._contextMenu[n][t]),sprite:"e-rte-toolbar-icon "+this._contextMenu[n][t]+" "+this._rteIconsList[this._contextMenu[n][t]],htmlAttr:this._contextMenu[n+1][t+1]=="|"?{"class":"e-rte-separator",id:this._contextMenu[n][t]}:{id:this._contextMenu[n][t]}});else i.push({id:this._contextMenu[n],parentId:null,text:this._getLocalizedLabels(this._contextMenu[n]),sprite:"e-rte-toolbar-icon "+this._contextMenu[n]+" "+this._rteIconsList[this._contextMenu[n]],htmlAttr:this._contextMenu[n+1]=="|"?{"class":"e-rte-separator",id:this._contextMenu[n]}:{id:this._contextMenu[n]}});return i},_createContextMenu:function(){var r=t.buildTag("ul.e-rte-context-menu #"+this._id+"_contextmenu"),i=this;return r.ejMenu({menuType:t.MenuType.ContextMenu,enableSeparator:!0,width:"auto",enableRTL:this.model.enableRTL,cssClass:this.model.cssClass,contextMenuTarget:this._getDocument(),click:n.proxy(this._contextMenuClick,this),fields:{dataSource:this._initContextMenu(),id:"id",parentId:"parentId",text:"text",htmlAttribute:"htmlAttr",spriteCssClass:"sprite"},beforeOpen:function(r){var u,f;this._spellObj=i._rteIframe.data("ejSpellCheck");n(r.target).hasClass("errorspan")&&!t.isNullOrUndefined(this._spellObj)?(this._spellObj._selectedTarget=r.target,this._spellObj._selectedValue=r.target.innerText,u=this._spellObj._filterSuggestions(this._spellObj,this._spellObj._selectedValue),u.length>0?this._spellObj._suggestedWords=u[0].SuggestedWords:this._spellObj.getSuggestionWords(r.target.innerText),i._spellcheckContextMenu(r,this._spellObj)):(f=n("#"+i._textMenuObj._id).find("span.e-spellsuggestions"),f.length>0&&n("#"+i._textMenuObj._id).find("span.e-spellsuggestions").parent().parent().remove());i._isIE()&&i._ieSelectionRange&&i.selectRange(i._ieSelectionRange);i.model.enabled?this.enable():this.disable();i._filterMenuItems(i._contextMenuEventArgs=r.events);n(this.element).parent().hide();n("#"+i._textMenuObj._id).find("span.e-spellsuggestions").parents("li").css("display","block")},open:function(){this.element.attr("style","visibility:visible;width:auto;display:block;left:0px;top:0px;");this.element.parent().show();i._contextmenuPosition(i._contextMenuEventArgs);this._showAnimation(this.element,this._showAnim);n(this.element).focus()},close:function(){n(i._getDocument()).find("body").removeClass("e-cursor")}}),r},_spellcheckContextMenu:function(t,i){var u=this,o=t.events.target,e=n("#"+u._textMenuObj._id).find("span.e-spellsuggestions"),f,r;for(e.length>0&&n("#"+u._textMenuObj._id).find("span.e-spellsuggestions").parent().parent().remove(),f=[this._getLocalizedLabels("addtodictionary"),this._getLocalizedLabels("ignoreall")].concat(i._suggestedWords),r=0;r<f.length;r++)u.insertMenuOption({newItem:f[r],targetItem:this._getLocalizedLabels("paste"),insertType:"insertAfter",menuType:{text:!0,image:!1,hyperlink:!0,table:!1},spriteCssClass:"e-spellsuggestions"})},_showHideContextMenu:function(){this.model.allowEditing&&this.model.enabled&&this.model.showContextMenu&&this._getDocument()?(this._textMenuObj=this._createContextMenu().data("ejMenu"),this._textMenuObj._off(n(this._textMenuObj.model.contextMenuTarget),"mouseup taphold",this._textMenuObj._ContextMenuHandler),this._textMenuObj._on(n(this._textMenuObj.model.contextMenuTarget),"mouseup",this._textMenuObj._ContextMenuHandler)):this._textMenuObj&&this._textMenuObj.destroy()},_checkNameAttr:function(){this.model.name?this.element.attr({name:this.model.name}):t.isNullOrUndefined(this.element.attr("name"))&&this.element.attr({name:this.element[0].id})},_enableEdit:function(n){this.model.allowEditing=n;n?(this._wireEvents(),this.model.showToolbar&&this._toolBarItems.ejToolbar("option","click",this._toolBarClick),this._rteIframe.contents().find("body").attr("contenteditable",!0)):(this._unwireEvents(),this.model.showToolbar&&this._toolBarItems.ejToolbar("option","click",null),this._rteIframe.contents().find("body").attr("contenteditable",!1));this._showHideContextMenu();this._disableResizeObj(n)},_disableResizeObj:function(i){i?this.model.enableRTL||this._on(n(this._getDocument()).find("table.e-rte-table"),"mouseover",this._tableMouseOver):(t.browserInfo().name==="mozilla"&&(this._getDocument().designMode="off"),this._off(n(this._getDocument()).find("table.e-rte-table"),"mouseover",this._tableMouseOver),this._removeResizeObject())},_changeSkin:function(n){this._rteWapper.removeClass(this.model.cssClass).addClass(n);this._subControlsSetModel("cssClass",n)},_updateIframeSkin:function(t){try{var i=this._rteIframe.contents().find("body");t&&(proxy=this,n.map(t,function(n,t){t=="class"?i.addClass(n):t=="required"?i.attr(t,n):t=="disabled"&&n=="disabled"?proxy.disable():t=="readOnly"&&n=="readOnly"?proxy._enableEdit(!1):i.attr(t,n)}))}catch(r){return!1}},_renderWrapper:function(){return this.model.minHeight.toString().indexOf("%")>0&&(this.model.minHeight=parseInt(this.model.height)*parseInt(this.model.minHeight)/100),!t.isNullOrUndefined(this.model.maxHeight)&&this.model.maxHeight.toString().indexOf("%")>0&&(this.model.maxHeight=parseInt(this.model.height)+parseInt(this.model.height)*parseInt(this.model.maxHeight)/100),this.model.minWidth.toString().indexOf("%")>0&&(this.model.minWidth=parseInt(this.model.width)*parseInt(this.model.minWidth)/100),!t.isNullOrUndefined(this.model.maxWidth)&&this.model.maxWidth.toString().indexOf("%")>0&&(this.model.maxWidth=parseInt(this.model.width)+parseInt(this.model.width)*parseInt(this.model.maxWidth)/100),this._rteWapper=t.buildTag("div.e-rte e-rte-wrapper e-widget e-box "+this.model.cssClass+"#"+this._rteId+"_wrapper","",{},{role:"presentation"}).insertBefore(this.element),this._rteWapper.css("height",this.model.height).css("width",this.model.width).css("min-height",this.model.minHeight).css("min-width",this.model.minWidth).css("max-height",this.model.maxHeight).css("max-width",this.model.maxWidth),this._rteWapper.append(this.element.hide()),this},_renderToolBar:function(){this._rteToolbar=t.buildTag("div.e-rte-toolbar #"+this._rteId+"_tools").insertAfter(this.element);this._crateToolbarTemplate()._initToolBarItems()._renderToolBarList();this._renderToolBarItems();t.browserInfo().name==="msie"&&t.browserInfo().version==="8.0"&&this._toolBarObj.disableItemByID(this._rteId+"_video")},_renderToolBarList:function(){var t={};t.click=this.model.allowEditing?this._toolBarClick:null;t.cssClass=this.model.cssClass;t.enableRTL=this.model.enableRTL;t.enableSeparator=!0;this.model.toolbarOverflowMode=="inline"&&(t.responsiveType="inline");t.isResponsive=this.model.isResponsive;t.height=t.isResponsive?"":"auto";t.showRoundedCorner=this.model.showRoundedCorner;t.tooltipSettings=this.model.tooltipSettings;t.create=function(){var t=n(this.element).find(".e-ddl.e-widget .e-dropdownlist"),i=n(this.element).find(".e-split.e-widget .e-splitbutton");t.length&&t.ejDropDownList({height:"30px"});i.length&&i.ejSplitButton({height:"30px"})};this._toolBarItems.ejToolbar(t);this._disableTabkeyNavigation(this._toolBarItems)._disableTabkeyNavigation(this._toolBarItems.find("[tabindex],.e-split-btn"));this._toolBarObj=this._toolBarItems.ejToolbar("instance");this.model.toolbarOverflowMode=="inline"&&(this._rteinline=this._toolBarObj._spantag,this._on(this._rteinline,"click",this._rteinlineClick));this._on(n(document),"mouseup touchend",this._zoomUp);this._on(n(this._toolBarObj.itemsContainer).find(".e-rteItem-zoomIn , .e-rteItem-zoomOut"),"mousedown touchstart",this._zoomDown)},_disableTabkeyNavigation:function(t){return n(t).attr("tabindex","-1"),this},_crateToolbarTemplate:function(){var i,r,u;this._toolBarItems=t.buildTag("div#"+this._rteId+"_toolbar").appendTo(this._rteToolbar).height(30);for(i in this._toolsList)i=this._toolsList[i],t.isNullOrUndefined(this.model.tools[i])||(i=="customTools"?t.isNullOrUndefined(this.model.tools[i])||this._customTools(this.model.tools[i]):this.model.tools[i].length>0&&this._createToolsItems(this.model.tools[i],i));return this.model.fileBrowser.filePath!=""&&(r=t.buildTag("ul#"+this._rteId+"-file-exporer"),u=n("<li id='"+this._rteId+"_fileBrowser' class='e-rte-explorer e-rteItem-fileBrowser' title='"+this._getLocalizedLabels("fileBrowser")+"' ><div class='e-rte-toolbar-icon fileBrowser e-fileBrowser' unselectable = 'on'><\/div><\/li>"),u.appendTo(r),r.appendTo(this._toolBarItems)),this},_createToolsItems:function(i,r){var f=t.buildTag("ul#"+(this._rteId+"_"+r)),e,u;for(r=="font"&&f.addClass("e-rte-fontgroup"),r=="formatStyle"&&f.addClass("e-rte-format"),r=="lists"&&f.addClass("e-rte-lists"),u=0;u<i.length;u++)e=n("<li id='"+(this._rteId+"_"+i[u].replace(/ /g,""))+"' class='e-rteItem-"+i[u]+"' ><div class='e-rte-toolbar-icon "+i[u]+" "+this._rteIconsList[i[u]]+"' unselectable = 'on'><\/div><\/li>"),i[u]==="video"&&t.browserInfo().name==="msie"&&t.browserInfo().version==="8.0"?e.attr("title",this._getLocalizedLabels("html5Support")):e.attr("title",this._getLocalizedLabels(i[u].replace(/ /g,""))),i[u]==="fullScreen"?e.attr("data-content",this._getLocalizedLabels("maximize")).children(".e-rte-toolbar-icon").addClass(this._rteIconsList.maximize):i[u]==="findAndReplace"&&e.attr("title",this._getLocalizedLabels("FindAndReplace")),e.appendTo(f);f.appendTo(this._toolBarItems);r!="font"||this.model.showFontOption||f.hide()},_customTools:function(i){for(var e,f,u,r=0;r<i.length;r++)e=t.buildTag("ul"),f=n("<li id='"+i[r].name+"' title='"+i[r].tooltip+"' ><div class='"+(t.isNullOrUndefined(i[r].css)?"":i[r].css)+"'>"+(t.isNullOrUndefined(i[r].text)?"":i[r].text)+"<\/div><\/li>"),u=i[r].action,typeof u=="string"&&(u=t.util.getObject(u,window)),t.isNullOrUndefined(i[r].action)||this._on(f,"click",u),n(i[r].template).appendTo(f.find("div")),f.appendTo(e),e.appendTo(this._toolBarItems)},_initToolBarItems:function(){return this._rteToolbar.find("li.e-rteItem-format").length>0&&this._renderFormat(),this._rteToolbar.find("li.e-rteItem-createTable").length>0&&this._renderTableDialog(),this._rteToolbar.find("li.e-rteItem-fontName").length>0&&this._renderFontStyle(),this._rteToolbar.find("li.e-rteItem-fontSize").length>0&&this._renderFontSize(),this._rteToolbar.find("li.e-rteItem-fontColor").length>0&&this._renderFontColor(),this._rteToolbar.find("li.e-rteItem-backgroundColor").length>0&&this._renderBGColor(),this._rteToolbar.find("li.e-rteItem-unorderedList").length>0&&this._renderUnOrderList(),this._rteToolbar.find("li.e-rteItem-orderedList").length>0&&this._renderOrderList(),this._rteToolbar.find("li.e-rteItem-import").length>0&&this._renderimport(),this.model.showClearAll||this._rteToolbar.find("li.e-rteItem-clearAll").hide(),this},_renderToolBarItems:function(){this._toolBarObj.disableItemByID(this._rteId+"_undo");this._toolBarObj.disableItemByID(this._rteId+"_redo");this.model.enableRTL?this._toolBarObj.selectItemByID(this._rteId+"_justifyRight"):this._toolBarObj.selectItemByID(this._rteId+"_justifyLeft");var n=this._rteToolbar.find("li.e-rteItem-addColumnLeft,li.e-rteItem-addColumnRight,li.e-rteItem-addRowAbove,li.e-rteItem-addRowBelow,li.e-rteItem-deleteRow,li.e-rteItem-deleteColumn,li.e-rteItem-deleteTable");return this.model.isResponsive&&n.length==0?this._toolBarObj._liTemplte.find("li.e-rteItem-addColumnLeft,li.e-rteItem-addColumnRight,li.e-rteItem-addRowAbove,li.e-rteItem-addRowBelow,li.e-rteItem-deleteRow,li.e-rteItem-deleteColumn,li.e-rteItem-deleteTable").hide():this._rteToolbar.find("li.e-rteItem-addColumnLeft,li.e-rteItem-addColumnRight,li.e-rteItem-addRowAbove,li.e-rteItem-addRowBelow,li.e-rteItem-deleteRow,li.e-rteItem-deleteColumn,li.e-rteItem-deleteTable").hide(),this},_renderEditArea:function(){this._rteEditor=t.buildTag("div.editarea #"+this._rteId+"_editor").appendTo(this._rteWapper);this._rteIframe=t.buildTag("iframe.content-iframe #"+this._rteId+"_Iframe","",{}).appendTo(this._rteEditor);this._rteIframe.css({border:"0"});this._setIFrames();navigator.userAgent.match(/(iPhone|iPod|iPad)/i)!=null&&(this._rteEditor.addClass("e-ipadscroll"),this._rteEditor.css("height",this._rteWapper.outerHeight()-this._rteToolbar.height()))},_xhtmlTagValidation:function(){var n,o,s,e,u,i;if(this.value()!=null){if(n=this.value(),n=n.replace(/\r/gi," ").replace(/\n/gi,"<br/> ").replace(/\r\n/gi," ").replace(/( )+/gi," ").replace(/&nbsp;/gi," ").replace(/&bull;/gi,"*").replace(/&ltquo;/gi,"<").replace(/&rtquo;/gi,">").replace(/&trze;/gi,"(tm)").replace(/&copy;/gi,"(c)").replace(/&reg;/gi,"(r)"),n.indexOf("<body>")!=-1&&(o=n.indexOf("<body>"),s=n.slice(0,o+6),n=n.replace(s,"").replace("<\/body><\/html>","")),n=n.replace(/<br>/g,"<br/>").replace(/<hr>/g,"<hr/>"),n=this._imageXhtml(n),n=this._styleXhtml(n),n=this._startXhtml(n),n.indexOf("alt=")!=-1){for(var v=/alt=\"(.*?)\"/ig,f=[],h,c=0;(h=v.exec(n))!=null;)f[c]=h[0],c++;for(i=0;i<f.length;i++)n=n.replace(f[i],'alt=""')}if(!t.isNullOrUndefined(this._fontXhtml(n))){if(n=this._fontXhtml(n),n.indexOf("ol")!=-1){for(var y=/<ol(.*)<\/ol>/ig,l,a=0,r=[];(l=y.exec(n))!==null;)r[a]=l[0].toString(),a++;for(e=[],u=0;u<r.length;u++)e[u]=r[u];for(i=0;i<r.length;i++)r[i]=r[i].replace(/<br\/>/gi,"");for(i=0;i<r.length;i++)n=n.replace(e[i],r[i])}n=n.replace(/<o:p>/gi,"").replace(/<\/o:p>/gi,"")}this.value(n)}},_setIFrames:function(){var r=null,f,u,i;this.value()!=null&&this.value()!=""&&(r=this.value().replace(/'/g,'"'));r==null&&this.value(n.trim(this.element[0].value));f=t.browserInfo().name=="msie"&&parseInt(t.browserInfo().version)==8;u="<!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <style>html, body{height: 100%;margin: 0;}body.e-cursor{cursor:default} span.e-selected-node\t{background-color: #939393;color: white;}span.e-selected-node.e-highlight{background-color: #1d9dd8;}body{font-family:Times New Roman,Times,serif;color:#5C5C5C;word-wrap:break-word;padding: 8px;box-sizing: border-box;}.e-rte-table caption{border: 1px solid;border-bottom:none}td{word-wrap:break-word;word-break:break-all;}.e-rteColumnResizer{position: absolute;bottom:0;overflow: visible;cursor: col-resize;background-repeat:repeat;background-color:transparent}.e-rteRowResizer{position: absolute;bottom:0;overflow: visible;margin-left: -4px;cursor: row-resize;background-repeat:repeat;background-color:transparent} span.e-rte-imageboxmark{width:5px;height:5px;position:absolute;display:block;background:#fff;border:1px solid #000;}<\/style><\/head><body spellcheck='false' autocorrect='off' contenteditable="+(this.model.allowEditing?"true":"false")+">"+(this.value()!=""&&this.value()!="<br>"?n.trim(this.value()):"<p><span>&#65279;<\/span><\/p>")+"<\/body><\/html>";this._rteIframe.css({width:"100%"});(this.element[0].value=="<div><\/div>"||this.element[0].value=="")&&(this.element[0].innerHTML=this.value());this._setContent(u);this._isIE8()&&this.value(this._getDocument().body.innerHTML);i=n(this._getDocument()).find("table");!this.model.enableRTL&&i.length>0&&this._on(i,"mouseover",this._tableMouseOver);this.model.enableXHTML&&this._updateValue();this._setAutoHeight();(!t.isNullOrUndefined(this.model.undoStackLimit)||this.model.undoStackLimit!==""||this.model.undoStackLimit>0)&&(this._backupArray[0]=this.getHtml())},_setIframeHeight:function(){var i=(!t.isNullOrUndefined(this._rteToolbar)&&this._rteToolbar.is(":visible")?this._rteToolbar.outerHeight():6)+(!t.isNullOrUndefined(this._rteFooter)&&this._rteFooter.is(":visible")?this._rteFooter.outerHeight():0);this._rteIframe.css("height",i==0?this.model.height:this._rteWapper.outerHeight()-i-(parseInt(this._rteEditor.css("padding-top"))+parseInt(n(".e-rte-wrapper").css("border-bottom-width"))+parseInt(this.model.showFooter?n(".e-rte-footer").css("margin-top"):0)))},_renderFooter:function(){var r=this.model,i,n;this._rteFooter=t.buildTag("div.e-rte-footer #"+this._rteId+"_footer").appendTo(this._rteWapper);i=t.buildTag("div.e-rte-footer-left");this._htmlSource=t.buildTag("div.e-rte-icons e-rte-footeritems e-rte-footericon e-rte-source "+this._rteIconsList.rteSource,"",{},{title:this._getLocalizedLabels("viewHtml")}).appendTo(i);this._htmlInfo=t.buildTag("div.e-rte-htmltaginfo e-rte-footeritems").appendTo(i);i.appendTo(this._rteFooter);n=t.buildTag("div.e-rte-footer-right");this._wordCount=t.buildTag("div.e-rte-wordcount e-rte-footeritems").appendTo(n);this._charCount=t.buildTag("div.e-rte-charcount e-rte-footeritems").appendTo(n);this._clearFormat=t.buildTag("div.e-rte-icons "+this._rteIconsList.clearFormat+" e-rte-footericon e-rte-footeritems","",{},{title:this._getLocalizedLabels("clearFormat"),unselectable:"on"}).appendTo(n);this._clearAll=t.buildTag("div.e-rte-icons clearAll "+this._rteIconsList.clearAll+" e-rte-footericon e-rte-footeritems","",{},{title:this._getLocalizedLabels("clearAll")}).appendTo(n);this._resize=t.buildTag("div.e-icons e-rte-resize "+this._rteIconsList.rteResize+" e-rte-footeritems").appendTo(n);n.appendTo(this._rteFooter);this._footerEvents("_on");this.model.showHtmlSource||this._htmlSource.hide().removeClass("e-rte-footeritems");this.model.showHtmlTagInfo||this._htmlInfo.hide().removeClass("e-rte-footeritems");this.model.showWordCount||this._wordCount.hide().removeClass("e-rte-footeritems");this.model.showCharCount||this._charCount.hide().removeClass("e-rte-footeritems");this.model.showClearAll||this._clearAll.hide().removeClass("e-rte-footeritems");this.model.showClearFormat||this._clearFormat.hide().removeClass("e-rte-footeritems");r.enableResize?this._enableResize():this._resize.hide().removeClass("e-rte-footeritems");this._updateCount();this.model.showWordCount&&this._on(this._wordCount,"click",this._wordCharClick);this.model.showCharCount&&this._on(this._charCount,"click",this._wordCharClick);this._renderTooltip(this.model.tooltipSettings)},_renderTooltip:function(i){var r=n.extend(!0,{},i);r.cssClass=t.isNullOrUndefined(r.cssClass)?"e-rteTooltip "+this.model.cssClass:r.cssClass+" e-rteTooltip "+this.model.cssClass;r.enableRTL=this.model.enableRTL;r.showRoundedCorner=this.model.showRoundedCorner;r.target=".e-rte-icons";this.model.showFooter&&(this._tooltip=n(this._rteFooter).ejTooltip(r).data("ejTooltip"))},_hideTooltip:function(){t.isNullOrUndefined(this._tooltip)||this._tooltip.hide()},_footerElement:function(n,t){if(this.model.showFooter){var i=this._rteFooter.find(n);t?i.show().addClass("e-rte-footeritems"):i.hide().addClass("e-rte-footeritems")}},_wordCharClick:function(){this._alertWindow.ejDialog("option",{showHeader:!0,title:"<span style='padding-left:0.4em;'>"+this._getLocalizedLabels("wordCount")+"<\/span>"});this.model.enableRTL&&this._alertWindow.find(".e-alert-ok").removeClass("e-rte-alertBtnRTL");this._alertWindow.find(".e-rte-button").removeClass("e-fieldseparate").css({"text-align":"center","padding-bottom":"1em","padding-top":"0.5em"});this._alertWindow.ejDialog("instance").refresh();this._openAlert("<div style='padding-left:0.3em;padding-right:0.3em;'><div style='"+(this.model.enableRTL?"float:right":"float:left")+"'>"+this._getLocalizedLabels("words")+"<p style='margin:0.875em 0em;'>"+this._getLocalizedLabels("charSpace")+"<\/p><p style='margin:0.875em 0em;'>"+this._getLocalizedLabels("charNoSpace")+"<\/p><\/div><div style='"+(this.model.enableRTL?"float:left;padding-right:2em;":"float:right;padding-left:2em;")+"'>"+(n.trim(this._getText())!=""?n.trim(this._getText()).split(/\W+/).length:0)+"<p style='margin:0.875em 0em;'>"+this._getText().length+"<\/p><p style='margin:0.875em 0em;'>"+this._getText().replace(/\s/g,"").length+"<\/p><\/div><\/div><br/>")},_updateColorPalette:function(){var t=n("ul#"+this._rteId+"_colorTable"),i=n("ul#"+this._rteId+"_colorBGTable");t.find("div.e-rte-table").remove();t.find("li").append(this._colorTable());i.find("div.e-rte-table").remove();i.find("li").append(this._colorTable())},_enableRTL:function(n){try{n?this._rteIframe.contents().find("body").css("direction","rtl"):this._rteIframe.contents().find("body").css("direction","ltr")}catch(t){}this._subControlsSetModel("enableRTL",n)},_roundedCorner:function(n){n&&this._rteWapper.toggleClass("e-corner-all");this._subControlsSetModel("showRoundedCorner",n)},_subControlsSetModel:function(i,r){t.isNullOrUndefined(this._tooltip)||(i=="cssClass"?n(this._rteFooter).ejTooltip("option",i,"e-rteTooltip "+r):n(this._rteFooter).ejTooltip("option",i,r));t.isNullOrUndefined(this._formatDDL)||this._formatDDL.ejDropDownList("option",i,r);t.isNullOrUndefined(this._fontStyleDDL)||this._fontStyleDDL.ejDropDownList("option",i,r);t.isNullOrUndefined(this._fontSizeDDL)||this._fontSizeDDL.ejDropDownList("option",i,r);t.isNullOrUndefined(this._fontColorSplit)||this._fontColorSplit.ejSplitButton("option",i,r);t.isNullOrUndefined(this._bgColorSplit)||this._bgColorSplit.ejSplitButton("option",i,r);t.isNullOrUndefined(this._toolBarItems)||(i=="showRoundedCorner"&&this._toolBarItems.hasClass("e-corner-top")&&this._toolBarItems.removeClass("e-corner-top").addClass("e-corner-all"),this._toolBarItems.ejToolbar("option",i,r),i=="showRoundedCorner"&&this._toolBarItems.hasClass("e-corner-all")&&this._toolBarItems.removeClass("e-corner-all").addClass("e-corner-top"));t.isNullOrUndefined(this._linkDialog)||(this._linkDialog.ejDialog("option",i,r),this._linkDialog.find(".e-rte-btn").ejButton("option",i,r),this._chkTarget.ejCheckBox("option",i,r),i=="showRoundedCorner"&&(r==!0?this._linkDialog.find(".e-inputtext").addClass("e-corner-all"):this._linkDialog.find(".e-inputtext").removeClass("e-corner-all")));t.isNullOrUndefined(this._imgDialog)||(this._imgDialog.ejDialog("option",i,r),this._imgDialog.find("div.e-rte-imageTab").ejTab("option",i,r),this._imgDialog.find(".e-rte-imgBorderPx").ejNumericTextbox("option",i,r),this._imgDialog.find(".e-rte-imgBorderStyle").ejDropDownList("option",i,r),this._chkImgDimensions.ejCheckBox("option",i,r),this._dialogchkTarget.ejCheckBox("option",i,r),this._imgDialog.find(".e-rte-btn").ejButton("option",i,r),i=="showRoundedCorner"&&(r==!0?this._imgDialog.find(".e-inputtext").addClass("e-corner-all"):this._imgDialog.find(".e-inputtext").removeClass("e-corner-all")));t.isNullOrUndefined(this._videoDialog)||(this._videoDialog.ejDialog("option",i,r),this._videoDialog.find(".e-rte-btn").ejButton("option",i,r),this._chkvideoDimensions.ejCheckBox("option",i,r),i=="showRoundedCorner"&&(r==!0?this._videoDialog.find(".e-inputtext").addClass("e-corner-all"):this._videoDialog.find(".e-inputtext").removeClass("e-corner-all")));t.isNullOrUndefined(this._createTable)||this._createTable.ejDialog("option",i,r);t.isNullOrUndefined(this._sourceDialog)||(this._sourceDialog.ejDialog("option",i,