gitbook-plugin-adsense
Advanced tools
Comparing version 0.0.3 to 0.0.4
require(["gitbook"], function(gitbook) { | ||
var config = config.adsense | ||
, adInsertPoint = document.querySelector('.page-inner section') | ||
, adsByGoogleScript | ||
, ad | ||
; | ||
gitbook.events.bind("start", function(e, config) { | ||
var config = config.adsense | ||
, adsByGoogleScript | ||
, ad | ||
; | ||
// Inject script to head. | ||
@@ -22,6 +23,12 @@ adsByGoogleScript = document.createElement('script'); | ||
ad.setAttribute('data-ad-format', config.format); | ||
document.querySelector('.page-inner section').appendChild(ad); | ||
adInsertPoint.appendChild(ad); | ||
(adsbygoogle = window.adsbygoogle || []).push({}); | ||
}); | ||
gitbook.events.bind("page.change", function() { | ||
if (ad) { | ||
adInsertPoint.appendChild(ad); | ||
} | ||
}); | ||
}); |
@@ -5,3 +5,3 @@ { | ||
"main": "index.js", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"engines": { | ||
@@ -8,0 +8,0 @@ "gitbook": ">=2.5.1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14401
36