Widget:TriviaText: Difference between revisions

From Unforgotten Realms Wiki
Jump to navigationJump to search
imported>Pillowkeeper
mNo edit summary
imported>Pillowkeeper
No edit summary
Line 10: Line 10:
var list = new Array();
var list = new Array();


list[0] = "<!--{$text|escape:'html'}-->"
<!--{foreach from=$text item=text}-->
list[1] = "<a href=\"https://wiki.urealms.com/wiki/Kallark\">Kallark</a> has a pot puppy named <b>Annihilus the Living Death That Walks</b>";
list.push("<!--{$text|escape:'html'}-->");
list[2] = "<b><a href=\"https://wiki.urealms.com/wiki/Kallark\">Slippery Knuckles Malone</a></b> does not recall his original name";
<!--{/foreach}-->
list[3] = "</b><a href=\"https://wiki.urealms.com/wiki/Thor\">Thor</a></b> is the son of <a href=\"https://wiki.urealms.com/wiki/Dragon_Aspect\">Dragon Aspect</a> <a href=\"https://wiki.urealms.com/wiki/Ouro'ras\">Ouro'ras</a> and is the creator of many races in the Realms";
list[4] = "<a href=\"https://wiki.urealms.com/wiki/Alessa_Stonemason\">Alessa Stonemason</a> is a reference to <b>Alessa Gillespie</b> of the Silent Hill franchise";
list[5] = "No one knows how <a href=\"https://wiki.urealms.com/wiki/Gnome\">Gnomes</a> came to be";
list[6] = "Before the <a href=\"https://wiki.urealms.com/wiki/Lore#The_Great_Hatching\">Birth of Magic</a>, the world was a <i>Utopia</i> in which no one could die";
list[7] = "<a href=\"https://wiki.urealms.com/wiki/Ghana_Ens_Sin\">Ghana Ens Sin</a> is an anagram of <i>shenanigans</i>.";
list[8] = "<a href=\"https://wiki.urealms.com/wiki/Alessa_Stonemason\">Alessa Stonemason</a> broke her bow after thinking she <i>killed</i> her daughter.";


var fin = list.length;
var fin = list.length;

Revision as of 18:07, 22 December 2016

  • <script> window.addEventListener("load", function () { var list = new Array(); list.push(""); var fin = list.length; for (j = 0; j < 6; j++){ var ul = document.getElementById("trivia" + j); var i = Math.floor(Math.random() * list.length); ul.insertAdjacentHTML( 'beforeend', list[i] ); var index = list.indexOf(list[i]); if (index > -1){ list.splice(index, 1); } } }); </script>