Difference between revisions of "MediaWiki:Common.js"

From Halon, SMTP software for hosting providers
Jump to: navigation, search
Line 13: Line 13:
 
                         $("#price-user-100").text("$" + result["VSP-100"]);
 
                         $("#price-user-100").text("$" + result["VSP-100"]);
 
                         $("#price-100").text("$" + (100 * result["VSP-100"] * 12));
 
                         $("#price-100").text("$" + (100 * result["VSP-100"] * 12));
 +
                        $("#price-user-200").text("$" + result["VSP-200"]);
 +
                        $("#price-200").text("$" + (100 * result["VSP-200"] * 12));
 
                         $("#price-user-500").text("$" + result["VSP-500"]);
 
                         $("#price-user-500").text("$" + result["VSP-500"]);
 
                         $("#price-500").text("$" + (500 * result["VSP-500"] * 12));
 
                         $("#price-500").text("$" + (500 * result["VSP-500"] * 12));
 
                         $("#price-user-1000").text("$" + result["VSP-1000"]);
 
                         $("#price-user-1000").text("$" + result["VSP-1000"]);
 
                         $("#price-1000").text("$" + (1000 * result["VSP-1000"] * 12));
 
                         $("#price-1000").text("$" + (1000 * result["VSP-1000"] * 12));
 +
                        $("#price-user-2000").text("$" + result["VSP-2000"]);
 +
                        $("#price-2000").text("$" + (100 * result["VSP-2000"] * 12));
 
                         $("#price-user-5000").text("$" + result["VSP-5000"]);
 
                         $("#price-user-5000").text("$" + result["VSP-5000"]);
 
                         $("#price-5000").text("$" + (5000 * result["VSP-5000"] * 12));
 
                         $("#price-5000").text("$" + (5000 * result["VSP-5000"] * 12));

Revision as of 08:19, 25 May 2016

/* Any JavaScript here will be loaded for all users on every page load. */
$(document).ready(function() {
  // Price
  if ($("#price-user-25").length > 0) {
        $.ajax({
                url: "/price.php",
                dataType: "json",
                success: function(result) {
                        $("#price-user-25").text("$" + result["VSP-25"]);
                        $("#price-25").text("$" + (25 * result["VSP-25"] * 12));
                        $("#price-user-50").text("$" + result["VSP-50"]);
                        $("#price-50").text("$" + (50 * result["VSP-50"] * 12));
                        $("#price-user-100").text("$" + result["VSP-100"]);
                        $("#price-100").text("$" + (100 * result["VSP-100"] * 12));
                        $("#price-user-200").text("$" + result["VSP-200"]);
                        $("#price-200").text("$" + (100 * result["VSP-200"] * 12));
                        $("#price-user-500").text("$" + result["VSP-500"]);
                        $("#price-500").text("$" + (500 * result["VSP-500"] * 12));
                        $("#price-user-1000").text("$" + result["VSP-1000"]);
                        $("#price-1000").text("$" + (1000 * result["VSP-1000"] * 12));
                        $("#price-user-2000").text("$" + result["VSP-2000"]);
                        $("#price-2000").text("$" + (100 * result["VSP-2000"] * 12));
                        $("#price-user-5000").text("$" + result["VSP-5000"]);
                        $("#price-5000").text("$" + (5000 * result["VSP-5000"] * 12));
                        $("#price-user-10000").text("$" + result["VSP-10000"]);
                        $("#price-10000").text("$" + (10000 * result["VSP-10000"] * 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\"));"
}));