Skip to content

Commit

Permalink
Add tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Nov 28, 2022
1 parent d6bafab commit 15b0188
Show file tree
Hide file tree
Showing 3 changed files with 342 additions and 62 deletions.
121 changes: 61 additions & 60 deletions wwwroot/dbc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
<script src="/js/input.js" crossorigin="anonymous"></script>

<link href="/css/style.css?v=1661289414" rel="stylesheet">
<script type="text/javascript" src="/js/main.js?v=1645063884"></script>
<script type="text/javascript" src="/js/anims.js?v=1658923290"></script>
<script type="text/javascript" src="/js/main.js"></script>
<script type="text/javascript" src="/js/tooltips.js"></script>
<script type="text/javascript" src="/js/anims.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg">
Expand Down Expand Up @@ -82,7 +83,7 @@
<input type="checkbox" autocomplete="off" id="hotfixToggle"> Use hotfixes?
</label>-->
<a style='vertical-align: top;' class='btn btn-secondary btn-sm' data-toggle='modal' href=''
data-target='#settingsModal'><i class='fa fa-gear'></i> Settings</a>
data-target='#settingsModal'><i class='fa fa-gear'></i> Settings</a>
<a id='dbdButton' style='vertical-align: top; display: none;' class='btn btn-secondary btn-sm disabled' href=''
target='_BLANK'><i class='fa fa-external-link'></i> DBD</a>
<a style='vertical-align: top; display: none' id='fkSearchButton' class='btn btn-danger btn-sm'
Expand Down Expand Up @@ -255,9 +256,9 @@ <h5 class="modal-title" id="foreignKeySearchLabel">Foreign key search</h5>
<link href="/css/select2.min.css" rel="stylesheet" />
<script src="/js/select2.min.js"></script>
<script src="/js/files.js" crossorigin="anonymous"></script>
<script src="/js/dbc.js"></script>
<script src="/js/flags.js"></script>
<script src="/js/enums.js"></script>
<script src="/js/dbc.js"></script>
<script type='text/javascript'>
var Settings = {
filtersAlwaysEnabled: false,
Expand Down Expand Up @@ -957,61 +958,61 @@ <h5 class="modal-title" id="foreignKeySearchLabel">Foreign key search</h5>
}

if (fk != "") {
if (fk == "FileData::ID") {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-toggle='modal' data-target='#moreInfoModal' data-tooltip='file' data-id='" +
full[meta.col] + "' onclick='fillModal(" + full[meta
.col] + ")'>" + full[meta.col] + "</a>";
} else if (fk == "SoundEntries::ID" && parseInt(
currentParams["build"][0]) > 6) {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
full[meta.col] + ", \"SoundKit::ID\",\"" +
currentParams["build"] + "\")'>" + full[meta.col] +
"</a>";
} else if (fk == "Item::ID" && full[meta.col] > 0) {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='item' data-id='" +
full[meta.col] +
"' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
full[meta.col] + ", \"" + fk + "\", \"" +
currentParams["build"] + "\")'>" + full[meta.col] +
"</a>";
} else if (fk.toLowerCase() == "questv2::id" && full[meta
.col] > 0) {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='quest' data-id='" +
full[meta.col] +
"' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
full[meta.col] + ", \"" + fk + "\", \"" +
currentParams["build"] + "\")'>" + full[meta.col] +
"</a>";
} else if (fk == "Creature::ID" && full[meta.col] > 0) {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='creature' data-id='" +
full[meta.col] +
"' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
full[meta.col] + ", \"" + fk + "\", \"" +
currentParams["build"] + "\")'>" + full[meta.col] +
"</a>";
} else if (fk.toLowerCase() == "spell::id" && full[meta
.col] > 0) {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='spell' data-id='" +
full[meta.col] +
"' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
full[meta.col] + ", \"" + fk + "\", \"" +
currentParams["build"] + "\")'>" + full[meta.col] +
"</a>";
} else {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='fk' data-id='" +
full[meta.col] + "' data-fk='" + fk +
"' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
full[meta.col] + ", \"" + fk + "\", \"" +
currentParams["build"] + "\")'>" + full[meta.col] +
"</a>";
}
//if (fk == "FileData::ID") {
// returnVar =
// "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-toggle='modal' data-target='#moreInfoModal' data-tooltip='file' data-id='" +
// full[meta.col] + "' onclick='fillModal(" + full[meta
// .col] + ")'>" + full[meta.col] + "</a>";
//} else if (fk == "SoundEntries::ID" && parseInt(
// currentParams["build"][0]) > 6) {
// returnVar =
// "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
// full[meta.col] + ", \"SoundKit::ID\",\"" +
// currentParams["build"] + "\")'>" + full[meta.col] +
// "</a>";
//} else if (fk == "Item::ID" && full[meta.col] > 0) {
// returnVar =
// "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='item' data-id='" +
// full[meta.col] +
// "' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
// full[meta.col] + ", \"" + fk + "\", \"" +
// currentParams["build"] + "\")'>" + full[meta.col] +
// "</a>";
//} else if (fk.toLowerCase() == "questv2::id" && full[meta
// .col] > 0) {
// returnVar =
// "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='quest' data-id='" +
// full[meta.col] +
// "' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
// full[meta.col] + ", \"" + fk + "\", \"" +
// currentParams["build"] + "\")'>" + full[meta.col] +
// "</a>";
//} else if (fk == "Creature::ID" && full[meta.col] > 0) {
// returnVar =
// "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='creature' data-id='" +
// full[meta.col] +
// "' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
// full[meta.col] + ", \"" + fk + "\", \"" +
// currentParams["build"] + "\")'>" + full[meta.col] +
// "</a>";
//} else if (fk.toLowerCase() == "spell::id" && full[meta
// .col] > 0) {
// returnVar =
// "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='spell' data-id='" +
// full[meta.col] +
// "' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
// full[meta.col] + ", \"" + fk + "\", \"" +
// currentParams["build"] + "\")'>" + full[meta.col] +
// "</a>";
//} else {
returnVar =
"<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;' data-tooltip='fk' data-id='" +
full[meta.col] + "' data-fk='" + fk +
"' data-toggle='modal' data-target='#fkModal' onclick='openFKModal(" +
full[meta.col] + ", \"" + fk + "\", \"" +
currentParams["build"] + "\")'>" + full[meta.col] +
"</a>";
//}
} else if (json["headers"][meta.col].startsWith("Flags") ||
flagMap.has(columnWithTable)) {
returnVar =
Expand Down Expand Up @@ -1245,7 +1246,7 @@ <h5 class="modal-title" id="foreignKeySearchLabel">Foreign key search</h5>

$('#fileFilter').on('change', function () {
if ($(this).val() != "" && $(this).val() != "Select a table") {
currentParams["dbc"] = $(this).val();
currentParams["dbc"] = $(this).val().toLowerCase();
if (document.getElementById("buildFilter")) {
clearState = true;
refreshVersions();
Expand Down
4 changes: 2 additions & 2 deletions wwwroot/js/dbc.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function getFlagDescriptions(db, field, value, targetFlags = 0){
let usedFlags = Array();
if (targetFlags == 0){
// eslint-disable-next-line no-undef
targetFlags = flagMap.get(db + '.' + field);
targetFlags = flagMap.get(db.toLowerCase() + '.' + field);
}

if (BigInt === undefined){
Expand Down Expand Up @@ -253,7 +253,7 @@ function fancyFlagTable(flagArrs){

function getEnum(db, field, value){
// eslint-disable-next-line no-undef
const targetEnum = enumMap.get(db + '.' + field);
const targetEnum = enumMap.get(db.toLowerCase() + '.' + field);
return getEnumVal(targetEnum, value);
}

Expand Down
Loading

0 comments on commit 15b0188

Please sign in to comment.