From 085742dd075ac74574b7a821affcff7d80ae6de3 Mon Sep 17 00:00:00 2001
From: Renaud Le Gac <legac@cppm.in2p3.fr>
Date: Fri, 13 Dec 2013 18:04:45 +0100
Subject: [PATCH] ExtJS 4.2: Use the ExtJS naming scheme for js files.

---
 buildVersion.py                                           | 8 ++++++--
 modules/plugin_dbui/helper.py                             | 8 +++-----
 static/plugin_dbui/src/{base.js => App.js}                | 0
 .../src/{buttondownload.js => button/Download.js}         | 0
 .../src/{directstore.js => data/DirectStore.js}           | 0
 .../src/{directproxy.js => data/proxy/Direct.js}          | 0
 static/plugin_dbui/src/{form.js => form/Panel.js}         | 0
 .../src/{fieldeditor.js => form/field/AceEditor.js}       | 0
 .../src/{combobox.js => form/field/ComboBox.js}           | 0
 .../{comboboxmaster.js => form/field/ComboBoxMaster.js}   | 0
 .../src/{comboboxslave.js => form/field/ComboBoxSlave.js} | 0
 .../plugin_dbui/src/{fielddict.js => form/field/Dict.js}  | 0
 .../plugin_dbui/src/{fieldlist.js => form/field/List.js}  | 0
 .../plugin_dbui/src/{pregexp.js => form/plugin/RegExp.js} | 2 +-
 .../src/{pformtooltip.js => form/plugin/ToolTip.js}       | 0
 static/plugin_dbui/src/{gridfilter.js => grid/Filter.js}  | 0
 static/plugin_dbui/src/{grid.js => grid/Panel.js}         | 0
 .../src/{pgridexpertmenu.js => grid/plugin/ExpertMenu.js} | 0
 .../src/{pgridmathjax.js => grid/plugin/MathJax.js}       | 0
 .../plugin/RowEditorBase.js}                              | 0
 .../plugin/RowEditorConfirmDelete.js}                     | 0
 .../plugin/RowEditorContextMenu.js}                       | 0
 .../plugin/RowEditorDblClick.js}                          | 0
 .../plugin/RowEditorToolbar.js}                           | 0
 .../BaseWithSelector.js}                                  | 0
 .../src/{gridwithfilter.js => panel/GridWithFilter.js}    | 0
 .../{panelwithurlselector.js => panel/WithUrlSelector.js} | 0
 .../plugin/LoaderException.js}                            | 0
 .../src/{ppanelmathjax.js => panel/plugin/MathJax.js}     | 0
 .../plugin_dbui/src/{viewport.js => viewport/Viewport.js} | 0
 .../src/{pviewportlogin.js => viewport/plugin/Login.js}   | 0
 31 files changed, 10 insertions(+), 8 deletions(-)
 rename static/plugin_dbui/src/{base.js => App.js} (100%)
 rename static/plugin_dbui/src/{buttondownload.js => button/Download.js} (100%)
 rename static/plugin_dbui/src/{directstore.js => data/DirectStore.js} (100%)
 rename static/plugin_dbui/src/{directproxy.js => data/proxy/Direct.js} (100%)
 rename static/plugin_dbui/src/{form.js => form/Panel.js} (100%)
 rename static/plugin_dbui/src/{fieldeditor.js => form/field/AceEditor.js} (100%)
 rename static/plugin_dbui/src/{combobox.js => form/field/ComboBox.js} (100%)
 rename static/plugin_dbui/src/{comboboxmaster.js => form/field/ComboBoxMaster.js} (100%)
 rename static/plugin_dbui/src/{comboboxslave.js => form/field/ComboBoxSlave.js} (100%)
 rename static/plugin_dbui/src/{fielddict.js => form/field/Dict.js} (100%)
 rename static/plugin_dbui/src/{fieldlist.js => form/field/List.js} (100%)
 rename static/plugin_dbui/src/{pregexp.js => form/plugin/RegExp.js} (92%)
 rename static/plugin_dbui/src/{pformtooltip.js => form/plugin/ToolTip.js} (100%)
 rename static/plugin_dbui/src/{gridfilter.js => grid/Filter.js} (100%)
 rename static/plugin_dbui/src/{grid.js => grid/Panel.js} (100%)
 rename static/plugin_dbui/src/{pgridexpertmenu.js => grid/plugin/ExpertMenu.js} (100%)
 rename static/plugin_dbui/src/{pgridmathjax.js => grid/plugin/MathJax.js} (100%)
 rename static/plugin_dbui/src/{pgridroweditorbase.js => grid/plugin/RowEditorBase.js} (100%)
 rename static/plugin_dbui/src/{pgridroweditorconfirmdelete.js => grid/plugin/RowEditorConfirmDelete.js} (100%)
 rename static/plugin_dbui/src/{pgridroweditorcontextmenu.js => grid/plugin/RowEditorContextMenu.js} (100%)
 rename static/plugin_dbui/src/{pgridroweditordblclick.js => grid/plugin/RowEditorDblClick.js} (100%)
 rename static/plugin_dbui/src/{pgridroweditortoolbar.js => grid/plugin/RowEditorToolbar.js} (100%)
 rename static/plugin_dbui/src/{basepanelwithselector.js => panel/BaseWithSelector.js} (100%)
 rename static/plugin_dbui/src/{gridwithfilter.js => panel/GridWithFilter.js} (100%)
 rename static/plugin_dbui/src/{panelwithurlselector.js => panel/WithUrlSelector.js} (100%)
 rename static/plugin_dbui/src/{ppanelloaderexception.js => panel/plugin/LoaderException.js} (100%)
 rename static/plugin_dbui/src/{ppanelmathjax.js => panel/plugin/MathJax.js} (100%)
 rename static/plugin_dbui/src/{viewport.js => viewport/Viewport.js} (100%)
 rename static/plugin_dbui/src/{pviewportlogin.js => viewport/plugin/Login.js} (100%)

diff --git a/buildVersion.py b/buildVersion.py
index 41677e00..1a49896a 100755
--- a/buildVersion.py
+++ b/buildVersion.py
@@ -268,10 +268,14 @@ def yuicompressor():
         if os.path.exists(el): 
             os.remove(el)
             print 'Remove javascript library', el
-            
+
     # debug version of the javascript library
     print 'Debug version of the javascript library', JSLIBDEBUG
-    subprocess.call('cat %s/*.js > %s' % (JSLIBSRC, JSLIBDEBUG), shell=True)
+            
+    subprocess.call("find %s -iname '*.js' | sort > JsFiles.txt" % JSLIBSRC, shell=True)
+    jsfiles = ' '.join(open("JsFiles.txt").readlines()).replace('\n', '')
+    subprocess.call("cat %s > %s" % (jsfiles, JSLIBDEBUG), shell=True)
+    os.remove("JsFiles.txt")
 
     # Minified version of the javascript library
     print 'Minified version of the javascript library', JSLIBMIN
diff --git a/modules/plugin_dbui/helper.py b/modules/plugin_dbui/helper.py
index def82abe..17fe2a4c 100644
--- a/modules/plugin_dbui/helper.py
+++ b/modules/plugin_dbui/helper.py
@@ -297,10 +297,8 @@ def get_file_paths(path, ext=None, alpha=True):
             
         elif os.path.isdir(p):
             for file in os.listdir(p):
-                pfile = os.path.join(server_path, el, file)
-                if os.path.isfile(pfile):
-                    if ext and (not pfile.endswith(ext)): continue
-                    li.append(os.path.join(client_path, el, file))
+                pfile = os.path.join(el, file)
+                li.extend(get_file_paths(pfile, ext, alpha))
     
     if alpha:
         li.sort()
@@ -558,7 +556,7 @@ def get_versions():
     server_path, client_path = get_reference_paths()
 
     # plugin dbui
-    fn = os.path.join(server_path, 'static', 'plugin_dbui', 'src', 'base.js')
+    fn = os.path.join(server_path, 'static', 'plugin_dbui', 'src', 'App.js')
     
     fi = open(fn, 'rb')
     s = fi.read()
diff --git a/static/plugin_dbui/src/base.js b/static/plugin_dbui/src/App.js
similarity index 100%
rename from static/plugin_dbui/src/base.js
rename to static/plugin_dbui/src/App.js
diff --git a/static/plugin_dbui/src/buttondownload.js b/static/plugin_dbui/src/button/Download.js
similarity index 100%
rename from static/plugin_dbui/src/buttondownload.js
rename to static/plugin_dbui/src/button/Download.js
diff --git a/static/plugin_dbui/src/directstore.js b/static/plugin_dbui/src/data/DirectStore.js
similarity index 100%
rename from static/plugin_dbui/src/directstore.js
rename to static/plugin_dbui/src/data/DirectStore.js
diff --git a/static/plugin_dbui/src/directproxy.js b/static/plugin_dbui/src/data/proxy/Direct.js
similarity index 100%
rename from static/plugin_dbui/src/directproxy.js
rename to static/plugin_dbui/src/data/proxy/Direct.js
diff --git a/static/plugin_dbui/src/form.js b/static/plugin_dbui/src/form/Panel.js
similarity index 100%
rename from static/plugin_dbui/src/form.js
rename to static/plugin_dbui/src/form/Panel.js
diff --git a/static/plugin_dbui/src/fieldeditor.js b/static/plugin_dbui/src/form/field/AceEditor.js
similarity index 100%
rename from static/plugin_dbui/src/fieldeditor.js
rename to static/plugin_dbui/src/form/field/AceEditor.js
diff --git a/static/plugin_dbui/src/combobox.js b/static/plugin_dbui/src/form/field/ComboBox.js
similarity index 100%
rename from static/plugin_dbui/src/combobox.js
rename to static/plugin_dbui/src/form/field/ComboBox.js
diff --git a/static/plugin_dbui/src/comboboxmaster.js b/static/plugin_dbui/src/form/field/ComboBoxMaster.js
similarity index 100%
rename from static/plugin_dbui/src/comboboxmaster.js
rename to static/plugin_dbui/src/form/field/ComboBoxMaster.js
diff --git a/static/plugin_dbui/src/comboboxslave.js b/static/plugin_dbui/src/form/field/ComboBoxSlave.js
similarity index 100%
rename from static/plugin_dbui/src/comboboxslave.js
rename to static/plugin_dbui/src/form/field/ComboBoxSlave.js
diff --git a/static/plugin_dbui/src/fielddict.js b/static/plugin_dbui/src/form/field/Dict.js
similarity index 100%
rename from static/plugin_dbui/src/fielddict.js
rename to static/plugin_dbui/src/form/field/Dict.js
diff --git a/static/plugin_dbui/src/fieldlist.js b/static/plugin_dbui/src/form/field/List.js
similarity index 100%
rename from static/plugin_dbui/src/fieldlist.js
rename to static/plugin_dbui/src/form/field/List.js
diff --git a/static/plugin_dbui/src/pregexp.js b/static/plugin_dbui/src/form/plugin/RegExp.js
similarity index 92%
rename from static/plugin_dbui/src/pregexp.js
rename to static/plugin_dbui/src/form/plugin/RegExp.js
index f1c9dfe0..cf6b02f5 100644
--- a/static/plugin_dbui/src/pregexp.js
+++ b/static/plugin_dbui/src/form/plugin/RegExp.js
@@ -3,7 +3,7 @@
  * by a regular expression object.
  *
  */
-Ext.define('App.form.plugin.PRegExp',  {
+Ext.define('App.form.plugin.RegExp',  {
 
     extend: 'Ext.AbstractPlugin',
     alias: 'plugin.pRegExp',
diff --git a/static/plugin_dbui/src/pformtooltip.js b/static/plugin_dbui/src/form/plugin/ToolTip.js
similarity index 100%
rename from static/plugin_dbui/src/pformtooltip.js
rename to static/plugin_dbui/src/form/plugin/ToolTip.js
diff --git a/static/plugin_dbui/src/gridfilter.js b/static/plugin_dbui/src/grid/Filter.js
similarity index 100%
rename from static/plugin_dbui/src/gridfilter.js
rename to static/plugin_dbui/src/grid/Filter.js
diff --git a/static/plugin_dbui/src/grid.js b/static/plugin_dbui/src/grid/Panel.js
similarity index 100%
rename from static/plugin_dbui/src/grid.js
rename to static/plugin_dbui/src/grid/Panel.js
diff --git a/static/plugin_dbui/src/pgridexpertmenu.js b/static/plugin_dbui/src/grid/plugin/ExpertMenu.js
similarity index 100%
rename from static/plugin_dbui/src/pgridexpertmenu.js
rename to static/plugin_dbui/src/grid/plugin/ExpertMenu.js
diff --git a/static/plugin_dbui/src/pgridmathjax.js b/static/plugin_dbui/src/grid/plugin/MathJax.js
similarity index 100%
rename from static/plugin_dbui/src/pgridmathjax.js
rename to static/plugin_dbui/src/grid/plugin/MathJax.js
diff --git a/static/plugin_dbui/src/pgridroweditorbase.js b/static/plugin_dbui/src/grid/plugin/RowEditorBase.js
similarity index 100%
rename from static/plugin_dbui/src/pgridroweditorbase.js
rename to static/plugin_dbui/src/grid/plugin/RowEditorBase.js
diff --git a/static/plugin_dbui/src/pgridroweditorconfirmdelete.js b/static/plugin_dbui/src/grid/plugin/RowEditorConfirmDelete.js
similarity index 100%
rename from static/plugin_dbui/src/pgridroweditorconfirmdelete.js
rename to static/plugin_dbui/src/grid/plugin/RowEditorConfirmDelete.js
diff --git a/static/plugin_dbui/src/pgridroweditorcontextmenu.js b/static/plugin_dbui/src/grid/plugin/RowEditorContextMenu.js
similarity index 100%
rename from static/plugin_dbui/src/pgridroweditorcontextmenu.js
rename to static/plugin_dbui/src/grid/plugin/RowEditorContextMenu.js
diff --git a/static/plugin_dbui/src/pgridroweditordblclick.js b/static/plugin_dbui/src/grid/plugin/RowEditorDblClick.js
similarity index 100%
rename from static/plugin_dbui/src/pgridroweditordblclick.js
rename to static/plugin_dbui/src/grid/plugin/RowEditorDblClick.js
diff --git a/static/plugin_dbui/src/pgridroweditortoolbar.js b/static/plugin_dbui/src/grid/plugin/RowEditorToolbar.js
similarity index 100%
rename from static/plugin_dbui/src/pgridroweditortoolbar.js
rename to static/plugin_dbui/src/grid/plugin/RowEditorToolbar.js
diff --git a/static/plugin_dbui/src/basepanelwithselector.js b/static/plugin_dbui/src/panel/BaseWithSelector.js
similarity index 100%
rename from static/plugin_dbui/src/basepanelwithselector.js
rename to static/plugin_dbui/src/panel/BaseWithSelector.js
diff --git a/static/plugin_dbui/src/gridwithfilter.js b/static/plugin_dbui/src/panel/GridWithFilter.js
similarity index 100%
rename from static/plugin_dbui/src/gridwithfilter.js
rename to static/plugin_dbui/src/panel/GridWithFilter.js
diff --git a/static/plugin_dbui/src/panelwithurlselector.js b/static/plugin_dbui/src/panel/WithUrlSelector.js
similarity index 100%
rename from static/plugin_dbui/src/panelwithurlselector.js
rename to static/plugin_dbui/src/panel/WithUrlSelector.js
diff --git a/static/plugin_dbui/src/ppanelloaderexception.js b/static/plugin_dbui/src/panel/plugin/LoaderException.js
similarity index 100%
rename from static/plugin_dbui/src/ppanelloaderexception.js
rename to static/plugin_dbui/src/panel/plugin/LoaderException.js
diff --git a/static/plugin_dbui/src/ppanelmathjax.js b/static/plugin_dbui/src/panel/plugin/MathJax.js
similarity index 100%
rename from static/plugin_dbui/src/ppanelmathjax.js
rename to static/plugin_dbui/src/panel/plugin/MathJax.js
diff --git a/static/plugin_dbui/src/viewport.js b/static/plugin_dbui/src/viewport/Viewport.js
similarity index 100%
rename from static/plugin_dbui/src/viewport.js
rename to static/plugin_dbui/src/viewport/Viewport.js
diff --git a/static/plugin_dbui/src/pviewportlogin.js b/static/plugin_dbui/src/viewport/plugin/Login.js
similarity index 100%
rename from static/plugin_dbui/src/pviewportlogin.js
rename to static/plugin_dbui/src/viewport/plugin/Login.js
-- 
GitLab