annotate mandarake-direct-link.user.js @ 52:f8c3374d862c

Fix mandarake cleanup No longer removing thumbnail in notification list
author nanaya <me@nanaya.pro>
date Sat, 16 Jun 2018 21:41:01 +0900
parents f0d5a5d80bfd
children 09f735548b2c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
Edho Arief <me@myconan.net>
parents:
diff changeset
1 // ==UserScript==
Edho Arief <me@myconan.net>
parents:
diff changeset
2 // @name mandarake direct link
Edho Arief <me@myconan.net>
parents:
diff changeset
3 // @namespace https://myconan.net
52
f8c3374d862c Fix mandarake cleanup
nanaya <me@nanaya.pro>
parents: 51
diff changeset
4 // @version 1.3.2
16
Edho Arief <me@myconan.net>
parents:
diff changeset
5 // @description Make proper link on mandarake pages
Edho Arief <me@myconan.net>
parents:
diff changeset
6 // @author nanaya
Edho Arief <me@myconan.net>
parents:
diff changeset
7 // @match https://order.mandarake.co.jp/*
18
Edho Arief <me@myconan.net>
parents: 17
diff changeset
8 // @match http://order.mandarake.co.jp/*
16
Edho Arief <me@myconan.net>
parents:
diff changeset
9 // @grant none
35
32a213717e6a Update update url
nanaya <me@nanaya.pro>
parents: 33
diff changeset
10 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/mandarake-direct-link.user.js
16
Edho Arief <me@myconan.net>
parents:
diff changeset
11 // ==/UserScript==
Edho Arief <me@myconan.net>
parents:
diff changeset
12
Edho Arief <me@myconan.net>
parents:
diff changeset
13 ;(function() {
33
Edho Arief <me@myconan.net>
parents: 20
diff changeset
14 "use strict";
51
f0d5a5d80bfd Remove extra element
nanaya <me@nanaya.pro>
parents: 49
diff changeset
15
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
16 $(".r18mark").remove();
52
f8c3374d862c Fix mandarake cleanup
nanaya <me@nanaya.pro>
parents: 51
diff changeset
17 $(".r18item ~ a[href^='#adult_confirm']").remove();
51
f0d5a5d80bfd Remove extra element
nanaya <me@nanaya.pro>
parents: 49
diff changeset
18
48
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
19 var fixR18Link = function(_i, el) {
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
20 var url = `/order/detailPage/item?itemCode=${el.id}`;
16
Edho Arief <me@myconan.net>
parents:
diff changeset
21
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
22 el.setAttribute("href", url);
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
23 el.setAttribute("class", "");
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
24 };
16
Edho Arief <me@myconan.net>
parents:
diff changeset
25
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
26 $("[href^='#adult_confirm']").each(fixR18Link);
48
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
27
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
28 var currentQuery = new URLSearchParams(location.search);
48
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
29 var fixSearchLink = function(_i, el) {
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
30 var query = new URLSearchParams(el.search);
48
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
31
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
32 for (let [key, value] of currentQuery) {
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
33 if (!query.has(key)) {
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
34 query.set(key, value);
48
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
35 }
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
36 }
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
37
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
38 el.setAttribute("href", `/order/listPage/list?${query.toString()}`);
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
39 };
48
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
40
49
2e1cae72a63e Semicolons
nanaya <me@nanaya.pro>
parents: 48
diff changeset
41 $("[href^='/order/listPage/list?']").each(fixSearchLink);
48
b60f0fd9c417 Update mandarake script
nanaya <me@nanaya.pro>
parents: 35
diff changeset
42 }).call();