Did better stuff
bzr revid: nicolas.vanhoren@openerp.com-20120802084745-02bahalf1q3ht1l4
This commit is contained in:
parent
050b4caa28
commit
6f39a63957
|
@ -22,15 +22,11 @@ openerp.web_linkedin = function(instance) {
|
|||
tag.src = "http://platform.linkedin.com/in.js";
|
||||
tag.innerHTML = 'api_key : ' + self.api_key + '\nauthorize : true';
|
||||
document.getElementsByTagName('head')[0].appendChild(tag);
|
||||
linkedin_added = true;
|
||||
self.linkedin_added = true;
|
||||
$(tag).load(function() {
|
||||
self.linkedin_def.resolve();
|
||||
});
|
||||
return self.linkedin_def.promise();
|
||||
}, function() {
|
||||
/*return new instance.web.Model("ir.config_parameter").call("set_param", ["web.linkedin.apikey", "cxnr0l53n73x"]).pipe(function() {
|
||||
return self.test_linkedin();
|
||||
});*/
|
||||
});
|
||||
},
|
||||
test_api_key: function() {
|
||||
|
@ -48,6 +44,10 @@ openerp.web_linkedin = function(instance) {
|
|||
},
|
||||
});
|
||||
|
||||
/*return new instance.web.Model("ir.config_parameter").call("set_param", ["web.linkedin.apikey", "cxnr0l53n73x"]).pipe(function() {
|
||||
return self.test_linkedin();
|
||||
});*/
|
||||
|
||||
instance.web_linkedin.tester = new instance.web_linkedin.LinkedinTester();
|
||||
|
||||
instance.web_linkedin.Linkedin = instance.web.form.FieldChar.extend({
|
||||
|
@ -55,20 +55,21 @@ openerp.web_linkedin = function(instance) {
|
|||
this._super.apply(this, arguments);
|
||||
var self = this;
|
||||
this.display_dm = new instance.web.DropMisordered(true);
|
||||
this.on("linkedin_loaded", this, function() {
|
||||
$("input", self.$element).after(QWeb.render("FieldChar.linkedin"));
|
||||
});
|
||||
},
|
||||
initialize_content: function() {
|
||||
this._super();
|
||||
var $ht = $(QWeb.render("FieldChar.linkedin"));
|
||||
var $in = this.$("input");
|
||||
$in.replaceWith($ht);
|
||||
this.$(".oe_linkedin_input").append($in);
|
||||
this.$(".oe_linkedin_img").click(_.bind(this.search_linkedin, this));
|
||||
|
||||
},
|
||||
search_linkedin: function() {
|
||||
var self = this;
|
||||
if (! this.get("effective_readonly")) {
|
||||
this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).then(function() {
|
||||
self.trigger("linkedin_loaded");
|
||||
});
|
||||
} else {
|
||||
this.display_dm.add($.when());
|
||||
}
|
||||
this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).then(function() {
|
||||
debugger;
|
||||
});
|
||||
},
|
||||
});
|
||||
instance.web.form.widgets.add('linkedin', 'instance.web_linkedin.Linkedin');
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
-->
|
||||
<templates xml:space="preserve">
|
||||
<t t-name="FieldChar.linkedin">
|
||||
Yop
|
||||
<img class="oe_linkedin_img" t-att-src='_s + "/web_linkedin/static/src/img/Linkedin_blue.png"' style="float: right;width: 1.5em;margin-top: -1px;"/>
|
||||
<div class="oe_linkedin_input" style="margin-right:1.5em"/>
|
||||
</t>
|
||||
</templates>
|
Loading…
Reference in New Issue