Skip to content

Instantly share code, notes, and snippets.

@lisposter
Created April 17, 2015 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lisposter/62fbe6f9bab108b0a1a2 to your computer and use it in GitHub Desktop.
Save lisposter/62fbe6f9bab108b0a1a2 to your computer and use it in GitHub Desktop.
redmine.userscript.js
// ==UserScript==
// @name Redmine
// @namespace http://zhu.li/
// @version 0.1.0
// @description add some useful quick links
// @author Leigh Zhu
// @match http://redmine.yourcompany.com/my/page
// @grant none
// ==/UserScript==
(function() {
$('.list.issues thead > tr').append('<th>操作</th>');
$('.list.issues tbody tr').each(function(i) {
var issue_id = $(this).attr('id').replace('issue-', '');
var edit_link = $('<a href="/issues/' + issue_id + '/edit" accesskey="e" class="icon icon-edit" onclick="showAndScrollTo(&quot;update&quot;, &quot;issue_notes&quot;); return false;">编辑</a>');
var delete_link = $('<a href="/watchers/watch?object_id=' + issue_id + '&amp;object_type=issue" class="issue-' + issue_id + '-watcher icon icon-fav" data-method="delete" data-remote="true" rel="nofollow">取消跟踪</a>');
delete_link.click(function() {
$(this).parent().remove();
});
$(this).append(delete_link, edit_link);
});
})();
@webcaetano
Copy link

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment