您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add shuffle button to Symbiota "Batch Georeferencing Tools" page
// ==UserScript== // @name Batch Georeferencing - Randomly Select Batch // @description Add shuffle button to Symbiota "Batch Georeferencing Tools" page // @namespace symbiota.user.batchgeoref.rsb // @include */batchgeoreftool.php // @author Jack Willis // @version 1.0 // @grant none // @license MIT; https://opensource.org/licenses/MIT // ==/UserScript== $(function() { function sample(array) { return array[(Math.random() * array.length) | 0]; } var shuffleButton = $("<a>") .html("🔀") // shuffle emoji .css("margin-left", "10px").css("font-size", "18px") .hover(function() { $(this).css("cursor", "pointer").css("text-decoration", "none"); }).click(function(event) { event.preventDefault(); $("#locallist option:selected").prop("selected", false); // deselect all batches $(sample($("#locallist option"))).prop("selected", true); // select random batch }); // inject shuffle button in the panel above the <select> $("form[name=georefform] > div:first-child").append(shuffleButton); });