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