diff --git a/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js index 0660169f5c..e9ebd53daf 100644 --- a/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js +++ b/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js @@ -26,7 +26,7 @@ title : ed.getLang('advanced.link_desc'), cmd : 'WP_Link' }); - + ed.addShortcut('alt+shift+a', ed.getLang('advanced.link_desc'), 'WP_Link'); // Add a node change handler, selects the button in the UI when a link is selected diff --git a/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js b/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js index e2a4389897..1983a16f2d 100644 --- a/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js +++ b/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js @@ -1,4 +1,4 @@ -(function($){ +(function($){ var inputs = {}, results = {}, ed, wpLink = { timeToTriggerRiver: 150, @@ -15,8 +15,8 @@ var e; // Init shared vars ed = tinyMCEPopup.editor; - - + + // URL inputs.url = $('#url-field'); // Secondary options @@ -29,7 +29,7 @@ results.recent = $('#most-recent-results'); results.search.data('river', wpLink.riverDefaults() ); results.recent.data('river', wpLink.riverDefaults() ); - + // Bind event handlers $('#wp-update').click( wpLink.update ); $('#wp-cancel').click( function() { tinyMCEPopup.close(); } ); @@ -46,11 +46,11 @@ if ( "_blank" == ed.dom.getAttrib(e, 'target') ) inputs.openInNewTab.attr('checked','checked'); } - + // Focus the URL field inputs.url.focus(); }, - + update : function() { var el, ed = tinyMCEPopup.editor, @@ -60,10 +60,10 @@ target : inputs.openInNewTab.attr('checked') ? '_blank' : '' }, e, b, defaultContent = attrs.title ? attrs.title : attrs.href; - + tinyMCEPopup.restoreSelection(); e = ed.dom.getParent(ed.selection.getNode(), 'A'); - + // If the values are empty... if ( ! attrs.href ) { // ...and nothing is selected, we should return @@ -81,12 +81,12 @@ return; } } - + tinyMCEPopup.execCommand("mceBeginUndoLevel"); if (e == null) { ed.getDoc().execCommand("unlink", false, null); - + // If no selection exists, create a new link from scratch. if ( ed.selection.isCollapsed() ) { el = ed.dom.create('a', { href: "#mce_temp_url#" }, defaultContent); @@ -117,7 +117,7 @@ tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); }, - + selectInternalLink : function() { var t = $(this); if ( t.hasClass('unselectable') ) @@ -127,24 +127,24 @@ inputs.url.val( t.children('.item-permalink').val() ); inputs.title.val( t.children('.item-title').text() ); }, - + maybeLoadRiver : function() { var t = $(this), ul = t.children('ul'), river = t.data('river'), bottom = t.scrollTop() + t.height(); - + if ( bottom != ul.height() || river.active || river.allLoaded ) return; - + setTimeout(function() { var newTop = t.scrollTop(), newBottom = newTop + t.height(), waiting = t.find('.river-waiting'); - + if ( bottom != newBottom || newBottom != ul.height() || river.active || river.allLoaded ) return; - + river.active = true; waiting.show(); t.scrollTop( newTop + waiting.outerHeight() ); @@ -163,18 +163,18 @@ searchInternalLinks : function() { var t = $(this), waiting, title = t.val(); - + if ( title.length > 2 ) { results.recent.hide(); results.search.show(); - + // Don't search if the keypress didn't change the title. if ( wpLink.lastSearch == title ) return; - + wpLink.lastSearch = title; waiting = t.siblings('img.waiting').show(); - + results.search.data('river', wpLink.riverDefaults() ); results.search.scrollTop(0); wpLink.linkAJAX( results.search, { title : title }, function(){ waiting.hide(); }); @@ -183,29 +183,29 @@ results.recent.show(); } }, - + linkAJAX : function( $panel, params, callback, opts ) { var response; opts = opts || {}; - + if ( ! $panel.hasClass('query-results') ) $panel = $panel.parents('.query-results'); - + if ( ! $panel.length ) return; - + response = wpLink.delayedCallback( function( results ) { wpLink.processAJAXResponse( $panel, results, callback, opts ); }, opts.delay ); - + $.post( ajaxurl, $.extend({ action : 'wp-link-ajax' }, params ), response, "json" ); }, - + processAJAXResponse: function( $panel, results, callback, opts ) { var list = ''; - + if ( !results ) { if ( !opts.append ) { list += '