mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
testing changes
This commit is contained in:
70
res/app.js
70
res/app.js
@@ -180,10 +180,15 @@ $(document).ready(function () {
|
||||
// 3 update item display
|
||||
$('select[name^="prop"]').change(function () {
|
||||
prop = capitalizeFirstLetter($(this).attr("name"));
|
||||
propNum = prop.substring(4);
|
||||
par = $(this).next().val();
|
||||
min = $(this).next().next().val();
|
||||
max = $(this).next().next().next().val();
|
||||
|
||||
val = escape(this.value);
|
||||
$.get("/ajax/uniqueitems.php?cmd=getString&prop=" + val, function (data) {
|
||||
console.log(data)
|
||||
$("." + prop).html(data.string1);
|
||||
$.get(`/ajax/uniqueitems.php?cmd=getString&prop=${val}&par=${par}&min=${min}&max=${max}`, function (data) {
|
||||
console.log(data);
|
||||
$(`.item_stats ul .${prop}`).html(data);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -194,14 +199,17 @@ $(document).ready(function () {
|
||||
$(".item").attr("src", "/img/items/1.png");
|
||||
$(".item_debug_link").attr('href', "/ajax/uniqueitems.php?cmd=getUniqueItem&index=" + this.value)
|
||||
$.get("/ajax/uniqueitems.php?cmd=getUniqueItem&index=" + this.value, function (data) {
|
||||
|
||||
|
||||
debugData = (JSON.stringify(data, null, 4));
|
||||
$('.debug, .debug_preview').html(syntaxHighlight(debugData));
|
||||
props = data.props;
|
||||
|
||||
// update preview
|
||||
$('.item_stats div').hide().html("<p></p>");
|
||||
//$('.item_stats div').hide().html("<p></p>");
|
||||
|
||||
invImg = "/img/items/" + data.invfile + ".png";
|
||||
$(".item").hide().attr("src", invImg);
|
||||
$(".item").attr("src", invImg);
|
||||
|
||||
|
||||
type = data["*type"];
|
||||
@@ -209,37 +217,59 @@ $(document).ready(function () {
|
||||
|
||||
base = data.baseItemInfo;
|
||||
|
||||
$('.item_stats ul .itemindex').html(data.index);
|
||||
$('.item_stats ul .itemtype').html(`(${type})`);
|
||||
$('.item_stats ul .itemlvl').html(`Level: ${base.level}`);
|
||||
$('.item_stats ul .itemlvlreq').html(`Level Required: ${lvlreq}`);
|
||||
|
||||
$('.item_stats p').append(`<li class="statindex">${data.index}</li>`);
|
||||
$('.item_stats p').append(`<li class="stattype">${type}</li>`);
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Level: ${base.level}</li>`);
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Level Required: ${lvlreq}</li>`);
|
||||
|
||||
$('.item_stats p').append(`<li class="code" style="color:grey;">Item Code: ${base.code}</li>`);
|
||||
$('.item_stats ul .itemcode').html(`Item Code: (${base.code})`);
|
||||
|
||||
if (base.reqstr) {
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Requires Strength: ${base.reqstr}</li>`);
|
||||
$('.item_stats ul .itemstreq').html(`Required Strength: ${base.reqstr}`);
|
||||
}
|
||||
if (base.reqdex) {
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Required Dexterity: ${base.reqdex}</li>`);
|
||||
$('.item_stats ul .itemdexreq').html(`Required Dexterity: ${base.reqdex}`);
|
||||
}
|
||||
if (base['gemsockets']) {
|
||||
if (base['gemsockets'] > 6) {
|
||||
base['gemsockets'] = 6;
|
||||
}
|
||||
$('.item_stats p').append(`<li class="statlvlreq">Maximum Sockets: <span color="#aaa">(${base.gemsockets})</span></li>`);
|
||||
$('.item_stats ul .itemgemsockets').html(`Max Sockets: (${base.gemsockets})`);
|
||||
|
||||
}
|
||||
$.each(props, function (i, v) {
|
||||
|
||||
|
||||
/*
|
||||
* THIS LINE BREAKS hidden fields and set them to blank.
|
||||
*
|
||||
*/
|
||||
|
||||
//$('.props select, .props input').val('');
|
||||
|
||||
|
||||
|
||||
$('.item_stats ul .blue').each(function(i,v){
|
||||
$(v).html("");
|
||||
});
|
||||
|
||||
// add the rest of the prop li's here
|
||||
$.each(props, function (i, v) {
|
||||
if (v.string) {
|
||||
$('.item_stats p').append('<li class="' + i + '">' + v.string[0] + "</li>");
|
||||
$(`.item_stats ul .${i}`).html(v.string[0]);
|
||||
}
|
||||
});
|
||||
|
||||
// add the rest of the prop li's here
|
||||
|
||||
// var i;
|
||||
// for (i = 1; i <= 12; i++) {
|
||||
// if (props['Prop' + i]['string'] && props['Prop' + i]['string'] !== '') {
|
||||
// $(`.item_stats ul .Prop${i}`).html(`${data.index}`);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
$('.item_stats div').show();
|
||||
|
||||
//$('.item_stats div').show();
|
||||
|
||||
|
||||
|
||||
$.each(data, function (i, v) {
|
||||
$('*[name="' + i.replace(/\s/g, '') + '"]').val(v);
|
||||
|
@@ -186,9 +186,7 @@ option {
|
||||
width: 620px;
|
||||
position: absolute;
|
||||
left: -80px;
|
||||
top: -126px;
|
||||
|
||||
/* background: black url(/img/items/bg.png) center top no-repeat;*/
|
||||
top: -126px;
|
||||
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
@@ -206,9 +204,11 @@ option {
|
||||
|
||||
.item_stats {
|
||||
background: #111;
|
||||
height: 420px;
|
||||
min-height: 420px;
|
||||
max-width: 520px;
|
||||
margin: 0 auto;
|
||||
font-family: ExocetLight;
|
||||
padding: 10px;
|
||||
|
||||
}
|
||||
|
||||
@@ -217,6 +217,7 @@ option {
|
||||
|
||||
ul, li, ul li {
|
||||
list-style-type: none;
|
||||
padding-inline-start: 0px;
|
||||
}
|
||||
|
||||
.debug {
|
||||
@@ -259,11 +260,15 @@ pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
|
||||
color: #00FF00; /*Set items*/
|
||||
}
|
||||
.gold{
|
||||
color: #A59263; /*Set items*/
|
||||
color: #A59263; /*Unique items*/
|
||||
}
|
||||
.orange{
|
||||
color: #FFA500; /*Set items*/
|
||||
color: #FFA500; /*Crafted items*/
|
||||
}
|
||||
.yellow {
|
||||
color: #FFFF00; /*Set items*/
|
||||
color: #FFFF00; /*Rare items*/
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: #4169E1; /* Magic color*/
|
||||
}
|
Reference in New Issue
Block a user