Updated inputosaurus.js to work with jQuery3

This commit is contained in:
djmaze 2020-07-09 16:01:41 +02:00
parent be6922bd20
commit eb731a4183
3 changed files with 6 additions and 25 deletions

View file

@ -44,5 +44,5 @@ This fork has modifications for:
* CRLF => LF line endings * CRLF => LF line endings
* Use gulp-terser instead of gulp-uglify * Use gulp-terser instead of gulp-uglify
* ES2015 (without polyfills) * ES2015 (without polyfills)
* No JS nanoscroll * No JS nanoscroll, jquery-scrollstop, jquery-mousewheel, matchmedia-polyfill
* Auth failed attempts written to syslog * Auth failed attempts written to syslog

View file

@ -14,6 +14,7 @@
* @created October 3,2012 * @created October 3,2012
* *
* @modified by RainLoop Team * @modified by RainLoop Team
* @modified by DJMaze
*/ */
@ -184,7 +185,7 @@
$menuItems = menu.element.find('li'); $menuItems = menu.element.find('li');
// activate single item to allow selection upon pressing 'Enter' // activate single item to allow selection upon pressing 'Enter'
if($menuItems.size() === 1){ if($menuItems.length === 1){
menu[menu.activate ? 'activate' : 'focus']($.Event('click'), $menuItems); menu[menu.activate ? 'activate' : 'focus']($.Event('click'), $menuItems);
} }
} }
@ -236,12 +237,12 @@
values = hook; values = hook;
} else if(delimiterFound !== false){ } else if(delimiterFound !== false){
values = val.split(delimiterFound); values = val.split(delimiterFound);
} else if(!ev || ev.which === $.ui.keyCode.ENTER && !$('.ui-menu-item .ui-state-focus').size() && !$('#ui-active-menuitem').size()){ } else if(!ev || ev.which === $.ui.keyCode.ENTER && !$('.ui-menu-item .ui-state-focus').length && !$('#ui-active-menuitem').length){
values.push(val); values.push(val);
ev && ev.preventDefault(); ev && ev.preventDefault();
// prevent autoComplete menu click from causing a false 'blur' // prevent autoComplete menu click from causing a false 'blur'
} else if(ev.type === 'blur' && !$('#ui-active-menuitem').size()){ } else if(ev.type === 'blur' && !$('#ui-active-menuitem').length){
values.push(val); values.push(val);
} }
@ -324,7 +325,7 @@
// IE goes back in history if the event isn't stopped // IE goes back in history if the event isn't stopped
ev.stopPropagation(); ev.stopPropagation();
if((!$(ev.currentTarget).val() || (('selectionStart' in ev.currentTarget) && ev.currentTarget.selectionStart === 0 && ev.currentTarget.selectionEnd === 0)) && lastTag.size()){ if((!$(ev.currentTarget).val() || (('selectionStart' in ev.currentTarget) && ev.currentTarget.selectionStart === 0 && ev.currentTarget.selectionEnd === 0)) && lastTag.length){
ev.preventDefault(); ev.preventDefault();
lastTag.find('a').focus(); lastTag.find('a').focus();
} }

View file

@ -4072,21 +4072,6 @@ jquery-backstretch@2.1.18:
dependencies: dependencies:
jquery "^3.1.1" jquery "^3.1.1"
jquery-migrate@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/jquery-migrate/-/jquery-migrate-3.1.0.tgz#8158de74cca39fb7fc2635db570151ae7ce3ddea"
integrity sha512-u/MtE1ST2pCr3rCyouJG2xMiw/k3OzLNeRKprjKTeHUezCGr0DyEgeXFdqFLmQfxfR5EsVu+mGo/sCcYdiYcIQ==
jquery-mousewheel@3.1.13:
version "3.1.13"
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5"
jquery-scrollstop@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/jquery-scrollstop/-/jquery-scrollstop-1.2.0.tgz#f1827a25cf12887d965c085d8a75035655b37663"
dependencies:
jquery ">=1.2.3"
jquery@3.4.1: jquery@3.4.1:
version "3.4.1" version "3.4.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
@ -4605,11 +4590,6 @@ matchdep@^2.0.0:
resolve "^1.4.0" resolve "^1.4.0"
stack-trace "0.0.10" stack-trace "0.0.10"
matchmedia-polyfill@0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/matchmedia-polyfill/-/matchmedia-polyfill-0.3.2.tgz#4666e252aead72e8dd232a9fbde5d93fa50497d3"
integrity sha512-B2zRzjqxZFUusBZrZux59XFFLoTN99SbGranxIHfjZVLGZuy8Iaf/s5iNR3qJwRQZBjBKsU6qBSUCltLV82gdw==
md5.js@^1.3.4: md5.js@^1.3.4:
version "1.3.5" version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"