Difference between revisions of "MediaWiki:Common.js"

From Halon, SMTP software for hosting providers
Jump to: navigation, search
Line 33: Line 33:
  
 
// Google Analytics
 
// Google Analytics
 +
/*
 
   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 
   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 
   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
 
   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
Line 40: Line 41:
 
   ga('create', 'UA-20664476-4', 'auto');
 
   ga('create', 'UA-20664476-4', 'auto');
 
   ga('send', 'pageview');
 
   ga('send', 'pageview');
 
+
*/
 
// WhosOn
 
// WhosOn
 +
/*
 
$("body").append($("<script />", {
 
$("body").append($("<script />", {
 
   html: "document.write(unescape(\"%3Cscript src='\" + document.location.protocol + \"//gateway02.whoson.ch/include.js?domain=www.halon.se' charset='utf-8' type='text/javascript'%3E%3C/script%3E\"));"
 
   html: "document.write(unescape(\"%3Cscript src='\" + document.location.protocol + \"//gateway02.whoson.ch/include.js?domain=www.halon.se' charset='utf-8' type='text/javascript'%3E%3C/script%3E\"));"
Line 47: Line 49:
 
$("body").append($("<script />", {
 
$("body").append($("<script />", {
 
   html: "document.write(unescape(\"%3Cscript charset='utf-8' type='text/javascript'%3EsWOResponse='';sWOInvite='N';if(typeof sWOTrackPage=='function')sWOTrackPage();%3C/script%3E\"));"
 
   html: "document.write(unescape(\"%3Cscript charset='utf-8' type='text/javascript'%3EsWOResponse='';sWOInvite='N';if(typeof sWOTrackPage=='function')sWOTrackPage();%3C/script%3E\"));"
 +
*/
 +
 +
 
}));
 
}));

Revision as of 21:29, 16 January 2018

/* Any JavaScript here will be loaded for all users on every page load. */
var levels = [25, 50, 100, 200, 500, 1000, 2000, 5000, 10000];
$(document).ready(function() {
  // Price
  if ($("#price-user-25").length > 0) {
        $.ajax({
                url: "/price.php",
                dataType: "json",
                success: function(result) {
                        $.each(levels, function (key, val) {
                            $("#price-user-" + val).text("$" + result["VSP-" + val]);
                        });
                },
        });
  }
  if ($("#price-10").length > 0) {
     var examples = [10, 40, 75, 150, 300, 750, 1500, 3000, 7500];
     $.each(examples, function (key, val) {
         pricecalc(val);
     });
  }
});

function pricecalc(users) {
        $.ajax({
                url: "/price.php?u=" + users,
                dataType: "json",
                success: function(result) {
                        $("#price-"+users).text("$" + parseInt(result * users * 12));
                },
        });
}

// Google Analytics
/*
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-20664476-4', 'auto');
  ga('send', 'pageview');
*/
// WhosOn
/*
$("body").append($("<script />", {
  html: "document.write(unescape(\"%3Cscript src='\" + document.location.protocol + \"//gateway02.whoson.ch/include.js?domain=www.halon.se' charset='utf-8' type='text/javascript'%3E%3C/script%3E\"));"
}));
$("body").append($("<script />", {
  html: "document.write(unescape(\"%3Cscript charset='utf-8' type='text/javascript'%3EsWOResponse='';sWOInvite='N';if(typeof sWOTrackPage=='function')sWOTrackPage();%3C/script%3E\"));"
*/


}));