<!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("tinymce.plugins.wpLink",{init:function(a,b){a.addCommand("WP_Link",function(){a.windowManager.open({file:tinymce.baseURL+"/wp-mce-link.php",width:480,height:400,inline:1},{plugin_url:b})});a.addButton("link",{title:a.getLang("advanced.link_desc"),cmd:"WP_Link"});a.addShortcut("alt+shift+a",a.getLang("advanced.link_desc"),"WP_Link");a.onNodeChange.add(function(d,c,e){c.setActive("wplink",e.nodeName=="A")})},getInfo:function(){return{longname:"WordPress Link Dialog",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wplink",tinymce.plugins.wpLink)})();
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(){tinymce.create("tinymce.plugins.wpLink",{init:function(a,b){a.addCommand("WP_Link",function(){a.windowManager.open({file:tinymce.baseURL+"/wp-mce-link.php",width:480,height:430,inline:1},{plugin_url:b})});a.addButton("link",{title:a.getLang("advanced.link_desc"),cmd:"WP_Link"});a.addShortcut("alt+shift+a",a.getLang("advanced.link_desc"),"WP_Link");a.onNodeChange.add(function(d,c,e){c.setActive("wplink",e.nodeName=="A")})},getInfo:function(){return{longname:"WordPress Link Dialog",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wplink",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 ( "_blank" == 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: "#mce_temp_url#" }, defaultContent);
</del><ins>+                                        el = ed.dom.create('a', { href: "#mce_temp_url#" }, 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 > 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 += '<li class="no-matches-found unselectable"><span class="item-title"><em>'
+                                                + wpLinkL10n.noMatchesFound
+                                                + '</em></span></li>';
+                                        }
+                                } else {
+                                        $.each( results, function() {
+                                                list += '<li><input type="hidden" class="item-permalink" value="' + this['permalink'] + '" />';
+                                                list += '<span class="item-title">';
+                                                list += this['title'] ? this['title'] : '<em>'+ wpLinkL10n.untitled + '</em>';
+                                                list += '</span><span class="item-info">' + this['info'] + '</span></li>';
+                                        });
+                                }
+                                
</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">                         }, "json" );
</span><del>-                },
-                
-                generateListMarkup : function( results ) {
-                        var s = '';
-                        
-                        if ( ! results )
-                                return '<li class="no-matches-found unselectable"><span class="item-title"><em>' + wpLinkL10n.noMatchesFound + '</em></span></li>';
-                        
-                        $.each( results, function() {
-                                s+= '<li><input type="hidden" class="item-permalink" value="' + this['permalink'] + '" />';
-                                s+= '<span class="item-title">'
-                                s+= this['title'] ? this['title'] : '<em>'+ wpLinkL10n.untitled + '</em>';
-                                s+= '</span><span class="item-info">' + this['info'] + '</span>';
-                                s+= '</li>';
-                        });
-                        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("#url-field");a.title=d("#link-title-field");a.openInNewTab=d("#link-target-checkbox");a.search=d("#search-field");c.search=d("#search-results");c.recent=d("#most-recent-results");d("#wp-update").click(e.update);d("#wp-cancel").click(function(){tinyMCEPopup.close()});d(".query-results").delegate("li","click",e.selectInternalLink);d(".wp-results-pagelinks").delegate("a","click",e.selectPageLink);a.search.keyup(e.searchInternalLinks);if(h=b.dom.getParent(b.selection.getNode(),"A")){a.url.val(h.href);a.title.val(b.dom.getAttrib(h,"title"));if("_blank"==b.dom.getAttrib(h,"target")){a.openInNewTab.attr("checked","checked")}}},update:function(){var j,g=tinyMCEPopup.editor,h={href:a.url.val(),title:a.title.val(),target:a.openInNewTab.attr("checked")?"_blank":""},k,f,i=h.title?h.title:h.href;tinyMCEPopup.restoreSelection();k=g.dom.getParent(g.selection.getNode(),"A");if(!h.href){if(g.selection.isCollapsed()){tinyMCEPopup.close();return}else{if(k){tinyMCEPopup.execCommand("mceBeginUndoLevel");f=g.selection.getBookmark();g.dom.remove(k,1);g.selection.moveToBookmark(f);tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close();return}}}tinyMCEPopup.execCommand("mceBeginUndoLevel");if(k==null){g.getDoc().execCommand("unlink",false,null);if(g.selection.isCollapsed()){var j=g.dom.create("a",{href:"#mce_temp_url#"},i);g.selection.setNode(j)}else{tinyMCEPopup.execCommand("CreateLink",false,"#mce_temp_url#",{skip_undo:1})}tinymce.each(g.dom.select("a"),function(l){if(g.dom.getAttrib(l,"href")=="#mce_temp_url#"){k=l;g.dom.setAttribs(k,h)}})}else{g.dom.setAttribs(k,h)}if(k.childNodes.length!=1||k.firstChild.nodeName!="IMG"){g.focus();g.selection.select(k);g.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close()},selectInternalLink:function(){var f=d(this);if(f.hasClass("unselectable")){return}f.siblings(".selected").removeClass("selected");f.addClass("selected");a.url.val(f.children(".item-permalink").val());a.title.val(f.children(".item-title").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("img.waiting").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("query-results")){g=g.parents(".query-results")}if(!g.length){return}d.post(ajaxurl,d.extend({action:"wp-link-ajax"},f),function(j){var i=g.children(".wp-results-pagelinks");g.children("ul").html(e.generateListMarkup(j.results));if(j.page_links){i.html(j.page_links).show()}else{i.hide()}if(h){h(j.results)}},"json")},generateListMarkup:function(f){var g="";if(!f){return'<li class="no-matches-found unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}d.each(f,function(){g+='<li><input type="hidden" class="item-permalink" value="'+this["permalink"]+'" />';g+='<span class="item-title">';g+=this["title"]?this["title"]:"<em>"+wpLinkL10n.untitled+"</em>";g+='</span><span class="item-info">'+this["info"]+"</span>";g+="</li>"});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:"",riverDefaults:function(){return{page:2,allLoaded:false,active:false}},init:function(){var f;b=tinyMCEPopup.editor;a.url=d("#url-field");a.title=d("#link-title-field");a.openInNewTab=d("#link-target-checkbox");a.search=d("#search-field");c.search=d("#search-results");c.recent=d("#most-recent-results");c.search.data("river",e.riverDefaults());c.recent.data("river",e.riverDefaults());d("#wp-update").click(e.update);d("#wp-cancel").click(function(){tinyMCEPopup.close()});d(".query-results").delegate("li","click",e.selectInternalLink);d(".query-results").scroll(e.maybeLoadRiver);a.search.keyup(e.searchInternalLinks);if(f=b.dom.getParent(b.selection.getNode(),"A")){a.url.val(f.href);a.title.val(b.dom.getAttrib(f,"title"));if("_blank"==b.dom.getAttrib(f,"target")){a.openInNewTab.attr("checked","checked")}}a.url.focus()},update:function(){var j,g=tinyMCEPopup.editor,h={href:a.url.val(),title:a.title.val(),target:a.openInNewTab.attr("checked")?"_blank":""},k,f,i=h.title?h.title:h.href;tinyMCEPopup.restoreSelection();k=g.dom.getParent(g.selection.getNode(),"A");if(!h.href){if(g.selection.isCollapsed()){tinyMCEPopup.close();return}else{if(k){tinyMCEPopup.execCommand("mceBeginUndoLevel");f=g.selection.getBookmark();g.dom.remove(k,1);g.selection.moveToBookmark(f);tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close();return}}}tinyMCEPopup.execCommand("mceBeginUndoLevel");if(k==null){g.getDoc().execCommand("unlink",false,null);if(g.selection.isCollapsed()){j=g.dom.create("a",{href:"#mce_temp_url#"},i);g.selection.setNode(j)}else{tinyMCEPopup.execCommand("CreateLink",false,"#mce_temp_url#",{skip_undo:1})}tinymce.each(g.dom.select("a"),function(l){if(g.dom.getAttrib(l,"href")=="#mce_temp_url#"){k=l;g.dom.setAttribs(k,h)}})}else{g.dom.setAttribs(k,h)}if(k.childNodes.length!=1||k.firstChild.nodeName!="IMG"){g.focus();g.selection.select(k);g.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close()},selectInternalLink:function(){var f=d(this);if(f.hasClass("unselectable")){return}f.siblings(".selected").removeClass("selected");f.addClass("selected");a.url.val(f.children(".item-permalink").val());a.title.val(f.children(".item-title").text())},maybeLoadRiver:function(){var g=d(this),f=g.children("ul"),h=g.data("river"),i=g.find(".river-waiting");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>2){c.recent.hide();c.search.show();if(e.lastSearch==g){return}e.lastSearch=g;h=f.siblings("img.waiting").show();c.search.data("river",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("query-results")){h=h.parents(".query-results")}if(!h.length){return}d.post(ajaxurl,d.extend({action:"wp-link-ajax"},g),function(j){var k="";if(!j){if(!f){k+='<li class="no-matches-found unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}}else{d.each(j,function(){k+='<li><input type="hidden" class="item-permalink" value="'+this["permalink"]+'" />';k+='<span class="item-title">';k+=this["title"]?this["title"]:"<em>"+wpLinkL10n.untitled+"</em>";k+='</span><span class="item-info">'+this["info"]+"</span></li>"})}h.children("ul")[f?"append":"html"](k);if(i){i(j)}},"json")}};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' => $args['pagenum'],
-                'per_page' => $query['posts_per_page'],
-        );
</del><ins>+        $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
</ins><span class="cx">
</span><del>-        $query['offset'] = $pagination['offset'] = $args['pagenum'] > 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->query( $query );
</span><span class="lines">@@ -47,27 +42,10 @@
</span><span class="cx">                         'title' => esc_html( strip_tags($post->post_title) ),
</span><span class="cx">                         'permalink' => get_permalink( $post->ID ),
</span><span class="cx">                         'info' => $info,
</span><del>-                );;
</del><ins>+                );
</ins><span class="cx">         }
</span><span class="cx">
</span><del>-        // Remaining pagination values.
-        $pagination['max'] = $get_posts->max_num_pages;
-        $pagination['page_links'] = paginate_links( array(
-                'prev_text' => __('&laquo;'),
-                'next_text' => __('&raquo;'),
-                'total' => $pagination['max'],
-                'current' => $pagination['current']
-        ) );
-
-        // Build response.
-        $resp = array(
-                'query' => $get_posts,
-                'objects' => $posts,
-                'results' => $results,
-                'pages' => $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' => $resp['results'] );
-        if ( isset( $resp['pages'] ) && !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 "\n";
</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"> <?php
</span><span class="cx"> wp_print_scripts( array( 'jquery', 'jquery-ui-widget' ) );
</span><span class="cx"> $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
</span><del>-$src = "plugins/wplink/js/wplink$suffix.js?ver=20101115";
</del><ins>+$src = "plugins/wplink/js/wplink$suffix.js?ver=20101116";
</ins><span class="cx"> ?>
</span><span class="cx"> <script type="text/javascript" src="<?php echo $src; ?>"></script>
</span><span class="cx"> <?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">                         <span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" />
</span><span class="cx">                 </label>
</span><span class="cx">                 <label for="link-target-checkbox" id="open-in-new-tab">
</span><del>-                        <input type="checkbox" id="link-target-checkbox" /><span><?php _e( 'Open in new tab' ); ?></span>
</del><ins>+                        <input type="checkbox" id="link-target-checkbox" /><span><?php _e( 'Open link in a new window/tab' ); ?></span>
</ins><span class="cx">                 </label>
</span><span class="cx">         </div>
</span><span class="cx">         <div id="search-panel">
</span><span class="lines">@@ -181,7 +189,7 @@
</span><span class="cx">                 <div id="most-recent-results" class="query-results">
</span><span class="cx">                         <ul>
</span><span class="cx">                                 <li class="unselectable"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></li>
</span><del>-                                <?php foreach ( $most_recent['results'] as $item ) : ?>
</del><ins>+                                <?php foreach ( $most_recent as $item ) : ?>
</ins><span class="cx">                                         <li>
</span><span class="cx">                                                 <input type="hidden" class="item-permalink" value="<?php echo esc_url( $item['permalink'] ); ?>" />
</span><span class="cx">                                                 <span class="item-title"><?php echo $item['title']; ?></span>
</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>