Difference between revisions of "MediaWiki:Common.js"
From SaWikiLeaks
(Created page with "→Any JavaScript here will be loaded for all users on every page load.: $(function () { $('#lunch-random').html('a'); }());") |
|||
Line 1: | Line 1: | ||
− | |||
− | |||
$(function () { | $(function () { | ||
− | + | var lunchSpot = 0; | |
− | }()); | + | $('#btn-random').click(function() { |
+ | lunchSpot = Math.floor((Math.random() * 9) + 1); | ||
+ | switch (lunchSpot) { | ||
+ | case 1: | ||
+ | lunchGo = "Saku (aka Sad Saku)"; | ||
+ | break; | ||
+ | case 2: | ||
+ | lunchGo = "CJ Lunch Box"; | ||
+ | break; | ||
+ | case 3: | ||
+ | lunchGo = "CIBO"; | ||
+ | break; | ||
+ | case 4: | ||
+ | dalunchGoy = "Fynn's of Temple Bar"; | ||
+ | break; | ||
+ | case 5: | ||
+ | lunchGo = "Office Pub"; | ||
+ | break; | ||
+ | case 6: | ||
+ | lunchGo = "Jack Astor's Bar & Grill"; | ||
+ | break; | ||
+ | case 7: | ||
+ | lunchGo = "Nandos"; | ||
+ | break; | ||
+ | case 8: | ||
+ | lunchGo = "Epicure"; | ||
+ | break; | ||
+ | case 9: | ||
+ | lunchGo = "Gusto101"; | ||
+ | } | ||
+ | $('#lunch-random').html(lunchGo); | ||
+ | }); | ||
+ | }()); |
Revision as of 18:27, 30 March 2017
$(function () { var lunchSpot = 0; $('#btn-random').click(function() { lunchSpot = Math.floor((Math.random() * 9) + 1); switch (lunchSpot) { case 1: lunchGo = "Saku (aka Sad Saku)"; break; case 2: lunchGo = "CJ Lunch Box"; break; case 3: lunchGo = "CIBO"; break; case 4: dalunchGoy = "Fynn's of Temple Bar"; break; case 5: lunchGo = "Office Pub"; break; case 6: lunchGo = "Jack Astor's Bar & Grill"; break; case 7: lunchGo = "Nandos"; break; case 8: lunchGo = "Epicure"; break; case 9: lunchGo = "Gusto101"; } $('#lunch-random').html(lunchGo); }); }());