diff options
| author | Olivier Dony <odo@openerp.com> | 2012-11-09 14:36:23 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2012-11-09 14:36:23 +0100 |
| commit | d47d5f202d8da18fac46dee9a9be6613d1ef8e2f (patch) | |
| tree | 703be521b4ca935d0e4375fc3e88b34558b282a3 /addons/web_linkedin/static/src/js | |
| parent | c9d5148991db5beccedc802ce56efb3689dd1527 (diff) | |
| parent | c5961309c424173953a67d873c79135a97856759 (diff) | |
[MERGE] Sync with trunk
bzr revid: odo@openerp.com-20121109133623-pvgt4b9koun74ib3
Diffstat (limited to 'addons/web_linkedin/static/src/js')
| -rw-r--r-- | addons/web_linkedin/static/src/js/linkedin.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/addons/web_linkedin/static/src/js/linkedin.js b/addons/web_linkedin/static/src/js/linkedin.js index 863e51e913f..ec58c3736f4 100644 --- a/addons/web_linkedin/static/src/js/linkedin.js +++ b/addons/web_linkedin/static/src/js/linkedin.js @@ -14,7 +14,7 @@ openerp.web_linkedin = function(instance) { }, test_linkedin: function() { var self = this; - return this.test_api_key().pipe(function() { + return this.test_api_key().then(function() { if (self.linkedin_added) return self.linkedin_def.promise(); var tag = document.createElement('script'); @@ -37,7 +37,7 @@ openerp.web_linkedin = function(instance) { if (this.api_key) { return $.when(); } - return new instance.web.Model("ir.config_parameter").call("get_param", ["web.linkedin.apikey"]).pipe(function(a) { + return new instance.web.Model("ir.config_parameter").call("get_param", ["web.linkedin.apikey"]).then(function(a) { if (!!a) { self.api_key = a; return true; @@ -69,13 +69,13 @@ openerp.web_linkedin = function(instance) { }, search_linkedin: function() { var self = this; - this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).then(function() { + this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).done(function() { var pop = new instance.web_linkedin.LinkedinPopup(self, self.get("value")); pop.open(); pop.on("selected", this, function(entity) { self.selected_entity(entity); }); - }, _.bind(this.linkedin_disabled, this)); + }).fail(_.bind(this.linkedin_disabled, this)); }, linkedin_disabled: function() { instance.web.dialog($(QWeb.render("LinkedIn.DisabledWarning")), { @@ -87,7 +87,7 @@ openerp.web_linkedin = function(instance) { }, selected_entity: function(entity) { var self = this; - this.create_on_change(entity).then(function(to_change) { + this.create_on_change(entity).done(function(to_change) { self.view.set_values(to_change); }); }, @@ -101,7 +101,7 @@ openerp.web_linkedin = function(instance) { to_change.image = false; if (entity.logoUrl) { defs.push(self.rpc('/web_linkedin/binary/url2binary', - {'url': entity.logoUrl}).pipe(function(data){ + {'url': entity.logoUrl}).then(function(data){ to_change.image = data; })); } @@ -120,7 +120,7 @@ openerp.web_linkedin = function(instance) { }).error(function() { children_def.reject(); }); - defs.push(children_def.pipe(function(result) { + defs.push(children_def.then(function(result) { result = _.reject(result.people.values || [], function(el) { return ! el.formattedName; }); @@ -128,7 +128,7 @@ openerp.web_linkedin = function(instance) { el.__type = "people"; return self.create_on_change(el); }); - return $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { var p_to_change = _.toArray(arguments); to_change.child_ids = p_to_change; }); @@ -144,7 +144,7 @@ openerp.web_linkedin = function(instance) { to_change.image = false; if (entity.pictureUrl) { defs.push(self.rpc('/web_linkedin/binary/url2binary', - {'url': entity.pictureUrl}).pipe(function(data){ + {'url': entity.pictureUrl}).then(function(data){ to_change.image = data; })); } @@ -163,7 +163,7 @@ openerp.web_linkedin = function(instance) { to_change.linkedinUrl = entity.publicProfileUrl; */ } - return $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { return to_change; }); }, @@ -186,7 +186,7 @@ openerp.web_linkedin = function(instance) { this._super(); var self = this; this.on("authentified", this, this.authentified); - instance.web_linkedin.tester.test_authentication().then(function() { + instance.web_linkedin.tester.test_authentication().done(function() { self.trigger("authentified"); }); }, @@ -200,7 +200,7 @@ openerp.web_linkedin = function(instance) { encodeURI(this.text), this.limit)).result(function (result) { cdef.resolve(result); }); - var def = cdef.pipe(function(companies) { + var def = cdef.then(function(companies) { var lst = companies.companies.values || []; lst = _.first(lst, self.limit); lst = _.map(lst, function(el) { @@ -214,7 +214,7 @@ openerp.web_linkedin = function(instance) { params({"keywords": this.text, "count": this.limit}).result(function(result) { pdef.resolve(result); }); - var def2 = pdef.pipe(function(people) { + var def2 = pdef.then(function(people) { var plst = people.people.values || []; plst = _.first(plst, self.limit); plst = _.map(plst, function(el) { |
