From 7dfd0d3cd68424e103991ef6946d2368cbe08a81 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 18 Jan 2024 14:43:41 +0800 Subject: [PATCH] fix #7318 - rename upload cropbox and panel tree --- Roo/BasicDialog.js | 8 +- Roo/BasicLayoutRegion.js | 28 +- Roo/BorderLayout.js | 97 +- Roo/{ContentPanel.js => Content.js} | 22 +- Roo/LayoutDialog.js | 10 +- Roo/LayoutRegion.js | 22 +- Roo/Login.js | 4 +- Roo/ReaderLayout.js | 4 +- Roo/ScrollPanel.js | 2 +- Roo/ViewPanel.js | 10 +- Roo/depreicated.js | 8 + Roo/dialog/namespace.js | 1 - Roo/{CalendarPanel.js => panel/Calendar.js} | 6 +- Roo/panel/Content.js | 479 + .../UploadCropbox.js => panel/Cropbox.js} | 58 +- Roo/{GridPanel.js => panel/Grid.js} | 12 +- .../NestedLayout.js} | 12 +- Roo/{TabPanel.js => panel/Tab.js} | 385 +- Roo/panel/TabItem.js | 324 + Roo/{TreePanel.js => panel/Tree.js} | 12 +- Roo/panel/namespace.js | 1 + buildSDK/dependancy_calendar.txt | 2 +- buildSDK/dependancy_ui.txt | 17 +- buildSDK/doc_templates/static/doc.js | 613 + css/roojs-debug.css | 2 +- docs/src/Roo_form_Password.js.html | 55 + examples/dialog/hello.html | 4 +- examples/dialog/hello.js | 12 +- examples/dialog/layout.js | 30 +- examples/examples.js | 4 +- examples/grid/ArrayGrid.bjs | 4 +- examples/grid/ArrayGrid.js | 4 +- examples/grid/array-grid.js | 2 +- examples/grid/calendar.js | 2 +- examples/grid/edit-grid.js | 2 +- examples/grid/viewpanel.js | 2 +- examples/layout/calendar.js | 8 +- examples/layout/viewpanel.bjs | 8 +- examples/layout/viewpanel.js | 8 +- .../uploadCropbox.html => panel/cropbox.html} | 12 +- .../uploadCropbox.js => panel/cropbox.js} | 24 +- examples/tabs/tabs-adv.js | 4 +- examples/tabs/tabs-example.js | 22 +- examples/tree/organizer.js | 4 +- examples/view/chooser.js | 24 +- locale/zh_HK.js | 2 +- roojs-all.js | 309 +- roojs-debug.js | 70653 ++++++++-------- roojs-ui-debug.js | 70653 ++++++++-------- roojs-ui.js | 309 +- 50 files changed, 72842 insertions(+), 71458 deletions(-) rename Roo/{ContentPanel.js => Content.js} (97%) create mode 100644 Roo/depreicated.js delete mode 100644 Roo/dialog/namespace.js rename Roo/{CalendarPanel.js => panel/Calendar.js} (96%) create mode 100644 Roo/panel/Content.js rename Roo/{dialog/UploadCropbox.js => panel/Cropbox.js} (97%) rename Roo/{GridPanel.js => panel/Grid.js} (88%) rename Roo/{NestedLayoutPanel.js => panel/NestedLayout.js} (91%) rename Roo/{TabPanel.js => panel/Tab.js} (54%) create mode 100644 Roo/panel/TabItem.js rename Roo/{TreePanel.js => panel/Tree.js} (80%) create mode 100644 Roo/panel/namespace.js create mode 100644 buildSDK/doc_templates/static/doc.js create mode 100644 docs/src/Roo_form_Password.js.html rename examples/{dialog/uploadCropbox.html => panel/cropbox.html} (77%) rename examples/{dialog/uploadCropbox.js => panel/cropbox.js} (91%) diff --git a/Roo/BasicDialog.js b/Roo/BasicDialog.js index d8034fdab8..cb148bb545 100644 --- a/Roo/BasicDialog.js +++ b/Roo/BasicDialog.js @@ -335,7 +335,7 @@ Roo.extend(Roo.BasicDialog, Roo.util.Observable, { /** * Reinitializes the tabs component, clearing out old tabs and finding new ones. - * @return {Roo.TabPanel} The tabs component + * @return {Roo.panel.Tab} The tabs component */ initTabs : function(){ var tabs = this.getTabs(); @@ -456,16 +456,16 @@ Roo.extend(Roo.BasicDialog, Roo.util.Observable, { }, /** - * Returns the TabPanel component (creates it if it doesn't exist). + * Returns the panel.Tab component (creates it if it doesn't exist). * Note: If you wish to simply check for the existence of tabs without creating them, * check for a null 'tabs' property. - * @return {Roo.TabPanel} The tabs component + * @return {Roo.panel.Tab} The tabs component */ getTabs : function(){ if(!this.tabs){ this.el.addClass("x-dlg-auto-tabs"); this.body.addClass(this.tabPosition == "bottom" ? "x-tabs-bottom" : "x-tabs-top"); - this.tabs = new Roo.TabPanel(this.body.dom, this.tabPosition == "bottom"); + this.tabs = new Roo.panel.Tab(this.body.dom, this.tabPosition == "bottom"); } return this.tabs; }, diff --git a/Roo/BasicLayoutRegion.js b/Roo/BasicLayoutRegion.js index 2f2d910820..f6394ca8b2 100644 --- a/Roo/BasicLayoutRegion.js +++ b/Roo/BasicLayoutRegion.js @@ -28,7 +28,7 @@ Roo.BasicLayoutRegion = function(mgr, config, pos, skipConfig){ * @event beforeremove * Fires before a panel is removed (or closed). To cancel the removal set "e.cancel = true" on the event argument. * @param {Roo.LayoutRegion} this - * @param {Roo.ContentPanel} panel The panel + * @param {Roo.panel.Content} panel The panel * @param {Object} e The cancel event object */ "beforeremove" : true, @@ -49,14 +49,14 @@ Roo.BasicLayoutRegion = function(mgr, config, pos, skipConfig){ * @event paneladded * Fires when a panel is added. * @param {Roo.LayoutRegion} this - * @param {Roo.ContentPanel} panel The panel + * @param {Roo.panel.Content} panel The panel */ "paneladded" : true, /** * @event panelremoved * Fires when a panel is removed. * @param {Roo.LayoutRegion} this - * @param {Roo.ContentPanel} panel The panel + * @param {Roo.panel.Content} panel The panel */ "panelremoved" : true, /** @@ -93,7 +93,7 @@ Roo.BasicLayoutRegion = function(mgr, config, pos, skipConfig){ * @event panelactivated * Fires when a panel is activated. * @param {Roo.LayoutRegion} this - * @param {Roo.ContentPanel} panel The activated panel + * @param {Roo.panel.Content} panel The activated panel */ "panelactivated" : true, /** @@ -207,8 +207,8 @@ Roo.extend(Roo.BasicLayoutRegion, Roo.util.Observable, { /** * Show the specified panel. - * @param {Number/String/ContentPanel} panelId The panels index, id or the panel itself - * @return {Roo.ContentPanel} The shown panel or null + * @param {Number/String/panel.Content} panelId The panels index, id or the panel itself + * @return {Roo.panel.Content} The shown panel or null */ showPanel : function(panel){ if(panel = this.getPanel(panel)){ @@ -219,7 +219,7 @@ Roo.extend(Roo.BasicLayoutRegion, Roo.util.Observable, { /** * Get the active panel for this region. - * @return {Roo.ContentPanel} The active panel or null + * @return {Roo.panel.Content} The active panel or null */ getActivePanel : function(){ return this.activePanel; @@ -227,8 +227,8 @@ Roo.extend(Roo.BasicLayoutRegion, Roo.util.Observable, { /** * Add the passed ContentPanel(s) - * @param {ContentPanel...} panel The ContentPanel(s) to add (you can pass more than one) - * @return {Roo.ContentPanel} The panel added (if only one was added) + * @param {panel.Content...} panel The ContentPanel(s) to add (you can pass more than one) + * @return {Roo.panel.Content} The panel added (if only one was added) */ add : function(panel){ if(arguments.length > 1){ @@ -262,7 +262,7 @@ Roo.extend(Roo.BasicLayoutRegion, Roo.util.Observable, { /** * Returns true if the panel is in this region. - * @param {Number/String/ContentPanel} panel The panels index, id or the panel itself + * @param {Number/String/panel.Content} panel The panels index, id or the panel itself * @return {Boolean} */ hasPanel : function(panel){ @@ -274,9 +274,9 @@ Roo.extend(Roo.BasicLayoutRegion, Roo.util.Observable, { /** * Removes the specified panel. If preservePanel is not true (either here or in the config), the panel is destroyed. - * @param {Number/String/ContentPanel} panel The panels index, id or the panel itself + * @param {Number/String/panel.Content} panel The panels index, id or the panel itself * @param {Boolean} preservePanel Overrides the config preservePanel option - * @return {Roo.ContentPanel} The panel that was removed + * @return {Roo.panel.Content} The panel that was removed */ remove : function(panel, preservePanel){ panel = this.getPanel(panel); @@ -295,8 +295,8 @@ Roo.extend(Roo.BasicLayoutRegion, Roo.util.Observable, { /** * Returns the panel specified or null if it's not in this region. - * @param {Number/String/ContentPanel} panel The panels index, id or the panel itself - * @return {Roo.ContentPanel} + * @param {Number/String/panel.Content} panel The panels index, id or the panel itself + * @return {Roo.panel.Content} */ getPanel : function(id){ if(typeof id == "object"){ // must be panel obj diff --git a/Roo/BorderLayout.js b/Roo/BorderLayout.js index 8228cedb34..26e53be520 100644 --- a/Roo/BorderLayout.js +++ b/Roo/BorderLayout.js @@ -11,7 +11,7 @@ /** * @class Roo.BorderLayout * @extends Roo.LayoutManager - * @children Roo.ContentPanel + * @children Roo.panel.Content * This class represents a common layout manager used in desktop applications. For screenshots and more details, * please see:

* Cross Browser Layouts - Part 1
@@ -57,7 +57,7 @@ }); // shorthand -var CP = Roo.ContentPanel; +var CP = Roo.panel.Content; layout.beginUpdate(); layout.add("north", new CP("north", "North")); @@ -228,8 +228,8 @@ Roo.extend(Roo.BorderLayout, Roo.LayoutManager, { /** * Adds a ContentPanel (or subclass) to this layout. * @param {String} target The target region key (north, south, east, west or center). - * @param {Roo.ContentPanel} panel The panel to add - * @return {Roo.ContentPanel} The added panel + * @param {Roo.panel.Content} panel The panel to add + * @return {Roo.panel.Content} The added panel */ add : function(target, panel){ @@ -240,8 +240,8 @@ Roo.extend(Roo.BorderLayout, Roo.LayoutManager, { /** * Remove a ContentPanel (or subclass) to this layout. * @param {String} target The target region key (north, south, east, west or center). - * @param {Number/String/Roo.ContentPanel} panel The index, id or panel to remove - * @return {Roo.ContentPanel} The removed panel + * @param {Number/String/Roo.panel.Content} panel The index, id or panel to remove + * @return {Roo.panel.Content} The removed panel */ remove : function(target, panel){ target = target.toLowerCase(); @@ -251,7 +251,7 @@ Roo.extend(Roo.BorderLayout, Roo.LayoutManager, { /** * Searches all regions for a panel with the specified id * @param {String} panelId - * @return {Roo.ContentPanel} The panel or null if it wasn't found + * @return {Roo.panel.Content} The panel or null if it wasn't found */ findPanel : function(panelId){ var rs = this.regions; @@ -268,8 +268,8 @@ Roo.extend(Roo.BorderLayout, Roo.LayoutManager, { /** * Searches all regions for a panel with the specified id and activates (shows) it. - * @param {String/ContentPanel} panelId The panels id or the panel itself - * @return {Roo.ContentPanel} The shown panel or null + * @param {String/panel.Content} panelId The panels id or the panel itself + * @return {Roo.panel.Content} The shown panel or null */ showPanel : function(panelId) { var rs = this.regions; @@ -347,7 +347,7 @@ layout.batchAdd({ // private addTypedPanels : function(lr, ps){ if(typeof ps == 'string'){ - lr.add(new Roo.ContentPanel(ps)); + lr.add(new Roo.panel.Content(ps)); } else if(ps instanceof Array){ for(var i =0, len = ps.length; i < len; i++){ @@ -357,7 +357,7 @@ layout.batchAdd({ else if(!ps.events){ // raw config? var el = ps.el; delete ps.el; // prevent conflict - lr.add(new Roo.ContentPanel(el || Roo.id(), ps)); + lr.add(new Roo.panel.Content(el || Roo.id(), ps)); } else { // panel object assumed! lr.add(ps); @@ -393,11 +393,11 @@ layout.addxtype({ // can accept a layout region..!?!? //Roo.log('Roo.BorderLayout add ' + cfg.xtype) - if (!cfg.xtype.match(/Panel$/)) { - return false; - } + // if (!cfg.xtype.match(/Panel$/)) { + // return false; + // } var ret = false; - + if (typeof(cfg.region) == 'undefined') { Roo.log("Failed to add Panel, region was not set"); Roo.log(cfg); @@ -416,7 +416,72 @@ layout.addxtype({ switch(cfg.xtype) { - case 'ContentPanel': // ContentPanel (el, cfg) + case 'Content': + if(cfg.autoCreate) { + ret = new Roo.panel[cfg.xtype](cfg); // new panel!!!!! + } else { + var el = this.el.createChild(); + ret = new Roo.panel[cfg.xtype](el, cfg); // new panel!!!!! + } + + this.add(region, ret); + break; + case 'Grid': + // needs grid and region + + //var el = this.getRegion(region).el.createChild(); + var el = this.el.createChild(); + // create the grid first... + + var grid = new Roo.grid[cfg.grid.xtype](el, cfg.grid); + delete cfg.grid; + if (region == 'center' && this.active ) { + cfg.background = false; + } + ret = new Roo.panel[cfg.xtype](grid, cfg); // new panel!!!!! + + this.add(region, ret); + if (cfg.background) { + ret.on('activate', function(gp) { + if (!gp.grid.rendered) { + gp.grid.render(); + } + }); + } else { + grid.render(); + } + break; + case 'NestedLayout': + // create a new Layout (which is a Border Layout... + var el = this.el.createChild(); + var clayout = cfg.layout; + delete cfg.layout; + clayout.items = clayout.items || []; + // replace this exitems with the clayout ones.. + xitems = clayout.items; + + + if (region == 'center' && this.active && this.getRegion('center').panels.length < 1) { + cfg.background = false; + } + var layout = new Roo.BorderLayout(el, clayout); + + ret = new Roo.panel[cfg.xtype](layout, cfg); // new panel!!!!! + //console.log('adding nested layout panel ' + cfg.toSource()); + this.add(region, ret); + nb = {}; /// find first... + break; + + case 'Calendar': + ret = new Roo.panel[cfg.xtype](cfg); // new panel!!!!! + this.add(region, ret); + break; + case 'Tree': // our new panel! + cfg.el = this.el.createChild(); + ret = new Roo.panel[cfg.xtype](cfg); // new panel!!!!! + this.add(region, ret); + break; + case 'ContentPanel': case 'ScrollPanel': // ContentPanel (el, cfg) case 'ViewPanel': if(cfg.autoCreate) { diff --git a/Roo/ContentPanel.js b/Roo/Content.js similarity index 97% rename from Roo/ContentPanel.js rename to Roo/Content.js index cc1b9d0ce5..56b6abd47d 100644 --- a/Roo/ContentPanel.js +++ b/Roo/Content.js @@ -9,11 +9,11 @@ * - - + + -

Upload Cropbox Dialog

-

This example shows how to create a very simple BasicDialog with "UploadCropbox".

+

Cropbox Panel

+

This example shows how to create a very simple BasicDialog with "Cropbox".



Note that the js is not minified so it is readable. See -for the full source code.

+for the full source code.

diff --git a/examples/dialog/uploadCropbox.js b/examples/panel/cropbox.js similarity index 91% rename from examples/dialog/uploadCropbox.js rename to examples/panel/cropbox.js index 9535a31123..5bae447d48 100644 --- a/examples/dialog/uploadCropbox.js +++ b/examples/panel/cropbox.js @@ -1,4 +1,4 @@ -var uploadCropbox = { +var cropboxDialog = { dialog : false, callback : false, @@ -32,13 +32,13 @@ var uploadCropbox = { }, items : [ { - xtype: 'ContentPanel', - xns: Roo, + xtype: 'Content', + xns: Roo.panel, region : "center", items : [ { - xtype : 'UploadCropbox', - xns : Roo.dialog, + xtype : 'Cropbox', + xns : Roo.panel, minWidth : 720, minHeight : 480, outputMaxWidth : 1200, @@ -148,11 +148,11 @@ var test = { }, items : [ { - xns : Roo, - xtype: 'GridPanel', + xns : Roo.panel, + xtype: 'Grid', region : "center", grid : { - xns : Roo.grid, + xns : Roo.panel, xtype : 'Grid', cm : [ { @@ -174,13 +174,13 @@ var test = { text : 'Add', listeners : { click : function () { - uploadCropbox.show(); + cropboxDialog.show(); document.body.onfocus = function(e) { - if(!uploadCropbox.cropbox.selectorEl.dom.files.length) { - uploadCropbox.dialog.hide(); + if(!cropboxDialog.cropbox.selectorEl.dom.files.length) { + cropboxDialog.dialog.hide(); } } - uploadCropbox.cropbox.selectorEl.dom.click(); + cropboxDialog.cropbox.selectorEl.dom.click(); } } } diff --git a/examples/tabs/tabs-adv.js b/examples/tabs/tabs-adv.js index 17e5da9f53..3f0c7d5f7b 100644 --- a/examples/tabs/tabs-adv.js +++ b/examples/tabs/tabs-adv.js @@ -7,9 +7,9 @@ * * Fork - LGPL *