<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16399] trunk/wp-includes/js/tinymce:
  Internal linking functionality updates.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16399">16399</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-11-16 05:11:41 +0000 (Tue, 16 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Internal linking functionality updates. Scrap pagination for a river of results. props koopersmith, see <a href="http://trac.wordpress.org/ticket/11420">#11420</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjstinymcepluginswplinkeditor_plugindevjs">trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkeditor_pluginjs">trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkjswplinkdevjs">trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkjswplinkjs">trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js</a></li>
<li><a href="#trunkwpincludesjstinymcewpmcelinkincludesphp">trunk/wp-includes/js/tinymce/wp-mce-link-includes.php</a></li>
<li><a href="#trunkwpincludesjstinymcewpmcelinkphp">trunk/wp-includes/js/tinymce/wp-mce-link.php</a></li>
<li><a href="#trunkwpincludesjstinymcewptinymcejsgz">trunk/wp-includes/js/tinymce/wp-tinymce.js.gz</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjstinymcepluginswplinkeditor_plugindevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js (16398 => 16399)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js        2010-11-16 04:25:14 UTC (rev 16398)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js        2010-11-16 05:11:41 UTC (rev 16399)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx">                                 ed.windowManager.open({
</span><span class="cx">                                         file : tinymce.baseURL + '/wp-mce-link.php',
</span><span class="cx">                                         width : 480,
</span><del>-                                        height : 400,
</del><ins>+                                        height : 430,
</ins><span class="cx">                                         inline : 1
</span><span class="cx">                                 }, {
</span><span class="cx">                                         plugin_url : url // Plugin absolute URL
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkeditor_pluginjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js (16398 => 16399)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js        2010-11-16 04:25:14 UTC (rev 16398)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js        2010-11-16 05:11:41 UTC (rev 16399)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(){tinymce.create(&quot;tinymce.plugins.wpLink&quot;,{init:function(a,b){a.addCommand(&quot;WP_Link&quot;,function(){a.windowManager.open({file:tinymce.baseURL+&quot;/wp-mce-link.php&quot;,width:480,height:400,inline:1},{plugin_url:b})});a.addButton(&quot;link&quot;,{title:a.getLang(&quot;advanced.link_desc&quot;),cmd:&quot;WP_Link&quot;});a.addShortcut(&quot;alt+shift+a&quot;,a.getLang(&quot;advanced.link_desc&quot;),&quot;WP_Link&quot;);a.onNodeChange.add(function(d,c,e){c.setActive(&quot;wplink&quot;,e.nodeName==&quot;A&quot;)})},getInfo:function(){return{longname:&quot;WordPress Link Dialog&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;&quot;,version:&quot;1.0&quot;}}});tinymce.PluginManager.add(&quot;wplink&quot;,tinymce.plugins.wpLink)})();
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(){tinymce.create(&quot;tinymce.plugins.wpLink&quot;,{init:function(a,b){a.addCommand(&quot;WP_Link&quot;,function(){a.windowManager.open({file:tinymce.baseURL+&quot;/wp-mce-link.php&quot;,width:480,height:430,inline:1},{plugin_url:b})});a.addButton(&quot;link&quot;,{title:a.getLang(&quot;advanced.link_desc&quot;),cmd:&quot;WP_Link&quot;});a.addShortcut(&quot;alt+shift+a&quot;,a.getLang(&quot;advanced.link_desc&quot;),&quot;WP_Link&quot;);a.onNodeChange.add(function(d,c,e){c.setActive(&quot;wplink&quot;,e.nodeName==&quot;A&quot;)})},getInfo:function(){return{longname:&quot;WordPress Link Dialog&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;&quot;,version:&quot;1.0&quot;}}});tinymce.PluginManager.add(&quot;wplink&quot;,tinymce.plugins.wpLink)})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkjswplinkdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js (16398 => 16399)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2010-11-16 04:25:14 UTC (rev 16398)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2010-11-16 05:11:41 UTC (rev 16399)
</span><span class="lines">@@ -1,8 +1,16 @@
</span><span class="cx"> (function($){        
</span><span class="cx">         var inputs = {}, results = {}, ed,
</span><span class="cx">         wpLink = {
</span><ins>+                lastSearch: '',
+                riverDefaults: function() {
+                        return {
+                                page : 2,
+                                allLoaded: false,
+                                active: false
+                        };
+                },
</ins><span class="cx">                 init : function() {
</span><del>-                        var e, etarget, eclass;
</del><ins>+                        var e;
</ins><span class="cx">                         // Init shared vars
</span><span class="cx">                         ed = tinyMCEPopup.editor;
</span><span class="cx">                         
</span><span class="lines">@@ -17,12 +25,14 @@
</span><span class="cx">                         // Result lists
</span><span class="cx">                         results.search = $('#search-results');
</span><span class="cx">                         results.recent = $('#most-recent-results');
</span><ins>+                        results.search.data('river', wpLink.riverDefaults() );
+                        results.recent.data('river', wpLink.riverDefaults() );
</ins><span class="cx">                         
</span><span class="cx">                         // Bind event handlers
</span><span class="cx">                         $('#wp-update').click( wpLink.update );
</span><span class="cx">                         $('#wp-cancel').click( function() { tinyMCEPopup.close(); } );
</span><span class="cx">                         $('.query-results').delegate('li', 'click', wpLink.selectInternalLink );
</span><del>-                        $('.wp-results-pagelinks').delegate('a', 'click', wpLink.selectPageLink );
</del><ins>+                        $('.query-results').scroll( wpLink.maybeLoadRiver );
</ins><span class="cx">                         inputs.search.keyup( wpLink.searchInternalLinks );
</span><span class="cx"> 
</span><span class="cx">                         // If link exists, select proper values.
</span><span class="lines">@@ -34,6 +44,9 @@
</span><span class="cx">                                 if ( &quot;_blank&quot; == ed.dom.getAttrib(e, 'target') )
</span><span class="cx">                                         inputs.openInNewTab.attr('checked','checked');
</span><span class="cx">                         }
</span><ins>+                        
+                        // Focus the URL field
+                        inputs.url.focus();
</ins><span class="cx">                 },
</span><span class="cx">                 
</span><span class="cx">                 update : function() {
</span><span class="lines">@@ -74,7 +87,7 @@
</span><span class="cx">                                 
</span><span class="cx">                                 // If no selection exists, create a new link from scratch.
</span><span class="cx">                                 if ( ed.selection.isCollapsed() ) {
</span><del>-                                        var el = ed.dom.create('a', { href: &quot;#mce_temp_url#&quot; }, defaultContent);
</del><ins>+                                        el = ed.dom.create('a', { href: &quot;#mce_temp_url#&quot; }, defaultContent);
</ins><span class="cx">                                         ed.selection.setNode(el);
</span><span class="cx">                                 // If a selection exists, wrap it in a link.
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -113,23 +126,43 @@
</span><span class="cx">                         inputs.title.val( t.children('.item-title').text() );
</span><span class="cx">                 },
</span><span class="cx">                 
</span><del>-                selectPageLink : function(e) {
-                        var page = e.target.href.match(/page=(\d+)/);
</del><ins>+                maybeLoadRiver : function() {
+                        var t = $(this),
+                                ul = t.children('ul'),
+                                river = t.data('river'),
+                                waiting = t.find('.river-waiting');
</ins><span class="cx">                         
</span><del>-                        page = page ? page[1] : 1; // If there's no match, it's the first page.
-                        e.preventDefault(); // Prevent the link from redirecting.
</del><ins>+                        if( t.scrollTop() + t.height() != ul.height() || river.active || river.allLoaded )
+                                return;
</ins><span class="cx">                         
</span><del>-                        wpLink.linkAJAX( $(this), { page : page });
</del><ins>+                        river.active = true;
+                        waiting.show();
+                        
+                        wpLink.linkAJAX( t, { page : river.page }, function(r) {
+                                river.page++;
+                                river.active = false;
+                                river.allLoaded = !r;
+                                waiting.hide();
+                        }, true);
</ins><span class="cx">                 },
</span><span class="cx">                 
</span><span class="cx">                 searchInternalLinks : function() {
</span><span class="cx">                         var t = $(this), waiting,
</span><span class="cx">                                 title = t.val();
</span><span class="cx">                         
</span><del>-                        if ( title ) {
</del><ins>+                        if ( title.length &gt; 2 ) {
</ins><span class="cx">                                 results.recent.hide();
</span><span class="cx">                                 results.search.show();
</span><ins>+                                
+                                // Don't search if the keypress didn't change the title.
+                                if ( wpLink.lastSearch == title )
+                                        return;
+                                
+                                wpLink.lastSearch = title;
</ins><span class="cx">                                 waiting = t.siblings('img.waiting').show();
</span><ins>+                                
+                                results.search.data('river', wpLink.riverDefaults() );
+                                results.search.scrollTop(0);
</ins><span class="cx">                                 wpLink.linkAJAX( results.search, { title : title }, function(){ waiting.hide(); });
</span><span class="cx">                         } else {
</span><span class="cx">                                 results.search.hide();
</span><span class="lines">@@ -137,7 +170,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 },
</span><span class="cx">                 
</span><del>-                linkAJAX : function( $panel, params, callback ) {
</del><ins>+                linkAJAX : function( $panel, params, callback, append ) {
</ins><span class="cx">                         if ( ! $panel.hasClass('query-results') )
</span><span class="cx">                                 $panel = $panel.parents('.query-results');
</span><span class="cx">                         
</span><span class="lines">@@ -146,38 +179,31 @@
</span><span class="cx">                         
</span><span class="cx">                         $.post( ajaxurl, $.extend({
</span><span class="cx">                                 action : 'wp-link-ajax'
</span><del>-                        }, params ), function(r) {
-                                var pagelinks = $panel.children('.wp-results-pagelinks');
</del><ins>+                        }, params ), function( results ) {
+                                var list = '';
</ins><span class="cx">                                 
</span><ins>+                                if ( !results ) {
+                                        if ( !append ) {
+                                                list += '&lt;li class=&quot;no-matches-found unselectable&quot;&gt;&lt;span class=&quot;item-title&quot;&gt;&lt;em&gt;'
+                                                + wpLinkL10n.noMatchesFound
+                                                + '&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;';
+                                        }
+                                } else {
+                                        $.each( results, function() {
+                                                list += '&lt;li&gt;&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;' + this['permalink'] + '&quot; /&gt;';
+                                                list += '&lt;span class=&quot;item-title&quot;&gt;';
+                                                list += this['title'] ? this['title'] : '&lt;em&gt;'+ wpLinkL10n.untitled + '&lt;/em&gt;';
+                                                list += '&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;' + this['info'] + '&lt;/span&gt;&lt;/li&gt;';
+                                        });
+                                }
+                                
</ins><span class="cx">                                 // Set results
</span><del>-                                $panel.children('ul').html( wpLink.generateListMarkup( r['results'] ) );
</del><ins>+                                $panel.children('ul')[ append ? 'append' : 'html' ]( list );
</ins><span class="cx">                                 
</span><del>-                                // Handle page links
-                                if ( r['page_links'] )
-                                        pagelinks.html( r['page_links'] ).show();
-                                else
-                                        pagelinks.hide();
-                                
</del><span class="cx">                                 // Run callback
</span><span class="cx">                                 if ( callback )
</span><del>-                                        callback( r['results'] );
</del><ins>+                                        callback( results );
</ins><span class="cx">                         }, &quot;json&quot; );
</span><del>-                },
-                
-                generateListMarkup : function( results ) {
-                        var s = '';
-                        
-                        if ( ! results )
-                                return '&lt;li class=&quot;no-matches-found unselectable&quot;&gt;&lt;span class=&quot;item-title&quot;&gt;&lt;em&gt;' + wpLinkL10n.noMatchesFound + '&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;';
-                        
-                        $.each( results, function() {
-                                s+= '&lt;li&gt;&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;' + this['permalink'] + '&quot; /&gt;';
-                                s+= '&lt;span class=&quot;item-title&quot;&gt;'
-                                s+= this['title'] ? this['title'] : '&lt;em&gt;'+ wpLinkL10n.untitled + '&lt;/em&gt;';
-                                s+= '&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;' + this['info'] + '&lt;/span&gt;';
-                                s+= '&lt;/li&gt;';
-                        });
-                        return s;
</del><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkjswplinkjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js (16398 => 16399)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js        2010-11-16 04:25:14 UTC (rev 16398)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js        2010-11-16 05:11:41 UTC (rev 16399)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(d){var a={},c={},b,e={init:function(){var h,g,f;b=tinyMCEPopup.editor;a.url=d(&quot;#url-field&quot;);a.title=d(&quot;#link-title-field&quot;);a.openInNewTab=d(&quot;#link-target-checkbox&quot;);a.search=d(&quot;#search-field&quot;);c.search=d(&quot;#search-results&quot;);c.recent=d(&quot;#most-recent-results&quot;);d(&quot;#wp-update&quot;).click(e.update);d(&quot;#wp-cancel&quot;).click(function(){tinyMCEPopup.close()});d(&quot;.query-results&quot;).delegate(&quot;li&quot;,&quot;click&quot;,e.selectInternalLink);d(&quot;.wp-results-pagelinks&quot;).delegate(&quot;a&quot;,&quot;click&quot;,e.selectPageLink);a.search.keyup(e.searchInternalLinks);if(h=b.dom.getParent(b.selection.getNode(),&quot;A&quot;)){a.url.val(h.href);a.title.val(b.dom.getAttrib(h,&quot;title&quot;));if(&quot;_blank&quot;==b.dom.getAttrib(h,&quot;target&quot;)){a.openInNewTab.attr(&quot;checked&quot;,&quot;checked&quot;)}}},update:function(){var j,g=tinyMCEPopup.editor,h={href:a.url.val(),title:a.title.val(),target:a.openInNewTab.attr(&quot;checked&quot;)?&quot;_blank&quot;:&quot;&quot;},k,f,i=h.title?h.title:h.href;tinyMCEPopup.restoreSelection();k=g.dom.getParent(g.selection.getNode(),&quot;A&quot;);if(!h.href){if(g.selection.isCollapsed()){tinyMCEPopup.close();return}else{if(k){tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);f=g.selection.getBookmark();g.dom.remove(k,1);g.selection.moveToBookmark(f);tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close();return}}}tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);if(k==null){g.getDoc().execCommand(&quot;unlink&quot;,false,null);if(g.selection.isCollapsed()){var j=g.dom.create(&quot;a&quot;,{href:&quot;#mce_temp_url#&quot;},i);g.selection.setNode(j)}else{tinyMCEPopup.execCommand(&quot;CreateLink&quot;,false,&quot;#mce_temp_url#&quot;,{skip_undo:1})}tinymce.each(g.dom.select(&quot;a&quot;),function(l){if(g.dom.getAttrib(l,&quot;href&quot;)==&quot;#mce_temp_url#&quot;){k=l;g.dom.setAttribs(k,h)}})}else{g.dom.setAttribs(k,h)}if(k.childNodes.length!=1||k.firstChild.nodeName!=&quot;IMG&quot;){g.focus();g.selection.select(k);g.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close()},selectInternalLink:function(){var f=d(this);if(f.hasClass(&quot;unselectable&quot;)){return}f.siblings(&quot;.selected&quot;).removeClass(&quot;selected&quot;);f.addClass(&quot;selected&quot;);a.url.val(f.children(&quot;.item-permalink&quot;).val());a.title.val(f.children(&quot;.item-title&quot;).text())},selectPageLink:function(g){var f=g.target.href.match(/page=(\d+)/);f=f?f[1]:1;g.preventDefault();e.linkAJAX(d(this),{page:f})},searchInternalLinks:function(){var f=d(this),h,g=f.val();if(g){c.recent.hide();c.search.show();h=f.siblings(&quot;img.waiting&quot;).show();e.linkAJAX(c.search,{title:g},function(){h.hide()})}else{c.search.hide();c.recent.show()}},linkAJAX:function(g,f,h){if(!g.hasClass(&quot;query-results&quot;)){g=g.parents(&quot;.query-results&quot;)}if(!g.length){return}d.post(ajaxurl,d.extend({action:&quot;wp-link-ajax&quot;},f),function(j){var i=g.children(&quot;.wp-results-pagelinks&quot;);g.children(&quot;ul&quot;).html(e.generateListMarkup(j.results));if(j.page_links){i.html(j.page_links).show()}else{i.hide()}if(h){h(j.results)}},&quot;json&quot;)},generateListMarkup:function(f){var g=&quot;&quot;;if(!f){return'&lt;li class=&quot;no-matches-found unselectable&quot;&gt;&lt;span class=&quot;item-title&quot;&gt;&lt;em&gt;'+wpLinkL10n.noMatchesFound+&quot;&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&quot;}d.each(f,function(){g+='&lt;li&gt;&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;'+this[&quot;permalink&quot;]+'&quot; /&gt;';g+='&lt;span class=&quot;item-title&quot;&gt;';g+=this[&quot;title&quot;]?this[&quot;title&quot;]:&quot;&lt;em&gt;&quot;+wpLinkL10n.untitled+&quot;&lt;/em&gt;&quot;;g+='&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;'+this[&quot;info&quot;]+&quot;&lt;/span&gt;&quot;;g+=&quot;&lt;/li&gt;&quot;});return g}};d(document).ready(e.init)})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(d){var a={},c={},b,e={lastSearch:&quot;&quot;,riverDefaults:function(){return{page:2,allLoaded:false,active:false}},init:function(){var f;b=tinyMCEPopup.editor;a.url=d(&quot;#url-field&quot;);a.title=d(&quot;#link-title-field&quot;);a.openInNewTab=d(&quot;#link-target-checkbox&quot;);a.search=d(&quot;#search-field&quot;);c.search=d(&quot;#search-results&quot;);c.recent=d(&quot;#most-recent-results&quot;);c.search.data(&quot;river&quot;,e.riverDefaults());c.recent.data(&quot;river&quot;,e.riverDefaults());d(&quot;#wp-update&quot;).click(e.update);d(&quot;#wp-cancel&quot;).click(function(){tinyMCEPopup.close()});d(&quot;.query-results&quot;).delegate(&quot;li&quot;,&quot;click&quot;,e.selectInternalLink);d(&quot;.query-results&quot;).scroll(e.maybeLoadRiver);a.search.keyup(e.searchInternalLinks);if(f=b.dom.getParent(b.selection.getNode(),&quot;A&quot;)){a.url.val(f.href);a.title.val(b.dom.getAttrib(f,&quot;title&quot;));if(&quot;_blank&quot;==b.dom.getAttrib(f,&quot;target&quot;)){a.openInNewTab.attr(&quot;checked&quot;,&quot;checked&quot;)}}a.url.focus()},update:function(){var j,g=tinyMCEPopup.editor,h={href:a.url.val(),title:a.title.val(),target:a.openInNewTab.attr(&quot;checked&quot;)?&quot;_blank&quot;:&quot;&quot;},k,f,i=h.title?h.title:h.href;tinyMCEPopup.restoreSelection();k=g.dom.getParent(g.selection.getNode(),&quot;A&quot;);if(!h.href){if(g.selection.isCollapsed()){tinyMCEPopup.close();return}else{if(k){tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);f=g.selection.getBookmark();g.dom.remove(k,1);g.selection.moveToBookmark(f);tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close();return}}}tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);if(k==null){g.getDoc().execCommand(&quot;unlink&quot;,false,null);if(g.selection.isCollapsed()){j=g.dom.create(&quot;a&quot;,{href:&quot;#mce_temp_url#&quot;},i);g.selection.setNode(j)}else{tinyMCEPopup.execCommand(&quot;CreateLink&quot;,false,&quot;#mce_temp_url#&quot;,{skip_undo:1})}tinymce.each(g.dom.select(&quot;a&quot;),function(l){if(g.dom.getAttrib(l,&quot;href&quot;)==&quot;#mce_temp_url#&quot;){k=l;g.dom.setAttribs(k,h)}})}else{g.dom.setAttribs(k,h)}if(k.childNodes.length!=1||k.firstChild.nodeName!=&quot;IMG&quot;){g.focus();g.selection.select(k);g.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close()},selectInternalLink:function(){var f=d(this);if(f.hasClass(&quot;unselectable&quot;)){return}f.siblings(&quot;.selected&quot;).removeClass(&quot;selected&quot;);f.addClass(&quot;selected&quot;);a.url.val(f.children(&quot;.item-permalink&quot;).val());a.title.val(f.children(&quot;.item-title&quot;).text())},maybeLoadRiver:function(){var g=d(this),f=g.children(&quot;ul&quot;),h=g.data(&quot;river&quot;),i=g.find(&quot;.river-waiting&quot;);if(g.scrollTop()+g.height()!=f.height()||h.active||h.allLoaded){return}h.active=true;i.show();e.linkAJAX(g,{page:h.page},function(j){h.page++;h.active=false;h.allLoaded=!j;i.hide()},true)},searchInternalLinks:function(){var f=d(this),h,g=f.val();if(g.length&gt;2){c.recent.hide();c.search.show();if(e.lastSearch==g){return}e.lastSearch=g;h=f.siblings(&quot;img.waiting&quot;).show();c.search.data(&quot;river&quot;,e.riverDefaults());c.search.scrollTop(0);e.linkAJAX(c.search,{title:g},function(){h.hide()})}else{c.search.hide();c.recent.show()}},linkAJAX:function(h,g,i,f){if(!h.hasClass(&quot;query-results&quot;)){h=h.parents(&quot;.query-results&quot;)}if(!h.length){return}d.post(ajaxurl,d.extend({action:&quot;wp-link-ajax&quot;},g),function(j){var k=&quot;&quot;;if(!j){if(!f){k+='&lt;li class=&quot;no-matches-found unselectable&quot;&gt;&lt;span class=&quot;item-title&quot;&gt;&lt;em&gt;'+wpLinkL10n.noMatchesFound+&quot;&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&quot;}}else{d.each(j,function(){k+='&lt;li&gt;&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;'+this[&quot;permalink&quot;]+'&quot; /&gt;';k+='&lt;span class=&quot;item-title&quot;&gt;';k+=this[&quot;title&quot;]?this[&quot;title&quot;]:&quot;&lt;em&gt;&quot;+wpLinkL10n.untitled+&quot;&lt;/em&gt;&quot;;k+='&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;'+this[&quot;info&quot;]+&quot;&lt;/span&gt;&lt;/li&gt;&quot;})}h.children(&quot;ul&quot;)[f?&quot;append&quot;:&quot;html&quot;](k);if(i){i(j)}},&quot;json&quot;)}};d(document).ready(e.init)})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcewpmcelinkincludesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/wp-mce-link-includes.php (16398 => 16399)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/wp-mce-link-includes.php        2010-11-16 04:25:14 UTC (rev 16398)
+++ trunk/wp-includes/js/tinymce/wp-mce-link-includes.php        2010-11-16 05:11:41 UTC (rev 16399)
</span><span class="lines">@@ -20,13 +20,8 @@
</span><span class="cx">         if ( isset( $args['s'] ) )
</span><span class="cx">                 $query['s'] = $args['s'];
</span><span class="cx"> 
</span><del>-        $pagination = array(
-                'current'  =&gt; $args['pagenum'],
-                'per_page' =&gt; $query['posts_per_page'],
-        );
</del><ins>+        $query['offset'] = $args['pagenum'] &gt; 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
</ins><span class="cx"> 
</span><del>-        $query['offset'] = $pagination['offset'] = $args['pagenum'] &gt; 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
-
</del><span class="cx">         // Do main query.
</span><span class="cx">         $get_posts = new WP_Query;
</span><span class="cx">         $posts = $get_posts-&gt;query( $query );
</span><span class="lines">@@ -47,27 +42,10 @@
</span><span class="cx">                         'title' =&gt; esc_html( strip_tags($post-&gt;post_title) ),
</span><span class="cx">                         'permalink' =&gt; get_permalink( $post-&gt;ID ),
</span><span class="cx">                         'info' =&gt; $info,
</span><del>-                );;
</del><ins>+                );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        // Remaining pagination values.
-        $pagination['max'] = $get_posts-&gt;max_num_pages;
-        $pagination['page_links'] = paginate_links( array(
-                'prev_text' =&gt; __('&amp;laquo;'),
-                'next_text' =&gt; __('&amp;raquo;'),
-                'total' =&gt; $pagination['max'],
-                'current' =&gt; $pagination['current']
-        ) );
-
-        // Build response.
-        $resp = array(
-                'query' =&gt; $get_posts,
-                'objects' =&gt; $posts,
-                'results' =&gt; $results,
-                'pages' =&gt; $pagination,
-        );
-
-        return $resp;
</del><ins>+        return $results;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wp_link_ajax( $request ) {
</span><span class="lines">@@ -76,16 +54,12 @@
</span><span class="cx">                 $args['s'] = stripslashes( $request['title'] );
</span><span class="cx">         $args['pagenum'] = ! empty( $request['page'] ) ? absint( $request['page'] ) : 1;
</span><span class="cx"> 
</span><del>-        $resp = wp_link_query( $args );
</del><ins>+        $results = wp_link_query( $args );
</ins><span class="cx"> 
</span><del>-        if ( ! isset( $resp ) )
</del><ins>+        if ( ! isset( $results ) )
</ins><span class="cx">                 die( '0' );
</span><del>-
-        $json = array( 'results' =&gt; $resp['results'] );
-        if ( isset( $resp['pages'] ) &amp;&amp; !empty( $resp['pages']['page_links'] ) )
-                $json['page_links'] = $resp['pages']['page_links'];
</del><span class="cx">         
</span><del>-        echo json_encode( $json );
</del><ins>+        echo json_encode( $results );
</ins><span class="cx">         echo &quot;\n&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesjstinymcewpmcelinkphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/wp-mce-link.php (16398 => 16399)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/wp-mce-link.php        2010-11-16 04:25:14 UTC (rev 16398)
+++ trunk/wp-includes/js/tinymce/wp-mce-link.php        2010-11-16 05:11:41 UTC (rev 16399)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> wp_print_scripts( array( 'jquery', 'jquery-ui-widget' ) );
</span><span class="cx"> $suffix = defined( 'SCRIPT_DEBUG' ) &amp;&amp; SCRIPT_DEBUG ? '.dev' : '';
</span><del>-$src = &quot;plugins/wplink/js/wplink$suffix.js?ver=20101115&quot;;
</del><ins>+$src = &quot;plugins/wplink/js/wplink$suffix.js?ver=20101116&quot;;
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo $src; ?&gt;&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;?php
</span><span class="lines">@@ -127,6 +127,14 @@
</span><span class="cx"> #search-results {
</span><span class="cx">         display: none;
</span><span class="cx"> }
</span><ins>+.river-waiting {
+        display: none;
+        padding: 10px 0;
+}
+.river-waiting img.waiting {
+        margin: 0 auto;
+        display: block;
+}
</ins><span class="cx"> .submitbox {
</span><span class="cx">         padding: 5px 5px 0;
</span><span class="cx">         font-size: 11px;
</span><span class="lines">@@ -157,7 +165,7 @@
</span><span class="cx">                         &lt;span&gt;&lt;?php _e( 'Title' ); ?&gt;&lt;/span&gt;&lt;input id=&quot;link-title-field&quot; type=&quot;text&quot; /&gt;
</span><span class="cx">                 &lt;/label&gt;
</span><span class="cx">                 &lt;label for=&quot;link-target-checkbox&quot; id=&quot;open-in-new-tab&quot;&gt;
</span><del>-                        &lt;input type=&quot;checkbox&quot; id=&quot;link-target-checkbox&quot; /&gt;&lt;span&gt;&lt;?php _e( 'Open in new tab' ); ?&gt;&lt;/span&gt;
</del><ins>+                        &lt;input type=&quot;checkbox&quot; id=&quot;link-target-checkbox&quot; /&gt;&lt;span&gt;&lt;?php _e( 'Open link in a new window/tab' ); ?&gt;&lt;/span&gt;
</ins><span class="cx">                 &lt;/label&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;div id=&quot;search-panel&quot;&gt;
</span><span class="lines">@@ -181,7 +189,7 @@
</span><span class="cx">                 &lt;div id=&quot;most-recent-results&quot; class=&quot;query-results&quot;&gt;
</span><span class="cx">                         &lt;ul&gt;
</span><span class="cx">                                 &lt;li class=&quot;unselectable&quot;&gt;&lt;em&gt;&lt;?php _e( 'No search term specified. Showing recent items.' ); ?&gt;&lt;/em&gt;&lt;/li&gt;
</span><del>-                                &lt;?php foreach ( $most_recent['results'] as $item ) : ?&gt;
</del><ins>+                                &lt;?php foreach ( $most_recent as $item ) : ?&gt;
</ins><span class="cx">                                         &lt;li&gt;
</span><span class="cx">                                                 &lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;&lt;?php echo esc_url( $item['permalink'] ); ?&gt;&quot; /&gt;
</span><span class="cx">                                                 &lt;span class=&quot;item-title&quot;&gt;&lt;?php echo $item['title']; ?&gt;&lt;/span&gt;
</span></span></pre></div>
<a id="trunkwpincludesjstinymcewptinymcejsgz"></a>
<div class="binary"><h4>Modified: trunk/wp-includes/js/tinymce/wp-tinymce.js.gz</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
</div>

</body>
</html>