From 8f49dcf74b99c8546f19625c6a85179a7fc225c7 Mon Sep 17 00:00:00 2001 From: josemigallas Date: Mon, 6 May 2024 14:55:16 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9E=96=E2=9A=B0=EF=B8=8F=20removes=20dead=20?= =?UTF-8?q?code:=20Mousetrap.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provider/admin/cms/templates.js | 18 ------------------ app/assets/javascripts/provider/cms.js | 1 - app/assets/javascripts/vendor/mousetrap.min.js | 8 -------- app/inputs/codemirror_input.rb | 2 +- app/javascript/src/Types/globals.d.ts | 7 ------- 5 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 app/assets/javascripts/vendor/mousetrap.min.js diff --git a/app/assets/javascripts/provider/admin/cms/templates.js b/app/assets/javascripts/provider/admin/cms/templates.js index 0e4d0e00b2..fa1a78f18f 100644 --- a/app/assets/javascripts/provider/admin/cms/templates.js +++ b/app/assets/javascripts/provider/admin/cms/templates.js @@ -22,24 +22,6 @@ toggledInputsInit(); }); - // keyboard actions - // - (function(){ - var save = function(){ - $("#cms_template_submit").click(); - }; - // this makes mousetrap work inside codemirror - // just have to load it in right time (after textarea is created) - // - // $(".CodeMirror textarea").addClass("mousetrap"); - - Mousetrap.bind(['meta+s', 'ctrl+s', 'command+s'], function(e){ - save(); - return false; - }); - - }()); - // init change detection $(window).on('beforeunload', function(e){ var textareas = $(".codemirror textarea[name]"), diff --git a/app/assets/javascripts/provider/cms.js b/app/assets/javascripts/provider/cms.js index 3bcdcc2623..29af29ba32 100644 --- a/app/assets/javascripts/provider/cms.js +++ b/app/assets/javascripts/provider/cms.js @@ -1,4 +1,3 @@ -//= require vendor/mousetrap.min.js //= require vendor/jquery.tipsy.js //= require vendor/jquery/extensions/jquery.cookie.js //= require jquery.pjax.js diff --git a/app/assets/javascripts/vendor/mousetrap.min.js b/app/assets/javascripts/vendor/mousetrap.min.js deleted file mode 100644 index 9b5638e135..0000000000 --- a/app/assets/javascripts/vendor/mousetrap.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* mousetrap v1.1.1 craig.is/killing/mice */ -window.Mousetrap=function(){function o(a,c,b){if(a.addEventListener)return a.addEventListener(c,b,!1);a.attachEvent("on"+c,b)}function u(a){return"keypress"==a.type?String.fromCharCode(a.which):h[a.which]?h[a.which]:v[a.which]?v[a.which]:String.fromCharCode(a.which).toLowerCase()}function p(a){var a=a||{},c=!1,b;for(b in l)a[b]?c=!0:l[b]=0;c||(n=!1)}function w(a,c,b,d,C){var g,e,f=[];if(!j[a])return[];"keyup"==b&&q(a)&&(c=[a]);for(g=0;gd||h.hasOwnProperty(d)&&(k[h[d]]=d)}b=k[a]?"keydown":"keypress"}"keypress"===b&&c.length&&(b="keydown"); -return b}function y(a,c,b,d,f){var a=a.replace(/\s+/g," "),g=a.split(" "),e,h,i=[];if(1":".","?":"/","|":"\\"},A={option:"alt",command:"meta","return":"enter",escape:"esc"},k,j={},i={},l={},z,t=!1,n=!1,f=1;20>f;++f)h[111+f]="f"+f;for(f=96;106>f;++f)h[f]=f-96;o(document,"keypress",s);o(document,"keydown",s);o(document,"keyup",s);return{bind:function(a,c,b){for(var d=a instanceof Array?a:[a],f=0;f = Required> & T - // Defined in app/assets/javascripts/vendor/mousetrap.min.js - // imported in app/assets/javascripts/provider/cms.js - // used in app/javascript/packs/cms.ts - namespace Mousetrap { - function bind (arr: unknown[], fun: (event: unknown) => false): void - } - namespace ThreeScale { // Made globally available in assets/javascripts/provider/cms/sidebar.js.coffee and available // eslint-disable-next-line @typescript-eslint/no-extraneous-class