This commit is contained in:
2024-11-05 10:47:20 -07:00
parent c801b1ff51
commit 5315c47fcd
276 changed files with 2990 additions and 6370 deletions

View File

@@ -1 +1 @@
Type.registerNamespace("Sys.Extended.UI.HtmlEditor");Sys.Extended.UI.HtmlEditor.PreviewPanel=function(n){Sys.Extended.UI.HtmlEditor.PreviewPanel.initializeBase(this,[n]);this._focus$delegate=Function.createDelegate(this,this._focus_event);this._blur$delegate=Function.createDelegate(this,this._blur_event);this._doc=null;this._content="";this._panel_timer=null};Sys.Extended.UI.HtmlEditor.PreviewPanel.prototype={_focus:function(){try{this.get_element().contentWindow.focus()}catch(n){}this._focused()},_focus_event:function(){if(this._panel_timer==null){var t=this.get_element().contentWindow,n=this;this._really_focused();this._panel_timer=setTimeout(function(){t.focus();n._really_focused();n._panel_timer=null},0)}return!0},_blur_event:function(){return this._panel_timer!=null&&(clearTimeout(this._panel_timer),this._panel_timer=null),!0},_activate:function(n){Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this,"_activate");this._content=n;this._wasFocused=!1;this._initIframe(n);Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["focus"],this._focus$delegate);Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["blur"],this._blur$delegate);this._activateFinished()},_deactivate:function(){if(Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["blur"],this._blur$delegate),Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["focus"],this._focus$delegate),Sys.Extended.UI.HtmlEditor.isIE)try{this._doc.open();this._doc.write("");this._doc.close();this.get_element().src="javascript:false;"}catch(n){}this._doc=null;this._content="";Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this,"_deactivate")},_initIframe:function(n){var t=Sys.Extended.UI.HtmlEditor.Trim(n);this._doc=this.get_element().contentWindow.document;Sys.Extended.UI.HtmlEditor.isIE&&(t=t.replace(/&amp;/ig,"&"));this._doc.open();this._doc.write('<html><head><link rel="stylesheet" href="'+this._editPanel.get_documentCssPath()+'" media="all" /><\/head><body>'+t+"<\/body><\/html>");this._doc.close()},_getContent:function(){return this._content},_setContent:function(n){this._content=n;this._initIframe(n)}};Sys.Extended.UI.HtmlEditor.PreviewPanel.registerClass("Sys.Extended.UI.HtmlEditor.PreviewPanel",Sys.Extended.UI.HtmlEditor.ModePanel);
Type.registerNamespace("Sys.Extended.UI.HtmlEditor"),Sys.Extended.UI.HtmlEditor.PreviewPanel=function(t){Sys.Extended.UI.HtmlEditor.PreviewPanel.initializeBase(this,[t]),this._focus$delegate=Function.createDelegate(this,this._focus_event),this._blur$delegate=Function.createDelegate(this,this._blur_event),this._doc=null,this._content="",this._panel_timer=null},Sys.Extended.UI.HtmlEditor.PreviewPanel.prototype={_focus:function(){try{this.get_element().contentWindow.focus()}catch(t){}this._focused()},_focus_event:function(){if(null==this._panel_timer){var t=this.get_element().contentWindow,e=this;this._really_focused(),this._panel_timer=setTimeout(function(){t.focus(),e._really_focused(),e._panel_timer=null},0)}return!0},_blur_event:function(){return null!=this._panel_timer&&(clearTimeout(this._panel_timer),this._panel_timer=null),!0},_activate:function(t){Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this,"_activate"),this._content=t,this._wasFocused=!1,this._initIframe(t),Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["focus"],this._focus$delegate),Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["blur"],this._blur$delegate),this._activateFinished()},_deactivate:function(){if(Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["blur"],this._blur$delegate),Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["focus"],this._focus$delegate),Sys.Extended.UI.HtmlEditor.isIE)try{this._doc.open(),this._doc.write(""),this._doc.close(),this.get_element().src="javascript:false;"}catch(t){}this._doc=null,this._content="",Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this,"_deactivate")},_initIframe:function(t){var e=Sys.Extended.UI.HtmlEditor.Trim(t);this._doc=this.get_element().contentWindow.document,Sys.Extended.UI.HtmlEditor.isIE&&(e=e.replace(/&amp;/gi,"&")),this._doc.open(),this._doc.write('<html><head><link rel="stylesheet" href="'+this._editPanel.get_documentCssPath()+'" media="all" /></head><body>'+e+"</body></html>"),this._doc.close()},_getContent:function(){return this._content},_setContent:function(t){this._content=t,this._initIframe(t)}},Sys.Extended.UI.HtmlEditor.PreviewPanel.registerClass("Sys.Extended.UI.HtmlEditor.PreviewPanel",Sys.Extended.UI.HtmlEditor.ModePanel);