From a78706fe3647ca8455293aa21c107b00ea7736da Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 22 Nov 2015 19:26:18 +0000 Subject: [PATCH] Editor: remove wpLink dependency on jQuery UI. Props afercia. Fixes #34716. git-svn-id: https://develop.svn.wordpress.org/trunk@35728 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/wplink.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/js/wplink.js b/src/wp-includes/js/wplink.js index f34a9bea09..b5a84aecb7 100644 --- a/src/wp-includes/js/wplink.js +++ b/src/wp-includes/js/wplink.js @@ -459,13 +459,14 @@ var wpLink; }, keydown: function( event ) { - var fn, id, - key = $.ui.keyCode; + var fn, id; - if ( key.ESCAPE === event.keyCode ) { + // Escape key. + if ( 27 === event.keyCode ) { wpLink.close(); event.stopImmediatePropagation(); - } else if ( key.TAB === event.keyCode ) { + // Tab key. + } else if ( 9 === event.keyCode ) { id = event.target.id; // wp-link-submit must always be the last focusable element in the dialog. @@ -479,7 +480,8 @@ var wpLink; } } - if ( event.keyCode !== key.UP && event.keyCode !== key.DOWN ) { + // Up Arrow and Down Arrow keys. + if ( 38 !== event.keyCode && 40 !== event.keyCode ) { return; } @@ -488,7 +490,8 @@ var wpLink; return; } - fn = event.keyCode === key.UP ? 'prev' : 'next'; + // Up Arrow key. + fn = 38 === event.keyCode ? 'prev' : 'next'; clearInterval( wpLink.keyInterval ); wpLink[ fn ](); wpLink.keyInterval = setInterval( wpLink[ fn ], wpLink.keySensitivity ); @@ -496,9 +499,8 @@ var wpLink; }, keyup: function( event ) { - var key = $.ui.keyCode; - - if ( event.which === key.UP || event.which === key.DOWN ) { + // Up Arrow and Down Arrow keys. + if ( 38 === event.keyCode || 40 === event.keyCode ) { clearInterval( wpLink.keyInterval ); event.preventDefault(); }