Difference between revisions of "MediaWiki:Common.js"

From TAMI
Jump to navigationJump to search
Line 20: Line 20:
  
 
/*************************************************************/
 
/*************************************************************/
/* */
+
/* Set TAMI title to random (*) word starting with I        */
 
/*************************************************************/
 
/*************************************************************/
  
Line 35: Line 35:
 
         "Incredible",
 
         "Incredible",
 
         "Improvement",
 
         "Improvement",
         "Israel", "Ideal", "Indomitable", "I", "Igneous", "Incontinent"];
+
         "Israel", "Ideal", "Indomitable", "I", "Igneous", "Incontinent",
 +
        "Ifsoever", "Imminent", "Immanent", "Immunodeficient", "Inconvertible",
 +
        "Incontrovertible", "Inception", "Infinite", "Impish", "Indubitable",
 +
        "Ingenious", "Incontinent", "Inspiring", "Inkfilled", "Invaded", "Ionized",
 +
        "Irresistable", "Isochloric", "Isobath", "Isomagnetic",
 +
        "Industrious", "Inconvincible", "Inexpert", "Intrest-group"
 +
        ];
 
     var n = titles.length;
 
     var n = titles.length;
 
     var i = 0;
 
     var i = 0;
 
     var change_title = function() {
 
     var change_title = function() {
 
         title_element.innerHTML = "Welcome to Tel Aviv Makers " + titles[i] + " hackerspace!";
 
         title_element.innerHTML = "Welcome to Tel Aviv Makers " + titles[i] + " hackerspace!";
         i = i + 1;
+
         i = Math.floor((Math.random() * n));
 
     }
 
     }
     setInterval(change_title, 2000);
+
     setInterval(change_title, 60000);
 
}
 
}
 
title_changer();
 
title_changer();

Revision as of 19:08, 2 January 2015

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

/**************************************************************/
/* Add Tow Truck botton (Start Collaborating) on the menu     */
/**************************************************************/
// 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";
towtruck_button.style.fontSize = "0.75em";
document.getElementById("p-navigation").getElementsByTagName("div")[0].appendChild(towtruck_button);

/*************************************************************/
/* Set TAMI title to random (*) word starting with I         */
/*************************************************************/

function title_changer()
{
    var title_element = document.getElementById("Welcome_to_Tel_Aviv_Makers_Insurgence_hackerspace.21");
    if (title_element === undefined) {
        //console.log("someone broke the fun script (or just not the main page)");
        return;
    }
    var titles = [
        "Insurgents",
        "Insurmountable", "Interconnected", "Intergalactic",
        "Incredible",
        "Improvement",
        "Israel", "Ideal", "Indomitable", "I", "Igneous", "Incontinent",
        "Ifsoever", "Imminent", "Immanent", "Immunodeficient", "Inconvertible",
        "Incontrovertible", "Inception", "Infinite", "Impish", "Indubitable",
        "Ingenious", "Incontinent", "Inspiring", "Inkfilled", "Invaded", "Ionized",
        "Irresistable", "Isochloric", "Isobath", "Isomagnetic",
        "Industrious", "Inconvincible", "Inexpert", "Intrest-group"
        ];
    var n = titles.length;
    var i = 0;
    var change_title = function() {
        title_element.innerHTML = "Welcome to Tel Aviv Makers " + titles[i] + " hackerspace!";
        i = Math.floor((Math.random() * n));
    }
    setInterval(change_title, 60000);
}
title_changer();