Loading courseWP.js +11 −17 Original line number Diff line number Diff line Loading @@ -84,6 +84,10 @@ if (opt['--options']) { } }); } // move the old --siteid option into the new options map if (opt['--siteid']) { options.siteid = opt['--siteid']; } console.log(JSON.stringify(options, null, 2)); if (opt['--wpurl']) { wp = wordpress.createClient({ Loading Loading @@ -457,23 +461,13 @@ function processPage(pi) { theme.process($, opt); // if using Piwik, install it at the bottom of the page if (opt['--siteid']) { $('body').append(` <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//stats.oeru.org/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', ${opt['--siteid']}]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <noscript><p><img src="//stats.oeru.org/piwik.php?idsite=${opt['--siteid']}" style="border:0;" alt="" /></p></noscript> `); // if using analytics, install at the bottom of the page if (options.siteid) { options.tracker = options.tracker || "//stats.oeru.org"; $('#content').append(`[oeru_analytics type="piwik" url="${options.tracker}" id="${options.siteid}"]`); } if (options.google_analytics) { $('#content').append(`[oeru_analytics type="google" id="${options.google_analytics}"]`); } // save the page: to Wordpress or to filesystem Loading Loading
courseWP.js +11 −17 Original line number Diff line number Diff line Loading @@ -84,6 +84,10 @@ if (opt['--options']) { } }); } // move the old --siteid option into the new options map if (opt['--siteid']) { options.siteid = opt['--siteid']; } console.log(JSON.stringify(options, null, 2)); if (opt['--wpurl']) { wp = wordpress.createClient({ Loading Loading @@ -457,23 +461,13 @@ function processPage(pi) { theme.process($, opt); // if using Piwik, install it at the bottom of the page if (opt['--siteid']) { $('body').append(` <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//stats.oeru.org/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', ${opt['--siteid']}]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <noscript><p><img src="//stats.oeru.org/piwik.php?idsite=${opt['--siteid']}" style="border:0;" alt="" /></p></noscript> `); // if using analytics, install at the bottom of the page if (options.siteid) { options.tracker = options.tracker || "//stats.oeru.org"; $('#content').append(`[oeru_analytics type="piwik" url="${options.tracker}" id="${options.siteid}"]`); } if (options.google_analytics) { $('#content').append(`[oeru_analytics type="google" id="${options.google_analytics}"]`); } // save the page: to Wordpress or to filesystem Loading