bump: 3.0.0 close #78
This commit is contained in:
parent
d355bb4ebe
commit
74ce0bf588
10 changed files with 1358 additions and 957 deletions
|
|
@ -1,9 +1,8 @@
|
|||
this.D = this.D || {};
|
||||
this.D.GA = (function () {
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// From https://github.com/egoist/vue-ga/blob/master/src/index.js
|
||||
|
||||
function appendScript () {
|
||||
var script = document.createElement('script');
|
||||
script.async = true;
|
||||
|
|
@ -28,23 +27,15 @@ function collect () {
|
|||
window.ga('send', 'pageview');
|
||||
}
|
||||
|
||||
var install = function () {
|
||||
if (install.installed) { return }
|
||||
install.installed = true;
|
||||
|
||||
var install = function (hook) {
|
||||
if (!window.$docsify.ga) {
|
||||
console.error('[Docsify] ga is required.');
|
||||
return
|
||||
}
|
||||
|
||||
window.$docsify.plugins = [].concat(function (hook) {
|
||||
hook.init(collect);
|
||||
hook.beforeEach(collect);
|
||||
}, window.$docsify.plugins);
|
||||
hook.beforeEach(collect);
|
||||
};
|
||||
|
||||
var ga = install();
|
||||
|
||||
return ga;
|
||||
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
|
||||
|
||||
}());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue