diff --git a/controllers/plugin_dbui.py b/controllers/plugin_dbui.py index 905da12a74244129d65c8b98c5a0952db01c1aa4..e05c35eefd484cadad7da33d4f2ce6442399068f 100644 --- a/controllers/plugin_dbui.py +++ b/controllers/plugin_dbui.py @@ -115,15 +115,21 @@ def index(): if len(lg) == 5 and lg[0:2] == lg[3:5]: lg = lg[0:2] response.files.append(os.path.join(extjs, 'src', 'locale', 'ext-lang-%s.js' % lg)) - # plugin libraries -- respect the alphabetic order - li = [] - appjs = os.path.join(base, 'static', 'plugin_dbui', 'lib') - for file in os.listdir(os.path.join(server_path, 'static', 'plugin_dbui', 'lib')): - if file.endswith(".js"): - li.append(os.path.join(appjs, file)) - - li.sort() - response.files.extend(li) + # plugin library -- the minified version + path = os.path.join(server_path, 'static', 'plugin_dbui', 'dbui-all.js') + if not debug and os.path.exists(path): + response.files.append(os.path.join(base, 'static', 'plugin_dbui', 'dbui-all.js')) + + # plugin libraries -- full version -- respect the alphabetic order + else: + li = [] + appjs = os.path.join(base, 'static', 'plugin_dbui', 'lib') + for file in os.listdir(os.path.join(server_path, 'static', 'plugin_dbui', 'lib')): + if file.endswith(".js"): + li.append(os.path.join(appjs, file)) + + li.sort() + response.files.extend(li) # main application script response.files.append(os.path.join(base, plugins.dbui.script_path, script)) diff --git a/views/plugin_dbui.html b/views/plugin_dbui.html index e053900c2da0db4b30b55d6e9b30661cd33864b4..5976d9247697518f2dd73757c9d9fac9131d4fbe 100644 --- a/views/plugin_dbui.html +++ b/views/plugin_dbui.html @@ -14,11 +14,12 @@ if el.endswith('css'):}}<link rel="stylesheet" type="text/css" href="{{=el}}"/> - {{elif el.endswith('appbase.js'):}} + {{elif el.endswith('appbase.js') or el.endswith('dbui-all.js'):}} <script type="text/javascript"> Ext.namespace('App'); App.name = '{{=request.application}}'; App.debug = {{=str(debug).lower()}}; + App.withMathJax = {{=str(withMathJax).lower()}}; </script> <script type="text/javascript" src="{{=el}}"></script>