您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Copy multiple Redmine URL links
当前为
// ==UserScript== // @name Redmine helper buttons: List page // @namespace Redmine // @icon https://dev.sun-asterisk.com/favicon.ico?1528612569 // @description Copy multiple Redmine URL links // @run-at document-start // @match *://dev.sun-asterisk.com/projects/* // @grant GM_setClipboard // @grant GM_notification // @version 1.1.0 // ==/UserScript== document.addEventListener("DOMContentLoaded", function (event) { var host = location.protocol + '//' + location.host; $('#query_form_with_buttons p.buttons').append('<a class="icon icon-copy ticket-urls" href="javascript:void(0)">Copy URLs</a>') .append('<a class="icon icon-copy hide-sidebar" href="javascript:void(0)">Hide sidebar</a>'); $('.ticket-urls').on('click', function () { var ticketUrls = []; $('input:checkbox[name="ids[]"]:checked').each(function () { ticketUrls.push(host + $(this).closest('tr').find('td.id a').attr('href')); }); var joinedUrls = ticketUrls.join("\n"); if (joinedUrls) { GM_setClipboard(joinedUrls); GM_notification ( {title: 'Redmine URL copied', text: joinedUrls, image: 'https://dev.sun-asterisk.com/favicon.ico?1528612569'} ); } }); $('.hide-sidebar').on('click', function () { var sidebar = $('#sidebar') content = $('#content'); if (sidebar.is(':visible')) { sidebar.hide(); $('#content').css('width', '100%'); } else { sidebar.show(); $('#content').css('width', ''); } }); });