From bc82a989f2449165f28955e7a11f944dbdf2e036 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 11 Apr 2011 10:30:32 +0200 Subject: [PATCH] [IMP] Renamed Notification methods 'default' -> notify , 'alert' -> warn bzr revid: fme@openerp.com-20110411083032-zc87gltpnw2z7s0r --- addons/base/static/src/js/chrome.js | 9 ++------- addons/base/static/src/js/data.js | 2 +- addons/base/static/src/js/form.js | 12 ++++++------ addons/base/static/src/js/search.js | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/addons/base/static/src/js/chrome.js b/addons/base/static/src/js/chrome.js index b26dccffb2e..920973e640a 100644 --- a/addons/base/static/src/js/chrome.js +++ b/addons/base/static/src/js/chrome.js @@ -245,12 +245,7 @@ openerp.base.Notification = openerp.base.BasicController.extend({ text: text }); }, - // TODO remove to avoid default as attribute - 'default': function(title, text) { - this.notify(title,text); - }, - // TODO change into warn to avoid alert - alert: function(title, text) { + warn: function(title, text) { this.$element.notify('create', 'oe_notification_alert', { title: title, text: text @@ -907,7 +902,7 @@ openerp.base.WebClient = openerp.base.Controller.extend({ this.header.start(); this.login.start(); this.menu.start(); - this.notification['default']("OpenERP Client", "The openerp client has been initialized."); + this.notification.notify("OpenERP Client", "The openerp client has been initialized."); }, on_logged: function() { this.action = new openerp.base.ActionManager(this.session, "oe_app"); diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index 8f5d6168e75..c16bf8eb81b 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -100,7 +100,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base. }, callback); }, unlink: function(ids) { - this.notification['default']("Unlink", ids); + this.notification.notify("Unlink", ids); }, call: function (method, ids, args, callback) { ids = ids || []; diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index bf42fc4fd7f..e31f03510d8 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -234,24 +234,24 @@ openerp.base.FormView = openerp.base.Controller.extend( /** @lends openerp.base } }); msg += ""; - this.notification.alert("The following fields are invalid :", msg); + this.notification.warn("The following fields are invalid :", msg); }, on_saved: function(r) { if (!r.result) { this.log("Record was not saved"); } else { // Check response for exceptions, display error - this.notification['default']("Record saved", "The record #" + this.datarecord.id + " has been saved."); + this.notification.notify("Record saved", "The record #" + this.datarecord.id + " has been saved."); } }, do_search: function (domains, contexts, groupbys) { - this.notification['default']("Searching form"); + this.notification.notify("Searching form"); }, on_action: function (action) { - this.notification['default']('Executing action ' + action); + this.notification.notify('Executing action ' + action); }, do_cancel: function () { - this.notification['default']("Cancelling form"); + this.notification.notify("Cancelling form"); } }); @@ -720,7 +720,7 @@ openerp.base.form.FieldOne2ManyDatasSet = openerp.base.DataSetStatic.extend({ this._super(id, data, callback); }, unlink: function() { - this.notification['default']('Unlinking o2m ' + this.ids); + this.notification.notify('Unlinking o2m ' + this.ids); } }); diff --git a/addons/base/static/src/js/search.js b/addons/base/static/src/js/search.js index ef10992d75f..21d1408f087 100644 --- a/addons/base/static/src/js/search.js +++ b/addons/base/static/src/js/search.js @@ -215,7 +215,7 @@ openerp.base.SearchView = openerp.base.Controller.extend({ * @param {Array} errors a never-empty array of error objects */ on_invalid: function (errors) { - this.notification['default']("Invalid Search", "triggered from search view"); + this.notification.notify("Invalid Search", "triggered from search view"); }, do_clear: function (e) { if (e && e.preventDefault) { e.preventDefault(); }