Set active tab to Uniqueitems. header.php, set uniqueitems to first tab active.

ajax/uniqueitems.php, add save/delete functionality
app.js, handle save/delete calls
src/tabs/optionsubmit.php, add delete button
tabs/UniqueItems.php remove form action

Ajax save, and delete working.
This commit is contained in:
Hash Borgir
2023-05-30 13:12:19 -06:00
parent 961a061662
commit 1f7ac14963
5 changed files with 631 additions and 540 deletions

View File

@@ -61,7 +61,7 @@
</div>
<ul class="nav nav-tabs" id="Tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link" id="Unique-tab" data-toggle="tab" href="#Unique" role="tab" aria-controls="Unique" aria-selected="true">Unique Items</a>
<a class="nav-link active" id="Unique-tab" data-toggle="tab" href="#Unique" role="tab" aria-controls="Unique" aria-selected="true">Unique Items</a>
</li>
<!-- <li class="nav-item" role="presentation">
<a class="nav-link" id="Set-tab" data-toggle="tab" href="#Set" role="tab" aria-controls="Set" aria-selected="false">Set Items</a>
@@ -77,7 +77,7 @@
</li>
-->
<li class="nav-item" role="presentation">
<a class="nav-link active" id="Chars-tab" data-toggle="tab" href="#Chars" role="tab" aria-controls="Chars" aria-selected="false">Character Editor</a>
<a class="nav-link" id="Chars-tab" data-toggle="tab" href="#Chars" role="tab" aria-controls="Chars" aria-selected="false">Character Editor</a>
</li>
<li class="nav-item" role="presentation">
@@ -94,7 +94,7 @@
</div>
</div>
<div class="tab-content" id="TabContent">
<div class="tab-pane fade" id="Unique" role="tabpanel" aria-labelledby="Unique-tab">
<div class="tab-pane fade show active" id="Unique" role="tabpanel" aria-labelledby="Unique-tab">
<?php require_once 'tabs/UniqueItems.php'; ?>
</div>
<div class="tab-pane fade" id="Set" role="tabpanel" aria-labelledby="Set-tab">
@@ -113,7 +113,7 @@
<div class="tab-pane fade" id="Doc" role="tabpanel" aria-labelledby="Doc-tab">
<?php require_once 'tabs/Doc.php'; ?>
</div>
<div class="tab-pane fade show active" id="Chars" role="tabpanel" aria-labelledby="Chars-tab">
<div class="tab-pane fade" id="Chars" role="tabpanel" aria-labelledby="Chars-tab">
<?php require_once 'tabs/Chars.php'; ?>
</div>
<div class="tab-pane fade" id="Debug" role="tabpanel" aria-labelledby="Debug-tab">

View File

@@ -107,13 +107,13 @@
</select>
</div>
</div>
<form action="/saveD2ModderEditorData.php" method="post">
<form class="uniqueform" action="" method="post">
<div class="form-group row">
<div class="col-2" style="background: #fec;">
<p>Index</p>
<div class="input-group">
<input name="index" type="text" aria-describedby="indexHelpBlock" required="required" class="form-control">
<input name="index" type="text" aria-describedby="indexHelpBlock" required="required" class="form-control input-uindex">
</div><span class="help"><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
<span class="form-text">Index: the ID pointer that is referenced by the game in TreasureClassEx.txt and CubeMain.txt, this column also contains the string-key used in the TBL files.</span>

View File

@@ -1,6 +1,15 @@
<div class="row options" style="background: none;">
<div class="offset-10 col-2" style="background: none;">
<button style="" name="submit" type="submit" class="btn btn-success">SAVE</button>
<button name="submit" type="reset" class="btn btn-danger">CLEAR</button>
<button name="submit" type="submit" class="btn btn-success btn-save">SAVE</button>
<button name="submit" type="reset" class="btn btn-warning btn-clear">CLEAR</button>
<button name="submit" type="submit" class="btn btn-danger btn-delete">DELETE</button>
</div>
</div>
</div>
<!--<div class="row options" style="background: none;">
<div class="offset-10 col-2" style="background: none;">
<a href="" name="submit" type="submit" class="btn btn-success btn-save">SAVE</a>
<button name="submit" type="reset" class="btn btn-warning btn-clear">CLEAR</button>
<a href="" name="submit" class="btn btn-danger btn-delete">DELETE</a>
</div>
</div>-->