Widget:tileSearch: Difference between revisions
Jump to navigation
Jump to search
Initial setup |
Added document-ready wait functionality as the MediaWiki does not wait for DOM |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><script> | <includeonly><script> | ||
RLQ.push(function () { | RLQ.push(['jquery', function () { | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$('.userselectiongridtable td, .userselectionpositiontable td').click(function() { | $('.userselectiongridtable td, .userselectionpositiontable td').click(function() { | ||
Line 12: | Line 12: | ||
}); | }); | ||
}); | }); | ||
}); | }]); | ||
function refreshList() { | function refreshList() { | ||
var searchedData = getSearchData(); | var searchedData = getSearchData(); | ||
var searchKey = calculateTileKey(searchedData); | var searchKey = calculateTileKey(searchedData); | ||
Line 95: | Line 93: | ||
var arr = new Array(3); | var arr = new Array(3); | ||
arr[0] = new Array(3); | arr[0] = new Array(3); | ||
arr[0][ | arr[0][2] = row.data('tile1') == "1"; | ||
arr[0][1] = row.data('tile4') == "1"; | arr[0][1] = row.data('tile4') == "1"; | ||
arr[0][ | arr[0][0] = row.data('tile7') == "1"; | ||
arr[1] = new Array(3); | arr[1] = new Array(3); | ||
arr[1][ | arr[1][2] = row.data('tile2') == "1"; | ||
arr[1][1] = row.data('tile5') == "1"; | arr[1][1] = row.data('tile5') == "1"; | ||
arr[1][ | arr[1][0] = row.data('tile8') == "1"; | ||
arr[2] = new Array(3); | arr[2] = new Array(3); | ||
arr[2][ | arr[2][2] = row.data('tile3') == "1"; | ||
arr[2][1] = row.data('tile6') == "1"; | arr[2][1] = row.data('tile6') == "1"; | ||
arr[2][ | arr[2][0] = row.data('tile9') == "1"; | ||
return arr; | return arr; | ||
} | } | ||
Line 142: | Line 140: | ||
function getDollOffset(row) { | function getDollOffset(row) { | ||
if (row.data('tile2') == "0") return { x: -1, y: | if (row.data('tile2') == "0") return { x: -1, y: -2 }; | ||
if (row.data('tile3') == "0") return { x: -2, y: | if (row.data('tile3') == "0") return { x: -2, y: -2 }; | ||
if (row.data('tile4') == "0") return { x: 0, y: -1 }; | if (row.data('tile4') == "0") return { x: 0, y: -1 }; | ||
if (row.data('tile5') == "0") return { x: -1, y: -1 }; | if (row.data('tile5') == "0") return { x: -1, y: -1 }; | ||
if (row.data('tile6') == "0") return { x: -2, y: -1 }; | if (row.data('tile6') == "0") return { x: -2, y: -1 }; | ||
if (row.data('tile7') == "0") return { x: 0, y: | if (row.data('tile7') == "0") return { x: 0, y: 0 }; | ||
if (row.data('tile8') == "0") return { x: -1, y: | if (row.data('tile8') == "0") return { x: -1, y: 0 }; | ||
if (row.data('tile9') == "0") return { x: -2, y: | if (row.data('tile9') == "0") return { x: -2, y: 0 }; | ||
return { x: 0, y: | return { x: 0, y: -2 }; | ||
} | } | ||
</script> | </script> | ||
<div style="display:inline-block"> | <div style="display:inline-block"> | ||
<div | <div class="tileSearchDiv"> | ||
The doll should buff these fields:<br/> | |||
<table class="userselectiongridtable"> | <table class="userselectiongridtable"> | ||
<tbody> | <tbody> | ||
Line 176: | Line 175: | ||
</table> | </table> | ||
</div> | </div> | ||
<div class="tileSearchDiv"> | |||
<div | The doll may stand on these fields:<br/> | ||
<table class="userselectionpositiontable"> | <table class="userselectionpositiontable"> | ||
<tbody> | <tbody> | ||
<tr> | <tr> | ||
<td | <td class="active"></td> | ||
<td | <td class="active"></td> | ||
<td | <td class="active"></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td class="active"></td> | ||
<td | <td class="active"></td> | ||
<td | <td class="active"></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td class="active"></td> | ||
<td | <td class="active"></td> | ||
<td | <td class="active"></td> | ||
</tr> | </tr> | ||
</tbody> | </tbody> |
Latest revision as of 15:08, 14 October 2019
The doll should buff these fields:
The doll may stand on these fields: