Created
December 9, 2009 17:25
-
-
Save fearphage/252612 to your computer and use it in GitHub Desktop.
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 lighthouse: Edit your comments | |
| // @description Adds ability to edit your own ticket comments. | |
| // @include https://*.lighthouseapp.com/projects/*/tickets/* | |
| // | |
| // Mouseover the comment and an edit button will appear to the | |
| // top-right of the comment. | |
| // ==/UserScript== | |
| (function(global, form) { | |
| form = document.forms && | |
| form.length > 1 && | |
| (form = form[2].action) && | |
| global.$$('ul.info .tticket').each(function(element, i) { | |
| var version, match = element.readAttribute('id').match(/-\d+-(\d+)$/); | |
| if (match && !element.hasClassName('attachment')) { | |
| version = match[1]; | |
| element | |
| .insert("<a href='" + form + "/versions/" + version + "' class='edit' style='display:none'>edit</a>") | |
| .observe('mouseover', function() { | |
| element.down('.edit').show(); | |
| }) | |
| .observe('mouseout', function() { | |
| element.down('.edit').hide(); | |
| }); | |
| } | |
| }); | |
| })(this.unsafeWindow || this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment