Difference between revisions of "MediaWiki:Common.js"

From TAMI
Jump to navigationJump to search
Line 8: Line 8:
 
towtruck_script.setAttribute("type","text/javascript");
 
towtruck_script.setAttribute("type","text/javascript");
 
towtruck_script.setAttribute("src", "https://towtruck.mozillalabs.com/towtruck.js");
 
towtruck_script.setAttribute("src", "https://towtruck.mozillalabs.com/towtruck.js");
 +
document.getElementsByTagName("head")[0].appendChild(towtruck_script);
 
var towtruck_button = document.createElement("button");
 
var towtruck_button = document.createElement("button");
 
towtruck_button.setAttribute("onclick", "TowTruck(this); return false;")
 
towtruck_button.setAttribute("onclick", "TowTruck(this); return false;")
 
towtruck_button.innerHTML = "Start Collaborating";
 
towtruck_button.innerHTML = "Start Collaborating";
 
document.getElementById("p-navigation").getElementsByTagName("div")[0].appendChild(towtruck_button);
 
document.getElementById("p-navigation").getElementsByTagName("div")[0].appendChild(towtruck_button);

Revision as of 08:29, 19 September 2013

/* Any JavaScript here will be loaded for all users on every page load. */
var tami_is_using_common_js = 1;

// Set to false or delete to disable analytics/tracking:
TowTruckConfig_enableAnalytics = true;

var towtruck_script = document.createElement("script");
towtruck_script.setAttribute("type","text/javascript");
towtruck_script.setAttribute("src", "https://towtruck.mozillalabs.com/towtruck.js");
document.getElementsByTagName("head")[0].appendChild(towtruck_script);
var towtruck_button = document.createElement("button");
towtruck_button.setAttribute("onclick", "TowTruck(this); return false;")
towtruck_button.innerHTML = "Start Collaborating";
document.getElementById("p-navigation").getElementsByTagName("div")[0].appendChild(towtruck_button);