NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Interpals: Show Image Links & fix photobox dimensions // @namespace https://asterleen.com // @version 0.2 // @description Allows opening Interpals users' photos in a new tab/window and downloading them + fixes the photo box dimensions // @author Asterleen // @match https://*.interpals.net/app/photo* // @license MIT // @copyright 2020, Asterleen (https://asterleen.com) // @grant none // ==/UserScript== (function () { 'use strict'; const sOriginalLinkId = "addnl-originalImageLink"; function addOriginalLink() { var oImageLink = $('#bigPhotoLnk'), //eslint-disable-line no-undef sImageUrl = oImageLink.css('background-image').match(/(https.+)\"/)[1], oOriginalLink = $('#' + sOriginalLinkId); //eslint-disable-line no-undef if (sImageUrl) { oImageLink.css({ width: 700, height: 900 }); if (oOriginalLink.length) { oOriginalLink.attr("href", sImageUrl); } else { $('#photoCont>.photoBox').append('<a id="' + sOriginalLinkId + '" href="' + sImageUrl + '" style="display:block;padding:5px">Original image</a>'); //eslint-disable-line no-undef } } } var observer = new MutationObserver(addOriginalLink); observer.observe(document, { childList: true, subtree: true, attributes: false, characterData: false }); addOriginalLink(); })();