diff --git a/THIRD_PARTY.txt b/THIRD_PARTY.txt index 0ff2a5f2..5312e43b 100644 --- a/THIRD_PARTY.txt +++ b/THIRD_PARTY.txt @@ -959,6 +959,7 @@ https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment-with-locales.min. https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment-with-langs.min.js https://cdnjs.cloudflare.com/ajax/libs/mootools/1.4.5/mootools-core-full-compat-yc.min.js https://cdnjs.cloudflare.com/ajax/libs/mootools/1.6.0/mootools-core.min.js +https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.6.5/mousetrap.min.js https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/14.7.0/nouislider.min.js https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/15.8.1/nouislider.min.js https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css diff --git a/core/mappings.js b/core/mappings.js index 8700151d..20d96603 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -426,6 +426,8 @@ mappings.cdn = { 'moment.js/{version}/moment.min.': resources.moment, 'moment.js/{version}/moment-with-locales.': resources.moment, 'mootools/{version}/mootools-core': resources.mootools, + 'mousetrap/{version}/mousetrap.min.js': resources.mousetrap, + 'mousetrap/{version}/mousetrap.js': resources.mousetrap, 'nprogress/{version}/nprogress.min.js': resources.nprogressJS, 'nprogress/{version}/nprogress.js': resources.nprogressJS, 'nprogress/{version}/nprogress.min.css': resources.nprogressCSS, diff --git a/core/resources.js b/core/resources.js index 9d078c68..399d9427 100644 --- a/core/resources.js +++ b/core/resources.js @@ -785,6 +785,10 @@ let resources = { 'mootools': { 'path': 'resources/mootools/{version}/mootools-core.min.jsm' }, + // mousetrap + 'mousetrap': { + 'path': 'resources/mousetrap/{version}/mousetrap.min.jsm' + }, // ngx-bootstrap datepicker 'ngxBootstrapDatepicker': { 'path': 'resources/ngx-bootstrap/{version}/datepicker/bs-datepicker.css' diff --git a/modules/internal/targets.js b/modules/internal/targets.js index e3b0ec7f..086cb3be 100644 --- a/modules/internal/targets.js +++ b/modules/internal/targets.js @@ -350,6 +350,7 @@ targets.setLastVersion = function (type, version) { if (helpers.compareVersion('1.4.5', version)) return '1.4.5'; // <= v1.4.5 return '1.6.0'; } + if (type.startsWith('/mousetrap/1.')) return '1.6.5'; if (type.startsWith('/ngx-bootstrap/')) { // The only resource used from ngx-bootstrap is the CSS file for the datepicker. // This CSS is unchanged since version 7. So it's not necessary to host it more than once. @@ -519,6 +520,7 @@ targets.determineResourceName = function (filename) { }; const ListOfFiles = { + 'mousetrap.min.jsm': 'mousetrap', 'jquery.powertip.min.jsm': 'jquery-powertip', 'jsrender.min.jsm': 'jsrender', 'supabase.min.jsm': 'supabase-js', diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 39469c92..c78cab1a 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -28,6 +28,7 @@

Added

diff --git a/resources/mousetrap/1.6.5/mousetrap.min.jsm b/resources/mousetrap/1.6.5/mousetrap.min.jsm new file mode 100644 index 00000000..185c42fd --- /dev/null +++ b/resources/mousetrap/1.6.5/mousetrap.min.jsm @@ -0,0 +1,11 @@ +/* mousetrap v1.6.5 craig.is/killing/mice */ +(function(q,u,c){function v(a,b,g){a.addEventListener?a.addEventListener(b,g,!1):a.attachEvent("on"+b,g)}function z(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return n[a.which]?n[a.which]:r[a.which]?r[a.which]:String.fromCharCode(a.which).toLowerCase()}function F(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function w(a){return"shift"==a||"ctrl"==a||"alt"==a|| +"meta"==a}function A(a,b){var g,d=[];var e=a;"+"===e?e=["+"]:(e=e.replace(/\+{2}/g,"+plus"),e=e.split("+"));for(g=0;gc||n.hasOwnProperty(c)&&(p[n[c]]=c)}g=p[e]?"keydown":"keypress"}"keypress"==g&&d.length&&(g="keydown");return{key:m,modifiers:d,action:g}}function D(a,b){return null===a||a===u?!1:a===b?!0:D(a.parentNode,b)}function d(a){function b(a){a= +a||{};var b=!1,l;for(l in p)a[l]?b=!0:p[l]=0;b||(x=!1)}function g(a,b,t,f,g,d){var l,E=[],h=t.type;if(!k._callbacks[a])return[];"keyup"==h&&w(a)&&(b=[a]);for(l=0;l":".","?":"/","|":"\\"},B={option:"alt",command:"meta","return":"enter", +escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p;for(c=1;20>c;++c)n[111+c]="f"+c;for(c=0;9>=c;++c)n[c+96]=c.toString();d.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};d.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};d.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};d.prototype.reset=function(){this._callbacks={}; +this._directMap={};return this};d.prototype.stopCallback=function(a,b){if(-1<(" "+b.className+" ").indexOf(" mousetrap ")||D(b,this.target))return!1;if("composedPath"in a&&"function"===typeof a.composedPath){var c=a.composedPath()[0];c!==a.target&&(b=c)}return"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};d.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};d.addKeycodes=function(a){for(var b in a)a.hasOwnProperty(b)&&(n[b]=a[b]);p=null}; +d.init=function(){var a=d(u),b;for(b in a)"_"!==b.charAt(0)&&(d[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};d.init();q.Mousetrap=d;"undefined"!==typeof module&&module.exports&&(module.exports=d);"function"===typeof define&&define.amd&&define(function(){return d})}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null);