From 2893f895331143ed54b2e7719f7f9cb2eecc6b32 Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <legac@cppm.in2p3.fr> Date: Thu, 21 Mar 2013 14:58:24 +0100 Subject: [PATCH] Deploy the javascript statement "use strict";. --- static/plugin_dbui/CHANGELOG | 2 ++ static/plugin_dbui/src/base.js | 7 +++++- .../plugin_dbui/src/basepanelwithselector.js | 4 +++- static/plugin_dbui/src/buttondownload.js | 6 ++++- static/plugin_dbui/src/combobox.js | 2 ++ static/plugin_dbui/src/form.js | 23 ++++++++++++++++--- static/plugin_dbui/src/grid.js | 6 +++++ static/plugin_dbui/src/gridfilter.js | 14 +++++++++++ static/plugin_dbui/src/gridwithfilter.js | 2 ++ static/plugin_dbui/src/jsonstore.js | 6 +++++ static/plugin_dbui/src/linkedcombobox.js | 10 ++++++++ .../plugin_dbui/src/panelwithurlselector.js | 16 ++++++++++--- static/plugin_dbui/src/pformtooltip.js | 2 ++ static/plugin_dbui/src/pgridexpertmenu.js | 3 +++ static/plugin_dbui/src/pgridmathjax.js | 2 ++ static/plugin_dbui/src/pgridpaging.js | 10 ++++++++ static/plugin_dbui/src/pgridroweditorbase.js | 19 +++++++++++++++ .../src/pgridroweditorconfirmdelete.js | 2 ++ .../src/pgridroweditorcontextmenu.js | 8 +++++++ .../plugin_dbui/src/pgridroweditordblclick.js | 2 ++ .../plugin_dbui/src/pgridroweditortoolbar.js | 2 ++ static/plugin_dbui/src/ppanelmathjax.js | 4 ++++ static/plugin_dbui/src/pregexp.js | 2 ++ static/plugin_dbui/src/pviewportlogin.js | 2 ++ static/plugin_dbui/src/viewport.js | 9 ++++---- 25 files changed, 152 insertions(+), 13 deletions(-) diff --git a/static/plugin_dbui/CHANGELOG b/static/plugin_dbui/CHANGELOG index 47ef5563..f0020157 100644 --- a/static/plugin_dbui/CHANGELOG +++ b/static/plugin_dbui/CHANGELOG @@ -1,6 +1,8 @@ --------------------------------- CHANGE LOG ---------------------------------- HEAD + - Deploy the javascript statement "use strict" in order + to comply with JSLINT. 0.4.11.0 (Mar 2013) - Upgrade to run with alias table. diff --git a/static/plugin_dbui/src/base.js b/static/plugin_dbui/src/base.js index 89f0721d..9ffaeb82 100644 --- a/static/plugin_dbui/src/base.js +++ b/static/plugin_dbui/src/base.js @@ -29,6 +29,7 @@ App.version = '0.4.11.0'; * @param {String} field */ App.encodeField = function (table, field) { + "use strict"; var t, f; t = table[0].toUpperCase() + table.slice(1, table.length); f = field[0].toUpperCase() + field.slice(1, field.length); @@ -51,6 +52,8 @@ App.encodeField = function (table, field) { */ App.getStore = function (storeId) { + "use strict"; + var cfg, store, table; @@ -92,7 +95,6 @@ App.getStore = function (storeId) { default: throw new Error('Fail to instanciate the object: "' + cfg.xtype + '"'); - break; } } return store; @@ -105,6 +107,7 @@ App.getStore = function (storeId) { * @param {App.data.DirectStore} store */ App.getTableName = function (store) { + "use strict"; return store.baseParams.tableName; }; @@ -116,6 +119,8 @@ App.getTableName = function (store) { */ App.isPlugin = function (component, ptype) { + "use strict"; + var i, plugin; diff --git a/static/plugin_dbui/src/basepanelwithselector.js b/static/plugin_dbui/src/basepanelwithselector.js index a6f66432..a5db6db4 100644 --- a/static/plugin_dbui/src/basepanelwithselector.js +++ b/static/plugin_dbui/src/basepanelwithselector.js @@ -56,6 +56,8 @@ App.BasePanelWithSelector = Ext.extend(Ext.Panel, { */ constructor: function(config) { + "use strict"; + var cfg, itemPanel, itemSelector, @@ -104,7 +106,7 @@ App.BasePanelWithSelector = Ext.extend(Ext.Panel, { Ext.apply(this, cfg); - // instanciate the panel + // instantiate the panel App.BasePanelWithSelector.superclass.constructor.call(this); } }); diff --git a/static/plugin_dbui/src/buttondownload.js b/static/plugin_dbui/src/buttondownload.js index 628a285f..6550dce1 100644 --- a/static/plugin_dbui/src/buttondownload.js +++ b/static/plugin_dbui/src/buttondownload.js @@ -21,6 +21,8 @@ App.ButtonDownload = Ext.extend(Ext.Button, { */ initComponent: function () { + "use strict"; + // initialize the underlying class App.ButtonDownload.superclass.initComponent.call(this); @@ -34,13 +36,15 @@ App.ButtonDownload = Ext.extend(Ext.Button, { * * NOTE: this method add and iframe at the end of the DOM document * the source of the iframe is the url pointing on the server conroller. - * The latter returun a document which is automatically loaded. + * The latter return a document which is automatically loaded. * * Method suggested on the sencha forum: * www.sencha.com/forum/showthread.php?26471-Download-File-on%28-click-%29 */ onDownload: function (button, event) { + "use strict"; + // remove existing iframe try { Ext.destroy(Ext.get('downloadIframe')); diff --git a/static/plugin_dbui/src/combobox.js b/static/plugin_dbui/src/combobox.js index 6ca93a8a..ae36adc8 100644 --- a/static/plugin_dbui/src/combobox.js +++ b/static/plugin_dbui/src/combobox.js @@ -26,6 +26,8 @@ App.form.ComboBox = Ext.extend(Ext.form.ComboBox, { */ initComponent: function () { + "use strict"; + // defined the empty text from the field label if (this.fieldLabel && !this.emptyText) { this.emptyText = "Select a " + this.fieldLabel + " ..."; diff --git a/static/plugin_dbui/src/form.js b/static/plugin_dbui/src/form.js index e1009862..a1ddaa92 100644 --- a/static/plugin_dbui/src/form.js +++ b/static/plugin_dbui/src/form.js @@ -63,6 +63,8 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { */ initComponent: function () { + "use strict"; + // helper function to reset the form // the scope is Ext.data.BasicStore function resetForm() { @@ -92,6 +94,8 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { */ disableFields: function (bool) { + "use strict"; + var form = this.getForm(); form.items.each(function (field) { @@ -108,6 +112,8 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { */ doAction: function () { + "use strict"; + var form = this.getForm(), newRecord; @@ -159,6 +165,9 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { * */ hardReset: function () { + + "use strict"; + var form = this.getForm(); form.items.each(function (field) { @@ -180,6 +189,8 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { */ onStoreException: function (proxy, type, action, options, response, arg) { + "use strict"; + var i, field, fieldName, @@ -251,6 +262,8 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { */ setAction: function (action, record) { + "use strict"; + var form = this.getForm(), table, tableId; @@ -305,6 +318,8 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { */ updateRecord: function (record) { + "use strict"; + var combo, field, fields = [], @@ -313,6 +328,10 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { rec, value; + function pushToFields(key, value) { + fields.push(value); + } + // get the list of dirty fields items = this.findByType('field'); for (i = 0; i < items.length; i += 1) { @@ -325,9 +344,7 @@ App.form.FormPanel = Ext.extend(Ext.form.FormPanel, { // include dirty fields embedded in composite fields items = this.findByType('compositefield'); for (i = 0; i < items.length; i += 1) { - items[i].items.eachKey(function(key, subfield) { - fields.push(subfield); - }); + items[i].items.eachKey(pushToFields); } // update the record diff --git a/static/plugin_dbui/src/grid.js b/static/plugin_dbui/src/grid.js index c74cc41b..2eb62a56 100644 --- a/static/plugin_dbui/src/grid.js +++ b/static/plugin_dbui/src/grid.js @@ -41,6 +41,8 @@ App.grid.Grid = Ext.extend(Ext.grid.GridPanel, { */ constructor: function (config) { + "use strict"; + var first_column = config.columns[0]; if ('xtype' in first_column && first_column.xtype === 'rownumberer') { @@ -55,6 +57,8 @@ App.grid.Grid = Ext.extend(Ext.grid.GridPanel, { */ initComponent: function () { + "use strict"; + // link the grid to the data store this.store = App.getStore(this.store); @@ -85,6 +89,8 @@ App.grid.Grid = Ext.extend(Ext.grid.GridPanel, { */ reset: function () { + "use strict"; + var action; // private function to emit the resetgrid event diff --git a/static/plugin_dbui/src/gridfilter.js b/static/plugin_dbui/src/gridfilter.js index 00fb8cb0..1f423d8f 100644 --- a/static/plugin_dbui/src/gridfilter.js +++ b/static/plugin_dbui/src/gridfilter.js @@ -46,6 +46,8 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { */ initComponent: function () { + "use strict"; + var field, fields, i; @@ -80,6 +82,8 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { */ bind: function (grid) { + "use strict"; + this.store = grid.getStore(); // paging toolbar ? @@ -98,6 +102,8 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { */ onChange: function (field) { + "use strict"; + // setup the filter conditions this.setupCondition(field); @@ -110,6 +116,8 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { */ onReset: function () { + "use strict"; + // reset field values and filter conditions this.reset(); @@ -125,6 +133,8 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { */ reset: function () { + "use strict"; + var fields = this.findByType('field'), i; @@ -143,6 +153,8 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { */ setupCondition: function (field) { + "use strict"; + var conditions = [], i, k, @@ -193,6 +205,8 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { */ updateStore: function () { + "use strict"; + var bbar = this.pagingToolbar, nRows, slider; diff --git a/static/plugin_dbui/src/gridwithfilter.js b/static/plugin_dbui/src/gridwithfilter.js index 4a42cdfa..fffee4db 100644 --- a/static/plugin_dbui/src/gridwithfilter.js +++ b/static/plugin_dbui/src/gridwithfilter.js @@ -12,6 +12,8 @@ App.grid.GridWithFilter = Ext.extend(App.BasePanelWithSelector, { initComponent: function() { + "use strict"; + var filter, grid; diff --git a/static/plugin_dbui/src/jsonstore.js b/static/plugin_dbui/src/jsonstore.js index 17243dfe..b7ecce54 100644 --- a/static/plugin_dbui/src/jsonstore.js +++ b/static/plugin_dbui/src/jsonstore.js @@ -55,6 +55,8 @@ App.data.DirectStore = Ext.extend(Ext.data.DirectStore, { */ constructor: function (config) { + "use strict"; + var cfg, cfgWrt, i; @@ -106,6 +108,8 @@ App.data.DirectStore = Ext.extend(Ext.data.DirectStore, { */ onWrite: function (store, action) { + "use strict"; + switch (action) { case 'create': store.totalLength += 1; @@ -123,6 +127,8 @@ App.data.DirectStore = Ext.extend(Ext.data.DirectStore, { */ restoreWhere: function () { + "use strict"; + var i; if ('where' in this.baseParams) { diff --git a/static/plugin_dbui/src/linkedcombobox.js b/static/plugin_dbui/src/linkedcombobox.js index d3fc68be..dc280a52 100644 --- a/static/plugin_dbui/src/linkedcombobox.js +++ b/static/plugin_dbui/src/linkedcombobox.js @@ -39,6 +39,8 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { */ initComponent: function () { + "use strict"; + // common configuration this.triggerAction = 'all'; @@ -95,6 +97,7 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { * @param {Integer} index */ filterMasterStore: function (combo, record, index) { + "use strict"; this.masterStore.filter(this.valueField, combo.getValue()); }, @@ -105,6 +108,8 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { */ initSlave: function () { + "use strict"; + // Reset and disable the combobox. // // NOTE @@ -146,6 +151,8 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { */ loadMasterData: function () { + "use strict"; + var data = [], key, keys = [], @@ -171,7 +178,10 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { */ onDataChanged: function () { + "use strict"; + var value = this.store.getAt(0).get(this.valueField); + this.setValue(value); this.enable(); } diff --git a/static/plugin_dbui/src/panelwithurlselector.js b/static/plugin_dbui/src/panelwithurlselector.js index d93ded3b..5923b888 100644 --- a/static/plugin_dbui/src/panelwithurlselector.js +++ b/static/plugin_dbui/src/panelwithurlselector.js @@ -69,6 +69,8 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, { */ initComponent: function () { + "use strict"; + App.PanelWithUrlSelector.superclass.initComponent.call(this); // connect the buttons @@ -81,6 +83,8 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, { */ onGo: function() { + "use strict"; + var fields, i, mainPanel = this.getComponent('mainPanel'), @@ -91,6 +95,10 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, { urlFunc = null, urlExt = null; + function extract(key, subfield) { + params[subfield.getName()] = subfield.getValue(); + } + // activate the auto scrolling mainPanel.setAutoScroll(true); @@ -114,9 +122,7 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, { // extract parameters embedded in composite fields fields = this.findByType('compositefield'); for (i = 0; i < fields.length; i += 1) { - fields[i].items.eachKey(function(key, subfield) { - params[subfield.getName()] = subfield.getValue(); - }); + fields[i].items.eachKey(extract); } // build the URL @@ -156,6 +162,8 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, { */ onLoad: function(el, success, response, options) { + "use strict"; + var panelWithSelector = this; // errors detection @@ -176,6 +184,8 @@ App.PanelWithUrlSelector = Ext.extend(App.BasePanelWithSelector, { */ onReset: function () { + "use strict"; + var fields, i, selector = this.getComponent('selectorPanel'); diff --git a/static/plugin_dbui/src/pformtooltip.js b/static/plugin_dbui/src/pformtooltip.js index 962a2ac8..55d194bd 100644 --- a/static/plugin_dbui/src/pformtooltip.js +++ b/static/plugin_dbui/src/pformtooltip.js @@ -25,6 +25,8 @@ App.form.ToolTip = Ext.extend(Object, { */ init: function (basicform) { + "use strict"; + var form = basicform; function createToolTip(c) { diff --git a/static/plugin_dbui/src/pgridexpertmenu.js b/static/plugin_dbui/src/pgridexpertmenu.js index 2ea70f29..48a7eee1 100644 --- a/static/plugin_dbui/src/pgridexpertmenu.js +++ b/static/plugin_dbui/src/pgridexpertmenu.js @@ -23,6 +23,8 @@ App.grid.ExpertMenu = Ext.extend(Object, { */ init: function(grid) { + "use strict"; + var bbar = grid.getBottomToolbar(), menu; @@ -46,6 +48,7 @@ App.grid.ExpertMenu = Ext.extend(Object, { * Handler to reset grid, its filters and its paging options */ onReset: function () { + "use strict"; var grid = this; grid.reset(); } diff --git a/static/plugin_dbui/src/pgridmathjax.js b/static/plugin_dbui/src/pgridmathjax.js index cf816312..a689de5a 100644 --- a/static/plugin_dbui/src/pgridmathjax.js +++ b/static/plugin_dbui/src/pgridmathjax.js @@ -13,6 +13,8 @@ App.grid.MathJax = Ext.extend(Object, { init: function (grid) { + "use strict"; + function processMath(gridView) { var domEl = Ext.getDom(gridView.el); MathJax.Hub.Queue(["Typeset", MathJax.Hub, domEl]); diff --git a/static/plugin_dbui/src/pgridpaging.js b/static/plugin_dbui/src/pgridpaging.js index f77a6210..61c42d56 100644 --- a/static/plugin_dbui/src/pgridpaging.js +++ b/static/plugin_dbui/src/pgridpaging.js @@ -28,6 +28,8 @@ App.grid.Paging = Ext.extend(Object, { */ init: function (grid) { + "use strict"; + var bbar; // create the paging bar @@ -80,6 +82,7 @@ App.grid.Paging = Ext.extend(Object, { * the scope is the bottom tool bar */ onChangePageSize: function (slider, newValue, thumb) { + "use strict"; var bbar = this; bbar.pageSize = newValue; bbar.moveFirst(); @@ -91,6 +94,8 @@ App.grid.Paging = Ext.extend(Object, { */ onInit: function (store, records, options) { + "use strict"; + var bbar, grid = this, nRecords = store.getTotalCount(), @@ -111,6 +116,9 @@ App.grid.Paging = Ext.extend(Object, { * The scope is the grid */ onReset: function() { + + "use strict"; + var bbar, grid = this, slider; @@ -131,6 +139,8 @@ App.grid.Paging = Ext.extend(Object, { */ onWrite: function () { + "use strict"; + var bbar, grid = this, slider; diff --git a/static/plugin_dbui/src/pgridroweditorbase.js b/static/plugin_dbui/src/pgridroweditorbase.js index c3985316..f4bce0f2 100644 --- a/static/plugin_dbui/src/pgridroweditorbase.js +++ b/static/plugin_dbui/src/pgridroweditorbase.js @@ -51,6 +51,8 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { */ init: function (grid) { + "use strict"; + var table; this.grid = grid; @@ -81,6 +83,9 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { * @param {Object} response */ addFormPanel: function (provider, response) { + + "use strict"; + var formCfg = response.result; // instantiate the form @@ -101,6 +106,8 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { */ getSelected: function () { + "use strict"; + var record = this.grid.getSelectionModel().getSelected(); if (!record) { @@ -118,6 +125,8 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { */ onAddRow: function () { + "use strict"; + this.formPanel.setAction('create'); this.setTitle(this.addTitle); this.show(); @@ -130,6 +139,8 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { */ onDeleteRow: function () { + "use strict"; + var record = this.getSelected(); if (!record) {return; } @@ -145,6 +156,8 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { */ onDuplicateRow: function () { + "use strict"; + var record = this.getSelected(); if (!record) {return; } @@ -160,6 +173,8 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { */ onEditRow: function () { + "use strict"; + var record = this.getSelected(); if (!record) {return; } @@ -174,6 +189,7 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { * The form handle the exception and take action. */ onException: function () { + "use strict"; this.hide(); }, @@ -184,6 +200,8 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { */ onViewRow: function () { + "use strict"; + var record = this.getSelected(); if (!record) {return; } @@ -202,6 +220,7 @@ App.grid.RowEditor = Ext.extend(Ext.Window, { * @param {Object} record */ onWrite: function (store, action, result, transaction, record) { + "use strict"; this.hide(); } }); diff --git a/static/plugin_dbui/src/pgridroweditorconfirmdelete.js b/static/plugin_dbui/src/pgridroweditorconfirmdelete.js index b9690845..c8eb6ec0 100644 --- a/static/plugin_dbui/src/pgridroweditorconfirmdelete.js +++ b/static/plugin_dbui/src/pgridroweditorconfirmdelete.js @@ -31,6 +31,8 @@ App.grid.RowEditorConfirmDelete = Ext.extend(App.grid.RowEditor, { */ onDeleteRow: function () { + "use strict"; + var record = this.getSelected(); if (!record) {return; } diff --git a/static/plugin_dbui/src/pgridroweditorcontextmenu.js b/static/plugin_dbui/src/pgridroweditorcontextmenu.js index 899a673e..f29b7012 100644 --- a/static/plugin_dbui/src/pgridroweditorcontextmenu.js +++ b/static/plugin_dbui/src/pgridroweditorcontextmenu.js @@ -38,6 +38,8 @@ App.grid.RowEditorContextMenu = Ext.extend(Object, { */ init: function (grid) { + "use strict"; + var menu = new Ext.menu.Menu(); // protection @@ -81,6 +83,9 @@ App.grid.RowEditorContextMenu = Ext.extend(Object, { * Prvate handler displaying the row context menu in an empty grid */ onContainerContextMenu: function (grid, event) { + + "use strict"; + var menu = this; event.stopEvent(); @@ -92,6 +97,7 @@ App.grid.RowEditorContextMenu = Ext.extend(Object, { * Nothing is display in that case. */ onHeaderContextMenu: function (grid, columIndex, event) { + "use strict"; event.stopEvent(); }, /** @@ -100,6 +106,8 @@ App.grid.RowEditorContextMenu = Ext.extend(Object, { */ onRowContextMenu: function (grid, rowIndex, event) { + "use strict"; + var menu = this; event.stopEvent(); diff --git a/static/plugin_dbui/src/pgridroweditordblclick.js b/static/plugin_dbui/src/pgridroweditordblclick.js index ac28e4e5..87310238 100644 --- a/static/plugin_dbui/src/pgridroweditordblclick.js +++ b/static/plugin_dbui/src/pgridroweditordblclick.js @@ -27,6 +27,8 @@ App.grid.RowEditorDblClick = Ext.extend(Object, { */ init: function(grid) { + "use strict"; + // protection if (!grid.rowEditor) { throw new Error('no grid row editor !!!'); diff --git a/static/plugin_dbui/src/pgridroweditortoolbar.js b/static/plugin_dbui/src/pgridroweditortoolbar.js index 581b6c91..28c1f982 100644 --- a/static/plugin_dbui/src/pgridroweditortoolbar.js +++ b/static/plugin_dbui/src/pgridroweditortoolbar.js @@ -22,6 +22,8 @@ App.grid.RowEditorToolbar = Ext.extend(Object, { */ init: function (grid) { + "use strict"; + var toolbar; // protection diff --git a/static/plugin_dbui/src/ppanelmathjax.js b/static/plugin_dbui/src/ppanelmathjax.js index 9af99215..ea102f48 100644 --- a/static/plugin_dbui/src/ppanelmathjax.js +++ b/static/plugin_dbui/src/ppanelmathjax.js @@ -13,6 +13,8 @@ App.panel.MathJax = Ext.extend(Object, { init: function (panel) { + "use strict"; + // register an handler which is activated only once // when the panel is rendered for the first time panel.on('render', this.onPanelRender, this, {single: true}); @@ -25,6 +27,7 @@ App.panel.MathJax = Ext.extend(Object, { * @param {Ext.Panel} panel */ onPanelRender: function (panel) { + "use strict"; var updater = panel.body.getUpdater(); updater.on('update', this.onProcess); }, @@ -35,6 +38,7 @@ App.panel.MathJax = Ext.extend(Object, { * @param {Object} o the response object */ onProcess: function (e, o) { + "use strict"; MathJax.Hub.PreProcess(); MathJax.Hub.Process(); } diff --git a/static/plugin_dbui/src/pregexp.js b/static/plugin_dbui/src/pregexp.js index a65767db..9a57f949 100644 --- a/static/plugin_dbui/src/pregexp.js +++ b/static/plugin_dbui/src/pregexp.js @@ -16,6 +16,8 @@ App.PRegExp = Ext.extend(Object, { init: function (component) { + "use strict"; + if (component.regex && typeof (component.regex) === "string") { component.regex = new RegExp(component.regex); } diff --git a/static/plugin_dbui/src/pviewportlogin.js b/static/plugin_dbui/src/pviewportlogin.js index 9b33944b..12c2aeb5 100644 --- a/static/plugin_dbui/src/pviewportlogin.js +++ b/static/plugin_dbui/src/pviewportlogin.js @@ -35,6 +35,8 @@ App.ViewportLogin = Ext.extend(Object, { */ init: function(viewport) { + "use strict"; + var inhibit_login = false, inhibit_logout = true, menu, diff --git a/static/plugin_dbui/src/viewport.js b/static/plugin_dbui/src/viewport.js index 50873faf..0338e227 100644 --- a/static/plugin_dbui/src/viewport.js +++ b/static/plugin_dbui/src/viewport.js @@ -28,11 +28,11 @@ App.Viewport = Ext.extend(Ext.Viewport, { */ constructor: function (config) { + "use strict"; + var cfg, loader, - root, - treePanel, - viewport; + root; Ext.apply(this, config); @@ -116,11 +116,12 @@ App.Viewport = Ext.extend(Ext.Viewport, { */ onCreateTab: function(node, event) { + "use strict"; + var cfg, parent = node.parentNode, panel, tabId, - viewport = this, wdgcfg = node.attributes.cfg, wdgtype = node.attributes.cfg.xtype; -- GitLab