Skip to content

Commit

Permalink
yarn run format
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrax-10 committed Feb 11, 2024
1 parent 598e031 commit b35dde0
Show file tree
Hide file tree
Showing 12 changed files with 1,260 additions and 1,269 deletions.
176 changes: 88 additions & 88 deletions plugins/CropperJS/cropper.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions plugins/StashBatchResultToggle/stashBatchResultToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

function toggleSearchItem(searchItem, toggleMode) {
const searchResultItem = searchItem.querySelector(
"li.search-result.selected-result.active",
"li.search-result.selected-result.active"
);
if (!searchResultItem) return;

Expand Down Expand Up @@ -55,7 +55,7 @@
} = stash.parseSearchResultItem(searchResultItem);

const studioMatchNode = matches.find(
(o) => o.matchType === "studio",
(o) => o.matchType === "studio"
)?.matchNode;
const performerMatchNodes = matches
.filter((o) => o.matchType === "performer")
Expand All @@ -66,17 +66,17 @@
const includeDate = document.getElementById("result-toggle-date").checked;
const includeCover = document.getElementById("result-toggle-cover").checked;
const includeStashID = document.getElementById(
"result-toggle-stashid",
"result-toggle-stashid"
).checked;
const includeURL = document.getElementById("result-toggle-url").checked;
const includeDetails = document.getElementById(
"result-toggle-details",
"result-toggle-details"
).checked;
const includeStudio = document.getElementById(
"result-toggle-studio",
"result-toggle-studio"
).checked;
const includePerformers = document.getElementById(
"result-toggle-performers",
"result-toggle-performers"
).checked;

let options = [];
Expand Down Expand Up @@ -115,7 +115,7 @@
includePerformers,
o,
resolveToggle(o),
]),
])
);

for (const [
Expand Down Expand Up @@ -333,11 +333,11 @@

async function loadSettings() {
for (const input of document.querySelectorAll(
`#${resultToggleConfigId} input`,
`#${resultToggleConfigId} input`
)) {
input.checked = await sessionStorage.getItem(
input.id,
input.dataset.default === "true",
input.dataset.default === "true"
);
input.addEventListener("change", async () => {
await sessionStorage.setItem(input.id, input.checked);
Expand All @@ -346,32 +346,32 @@
}

stash.addEventListener("tagger:mutation:add:remoteperformer", (evt) =>
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0),
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0)
);
stash.addEventListener("tagger:mutation:add:remotestudio", (evt) =>
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0),
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0)
);
stash.addEventListener("tagger:mutation:add:local", (evt) =>
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0),
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0)
);
stash.addEventListener("tagger:mutation:add:container", (evt) =>
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0),
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0)
);
stash.addEventListener("tagger:mutation:add:subcontainer", (evt) =>
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0),
toggleSearchItem(getClosestAncestor(evt.detail.node, ".search-item"), 0)
);

function checkSaveButtonDisplay() {
const taggerContainer = document.querySelector(".tagger-container");
const saveButton = getElementByXpath(
"//button[text()='Save']",
taggerContainer,
taggerContainer
);
btnGroup.style.display = saveButton ? "inline-block" : "none";
}

stash.addEventListener(
"tagger:mutations:searchitems",
checkSaveButtonDisplay,
checkSaveButtonDisplay
);
})();
10 changes: 5 additions & 5 deletions plugins/defaultDataForPath/defaultDataForPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function main() {
" to " +
name +
" " +
ID,
ID
);
}
for (var o = 0; o < defaultPerformers.length; o++) {
Expand All @@ -138,7 +138,7 @@ function main() {
" to " +
name +
" " +
ID,
ID
);
}
addStudio
Expand All @@ -148,7 +148,7 @@ function main() {
" to " +
name +
" " +
ID,
ID
)
: "";
}
Expand Down Expand Up @@ -315,7 +315,7 @@ function addAllData(
defaultData,
pTags,
pPerformers,
pStudio,
pStudio
) {
if (obj) {
if (obj.paths) {
Expand Down Expand Up @@ -367,7 +367,7 @@ function addAllData(
defaultData,
pTags,
pPerformers,
pStudio,
pStudio
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/filenameParser/filenameParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function cleanFilename(name) {
];
var regExp = new RegExp(
"(_|[^\\w\\d]|^)(" + blockList.join("|") + ")(_|[^\\w\\d]|$)",
"i",
"i"
);
while (regExp.test(name)) {
name = name.replace(regExp, "$1$3");
Expand Down
2 changes: 1 addition & 1 deletion plugins/pathParser/pathParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function matchRuleWithPath(sceneId, path, cb) {
// Remove extension from filename
parts[parts.length - 1] = parts[parts.length - 1].slice(
0,
parts[parts.length - 1].lastIndexOf("."),
parts[parts.length - 1].lastIndexOf(".")
);

for (var i = 0; i < rules.length; i++) {
Expand Down
6 changes: 3 additions & 3 deletions plugins/sceneCoverCropper/sceneCoverCropper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
new Cropper(img);
} catch (e) {
console.error(
"Cropper not loaded - please install 4. CropperJS from CommunityScripts",
"Cropper not loaded - please install 4. CropperJS from CommunityScripts"
);
}
try {
stash.getVersion();
} catch (e) {
console.error(
"Stash not loaded - please install 1. stashUserscriptLibrary from CommunityScripts",
"Stash not loaded - please install 1. stashUserscriptLibrary from CommunityScripts"
);
}

Expand Down Expand Up @@ -52,7 +52,7 @@
"d-flex",
"flex-row",
"justify-content-center",
"align-items-center",
"align-items-center"
);
cropBtnContainer.style.gap = "10px";
cropperModal.appendChild(cropBtnContainer);
Expand Down
Loading

0 comments on commit b35dde0

Please sign in to comment.