Skip to content

Commit

Permalink
prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed Oct 17, 2024
1 parent 6386147 commit 5d13175
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 61 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ All notable changes to this project will be documented in this file.
## 2.5.23

## Fixed
* Minor graphical annoyances with List View.
* Parser specific inputs not being validated.

- Minor graphical annoyances with List View.
- Parser specific inputs not being validated.

### Changed
* Placeholders are now OS specific for parser specific inputs.

- Placeholders are now OS specific for parser specific inputs.

## 2.5.22

Expand Down
9 changes: 3 additions & 6 deletions src/lang/en-US/langStrings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
},
"manualParser": {
"manifestsInputTitle": "Manifests Directory",
"manifestsInputPlaceholder":
{
"manifestsInputPlaceholder": {
"Windows_NT": "C:\\path\\to\\your\\manifests\\",
"Darwin": "/path/to/your/manifests/",
"Linux": "/path/to/your/manifests/"
Expand All @@ -113,8 +112,7 @@
},
"epicParser": {
"manifestsInputTitle": "Epic Manifests Directory Override",
"manifestsInputPlaceholder":
{
"manifestsInputPlaceholder": {
"Windows_NT": "C:\\path\\to\\your\\manifests\\",
"Darwin": "/path/to/your/manifests/",
"Linux": "/path/to/your/manifests/"
Expand All @@ -130,8 +128,7 @@
"legendaryParser": {
"launcherModeInputTitle": "Launch games via Legendary for online services",
"legendaryInstalledFileTitle": "Legendary installed.json Path Override",
"legendaryInstalledFilePlaceholder":
{
"legendaryInstalledFilePlaceholder": {
"Windows_NT": "C:\\path\\to\\legendary\\installed.json",
"Darwin": "/path/to/legendary/installed.json",
"Linux": "/path/to/legendary/installed.json"
Expand Down
3 changes: 2 additions & 1 deletion src/lib/parsers/itch-io.parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export class ItchIoParser implements GenericParser {
},
itchIoWindowsOnLinuxInstallDriveRedirect: {
label: this.lang.itchIoWindowsOnLinuxInstallDriveRedirectTitle,
placeholder: this.lang.itchIoWindowsOnLinuxInstallDriveRedirectPlaceholder,
placeholder:
this.lang.itchIoWindowsOnLinuxInstallDriveRedirectPlaceholder,
inputType: "dir",
info: this.lang.docs__md.input.join(""),
},
Expand Down
3 changes: 1 addition & 2 deletions src/lib/parsers/manual.parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as fs from "fs-extra";
import * as path from "path";
import * as os from "os";


export class ManualParser implements GenericParser {
private get lang() {
return APP.lang.manualParser;
Expand Down Expand Up @@ -72,4 +71,4 @@ export class ManualParser implements GenericParser {
return undefined;
});
}
}
}
24 changes: 12 additions & 12 deletions src/models/language.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export interface languageStruct {
};
battleNetParser: {
battleExeOverrideTitle: string;
battleExeOverridePlaceholder: {[key: string]: string};
battleExeOverridePlaceholder: { [key: string]: string };
docs__md: {
self: string[];
input: string[];
Expand All @@ -129,7 +129,7 @@ export interface languageStruct {
};
UWPParser: {
UWPDirTitle: string;
UWPDirPlaceholder: {[key: string]: string};
UWPDirPlaceholder: { [key: string]: string };
UWPLauncherModeTitle: string;
docs__md: {
self: string[];
Expand All @@ -142,9 +142,9 @@ export interface languageStruct {
};
itchIoParser: {
itchIoAppDataOverrideTitle: string;
itchIoAppDataOverridePlaceholder: {[key: string]: string};
itchIoAppDataOverridePlaceholder: { [key: string]: string };
itchIoWindowsOnLinuxInstallDriveRedirectTitle: string;
itchIoWindowsOnLinuxInstallDriveRedirectPlaceholder: string;
itchIoWindowsOnLinuxInstallDriveRedirectPlaceholder: string;
docs__md: {
self: string[];
input: string[];
Expand All @@ -159,7 +159,7 @@ export interface languageStruct {
};
eaDesktopParser: {
eaGamesDirTitle: string;
eaGamesDirPlaceholder: {[key: string]: string};
eaGamesDirPlaceholder: { [key: string]: string };
eaLauncherModeTitle: string;
docs__md: {
self: string[];
Expand All @@ -173,7 +173,7 @@ export interface languageStruct {
};
amazonGamesParser: {
exeOverrideTitle: string;
exeOverridePlaceholder: {[key: string]: string};
exeOverridePlaceholder: { [key: string]: string };
launcherModeInputTitle: string;
docs__md: {
self: string[];
Expand All @@ -188,7 +188,7 @@ export interface languageStruct {
};
manualParser: {
manifestsInputTitle: string;
manifestsInputPlaceholder: {[key: string]: string};
manifestsInputPlaceholder: { [key: string]: string };
docs__md: {
self: string[];
input: string[];
Expand All @@ -199,7 +199,7 @@ export interface languageStruct {
};
epicParser: {
manifestsInputTitle: string;
manifestsInputPlaceholder: {[key: string]: string};
manifestsInputPlaceholder: { [key: string]: string };
launcherModeInputTitle: string;
docs__md: {
self: string[];
Expand All @@ -215,9 +215,9 @@ export interface languageStruct {
legendaryParser: {
launcherModeInputTitle: string;
legendaryExeOverrideTitle: string;
legendaryExeOverridePlaceholder: {[key: string]: string};
legendaryExeOverridePlaceholder: { [key: string]: string };
legendaryInstalledFileTitle: string;
legendaryInstalledFilePlaceholder: {[key: string]: string};
legendaryInstalledFilePlaceholder: { [key: string]: string };
docs__md: {
self: string[];
input: string[];
Expand All @@ -229,7 +229,7 @@ export interface languageStruct {
};
uplayParser: {
uplayDirTitle: string;
uplayDirPlaceholder: {[key: string]: string};
uplayDirPlaceholder: { [key: string]: string };
launcherModeInputTitle: string;
docs__md: {
self: string[];
Expand All @@ -245,7 +245,7 @@ export interface languageStruct {
};
gogParser: {
galaxyExeOverrideTitle: string;
galaxyExeOverridePlaceholder: {[key: string]: string};
galaxyExeOverridePlaceholder: { [key: string]: string };
launcherModeInputTitle: string;
parseLinkedExecsTitle: string;
parseRegistryEntries: string;
Expand Down
2 changes: 1 addition & 1 deletion src/models/parser.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface ParserInputField {
placeholder?: string;
inputType: "text" | "path" | "dir" | "toggle" | "multiselect";
allowedValues?: SelectItem[];
initialValue?: string[]|string;
initialValue?: string[] | string;
hidden?: boolean;
required?: boolean;
info?: string;
Expand Down
58 changes: 28 additions & 30 deletions src/renderer/components/ng-bubbles.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,18 @@ export class NgBubblesComponent implements ControlValueAccessor {
if (this.addable && !this.editing[index]) {
this.editing[index] = true;
this.addables[index] = this.items[index];
const self=this;
setTimeout(()=> {
const inputEl = document.querySelector(".editable") as HTMLTextAreaElement;
const len = self.addables[index].length
self.setInnerHtml(inputEl,self.addables[index], {start: len, end: len})
const self = this;
setTimeout(() => {
const inputEl = document.querySelector(
".editable",
) as HTMLTextAreaElement;
const len = self.addables[index].length;
self.setInnerHtml(inputEl, self.addables[index], {
start: len,
end: len,
});
inputEl.focus();
}, 100)
}, 100);
}
}

Expand All @@ -117,30 +122,27 @@ export class NgBubblesComponent implements ControlValueAccessor {
}

private transferChangeBubble(index: number) {
if(this.addables[index]) {
this.changeItem(this.addables[index], index)
this.addables[index]="";
this.editing[index]=false;
if (this.addables[index]) {
this.changeItem(this.addables[index], index);
this.addables[index] = "";
this.editing[index] = false;
} else {
this.removeItem(index);
}
this.changeRef.detectChanges();
}

handleChangeKeypress(event: KeyboardEvent, index: number) {
if (
event.key === "Enter"
) {
if (event.key === "Enter") {
event.preventDefault();
this.transferChangeBubble(index);
if(index == this.items.length - 1) {
if (index == this.items.length - 1) {
this.addLiveItem();
}
}
else if (event.key === "Backspace" && this.addables[index] == "") {
} else if (event.key === "Backspace" && this.addables[index] == "") {
event.preventDefault();
this.transferChangeBubble(index);
this.makeLiveItem(index-1);
this.makeLiveItem(index - 1);
}
}

Expand All @@ -164,22 +166,18 @@ export class NgBubblesComponent implements ControlValueAccessor {
this.changeRef.detectChanges();
}
handleKeypress(event: KeyboardEvent) {
if (
event.key === "Enter"
) {
if (event.key === "Enter") {
event.preventDefault();
const goToNew = !!this.addableValue
const goToNew = !!this.addableValue;
this.transferBubble();
if(goToNew) {
this.addLiveItem()
if (goToNew) {
this.addLiveItem();
}
}
else if(event.key === "Backspace" && this.addableValue == "") {
} else if (event.key === "Backspace" && this.addableValue == "") {
event.preventDefault();
this.transferBubble();
this.makeLiveItem(this.items.length-1);
this.makeLiveItem(this.items.length - 1);
}

}
handleBlur() {
this.transferBubble();
Expand All @@ -188,7 +186,7 @@ export class NgBubblesComponent implements ControlValueAccessor {
addItem(item: string) {
this.items.push(item);
this.editing.push(false);
this.addables.push("")
this.addables.push("");
this.onChange(this.items);
this.onTouched();
}
Expand All @@ -208,8 +206,8 @@ export class NgBubblesComponent implements ControlValueAccessor {
writeValue(value: string[]) {
this.items = value;
const len = value ? value.length : 0;
this.editing = Array(len).map(x=>false);
this.addables = Array(len).map(x=>"");
this.editing = Array(len).map((x) => false);
this.addables = Array(len).map((x) => "");
this.onChange(this.items);
this.changeRef.detectChanges();
this.onTouched();
Expand Down
10 changes: 7 additions & 3 deletions src/renderer/services/parsers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,10 @@ export class ParsersService {

validate(key: string, data: any, options?: any) {
switch (key) {
case "parserType":
return parserInfo.availableParsers.includes(data) ? null : this.lang.validationErrors.parserType__md;
case "parserType":
return parserInfo.availableParsers.includes(data)
? null
: this.lang.validationErrors.parserType__md;
case "configTitle":
return data ? null : this.lang.validationErrors.configTitle__md;
case "parserId":
Expand Down Expand Up @@ -419,7 +421,9 @@ export class ParsersService {
isDir,
)
? null
: isDir ? this.lang.validationErrors.genericDir__md : this.lang.validationErrors.genericPath__md;
: isDir
? this.lang.validationErrors.genericDir__md
: this.lang.validationErrors.genericPath__md;
}
return null;
}
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/styles/ng-bubbles.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
.delete {
margin-left: 0.25em;
}
.editable,.editablePlus {
.editable,
.editablePlus {
display: flex;
min-width:10px;
min-width: 10px;
height: 20px;
cursor: white;
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/styles/preview.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@
}
}
&.header > .infoField {
&:hover,&.sortBy {
&:hover,
&.sortBy {
background-color: var(
--color-ng-select-option-background-hover
);
Expand Down

0 comments on commit 5d13175

Please sign in to comment.