Skip to content

Commit

Permalink
Merge pull request #28 from blakeoxx/lintrolling
Browse files Browse the repository at this point in the history
Lintrolling
  • Loading branch information
blakeoxx authored Nov 1, 2023
2 parents 06d71b9 + fa36498 commit 45c4b46
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ module.exports = {
"import/order": "off",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"jsdoc/newline-after-description": "error",
"jsdoc/no-types": "error",
"max-classes-per-file": "off",
"max-len": [
Expand Down
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>Adv Dupe Inspector - Subnet ROOT Labs</title><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/solid.css" integrity="sha384-wnAC7ln+XN0UKdcPvJvtqIH3jOjs9pnKnq9qX68ImXvOGz2JuFoEiCjT8jyZQX2z" crossorigin="anonymous"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/fontawesome.css" integrity="sha384-HbmWTHay9psM8qyzEKPc8odH4DsOuzdejtnr+OFtDmOcIVnhgReQ4GZBH7uwcjf6" crossorigin="anonymous"><script defer="defer" src="bundle.js"></script><link href="main.css" rel="stylesheet"></head><body><div id="header"><h1>Adv Dupe Inspector</h1><p>See what's in your dupes. Select a dupe from your Gmod data folder (%STEAMDIR%/steamapps/common/GarrysMod/garrysmod/data/adv_duplicator) <b>OR</b> drag a file into this window to get started.<br><a href="https://www.subnetroot.com">Powered by Subnet ROOT</a></p><div id="fileupload"><i class="fas fa-file-upload"></i> Choose a dupe file<div id="filestatus" class="hidden" title="Click for more details"><i class="fas fa-cog fa-spin status-icon loading-icon"></i> <i class="fas fa-check-circle status-icon accepted-icon"></i> <i class="fas fa-times-circle status-icon rejected-icon"></i> <i class="fas fa-exclamation-circle status-icon warning-icon"></i> <span class="label"></span></div><div class="file-select-container"><input type="file"></div><div id="filedetails" class="hidden"></div></div></div><div id="treeview-container"><div id="treeview"><h2>Treeview</h2><details open><summary>(no file loaded)</summary></details></div></div><div id="inspector-container"><div id="inspector"><h2>Inspector area</h2></div></div></body></html>
<!doctype html><html lang="en-US"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>Adv Dupe Inspector - Subnet ROOT Labs</title><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/solid.css" integrity="sha384-wnAC7ln+XN0UKdcPvJvtqIH3jOjs9pnKnq9qX68ImXvOGz2JuFoEiCjT8jyZQX2z" crossorigin="anonymous"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/fontawesome.css" integrity="sha384-HbmWTHay9psM8qyzEKPc8odH4DsOuzdejtnr+OFtDmOcIVnhgReQ4GZBH7uwcjf6" crossorigin="anonymous"><script defer="defer" src="bundle.js"></script><link href="main.css" rel="stylesheet"></head><body><div id="header"><h1>Adv Dupe Inspector</h1><p>See what's in your dupes. Select a dupe from your Gmod data folder (%STEAMDIR%/steamapps/common/GarrysMod/garrysmod/data/adv_duplicator) <b>OR</b> drag a file into this window to get started.<br><a href="https://www.subnetroot.com">Powered by Subnet ROOT</a></p><div id="fileupload"><i class="fas fa-file-upload"></i> Choose a dupe file<div id="filestatus" class="hidden" title="Click for more details"><i class="fas fa-cog fa-spin status-icon loading-icon"></i> <i class="fas fa-check-circle status-icon accepted-icon"></i> <i class="fas fa-times-circle status-icon rejected-icon"></i> <i class="fas fa-exclamation-circle status-icon warning-icon"></i> <span class="label"></span></div><div class="file-select-container"><input type="file"></div><div id="filedetails" class="hidden"></div></div></div><div id="treeview-container"><div id="treeview"><h2>Treeview</h2><details open><summary>(no file loaded)</summary></details></div></div><div id="inspector-container"><div id="inspector"><h2>Inspector area</h2></div></div></body></html>
22 changes: 14 additions & 8 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class AppComponent {
{
this.updateFileStatus('rejected', ['The file reader returned an unknown error. Please check the file and try again.']);
}
else this.updateFileStatus('rejected', ['The file reader returned error code ' + res.target.error.code + '. '
else this.updateFileStatus('rejected', ['The file reader returned error code ' + res.target.error.name + '. '
+ 'Please check the file and try again.']);
};

Expand Down Expand Up @@ -209,28 +209,31 @@ export class AppComponent {
showFileDetails()
{
const detailsview = $('#inspector');
const detailsFilename: string = detailsview.data('filename') as string;
const detailsDataSections: DataSectionCollection = detailsview.data('datasections') as DataSectionCollection;

detailsview.empty();
detailsview.append($('<h2></h2>').text(detailsview.data('filename')));
detailsview.append($('<h2></h2>').text(detailsFilename));

let infosection: JQuery;
let infolist: JQuery;
infosection = $('<div><b>Info:</b><ul></ul></div>');
infolist = infosection.find('ul');
Object.entries(detailsview.data('datasections').Info).forEach(([key, val]) => {
Object.entries(detailsDataSections.Info).forEach(([key, val]) => {
infolist.append($('<li></li>').text(key+': '+val));
});
detailsview.append(infosection);

infosection = $('<div><b>More Information:</b><ul></ul></div>');
infolist = infosection.find('ul');
Object.entries(detailsview.data('datasections')['More Information']).forEach(([key, val]) => {
Object.entries(detailsDataSections['More Information']).forEach(([key, val]) => {
infolist.append($('<li></li>').text(key+': '+val));
});
detailsview.append(infosection);

infosection = $('<div><b>Dictionary:</b><ul></ul></div>');
infolist = infosection.find('ul');
Object.entries(detailsview.data('datasections').Dict).forEach(([key, val]) => {
Object.entries(detailsDataSections.Dict).forEach(([key, val]) => {
infolist.append($('<li></li>').text(key+': '+val));
});
detailsview.append(infosection);
Expand Down Expand Up @@ -326,7 +329,7 @@ export class AppComponent {
$('#treeview > details .inspecting').removeClass('inspecting');
target.addClass('inspecting');
if (target.hasClass('fileitem')) this.showFileDetails();
else this.showEdictDetails(target.data('edictid'), target.hasClass('associative'));
else this.showEdictDetails((target.data('edictid') as string), target.hasClass('associative'));

// Open any parent trees to the target
target.parentsUntil('#treeview', 'details').prop('open', true);
Expand Down Expand Up @@ -393,8 +396,11 @@ export class AppComponent {

handleFileSelect(event: JQuery.ChangeEvent)
{
// @ts-ignore: The files property DOES exist on this event
this.loadFile(event.originalEvent?.target?.files ?? new FileList());
// The change event for file input elements includes a `files` property not part of the EventTarget interface.
// So we create a new intersection type to make TypeScript happy
type FileSelectedEventTarget = EventTarget & {files?: FileList};
const target: FileSelectedEventTarget = event.originalEvent?.target as FileSelectedEventTarget;
this.loadFile(target?.files ?? new FileList());
}

handleFileDrop(event: JQuery.DropEvent)
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/edict-collection.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export class EdictCollectionComponent
{
@serializable(map(object(Edict)))
private entities: Record<string, Edict>;
private headEntityID: string | undefined;
@serializable(map(object(Edict)))
private constraints: Record<string, Edict>;
private headEntityID: string | undefined;
private headConstraintID: string | undefined;

constructor()
Expand Down
4 changes: 2 additions & 2 deletions src/app/data-models/edict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { list, object, serializable, serializeAll } from 'serializr';
@serializeAll
export class Edict
{
private edictID: string;
private isEntityFlag: boolean;
@serializable(list(object(EdictExpression)))
private expressions: EdictExpression[] = [];
private edictID: string;
private isEntityFlag: boolean;

constructor(edictID: string, isEntityFlag: boolean)
{
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Adv Dupe Inspector - Subnet ROOT Labs</title>
Expand Down

0 comments on commit 45c4b46

Please sign in to comment.