From: Alan Knowles Date: Tue, 2 Feb 2021 03:03:12 +0000 (+0800) Subject: Uncommited changes synced X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=90e53fc926b9fb3b4c0b817ff59b7701d6691bba Uncommited changes synced --- diff --git a/Roo/bootstrap/panel/Content.js b/Roo/bootstrap/panel/Content.js index 89b0eaaf92..ed26ba68df 100644 --- a/Roo/bootstrap/panel/Content.js +++ b/Roo/bootstrap/panel/Content.js @@ -65,11 +65,11 @@ Roo.bootstrap.panel.Content = function( config){ " roo-layout-inactive-content", id: config.id||el }; - if (this.iframe) { + if (config.iframe) { elcfg.cn = [ { tag : 'iframe', - style : 'border 0px', + style : 'border: 0px', src : 'about:blank' } ]; @@ -81,7 +81,7 @@ Roo.bootstrap.panel.Content = function( config){ } this.el = Roo.DomHelper.append(document.body, elcfg , true); - if (this.iframe) { + if (config.iframe) { this.iframeEl = this.el.select('iframe',true).first(); } @@ -220,6 +220,7 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, { tabTip : '', iframe : false, + iframeEl : false, setRegion : function(region){ this.region = region; @@ -409,8 +410,14 @@ panel.load({ this.el.setSize(width, height); } var size = this.adjustForComponents(width, height); + if (this.iframe) { + this.iframeEl.setSize(width,height); + } + this.resizeEl.setSize(this.autoWidth ? "auto" : size.width, this.autoHeight ? "auto" : size.height); this.fireEvent('resize', this, size.width, size.height); + + } }, diff --git a/docs/json/roodata.json b/docs/json/roodata.json index 96837d3a05..c41e975a11 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -66950,6 +66950,12 @@ "desc" : "True for this panel to adjust its size to fit when the region resizes (defaults to false)", "memberOf" : "" }, + { + "name" : "iframe", + "type" : "Boolean", + "desc" : "contents are an iframe - makes showing remote sources/CSS feasible..", + "memberOf" : "" + }, { "name" : "listeners", "type" : "Object", @@ -67144,7 +67150,7 @@ { "name" : "load", "type" : "function", - "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.", + "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.\nDoes not work with IFRAME contents", "sig" : "(url, params, callback, discardUrl)", "static" : false, "memberOf" : "" @@ -67192,7 +67198,7 @@ { "name" : "setContent", "type" : "function", - "desc" : "Updates this panel's element", + "desc" : "Updates this panel's element (not for iframe)", "sig" : "(content, loadScripts)", "static" : false, "memberOf" : "" @@ -67291,6 +67297,12 @@ "desc" : "The grid for this panel", "memberOf" : "" }, + { + "name" : "iframe", + "type" : "Boolean", + "desc" : "contents are an iframe - makes showing remote sources/CSS feasible..", + "memberOf" : "Roo.bootstrap.panel.Content" + }, { "name" : "listeners", "type" : "Object", @@ -67493,7 +67505,7 @@ { "name" : "load", "type" : "function", - "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.", + "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.\nDoes not work with IFRAME contents", "sig" : "(url, params, callback, discardUrl)", "static" : false, "memberOf" : "Roo.bootstrap.panel.Content" @@ -67541,7 +67553,7 @@ { "name" : "setContent", "type" : "function", - "desc" : "Updates this panel's element", + "desc" : "Updates this panel's element (not for iframe)", "sig" : "(content, loadScripts)", "static" : false, "memberOf" : "Roo.bootstrap.panel.Content" @@ -67634,6 +67646,12 @@ "desc" : "True for this panel to adjust its size to fit when the region resizes (defaults to false)", "memberOf" : "Roo.bootstrap.panel.Content" }, + { + "name" : "iframe", + "type" : "Boolean", + "desc" : "contents are an iframe - makes showing remote sources/CSS feasible..", + "memberOf" : "Roo.bootstrap.panel.Content" + }, { "name" : "listeners", "type" : "Object", @@ -67844,7 +67862,7 @@ { "name" : "load", "type" : "function", - "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.", + "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.\nDoes not work with IFRAME contents", "sig" : "(url, params, callback, discardUrl)", "static" : false, "memberOf" : "Roo.bootstrap.panel.Content" @@ -67892,7 +67910,7 @@ { "name" : "setContent", "type" : "function", - "desc" : "Updates this panel's element", + "desc" : "Updates this panel's element (not for iframe)", "sig" : "(content, loadScripts)", "static" : false, "memberOf" : "Roo.bootstrap.panel.Content" diff --git a/docs/src/Roo_bootstrap_panel_Content.js.html b/docs/src/Roo_bootstrap_panel_Content.js.html index 1f1d379d97..1fb9bd673b 100644 --- a/docs/src/Roo_bootstrap_panel_Content.js.html +++ b/docs/src/Roo_bootstrap_panel_Content.js.html @@ -27,6 +27,7 @@ * @cfg {String/Object} params When used with {@link #url}, calls {@link #setUrl} with this value * @cfg {Boolean} loadOnce When used with {@link #url}, calls {@link #setUrl} with this value * @cfg {String} content Raw content to fill content panel with (uses setContent on construction.) + * @cfg {Boolean} iframe contents are an iframe - makes showing remote sources/CSS feasible.. * @cfg {Boolean} badges render the badges * @cfg {String} cls extra classes to use * @cfg {String} background (primary|secondary|success|info|warning|danger|light|dark) @@ -64,12 +65,26 @@ " roo-layout-inactive-content", id: config.id||el }; + if (this.iframe) { + elcfg.cn = [ + { + tag : 'iframe', + style : 'border 0px', + src : 'about:blank' + } + ]; + } + if (config.html) { elcfg.html = config.html; } this.el = Roo.DomHelper.append(document.body, elcfg , true); + if (this.iframe) { + this.iframeEl = this.el.select('iframe',true).first(); + } + } } this.closable = false; @@ -166,7 +181,7 @@ - if(this.autoScroll){ + if(this.autoScroll && !this.iframe){ this.resizeEl.setStyle("overflow", "auto"); } else { // fix randome scrolling @@ -204,6 +219,8 @@ tabTip : '', + iframe : false, + setRegion : function(region){ this.region = region; this.setActiveClass(region && !this.background); @@ -243,11 +260,15 @@ return true; }, /** - * Updates this panel's element + * Updates this panel's element (not for iframe) * @param {String} content The new content * @param {Boolean} loadScripts (optional) true to look for and process scripts */ setContent : function(content, loadScripts){ + if (this.iframe) { + return; + } + this.el.update(content, loadScripts); }, @@ -264,10 +285,14 @@ * @return {Roo.UpdateManager} The UpdateManager */ getUpdateManager : function(){ + if (this.iframe) { + return false; + } return this.el.getUpdateManager(); }, /** * Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}. + * Does not work with IFRAME contents * @param {Object/String/Function} url The url for this request or a function to call to get the url or a config object containing any of the following options: <pre><code> panel.load({ @@ -282,6 +307,7 @@ panel.load({ scripts: false }); </code></pre> + * The only required property is <i>url</i>. The optional properties <i>nocache</i>, <i>text</i> and <i>scripts</i> * are shorthand for <i>disableCaching</i>, <i>indicatorText</i> and <i>loadScripts</i> and are used to set their associated property on this panel UpdateManager instance. * @param {String/Object} params (optional) The parameters to pass as either a URL encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2} @@ -290,6 +316,11 @@ panel.load({ * @return {Roo.ContentPanel} this */ load : function(){ + + if (this.iframe) { + return this; + } + var um = this.el.getUpdateManager(); um.update.apply(um, arguments); return this; @@ -301,9 +332,14 @@ panel.load({ * @param {String/Function} url The URL to load the content from or a function to call to get the URL * @param {String/Object} params (optional) The string params for the update call or an object of the params. See {@link Roo.UpdateManager#update} for more details. (Defaults to null) * @param {Boolean} loadOnce (optional) Whether to only load the content once. If this is false it makes the Ajax call every time this panel is activated. (Defaults to false) - * @return {Roo.UpdateManager} The UpdateManager + * @return {Roo.UpdateManager|Boolean} The UpdateManager or false if IFRAME */ setUrl : function(url, params, loadOnce){ + if (this.iframe) { + this.iframeEl.dom.src = url; + return false; + } + if(this.refreshDelegate){ this.removeListener("activate", this.refreshDelegate); } diff --git a/docs/symbols/Roo.bootstrap.panel.Content.json b/docs/symbols/Roo.bootstrap.panel.Content.json index 0eafbc3835..21e7c7dc9a 100644 --- a/docs/symbols/Roo.bootstrap.panel.Content.json +++ b/docs/symbols/Roo.bootstrap.panel.Content.json @@ -116,6 +116,13 @@ "memberOf" : "Roo.bootstrap.panel.Content", "optvals" : [] }, + { + "name" : "iframe", + "type" : "Boolean", + "desc" : "contents are an iframe - makes showing remote sources/CSS feasible..", + "memberOf" : "Roo.bootstrap.panel.Content", + "optvals" : [] + }, { "name" : "cls", "type" : "String", @@ -304,8 +311,8 @@ "returns" : [ { "name" : "", - "type" : "Roo.UpdateManager", - "desc" : "The UpdateManager" + "type" : "Roo.UpdateManager|Boolean", + "desc" : "The UpdateManager or false if IFRAME" } ] }, @@ -345,7 +352,7 @@ }, { "name" : "load", - "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.", + "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.\nDoes not work with IFRAME contents", "isStatic" : false, "isConstructor" : false, "isPrivate" : false, @@ -450,7 +457,7 @@ }, { "name" : "setContent", - "desc" : "Updates this panel's element", + "desc" : "Updates this panel's element (not for iframe)", "isStatic" : false, "isConstructor" : false, "isPrivate" : false, diff --git a/docs/symbols/Roo.bootstrap.panel.Grid.json b/docs/symbols/Roo.bootstrap.panel.Grid.json index f61d967228..c365f0bd42 100644 --- a/docs/symbols/Roo.bootstrap.panel.Grid.json +++ b/docs/symbols/Roo.bootstrap.panel.Grid.json @@ -99,6 +99,13 @@ "memberOf" : "Roo.bootstrap.panel.Content", "optvals" : [] }, + { + "name" : "iframe", + "type" : "Boolean", + "desc" : "contents are an iframe - makes showing remote sources/CSS feasible..", + "memberOf" : "Roo.bootstrap.panel.Content", + "optvals" : [] + }, { "name" : "cls", "type" : "String", @@ -314,8 +321,8 @@ "returns" : [ { "name" : "", - "type" : "Roo.UpdateManager", - "desc" : "The UpdateManager" + "type" : "Roo.UpdateManager|Boolean", + "desc" : "The UpdateManager or false if IFRAME" } ] }, @@ -355,7 +362,7 @@ }, { "name" : "load", - "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.", + "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.\nDoes not work with IFRAME contents", "isStatic" : false, "isConstructor" : false, "isPrivate" : false, @@ -460,7 +467,7 @@ }, { "name" : "setContent", - "desc" : "Updates this panel's element", + "desc" : "Updates this panel's element (not for iframe)", "isStatic" : false, "isConstructor" : false, "isPrivate" : false, diff --git a/docs/symbols/Roo.bootstrap.panel.Nest.json b/docs/symbols/Roo.bootstrap.panel.Nest.json index b014780291..90eeacb236 100644 --- a/docs/symbols/Roo.bootstrap.panel.Nest.json +++ b/docs/symbols/Roo.bootstrap.panel.Nest.json @@ -105,6 +105,13 @@ "memberOf" : "Roo.bootstrap.panel.Content", "optvals" : [] }, + { + "name" : "iframe", + "type" : "Boolean", + "desc" : "contents are an iframe - makes showing remote sources/CSS feasible..", + "memberOf" : "Roo.bootstrap.panel.Content", + "optvals" : [] + }, { "name" : "cls", "type" : "String", @@ -334,8 +341,8 @@ "returns" : [ { "name" : "", - "type" : "Roo.UpdateManager", - "desc" : "The UpdateManager" + "type" : "Roo.UpdateManager|Boolean", + "desc" : "The UpdateManager or false if IFRAME" } ] }, @@ -375,7 +382,7 @@ }, { "name" : "load", - "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.", + "desc" : "Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.\nDoes not work with IFRAME contents", "isStatic" : false, "isConstructor" : false, "isPrivate" : false, @@ -480,7 +487,7 @@ }, { "name" : "setContent", - "desc" : "Updates this panel's element", + "desc" : "Updates this panel's element (not for iframe)", "isStatic" : false, "isConstructor" : false, "isPrivate" : false, diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 637d27abd5..8d3522112b 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -39514,11 +39514,11 @@ Roo.bootstrap.panel.Content = function( config){ " roo-layout-inactive-content", id: config.id||el }; - if (this.iframe) { + if (config.iframe) { elcfg.cn = [ { tag : 'iframe', - style : 'border 0px', + style : 'border: 0px', src : 'about:blank' } ]; @@ -39530,7 +39530,7 @@ Roo.bootstrap.panel.Content = function( config){ } this.el = Roo.DomHelper.append(document.body, elcfg , true); - if (this.iframe) { + if (config.iframe) { this.iframeEl = this.el.select('iframe',true).first(); } @@ -39669,6 +39669,7 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, { tabTip : '', iframe : false, + iframeEl : false, setRegion : function(region){ this.region = region; @@ -39858,8 +39859,14 @@ panel.load({ this.el.setSize(width, height); } var size = this.adjustForComponents(width, height); + if (this.iframe) { + this.iframeEl.setSize(width,height); + } + this.resizeEl.setSize(this.autoWidth ? "auto" : size.width, this.autoHeight ? "auto" : size.height); this.fireEvent('resize', this, size.width, size.height); + + } }, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 1735a81944..a818a1cda5 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1699,12 +1699,12 @@ this.split.el.setLeft(A.x+A.width);this.split.el.setTop(A.y);this.split.el.setHe Roo.namespace("Roo.bootstrap.panel"); // Roo/bootstrap/panel/Content.js Roo.bootstrap.panel.Content=function(A){this.tpl=A.tpl||false;var el=A.el;var B=A.content;if(A.autoCreate){el=Roo.id();}this.el=Roo.get(el);if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=A.id||el;}this.el=Roo.DomHelper.append(document.body,A.autoCreate,true); -}else{var C={tag:"div",cls:(A.cls||'')+(A.background?' bg-'+A.background:'')+" roo-layout-inactive-content",id:A.id||el};if(this.iframe){C.cn=[{tag:'iframe',style:'border 0px',src:'about:blank'}];}if(A.html){C.html=A.html;}this.el=Roo.DomHelper.append(document.body,C,true); -if(this.iframe){this.iframeEl=this.el.select('iframe',true).first();}}}this.closable=false;this.loaded=false;this.active=false;if(A.toolbar&&!A.toolbar.el&&A.toolbar.xtype){this.toolbar=new A.toolbar.xns[A.toolbar.xtype](A.toolbar);this.wrapEl=this.el;var ti=[]; +}else{var C={tag:"div",cls:(A.cls||'')+(A.background?' bg-'+A.background:'')+" roo-layout-inactive-content",id:A.id||el};if(A.iframe){C.cn=[{tag:'iframe',style:'border: 0px',src:'about:blank'}];}if(A.html){C.html=A.html;}this.el=Roo.DomHelper.append(document.body,C,true); +if(A.iframe){this.iframeEl=this.el.select('iframe',true).first();}}}this.closable=false;this.loaded=false;this.active=false;if(A.toolbar&&!A.toolbar.el&&A.toolbar.xtype){this.toolbar=new A.toolbar.xns[A.toolbar.xtype](A.toolbar);this.wrapEl=this.el;var ti=[]; if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;}var D=[];this.toolbar.render(this.wrapEl,'before');for(var i=0;i=0){var s=k.split('-');for(var i=0;i"+this.title[k]+"";}}else{t+=""+this.title[k]+"";}}return t;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A); -}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate(); -}},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null;},form:false,view:false,getChildContainer:function(){return this.getEl();}}); +}var C=this.adjustForComponents(A,B);if(this.iframe){this.iframeEl.setSize(A,B);}this.resizeEl.setSize(this.autoWidth?"auto":C.width,this.autoHeight?"auto":C.height);this.fireEvent('resize',this,C.width,C.height);}},getTitle:function(){if(typeof(this.title)!='object'){return this.title; +}var t='';for(var k in this.title){if(!this.title.hasOwnProperty(k)){continue;}if(k.indexOf('-')>=0){var s=k.split('-');for(var i=0;i"+this.title[k]+"";}}else{t+=""+this.title[k]+""; +}}return t;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip(); +},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null;},form:false,view:false,getChildContainer:function(){return this.getEl(); +}}); // Roo/bootstrap/panel/Grid.js Roo.bootstrap.panel.Grid=function(A){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"roo-layout-grid-wrapper roo-layout-inactive-content"},true);A.el=this.wrapper;if(A.container){this.wrapper.setStyle("overflow","hidden");this.wrapper.addClass('roo-grid-container'); }if(A.toolbar){var B=this.wrapper.createChild();this.toolbar=Roo.factory(A.toolbar);var ti=[];if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;}var C=[];this.toolbar.render(B);for(var i=0;i