<!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>[16439] trunk/wp-includes/js/tinymce: Pinking shears</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16439">16439</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-11-17 18:48:27 +0000 (Wed, 17 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Pinking shears</pre>

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

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjstinymcepluginswplinkeditor_plugindevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js (16438 => 16439)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js        2010-11-17 18:47:34 UTC (rev 16438)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js        2010-11-17 18:48:27 UTC (rev 16439)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx">                                 title : ed.getLang('advanced.link_desc'),
</span><span class="cx">                                 cmd : 'WP_Link'
</span><span class="cx">                         });
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         ed.addShortcut('alt+shift+a', ed.getLang('advanced.link_desc'), 'WP_Link');
</span><span class="cx"> 
</span><span class="cx">                         // Add a node change handler, selects the button in the UI when a link is selected
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkjswplinkdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js (16438 => 16439)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2010-11-17 18:47:34 UTC (rev 16438)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2010-11-17 18:48:27 UTC (rev 16439)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-(function($){        
</del><ins>+(function($){
</ins><span class="cx">         var inputs = {}, results = {}, ed,
</span><span class="cx">         wpLink = {
</span><span class="cx">                 timeToTriggerRiver: 150,
</span><span class="lines">@@ -15,8 +15,8 @@
</span><span class="cx">                         var e;
</span><span class="cx">                         // Init shared vars
</span><span class="cx">                         ed = tinyMCEPopup.editor;
</span><del>-                        
-                        
</del><ins>+
+
</ins><span class="cx">                         // URL
</span><span class="cx">                         inputs.url = $('#url-field');
</span><span class="cx">                         // Secondary options
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">                         results.recent = $('#most-recent-results');
</span><span class="cx">                         results.search.data('river', wpLink.riverDefaults() );
</span><span class="cx">                         results.recent.data('river', wpLink.riverDefaults() );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         // Bind event handlers
</span><span class="cx">                         $('#wp-update').click( wpLink.update );
</span><span class="cx">                         $('#wp-cancel').click( function() { tinyMCEPopup.close(); } );
</span><span class="lines">@@ -46,11 +46,11 @@
</span><span class="cx">                                 if ( &quot;_blank&quot; == ed.dom.getAttrib(e, 'target') )
</span><span class="cx">                                         inputs.openInNewTab.attr('checked','checked');
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         // Focus the URL field
</span><span class="cx">                         inputs.url.focus();
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 update : function() {
</span><span class="cx">                         var el,
</span><span class="cx">                                 ed = tinyMCEPopup.editor,
</span><span class="lines">@@ -60,10 +60,10 @@
</span><span class="cx">                                         target : inputs.openInNewTab.attr('checked') ? '_blank' : ''
</span><span class="cx">                                 }, e, b,
</span><span class="cx">                                 defaultContent = attrs.title ? attrs.title : attrs.href;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         tinyMCEPopup.restoreSelection();
</span><span class="cx">                         e = ed.dom.getParent(ed.selection.getNode(), 'A');
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         // If the values are empty...
</span><span class="cx">                         if ( ! attrs.href ) {
</span><span class="cx">                                 // ...and nothing is selected, we should return
</span><span class="lines">@@ -81,12 +81,12 @@
</span><span class="cx">                                         return;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><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><del>-                                
</del><ins>+
</ins><span class="cx">                                 // If no selection exists, create a new link from scratch.
</span><span class="cx">                                 if ( ed.selection.isCollapsed() ) {
</span><span class="cx">                                         el = ed.dom.create('a', { href: &quot;#mce_temp_url#&quot; }, defaultContent);
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">                         tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);
</span><span class="cx">                         tinyMCEPopup.close();
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 selectInternalLink : function() {
</span><span class="cx">                         var t = $(this);
</span><span class="cx">                         if ( t.hasClass('unselectable') )
</span><span class="lines">@@ -127,24 +127,24 @@
</span><span class="cx">                         inputs.url.val( t.children('.item-permalink').val() );
</span><span class="cx">                         inputs.title.val( t.children('.item-title').text() );
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 maybeLoadRiver : function() {
</span><span class="cx">                         var t = $(this),
</span><span class="cx">                                 ul = t.children('ul'),
</span><span class="cx">                                 river = t.data('river'),
</span><span class="cx">                                 bottom = t.scrollTop() + t.height();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( bottom != ul.height() || river.active || river.allLoaded )
</span><span class="cx">                                 return;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         setTimeout(function() {
</span><span class="cx">                                 var newTop = t.scrollTop(),
</span><span class="cx">                                         newBottom = newTop + t.height(),
</span><span class="cx">                                         waiting = t.find('.river-waiting');
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 if ( bottom != newBottom || newBottom != ul.height() || river.active || river.allLoaded )
</span><span class="cx">                                         return;
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 river.active = true;
</span><span class="cx">                                 waiting.show();
</span><span class="cx">                                 t.scrollTop( newTop + waiting.outerHeight() );
</span><span class="lines">@@ -163,18 +163,18 @@
</span><span class="cx">                 searchInternalLinks : function() {
</span><span class="cx">                         var t = $(this), waiting,
</span><span class="cx">                                 title = t.val();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( title.length &gt; 2 ) {
</span><span class="cx">                                 results.recent.hide();
</span><span class="cx">                                 results.search.show();
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 // Don't search if the keypress didn't change the title.
</span><span class="cx">                                 if ( wpLink.lastSearch == title )
</span><span class="cx">                                         return;
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 wpLink.lastSearch = title;
</span><span class="cx">                                 waiting = t.siblings('img.waiting').show();
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 results.search.data('river', wpLink.riverDefaults() );
</span><span class="cx">                                 results.search.scrollTop(0);
</span><span class="cx">                                 wpLink.linkAJAX( results.search, { title : title }, function(){ waiting.hide(); });
</span><span class="lines">@@ -183,29 +183,29 @@
</span><span class="cx">                                 results.recent.show();
</span><span class="cx">                         }
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 linkAJAX : function( $panel, params, callback, opts ) {
</span><span class="cx">                         var response;
</span><span class="cx">                         opts = opts || {};
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( ! $panel.hasClass('query-results') )
</span><span class="cx">                                 $panel = $panel.parents('.query-results');
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( ! $panel.length )
</span><span class="cx">                                 return;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         response = wpLink.delayedCallback( function( results ) {
</span><span class="cx">                                 wpLink.processAJAXResponse( $panel, results, callback, opts );
</span><span class="cx">                         }, opts.delay );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $.post( ajaxurl, $.extend({
</span><span class="cx">                                 action : 'wp-link-ajax'
</span><span class="cx">                         }, params ), response, &quot;json&quot; );
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 processAJAXResponse: function( $panel, results, callback, opts ) {
</span><span class="cx">                         var list = '';
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( !results ) {
</span><span class="cx">                                 if ( !opts.append ) {
</span><span class="cx">                                         list += '&lt;li class=&quot;no-matches-found unselectable&quot;&gt;&lt;span class=&quot;item-title&quot;&gt;&lt;em&gt;'
</span><span class="lines">@@ -220,28 +220,28 @@
</span><span class="cx">                                         list += '&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;' + this['info'] + '&lt;/span&gt;&lt;/li&gt;';
</span><span class="cx">                                 });
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         // Set results
</span><span class="cx">                         $panel.children('ul')[ opts.append ? 'append' : 'html' ]( list );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         // Run callback
</span><span class="cx">                         if ( callback )
</span><span class="cx">                                 callback( results );
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 delayedCallback : function( func, delay ) {
</span><span class="cx">                         var timeoutTriggered, funcTriggered, funcArgs, funcContext;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( ! delay )
</span><span class="cx">                                 return func;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         setTimeout( function() {
</span><span class="cx">                                 if ( funcTriggered )
</span><span class="cx">                                         return func.apply( funcContext, funcArgs );
</span><span class="cx">                                 // Otherwise, wait.
</span><span class="cx">                                 timeoutTriggered = true;
</span><span class="cx">                         }, delay);
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         return function() {
</span><span class="cx">                                 if ( timeoutTriggered )
</span><span class="cx">                                         return func.apply( this, arguments );
</span><span class="lines">@@ -252,6 +252,6 @@
</span><span class="cx">                         };
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         $(document).ready( wpLink.init );
</span><span class="cx"> })(jQuery);
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcewpmcelinkincludesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/wp-mce-link-includes.php (16438 => 16439)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/wp-mce-link-includes.php        2010-11-17 18:47:34 UTC (rev 16438)
+++ trunk/wp-includes/js/tinymce/wp-mce-link-includes.php        2010-11-17 18:48:27 UTC (rev 16439)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> function wp_link_query( $args = array() ) {
</span><span class="cx">         $pts = get_post_types( array( 'publicly_queryable' =&gt; true ), 'objects' );
</span><span class="cx">         $pt_names = array_keys( $pts );
</span><del>-        
</del><ins>+
</ins><span class="cx">         $query = array(
</span><span class="cx">                 'post_type' =&gt; $pt_names,
</span><span class="cx">                 'suppress_filters' =&gt; true,
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">         // Check if any posts were found.
</span><span class="cx">         if ( ! $get_posts-&gt;post_count )
</span><span class="cx">                 return false;
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Build results.
</span><span class="cx">         $results = array();
</span><span class="cx">         foreach ( $posts as $post ) {
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">                         $info = mysql2date( __( 'Y/m/d' ), $post-&gt;post_date );
</span><span class="cx">                 else
</span><span class="cx">                         $info = $pts[ $post-&gt;post_type ]-&gt;labels-&gt;singular_name;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $results[] = array(
</span><span class="cx">                         'ID' =&gt; $post-&gt;ID,
</span><span class="cx">                         'title' =&gt; esc_html( strip_tags($post-&gt;post_title) ),
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> 
</span><span class="cx">         if ( ! isset( $results ) )
</span><span class="cx">                 die( '0' );
</span><del>-        
</del><ins>+
</ins><span class="cx">         echo json_encode( $results );
</span><span class="cx">         echo &quot;\n&quot;;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>