annotate tweetdeck-large-image.user.js @ 25:06d7972287c1

(none)
author Edho Arief <me@myconan.net>
date Tue, 17 Nov 2015 11:01:09 +0000
parents 8ce6738a3a81
children 6ff29abe127d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
Edho Arief <me@myconan.net>
parents:
diff changeset
1 // ==UserScript==
Edho Arief <me@myconan.net>
parents:
diff changeset
2 // @name Tweetdeck large image
Edho Arief <me@myconan.net>
parents:
diff changeset
3 // @namespace https://myconan.net
Edho Arief <me@myconan.net>
parents:
diff changeset
4 // @version 1.0.0
Edho Arief <me@myconan.net>
parents:
diff changeset
5 // @description No more stupid link for images in tweetdeck
Edho Arief <me@myconan.net>
parents:
diff changeset
6 // @author nanaya
Edho Arief <me@myconan.net>
parents:
diff changeset
7 // @match https://tweetdeck.twitter.com/*
Edho Arief <me@myconan.net>
parents:
diff changeset
8 // @grant none
Edho Arief <me@myconan.net>
parents:
diff changeset
9 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanaya1/TK64/tip/files/jiku-chu-direct-link.user.js
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 $ = jQuery;
Edho Arief <me@myconan.net>
parents:
diff changeset
14
Edho Arief <me@myconan.net>
parents:
diff changeset
15 $(document).off('.ec-userscript');
25
Edho Arief <me@myconan.net>
parents: 24
diff changeset
16 $(document).on('mouseenter.ec-userscript', '.js-media-image-link', function(e) {
Edho Arief <me@myconan.net>
parents: 24
diff changeset
17 var link = e.currentTarget;
Edho Arief <me@myconan.net>
parents: 24
diff changeset
18 if (link._ecUserscript === true) { return; }
Edho Arief <me@myconan.net>
parents: 24
diff changeset
19
Edho Arief <me@myconan.net>
parents: 24
diff changeset
20 var url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)(:small)?\1\)$/, '$2');
Edho Arief <me@myconan.net>
parents: 24
diff changeset
21 link.setAttribute('href', url + ':orig');
Edho Arief <me@myconan.net>
parents: 24
diff changeset
22 link._ecUserscript = true;
24
Edho Arief <me@myconan.net>
parents:
diff changeset
23 });
Edho Arief <me@myconan.net>
parents:
diff changeset
24 }).call();