Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
justjavac committed Dec 6, 2023
1 parent 91c9299 commit aaea38f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ let bindSyncRemoteStaticRuleEventListener = () => {
UpdateRulesetOptions,
(callback) => {
showRuleList();
}
},
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ let bindButtonUploadRuleFromFile = () => {
e.stopPropagation();
e.preventDefault();
},
false
false,
);
dropbox.addEventListener(
"dragover",
(e) => {
e.stopPropagation();
e.preventDefault();
},
false
false,
);

dropbox.addEventListener(
Expand All @@ -166,7 +166,7 @@ let bindButtonUploadRuleFromFile = () => {
showUploadFileContent(file);
}
},
false
false,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let messageReciver = () => {
}
}
},
false
false,
);
};

Expand Down
6 changes: 3 additions & 3 deletions extension/options_ui/js/CommonBundle/Components/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let updateDynamicRules = (
},
() => {
callback(args);
}
},
);
};
let deleteDynamicRules = (type, id = 0, callback = () => {}, ...args) => {
Expand Down Expand Up @@ -82,7 +82,7 @@ let deleteDynamicRules = (type, id = 0, callback = () => {}, ...args) => {
},
() => {
callback(args);
}
},
);
}
});
Expand Down Expand Up @@ -128,7 +128,7 @@ let enableStaticRules = (callback, ...args) => {
deleteDynamicRules("sync_remote_static_rule", 0, () => {
callback();
});
}
},
);
};

Expand Down
2 changes: 1 addition & 1 deletion extension/options_ui/js/CommonBundle/Components/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let editor = {
onChange: (
updatedContent,
previousContent,
{ contentErrors, patchResult }
{ contentErrors, patchResult },
) => {
// content is an object { json: JSONData } | { text: string }
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let showDynamicRules = (type = "all_dynamic_rule") => {
list += `<li class="${rule_id_range_type}" data-rule-id="${
value.id
}" data-origin="${encodeURIComponent(
JSON.stringify(value)
JSON.stringify(value),
)}" title="规则来源:${show_rule_id_range_name}">规则来源:${show_rule_id_range_name};编号为:&nbsp;&nbsp;${
value.id
}&nbsp;&nbsp;;规则作用:${rule_action_name}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="del-flag" data-rule-id="${
Expand All @@ -62,7 +62,7 @@ let bindDynamicRuleEventListener = () => {
if (event.target.nodeName === "LI") {
let content_box = document.querySelector("#rule-content-container");
let content = decodeURIComponent(
event.target.getAttribute("data-origin")
event.target.getAttribute("data-origin"),
);
//console.log(content);

Expand All @@ -71,19 +71,19 @@ let bindDynamicRuleEventListener = () => {
text: undefined,
});
content_box.value = decodeURIComponent(
event.target.getAttribute("data-origin")
event.target.getAttribute("data-origin"),
);
content_box.setAttribute("rule-type", "dynamic");
content_box.setAttribute(
"rule-id",
event.target.getAttribute("data-rule-id")
event.target.getAttribute("data-rule-id"),
);
}
if (event.target.nodeName === "SPAN") {
event.target.parentNode.remove();
deleteDynamicRules(
"single_rule",
event.target.getAttribute("data-rule-id")
event.target.getAttribute("data-rule-id"),
);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let bindButtonEventListener = () => {
if (rule_str) {
utils.createJSONFile(
rule_str,
"ReplaceGoogleCDN-backup-rule-" + time + ".json"
"ReplaceGoogleCDN-backup-rule-" + time + ".json",
);
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ let bindButtonEventListener = () => {
let content = content_box.value;
if (content) {
let button = document.querySelector(
"#jsoneditor .jse-button.jse-format"
"#jsoneditor .jse-button.jse-format",
);
if (button) {
button.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { showDynamicRules } from "../../CommonBundle/Components/showDynamicRules

let defaultDomainList = document.querySelector(".default-redirect-domains");
let defaultDomainOptions = document.querySelector(
".default-redirect-domians-options"
".default-redirect-domians-options",
);
let showDefaultDomainList = () => {
let list = "";
Expand Down Expand Up @@ -61,7 +61,7 @@ let bindSetDefaultDomainOptionEventListener = () => {

let rule_info =
event.target.options[event.target.selectedIndex].getAttribute(
"data-rule-info"
"data-rule-info",
);
let rule = JSON.parse(rule_info);

Expand Down
2 changes: 1 addition & 1 deletion extension/sandbox/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ list_box.addEventListener("click", (event) => {
JSON.stringify({
url: url,
}),
location.origin + "/options_ui/index.html"
location.origin + "/options_ui/index.html",
);
return;

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"scripts": {
"fmt": "prettier --write \"extension/**/*.{ts,js}\"",
"fmt:check": "prettier --check \"extension/**/*.{ts,js}\"",
"build": "bash extension/tools/release-archive.sh",
"release": "bash release-archive.sh",
"firefox-test": "npx web-ext run "
Expand Down

0 comments on commit aaea38f

Please sign in to comment.