Created
August 10, 2023 13:09
-
-
Save qubodup/c8774ec15a8aeee188f3945ccf487af8 to your computer and use it in GitHub Desktop.
Copy OpenClipArt tags easily from a text box
This file contains hidden or 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 OpenClipart Tag Copy Helper | |
// @namespace https://github.com/qubodup | |
// @version 0.1 | |
// @description makes copying tags easier, for remixing | |
// @author qubodup | |
// @match https://openclipart.org/detail/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=openclipart.org | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// https://stackoverflow.com/a/12897970/188159 | |
window.addEventListener('load', function() { | |
// https://stackoverflow.com/questions/16570564/jquery-get-an-array-of-text | |
var array = $('.clipart-detail-meta > dl > dd > a').map(function(){ | |
return $.trim($(this).text()); | |
}).get(); | |
var tagtext = array.join(', ') | |
$('.clipart-detail-meta > dl').after('<textarea style="width:100%">' + tagtext + '</textarea>'); | |
}, false); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment