Skip to content

Commit

Permalink
Format code (ScratchAddons#6868)
Browse files Browse the repository at this point in the history
Co-authored-by: DNin01 <[email protected]>
  • Loading branch information
DNin01 and DNin01 authored Nov 14, 2023
1 parent 311043f commit c967343
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions addon-api/content-script/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default class Tab extends Listenable {
this._clientVersion = document.querySelector("meta[name='format-detection']")
? "scratch-www"
: document.querySelector("script[type='text/javascript']")
? "scratchr2"
: null;
? "scratchr2"
: null;
return this._clientVersion;
}
/**
Expand Down
8 changes: 4 additions & 4 deletions addons/editor-number-arrow-keys/userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export default async function ({ addon }) {
let settingValue = e.shiftKey
? addon.settings.get("shiftCustom")
: e.altKey
? addon.settings.get("altCustom")
: addon.settings.get("regularCustom");
? addon.settings.get("altCustom")
: addon.settings.get("regularCustom");
if (settingValue === "") settingValue = 0;
let valueAsFloat = parseFloat(settingValue);
if (valueAsFloat < 0) valueAsFloat *= -1; // If user typed a negative number, we make it positive
Expand All @@ -137,8 +137,8 @@ export default async function ({ addon }) {
changeBy *= e.shiftKey
? settings[addon.settings.get("shift")]
: e.altKey
? settings[addon.settings.get("alt")]
: settings[addon.settings.get("regular")];
? settings[addon.settings.get("alt")]
: settings[addon.settings.get("regular")];
}

const newValueAsInt =
Expand Down
8 changes: 4 additions & 4 deletions addons/find-bar/userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ export default async function ({ addon, msg, console }) {
this.selectedTab === 0
? this.getScratchBlocks()
: this.selectedTab === 1
? this.getScratchCostumes()
: this.selectedTab === 2
? this.getScratchSounds()
: [];
? this.getScratchCostumes()
: this.selectedTab === 2
? this.getScratchSounds()
: [];

this.dropdown.empty();

Expand Down
8 changes: 4 additions & 4 deletions background/get-addon-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const areColorsEqual = (currentColor, oldPresetColor) => {
hexColor.length === 7 // #{rr}{gg}{bb} → #{rr}{gg}{bb}ff
? `${hexColor}ff`
: hexColor.length === 5 // #{r}{g}{b}{a} → #{rr}{gg}{bb}{aa}
? `#${hexColor[1].repeat(2)}${hexColor[2].repeat(2)}${hexColor[3].repeat(2)}${hexColor[4].repeat(2)}`
: hexColor.length === 4 // #{r}{g}{b} → #{rr}{gg}{bb}ff
? `#${hexColor[1].repeat(2)}${hexColor[2].repeat(2)}${hexColor[3].repeat(2)}ff`
: hexColor;
? `#${hexColor[1].repeat(2)}${hexColor[2].repeat(2)}${hexColor[3].repeat(2)}${hexColor[4].repeat(2)}`
: hexColor.length === 4 // #{r}{g}{b} → #{rr}{gg}{bb}ff
? `#${hexColor[1].repeat(2)}${hexColor[2].repeat(2)}${hexColor[3].repeat(2)}ff`
: hexColor;

// Convert both colors to #{rr}{gg}{bb}{aa}
const currentColorRRGGBBAA = getRRGGBBAA(currentColorLowercase);
Expand Down
4 changes: 2 additions & 2 deletions libraries/common/cs/text-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ function makeHsv(hSource, sSource, vSource) {
typeof hSource !== "number" && convertToHsv(parseHex(hSource)).s === 0
? 0
: typeof sSource === "number"
? sSource
: convertToHsv(parseHex(sSource)).s;
? sSource
: convertToHsv(parseHex(sSource)).s;
const v = typeof vSource === "number" ? vSource : convertToHsv(parseHex(vSource)).v;
return convertToHex(convertFromHsv({ h, s, v }));
}
Expand Down
4 changes: 2 additions & 2 deletions popups/scratch-messaging/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ export default async ({ addon, msg, safeMsg }) => {
resourceType === "project"
? "getProjectObject"
: resourceType === "user"
? "getProfileObject"
: "getStudioObject";
? "getProfileObject"
: "getStudioObject";
const resourceObject = this[resourceGetFunction](resourceId);
for (const sortedId of sortedIds) resourceObject.commentChains.push(sortedId);

Expand Down
4 changes: 2 additions & 2 deletions webpages/settings/components/addon-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export default async function ({ template }) {
isIframe && !this.expanded && (this.addon.info || []).every((item) => item.type !== "warning")
? false
: event.shiftKey
? false
: newState;
? false
: newState;
chrome.runtime.sendMessage({ changeEnabledState: { addonId: this.addon._addonId, newState } });
this.$emit("toggle-addon-request", newState);
};
Expand Down
12 changes: 6 additions & 6 deletions webpages/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,12 @@ let fuse;
manifest._categories[0] = manifest.tags.includes("popup")
? "popup"
: manifest.tags.includes("easterEgg")
? "easterEgg"
: manifest.tags.includes("theme")
? "theme"
: manifest.tags.includes("community")
? "community"
: "editor";
? "easterEgg"
: manifest.tags.includes("theme")
? "theme"
: manifest.tags.includes("community")
? "community"
: "editor";

const addCategoryIfTag = (arr) => {
let count = 0;
Expand Down

0 comments on commit c967343

Please sign in to comment.