<!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>[14740] trunk/wp-admin/js/nav-menu.dev.js:
Remove trailing tabs from nav-menu.dev.js</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14740">14740</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2010-05-19 08:44:28 +0000 (Wed, 19 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove trailing tabs from nav-menu.dev.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 (14739 => 14740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.dev.js        2010-05-19 07:03:24 UTC (rev 14739)
+++ trunk/wp-admin/js/nav-menu.dev.js        2010-05-19 08:44:28 UTC (rev 14740)
</span><span class="lines">@@ -11,14 +11,14 @@
</span><span class="cx"> var wpNavMenu;
</span><span class="cx">
</span><span class="cx"> (function($) {
</span><del>-        
</del><ins>+
</ins><span class="cx">         var api = wpNavMenu = {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 options : {
</span><span class="cx">                         menuItemDepthPerLevel : 30, // Do not use directly. Use depthToPx and pxToDepth instead.
</span><span class="cx">                         globalMaxDepth : 11
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 menuList : undefined,        // Set in init.
</span><span class="cx">                 targetList : undefined, // Set in init.
</span><span class="cx">
</span><span class="lines">@@ -28,9 +28,9 @@
</span><span class="cx">                         api.targetList = api.menuList;
</span><span class="cx">
</span><span class="cx">                         this.jQueryExtensions();
</span><del>-                        
</del><ins>+
</ins><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">@@ -47,7 +47,7 @@
</span><span class="cx">
</span><span class="cx">                         this.initTabManager();
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 jQueryExtensions : function() {
</span><span class="cx">                         // jQuery extensions
</span><span class="cx">                         $.fn.extend({
</span><span class="lines">@@ -171,11 +171,11 @@
</span><span class="cx">                                         var height, width, parent, children, maxChildDepth, tempHolder;
</span><span class="cx">
</span><span class="cx">                                         transport = ui.item.children('.menu-item-transport');
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                         // Set depths. currentDepth must be set before children are located.
</span><span class="cx">                                         originalDepth = ui.item.menuItemDepth();
</span><span class="cx">                                         updateCurrentDepth(ui, originalDepth);
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                         // Attach child elements to parent
</span><span class="cx">                                         // Skip the placeholder
</span><span class="cx">                                         parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item;
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx">                                         width += api.depthToPx(maxChildDepth - originalDepth); // Account for children
</span><span class="cx">                                         width -= 2; // Subtract 2 for borders
</span><span class="cx">                                         ui.placeholder.width(width);
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         // Update the list of menu items.
</span><span class="cx">                                         tempHolder = ui.placeholder.next();
</span><span class="cx">                                         tempHolder.css( 'margin-top', helperHeight + 'px' ); // Set the margin to absorb the placeholder
</span><span class="lines">@@ -209,7 +209,7 @@
</span><span class="cx">                                         $(this).sortable( "refresh" ); // The children aren't sortable. We should let jQ UI know.
</span><span class="cx">                                         ui.item.after( ui.placeholder ); // reattach the placeholder.
</span><span class="cx">                                         tempHolder.css('margin-top', 0); // reset the margin
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         // Now that the element is complete, we can update...
</span><span class="cx">                                         updateSharedVars(ui);
</span><span class="cx">                                 },
</span><span class="lines">@@ -218,7 +218,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">                                         // Update depth classes
</span><span class="cx">                                         if( depthChange != 0 ) {
</span><span class="cx">                                                 ui.item.updateDepthClass( currentDepth );
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx">
</span><span class="cx">                                         if( depth != currentDepth )
</span><span class="cx">                                                 updateCurrentDepth(ui, depth);
</span><del>-                                                
</del><ins>+
</ins><span class="cx">                                         // If we overlap the next element, manually shift downwards
</span><span class="cx">                                         if( nextThreshold && offset.top + helperHeight > nextThreshold ) {
</span><span class="cx">                                                 next.after( ui.placeholder );
</span><span class="lines">@@ -258,7 +258,7 @@
</span><span class="cx">
</span><span class="cx">                         function updateSharedVars(ui) {
</span><span class="cx">                                 var depth;
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 prev = ui.placeholder.prev();
</span><span class="cx">                                 next = ui.placeholder.next();
</span><span class="cx">
</span><span class="lines">@@ -331,7 +331,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">@@ -343,7 +343,7 @@
</span><span class="cx">                                 $(this).addSelectedToMenu( processMethod );
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 attachThemeLocationsListeners : function() {
</span><span class="cx">                         var loc = $('#nav-menu-theme-locations'),
</span><span class="cx">                         params = {
</span><span class="lines">@@ -359,33 +359,33 @@
</span><span class="cx">                                 return false;
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><del>-        
</del><ins>+
</ins><span class="cx">                 attachQuickSearchListeners : function() {
</span><span class="cx">                         var searchTimer;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $('.quick-search').keypress(function(e){
</span><span class="cx">                                 var t = $(this);
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 if( 13 == e.which ) {
</span><span class="cx">                                         api.updateQuickSearchResults( t );
</span><span class="cx">                                         return false;
</span><span class="cx">                                 }
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 if( searchTimer ) clearTimeout(searchTimer);
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 searchTimer = setTimeout(function(){
</span><span class="cx">                                         api.updateQuickSearchResults( t );
</span><span class="cx">                                 }, 400);
</span><span class="cx">                         }).attr('autocomplete','off');
</span><span class="cx">                 },
</span><del>-                
</del><ins>+
</ins><span class="cx">                 updateQuickSearchResults : function(input) {
</span><span class="cx">                         var panel, params,
</span><span class="cx">                         minSearchLength = 2,
</span><span class="cx">                         q = input.val();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if( q.length < minSearchLength ) return;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         panel = input.parents('.tabs-panel');
</span><span class="cx">                         params = {
</span><span class="cx">                                 'action': 'menu-quick-search',
</span><span class="lines">@@ -402,16 +402,16 @@
</span><span class="cx">                                 api.processQuickSearchQueryResponse(menuMarkup, params, panel);
</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">@@ -422,11 +422,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">@@ -435,21 +435,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">@@ -465,11 +465,11 @@
</span><span class="cx">                 addMenuItemToBottom : function( menuMarkup, req ) {
</span><span class="cx">                         $(menuMarkup).hideAdvancedMenuItemFields().appendTo( api.targetList );
</span><span class="cx">                 },
</span><del>-        
</del><ins>+
</ins><span class="cx">                 addMenuItemToTop : function( menuMarkup, req ) {
</span><span class="cx">                         $(menuMarkup).hideAdvancedMenuItemFields().prependTo( api.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 );
</span><span class="lines">@@ -481,19 +481,19 @@
</span><span class="cx">                         $('#menu-settings-column').bind('click', function(e) {
</span><span class="cx">                                 var selectAreaMatch, activePanel, panelId, wrapper, items,
</span><span class="cx">                                         target = $(e.target);
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 if ( target.hasClass('nav-tab-link') ) {
</span><span class="cx">                                         panelId = /#(.*)$/.exec(e.target.href);
</span><span class="cx">                                         if ( panelId && panelId[1] )
</span><span class="cx">                                                 panelId = panelId[1]
</span><span class="cx">                                         else
</span><span class="cx">                                                 return false;
</span><del>-                                                
</del><ins>+
</ins><span class="cx">                                         wrapper = target.parents('.inside').first();
</span><span class="cx">
</span><span class="cx">                                         // upon changing tabs, we want to uncheck all checkboxes
</span><span class="cx">                                         $('input', wrapper).removeAttr('checked');
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         $('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
</span><span class="cx">                                         $('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
</span><span class="cx">
</span><span class="lines">@@ -706,7 +706,7 @@
</span><span class="cx">                         pattern = new RegExp('menu-item\\[(\[^\\]\]*)', 'g'),
</span><span class="cx">                         items = resp.match(/<li>.*<\/li>/g);
</span><span class="cx">
</span><del>-                        if( ! items ) {                                
</del><ins>+                        if( ! items ) {
</ins><span class="cx">                                 $('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
</span><span class="cx">                                 $('img.waiting', panel).hide();
</span><span class="cx">                                 return;
</span></span></pre>
</div>
</div>
</body>
</html>