<!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>[14465] trunk/wp-admin/js/nav-menu.dev.js:
  Trim trailing whites from nav-menu js.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14465">14465</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-05-05 20:37:32 +0000 (Wed, 05 May 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Trim trailing whites from nav-menu js.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjsnavmenudevjs">trunk/wp-admin/js/nav-menu.dev.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjsnavmenudevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.dev.js (14464 => 14465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.dev.js        2010-05-05 20:29:50 UTC (rev 14464)
+++ trunk/wp-admin/js/nav-menu.dev.js        2010-05-05 20:37:32 UTC (rev 14465)
</span><span class="lines">@@ -177,13 +177,13 @@
</span><span class="cx">                                 var t = $(this),
</span><span class="cx">                                         checked = t.find('.tabs-panel-active .categorychecklist li input:checked'),
</span><span class="cx">                                         re = new RegExp('menu-item\\[(\[^\\]\]*)');
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                                 processMethod = processMethod || api.addMenuItemToBottom;
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                                 // If no items are checked, bail.
</span><span class="cx">                                 if ( !checked.length )
</span><span class="cx">                                         return false;
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                                 // Show the ajax spinner
</span><span class="cx">                                 t.find('img.waiting').show();
</span><span class="cx"> 
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">                         targetList = menuList;
</span><span class="cx"> 
</span><span class="cx">                         this.attachMenuEditListeners();
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         this.setupInputWithDefaultTitle();
</span><span class="cx">                         this.attachAddMenuItemListeners();
</span><span class="cx">                         this.attachQuickSearchListeners();
</span><span class="lines">@@ -232,9 +232,9 @@
</span><span class="cx">                         this.initToggles();
</span><span class="cx"> 
</span><span class="cx">                         this.initTabManager();
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         this.initAddMenuItemDraggables();
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         this.checkForEmptyMenu();
</span><span class="cx">                 },
</span><span class="cx"> 
</span><span class="lines">@@ -268,11 +268,11 @@
</span><span class="cx">                                         transport = ui.item.children('.menu-item-transport');
</span><span class="cx">                                         // Check if the item is in the menu, or new
</span><span class="cx">                                         newItem = ( ui.helper.hasClass('new-menu-item') );
</span><del>-                                        
</del><ins>+                                
</ins><span class="cx">                                         // Set depths. currentDepth must be set before children are located.
</span><span class="cx">                                         originalDepth = ( newItem ) ? 0 : ui.item.menuItemDepth();
</span><span class="cx">                                         updateCurrentDepth(ui, originalDepth);
</span><del>-                                        
</del><ins>+                                
</ins><span class="cx">                                         if( ! newItem ) {
</span><span class="cx">                                                 // Attach child elements to parent
</span><span class="cx">                                                 // Skip the placeholder
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx"> 
</span><span class="cx">                                         // Return child elements to the list
</span><span class="cx">                                         children = transport.children().insertAfter(ui.item);
</span><del>-                                        
</del><ins>+                                
</ins><span class="cx">                                         if( newItem ) {
</span><span class="cx">                                                 // Remove the helper item
</span><span class="cx">                                                 ui.item.remove();
</span><span class="lines">@@ -374,7 +374,7 @@
</span><span class="cx">                                 currentDepth = depth;
</span><span class="cx">                         }
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 initAddMenuItemDraggables : function() {
</span><span class="cx">                         var menuItems = $('.potential-menu-item');
</span><span class="cx">                         menuItems.click(function(e){
</span><span class="lines">@@ -389,7 +389,7 @@
</span><span class="cx">                                                  item = target.parent(),
</span><span class="cx">                                                 li = item.parent(),
</span><span class="cx">                                                 items;
</span><del>-                                        
</del><ins>+                                
</ins><span class="cx">                                         // Make sure the item we're dragging is selected.
</span><span class="cx">                                         item.selectItem();
</span><span class="cx">                                         // Set us to be the ajax target
</span><span class="lines">@@ -399,7 +399,7 @@
</span><span class="cx">                                         ui.helper.children('.additional-menu-items').append( items );
</span><span class="cx">                                         // This class tells the sortables to treat it as a new item.
</span><span class="cx">                                         ui.helper.addClass('new-menu-item');
</span><del>-                                        
</del><ins>+                                
</ins><span class="cx">                                         // CSS tweaks to remove some unnecessary items
</span><span class="cx">                                         ui.helper.children('div').hide();
</span><span class="cx">                                         items.first().css('margin-top', 0);
</span><span class="lines">@@ -407,10 +407,10 @@
</span><span class="cx">                                         // Make the items look like menu items
</span><span class="cx">                                         items.children('div').addClass('menu-item-handle');
</span><span class="cx">                                         ui.helper.children('div').addClass('hidden-handle');
</span><del>-                                        
</del><ins>+                                
</ins><span class="cx">                                         // Trigger the ajax
</span><span class="cx">                                         li.parents('.inside').find('.add-to-menu input').click();
</span><del>-                                        
</del><ins>+                                
</ins><span class="cx">                                         // Lock dimensions
</span><span class="cx">                                         ui.helper.width( ui.helper.width() );
</span><span class="cx">                                         ui.helper.height( ui.helper.height() );
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> 
</span><span class="cx">                 attachAddMenuItemListeners : function() {
</span><span class="cx">                         var form = $('#nav-menu-meta');
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         form.find('.add-to-menu input').click(function(){
</span><span class="cx">                                 $(this).trigger('wp-add-menu-item', [api.addMenuItemToBottom]);
</span><span class="cx">                                 return false;
</span><span class="lines">@@ -480,13 +480,13 @@
</span><span class="cx">                         });
</span><span class="cx">                         form.find('.posttypediv, .taxonomydiv').bind('wp-add-menu-item', function(e, processMethod) {
</span><span class="cx">                                 $(this).addSelectedToMenu( processMethod );
</span><del>-                        });        
</del><ins>+                        });
</ins><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 attachQuickSearchListeners : function() {
</span><span class="cx">                         var that = this,
</span><span class="cx">                                 form = $('#nav-menu-meta');
</span><del>-                                
</del><ins>+                        
</ins><span class="cx">                         // auto-suggest for the quick-search boxes
</span><span class="cx">                         $('input.quick-search').each(function(i, el) {
</span><span class="cx">                                 that.setupQuickSearchEventListeners(el);
</span><span class="lines">@@ -499,7 +499,7 @@
</span><span class="cx">                                 that.quickSearch( $(this).attr('id') );
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 quickSearch : function(id) {
</span><span class="cx">                         var type = $('#' + id + ' .quick-search').attr('name'),
</span><span class="cx">                         q = $('#' + id + ' .quick-search').val(),
</span><span class="lines">@@ -524,16 +524,16 @@
</span><span class="cx">                                 processMethod.call(that, menuMarkup, params);
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 addCustomLink : function( processMethod ) {
</span><span class="cx">                         var url = $('#custom-menu-item-url').val(),
</span><span class="cx">                                 label = $('#custom-menu-item-name').val();
</span><del>-                                
</del><ins>+                        
</ins><span class="cx">                         processMethod = processMethod || api.addMenuItemToBottom;
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         if ( '' == url || 'http://' == url )
</span><span class="cx">                                 return false;
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         // Show the ajax spinner
</span><span class="cx">                         $('.customlinkdiv img.waiting').show();
</span><span class="cx">                         this.addLinkToMenu( url, label, processMethod, function() {
</span><span class="lines">@@ -544,11 +544,11 @@
</span><span class="cx">                                 $('#custom-menu-item-url').val('http://');
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 addLinkToMenu : function(url, label, processMethod, callback) {
</span><span class="cx">                         processMethod = processMethod || api.addMenuItemToBottom;
</span><span class="cx">                         callback = callback || function(){};
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         api.addItemToMenu({
</span><span class="cx">                                 '-1': {
</span><span class="cx">                                         'menu-item-type': 'custom',
</span><span class="lines">@@ -557,21 +557,21 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }, processMethod, callback);
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 addItemToMenu : function(menuItem, processMethod, callback) {
</span><span class="cx">                         var menu = $('#menu').val(),
</span><span class="cx">                                 nonce = $('#menu-settings-column-nonce').val();
</span><del>-                                
</del><ins>+                        
</ins><span class="cx">                         processMethod = processMethod || function(){};
</span><span class="cx">                         callback = callback || function(){};
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         params = {
</span><span class="cx">                                 'action': 'add-menu-item',
</span><span class="cx">                                 'menu': menu,
</span><span class="cx">                                 'menu-settings-column-nonce': nonce,
</span><span class="cx">                                 'menu-item': menuItem,
</span><span class="cx">                         };
</span><del>-                        
</del><ins>+                
</ins><span class="cx">                         $.post( ajaxurl, params, function(menuMarkup) {
</span><span class="cx">                                 processMethod(menuMarkup, params);
</span><span class="cx">                                 callback();
</span><span class="lines">@@ -587,11 +587,11 @@
</span><span class="cx">                 addMenuItemToBottom : function( menuMarkup, req ) {
</span><span class="cx">                         $(menuMarkup).hideAdvancedMenuItemFields().appendTo( targetList );
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 addMenuItemToTop : function( menuMarkup, req ) {
</span><span class="cx">                         $(menuMarkup).hideAdvancedMenuItemFields().prependTo( targetList );
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 attachHomeLinkListener : function() {
</span><span class="cx">                         $('.add-home-link', '.customlinkdiv').click(function(e) {
</span><span class="cx">                                 api.addLinkToMenu( navMenuL10n.homeurl, navMenuL10n.home, api.addMenuItemToTop, recalculateMenuItemPositions );
</span><span class="lines">@@ -917,7 +917,7 @@
</span><span class="cx">                                 that.checkForEmptyMenu();
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><del>-                
</del><ins>+        
</ins><span class="cx">                 checkForEmptyMenu : function() {
</span><span class="cx">                         if( menuList.children().length ) return;
</span><span class="cx">                         menuList.height(80).one('sortstop', function(){
</span></span></pre>
</div>
</div>

</body>
</html>