comparison mandarake-direct-link.user.js @ 49:2e1cae72a63e

Semicolons
author nanaya <me@nanaya.pro>
date Thu, 12 Oct 2017 16:40:13 +0900
parents b60f0fd9c417
children f0d5a5d80bfd
comparison
equal deleted inserted replaced
48:b60f0fd9c417 49:2e1cae72a63e
10 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/mandarake-direct-link.user.js 10 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/mandarake-direct-link.user.js
11 // ==/UserScript== 11 // ==/UserScript==
12 12
13 ;(function() { 13 ;(function() {
14 "use strict"; 14 "use strict";
15 $(".r18mark").remove() 15 $(".r18mark").remove();
16 var fixR18Link = function(_i, el) { 16 var fixR18Link = function(_i, el) {
17 var url = `/order/detailPage/item?itemCode=${el.id}` 17 var url = `/order/detailPage/item?itemCode=${el.id}`;
18 18
19 el.setAttribute("href", url) 19 el.setAttribute("href", url);
20 el.setAttribute("class", "") 20 el.setAttribute("class", "");
21 } 21 };
22 22
23 $("[href^='#adult_confirm']").each(fixR18Link) 23 $("[href^='#adult_confirm']").each(fixR18Link);
24 24
25 var currentQuery = new URLSearchParams(location.search) 25 var currentQuery = new URLSearchParams(location.search);
26 var fixSearchLink = function(_i, el) { 26 var fixSearchLink = function(_i, el) {
27 var query = new URLSearchParams(el.search) 27 var query = new URLSearchParams(el.search);
28 28
29 for (let [key, value] of currentQuery) { 29 for (let [key, value] of currentQuery) {
30 if (!query.has(key)) { 30 if (!query.has(key)) {
31 query.set(key, value) 31 query.set(key, value);
32 } 32 }
33 } 33 }
34 34
35 el.setAttribute("href", `/order/listPage/list?${query.toString()}`) 35 el.setAttribute("href", `/order/listPage/list?${query.toString()}`);
36 } 36 };
37 37
38 $("[href^='/order/listPage/list?']").each(fixSearchLink) 38 $("[href^='/order/listPage/list?']").each(fixSearchLink);
39 }).call(); 39 }).call();