annotate pixiv-direct-external-link.user.js @ 24:8ce6738a3a81

(none)
author Edho Arief <me@myconan.net>
date Tue, 17 Nov 2015 10:56:29 +0000
parents 4b13157ae3a1
children 28505554a8b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
Edho Arief <me@myconan.net>
parents:
diff changeset
1 // ==UserScript==
Edho Arief <me@myconan.net>
parents:
diff changeset
2 // @name pixiv direct external link
Edho Arief <me@myconan.net>
parents:
diff changeset
3 // @namespace https://myconan.net
19
Edho Arief <me@myconan.net>
parents: 18
diff changeset
4 // @version 1.1.0
14
Edho Arief <me@myconan.net>
parents:
diff changeset
5 // @description Make proper link on pixiv pages
Edho Arief <me@myconan.net>
parents:
diff changeset
6 // @author nanaya
Edho Arief <me@myconan.net>
parents:
diff changeset
7 // @match http://www.pixiv.net/*
Edho Arief <me@myconan.net>
parents:
diff changeset
8 // @grant none
15
Edho Arief <me@myconan.net>
parents: 14
diff changeset
9 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanaya1/TK64/tip/files/pixiv-direct-external-link.user.js
14
Edho Arief <me@myconan.net>
parents:
diff changeset
10 // ==/UserScript==
Edho Arief <me@myconan.net>
parents:
diff changeset
11
Edho Arief <me@myconan.net>
parents:
diff changeset
12 ;(function() {
Edho Arief <me@myconan.net>
parents:
diff changeset
13 var fixLink = function(_i, el) {
Edho Arief <me@myconan.net>
parents:
diff changeset
14 var
Edho Arief <me@myconan.net>
parents:
diff changeset
15 $el = $(el),
Edho Arief <me@myconan.net>
parents:
diff changeset
16 url = decodeURIComponent($el.attr('href').replace(/^\/?jump.php\?/, ""));
Edho Arief <me@myconan.net>
parents:
diff changeset
17
Edho Arief <me@myconan.net>
parents:
diff changeset
18 $el.attr('href', url);
Edho Arief <me@myconan.net>
parents:
diff changeset
19 };
Edho Arief <me@myconan.net>
parents:
diff changeset
20
Edho Arief <me@myconan.net>
parents:
diff changeset
21 $("[href^='jump.php?']").each(fixLink);
Edho Arief <me@myconan.net>
parents:
diff changeset
22 $("[href^='/jump.php?']").each(fixLink);
Edho Arief <me@myconan.net>
parents:
diff changeset
23 }).call();