Changeset 26232
- Timestamp:
- 11/15/2013 11:18:18 PM (11 years ago)
- Location:
- trunk/src/wp-admin/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/dashboard.js
r26230 r26232 1 /* global pagenow */1 /* global pagenow, ajaxurl, postboxes, wpActiveEditor:true */ 2 2 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad; 3 3 … … 6 6 var welcomePanel = $('#welcome-panel'), 7 7 welcomePanelHide = $('#wp_welcome_panel-hide'), 8 8 updateWelcomePanel = function( visible ) { 9 9 $.post( ajaxurl, { 10 10 action: 'update-welcome-panel', … … 14 14 }; 15 15 16 if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') ) 16 if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') ) { 17 17 welcomePanel.removeClass('hidden'); 18 } 18 19 19 20 $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) { … … 49 50 if ( el ) { 50 51 el = el.toString(); 51 if ( $.inArray(el, ajaxWidgets) != -1 )52 if ( $.inArray(el, ajaxWidgets) !== -1 ) { 52 53 show(0, el); 54 } 53 55 } else { 54 56 $.each( ajaxWidgets, show ); … … 91 93 var input = $(this), prompt = $('#' + this.id + '-prompt-text'); 92 94 93 if ( '' === this.value ) 95 if ( '' === this.value ) { 94 96 prompt.removeClass('screen-reader-text'); 97 } 95 98 96 99 prompt.click( function() { … … 100 103 101 104 input.blur( function() { 102 if ( '' === this.value ) 105 if ( '' === this.value ) { 103 106 prompt.removeClass('screen-reader-text'); 107 } 104 108 }); 105 109 … … 110 114 111 115 $('#quick-press').on( 'click focusin', function() { 112 $(this).addClass( "quickpress-open");113 $( "#description-wrap, p.submit").slideDown(200);116 $(this).addClass('quickpress-open'); 117 $('#description-wrap, p.submit').slideDown(200); 114 118 wpActiveEditor = 'content'; 115 119 }); … … 121 125 $( this ).fadeOut().closest('.activity-block').find( 'li.hidden' ).fadeIn().removeClass( 'hidden' ); 122 126 e.preventDefault(); 123 }) 127 }); 124 128 125 129 // Dashboard columns 126 jQuery(document).ready(function ( $) {130 jQuery(document).ready(function () { 127 131 // Update main column count on load 128 132 updateColumnCount(); … … 135 139 function updateColumnCount() { 136 140 var cols = 1, 137 windowWidth = parseInt(jQuery(window).width()); 138 if (799 < windowWidth && 1299 > windowWidth) 141 windowWidth = parseInt(jQuery(window).width(), 10); 142 143 if (799 < windowWidth && 1299 > windowWidth) { 139 144 cols = 2; 140 if (1300 < windowWidth && 1799 > windowWidth) 145 } 146 147 if (1300 < windowWidth && 1799 > windowWidth) { 141 148 cols = 3; 142 if (1800 < windowWidth) 149 } 150 151 if (1800 < windowWidth) { 143 152 cols = 4; 153 } 144 154 jQuery('.metabox-holder').attr('class', jQuery('.metabox-holder').attr('class').replace(/columns-\d+/, 'columns-' + cols)); 145 155 } -
trunk/src/wp-admin/js/media-gallery.js
r21592 r26232 1 /* global ajaxurl */ 1 2 jQuery(function($){ 2 3 $( 'body' ).bind( 'click.wp-gallery', function(e){ -
trunk/src/wp-admin/js/theme-preview.js
r21592 r26232 1 1 /* global tb_click */ 2 2 var thickDims, tbWidth, tbHeight; 3 3 jQuery(document).ready(function($) { … … 13 13 $('#TB_iframeContent').width(w).height(h - 27); 14 14 tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'}); 15 if ( typeof document.body.style.maxWidth != 'undefined' )15 if ( typeof document.body.style.maxWidth !== 'undefined' ) { 16 16 tbWindow.css({'top':'30px','margin-top':'0'}); 17 } 17 18 } 18 19 }; 19 20 20 21 thickDims(); 21 $(window).resize( function() { thickDims() } );22 $(window).resize( function() { thickDims(); } ); 22 23 23 24 $('a.thickbox-preview').click( function() { … … 26 27 var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text; 27 28 28 if ( tbWidth = href.match(/&tbWidth=[0-9]+/) ) 29 if ( tbWidth = href.match(/&tbWidth=[0-9]+/) ) { 29 30 tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10); 30 else31 } else { 31 32 tbWidth = $(window).width() - 90; 33 } 32 34 33 if ( tbHeight = href.match(/&tbHeight=[0-9]+/) ) 35 if ( tbHeight = href.match(/&tbHeight=[0-9]+/) ) { 34 36 tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10); 35 else37 } else { 36 38 tbHeight = $(window).height() - 60; 39 } 37 40 38 41 if ( alink.length ) {
Note: See TracChangeset
for help on using the changeset viewer.