Skip to content

Commit

Permalink
CS und Meldung bei fehlerhaften request angepasst
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaddade committed Jun 21, 2022
1 parent efe0d85 commit c67c1cd
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions assets/watson.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
jQuery(function($){


/*
|--------------------------------------------------------------------------
| Allgemeines
|--------------------------------------------------------------------------
|
|
*/

var $watson_id = getUrlParameter('watson_id');
Expand Down Expand Up @@ -83,8 +79,6 @@ jQuery(function($){
|--------------------------------------------------------------------------
| Watson
|--------------------------------------------------------------------------
|
|
*/

// instantiate the typeahead UI
Expand All @@ -102,21 +96,21 @@ jQuery(function($){
});

$(document).keydown(function(e) {
if (($watsonSettings.agentHotkey == '16-32' && e.shiftKey && e.keyCode == 32) ||
($watsonSettings.agentHotkey == '16-17-32' && e.shiftKey && e.ctrlKey && e.keyCode == 32) ||
($watsonSettings.agentHotkey == '16-18-32' && e.shiftKey && e.altKey && e.keyCode == 32) ||
($watsonSettings.agentHotkey == '17-32' && e.ctrlKey && e.keyCode == 32) ||
($watsonSettings.agentHotkey == '17-18-32' && e.ctrlKey && e.altKey && e.keyCode == 32) ||
($watsonSettings.agentHotkey == '17-91-32' && e.ctrlKey && e.metaKey && e.keyCode == 32) ||
($watsonSettings.agentHotkey == '18-32' && e.altKey && e.keyCode == 32)) {
if (($watsonSettings.agentHotkey === '16-32' && e.shiftKey && e.keyCode === 32) ||
($watsonSettings.agentHotkey === '16-17-32' && e.shiftKey && e.ctrlKey && e.keyCode === 32) ||
($watsonSettings.agentHotkey === '16-18-32' && e.shiftKey && e.altKey && e.keyCode === 32) ||
($watsonSettings.agentHotkey === '17-32' && e.ctrlKey && e.keyCode === 32) ||
($watsonSettings.agentHotkey === '17-18-32' && e.ctrlKey && e.altKey && e.keyCode === 32) ||
($watsonSettings.agentHotkey === '17-91-32' && e.ctrlKey && e.metaKey && e.keyCode === 32) ||
($watsonSettings.agentHotkey === '18-32' && e.altKey && e.keyCode === 32)) {

checkWatsonAgent();
}
});

$(document).keyup(function(e) {
// Escape
if (e.keyCode == 27) {
if (e.keyCode === 27) {
hideWatsonAgent();
}
});
Expand Down Expand Up @@ -176,7 +170,7 @@ jQuery(function($){
templates: {
empty: [
'<div class="empty-message">',
'Please sign in.',
'The request failed.',
'</div>'
].join('\n'),
suggestion: function (data) {
Expand Down Expand Up @@ -210,10 +204,10 @@ jQuery(function($){


$watsonTypeahead.keydown(function(e) {
if (($watsonSettings.quicklookHotkey == '16' && e.shiftKey) ||
($watsonSettings.quicklookHotkey == '17' && e.ctrlKey) ||
($watsonSettings.quicklookHotkey == '18' && e.altKey) ||
($watsonSettings.quicklookHotkey == '91' && e.metaKey)
if (($watsonSettings.quicklookHotkey === '16' && e.shiftKey) ||
($watsonSettings.quicklookHotkey === '17' && e.ctrlKey) ||
($watsonSettings.quicklookHotkey === '18' && e.altKey) ||
($watsonSettings.quicklookHotkey === '91' && e.metaKey)
) {
if (typeof($curTypeaheadItem) !== 'undefined' && typeof($curTypeaheadItem.quick_look_url) !== 'undefined') {
quicklook($curTypeaheadItem.quick_look_url);
Expand Down

0 comments on commit c67c1cd

Please sign in to comment.