( function( $, wpLinkL10n, wp ) {
var editor, searchTimer, River, Query, correctedURL, linkNode,
- emailRegexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i,
- urlRegexp = /^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,4}[^ "]*$/i,
+ emailRegexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i,
+ urlRegexp = /^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,63}[^ "]*$/i,
inputs = {},
rivers = {},
isTouch = ( 'ontouchend' in document );
keySensitivity: 100,
lastSearch: '',
textarea: '',
+ modalOpen: false,
init: function() {
inputs.wrap = $('#wp-link-wrap');
$body = $( document.body );
$body.addClass( 'modal-open' );
+ wpLink.modalOpen = true;
linkNode = node;
wpLink.range = null;
onlyText = this.hasSelectedText( linkNode );
if ( linkNode ) {
- linkText = linkNode.innerText || linkNode.textContent;
+ linkText = linkNode.textContent || linkNode.innerText;
href = editor.dom.getAttrib( linkNode, 'href' );
if ( ! $.trim( linkText ) ) {
close: function( reset ) {
$( document.body ).removeClass( 'modal-open' );
+ wpLink.modalOpen = false;
if ( reset !== 'noReset' ) {
if ( ! wpLink.isMCE() ) {
editor.focus();
editor.nodeChanged();
+ if ( link && editor.plugins.wplink ) {
+ editor.plugins.wplink.checkLink( link );
+ }
+
// Audible confirmation message when a link has been inserted in the Editor.
wp.a11y.speak( wpLinkL10n.linkInserted );
},