MCPcopy Index your code
hub / github.com/hoothin/UserScripts / del

Method del

Pagetual/pagetual.user.js:9942–9971  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9940 }
9941 }
9942 del() {
9943 if (this.ruleUrl.id < 2) {
9944 showTips(i18n("cantDel"));
9945 } else if (window.confirm(i18n("confirmDel"))) {
9946 for (let u = 0; u < rulesData.urls.length; u++) {
9947 if (this.ruleUrl.id == rulesData.urls[u].id) {
9948 rulesData.urls.splice(u, 1);
9949 break;
9950 }
9951 }
9952 for (let u = 0; u < ruleUrls.length; u++) {
9953 if (this.ruleUrl.id == ruleUrls[u].id) {
9954 ruleUrls.splice(u, 1);
9955 break;
9956 }
9957 }
9958 for (let u = 0; u < rulesData.sort.length; u++) {
9959 if (this.ruleUrl.id == rulesData.sort[u]) {
9960 rulesData.sort.splice(u, 1);
9961 break;
9962 }
9963 }
9964 rulesData.ruleVersion = 0;
9965 storage.setItem("rulesData", rulesData);
9966 ruleParser.rules = ruleParser.rules.filter(item => {return item.from != this.ruleUrl.id});
9967 storage.setItem("rules", ruleParser.rules);
9968 this.item.parentNode.removeChild(this.item);
9969 //location.reload();
9970 }
9971 }
9972 }
9973 let langSelect = document.createElement("select");
9974 langSelect.style.float = "right";

Callers 1

initMethod · 0.95

Calls 2

showTipsFunction · 0.85
i18nFunction · 0.70

Tested by

no test coverage detected