Index: ticketdelete.js =================================================================== --- ticketdelete.js (revision 8138) +++ ticketdelete.js (working copy) @@ -1,20 +1,23 @@ $(document).ready(function() { - var ticket = /\/ticket\/(\d+)/.exec(document.location)[1]; - var delete_link = 'Delete'; - var ticket_buttons = $('#ticket .inlinebuttons')[0]; - if (ticket_buttons) { - $(ticket_buttons).append(delete_link); - } else { - $('#ticket table.properties').after('

'+delete_link+' 

'); - } - $('#changelog .inlinebuttons').each(function() { - var comment = $('input[@name=replyto]', this)[0]; - if (comment) { - comment = comment.value; - $(this).append('Delete'); + var newticket_url = document.location.toString().match('/newticket') + if (newticket_url==null) { + var ticket = /\/ticket\/(\d+)/.exec(document.location)[1]; + var delete_link = 'Delete'; + var ticket_buttons = $('#ticket .inlinebuttons')[0]; + if (ticket_buttons) { + $(ticket_buttons).append(delete_link); + } else { + $('#ticket table.properties').after('

'+delete_link+' 

'); + } + $('#changelog .inlinebuttons').each(function() { + var comment = $('input[@name=replyto]', this)[0]; + if (comment) { + comment = comment.value; + $(this).append('Delete'); - // doesnt work, form tokens - // $(this).append('
'); - } - }); + // doesnt work, form tokens + // $(this).append('
'); + } + }); + } });