mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Plugin system improvements
+ piwik analytics plugin (not tested)
This commit is contained in:
parent
4c38993c26
commit
085095b717
11 changed files with 137 additions and 11 deletions
32
plugins/piwik-analytics/js/include.js
Normal file
32
plugins/piwik-analytics/js/include.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
$(function () {
|
||||
|
||||
var
|
||||
sPiwikURL = '' + window.rl.pluginSettingsGet('piwik-analytics', 'piwik_url'),
|
||||
sSiteID = '' + window.rl.pluginSettingsGet('piwik-analytics', 'site_id')
|
||||
;
|
||||
|
||||
if ('' !== sPiwikURL && '' !== sSiteID)
|
||||
{
|
||||
sPiwikURL = sPiwikURL.replace(/[\\\/\s]+$/, '') + '/';
|
||||
if (/^https?:/i.test(sPiwikURL))
|
||||
{
|
||||
sPiwikURL = 'http://' + sPiwikURL;
|
||||
}
|
||||
|
||||
window._paq = window._paq || [];
|
||||
(function(window){
|
||||
window._paq.push(['setSiteId', sSiteID]);
|
||||
window._paq.push(['setTrackerUrl', sPiwikURL + 'piwik.php']);
|
||||
window._paq.push(['trackPageView']);
|
||||
window.setInterval(function () {
|
||||
window._paq.push(['trackPageView']);
|
||||
}, 1000 * 60 * 2);
|
||||
var d = window.document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
||||
g.type = 'text/javascript'; g.defer = true; g.async = true; g.src = sPiwikURL + 'piwik.js';
|
||||
if (s && s.parentNode) {
|
||||
s.parentNode.insertBefore(g, s);
|
||||
}
|
||||
}(window));
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue