Mercurial > ec-userscripts
comparison tweetdeck-large-image.user.js @ 49:2e1cae72a63e
Semicolons
author | nanaya <me@nanaya.pro> |
---|---|
date | Thu, 12 Oct 2017 16:40:13 +0900 |
parents | 32a213717e6a |
children | 19c391840d4a |
comparison
equal
deleted
inserted
replaced
48:b60f0fd9c417 | 49:2e1cae72a63e |
---|---|
10 // ==/UserScript== | 10 // ==/UserScript== |
11 | 11 |
12 ;(function() { | 12 ;(function() { |
13 "use strict"; | 13 "use strict"; |
14 | 14 |
15 var $ = jQuery | 15 var $ = jQuery; |
16 var replaceLink = function(e) { | 16 var replaceLink = function(e) { |
17 var link = e.currentTarget | 17 var link = e.currentTarget; |
18 if (link._ecUserscript === true) { return } | 18 if (link._ecUserscript === true) { return; } |
19 | 19 |
20 var images = link.getElementsByClassName("media-img") | 20 var images = link.getElementsByClassName("media-img"); |
21 | 21 |
22 var url | 22 var url; |
23 if (images.length) { | 23 if (images.length) { |
24 url = images[0].src.replace(/:[a-z0-9]+$/, "") | 24 url = images[0].src.replace(/:[a-z0-9]+$/, ""); |
25 } else { | 25 } else { |
26 url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)(:small)?\1\)$/, "$2") | 26 url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)(:small)?\1\)$/, "$2"); |
27 } | 27 } |
28 link.setAttribute("href", url + ":orig") | 28 link.setAttribute("href", url + ":orig"); |
29 link._ecUserscript = true | 29 link._ecUserscript = true; |
30 } | 30 }; |
31 | 31 |
32 $(document).off(".ec-userscript") | 32 $(document).off(".ec-userscript"); |
33 $(document).on("mouseenter.ec-userscript", ".js-media-image-link", replaceLink) | 33 $(document).on("mouseenter.ec-userscript", ".js-media-image-link", replaceLink); |
34 }).call(); | 34 }).call(); |