Difference between revisions of "MediaWiki:Common.js"

From Halon, SMTP software for hosting providers
Jump to: navigation, search
Line 40: Line 40:
 
   })();
 
   })();
  
/* $.getScript("http://gateway02.whoson.ch/include.js?domain=www.halon.se", function() {
+
$.ajaxSetup({async:false});
 +
  $.getScript("http://gateway02.whoson.ch/include.js?domain=www.halon.se", function() {
 
     sWOResponse='';
 
     sWOResponse='';
 
     sWOInvite='N';
 
     sWOInvite='N';
 
     if(typeof sWOTrackPage=='function')sWOTrackPage();
 
     if(typeof sWOTrackPage=='function')sWOTrackPage();
   });*/
+
   });
 
 
        var sWO={};
 
                sWO.i =  function()  {if (typeof(woAfterLoad) == 'function') {woAfterLoad(); woAfterLoad = null;}}
 
        sWO.o = function() { if (typeof(sWOInvite)=='undefined'||sWOInvite=='') {return;} sWOInvite='';sWOTrackPage();
 
            var iog = document.createElement('script');
 
            iog.type = 'text/javascript';
 
            iog.async = true;
 
            iog.onload = sWO.i;
 
                    iog.onreadystatechange = function () {
 
                                if (this.readyState == 'loaded' || this.readyState == 'complete') sWO.i();
 
                                };
 
            iog.src='http://gateway02.whoson.ch/include.js?domain=www.halon.se'
 
            var s = document.getElementsByTagName('body')[0];
 
            s.appendChild(iog, s);
 
            }
 
        sWO.f = function() { var wog = document.createElement('script');
 
            wog.type = 'text/javascript';
 
            wog.async = true;
 
            wog.onload = sWO.o;
 
            wog.onreadystatechange = function () { if (this.readyState == 'loaded' || this.readyState == 'complete') sWO.o(); };
 
            wog.src = 'http://gateway02.whoson.ch/include.js?domain=www.halon.se'
 
            var s = document.getElementsByTagName('script')[0];
 
            s.parentNode.insertBefore(wog, s);
 
            };
 
        if (window.attachEvent) {window.attachEvent('onload', sWO.f);} else {window.addEventListener('load',sWO.f,false)}
 

Revision as of 10:07, 29 October 2013

/* 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("$" + (25 * result["VSP-50"] * 12));
                        $("#price-user-100").text("$" + result["VSP-100"]);
                        $("#price-100").text("$" + (100 * result["VSP-100"] * 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-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));
                },
        });
  }
});

  var _gaq = _gaq || [];
  var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
  _gaq.push(['_require', 'inpage_linkid', pluginUrl]);
  _gaq.push(['_setAccount', 'UA-20664476-2']);
  _gaq.push(['_setDomainName', 'halon.se']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

$.ajaxSetup({async:false});
  $.getScript("http://gateway02.whoson.ch/include.js?domain=www.halon.se", function() {
    sWOResponse='';
    sWOInvite='N';
    if(typeof sWOTrackPage=='function')sWOTrackPage();
  });