Mercurial > ec-userscripts
diff mandarake-direct-link.user.js @ 66:444b17e657be
Standardize code style
author | nanaya <me@nanaya.pro> |
---|---|
date | Wed, 10 Jul 2019 22:36:31 +0900 |
parents | 960d452dea99 |
children | 17c94a818088 |
line wrap: on
line diff
--- a/mandarake-direct-link.user.js Wed Jul 10 22:30:14 2019 +0900 +++ b/mandarake-direct-link.user.js Wed Jul 10 22:36:31 2019 +0900 @@ -10,33 +10,34 @@ // @downloadURL https://bitbucket.org/nanayapro/ec-userscripts/raw/tip/mandarake-direct-link.user.js // ==/UserScript== -;(function() { - "use strict"; +/* global $ */ +;(function () { + 'use strict' - $(".r18mark").remove(); - $(".r18item ~ a[href^='#adult_confirm']").remove(); + $('.r18mark').remove() + $(".r18item ~ a[href^='#adult_confirm']").remove() - var fixR18Link = function(_i, el) { - var url = `/order/detailPage/item?itemCode=${el.id}`; + var fixR18Link = function (_i, el) { + var url = `/order/detailPage/item?itemCode=${el.id}` - el.setAttribute("href", url); - el.setAttribute("class", ""); - }; + el.setAttribute('href', url) + el.setAttribute('class', '') + } - $("[href^='#adult_confirm']").each(fixR18Link); + $("[href^='#adult_confirm']").each(fixR18Link) - var currentQuery = new URLSearchParams(location.search); - var fixSearchLink = function(_i, el) { - var query = new URLSearchParams(el.search); + var currentQuery = new URLSearchParams(window.location.search) + var fixSearchLink = function (_i, el) { + var query = new URLSearchParams(el.search) for (let [key, value] of currentQuery) { if (!query.has(key)) { - query.set(key, value); + query.set(key, value) } } - el.setAttribute("href", `/order/listPage/list?${query.toString()}`); - }; + el.setAttribute('href', `/order/listPage/list?${query.toString()}`) + } - $("[href^='/order/listPage/list?']").each(fixSearchLink); -}).call(); + $("[href^='/order/listPage/list?']").each(fixSearchLink) +}).call()