[Rt-commit] rt branch, 4.4/keyboard-shortcut-correspond, repushed

Craig Kaiser craig at bestpractical.com
Mon Apr 23 09:39:48 EDT 2018


The branch 4.4/keyboard-shortcut-correspond was deleted and repushed:
       was 4738a5e2ed22de8a8e4cbd63cb99009f35e04da0
       now 90bd40dccb101146fd91c83515051f9087498d94

1: 4738a5e2e ! 1: 90bd40dcc Update shortcuts to r and c
    @@ -1,6 +1,6 @@
     Author: craig Kaiser <craig at bestpractical.com>
     
    -    Add key shortcut for correspond on ticket
    +    Update shortcuts to r and c
     
     diff --git a/share/html/Elements/ShortcutHelp b/share/html/Elements/ShortcutHelp
     --- a/share/html/Elements/ShortcutHelp
    @@ -65,6 +65,32 @@
     --- a/share/static/js/keyboard-shortcuts.js
     +++ b/share/static/js/keyboard-shortcuts.js
     @@
    +         return false; // prevent '/' character from being typed in search box
    +     };
    + 
    ++    var generateUpdateLink = function(ticketId, action) {
    ++        if (!ticketId) return '';
    ++        return RT.Config.WebHomePath + '/Ticket/Update.html?Action=' + action + '&id=' + ticketId;
    ++    };
    ++
    ++    var replyToTicket = function() {
    ++        var ticketId = jQuery('tr.id').children('td.value').text();
    ++        var replyLink = generateUpdateLink(ticketId, 'Respond');
    ++        if (!replyLink) return;
    ++        window.location.href = replyLink;
    ++    };
    ++
    ++    var commentOnTicket = function() {
    ++        var ticketId = jQuery('tr.id').children('td.value').text();
    ++        var commentLink = generateUpdateLink(ticketId, 'Comment');
    ++        if (!commentLink) return;
    ++        window.location.href = commentLink;
    ++    };
    ++
    +     var openHelp = function() {
    +         var modal = jQuery('.modal');
    +         if (modal.length) {
    +@@
      
              var is_search = jQuery('body#comp-Search-Results').length > 0;
              var is_bulk_update = jQuery('body#comp-Search-Bulk').length > 0;
    @@ -82,46 +108,8 @@
          Mousetrap.bind('g h', goHome);
          Mousetrap.bind('/', simpleSearch);
          Mousetrap.bind('?', openHelp);
    --});
    ++    Mousetrap.bind('r', replyToTicket);
    ++    Mousetrap.bind('c', commentOnTicket);
    + });
      
    --jQuery(function() {
    -     // Only load these shortcuts if there is a ticket list on the page
    -     var hasTicketList = jQuery('table.ticket-list').length;
    -     if (!hasTicketList) return;
    -@@
    -     };
    - 
    -     var replyToTicket = function() {
    --        if (!currentRow) return;
    --
    --        var ticketId = currentRow.closest('tbody').data('recordId');
    --        var replyLink = generateUpdateLink(ticketId, 'Respond');
    -+        var ticketId = jQuery('tr.id').children('td.value').text();
    -+        if (!currentRow && !ticketId ) return;
    -+        if ( !currentRow ) {
    -+            var replyLink = generateUpdateLink(ticketId, 'Respond');
    -+        } else {
    -+            var ticketId = currentRow.closest('tbody').data('recordId');
    -+            var replyLink = generateUpdateLink(ticketId, 'Respond');
    -+        };
    -         if (!replyLink) return;
    - 
    -         window.location.href = replyLink;
    -     };
    - 
    -     var commentOnTicket = function() {
    --        if (!currentRow) return;
    --
    --        var ticketId = currentRow.closest('tbody').data('recordId');
    --        var commentLink = generateUpdateLink(ticketId, 'Comment');
    -+        var ticketId = jQuery('tr.id').children('td.value').text();
    -+        if (!currentRow && !ticketId) return;
    -+        if ( !currentRow ) {
    -+            var commentLink = generateUpdateLink(ticketId, 'Comment');
    -+        } else {
    -+            var ticketId = currentRow.closest('tbody').data('recordId');
    -+            var commentLink = generateUpdateLink(ticketId, 'Comment');
    -+        };
    -         if (!commentLink) return;
    - 
    -         window.location.href = commentLink;
    + jQuery(function() {



More information about the rt-commit mailing list