Zabbix submit acknowledgement with Ctrl-Enter

Adds the standard "save and go" keyboard shortcut

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Zabbix submit acknowledgement with Ctrl-Enter
// @namespace    http://wosc.de/
// @version      1.0
// @description  Adds the standard "save and go" keyboard shortcut
// @author       Wolfgang Schnerring
// @match        http://*/zabbix/zabbix.php?*action=acknowledge*
// @grant        none
// ==/UserScript==

(function() {
'use strict';

var $ = window.jQuery;

$('textarea').on('keydown', function(event) {
  if (! (event.which == 13 && event.ctrlKey)) return;

  event.preventDefault();
  $(event.target).closest('form').find('button[value="acknowledge.create"]').click();
});

})();