Actions

MediaWiki

Common.js: Difference between revisions

From Necroxia Origin

mNo edit summary
m (Replaced content with "→‎Any JavaScript here will be loaded for all users on every page load.: mw.loader.load( '/w/index.php?title=MediaWiki:UrsagrodonTeleportCalculator.js&action=raw&ctype=t...")
Tag: Replaced
 
(44 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
$("#testdiv").each(function() {
mw.loader.load( '/w/index.php?title=MediaWiki:UrsagrodonTeleportCalculator.js&action=raw&ctype=text/javascript' );
var parent = $(this);
//var inputs = ['currentRoom', 'currentCount', 'answerNumber'];
var inputs = [
['currentRoom', 1, 32, 1], ['currentCount', 0, 999, 0], ['answerNumber', 31, 93, 77]
];
//var d = document.createElement('div');
for (i = 0; i < inputs.length; i++) {
$(this).append("<input type='number' id='" + inputs[i][1] + "' name='"+inputs[i][1]+"' min='"+inputs[i][2]+"' max='"+inputs[i][3]+"' value='"+inputs[i][4]+"' maxLength='4' style='width:70px'/>");
$(this).append("<br> id="+inputs[i][1]+" name="+inputs[i][1]+" min="+inputs[i][2]+" max="+inputs[i][3]+" value="+inputs[i][4]);
}
$(this).append("<button onclick='getPossibleTeleports()'>getChance</button>");
var currentRoom = $('#currentRoom').val();
$(this).append("<br>"+currentRoom);
$(this).append("<br> " + $("input[id=currentRoom]").value);
});
 
function getPossibleTeleports() {
var currentRoom = $('#currentRoom').val();
$(parent).append("<br>"+currentRoom);
}

Latest revision as of 12:08, 1 September 2020

/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.load( '/w/index.php?title=MediaWiki:UrsagrodonTeleportCalculator.js&action=raw&ctype=text/javascript' );