mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-03-08 18:49:12 +00:00
fixed up with Jo's help setTargeting base method
This commit is contained in:
parent
6d8cbb72e4
commit
8989d9c5ea
@ -39,19 +39,20 @@ function keyParse(word) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This sets the key and value for custom targeting
|
// This sets the key and value for custom targeting
|
||||||
var Foo = function(key, value) {
|
var Foo = function(key, value, googletag) {
|
||||||
this.locationKey = key;
|
this.locationKey = key;
|
||||||
this.locationValue = value;
|
this.locationValue = value;
|
||||||
|
this.googletag = googletag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setTargeting is not defined. We want to return as a method - PROBLEM 1
|
// setTargeting is not defined. We want to return as a method - PROBLEM 1
|
||||||
Foo.prototype.bar = function() {
|
Foo.prototype.bar = function() {
|
||||||
return setTargeting((this.locationKey), (this.locationValue));
|
return googletag.setTargeting((this.locationKey), (this.locationValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This should call googletag.setTargeting(key for that location, value for that location)
|
// This should call googletag.setTargeting(key for that location, value for that location)
|
||||||
var googletag = new Foo(keyParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_key_code), valueParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_value_code));
|
var f = new Foo(keyParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_key_code), valueParse(Discourse.SiteSettings.dfp_target_topic_above_post_stream_value_code), googletag);
|
||||||
googletag.bar();
|
f.bar();
|
||||||
|
|
||||||
// END of Coaches Note
|
// END of Coaches Note
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user