mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-07-08 14:12:44 +00:00
Successful mobile slots - default to 320*50
This commit is contained in:
parent
f94bf79192
commit
6d93faf871
@ -8,6 +8,8 @@ var ad_code = '';
|
|||||||
var publisher_id = Discourse.SiteSettings.adsense_publisher_code;
|
var publisher_id = Discourse.SiteSettings.adsense_publisher_code;
|
||||||
var preGoogleVars = null;
|
var preGoogleVars = null;
|
||||||
var postGoogleVars = null;
|
var postGoogleVars = null;
|
||||||
|
var mobile_width = 320;
|
||||||
|
var mobile_height = 50;
|
||||||
|
|
||||||
|
|
||||||
function splitWidthInt(value) {
|
function splitWidthInt(value) {
|
||||||
@ -101,6 +103,9 @@ export default Ember.Component.extend({
|
|||||||
ad_width: ad_width,
|
ad_width: ad_width,
|
||||||
ad_height: ad_height,
|
ad_height: ad_height,
|
||||||
|
|
||||||
|
mobile_width: mobile_width,
|
||||||
|
mobile_height: mobile_height,
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
this.set('ad_width', data[this.placement]["ad_width"] );
|
this.set('ad_width', data[this.placement]["ad_width"] );
|
||||||
this.set('ad_height', data[this.placement]["ad_height"] );
|
this.set('ad_height', data[this.placement]["ad_height"] );
|
||||||
@ -117,8 +122,8 @@ export default Ember.Component.extend({
|
|||||||
}.property('adWrapperStyle'),
|
}.property('adWrapperStyle'),
|
||||||
|
|
||||||
adWrapperStyleMobile: function() {
|
adWrapperStyleMobile: function() {
|
||||||
return `width: 320px; height: 50px; margin:0 auto;`.htmlSafe();
|
return `width: ${this.get('mobile_width')}px; height: ${this.get('mobile_height')}px; margin:0 auto;`.htmlSafe();
|
||||||
},
|
}.property('mobile_width', 'mobile_height'),
|
||||||
|
|
||||||
adInsStyleMobile: function() {
|
adInsStyleMobile: function() {
|
||||||
return `display: inline-block; ${this.get('adWrapperStyleMobile')}`.htmlSafe();
|
return `display: inline-block; ${this.get('adWrapperStyleMobile')}`.htmlSafe();
|
||||||
|
@ -4,6 +4,9 @@ import loadScript from 'discourse/lib/load-script';
|
|||||||
var const_width = '';
|
var const_width = '';
|
||||||
var const_height = '';
|
var const_height = '';
|
||||||
|
|
||||||
|
var mobile_width = 320;
|
||||||
|
var mobile_height = 50;
|
||||||
|
|
||||||
var _loaded = false,
|
var _loaded = false,
|
||||||
_promise = null;
|
_promise = null;
|
||||||
|
|
||||||
@ -115,6 +118,9 @@ export default Ember.Component.extend({
|
|||||||
classNames: ['google-dfp-ad'],
|
classNames: ['google-dfp-ad'],
|
||||||
loadedGoogletag: false,
|
loadedGoogletag: false,
|
||||||
|
|
||||||
|
mobile_width: mobile_width,
|
||||||
|
mobile_height: mobile_height,
|
||||||
|
|
||||||
// Part of the divID of the div part of the GPT
|
// Part of the divID of the div part of the GPT
|
||||||
divId: function() {
|
divId: function() {
|
||||||
return "div-gpt-ad-" + this.get('placement');
|
return "div-gpt-ad-" + this.get('placement');
|
||||||
@ -125,8 +131,8 @@ export default Ember.Component.extend({
|
|||||||
}.property('const_width', 'const_height'),
|
}.property('const_width', 'const_height'),
|
||||||
|
|
||||||
adWrapperStyleMobile: function() {
|
adWrapperStyleMobile: function() {
|
||||||
return `width: 320px; height: 50px;`.htmlSafe();
|
return `width: ${this.get('mobile_width')}px; height: ${this.get('mobile_height')}px; margin:0 auto;`.htmlSafe();
|
||||||
},
|
}.property('mobile_width', 'mobile_height'),
|
||||||
|
|
||||||
_initGoogleDFP: function() {
|
_initGoogleDFP: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user