<!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>[16561] trunk:
  Make Linking and Internal Linking keyboard-friendly and URL-paste-friendly
 .</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16561">16561</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2010-11-24 06:44:46 +0000 (Wed, 24 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make Linking and Internal Linking keyboard-friendly and URL-paste-friendly. props koopersmith. fixes <a href="http://trac.wordpress.org/ticket/15544">#15544</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesinternallinkingphp">trunk/wp-admin/includes/internal-linking.php</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswpdialogseditor_plugindevjs">trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswpdialogseditor_pluginjs">trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkcsswplinkcss">trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.css</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkcsswplinkdevcss">trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.dev.css</a></li>
<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="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesinternallinkingphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/internal-linking.php (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/internal-linking.php        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-admin/includes/internal-linking.php        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -70,18 +70,18 @@
</span><span class="cx">  */
</span><span class="cx"> function wp_link_dialog() {
</span><span class="cx"> ?&gt;
</span><del>-&lt;div id=&quot;wp-link&quot;&gt;
</del><ins>+&lt;form id=&quot;wp-link&quot; tabindex=&quot;-1&quot;&gt;
</ins><span class="cx"> &lt;div id=&quot;link-selector&quot;&gt;
</span><span class="cx">         &lt;div id=&quot;link-options&quot;&gt;
</span><span class="cx">                 &lt;p class=&quot;howto&quot;&gt;&lt;?php _e( 'Enter the destination URL:' ); ?&gt;&lt;/p&gt;
</span><span class="cx">                 &lt;div&gt;
</span><del>-                        &lt;label&gt;&lt;span&gt;&lt;?php _e( 'URL' ); ?&gt;&lt;/span&gt;&lt;input id=&quot;url-field&quot; type=&quot;text&quot; /&gt;&lt;/label&gt;
</del><ins>+                        &lt;label&gt;&lt;span&gt;&lt;?php _e( 'URL' ); ?&gt;&lt;/span&gt;&lt;input id=&quot;url-field&quot; type=&quot;text&quot; tabindex=&quot;10&quot; autocomplete=&quot;off&quot; /&gt;&lt;/label&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><span class="cx">                 &lt;div&gt;
</span><del>-                        &lt;label&gt;&lt;span&gt;&lt;?php _e( 'Title' ); ?&gt;&lt;/span&gt;&lt;input id=&quot;link-title-field&quot; type=&quot;text&quot; /&gt;&lt;/label&gt;
</del><ins>+                        &lt;label&gt;&lt;span&gt;&lt;?php _e( 'Title' ); ?&gt;&lt;/span&gt;&lt;input id=&quot;link-title-field&quot; type=&quot;text&quot; tabindex=&quot;20&quot; autocomplete=&quot;off&quot; /&gt;&lt;/label&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><span class="cx">                 &lt;div class=&quot;link-target&quot;&gt;
</span><del>-                        &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;link-target-checkbox&quot; /&gt; &lt;?php _e( 'Open link in a new window/tab' ); ?&gt;&lt;/label&gt;
</del><ins>+                        &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;link-target-checkbox&quot; tabindex=&quot;30&quot; /&gt; &lt;?php _e( 'Open link in a new window/tab' ); ?&gt;&lt;/label&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;div id=&quot;search-panel&quot;&gt;
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">                         &lt;p class=&quot;howto&quot;&gt;&lt;?php _e( 'Or, link to existing site content:' ); ?&gt;&lt;/p&gt;
</span><span class="cx">                         &lt;label for=&quot;search-field&quot;&gt;
</span><span class="cx">                                 &lt;span&gt;&lt;?php _e( 'Search' ); ?&gt;&lt;/span&gt;
</span><del>-                                &lt;input type=&quot;text&quot; id=&quot;search-field&quot; class=&quot;link-search-field&quot; /&gt;
</del><ins>+                                &lt;input type=&quot;text&quot; id=&quot;search-field&quot; class=&quot;link-search-field&quot; tabindex=&quot;60&quot; autocomplete=&quot;off&quot; /&gt;
</ins><span class="cx">                                 &lt;img class=&quot;waiting&quot; src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; alt=&quot;&quot; /&gt;
</span><span class="cx">                         &lt;/label&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="lines">@@ -113,10 +113,10 @@
</span><span class="cx">                 &lt;a class=&quot;submitdelete deletion&quot; href=&quot;#&quot;&gt;&lt;?php _e( 'Cancel' ); ?&gt;&lt;/a&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;div id=&quot;wp-link-update&quot;&gt;
</span><del>-                &lt;a class=&quot;button-primary&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
</del><ins>+                &lt;?php submit_button( __('Update'), 'primary', 'wp-link-submit', false, array('tabindex' =&gt; 100)); ?&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><del>-&lt;/div&gt;
</del><ins>+&lt;/form&gt;
</ins><span class="cx"> &lt;?php 
</span><span class="cx"> }
</span><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpdialogseditor_plugindevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -36,6 +36,21 @@
</span><span class="cx">                         };
</span><span class="cx">                 }
</span><span class="cx">         });
</span><ins>+        
+        $(document).ready(function() {
+                $.widget(&quot;wp.wpdialog&quot;, $.ui.dialog, {
+                        open: function() {
+                                // Initialize tinyMCEPopup if it exists.
+                                if ( tinyMCEPopup )
+                                        tinyMCEPopup.init();
+                                // Open the dialog.
+                                $.ui.dialog.prototype.open.apply( this, arguments );
+                                // WebKit leaves focus in the TinyMCE editor unless we shift focus.
+                                this.element.focus();
+                                this._trigger('refresh');
+                        }
+                });
+        });
</ins><span class="cx"> 
</span><span class="cx">         tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
</span><span class="cx">                 WPWindowManager : function(ed) {
</span><span class="lines">@@ -60,12 +75,9 @@
</span><span class="cx">                         t.element = t.windows[ f.id ] = element;
</span><span class="cx">                         
</span><span class="cx">                         // Store selection
</span><del>-                        t.bookmark = t.editor.selection.getBookmark();
</del><ins>+                        t.bookmark = t.editor.selection.getBookmark(1);
</ins><span class="cx">                         
</span><del>-                        if ( tinyMCEPopup )
-                                tinyMCEPopup.init();
-                        
-                        element.dialog({
</del><ins>+                        element.wpdialog({
</ins><span class="cx">                                 title: f.title,
</span><span class="cx">                                 width: f.width,
</span><span class="cx">                                 height: f.height,
</span><span class="lines">@@ -75,7 +87,7 @@
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="cx">                 close : wpDialogFn(function() {
</span><del>-                        this.element.dialog('close');
</del><ins>+                        this.element.wpdialog('close');
</ins><span class="cx">                 })
</span><span class="cx">         });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpdialogseditor_pluginjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(b){var a=function(c){return function(){if(this.features.wpDialog){return c.apply(this,arguments)}else{return this.parent.apply(this,arguments)}}};tinymce.create(&quot;tinymce.plugins.WPDialogs&quot;,{init:function(c,d){c.onBeforeRenderUI.add(function(){c.windowManager=new tinymce.WPWindowManager(c)})},getInfo:function(){return{longname:&quot;WPDialogs&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;http://wordpress.org&quot;,version:&quot;0.1&quot;}}});tinymce.create(&quot;tinymce.WPWindowManager:tinymce.InlineWindowManager&quot;,{WPWindowManager:function(c){this.parent(c)},open:function(e,g){var d=this,c;if(!e.wpDialog){return this.parent(e,g)}else{if(!e.id){return}}c=b(&quot;#&quot;+e.id);if(!c.length){return}d.features=e;d.params=g;d.onOpen.dispatch(d,e,g);d.element=d.windows[e.id]=c;d.bookmark=d.editor.selection.getBookmark();if(tinyMCEPopup){tinyMCEPopup.init()}c.dialog({title:e.title,width:e.width,height:e.height,modal:true,dialogClass:&quot;wp-dialog&quot;,zIndex:300000})},close:a(function(){this.element.dialog(&quot;close&quot;)})});tinymce.PluginManager.add(&quot;wpdialogs&quot;,tinymce.plugins.WPDialogs)})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(b){var a=function(c){return function(){if(this.features.wpDialog){return c.apply(this,arguments)}else{return this.parent.apply(this,arguments)}}};tinymce.create(&quot;tinymce.plugins.WPDialogs&quot;,{init:function(c,d){c.onBeforeRenderUI.add(function(){c.windowManager=new tinymce.WPWindowManager(c)})},getInfo:function(){return{longname:&quot;WPDialogs&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;http://wordpress.org&quot;,version:&quot;0.1&quot;}}});b(document).ready(function(){b.widget(&quot;wp.wpdialog&quot;,b.ui.dialog,{open:function(){if(tinyMCEPopup){tinyMCEPopup.init()}b.ui.dialog.prototype.open.apply(this,arguments);this.element.focus();this._trigger(&quot;refresh&quot;)}})});tinymce.create(&quot;tinymce.WPWindowManager:tinymce.InlineWindowManager&quot;,{WPWindowManager:function(c){this.parent(c)},open:function(e,g){var d=this,c;if(!e.wpDialog){return this.parent(e,g)}else{if(!e.id){return}}c=b(&quot;#&quot;+e.id);if(!c.length){return}d.features=e;d.params=g;d.onOpen.dispatch(d,e,g);d.element=d.windows[e.id]=c;d.bookmark=d.editor.selection.getBookmark(1);c.wpdialog({title:e.title,width:e.width,height:e.height,modal:true,dialogClass:&quot;wp-dialog&quot;,zIndex:300000})},close:a(function(){this.element.wpdialog(&quot;close&quot;)})});tinymce.PluginManager.add(&quot;wpdialogs&quot;,tinymce.plugins.WPDialogs)})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkcsswplinkcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.css (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.css        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.css        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -1 +1 @@
</span><del>-#wp-link p.howto{margin:3px;}#link-options{padding:10px 0 14px;border-bottom:1px solid #dfdfdf;margin:0 6px 14px;}#wp-link label input[type=&quot;text&quot;]{width:360px;margin-top:5px;}#wp-link label span{display:inline-block;width:80px;text-align:right;padding-right:5px;}#wp-link .link-search-wrapper{margin:5px 5px 9px;display:block;overflow:hidden;}#wp-link .link-search-wrapper span{float:left;margin-top:6px;}#wp-link .link-search-wrapper input[type=&quot;text&quot;]{float:left;width:220px;}#wp-link .link-search-wrapper img.waiting{margin:8px 1px 0 4px;float:left;display:none;}#wp-link .link-target{width:auto;padding:3px 0 0;margin:0 0 0 87px;font-size:11px;}#wp-link .query-results{border:1px #dfdfdf solid;margin:0 5px 5px;background:#fff;height:185px;overflow:auto;}#wp-link li,#wp-link .query-notice{margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#333;padding:4px 6px;cursor:pointer;}#wp-link li:hover{background:#eaf2fa;color:#151515;}#wp-link li.unselectable{border-bottom:1px solid #dfdfdf;}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#333;}#wp-link li.selected{background:#ddd;color:#333;}#wp-link li.selected .item-title{font-weight:bold;}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;float:right;}#search-results{display:none;}#wp-link .river-waiting{display:none;padding:10px 0;}#wp-link .river-waiting img.waiting{margin:0 auto;display:block;}#wp-link .submitbox{padding:5px 10px;font-size:11px;overflow:auto;height:29px;}#wp-link-cancel{line-height:25px;float:left;}#wp-link-update{line-height:23px;float:right;}#wp-link-update a{display:inline-block;}
</del><span class="cx">\ No newline at end of file
</span><ins>+#wp-link p.howto{margin:3px;}#link-options{padding:10px 0 14px;border-bottom:1px solid #dfdfdf;margin:0 6px 14px;}#wp-link label input[type=&quot;text&quot;]{width:360px;margin-top:5px;}#wp-link label span{display:inline-block;width:80px;text-align:right;padding-right:5px;}#wp-link .link-search-wrapper{margin:5px 5px 9px;display:block;overflow:hidden;}#wp-link .link-search-wrapper span{float:left;margin-top:6px;}#wp-link .link-search-wrapper input[type=&quot;text&quot;]{float:left;width:220px;}#wp-link .link-search-wrapper img.waiting{margin:8px 1px 0 4px;float:left;display:none;}#wp-link .link-target{width:auto;padding:3px 0 0;margin:0 0 0 87px;font-size:11px;}#wp-link .query-results{border:1px #dfdfdf solid;margin:0 5px 5px;background:#fff;height:185px;overflow:auto;position:relative;}#wp-link li,#wp-link .query-notice{margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#333;padding:4px 6px;cursor:pointer;}#wp-link li:hover{background:#eaf2fa;color:#151515;}#wp-link li.unselectable{border-bottom:1px solid #dfdfdf;}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#333;}#wp-link li.selected{background:#ddd;color:#333;}#wp-link li.selected .item-title{font-weight:bold;}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;float:right;}#search-results{display:none;}#wp-link .river-waiting{display:none;padding:10px 0;}#wp-link .river-waiting img.waiting{margin:0 auto;display:block;}#wp-link .submitbox{padding:5px 10px;font-size:11px;overflow:auto;height:29px;}#wp-link-cancel{line-height:25px;float:left;}#wp-link-update{line-height:23px;float:right;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkcsswplinkdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.dev.css (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.dev.css        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/css/wplink.dev.css        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">         background: #fff;
</span><span class="cx">         height: 185px;
</span><span class="cx">         overflow: auto;
</span><ins>+        position: relative;
</ins><span class="cx"> }
</span><span class="cx"> #wp-link li,
</span><span class="cx"> #wp-link .query-notice {
</span><span class="lines">@@ -104,7 +105,4 @@
</span><span class="cx"> #wp-link-update {
</span><span class="cx">         line-height: 23px;
</span><span class="cx">         float: right;
</span><del>-}
-#wp-link-update a {
-        display: inline-block;
</del><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkeditor_plugindevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -9,8 +9,12 @@
</span><span class="cx">                  * @param {string} url Absolute URL to where the plugin is located.
</span><span class="cx">                  */
</span><span class="cx">                 init : function(ed, url) {
</span><ins>+                        var disabled = true;
+                        
</ins><span class="cx">                         // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
</span><span class="cx">                         ed.addCommand('WP_Link', function() {
</span><ins>+                                if ( disabled )
+                                        return;
</ins><span class="cx">                                 ed.windowManager.open({
</span><span class="cx">                                         id : 'wp-link',
</span><span class="cx">                                         width : 480,
</span><span class="lines">@@ -29,10 +33,9 @@
</span><span class="cx">                         });
</span><span class="cx"> 
</span><span class="cx">                         ed.addShortcut('alt+shift+a', ed.getLang('advanced.link_desc'), 'WP_Link');
</span><del>-
-                        // Add a node change handler, selects the button in the UI when a link is selected
-                        ed.onNodeChange.add(function(ed, cm, n) {
-                                cm.setActive('wplink', n.nodeName == 'A');
</del><ins>+                        
+                        ed.onNodeChange.add(function(ed, cm, n, co) {
+                                disabled = co &amp;&amp; n.nodeName != 'A';
</ins><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="cx">                 /**
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkeditor_pluginjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js        2010-11-24 06:44:46 UTC (rev 16561)
</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({id:&quot;wp-link&quot;,width:480,height:&quot;auto&quot;,wpDialog:true,title:a.getLang(&quot;advlink.link_desc&quot;)},{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){var c=true;a.addCommand(&quot;WP_Link&quot;,function(){if(c){return}a.windowManager.open({id:&quot;wp-link&quot;,width:480,height:&quot;auto&quot;,wpDialog:true,title:a.getLang(&quot;advlink.link_desc&quot;)},{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(e,d,g,f){c=f&amp;&amp;g.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 (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -7,10 +7,11 @@
</span><span class="cx">                 timeToTriggerRiver: 150,
</span><span class="cx">                 minRiverAJAXDuration: 200,
</span><span class="cx">                 riverBottomThreshold: 5,
</span><ins>+                keySensitivity: 100,
</ins><span class="cx">                 lastSearch: '',
</span><span class="cx">                 init : function() {
</span><span class="cx">                         inputs.dialog = $('#wp-link');
</span><del>-                        inputs.update = $('#wp-link-update a');
</del><ins>+                        inputs.submit = $('#wp-link-submit');
</ins><span class="cx">                         // URL
</span><span class="cx">                         inputs.url = $('#url-field');
</span><span class="cx">                         // Secondary options
</span><span class="lines">@@ -24,22 +25,28 @@
</span><span class="cx">                         rivers.elements = $('.query-results', inputs.dialog);
</span><span class="cx"> 
</span><span class="cx">                         // Bind event handlers
</span><del>-                        inputs.update.click( wpLink.update );
-                        $('#wp-link-cancel').click( function() { tinyMCEPopup.close(); } );
</del><ins>+                        inputs.dialog.keydown( wpLink.keydown );
+                        inputs.dialog.keyup( wpLink.keyup );
+                        inputs.submit.click( function(e){
+                                wpLink.update();
+                                e.preventDefault();
+                        });
+                        $('#wp-link-cancel').click( wpLink.cancel );
</ins><span class="cx">                         
</span><del>-                        rivers.elements.delegate('li', 'click', wpLink.selectInternalLink )
</del><ins>+                        rivers.elements.bind('river-select', wpLink.updateFields );
</ins><span class="cx">                         
</span><span class="cx">                         inputs.search.keyup( wpLink.searchInternalLinks );
</span><span class="cx">                         
</span><del>-                        inputs.dialog.bind('dialogopen', wpLink.refresh);
</del><ins>+                        inputs.dialog.bind('wpdialogrefresh', wpLink.refresh);
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 refresh : function() {
</span><span class="cx">                         var e;
</span><span class="cx">                         ed = tinyMCEPopup.editor;
</span><span class="cx">                         
</span><del>-                        // Clear previously selected links
-                        rivers.elements.find('.selected').removeClass('selected');
</del><ins>+                        // Refresh rivers (clear links, check visibility)
+                        rivers.search.refresh();
+                        rivers.recent.refresh();
</ins><span class="cx">                         
</span><span class="cx">                         tinyMCEPopup.restoreSelection();
</span><span class="cx"> 
</span><span class="lines">@@ -52,85 +59,79 @@
</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">                                 // Update save prompt.
</span><del>-                                inputs.update.text( wpLinkL10n.update );
</del><ins>+                                inputs.submit.val( wpLinkL10n.update );
</ins><span class="cx"> 
</span><span class="cx">                         // If there's no link, set the default values.
</span><span class="cx">                         } else {
</span><del>-                                // Set URL and description to defaults.
-                                // Leave the new tab setting as-is.
-                                inputs.url.val('http://');
-                                inputs.title.val('');
</del><ins>+                                wpLink.setDefaultValues();
</ins><span class="cx">                                 // Update save prompt.
</span><del>-                                inputs.update.text( wpLinkL10n.save );
</del><ins>+                                inputs.submit.val( wpLinkL10n.save );
</ins><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         tinyMCEPopup.storeSelection();
</span><del>-                        // If the focus is moved above the selection changes,
-                        // IE will show a flashing cursor over the dialog.
-                        inputs.url.focus();
</del><ins>+                        // Focus the URL field and highlight its contents.
+                        //     If this is moved above the selection changes,
+                        //     IE will show a flashing cursor over the dialog.
+                        inputs.url.focus()[0].select();
</ins><span class="cx">                         // Load the most recent results if this is the first time opening the panel.
</span><span class="cx">                         if ( ! rivers.recent.ul.children().length )
</span><span class="cx">                                 rivers.recent.ajax();
</span><span class="cx">                 },
</span><ins>+                
+                cancel : function() {
+                        tinyMCEPopup.close();
+                },
</ins><span class="cx"> 
</span><span class="cx">                 update : function() {
</span><del>-                        var el,
-                                ed = tinyMCEPopup.editor,
</del><ins>+                        var ed = tinyMCEPopup.editor,
</ins><span class="cx">                                 attrs = {
</span><span class="cx">                                         href : inputs.url.val(),
</span><span class="cx">                                         title : inputs.title.val(),
</span><span class="cx">                                         target : inputs.openInNewTab.attr('checked') ? '_blank' : ''
</span><del>-                                }, e, b,
-                                defaultContent = attrs.title ? attrs.title : attrs.href;
</del><ins>+                                }, e, b;
</ins><span class="cx"> 
</span><span class="cx">                         tinyMCEPopup.restoreSelection();
</span><span class="cx">                         e = ed.dom.getParent(ed.selection.getNode(), 'A');
</span><span class="cx"> 
</span><del>-                        // If the values are empty...
</del><ins>+                        // If the values are empty, unlink and return
</ins><span class="cx">                         if ( ! attrs.href || attrs.href == 'http://' ) {
</span><del>-                                // ...and nothing is selected, we should return
-                                if ( ed.selection.isCollapsed() ) {
-                                        tinyMCEPopup.close();
-                                        return;
-                                // ...and a link exists, we should unlink and return
-                                } else if ( e ) {
</del><ins>+                                if ( e ) {
</ins><span class="cx">                                         tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);
</span><span class="cx">                                         b = ed.selection.getBookmark();
</span><span class="cx">                                         ed.dom.remove(e, 1);
</span><span class="cx">                                         ed.selection.moveToBookmark(b);
</span><span class="cx">                                         tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);
</span><span class="cx">                                         tinyMCEPopup.close();
</span><del>-                                        return;
</del><span class="cx">                                 }
</span><ins>+                                return;
</ins><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);
</span><span class="cx"> 
</span><span class="cx">                         if (e == null) {
</span><span class="cx">                                 ed.getDoc().execCommand(&quot;unlink&quot;, false, null);
</span><ins>+                                tinyMCEPopup.execCommand(&quot;CreateLink&quot;, false, &quot;#mce_temp_url#&quot;, {skip_undo : 1});
</ins><span class="cx"> 
</span><del>-                                // If no selection exists, create a new link from scratch.
-                                if ( ed.selection.isCollapsed() ) {
-                                        el = ed.dom.create('a', { href: &quot;#mce_temp_url#&quot; }, defaultContent);
-                                        ed.selection.setNode(el);
-                                // If a selection exists, wrap it in a link.
-                                } else {
-                                        tinyMCEPopup.execCommand(&quot;CreateLink&quot;, false, &quot;#mce_temp_url#&quot;, {skip_undo : 1});
-                                }
-
</del><span class="cx">                                 tinymce.each(ed.dom.select(&quot;a&quot;), function(n) {
</span><span class="cx">                                         if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
</span><span class="cx">                                                 e = n;
</span><span class="cx">                                                 ed.dom.setAttribs(e, attrs);
</span><span class="cx">                                         }
</span><span class="cx">                                 });
</span><ins>+                                
+                                // Sometimes WebKit lets a user create a link where
+                                // they shouldn't be able to. In this case, CreateLink
+                                // injects &quot;#mce_temp_url#&quot; into their content. Fix it.
+                                if ( $(e).text() == '#mce_temp_url#' ) {
+                                        ed.dom.remove(e);
+                                        e = null;
+                                }
</ins><span class="cx">                         } else {
</span><span class="cx">                                 ed.dom.setAttribs(e, attrs);
</span><span class="cx">                         }
</span><span class="cx"> 
</span><del>-                        children = $(e).children();
</del><span class="cx">                         // Don't move caret if selection was image
</span><del>-                        if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {
</del><ins>+                        if ( e &amp;&amp; (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') ) {
</ins><span class="cx">                                 ed.focus();
</span><span class="cx">                                 ed.selection.select(e);
</span><span class="cx">                                 ed.selection.collapse(0);
</span><span class="lines">@@ -141,23 +142,26 @@
</span><span class="cx">                         tinyMCEPopup.close();
</span><span class="cx">                 },
</span><span class="cx"> 
</span><del>-                selectInternalLink : function() {
-                        var t = $(this);
-                        if ( t.hasClass('unselectable') )
-                                return;
-                        t.siblings('.selected').removeClass('selected');
-                        t.addClass('selected');
-                        inputs.url.val( t.children('.item-permalink').val() );
-                        inputs.title.val( t.children('.item-title').text() );
</del><ins>+                updateFields : function( e, li, originalEvent ) {
+                        inputs.url.val( li.children('.item-permalink').val() );
+                        inputs.title.val( li.children('.item-title').text() );
+                        if ( originalEvent &amp;&amp; originalEvent.type == &quot;click&quot; )
+                                inputs.url.focus();
</ins><span class="cx">                 },
</span><ins>+                setDefaultValues : function() {
+                        // Set URL and description to defaults.
+                        // Leave the new tab setting as-is.
+                        inputs.url.val('http://');
+                        inputs.title.val('');
+                },
</ins><span class="cx"> 
</span><span class="cx">                 searchInternalLinks : function() {
</span><span class="cx">                         var t = $(this), waiting,
</span><span class="cx">                                 search = t.val();
</span><span class="cx"> 
</span><span class="cx">                         if ( search.length &gt; 2 ) {
</span><del>-                                rivers.recent.element.hide();
-                                rivers.search.element.show();
</del><ins>+                                rivers.recent.hide();
+                                rivers.search.show();
</ins><span class="cx"> 
</span><span class="cx">                                 // Don't search if the keypress didn't change the title.
</span><span class="cx">                                 if ( wpLink.lastSearch == search )
</span><span class="lines">@@ -169,10 +173,53 @@
</span><span class="cx">                                 rivers.search.change( search );
</span><span class="cx">                                 rivers.search.ajax( function(){ waiting.hide(); });
</span><span class="cx">                         } else {
</span><del>-                                rivers.search.element.hide();
-                                rivers.recent.element.show();
</del><ins>+                                rivers.search.hide();
+                                rivers.recent.show();
</ins><span class="cx">                         }
</span><span class="cx">                 },
</span><ins>+                
+                next : function() {
+                        rivers.search.next();
+                        rivers.recent.next();
+                },
+                prev : function() {
+                        rivers.search.prev();
+                        rivers.recent.prev();
+                },
+                
+                keydown : function( event ) {
+                        var fn, key = $.ui.keyCode;
+                        
+                        switch( event.which ) {
+                                case key.UP:
+                                        fn = 'prev';
+                                case key.DOWN:
+                                        fn = fn || 'next';
+                                        clearInterval( wpLink.keyInterval );
+                                        wpLink[ fn ]();
+                                        wpLink.keyInterval = setInterval( wpLink[ fn ], wpLink.keySensitivity );
+                                        break;
+                                default:
+                                        return;
+                        }
+                        event.preventDefault();
+                },
+                keyup: function( event ) {
+                        var key = $.ui.keyCode;
+                        
+                        switch( event.which ) {
+                                case key.ESCAPE:
+                                        wpLink.cancel();
+                                        break;
+                                case key.UP:
+                                case key.DOWN:
+                                        clearInterval( wpLink.keyInterval );
+                                        break;
+                                default:
+                                        return;
+                        }
+                        event.preventDefault();
+                },
</ins><span class="cx"> 
</span><span class="cx">                 delayedCallback : function( func, delay ) {
</span><span class="cx">                         var timeoutTriggered, funcTriggered, funcArgs, funcContext;
</span><span class="lines">@@ -205,11 +252,75 @@
</span><span class="cx">                 this.waiting = element.find('.river-waiting');
</span><span class="cx">                 
</span><span class="cx">                 this.change( search );
</span><ins>+                this.refresh();
</ins><span class="cx">                 
</span><span class="cx">                 element.scroll( function(){ self.maybeLoad(); });
</span><ins>+                element.delegate('li', 'click', function(e){ self.select( $(this), e ); });
</ins><span class="cx">         };
</span><span class="cx">         
</span><span class="cx">         $.extend( River.prototype, {
</span><ins>+                refresh: function() {
+                        this.deselect();
+                        this.visible = this.element.is(':visible');
+                },
+                show: function() {
+                        if ( ! this.visible ) {
+                                this.deselect();
+                                this.element.show();
+                                this.visible = true;
+                        }
+                },
+                hide: function() {
+                        this.element.hide();
+                        this.visible = false;
+                },
+                // Selects a list item and triggers the river-select event.
+                select: function( li, event ) {
+                        var liHeight, elHeight, liTop, elTop;
+                        
+                        if ( li.hasClass('unselectable') || li == this.selected )
+                                return;
+                        
+                        this.deselect();
+                        this.selected = li.addClass('selected');
+                        // Make sure the element is visible
+                        liHeight = li.outerHeight();
+                        elHeight = this.element.height();
+                        liTop = li.position().top;
+                        elTop = this.element.scrollTop();
+                        
+                        if ( liTop &lt; 0 ) // Make first visible element
+                                this.element.scrollTop( elTop + liTop );
+                        else if ( liTop + liHeight &gt; elHeight ) // Make last visible element
+                                this.element.scrollTop( elTop + liTop - elHeight + liHeight );
+                        
+                        // Trigger the river-select event
+                        this.element.trigger('river-select', [ li, event, this ]);
+                },
+                deselect: function() {
+                        if ( this.selected )
+                                this.selected.removeClass('selected');
+                        this.selected = false;
+                },
+                prev: function() {
+                        if ( ! this.visible )
+                                return;
+                        
+                        var to;
+                        if ( this.selected ) {
+                                to = this.selected.prev('li');
+                                if ( to.length )
+                                        this.select( to );
+                        }
+                },
+                next: function() {
+                        if ( ! this.visible )
+                                return;
+                        
+                        var to = this.selected ? this.selected.next('li') : $('li:not(.unselectable):first', this.element);
+                        if ( to.length )
+                                this.select( to );
+                },
</ins><span class="cx">                 ajax: function( callback ) {
</span><span class="cx">                         var self = this,
</span><span class="cx">                                 delay = this.query.page == 1 ? 0 : wpLink.minRiverAJAXDuration,
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkjswplinkjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,lastSearch:&quot;&quot;,init:function(){b.dialog=f(&quot;#wp-link&quot;);b.update=f(&quot;#wp-link-update a&quot;);b.url=f(&quot;#url-field&quot;);b.title=f(&quot;#link-title-field&quot;);b.openInNewTab=f(&quot;#link-target-checkbox&quot;);b.search=f(&quot;#search-field&quot;);e.search=new a(f(&quot;#search-results&quot;));e.recent=new a(f(&quot;#most-recent-results&quot;));e.elements=f(&quot;.query-results&quot;,b.dialog);b.update.click(wpLink.update);f(&quot;#wp-link-cancel&quot;).click(function(){tinyMCEPopup.close()});e.elements.delegate(&quot;li&quot;,&quot;click&quot;,wpLink.selectInternalLink);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind(&quot;dialogopen&quot;,wpLink.refresh)},refresh:function(){var g;d=tinyMCEPopup.editor;e.elements.find(&quot;.selected&quot;).removeClass(&quot;selected&quot;);tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),&quot;A&quot;)){b.url.val(g.href);b.title.val(d.dom.getAttrib(g,&quot;title&quot;));if(&quot;_blank&quot;==d.dom.getAttrib(g,&quot;target&quot;)){b.openInNewTab.attr(&quot;checked&quot;,&quot;checked&quot;)}b.update.text(wpLinkL10n.update)}else{b.url.val(&quot;http://&quot;);b.title.val(&quot;&quot;);b.update.text(wpLinkL10n.save)}tinyMCEPopup.storeSelection();b.url.focus();if(!e.recent.ul.children().length){e.recent.ajax()}},update:function(){var k,h=tinyMCEPopup.editor,i={href:b.url.val(),title:b.title.val(),target:b.openInNewTab.attr(&quot;checked&quot;)?&quot;_blank&quot;:&quot;&quot;},l,g,j=i.title?i.title:i.href;tinyMCEPopup.restoreSelection();l=h.dom.getParent(h.selection.getNode(),&quot;A&quot;);if(!i.href||i.href==&quot;http://&quot;){if(h.selection.isCollapsed()){tinyMCEPopup.close();return}else{if(l){tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);g=h.selection.getBookmark();h.dom.remove(l,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close();return}}}tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);if(l==null){h.getDoc().execCommand(&quot;unlink&quot;,false,null);if(h.selection.isCollapsed()){k=h.dom.create(&quot;a&quot;,{href:&quot;#mce_temp_url#&quot;},j);h.selection.setNode(k)}else{tinyMCEPopup.execCommand(&quot;CreateLink&quot;,false,&quot;#mce_temp_url#&quot;,{skip_undo:1})}tinymce.each(h.dom.select(&quot;a&quot;),function(m){if(h.dom.getAttrib(m,&quot;href&quot;)==&quot;#mce_temp_url#&quot;){l=m;h.dom.setAttribs(l,i)}})}else{h.dom.setAttribs(l,i)}children=f(l).children();if(l.childNodes.length!=1||l.firstChild.nodeName!=&quot;IMG&quot;){h.focus();h.selection.select(l);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close()},selectInternalLink:function(){var g=f(this);if(g.hasClass(&quot;unselectable&quot;)){return}g.siblings(&quot;.selected&quot;).removeClass(&quot;selected&quot;);g.addClass(&quot;selected&quot;);b.url.val(g.children(&quot;.item-permalink&quot;).val());b.title.val(g.children(&quot;.item-title&quot;).text())},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length&gt;2){e.recent.element.hide();e.search.element.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.siblings(&quot;img.waiting&quot;).show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.element.hide();e.recent.element.show()}},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}}};a=function(i,h){var g=this;this.element=i;this.ul=i.children(&quot;ul&quot;);this.waiting=i.find(&quot;.river-waiting&quot;);this.change(h);i.scroll(function(){g.maybeLoad()})};f.extend(a.prototype,{ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&amp;&amp;this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(g,k){var h=&quot;&quot;,i=true,j=k.page==1;if(!g){if(j){h+='&lt;li class=&quot;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{f.each(g,function(){h+=i?'&lt;li class=&quot;alternate&quot;&gt;':&quot;&lt;li&gt;&quot;;h+='&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;'+this[&quot;permalink&quot;]+'&quot; /&gt;';h+='&lt;span class=&quot;item-title&quot;&gt;';h+=this[&quot;title&quot;]?this[&quot;title&quot;]:&quot;&lt;em&gt;&quot;+wpLinkL10n.untitled+&quot;&lt;/em&gt;&quot;;h+='&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;'+this[&quot;info&quot;]+&quot;&lt;/span&gt;&lt;/li&gt;&quot;;i=!i})}this.ul[j?&quot;html&quot;:&quot;append&quot;](h)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g&lt;this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k&lt;h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:&quot;wp-link-ajax&quot;,page:this.page};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},&quot;json&quot;)}});f(document).ready(wpLink.init)})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:&quot;&quot;,init:function(){b.dialog=f(&quot;#wp-link&quot;);b.submit=f(&quot;#wp-link-submit&quot;);b.url=f(&quot;#url-field&quot;);b.title=f(&quot;#link-title-field&quot;);b.openInNewTab=f(&quot;#link-target-checkbox&quot;);b.search=f(&quot;#search-field&quot;);e.search=new a(f(&quot;#search-results&quot;));e.recent=new a(f(&quot;#most-recent-results&quot;));e.elements=f(&quot;.query-results&quot;,b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){wpLink.update();g.preventDefault()});f(&quot;#wp-link-cancel&quot;).click(wpLink.cancel);e.elements.bind(&quot;river-select&quot;,wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind(&quot;wpdialogrefresh&quot;,wpLink.refresh)},refresh:function(){var g;d=tinyMCEPopup.editor;e.search.refresh();e.recent.refresh();tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),&quot;A&quot;)){b.url.val(g.href);b.title.val(d.dom.getAttrib(g,&quot;title&quot;));if(&quot;_blank&quot;==d.dom.getAttrib(g,&quot;target&quot;)){b.openInNewTab.attr(&quot;checked&quot;,&quot;checked&quot;)}b.submit.val(wpLinkL10n.update)}else{wpLink.setDefaultValues();b.submit.val(wpLinkL10n.save)}tinyMCEPopup.storeSelection();b.url.focus()[0].select();if(!e.recent.ul.children().length){e.recent.ajax()}},cancel:function(){tinyMCEPopup.close()},update:function(){var h=tinyMCEPopup.editor,i={href:b.url.val(),title:b.title.val(),target:b.openInNewTab.attr(&quot;checked&quot;)?&quot;_blank&quot;:&quot;&quot;},j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),&quot;A&quot;);if(!i.href||i.href==&quot;http://&quot;){if(j){tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close()}return}tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);if(j==null){h.getDoc().execCommand(&quot;unlink&quot;,false,null);tinyMCEPopup.execCommand(&quot;CreateLink&quot;,false,&quot;#mce_temp_url#&quot;,{skip_undo:1});tinymce.each(h.dom.select(&quot;a&quot;),function(k){if(h.dom.getAttrib(k,&quot;href&quot;)==&quot;#mce_temp_url#&quot;){j=k;h.dom.setAttribs(j,i)}});if(f(j).text()==&quot;#mce_temp_url#&quot;){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&amp;&amp;(j.childNodes.length!=1||j.firstChild.nodeName!=&quot;IMG&quot;)){h.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close()},updateFields:function(i,h,g){b.url.val(h.children(&quot;.item-permalink&quot;).val());b.title.val(h.children(&quot;.item-title&quot;).text());if(g&amp;&amp;g.type==&quot;click&quot;){b.url.focus()}},setDefaultValues:function(){b.url.val(&quot;http://&quot;);b.title.val(&quot;&quot;)},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length&gt;2){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.siblings(&quot;img.waiting&quot;).show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.hide();e.recent.show()}},next:function(){e.search.next();e.recent.next()},prev:function(){e.search.prev();e.recent.prev()},keydown:function(i){var h,g=f.ui.keyCode;switch(i.which){case g.UP:h=&quot;prev&quot;;case g.DOWN:h=h||&quot;next&quot;;clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);break;default:return}i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;switch(h.which){case g.ESCAPE:wpLink.cancel();break;case g.UP:case g.DOWN:clearInterval(wpLink.keyInterval);break;default:return}h.preventDefault()},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}}};a=function(i,h){var g=this;this.element=i;this.ul=i.children(&quot;ul&quot;);this.waiting=i.find(&quot;.river-waiting&quot;);this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate(&quot;li&quot;,&quot;click&quot;,function(j){g.select(f(this),j)})};f.extend(a.prototype,{refresh:function(){this.deselect();this.visible=this.element.is(&quot;:visible&quot;)},show:function(){if(!this.visible){this.deselect();this.element.show();this.visible=true}},hide:function(){this.element.hide();this.visible=false},select:function(h,k){var j,i,l,g;if(h.hasClass(&quot;unselectable&quot;)||h==this.selected){return}this.deselect();this.selected=h.addClass(&quot;selected&quot;);j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l&lt;0){this.element.scrollTop(g+l)}else{if(l+j&gt;i){this.element.scrollTop(g+l-i+j)}}this.element.trigger(&quot;river-select&quot;,[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass(&quot;selected&quot;)}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev(&quot;li&quot;);if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next(&quot;li&quot;):f(&quot;li:not(.unselectable):first&quot;,this.element);if(g.length){this.select(g)}},ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&amp;&amp;this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(g,k){var h=&quot;&quot;,i=true,j=k.page==1;if(!g){if(j){h+='&lt;li class=&quot;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{f.each(g,function(){h+=i?'&lt;li class=&quot;alternate&quot;&gt;':&quot;&lt;li&gt;&quot;;h+='&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;'+this[&quot;permalink&quot;]+'&quot; /&gt;';h+='&lt;span class=&quot;item-title&quot;&gt;';h+=this[&quot;title&quot;]?this[&quot;title&quot;]:&quot;&lt;em&gt;&quot;+wpLinkL10n.untitled+&quot;&lt;/em&gt;&quot;;h+='&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;'+this[&quot;info&quot;]+&quot;&lt;/span&gt;&lt;/li&gt;&quot;;i=!i})}this.ul[j?&quot;html&quot;:&quot;append&quot;](h)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g&lt;this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k&lt;h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:&quot;wp-link-ajax&quot;,page:this.page};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},&quot;json&quot;)}});f(document).ready(wpLink.init)})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (16560 => 16561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-11-24 05:31:25 UTC (rev 16560)
+++ trunk/wp-includes/script-loader.php        2010-11-24 06:44:46 UTC (rev 16561)
</span><span class="lines">@@ -270,7 +270,7 @@
</span><span class="cx">                 'l10n_print_after' =&gt; 'try{convertEntities(adminBarL10n);}catch(e){};',
</span><span class="cx">         ) );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'wplink', &quot;/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js&quot;, array('jquery'), '20101120' );
</del><ins>+        $scripts-&gt;add( 'wplink', &quot;/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js&quot;, array('jquery'), '20101123' );
</ins><span class="cx">         $scripts-&gt;localize( 'wplink', 'wpLinkL10n', array(
</span><span class="cx">                 'update' =&gt; __('Update'),
</span><span class="cx">                 'save' =&gt; __('Save Link'),
</span><span class="lines">@@ -518,7 +518,7 @@
</span><span class="cx">         $styles-&gt;add( 'nav-menu', &quot;/wp-admin/css/nav-menu$suffix.css&quot;, array(), '20100907' );
</span><span class="cx">         $styles-&gt;add( 'admin-bar', &quot;/wp-includes/css/admin-bar$suffix.css&quot;, array(), '20101117' );
</span><span class="cx">         $styles-&gt;add( 'wp-jquery-ui-dialog', &quot;/wp-includes/css/jquery-ui-dialog$suffix.css&quot;, array(), '20101119' );
</span><del>-        $styles-&gt;add( 'wplink', &quot;/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css&quot;, array(), '20101119' );
</del><ins>+        $styles-&gt;add( 'wplink', &quot;/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css&quot;, array(), '20101123' );
</ins><span class="cx"> 
</span><span class="cx">         foreach ( $rtl_styles as $rtl_style ) {
</span><span class="cx">                 $styles-&gt;add_data( $rtl_style, 'rtl', true );
</span></span></pre>
</div>
</div>

</body>
</html>