﻿Type.registerNamespace("AjaxControlToolkit.HTMLEditor");AjaxControlToolkit.HTMLEditor.LastFocusedEditPanel=null;AjaxControlToolkit.HTMLEditor.EditPanel=function(e){var d=true,b=null,c=false,a=this;AjaxControlToolkit.HTMLEditor.EditPanel.initializeBase(a,[e]);a._loaded=c;a._eAfter=b;a._toolbars=b;a._modePanels=b;a._contentChangedElement=b;a._contentElement=b;a._contentForceElement=b;a._activeModeElement=b;a._suppressTabInDesignMode=c;a._keyboardEnabled=d;a._noPaste=c;a._hotkeys=b;a._showAnchors=c;a._showPlaceHolders=c;a._startEnd=d;a._relativeImages=d;a._documentCssPath=b;a._designPanelCssPath=b;a._imagePath_1x1=b;a._imagePath_flash=b;a._imagePath_media=b;a._imagePath_anchor=b;a._imagePath_placeHolder=b;a._autofocus=d;a._initialCleanUp=c;a._noScript=c;a._noUnicode=c;a._cachedToolbarIds=b;a._contentPrepared=c;a._activeMode=b;a._pageRequestManager=b;a._formOnSubmitSaved=b;a._app_onload$delegate=Function.createDelegate(a,a._app_onload);a._onsubmit$delegate=Function.createDelegate(a,a._onsubmit);a._disposed=d};AjaxControlToolkit.HTMLEditor.EditPanel.prototype={get_relativeImages:function(){return this._relativeImages},set_relativeImages:function(a){this._relativeImages=a;if(this._loaded)this.raisePropertyChanged("relativeImages")},get_startEnd:function(){return this._startEnd},set_startEnd:function(a){this._startEnd=a;if(this._loaded)this.raisePropertyChanged("startEnd")},get_showPlaceHolders:function(){return this._showPlaceHolders},set_showPlaceHolders:function(a){this._showPlaceHolders=a;if(this._loaded)this.raisePropertyChanged("showPlaceHolders")},get_showAnchors:function(){return this._showAnchors},set_showAnchors:function(a){this._showAnchors=a;if(this._loaded)this.raisePropertyChanged("showAnchors")},get_hotkeys:function(){return this._hotkeys},set_hotkeys:function(a){this._hotkeys=a;if(this._loaded)this.raisePropertyChanged("noPaste")},get_noPaste:function(){return this._noPaste},set_noPaste:function(a){this._noPaste=a;if(this._loaded)this.raisePropertyChanged("noPaste")},get_suppressTabInDesignMode:function(){return this._suppressTabInDesignMode},set_suppressTabInDesignMode:function(a){this._suppressTabInDesignMode=a;if(this._loaded)this.raisePropertyChanged("suppressTabInDesignMode")},get_keyboardEnabled:function(){return this._keyboardEnabled},set_keyboardEnabled:function(a){this._keyboardEnabled=a;if(this._loaded)this.raisePropertyChanged("keyboardEnabled")},get_noUnicode:function(){return this._noUnicode},set_noUnicode:function(a){this._noUnicode=a;if(this._loaded)this.raisePropertyChanged("noUnicode")},get_noScript:function(){return this._noScript},set_noScript:function(a){this._noScript=a;if(this._loaded)this.raisePropertyChanged("noScript")},get_initialCleanUp:function(){return this._initialCleanUp},set_initialCleanUp:function(a){this._initialCleanUp=a;if(this._loaded)this.raisePropertyChanged("initialCleanUp")},get_imagePath_1x1:function(){return this._imagePath_1x1},set_imagePath_1x1:function(a){this._imagePath_1x1=a},get_imagePath_flash:function(){return this._imagePath_flash},set_imagePath_flash:function(a){this._imagePath_flash=a},get_imagePath_media:function(){return this._imagePath_media},set_imagePath_media:function(a){this._imagePath_media=a},get_imagePath_anchor:function(){return this._imagePath_anchor},set_imagePath_anchor:function(a){this._imagePath_anchor=a},get_imagePath_placeHolder:function(){return this._imagePath_placeHolder},set_imagePath_placeHolder:function(a){this._imagePath_placeHolder=a},get_documentCssPath:function(){return this._documentCssPath},set_documentCssPath:function(a){this._documentCssPath=a;if(this._loaded)this.raisePropertyChanged("documentCssPath")},get_designPanelCssPath:function(){return this._designPanelCssPath},set_designPanelCssPath:function(a){this._designPanelCssPath=a;if(this._loaded)this.raisePropertyChanged("designPanelCssPath")},get_autofocus:function(){return this._autofocus},set_autofocus:function(a){this._autofocus=a;if(this._loaded)this.raisePropertyChanged("autofocus")},get_content:function(){if(this._activeMode==null)return "";return this.getContent()},set_content:function(b){var a=this;if(!a.get_isInitialized()||!a._loaded){if(a.get_contentElement()!=null)a.get_contentElement().value=b.replace(/\"/g,"&quot;");return}a.setContent(b);if(a._loaded)a.raisePropertyChanged("content")},get_activeMode:function(){if(this._activeMode==null)return AjaxControlToolkit.HTMLEditor.ActiveModeType.Design;return this._activeMode},set_activeMode:function(b){var a=this;if(!AjaxControlToolkit.HTMLEditor.ActiveModeType_checkValue(b))throw Error.argumentOutOfRange("value, function: AjaxControlToolkit.HTMLEditor.EditPanel.set_activeMode");var c=a._activeMode,d=true;if(a._loaded&&c!=null&&c!=b){var e=new AjaxControlToolkit.HTMLEditor.ActiveModeChangedArgs(c,b,a);a.raiseBeforeActiveModeChanged(e);a._eAfter=new AjaxControlToolkit.HTMLEditor.ActiveModeChangedArgs(c,b,a);d=a._setMode(b)}else a._activeMode=b;a.get_activeModeElement().value=b;return d},get_contentChangedElement:function(){return this._contentChangedElement},set_contentChangedElement:function(a){this._contentChangedElement=a},get_contentElement:function(){return this._contentElement},set_contentElement:function(a){this._contentElement=a},get_contentForceElement:function(){return this._contentForceElement},set_contentForceElement:function(a){this._contentForceElement=a},get_activeModeElement:function(){return this._activeModeElement},set_activeModeElement:function(a){this._activeModeElement=a},setCancelOnPostback:function(){if(this._loaded)this.get_contentForceElement().value=""},setAcceptOnPostback:function(){if(this._loaded)this.get_contentForceElement().value="1"},get_toolbars:function(){if(this._toolbars==null)this._toolbars=[];return this._toolbars},set_toolbars:function(a){this.get_toolbars().push(a)},get_toolbarIds:function(){},set_toolbarIds:function(c){if(!this.get_isInitialized()){this._cachedToolbarIds=c;return}var b=c.split(";");for(var a=0;a<b.length;a++)if(b[a].length>0)this.set_toolbars($find(b[a]))},get_modePanels:function(){if(this._modePanels==null)this._modePanels=[];return this._modePanels},set_modePanel:function(a){this.get_modePanels().push(a)},get_modePanelIds:function(){},set_modePanelIds:function(c){var b=c.split(";");for(var a=0;a<b.length;a++)this.set_modePanel($find(b[a]))},add_focused:function(a){this.get_events().addHandler("focused",a)},remove_focused:function(a){this.get_events().removeHandler("focused",a)},raiseFocused:function(b){var a=this.get_events().getHandler("focused");if(a)a(this,b)},add_activeModeChanged:function(a){this.get_events().addHandler("activeModeChanged",a)},remove_activeModeChanged:function(a){this.get_events().removeHandler("activeModeChanged",a)},raiseActiveModeChanged:function(b){var a=this.get_events().getHandler("activeModeChanged");if(a)a(this,b)},add_beforeActiveModeChanged:function(a){this.get_events().addHandler("beforeActiveModeChanged",a)},remove_beforeActiveModeChanged:function(a){this.get_events().removeHandler("beforeActiveModeChanged",a)},raiseBeforeActiveModeChanged:function(b){var a=this.get_events().getHandler("beforeActiveModeChanged");if(a)a(this,b)},get_activePanel:function(){var a=this.get_modePanels()[this.get_activeMode()];if(a==null||typeof a=="undefined")throw Error.argumentOutOfRange("activeMode, function: AjaxControlToolkit.HTMLEditor.EditPanel.get_activePanel");return a},initialize:function(){var a=this;a.__appLoaded__=false;AjaxControlToolkit.HTMLEditor.EditPanel.callBaseMethod(a,"initialize");a._disposed=false;Sys.Application.add_load(a._app_onload$delegate);if(Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager){a._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();if(a._pageRequestManager){a._partialUpdateEndRequestHandler=Function.createDelegate(a,a._partialUpdateEndRequest);a._pageRequestManager.add_endRequest(a._partialUpdateEndRequestHandler);a._invokingRequestHandler=Function.createDelegate(a,a._invokingRequest);Sys.Net.WebRequestManager.add_invokingRequest(a._invokingRequestHandler);a._completedRequestHandler=Function.createDelegate(a,a._completedRequest);Sys.Net.WebRequestManager.add_completedRequest(a._completedRequestHandler)}}AjaxControlToolkit.HTMLEditor.addFormOnSubmit(a._onsubmit$delegate)},dispose:function(){var b=null,a=this;a._loaded=false;a._disposed=true;if(a._pageRequestManager){if(a._invokingRequestHandler){a._pageRequestManager.remove_endRequest(a._partialUpdateEndRequestHandler);a._partialUpdateEndRequestHandler=b;Sys.Net.WebRequestManager.remove_invokingRequest(a._invokingRequestHandler);a._invokingRequestHandler=b;Sys.Net.WebRequestManager.remove_completedRequest(a._completedRequestHandler);a._completedRequestHandler=b}a._pageRequestManager=b}AjaxControlToolkit.HTMLEditor.removeFormOnSubmit(a._onsubmit$delegate);Sys.Application.remove_load(a._app_onload$delegate);a.disableToolbars();AjaxControlToolkit.HTMLEditor.EditPanel.callBaseMethod(a,"dispose")},_onsubmit:function(){var a=this;if(!a._contentPrepared){a._prepareContentForPostback(a.get_content());a._contentPrepared=true}return true},_invokingRequest:function(f,d){var a=this;if(a._contentPrepared)return;var c=d.get_webRequest(),b=c.get_body(),e=new RegExp("([\\?&])("+a.get_contentElement().name+"=)([^&$]*)([&$])","g");b=b.replace(e,"$1$2"+escape(a.get_content().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;"))+"$4");a._contentPrepared=true;c.set_body(b)},_completedRequest:function(){this._contentPrepared=false},_partialUpdateEndRequest:function(){var a=this;a._contentPrepared=false;if(AjaxControlToolkit.HTMLEditor.isIE&&a.__blured){a.__blured=false;a.get_activePanel()._focus()}},_app_onload:function(){var b=null,a=this;if(a.__appLoaded__)return;a.__appLoaded__=true;if(a._disposed)return;var h=a;a._loaded=true;a.set_activeMode(parseInt(a.get_activeModeElement().value));if(a._cachedToolbarIds!=b){a.set_toolbarIds(a._cachedToolbarIds);a._cachedToolbarIds=b}a._shouldResize=false;if(AjaxControlToolkit.HTMLEditor.isIE&&document.compatMode!="BackCompat")if(a.get_element().clientHeight==0||Sys.Browser.version<7)a._shouldResize=true;if(a._shouldResize){var e=a.get_modePanels(),c=e[AjaxControlToolkit.HTMLEditor.ActiveModeType.Design];if(c==b)c=e[AjaxControlToolkit.HTMLEditor.ActiveModeType.Preview];var f=e[AjaxControlToolkit.HTMLEditor.ActiveModeType.Html];if(c!=b&&f!=b){var d=c.get_element();d.style.display="";f.get_element().style.height=d.offsetHeight+"px";d.style.display="none"}}var g=a.get_contentElement().value.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&");a.setContent(a._initialCleanUp?AjaxControlToolkit.HTMLEditor.cleanUp(g.replace(/[\n\r]+/g," ")):g);a.setAcceptOnPostback()},_setActive:function(){var a=this;for(var b=0;b<a.get_toolbars().length;b++)a.get_toolbars()[b].set_activeEditPanel(a,true);if(a._eAfter!=null){a.raisePropertyChanged("activeMode");a.raiseActiveModeChanged(a._eAfter);a._eAfter=null}},_focused:function(c){var a=this;if(!(typeof c!="undefined"&&c))for(var b=0;b<a.get_toolbars().length;b++)a.get_toolbars()[b].set_activeEditPanel(a);AjaxControlToolkit.HTMLEditor.LastFocusedEditPanel=a},_really_focused:function(){this._focused();this.raiseFocused(new Sys.EventArgs)},updateToolbar:function(){this._focused()},getContent:function(){return this.get_activePanel().get_content().replace(/<\/?html(?=\s|>)(?:[^>]*?)>/gi,"").replace(/<\/?head(?=\s|>)(?:[^>]*?)>/gi,"").replace(/<\/?body(?=\s|>)(?:[^>]*?)>/gi,"").replace(/^([\n\r]+)/,"").replace(/([\n\r]+)$/,"")},setContent:function(b){var a=b;if(this.get_noScript())a=a.replace(/(<script(?:[^>]*?)>(?:[^<]*?)<\/script(?:[^>]*?)>)/ig,"");a=a.replace(/<\/?html(?=\s|>)(?:[^>]*?)>/gi,"").replace(/<\/?head(?=\s|>)(?:[^>]*?)>/gi,"").replace(/<\/?body(?=\s|>)(?:[^>]*?)>/gi,"").replace(/^([\n\r]+)/,"").replace(/([\n\r]+)$/,"");this._prepareContentForPostback(a);this.get_activePanel().set_content(a)},_prepareContentForPostback:function(a){this.get_contentElement().value=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")},_setMode:function(b){var a=this,c=a.get_activePanel();if(!c._activated){var f=a;setTimeout(function(){f._setMode(b)},10);return false}var g=a.get_content();if(a._shouldResize&&b==AjaxControlToolkit.HTMLEditor.ActiveModeType.Html){var d=a.get_activePanel(),e=a.get_modePanels()[AjaxControlToolkit.HTMLEditor.ActiveModeType.Html];if(d!=null&&e!=null)e.get_element().style.height=d.get_element().offsetHeight+"px"}a.disableToolbars(b);c._deactivate();a._activeMode=b;a.setContent(g);return true},disableToolbars:function(c){for(var a=0;a<this.get_toolbars().length;a++){var b=this.get_toolbars()[a];if(b._loaded)b.disable(c)}},openWait:function(){},closeWait:function(){}};AjaxControlToolkit.HTMLEditor.EditPanel.registerClass("AjaxControlToolkit.HTMLEditor.EditPanel",Sys.UI.Control);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();