Difference between revisions of "MediaWiki:Calculator.js"
m |
m |
||
Line 31: | Line 31: | ||
importScript('MediaWiki:Calculator.js/Luck.js'); | importScript('MediaWiki:Calculator.js/Luck.js'); | ||
break; | break; | ||
− | case ' | + | case 'Mana Regeneration': |
importScript('MediaWiki:Calculator.js/Mana_Regeneration.js'); | importScript('MediaWiki:Calculator.js/Mana_Regeneration.js'); | ||
break; | break; | ||
} | } |
Revision as of 11:50, 4 May 2010
/** * Code for calculators. */ var Calculator = Class.extend({ init: function(content, id, title, columns) { var location = document.getElementById(id); var table = document.createElement('table'); table.className = 'uoguidetable open'; var calcTableBody = document.createElement('tbody'); table.appendChild(calcTableBody); var calcTableRow = document.createElement('tr'); calcTableBody.appendChild(calcTableRow); var calcTableHeader = document.createElement('th'); calcTableHeader.colSpan = columns; calcTableHeader.appendChild(document.createTextNode(title)); calcTableRow.appendChild(calcTableHeader); calcTableRow = content; calcTableBody.appendChild(calcTableRow); location.appendChild(table); } }); switch (wgPageName) { case 'Luck': importScript('MediaWiki:Calculator.js/Luck.js'); break; case 'Mana Regeneration': importScript('MediaWiki:Calculator.js/Mana_Regeneration.js'); break; }