<!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"> ?>
</span><del>-<div id="wp-link">
</del><ins>+<form id="wp-link" tabindex="-1">
</ins><span class="cx"> <div id="link-selector">
</span><span class="cx">         <div id="link-options">
</span><span class="cx">                 <p class="howto"><?php _e( 'Enter the destination URL:' ); ?></p>
</span><span class="cx">                 <div>
</span><del>-                        <label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" /></label>
</del><ins>+                        <label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" tabindex="10" autocomplete="off" /></label>
</ins><span class="cx">                 </div>
</span><span class="cx">                 <div>
</span><del>-                        <label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" /></label>
</del><ins>+                        <label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" tabindex="20" autocomplete="off" /></label>
</ins><span class="cx">                 </div>
</span><span class="cx">                 <div class="link-target">
</span><del>-                        <label><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
</del><ins>+                        <label><input type="checkbox" id="link-target-checkbox" tabindex="30" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
</ins><span class="cx">                 </div>
</span><span class="cx">         </div>
</span><span class="cx">         <div id="search-panel">
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">                         <p class="howto"><?php _e( 'Or, link to existing site content:' ); ?></p>
</span><span class="cx">                         <label for="search-field">
</span><span class="cx">                                 <span><?php _e( 'Search' ); ?></span>
</span><del>-                                <input type="text" id="search-field" class="link-search-field" />
</del><ins>+                                <input type="text" id="search-field" class="link-search-field" tabindex="60" autocomplete="off" />
</ins><span class="cx">                                 <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
</span><span class="cx">                         </label>
</span><span class="cx">                 </div>
</span><span class="lines">@@ -113,10 +113,10 @@
</span><span class="cx">                 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a>
</span><span class="cx">         </div>
</span><span class="cx">         <div id="wp-link-update">
</span><del>-                <a class="button-primary" href="#"></a>
</del><ins>+                <?php submit_button( __('Update'), 'primary', 'wp-link-submit', false, array('tabindex' => 100)); ?>
</ins><span class="cx">         </div>
</span><span class="cx"> </div>
</span><del>-</div>
</del><ins>+</form>
</ins><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx"> ?>
</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("wp.wpdialog", $.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("tinymce.plugins.WPDialogs",{init:function(c,d){c.onBeforeRenderUI.add(function(){c.windowManager=new tinymce.WPWindowManager(c)})},getInfo:function(){return{longname:"WPDialogs",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"0.1"}}});tinymce.create("tinymce.WPWindowManager:tinymce.InlineWindowManager",{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("#"+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:"wp-dialog",zIndex:300000})},close:a(function(){this.element.dialog("close")})});tinymce.PluginManager.add("wpdialogs",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("tinymce.plugins.WPDialogs",{init:function(c,d){c.onBeforeRenderUI.add(function(){c.windowManager=new tinymce.WPWindowManager(c)})},getInfo:function(){return{longname:"WPDialogs",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"0.1"}}});b(document).ready(function(){b.widget("wp.wpdialog",b.ui.dialog,{open:function(){if(tinyMCEPopup){tinyMCEPopup.init()}b.ui.dialog.prototype.open.apply(this,arguments);this.element.focus();this._trigger("refresh")}})});tinymce.create("tinymce.WPWindowManager:tinymce.InlineWindowManager",{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("#"+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:"wp-dialog",zIndex:300000})},close:a(function(){this.element.wpdialog("close")})});tinymce.PluginManager.add("wpdialogs",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="text"]{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="text"]{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="text"]{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="text"]{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 && 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("tinymce.plugins.wpLink",{init:function(a,b){a.addCommand("WP_Link",function(){a.windowManager.open({id:"wp-link",width:480,height:"auto",wpDialog:true,title:a.getLang("advlink.link_desc")},{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){var c=true;a.addCommand("WP_Link",function(){if(c){return}a.windowManager.open({id:"wp-link",width:480,height:"auto",wpDialog:true,title:a.getLang("advlink.link_desc")},{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(e,d,g,f){c=f&&g.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 (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 ( "_blank" == 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("mceBeginUndoLevel");
</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("mceEndUndoLevel");
</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("mceBeginUndoLevel");
</span><span class="cx">
</span><span class="cx">                         if (e == null) {
</span><span class="cx">                                 ed.getDoc().execCommand("unlink", false, null);
</span><ins>+                                tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {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: "#mce_temp_url#" }, defaultContent);
-                                        ed.selection.setNode(el);
-                                // If a selection exists, wrap it in a link.
-                                } else {
-                                        tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
-                                }
-
</del><span class="cx">                                 tinymce.each(ed.dom.select("a"), 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 "#mce_temp_url#" 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 && (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 && originalEvent.type == "click" )
+                                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 > 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 < 0 ) // Make first visible element
+                                this.element.scrollTop( elTop + liTop );
+                        else if ( liTop + liHeight > 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:"",init:function(){b.dialog=f("#wp-link");b.update=f("#wp-link-update a");b.url=f("#url-field");b.title=f("#link-title-field");b.openInNewTab=f("#link-target-checkbox");b.search=f("#search-field");e.search=new a(f("#search-results"));e.recent=new a(f("#most-recent-results"));e.elements=f(".query-results",b.dialog);b.update.click(wpLink.update);f("#wp-link-cancel").click(function(){tinyMCEPopup.close()});e.elements.delegate("li","click",wpLink.selectInternalLink);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind("dialogopen",wpLink.refresh)},refresh:function(){var g;d=tinyMCEPopup.editor;e.elements.find(".selected").removeClass("selected");tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),"A")){b.url.val(g.href);b.title.val(d.dom.getAttrib(g,"title"));if("_blank"==d.dom.getAttrib(g,"target")){b.openInNewTab.attr("checked","checked")}b.update.text(wpLinkL10n.update)}else{b.url.val("http://");b.title.val("");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("checked")?"_blank":""},l,g,j=i.title?i.title:i.href;tinyMCEPopup.restoreSelection();l=h.dom.getParent(h.selection.getNode(),"A");if(!i.href||i.href=="http://"){if(h.selection.isCollapsed()){tinyMCEPopup.close();return}else{if(l){tinyMCEPopup.execCommand("mceBeginUndoLevel");g=h.selection.getBookmark();h.dom.remove(l,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close();return}}}tinyMCEPopup.execCommand("mceBeginUndoLevel");if(l==null){h.getDoc().execCommand("unlink",false,null);if(h.selection.isCollapsed()){k=h.dom.create("a",{href:"#mce_temp_url#"},j);h.selection.setNode(k)}else{tinyMCEPopup.execCommand("CreateLink",false,"#mce_temp_url#",{skip_undo:1})}tinymce.each(h.dom.select("a"),function(m){if(h.dom.getAttrib(m,"href")=="#mce_temp_url#"){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!="IMG"){h.focus();h.selection.select(l);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close()},selectInternalLink:function(){var g=f(this);if(g.hasClass("unselectable")){return}g.siblings(".selected").removeClass("selected");g.addClass("selected");b.url.val(g.children(".item-permalink").val());b.title.val(g.children(".item-title").text())},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length>2){e.recent.element.hide();e.search.element.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.siblings("img.waiting").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("ul");this.waiting=i.find(".river-waiting");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&&this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(g,k){var h="",i=true,j=k.page==1;if(!g){if(j){h+='<li class="unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}}else{f.each(g,function(){h+=i?'<li class="alternate">':"<li>";h+='<input type="hidden" class="item-permalink" value="'+this["permalink"]+'" />';h+='<span class="item-title">';h+=this["title"]?this["title"]:"<em>"+wpLinkL10n.untitled+"</em>";h+='</span><span class="item-info">'+this["info"]+"</span></li>";i=!i})}this.ul[j?"html":"append"](h)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g<this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k<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:"wp-link-ajax",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)},"json")}});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:"",init:function(){b.dialog=f("#wp-link");b.submit=f("#wp-link-submit");b.url=f("#url-field");b.title=f("#link-title-field");b.openInNewTab=f("#link-target-checkbox");b.search=f("#search-field");e.search=new a(f("#search-results"));e.recent=new a(f("#most-recent-results"));e.elements=f(".query-results",b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){wpLink.update();g.preventDefault()});f("#wp-link-cancel").click(wpLink.cancel);e.elements.bind("river-select",wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind("wpdialogrefresh",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(),"A")){b.url.val(g.href);b.title.val(d.dom.getAttrib(g,"title"));if("_blank"==d.dom.getAttrib(g,"target")){b.openInNewTab.attr("checked","checked")}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("checked")?"_blank":""},j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),"A");if(!i.href||i.href=="http://"){if(j){tinyMCEPopup.execCommand("mceBeginUndoLevel");g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close()}return}tinyMCEPopup.execCommand("mceBeginUndoLevel");if(j==null){h.getDoc().execCommand("unlink",false,null);tinyMCEPopup.execCommand("CreateLink",false,"#mce_temp_url#",{skip_undo:1});tinymce.each(h.dom.select("a"),function(k){if(h.dom.getAttrib(k,"href")=="#mce_temp_url#"){j=k;h.dom.setAttribs(j,i)}});if(f(j).text()=="#mce_temp_url#"){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&&(j.childNodes.length!=1||j.firstChild.nodeName!="IMG")){h.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close()},updateFields:function(i,h,g){b.url.val(h.children(".item-permalink").val());b.title.val(h.children(".item-title").text());if(g&&g.type=="click"){b.url.focus()}},setDefaultValues:function(){b.url.val("http://");b.title.val("")},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length>2){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.siblings("img.waiting").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="prev";case g.DOWN:h=h||"next";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("ul");this.waiting=i.find(".river-waiting");this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate("li","click",function(j){g.select(f(this),j)})};f.extend(a.prototype,{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},select:function(h,k){var j,i,l,g;if(h.hasClass("unselectable")||h==this.selected){return}this.deselect();this.selected=h.addClass("selected");j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l<0){this.element.scrollTop(g+l)}else{if(l+j>i){this.element.scrollTop(g+l-i+j)}}this.element.trigger("river-select",[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass("selected")}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev("li");if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next("li"):f("li:not(.unselectable):first",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&&this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(g,k){var h="",i=true,j=k.page==1;if(!g){if(j){h+='<li class="unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}}else{f.each(g,function(){h+=i?'<li class="alternate">':"<li>";h+='<input type="hidden" class="item-permalink" value="'+this["permalink"]+'" />';h+='<span class="item-title">';h+=this["title"]?this["title"]:"<em>"+wpLinkL10n.untitled+"</em>";h+='</span><span class="item-info">'+this["info"]+"</span></li>";i=!i})}this.ul[j?"html":"append"](h)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g<this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k<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:"wp-link-ajax",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)},"json")}});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' => 'try{convertEntities(adminBarL10n);}catch(e){};',
</span><span class="cx">         ) );
</span><span class="cx">
</span><del>-        $scripts->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js", array('jquery'), '20101120' );
</del><ins>+        $scripts->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js", array('jquery'), '20101123' );
</ins><span class="cx">         $scripts->localize( 'wplink', 'wpLinkL10n', array(
</span><span class="cx">                 'update' => __('Update'),
</span><span class="cx">                 'save' => __('Save Link'),
</span><span class="lines">@@ -518,7 +518,7 @@
</span><span class="cx">         $styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100907' );
</span><span class="cx">         $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20101117' );
</span><span class="cx">         $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101119' );
</span><del>-        $styles->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css", array(), '20101119' );
</del><ins>+        $styles->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css", array(), '20101123' );
</ins><span class="cx">
</span><span class="cx">         foreach ( $rtl_styles as $rtl_style ) {
</span><span class="cx">                 $styles->add_data( $rtl_style, 'rtl', true );
</span></span></pre>
</div>
</div>
</body>
</html>