Difference between revisions of "MediaWiki:Common.js"

From securityrouter.org, an OpenBSD-based firewall
Jump to: navigation, search
 
Line 43: Line 43:
 
   ga('create', 'UA-73635745-1', 'auto');
 
   ga('create', 'UA-73635745-1', 'auto');
 
   ga('send', 'pageview');
 
   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\"));"
 
}));
 

Latest revision as of 12:45, 28 August 2018

/* Any JavaScript here will be loaded for all users on every page load. */
// XXX Remember to change Mobile.js as well!
$(document).ready(function() {
  // Price
  if ($("#price-basic").length > 0) {
        $.ajax({
                url: "/price.php",
                dataType: "json",
                success: function(result) {
                        $("#price-803").text("$" + result["HSR-803"]);
                        $("#price-1204").text("$" + result["HSR-1204"]);
                        $("#price-1304").text("$" + result["HSR-1304"]);
                        $("#price-2006").text("$" + result["HSR-2006"]);
                        $("#price-2106").text("$" + result["HSR-2106"]);
                        $("#price-3008").text("$" + result["HSR-3008"]);
                        $("#price-3010").text("$" + result["HSR-3010"]);
                        $("#price-3116").text("$" + result["HSR-3116"]);
                        $("#price-lite").text("$" + result["VSR-Lite"]);
                        $("#price-basic").text("$" + result["VSR-Basic"]);
                        $("#price-plus").text("$" + result["VSR-Plus"]);
                        $("#price-unlimited").text("$" + result["VSR-Unlimited"]);
                        $("#price-update").text("$" + result["VSR-Update"] + " each");
                        $(".price-support").text("$" + result["Support"] + "/hour");
                        $("#price-basic-renewtext").text(" (for example $" + result["VSR-Basic-renew"] + " for basic)");
                        $("#price-renew").text("$" + result[$("#model").text() + "-renew"]);
                        $("#price-add-ipsec").text("$" + result["SR-ipsec"] + " each");
 	                $("#price-add-vlan").text("$" + result["SR-vlan"] + " each");
 	                $("#price-add-vpn").text("$" + result["SR-vpn"] + " each");
 	                $("#price-add-load-balancer").text("$" + result["SR-load-balancer"] + " each");
 	                $("#price-add-bgp").text("$" + result["SR-bgp"]);
	                $("#price-add-firewall-rules").text("$" + result["SR-firewall-rules"]);
                },
        });
  }
});

// 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-73635745-1', 'auto');
  ga('send', 'pageview');