From 404f1cc8efa038579b1dab4c8f25b16e86cca541 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Wed, 17 Jan 2018 13:24:25 +0530 Subject: [PATCH] Fixing the javascript file after running pga_eslint.js script --- web/pgadmin/static/bundle/app.js | 30 ++++---- web/pgadmin/static/bundle/browser.js | 2 +- web/pgadmin/static/bundle/codemirror.js | 2 +- web/pgadmin/static/js/sqleditor_utils.js | 76 +++++++++---------- .../tools/sqleditor/static/js/sqleditor.js | 18 ++--- 5 files changed, 64 insertions(+), 64 deletions(-) diff --git a/web/pgadmin/static/bundle/app.js b/web/pgadmin/static/bundle/app.js index 9df103bee..a2b86f875 100644 --- a/web/pgadmin/static/bundle/app.js +++ b/web/pgadmin/static/bundle/app.js @@ -1,23 +1,23 @@ define('app', [ - 'babel-polyfill', 'sources/pgadmin', 'bundled_browser', 'pgadmin.datagrid' - ], function() { - var initializeModules = function(Object) { - for (var key in Object) { - var module = Object[key]; - if (module.init && typeof module.init == 'function') { - module.init(); - } - else if (module.Init && typeof module.Init == 'function') { - module.Init(); - } + 'babel-polyfill', 'sources/pgadmin', 'bundled_browser', 'pgadmin.datagrid', +], function(babelPolyFill, pgAdmin) { + var initializeModules = function(Object) { + for (var key in Object) { + var module = Object[key]; + if (module.init && typeof module.init == 'function') { + module.init(); + } + else if (module.Init && typeof module.Init == 'function') { + module.Init(); } } + }; // Initialize modules registered to pgAdmin, pgAdmin.Browser and Tools object. - initializeModules(pgAdmin); - initializeModules(pgAdmin.Browser); - initializeModules(pgAdmin.Tools); + initializeModules(pgAdmin); + initializeModules(pgAdmin.Browser); + initializeModules(pgAdmin.Tools); // create menus after all modules are initialized. - pgAdmin.Browser.create_menus(); + pgAdmin.Browser.create_menus(); }); diff --git a/web/pgadmin/static/bundle/browser.js b/web/pgadmin/static/bundle/browser.js index c415d2e9a..d39ce22b2 100644 --- a/web/pgadmin/static/bundle/browser.js +++ b/web/pgadmin/static/bundle/browser.js @@ -1,5 +1,5 @@ define('bundled_browser',[ - 'pgadmin.browser' + 'pgadmin.browser', ], function(pgBrowser) { pgBrowser.init(); }); diff --git a/web/pgadmin/static/bundle/codemirror.js b/web/pgadmin/static/bundle/codemirror.js index 4c79d1de0..10b3e3b7d 100644 --- a/web/pgadmin/static/bundle/codemirror.js +++ b/web/pgadmin/static/bundle/codemirror.js @@ -13,7 +13,7 @@ import 'codemirror/addon/search/searchcursor'; import 'codemirror/addon/search/jump-to-line'; import 'codemirror/addon/edit/matchbrackets'; import 'codemirror/addon/edit/closebrackets'; -import 'codemirror/addon/comment/comment' +import 'codemirror/addon/comment/comment'; import '../js/codemirror/addon/fold/pgadmin-sqlfoldcode'; export default CodeMirror; \ No newline at end of file diff --git a/web/pgadmin/static/js/sqleditor_utils.js b/web/pgadmin/static/js/sqleditor_utils.js index 11b609e12..6e2ae4e86 100644 --- a/web/pgadmin/static/js/sqleditor_utils.js +++ b/web/pgadmin/static/js/sqleditor_utils.js @@ -81,49 +81,49 @@ define(['jquery', 'sources/gettext'], // Inject CSS as required switch(status) { // Busy - case 1: + case 1: // if received busy status more than once then only - if(status == sqlEditorUtils.previousStatus && + if(status == sqlEditorUtils.previousStatus && !$status_el.hasClass('fa-hourglass-half')) { - $status_el.removeClass() + $status_el.removeClass() .addClass('fa fa-hourglass-half'); - is_status_changed = true; - } - break; + is_status_changed = true; + } + break; // Idle in transaction - case 2: - if(sqlEditorUtils.previousStatus != status && + case 2: + if(sqlEditorUtils.previousStatus != status && !$status_el.hasClass('fa-clock-o')) { - $status_el.removeClass() + $status_el.removeClass() .addClass('fa fa-clock-o'); - is_status_changed = true; - } - break; + is_status_changed = true; + } + break; // Failed in transaction - case 3: - if(sqlEditorUtils.previousStatus != status && + case 3: + if(sqlEditorUtils.previousStatus != status && !$status_el.hasClass('fa-exclamation-circle')) { - $status_el.removeClass() + $status_el.removeClass() .addClass('fa fa-exclamation-circle'); - is_status_changed = true; - } - break; + is_status_changed = true; + } + break; // Failed in transaction with unknown server side error - case 4: - if(sqlEditorUtils.previousStatus != status && + case 4: + if(sqlEditorUtils.previousStatus != status && !$status_el.hasClass('fa-exclamation-triangle')) { - $status_el.removeClass() + $status_el.removeClass() .addClass('fa fa-exclamation-triangle'); - is_status_changed = true; - } - break; - default: - if(sqlEditorUtils.previousStatus != status && + is_status_changed = true; + } + break; + default: + if(sqlEditorUtils.previousStatus != status && !$status_el.hasClass('fa-query_tool_connected')) { - $status_el.removeClass() + $status_el.removeClass() .addClass('fa-custom fa-query-tool-connected'); - is_status_changed = true; - } + is_status_changed = true; + } } sqlEditorUtils.previousStatus = status; @@ -136,8 +136,8 @@ define(['jquery', 'sources/gettext'], // We come here means we did not receive expected response // from server, we need to error out sqlEditorUtils.previousStatus = -99; - msg = gettext("An unexpected error occurred - " + - "ensure you are logged into the application."); + msg = gettext('An unexpected error occurred - ' + + 'ensure you are logged into the application.'); $el.attr('data-content', msg); if(!$status_el.hasClass('fa-query-tool-disconnected')) { $el.popover('hide'); @@ -148,10 +148,10 @@ define(['jquery', 'sources/gettext'], }, error: function (e) { sqlEditorUtils.previousStatus = -1; - var msg = gettext("Transaction status check failed."); + var msg = gettext('Transaction status check failed.'); if (e.readyState == 0) { - msg = gettext("Not connected to the server or the connection to " + - "the server has been closed."); + msg = gettext('Not connected to the server or the connection to ' + + 'the server has been closed.'); } else if (e.responseJSON && e.responseJSON.errormsg) { msg = e.responseJSON.errormsg; } @@ -164,14 +164,14 @@ define(['jquery', 'sources/gettext'], $status_el.removeClass() .addClass('fa-custom fa-query-tool-disconnected'); } - } + }, }); }, // This function will update the connection status updateConnectionStatus: function(url, poll_time) { - var $el = $(".connection_status"), - $status_el = $($($el).find(".fa-custom")); + var $el = $('.connection_status'), + $status_el = $($($el).find('.fa-custom')); // Apply popover on element $el.popover(); @@ -188,7 +188,7 @@ define(['jquery', 'sources/gettext'], // Updates the flag for connection status poll updateConnectionStatusFlag: function(status) { - var $el = $(".connection_status"); + var $el = $('.connection_status'); if ($el.data('panel-visible') != status) { $el.data('panel-visible', status); } diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index 590996b85..3df96051d 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -156,7 +156,7 @@ define('tools.querytool', [ 'filename': 'css', }), theme: 'webcabin.overrides.css', - }); + }); var sql_panel = new pgAdmin.Browser.Panel({ name: 'sql_panel', @@ -298,13 +298,13 @@ define('tools.querytool', [ transId = self.handler.transId; // If transaction id is already set if($container.data('trans-id') != transId) { - $container.data('trans-id', transId) + $container.data('trans-id', transId); } if (!$container.hasClass('wcPanelTabContentHidden')) { - setTimeout(function () { - self.handler.gridView.query_tool_obj.focus(); - }, 200); + setTimeout(function () { + self.handler.gridView.query_tool_obj.focus(); + }, 200); // Trigger an event to update connection status flag pgBrowser.Events.trigger( 'pgadmin:query_tool:panel:gain_focus:' + transId @@ -321,10 +321,10 @@ define('tools.querytool', [ pgBrowser.Events.trigger( 'pgadmin:query_tool:panel:lost_focus:' + transId ); - } - }); - } - }); + } + }); + } + }); // Code to update connection status polling flag pgBrowser.Events.on(