Skip to content

Commit

Permalink
More NEI support
Browse files Browse the repository at this point in the history
  • Loading branch information
onsubmit committed Mar 2, 2015
1 parent 71852e2 commit c2e186d
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 106 deletions.
16 changes: 5 additions & 11 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ h1, h2, h3, h4, h5, h6, p {
padding-bottom: 10px;
}

#craftingDialogTableContainer {
display: table;
margin: 0 auto;
}

#craftingTable, #craftingDialogTable {
empty-cells: show;
border-spacing: 0px;
float: left;
}

#craftingTable td, #craftingDialogTable td, td.craftingCell {
Expand Down Expand Up @@ -74,16 +78,6 @@ div.accept, div#craftingOutput, div #craftingDialogOutput {
text-shadow: 1px 1px #000;
}

#craftArrow {
padding: 0px 5px 0 5px;
float: left;
}

#craftDialogArrow {
padding: 10px 5px 0 5px;
float: left;
}

#craftingOutputTable, #craftingDialogOutputTable {
empty-cells: show;
border-spacing: 0px;
Expand Down
64 changes: 39 additions & 25 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,29 @@
<div id="leftColumn">
<div id="inventory" class="window">
<div id="craftingContainer">
<table id="craftingTable"></table>
<div id="craftingAction">
<div id="craftArrow">
<button id="clearCraft">x</button><br />
<img src="images/ArrowRight.png" />
</div>
<table id="craftingOutputTable">
<tr>
<td class="craftingCell"><div id="craftingOutput"></div></td>
<td>
<div id="craftingTakeContainer">
<input id="craftingTakeAmount" value="1" readonly="readonly"/>
</div>
</td>
</tr>
</table>
</div>
<table>
<tr>
<td>
<table id="craftingTable"></table>
</td>
<td style="vertical-align: middle">
<button id="clearCraft">x</button><br />
<img src="images/ArrowRight.png" />
</td>
<td>
<table id="craftingOutputTable">
<tr>
<td class="craftingCell"><div id="craftingOutput"></div></td>
<td>
<div id="craftingTakeContainer">
<input id="craftingTakeAmount" value="1" readonly="readonly"/>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="clearBoth"></div>
</div>
<div id="inventoryContainer" class="clearBoth">
Expand All @@ -60,7 +66,7 @@
<button id="options" class="big"><u>O</u>ptions</button>
</div>
<div id="itemTooltip">
<img id="itemTooltipIcon" class="floatRight" />
<img id="itemTooltipIcon" class="floatLeft" />
<p id="itemTooltipName"></p>
<ul id="itemMenu">
<li id="itemMenuRecipe"><a href="#">Recipe</a></li>
Expand Down Expand Up @@ -96,14 +102,22 @@
</div>
</div>
<div id="craftingDialog">
<table id="craftingDialogTable"></table>
<div id="craftingDialogAction">
<div id="craftDialogArrow">
<img src="images/ArrowRight.png" />
</div>
<table id="craftingDialogOutputTable">
<div id="craftingDialogTableContainer">
<table>
<tr>
<td class="craftingCell"><div id="craftingDialogOutput"></div></td>
<td>
<table id="craftingDialogTable"></table>
</td>
<td style="vertical-align: middle">
<img src="images/ArrowRight.png" />
</td>
<td>
<table id="craftingDialogOutputTable">
<tr>
<td class="craftingCell"><div id="craftingDialogOutput"></div></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
Expand Down
10 changes: 9 additions & 1 deletion js/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ if (!String.prototype.trimEnd)
}
}

if (!Array.prototype.contains)
{
Array.prototype.contains = function(item)
{
return ($.inArray(item, this) !== -1);
}
}

if (!Array.prototype.assignEach)
{
Array.prototype.assignEach = function(f)
Expand Down Expand Up @@ -63,7 +71,7 @@ if (!Array.prototype.pushUnique)
{
Array.prototype.pushUnique = function(item)
{
return this.pushIf($.inArray(item, this) === -1, item);
return this.pushIf(!this.contains(item), item);
}
}

Expand Down
Loading

0 comments on commit c2e186d

Please sign in to comment.