Created
April 17, 2015 04:40
-
-
Save lisposter/62fbe6f9bab108b0a1a2 to your computer and use it in GitHub Desktop.
redmine.userscript.js
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 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("update", "issue_notes"); return false;">编辑</a>'); | |
var delete_link = $('<a href="/watchers/watch?object_id=' + issue_id + '&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); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok