Last active
November 12, 2016 04:43
-
-
Save IlyaGulya/11b9105b7fa30e34de70597409759277 to your computer and use it in GitHub Desktop.
Userscript for easy copying the item URL on http://www.xarakiri.ru/
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
// ==UserScript== | |
// @name Harakiri URL button | |
// @namespace http://ccrowd.in/ | |
// @version 0.0.1 | |
// @description Userscript for easy copying the item URL on http://www.xarakiri.ru/ | |
// @author [email protected] | |
// @match http://www.xarakiri.ru/catalog/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint esnext: true */ | |
(function() { | |
'use strict'; | |
let items = $(".col").filter((key, item) => item.id.startsWith("item_")); | |
items.each((key, item) => { | |
let child = $(item).find(".item__content"); | |
let url = `${location.href.replace(location.hash,"")}#${item.id}`; | |
$(`<a style="position: absolute; bottom: 6px; right: 7px; background: #f5f5f5; padding: 10px 15px; border-radius: 2px; border: 1px solid #e8e8e8; color: #000;" href="${url}">URL</a>`).appendTo(child); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment