Page MenuHomePhabricator

OTRS-1ClickSpam.js

Authored By
bzimport
Nov 22 2014, 2:25 AM
Size
608 B
Referenced Files
None
Subscribers
None

OTRS-1ClickSpam.js

$( function () {
$( '.MasterAction' ).each( function () {
var $spam = $( '<li>' );
$spam.append( $( '<button>' ).text( '1-click spam' ) );
$spam.click( function oneClickSpam ( clickEvent ) {
var ticketid = this.id.match( /TicketID_(\d+)/ )[1];
clickEvent.preventDefault();
clickEvent.stopPropagation();
$.get( 'index.pl?Action=AgentTicketMove&TicketID=' + ticketid + '&DestQueue=Junk', function () {
// TODO: Implement error handling here.
$( this ).hide();
}.bind( this ) );
}.bind( this ) )
$( this ).find( 'ul.Actions' ).append( $spam );
} );
} );

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11748
Default Alt Text
OTRS-1ClickSpam.js (608 B)

Event Timeline