diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2016-03-07 21:52:52 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2016-03-07 21:52:52 +0300 |
commit | e49cd78e998b92347d329a2e6dd03638aef6d92b (patch) | |
tree | ec4e160e633ac9d94026f5ff8470d63414426a3e | |
parent | 1934bb1e3a4b558e15d9b03fcab0e0613217d490 (diff) | |
parent | cb9b47f40abc3e4fbd94642ea15289373fcdbf1b (diff) |
Merge pull request #9876 from blogfoster/script/use-window-for-piwik
Add possibility to use piwik.js via browserify
-rw-r--r-- | js/piwik.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/js/piwik.js b/js/piwik.js index 639f5f05e4..3f6a2f350e 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -956,7 +956,7 @@ if (typeof JSON2 !== 'object' && typeof window.JSON === 'object' && window.JSON. /*global window */ /*global unescape */ /*global ActiveXObject */ -/*members encodeURIComponent, decodeURIComponent, getElementsByTagName, +/*members Piwik, encodeURIComponent, decodeURIComponent, getElementsByTagName, shift, unshift, piwikAsyncInit, frameElement, self, hasFocus, createElement, appendChild, characterSet, charset, all, addEventListener, attachEvent, removeEventListener, detachEvent, disableCookies, @@ -1046,8 +1046,8 @@ if (typeof _paq !== 'object') { } // Piwik singleton and namespace -if (typeof Piwik !== 'object') { - Piwik = (function () { +if (typeof window.Piwik !== 'object') { + window.Piwik = (function () { 'use strict'; /************************************************************ @@ -2086,7 +2086,7 @@ if (typeof Piwik !== 'object') { var foundNodes = nodeToSearch.getElementsByClassName(className); return this.htmlCollectionToArray(foundNodes); } - + var children = getChildrenFromNode(nodeToSearch); if (!children || !children.length) { @@ -6501,7 +6501,7 @@ if (window && window.piwikAsyncInit) { (function () { var jsTrackerType = (typeof AnalyticsTracker); if (jsTrackerType === 'undefined') { - AnalyticsTracker = Piwik; + AnalyticsTracker = window.Piwik; } }()); /*jslint sloppy: false */ @@ -6543,7 +6543,7 @@ if (typeof piwik_log !== 'function') { // instantiate the tracker var option, - piwikTracker = Piwik.getTracker(piwikUrl, siteId); + piwikTracker = window.Piwik.getTracker(piwikUrl, siteId); // initialize tracker piwikTracker.setDocumentTitle(documentTitle); |