Created
June 22, 2016 21:59
-
-
Save JDMcKinstry/9a0364d8f64aefaddc666cda9e7201b0 to your computer and use it in GitHub Desktop.
Makes it easy to open Instagram images and videos in separate links when using IG on Desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bob() { | |
$("article div > img:not(.atagged), article div > video:not(.atagged)").each(function(i) { | |
var href = this.src, | |
oType = this.tagName.toLowerCase(); | |
oType = oType.charAt(0).toUpperCase() + oType.substr(1); | |
$(this).addClass("atagged").closest("article").children("header+div") | |
.append($("<a />", { href: href, style: "padding:1em;text-align:center;", target: "_blank", text: "Open "+oType })); | |
}).length; | |
} | |
bob(); | |
$(document).ajaxSuccess(function(event, jqXHR, ajaxOptions, data) { if (data && data.feed) bob(); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment