Skip to content

Commit

Permalink
Update Bootstrap, DataTables, Select2
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Aug 31, 2024
1 parent 06f8b6d commit e94547e
Show file tree
Hide file tree
Showing 37 changed files with 416 additions and 1,141 deletions.
10 changes: 5 additions & 5 deletions Controllers/CASCController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public async Task<string> MoreInfo(int filedataid)

if (CASC.FDIDToCHash.TryGetValue(filedataid, out var cKey))
{
html += "<tr><td>Content hash (MD5)</td><td style='font-family: monospace;'><a href='#' data-toggle='modal' data-target='#chashModal' onClick='fillChashModal(\"" + cKey.ToLower() + "\")'>" + cKey.ToLower() + "</a></td></tr>";
html += "<tr><td>Content hash (MD5)</td><td style='font-family: monospace;'><a href='#' data-bs-toggle='modal' data-bs-target='#chashModal' onClick='fillChashModal(\"" + cKey.ToLower() + "\")'>" + cKey.ToLower() + "</a></td></tr>";
html += "<tr><td>Size</td><td>" + (CASC.CHashToSize.TryGetValue(cKey, out long size) ? size + " bytes" : "N/A") + "</td></tr>";
}

Expand Down Expand Up @@ -840,7 +840,7 @@ public async Task<string> MoreInfo(int filedataid)
html += "<table class='table table-striped'><thead><tr><th>Build</th><th>Content hash</th></tr></thead>";
foreach (var version in versions)
{
html += "<tr><td>" + version.buildName + "</td><td><a href='#' data-toggle='modal' data-target='#chashModal' onClick='fillChashModal(\"" + version.contentHash.ToLower() + "\")'>" + version.contentHash.ToLower() + "</a></td></tr>";
html += "<tr><td>" + version.buildName + "</td><td><a href='#' data-bs-toggle='modal' data-bs-target='#chashModal' onClick='fillChashModal(\"" + version.contentHash.ToLower() + "\")'>" + version.contentHash.ToLower() + "</a></td></tr>";
}
html += "</table>";
}
Expand Down Expand Up @@ -882,12 +882,12 @@ public string DiffFile(int fileDataID, string from, string to, bool json = false
{
html = "<ul class='nav nav-tabs' id='diffTabs' role='tablist'>";
html += "<li class='nav-item'>";
html += "<a class='nav-link active' id='sbs-tab' data-toggle='tab' href='#sbs' role='tab' aria-controls='sbs' aria-selected='true'>Side-by-Side</a>";
html += "<a class='nav-link active' id='sbs-tab' data-bs-toggle='tab' href='#sbs' role='tab' aria-controls='sbs' aria-selected='true'>Side-by-Side</a>";
html += "</li>";
html += "<li class='nav-item'>";
html += "<a class='nav-link' id='toggle-tab' data-toggle='tab' href='#toggle' role='tab' aria-controls='toggle' aria-selected='false'>Switcher</a>";
html += "<a class='nav-link' id='toggle-tab' data-bs-toggle='tab' href='#toggle' role='tab' aria-controls='toggle' aria-selected='false'>Switcher</a>";
html += "</li>";
//html += "<li class='nav-item'><a class='nav-link' id='imagediff-tab' data-toggle='tab' href='#imagediff' role='tab' aria-controls='imagediff' aria-selected='false'>Diff</a>";
//html += "<li class='nav-item'><a class='nav-link' id='imagediff-tab' data-bs-toggle='tab' href='#imagediff' role='tab' aria-controls='imagediff' aria-selected='false'>Diff</a>";
//html += "</li>";
html += "</ul>";
html += "<div class='tab-content'>";
Expand Down
9 changes: 9 additions & 0 deletions Controllers/WDBController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using wow.tools.local.Services;
using WoWFormatLib.FileReaders;

namespace wow.tools.local.Controllers
{
Expand Down Expand Up @@ -40,5 +41,13 @@ public DataTablesResult CreatureTable(int draw, int start, int length)

return result;
}

[Route("quests")]
[HttpGet]
public string QuestDebug()
{
var questWDB = WDBReader.Read("C:\\World of Warcraft\\_retail_\\Cache\\WDB\\enUS\\questcache.wdb", "11.0.2.56196");
return questWDB.ToString();
}
}
}
1 change: 1 addition & 0 deletions wow.tools.local.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<Content Remove="versionHistory.json" />
<Content Remove="wwwroot\db\broadcasttext.html" />
<Content Remove="wwwroot\db\creatures.html" />
<Content Remove="wwwroot\db\quests.html" />
<Content Remove="wwwroot\files\naming.html" />
<Content Remove="wwwroot\header.html" />
</ItemGroup>
Expand Down
40 changes: 15 additions & 25 deletions wwwroot/builds/diff.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html data-bs-theme="dark">
<head>
<title>WoW.tools</title>
<meta property='og:type' content='website'>
Expand Down Expand Up @@ -101,7 +101,6 @@
data: 'type'
}
],
pagingType: "input",
pageLength: 25,
autoWidth: false,
deferRender: true,
Expand Down Expand Up @@ -129,7 +128,7 @@
{
"targets": 4,
"render": function (data, type, full, meta) {
return "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer' data-toggle='modal' data-target='#moreInfoModal' onClick='fillModal(" + full.id + ")'><i class='fa fa-info-circle'></i></a></td>";
return "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer' data-bs-toggle='modal' data-bs-target='#moreInfoModal' onClick='fillModal(" + full.id + ")'><i class='fa fa-info-circle'></i></a></td>";
}
},
{
Expand All @@ -153,21 +152,21 @@
//}

if (previewTypes.includes(full.type)) {
content = "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillPreviewModal(\"\"," + full.id + "\,\"" + full.type + "\")'><i class='fa fa-eye'></i></a>";
content = "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer' data-bs-toggle='modal' data-bs-target='#previewModal' onClick='fillPreviewModal(\"\"," + full.id + "\,\"" + full.type + "\")'><i class='fa fa-eye'></i></a>";
} else {
content = "<i class='fa fa-ban' style='opacity: 0.3'></i>";
}

if (full.md5 == "de6135861a6cacfe176830f18f597c3e") {
content += " <span style='float: right'><a tabindex='0' role='button' data-trigger='hover' data-container='body' data-html='true' data-toggle='popover' data-placement='top' style='color: ;' data-content='<b>Placeholder audio</b><br> This file has no audio yet'><span class='fa-stack'><i class='fa fa-volume-off fa-stack-1x'></i><i class='fa fa-ban fa-stack-1x text-danger'></i></span></i></a></span>";
content += " <span style='float: right'><a tabindex='0' role='button' data-bs-trigger='hover' data-bs-container='body' data-bs-html='true' data-bs-toggle='popover' data-bs-placement='top' style='color: ;' data-bs-content='<b>Placeholder audio</b><br> This file has no audio yet'><span class='fa-stack'><i class='fa fa-volume-off fa-stack-1x'></i><i class='fa fa-ban fa-stack-1x text-danger'></i></span></i></a></span>";
}
break;
case "modified":
switch (full.type) {
case "db2":
if (full.filename && full.filename != "Unknown") {
var db2name = full.filename.toLowerCase().replace("dbfilesclient/", "").replace(".db2", "");
content = "<a style='cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillDBCDiffModal(\"" + from + "\", \"" + to + "\", \"" + db2name + "\")'>Preview</a>";
content = "<a style='cursor: pointer' data-bs-toggle='modal' data-bs-target='#previewModal' onClick='fillDBCDiffModal(\"" + from + "\", \"" + to + "\", \"" + db2name + "\")'>Preview</a>";

}
break;
Expand All @@ -182,35 +181,35 @@
case "xml":
case "xsd":
case "wtf":
content = "<a style='cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillDiffModal(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Preview</a>";
content = "<a style='cursor: pointer' data-bs-toggle='modal' data-bs-target='#previewModal' onClick='fillDiffModal(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Preview</a>";
break;
case "wmo":
case "m2":
content = "<a style='cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillDiffModalJSON(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Diff</a>";
content = "<a style='cursor: pointer' data-bs-toggle='modal' data-bs-target='#previewModal' onClick='fillDiffModalJSON(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Diff</a>";
break;
case "wdt":
if (full.filename.endsWith("_fogs.wdt") || full.filename.endsWith("_occ.wdt") || full.filename.endsWith("_lgt.wdt") || full.filename.endsWith("_mpv.wdt")) {
content = "N/A";
} else {
content = "<a style='cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillDiffModalJSON(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Diff</a>";
content = "<a style='cursor: pointer' data-bs-toggle='modal' data-bs-target='#previewModal' onClick='fillDiffModalJSON(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Diff</a>";
}
case "adt":
if (full.filename.endsWith("_tex0.adt") || full.filename.endsWith("_obj0.adt") || full.filename.endsWith("_obj1.adt") || full.filename.endsWith("_lod.adt")) {
content = "N/A";
} else {
content = "<a style='cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillDiffModalJSON(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Diff</a>";
content = "<a style='cursor: pointer' data-bs-toggle='modal' data-bs-target='#previewModal' onClick='fillDiffModalJSON(\"" + from + "\", \"" + to + "\", \"" + full.id + "\")'>Diff</a>";
}
break;
//case "ogg":
// content = "<a style='cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillPreviewModalByContenthash(\"<?= $toBuild['hash'] ?>\", \"" + full.id + "\",\"" + full.md5 + "\")'>Preview</a>";
// content = "<a style='cursor: pointer' data-bs-toggle='modal' data-bs-target='#previewModal' onClick='fillPreviewModalByContenthash(\"<?= $toBuild['hash'] ?>\", \"" + full.id + "\",\"" + full.md5 + "\")'>Preview</a>";
// break;
default:
content = "N/A";
break;
}

if (full.md5 == "de6135861a6cacfe176830f18f597c3e" || full.md5 == "ea80e802952501021865cfeed808ac3f") {
content += " <span style='float: right'><a tabindex='0' role='button' data-trigger='hover' data-container='body' data-html='true' data-toggle='popover' data-placement='top' style='color: ;' data-content='<b>Placeholder audio</b><br> This file has no audio yet'><span class='fa-stack'><i class='fa fa-volume-off fa-stack-1x'></i><i class='fa fa-ban fa-stack-1x text-danger'></i></span></i></a></span>";
content += " <span style='float: right'><a tabindex='0' role='button' data-bs-trigger='hover' data-bs-container='body' data-bs-html='true' data-bs-toggle='popover' data-bs-placement='top' style='color: ;' data-bs-content='<b>Placeholder audio</b><br> This file has no audio yet'><span class='fa-stack'><i class='fa fa-volume-off fa-stack-1x'></i><i class='fa fa-ban fa-stack-1x text-danger'></i></span></i></a></span>";
}
break;
case "removed":
Expand Down Expand Up @@ -269,7 +268,7 @@
});
},
"drawCallback": function () {
$('[data-toggle="popover"]').popover();
$('[data-bs-toggle="popover"]').popover();
}
});

Expand Down Expand Up @@ -307,15 +306,12 @@ <h3>Showing differences between <span id="fromBuildName"></span> and <span id="t
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="moreInfoModalLabel">More information</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="moreInfoModalContent">
<i class="fa fa-refresh fa-spin" style="font-size:24px"></i>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
Expand All @@ -325,15 +321,12 @@ <h5 class="modal-title" id="moreInfoModalLabel">More information</h5>
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="previewModalLabel">Preview</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="previewModalContent">
<i class="fa fa-refresh fa-spin" style="font-size:24px"></i>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
Expand All @@ -343,15 +336,12 @@ <h5 class="modal-title" id="previewModalLabel">Preview</h5>
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="chashModalLabel">Content hash lookup</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="chashModalContent">
<i class="fa fa-refresh fa-spin" style="font-size:24px"></i>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions wwwroot/builds/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!DOCTYPE html>
<html>
<html data-bs-theme="dark">
<head>
<title>WoW.tools</title>
<meta property='og:type' content='website'>
Expand Down Expand Up @@ -41,7 +41,7 @@
<div class="container-fluid">
<h3>Diff builds</h3>
<form method="GET" action="/builds/diff.html">
<div class="form-row" style="width: 40vw">
<div class="row" style="width: 40vw">
<div class="col">
<label for="idFormFrom">From</label>
<select class="form-control" name="from" id="diffFormFrom"></select>
Expand Down Expand Up @@ -90,7 +90,6 @@ <h3>Admin</h3>
let diffInit = false;

var table = $('#buildtable').DataTable({
"pagingType": "input",
"pageLength": 25,
"searching": false,
"serverSide": true,
Expand Down
9 changes: 4 additions & 5 deletions wwwroot/css/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions wwwroot/css/bootstrap.min.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit e94547e

Please sign in to comment.