# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\Users\Gary\Documents\NetBeansProjects\WordPress\trunk\wp-admin\js
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
|
|
|
|
| 3 | 3 | // sidebar admin menu |
| 4 | 4 | adminMenu = { |
| 5 | 5 | init : function() { |
| 6 | | var menu = $('#adminmenu'); |
| | 6 | var menu = $('#adminmenu'), |
| | 7 | body = $('body'); |
| 7 | 8 | |
| 8 | | $('.wp-menu-toggle', menu).each( function() { |
| | 9 | menu.find('.wp-menu-toggle').each( function() { |
| 9 | 10 | var t = $(this), sub = t.siblings('.wp-submenu'); |
| 10 | 11 | if ( sub.length ) |
| 11 | 12 | t.click(function(){ adminMenu.toggle( sub ); }); |
| … |
… |
|
| 15 | 16 | |
| 16 | 17 | this.favorites(); |
| 17 | 18 | |
| 18 | | $('.separator', menu).click(function(){ |
| 19 | | if ( $('body').hasClass('folded') ) { |
| | 19 | menu.find('.separator').click(function(){ |
| | 20 | if ( body.hasClass('folded') ) { |
| 20 | 21 | adminMenu.fold(1); |
| 21 | 22 | deleteUserSetting( 'mfold' ); |
| 22 | 23 | } else { |
| … |
… |
|
| 26 | 27 | return false; |
| 27 | 28 | }); |
| 28 | 29 | |
| 29 | | if ( $('body').hasClass('folded') ) |
| | 30 | if ( body.hasClass('folded') ) |
| 30 | 31 | this.fold(); |
| 31 | 32 | |
| 32 | 33 | this.restoreMenuState(); |
| 33 | 34 | }, |
| 34 | 35 | |
| 35 | 36 | restoreMenuState : function() { |
| 36 | | $('li.wp-has-submenu', '#adminmenu').each(function(i, e) { |
| | 37 | $('#adminmenu').find('li.wp-has-submenu').each(function(i, e) { |
| 37 | 38 | var v = getUserSetting( 'm'+i ); |
| 38 | 39 | if ( $(e).hasClass('wp-has-current-submenu') ) |
| 39 | 40 | return true; // leave the current parent open |
| … |
… |
|
| 51 | 52 | }).parent().toggleClass( 'wp-menu-open' ).attr('id'); |
| 52 | 53 | |
| 53 | 54 | if ( id ) { |
| 54 | | $('li.wp-has-submenu', '#adminmenu').each(function(i, e) { |
| | 55 | $('#adminmenu').find('li.wp-has-submenu').each(function(i, e) { |
| 55 | 56 | if ( id == e.id ) { |
| 56 | 57 | var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c'; |
| 57 | 58 | setUserSetting( 'm'+i, v ); |
| … |
… |
|
| 63 | 64 | }, |
| 64 | 65 | |
| 65 | 66 | fold : function(off) { |
| | 67 | var wpHasSubmenu = $('#adminmenu').find('li.wp-has-submenu'); |
| 66 | 68 | if (off) { |
| 67 | 69 | $('body').removeClass('folded'); |
| 68 | | $('#adminmenu li.wp-has-submenu').unbind(); |
| | 70 | wpHasSubmenu.unbind(); |
| 69 | 71 | } else { |
| 70 | 72 | $('body').addClass('folded'); |
| 71 | | $('#adminmenu li.wp-has-submenu').hoverIntent({ |
| | 73 | wpHasSubmenu.hoverIntent({ |
| 72 | 74 | over: function(e){ |
| 73 | 75 | var m, b, h, o, f; |
| 74 | 76 | m = $(this).find('.wp-submenu'); |
| … |
… |
|
| 96 | 98 | }, |
| 97 | 99 | |
| 98 | 100 | favorites : function() { |
| 99 | | $('#favorite-inside').width( $('#favorite-actions').width() - 4 ); |
| 100 | | $('#favorite-toggle, #favorite-inside').bind('mouseenter', function() { |
| 101 | | $('#favorite-inside').removeClass('slideUp').addClass('slideDown'); |
| | 101 | var favoriteFirst = $('#favorite-first'), |
| | 102 | favoriteInside = $('#favorite-inside'); |
| | 103 | |
| | 104 | favoriteInside.width( $('#favorite-actions').width() - 4 ); |
| | 105 | $('#favorite-toggle').add(favoriteInside).bind('mouseenter', function() { |
| | 106 | favoriteInside.removeClass('slideUp').addClass('slideDown'); |
| 102 | 107 | setTimeout(function() { |
| 103 | | if ( $('#favorite-inside').hasClass('slideDown') ) { |
| 104 | | $('#favorite-inside').slideDown(100); |
| 105 | | $('#favorite-first').addClass('slide-down'); |
| | 108 | if ( favoriteInside.hasClass('slideDown') ) { |
| | 109 | favoriteInside.slideDown(100); |
| | 110 | favoriteFirst.addClass('slide-down'); |
| 106 | 111 | } |
| 107 | 112 | }, 200); |
| 108 | 113 | }).bind('mouseleave', function() { |
| 109 | | $('#favorite-inside').removeClass('slideDown').addClass('slideUp'); |
| | 114 | favoriteInside.removeClass('slideDown').addClass('slideUp'); |
| 110 | 115 | setTimeout(function() { |
| 111 | | if ( $('#favorite-inside').hasClass('slideUp') ) { |
| 112 | | $('#favorite-inside').slideUp(100, function() { |
| 113 | | $('#favorite-first').removeClass('slide-down'); |
| | 116 | if ( favoriteInside.hasClass('slideUp') ) { |
| | 117 | favoriteInside.slideUp(100, function() { |
| | 118 | favoriteFirst.removeClass('slide-down'); |
| 114 | 119 | }); |
| 115 | 120 | } |
| 116 | 121 | }, 300); |
| … |
… |
|
| 202 | 207 | }; |
| 203 | 208 | |
| 204 | 209 | jQuery(document).ready( function($) { |
| 205 | | var lastClicked = false, checks, first, last, checked, bgx = ( isRtl ? 'left' : 'right' ); |
| | 210 | var lastClicked = false, checks, first, last, checked, bgx = ( isRtl ? 'left' : 'right' ), |
| | 211 | helpLink = $('#contextual-help-link'), |
| | 212 | helpLinkWrap = $('#contextual-help-link-wrap'), |
| | 213 | helpWrap = $('#contextual-help-wrap'), |
| | 214 | screenOptionsLinkWrap = $('#screen-options-link-wrap'), |
| | 215 | screenOptionsWrap = $('#screen-options-wrap'), |
| | 216 | showSettingsLink = $('#show-settings-link'); |
| 206 | 217 | |
| 207 | 218 | // Move .updated and .error alert boxes. Don't move boxes designed to be inline. |
| 208 | 219 | $('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2'); |
| 209 | 220 | $('div.updated, div.error').not('.below-h2, .inline').insertAfter( $('div.wrap h2:first') ); |
| 210 | 221 | |
| 211 | 222 | // screen settings tab |
| 212 | | $('#show-settings-link').click(function () { |
| 213 | | if ( ! $('#screen-options-wrap').hasClass('screen-options-open') ) |
| 214 | | $('#contextual-help-link-wrap').css('visibility', 'hidden'); |
| | 223 | showSettingsLink.click(function () { |
| | 224 | if ( ! screenOptionsWrap.hasClass('screen-options-open') ) |
| | 225 | helpLinkWrap.css('visibility', 'hidden'); |
| 215 | 226 | |
| 216 | | $('#screen-options-wrap').slideToggle('fast', function(){ |
| | 227 | screenOptionsWrap.slideToggle('fast', function(){ |
| 217 | 228 | if ( $(this).hasClass('screen-options-open') ) { |
| 218 | | $('#show-settings-link').css({'backgroundPosition':'top '+bgx}); |
| 219 | | $('#contextual-help-link-wrap').css('visibility', ''); |
| | 229 | showSettingsLink.css({'backgroundPosition':'top '+bgx}); |
| | 230 | helpLinkWrap.css('visibility', ''); |
| 220 | 231 | $(this).removeClass('screen-options-open'); |
| 221 | 232 | } else { |
| 222 | | $('#show-settings-link').css({'backgroundPosition':'bottom '+bgx}); |
| | 233 | showSettingsLink.css({'backgroundPosition':'bottom '+bgx}); |
| 223 | 234 | $(this).addClass('screen-options-open'); |
| 224 | 235 | } |
| 225 | 236 | }); |
| … |
… |
|
| 227 | 238 | }); |
| 228 | 239 | |
| 229 | 240 | // help tab |
| 230 | | $('#contextual-help-link').click(function () { |
| 231 | | if ( ! $('#contextual-help-wrap').hasClass('contextual-help-open') ) |
| 232 | | $('#screen-options-link-wrap').css('visibility', 'hidden'); |
| 233 | 241 | |
| 234 | | $('#contextual-help-wrap').slideToggle('fast', function() { |
| | 242 | helpLink.click(function () { |
| | 243 | if ( ! helpWrap.hasClass('contextual-help-open') ) |
| | 244 | screenOptionsLinkWrap.css('visibility', 'hidden'); |
| | 245 | |
| | 246 | helpWrap.slideToggle('fast', function() { |
| 235 | 247 | if ( $(this).hasClass('contextual-help-open') ) { |
| 236 | | $('#contextual-help-link').css({'backgroundPosition':'top '+bgx}); |
| 237 | | $('#screen-options-link-wrap').css('visibility', ''); |
| | 248 | helpLink.css({'backgroundPosition':'top '+bgx}); |
| | 249 | screenOptionsLinkWrap.css('visibility', ''); |
| 238 | 250 | $(this).removeClass('contextual-help-open'); |
| 239 | 251 | } else { |
| 240 | | $('#contextual-help-link').css({'backgroundPosition':'bottom '+bgx}); |
| | 252 | helpLink.css({'backgroundPosition':'bottom '+bgx}); |
| 241 | 253 | $(this).addClass('contextual-help-open'); |
| 242 | 254 | } |
| 243 | 255 | }); |
| … |
… |
|
| 326 | 338 | e.stopPropagation(); |
| 327 | 339 | if ( e.preventDefault ) |
| 328 | 340 | e.preventDefault(); |
| 329 | | }); |
| 330 | | |
| 331 | | $('#newcontent').blur(function(e) { |
| | 341 | }).blur(function(e) { |
| 332 | 342 | if ( this.lastKey && 9 == this.lastKey ) |
| 333 | 343 | this.focus(); |
| 334 | 344 | }); |