mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
D2S Editing WIP
This commit is contained in:
58
res/app.js
58
res/app.js
@@ -1,29 +1,29 @@
|
||||
/*
|
||||
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
|
||||
|
||||
This file is part of D2Modder
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with
|
||||
or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
|
||||
* This software must not be used for commercial purposes
|
||||
* without my consent. Any sales or commercial use are prohibited
|
||||
* without my express knowledge and consent.
|
||||
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY!
|
||||
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
@@ -37,7 +37,7 @@
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
*/
|
||||
// highlight json dump for item debugger
|
||||
function syntaxHighlight(json) {
|
||||
@@ -97,7 +97,7 @@ $(document).ready(function () {
|
||||
});
|
||||
x = $(this).find('option:selected').text();
|
||||
$("*[name='*type']").val(x);
|
||||
$('.itemtype').html("("+x+")");
|
||||
$('.itemtype').html("(" + x + ")");
|
||||
|
||||
});
|
||||
$('.a-select').change(function () {
|
||||
@@ -107,7 +107,7 @@ $(document).ready(function () {
|
||||
});
|
||||
x = $(this).find('option:selected').text();
|
||||
$("*[name='*type']").val(x);
|
||||
$('.itemtype').html("("+x+")");
|
||||
$('.itemtype').html("(" + x + ")");
|
||||
});
|
||||
$('.m-select').change(function () {
|
||||
$('.w-select,.a-select').each(function (i, v) {
|
||||
@@ -116,7 +116,7 @@ $(document).ready(function () {
|
||||
});
|
||||
x = $(this).find('option:selected').text();
|
||||
$("*[name='*type']").val(x);
|
||||
$('.itemtype').html("("+x+")");
|
||||
$('.itemtype').html("(" + x + ")");
|
||||
});
|
||||
|
||||
$(".btnconfig").click(function () {
|
||||
@@ -322,5 +322,37 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
|
||||
// Chars.php Character Editor AJAXIFY
|
||||
// Prevent default form submit
|
||||
$('form').submit(function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
$(".wpcheck").change(function () {
|
||||
// Toggle the value between 0 and 1
|
||||
var value = $(this).is(":checked") ? 1 : 0;
|
||||
|
||||
// Get the name of the checkbox
|
||||
var name = $(this).attr("name");
|
||||
|
||||
// Get the name of the difficulty
|
||||
var diff = $(this).attr("diff");
|
||||
|
||||
// Get the value of the input named "filePath"
|
||||
var filePath = $("input[name='filePath']").val();
|
||||
|
||||
// Construct the URL for the GET request
|
||||
var url = "/saveCharacter.php?cmd=wp&name=" + name + "&value=" + value + "&filePath=" + filePath + "&diff=" + diff;
|
||||
|
||||
|
||||
// Send the GET request
|
||||
$.get(url, function (response) {
|
||||
// Handle the response if needed
|
||||
console.log(response);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});// end document.ready
|
Reference in New Issue
Block a user