diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js index 2a7e3244..dded4d77 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js +++ b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js @@ -1,7 +1,10 @@ define('pgadmin.node.cast', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', - 'pgadmin.browser', 'alertify', 'pgadmin.browser.collection' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) { + 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', + + 'pgadmin.browser.collection' +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper) { // Extend the collection class for cast if (!pgBrowser.Nodes['coll-cast']) { var casts = pgAdmin.Browser.Nodes['coll-cast'] = @@ -212,7 +215,8 @@ define('pgadmin.node.cast', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js index ee5cbd76..0dc11da7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js @@ -1,8 +1,10 @@ define('pgadmin.node.synonym', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', + 'pgadmin.browser.collection' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper) { if (!pgBrowser.Nodes['coll-synonym']) { var databases = pgAdmin.Browser.Nodes['coll-synonym'] = @@ -167,7 +169,8 @@ define('pgadmin.node.synonym', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/js/check_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/js/check_constraint.js index 82bb8293..b12d9d30 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/js/check_constraint.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/templates/check_constraint/js/check_constraint.js @@ -2,8 +2,10 @@ define('pgadmin.node.check_constraints', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', + 'pgadmin.browser.collection' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) { // Check Constraint Node if (!pgBrowser.Nodes['check_constraints']) { @@ -63,7 +65,8 @@ define('pgadmin.node.check_constraints', [ type:'GET', success: function(res) { if (res.success == 1) { - Alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.removeIcon(i); data.valid = true; data.icon = 'icon-check_constraints'; @@ -76,7 +79,8 @@ define('pgadmin.node.check_constraints', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - Alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js index 84b7adfb..95afa3ef 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js @@ -1,8 +1,10 @@ define('pgadmin.node.foreign_key', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', + 'pgadmin.browser.collection' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) { var formatNode = function(opt) { if (!opt.id) { @@ -653,7 +655,8 @@ define('pgadmin.node.foreign_key', [ type:'GET', success: function(res) { if (res.success == 1) { - Alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.removeIcon(i); data.valid = true; data.icon = 'icon-foreign_key'; @@ -666,7 +669,8 @@ define('pgadmin.node.foreign_key', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - Alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js index 0b701a4b..dbd171e3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js @@ -1,9 +1,10 @@ define('pgadmin.node.table', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', 'pgadmin.browser.collection', 'pgadmin.node.column', 'pgadmin.node.constraints' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper) { if (!pgBrowser.Nodes['coll-table']) { var databases = pgBrowser.Nodes['coll-table'] = @@ -122,7 +123,8 @@ define('pgadmin.node.table', [ dataType: "json", success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.unload(i); t.setInode(i); t.deselect(i); @@ -135,7 +137,8 @@ define('pgadmin.node.table', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -174,7 +177,8 @@ define('pgadmin.node.table', [ dataType: "json", success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.removeIcon(i); data.icon = 'icon-table'; t.addIcon(i, {icon: data.icon}); @@ -191,7 +195,8 @@ define('pgadmin.node.table', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -221,7 +226,8 @@ define('pgadmin.node.table', [ type:'DELETE', success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.removeIcon(i); data.icon = 'icon-table'; t.addIcon(i, {icon: data.icon}); @@ -238,7 +244,8 @@ define('pgadmin.node.table', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js index 7716b878..1623fe54 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js @@ -1,8 +1,9 @@ define('pgadmin.node.trigger', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'backform', 'alertify', + 'sources/alerts/alertify_wrapper', 'pgadmin.browser.collection' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify, AlertifyWrapper) { var CustomSwitchControl = Backform.CustomSwitchControl = Backform.SwitchControl.extend({ template: _.template([ @@ -109,7 +110,8 @@ define('pgadmin.node.trigger', [ dataType: "json", success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.removeIcon(i); data.icon = 'icon-trigger'; t.addIcon(i, {icon: data.icon}); @@ -126,7 +128,8 @@ define('pgadmin.node.trigger', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -152,7 +155,8 @@ define('pgadmin.node.trigger', [ dataType: "json", success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.removeIcon(i); data.icon = 'icon-trigger-bad'; t.addIcon(i, {icon: data.icon}); @@ -169,7 +173,8 @@ define('pgadmin.node.trigger', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js index 7e1c8351..24981071 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js @@ -1,8 +1,10 @@ define('pgadmin.node.mview', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'alertify', 'pgadmin.browser', 'codemirror', + 'sources/alerts/alertify_wrapper', + 'pgadmin.browser.server.privilege' -], function(gettext, url_for, $, _, S, pgAdmin, alertify, pgBrowser, CodeMirror) { +], function(gettext, url_for, $, _, S, pgAdmin, alertify, pgBrowser, CodeMirror, AlertifyWrapper) { /** Create and add a view collection into nodes @@ -292,7 +294,8 @@ define('pgadmin.node.mview', [ dataType: "json", success: function(res) { if (res.success == 1) { - alertify.success('View refreshed successfully'); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success('View refreshed successfully'); } else { alertify.alert( diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js index aead13c6..e3797338 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js +++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js @@ -1,9 +1,11 @@ define('pgadmin.node.database', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', + 'pgadmin.browser.collection', 'pgadmin.browser.server.privilege', 'pgadmin.browser.server.variable', -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) { if (!pgBrowser.Nodes['coll-database']) { var databases = pgBrowser.Nodes['coll-database'] = @@ -191,7 +193,8 @@ define('pgadmin.node.database', [ success: function(res) { if (res.success == 1) { var prv_i = t.parent(i); - Alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.removeIcon(i); data.connected = false; data.icon = 'icon-database-not-connected'; @@ -205,7 +208,8 @@ define('pgadmin.node.database', [ } else { try { - Alertify.error(res.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(res.errormsg); } catch (e) {} t.unload(i); } @@ -214,7 +218,8 @@ define('pgadmin.node.database', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - Alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -511,7 +516,8 @@ define('pgadmin.node.database', [ tree.addIcon(item, {icon: data.icon}); } - Alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); obj.trigger('connected', obj, item, data); pgBrowser.Events.trigger( 'pgadmin:database:connected', item, data diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js index ea1f118b..f5ec62bc 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js +++ b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js @@ -1,8 +1,10 @@ define('pgadmin.node.pga_job', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', + 'pgadmin.node.pga_jobstep', 'pgadmin.node.pga_schedule' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, AlertifyWrapper) { if (!pgBrowser.Nodes['coll-pga_job']) { var pga_jobs = pgBrowser.Nodes['coll-pga_job'] = @@ -178,18 +180,19 @@ define('pgadmin.node.pga_job', [ t.unload(i); }, error: function(xhr, status, error) { - var error_msg = "Unable to run pgagent job."; + var error_msg = "Unable to run pgagent job."; + var alertifyWrapper = new AlertifyWrapper(); if (xhr.readyState == 0) { - alertify.error(gettext('Not connected to the server or the connection to the server has been closed.')); + alertifyWrapper.error(gettext('Not connected to the server or the connection to the server has been closed.')); } else { if (_.isUndefined(xhr.responseText)) { - alertify.error(error_msg); + alertifyWrapper.error(error_msg); } else { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + alertifyWrapper.error(err.errormsg); } } } diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js index 72d44d16..34560583 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/server.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js @@ -2,10 +2,11 @@ define('pgadmin.node.server', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', 'pgadmin.server.supported_servers', - 'pgadmin.user_management.current_user' + 'pgadmin.user_management.current_user', + 'sources/alerts/alertify_wrapper', ], function( gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, - supported_servers, current_user + supported_servers, current_user, AlertifyWrapper ) { if (!pgBrowser.Nodes['server']) { @@ -189,7 +190,8 @@ define('pgadmin.node.server', [ type:'DELETE', success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); d = t.itemData(i); t.removeIcon(i); d.connected = false; @@ -208,7 +210,8 @@ define('pgadmin.node.server', [ } else { try { - alertify.error(res.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(res.errormsg); } catch (e) {} t.unload(i); } @@ -217,7 +220,8 @@ define('pgadmin.node.server', [ try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -285,17 +289,20 @@ define('pgadmin.node.server', [ method:'GET', success: function(res) { if (res.data.status) { - alertify.success(res.data.result); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.data.result); } else { - alertify.error(res.data.result); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(res.data.result); } }, error: function(xhr, status, error) { try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -330,13 +337,15 @@ define('pgadmin.node.server', [ method:'POST', data:{ 'value': JSON.stringify(value) }, success: function(res) { - alertify.success(res.data.result, 10); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.data.result, 10); }, error: function(xhr, status, error) { try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg, 10); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg, 10); } } catch (e) {} t.unload(i); @@ -344,7 +353,8 @@ define('pgadmin.node.server', [ }); } else { evt.cancel = true; - alertify.error( gettext('Please enter a valid name.'), 10); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error( gettext('Please enter a valid name.'), 10); } }, // We will execute this function when user clicks on the Cancel button @@ -485,18 +495,20 @@ define('pgadmin.node.server', [ method:'POST', data:{'data': JSON.stringify(args) }, success: function(res) { + var alertifyWrapper = new AlertifyWrapper(); if (res.success) { - alertify.success(res.info); + alertifyWrapper.success(res.info); self.close(); } else { - alertify.error(res.errormsg); + alertifyWrapper.error(res.errormsg); } }, error: function(xhr, status, error) { try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} } @@ -529,7 +541,8 @@ define('pgadmin.node.server', [ dataType: "json", success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.itemData(i).wal_pause=res.data.wal_pause; t.unload(i); t.setInode(i); @@ -545,7 +558,8 @@ define('pgadmin.node.server', [ var err = $.parseJSON(xhr.responseText); if (err.success == 0) { msg = S(err.errormsg).value(); - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -571,7 +585,8 @@ define('pgadmin.node.server', [ dataType: "json", success: function(res) { if (res.success == 1) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); t.itemData(i).wal_pause=res.data.wal_pause; t.unload(i); t.setInode(i); @@ -587,7 +602,8 @@ define('pgadmin.node.server', [ var err = $.parseJSON(xhr.responseText); if (err.success == 0) { msg = S(err.errormsg).value(); - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} t.unload(i); @@ -888,7 +904,8 @@ define('pgadmin.node.server', [ pgBrowser.serverInfo || {}; serverInfo[data._id] = _.extend({}, data); - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); obj.trigger('connected', obj, item, data); // Generate the event that server is connected diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/js/tablespaces.js b/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/js/tablespaces.js index 4e6d26eb..61814879 100644 --- a/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/js/tablespaces.js +++ b/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/js/tablespaces.js @@ -1,9 +1,11 @@ define('pgadmin.node.tablespace', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', + 'sources/alerts/alertify_wrapper', + 'pgadmin.browser.collection', 'pgadmin.browser.node.ui', 'pgadmin.browser.server.privilege' -], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) { +], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, AlertifyWrapper) { if (!pgBrowser.Nodes['coll-tablespace']) { var databases = pgBrowser.Nodes['coll-tablespace'] = @@ -278,17 +280,20 @@ define('pgadmin.node.tablespace', [ data:{'data': JSON.stringify(args) }, success: function(res) { if (res.success) { - alertify.success(res.info); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(res.info); self.close(); } else { - alertify.error(res.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(res.errormsg); } }, error: function(xhr, status, error) { try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - alertify.error(err.errormsg); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(err.errormsg); } } catch (e) {} } diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js index c7b4220f..3273b2be 100644 --- a/web/pgadmin/browser/templates/browser/js/node.js +++ b/web/pgadmin/browser/templates/browser/js/node.js @@ -1,8 +1,11 @@ define([ 'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser.menu', 'backbone', 'alertify', 'pgadmin.browser.datamodel', - 'backform', 'pgadmin.backform', 'wcdocker', 'pgadmin.alertifyjs' -], function(gettext, $, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) { + 'backform', + 'sources/alerts/alertify_wrapper', + + 'pgadmin.backform', 'wcdocker', 'pgadmin.alertifyjs' +], function(gettext, $, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform, AlertifyWrapper) { var wcDocker = window.wcDocker, keyCode = { @@ -616,10 +619,10 @@ define([ if (!(_.isFunction(obj.canDropCascade) ? obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) { - Alertify.notify( + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error( S('The %s "%s" cannot be dropped!') .sprintf(obj.label, d.label).value(), - 'error', 10 ); return; @@ -630,12 +633,13 @@ define([ title = S( gettext('DROP %s?')).sprintf(obj.label).value(); if (!(_.isFunction(obj.canDrop) ? - obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) { - Alertify.notify( - S('The %s "%s" cannot be dropped!') - .sprintf(obj.label, d.label).value(), - 'error', 10 - ); + obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) { + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error( + S('The %s "%s" cannot be dropped!') + .sprintf(obj.label, d.label).value(), + 10 + ); return; } } diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js index 0763849d..91de0eef 100644 --- a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js +++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager.js @@ -1,7 +1,8 @@ // This defines File Manager dialog define([ - 'sources/gettext', 'jquery', 'underscore', 'alertify' -], function(gettext, $, _, alertify) { + 'sources/gettext', 'jquery', 'underscore', 'alertify', + 'sources/alerts/alertify_wrapper', +], function(gettext, $, _, alertify, AlertifyWrapper) { pgAdmin = pgAdmin || window.pgAdmin || {}; /* @@ -595,12 +596,14 @@ define([ permission = true; } else { $('.file_manager_ok').addClass('disabled'); - alertify.error(data.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(data.Error); } }, error: function() { $('.file_manager_ok').addClass('disabled'); - alertify.error( gettext('Error occurred while checking access permission.')); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error( gettext('Error occurred while checking access permission.')); } }); return permission; diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js index 920a1715..d0eaf7a8 100755 --- a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js +++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js @@ -13,7 +13,7 @@ "use strict"; // use alertify and underscore js -var alertify = require("alertify"), +var AlertifyWrapper = require('sources/alerts/alertify_wrapper'), _ = require("underscore"), S = require("underscore.string"), gettext = require('sources/gettext'); @@ -296,14 +296,17 @@ var setUploader = function(path) { $.getJSON(fileConnector + '?mode=addfolder&path=' + $('.currentpath').val() + '&name=' + foldername, function(resp) { var result = resp.data.result; if (result.Code === 1) { - alertify.success(lg.successful_added_folder); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(lg.successful_added_folder); getFolderInfo(result.Parent); } else { - alertify.error(result.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(result.Error); } }); } else { - alertify.error(lg.no_foldername); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(lg.no_foldername); } }; @@ -466,9 +469,11 @@ var renameItem = function(data) { // UnBind toolbar functions. $('.fileinfo').find('button.rename, button.delete, button.download').unbind(); - alertify.success(lg.successful_rename); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(lg.successful_rename); } else { - alertify.error(result.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(result.Error); } finalName = result['New Name']; @@ -508,14 +513,16 @@ var deleteItem = function(data) { if (result.Code === 1) { isDeleted = true; if (isDeleted) { - alertify.success(lg.successful_delete); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(lg.successful_delete); var rootpath = result.Path.substring(0, result.Path.length-1); // removing the last slash rootpath = rootpath.substr(0, rootpath.lastIndexOf('/') + 1); getFolderInfo(rootpath); } } else { isDeleted = false; - alertify.error(result.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(result.Error); } } }); @@ -601,7 +608,8 @@ var getFileInfo = function(file) { } } else { $('.file_manager_ok').addClass('disabled'); - alertify.error(data.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(data.Error); } } }); @@ -628,12 +636,14 @@ var checkPermission = function(path) { permission = true; } else { $('.file_manager_ok').addClass('disabled'); - alertify.error(data.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(data.Error); } }, error: function() { $('.file_manager_ok').addClass('disabled'); - alertify.error( gettext('Error occurred while checking access permission.')); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error( gettext('Error occurred while checking access permission.')); } }); return permission; @@ -703,7 +713,8 @@ var getFolderInfo = function(path, file_type) { // hide activity indicator $('.fileinfo').find('span.activity').hide(); if (data.Code === 0) { - alertify.error(data.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(data.Error); return; } // generate HTML for files/folder and render into container @@ -1599,18 +1610,21 @@ if (has_capability(data, 'upload')) { $this.find(".dz-upload").addClass("success"); }, 1000); $this.find(".dz-upload").css('width', "100%").html("100%"); - alertify.success(lg.upload_success); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.success(lg.upload_success); } else { $this.find(".dz-upload").addClass("error"); $this.find(".dz-upload").css('width', "0%").html("0%"); - alertify.error(data.Error); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(data.Error); } getFolderInfo(path); }, totaluploadprogress: function(progress) {}, complete: function(file) { if (file.status == "error") { - alertify.error(lg.ERROR_UPLOADING_FILE); + var alertifyWrapper = new AlertifyWrapper(); + alertifyWrapper.error(lg.ERROR_UPLOADING_FILE); } $('.upload_file .dz_cross_btn').removeAttr('disabled'); getFolderInfo(path); diff --git a/web/pgadmin/static/css/bootstrap.overrides.css b/web/pgadmin/static/css/bootstrap.overrides.css index 2bb97512..4acf484a 100755 --- a/web/pgadmin/static/css/bootstrap.overrides.css +++ b/web/pgadmin/static/css/bootstrap.overrides.css @@ -1019,137 +1019,12 @@ ul.nav.nav-tabs { height: 8em; overflow: scroll; } -/* Overrides alertify js headers */ -.alertify .ajs-header { - padding: 6px 10px!important; - min-height: 35px; - max-height: 35px; - border-bottom: 2px solid darkgray; - background-color: #2C76B4; - font-weight: bold; - color: white; - font-size: 14px; - font-weight: bold; - border-radius: 0; -} - -.alertify.ajs-maximized .ajs-commands, .alertify.ajs-resizable .ajs-commands { - margin: 2px 0px 0 0; -} - -/* Overrides alertify js headers hovering behaviour*/ -.alertify .ajs-header:hover { - background-color:#2C76B4; -} -/* Removes padding from alertify footer */ -.alertify .ajs-footer { - padding: 0; - min-height: 35px; -} -/* Restyling alertify buttons */ -.alertify .ajs-footer .ajs-buttons { - background-color: #D2D2D2; - border-width: 2px 0px 0px 0px; - border-style: solid; - border-color: rgb(85, 85, 85); -} - -.alertify .ajs-footer .ajs-buttons.ajs-auxiliary .ajs-button, .alertify .ajs-footer .ajs-buttons.ajs-primary .ajs-button { - margin-left: 2px; - margin-right: 2px; - margin-top:2px; - margin-bottom:0px; -} - -.alertify .ajs-footer .ajs-buttons .ajs-button { - min-width: 40px; - min-height: 30px; -} - -.alertify .ajs-commands { - margin: -22px 4px 0 0; -} - -/* Replaces alertify button icons */ -.alertify .ajs-commands button{ - margin-left: 5px; -} - -/* Prevent text blur in the runtime */ -.alertify .ajs-dimmer, -.alertify .ajs-modal { - -webkit-transform: none; -} - -.ajs-commands { - position: absolute; - width: auto!important; -} - -.ajs-pin , .ajs-maximize , .ajs-close{ - width: 20px; - height: 20px; - border: 2px solid #9E9E9E !important; - background-color: #ddd!important; - font-size: 12px; - border-radius: 5px 5px 5px 5px; - position: relative; - //float: right; - cursor: pointer; - text-align: center; - overflow: hidden; - z-index: 1; -} -.ajs-pin:hover , .ajs-maximize:hover , .ajs-close:hover{ - border: 2px solid #CCCCCC!important; -} - -.alertify .ajs-commands button.ajs-maximize { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAZklEQVQ4jcWTuw2AMAxEn5jBs7B/e0gpmAiKEGRS5QDBSS7v+Q8fSsCWQgDTA+DsGgJYuypumTNkWCWZg9q/HIAOSDim/xTUcu0exXXaxQG0teRVWQPLx2Gbe8B55yNqv7C4GV/TDq//J11odoZgAAAAAElFTkSuQmCC); - background-size: 14px; -} - -.alertify.ajs-modeless.ajs-pinnable .ajs-commands button.ajs-pin { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAkElEQVQ4jWNkwAR8DAwMBxkYGMTQxF8xMDDYMzAwfMKiBwMYMDAw3GRgYPgPxTehYiSBKCQDonApYiLV1KFjABsDA4MpEt8UKkYUkGBgYDjPgAhAGD4PlSPooqNYNMPwUXRXM+IwBAbaoXQlktg/ZMUsWAxAVvASmyZCBiCDNwTkCRrwasANIOgFQoADinECAAtnIEoWoODLAAAAAElFTkSuQmCC); - background-size: 13px; -} - -.alertify .ajs-commands button.ajs-close { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAdklEQVQ4jd2SwQnAIAxF36GH0pOTFHEgF3IkR5LO0F4SCGJVEHroAy/f/E+igV+yAa6hO7nrcgAZuIBg9CBalppXEnDL0RA1q556ASdQqhBrLlLTxVch1uxHZiU2AuKs2Vdt23GGHSy/wfIvzOzBPhpjaRO/5wG/szevJ+ZXzAAAAABJRU5ErkJggg==); -} - -.alertify.ajs-maximized .ajs-commands button.ajs-maximize { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA8klEQVQ4jZ3QMUpDQRCH8V+ewULQE4iERTyCrQiDCpbaCKKljbV4A89gqVgGrCMDWlpaWwVPoFYiIjYv8hBJXjLN7s7u9+3wZ4aKiOWI2IJOi8dHuM7MXxj3WMHe3CRBKeUGvVJKllJG8CrmoNty6jMsYKeGoY/jtgI4bez7OMjMr2oKwaieRzDMIljDRUSgXQZPeG2cv7GOffQ7ETGPcyw2HozWQWY+jLN3M/MzIu4wwNKf+zeMFVSQmY/YbfzeuiqIiAonZgi1quErHNa9F7xPM8FlAx5iA9ttJRVu8VHDm5k5rDNpLRERWxHR+6c/MZMfLIJDwzY66IkAAAAASUVORK5CYII=); -} - -/* Restyling alertify dialogue panel boundaries */ -.alertify .ajs-dialog { - border: 3px solid #DDDDDD; - border-radius: 0; -} -.alertify .ajs-content { - padding-left: 0 !important; - padding-right: 0 !important; -} - -.alertify .ajs-handle { - right: -4px; - bottom: -4px; -} span.button-label { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: initial; } -button.pg-alertify-button { - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; - font-size: 14px; - -webkit-font-smoothing: auto; -} -.fa.pg-alertify-button:before { - font: normal normal normal 18px/1 FontAwesome; - margin-right: 5px; -} + .backform_control_notes { background-color: #f5f5f5; border: 1px solid #ccc; diff --git a/web/pgadmin/static/js/alerts/alertify_wrapper.js b/web/pgadmin/static/js/alerts/alertify_wrapper.js new file mode 100644 index 00000000..c47091ee --- /dev/null +++ b/web/pgadmin/static/js/alerts/alertify_wrapper.js @@ -0,0 +1,40 @@ +define([ + 'jquery', + 'alertify', +], function ($, alertify) { + var AlertifyWrapper = function () { + var success = function (message, timeout) { + var alertMessage = '\ +