24
|
1 // ==UserScript==
|
|
2 // @name Tweetdeck large image
|
|
3 // @namespace https://myconan.net
|
28
|
4 // @version 1.0.1
|
24
|
5 // @description No more stupid link for images in tweetdeck
|
|
6 // @author nanaya
|
|
7 // @match https://tweetdeck.twitter.com/*
|
|
8 // @grant none
|
26
|
9 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanaya1/TK64/tip/files/tweetdeck-large-image.user.js
|
24
|
10 // ==/UserScript==
|
|
11
|
|
12 ;(function() {
|
|
13 var $ = jQuery;
|
|
14
|
|
15 $(document).off('.ec-userscript');
|
25
|
16 $(document).on('mouseenter.ec-userscript', '.js-media-image-link', function(e) {
|
|
17 var link = e.currentTarget;
|
|
18 if (link._ecUserscript === true) { return; }
|
|
19
|
28
|
20 var images = link.getElementsByClassName('media-img');
|
|
21
|
|
22 var url;
|
|
23 if (images.length) {
|
|
24 url = images[0].src.replace(/:[a-z0-9]+$/, '');
|
|
25 } else {
|
|
26 url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)(:small)?\1\)$/, '$2');
|
|
27 }
|
25
|
28 link.setAttribute('href', url + ':orig');
|
|
29 link._ecUserscript = true;
|
24
|
30 });
|
|
31 }).call(); |