Changeset 24695
- Timestamp:
- 07/12/2013 11:32:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
wp-admin/css/wp-admin.css (modified) (1 diff)
-
wp-includes/css/wp-auth-check.css (modified) (5 diffs)
-
wp-includes/functions.php (modified) (3 diffs)
-
wp-includes/js/wp-auth-check.js (modified) (5 diffs)
-
wp-includes/script-loader.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.css
r24688 r24695 7188 7188 .interim-login #login { 7189 7189 padding: 0; 7190 margin: 25px auto 20px;7190 margin: 5px auto 20px; 7191 7191 } 7192 7192 -
trunk/wp-includes/css/wp-auth-check.css
r23805 r24695 25 25 top: 40px; 26 26 bottom: 20px; 27 max-height: 4 35px;27 max-height: 415px; 28 28 width: 380px; 29 29 margin: 0 0 0 -190px; 30 padding: 0;30 padding: 30px 0 0; 31 31 background-color: #fbfbfb; 32 32 -webkit-border-radius: 3px; … … 41 41 42 42 #wp-auth-check-wrap #wp-auth-check-form { 43 background: url( '../images/wpspin-2x.gif') no-repeat center center;43 background: url(../images/wpspin-2x.gif) no-repeat center center; 44 44 background-size: 16px 16px; 45 45 height: 100%; … … 53 53 54 54 #wp-auth-check-wrap .wp-auth-check-close { 55 bottom: 10px;56 display: none;57 55 position: absolute; 58 right: 30px; 56 top: 8px; 57 right: 8px; 58 height: 14px; 59 width: 14px; 60 cursor: pointer; 61 background-image: url(../images/uploader-icons.png); 62 background-repeat: no-repeat; 63 background-position: -100px 0; 64 } 65 66 #wp-auth-check-wrap .wp-auth-check-close:focus { 67 outline: 1px dotted #888; 59 68 } 60 69 … … 66 75 font-size: 14px; 67 76 line-height: 21px; 68 padding: 10px25px;77 padding: 0 25px; 69 78 display: none; 70 79 } … … 75 84 } 76 85 86 @media print, 87 (-o-min-device-pixel-ratio: 5/4), 88 (-webkit-min-device-pixel-ratio: 1.25), 89 (min-resolution: 120dpi) { 90 #wp-auth-check-wrap .wp-auth-check-close { 91 background-image: url(../images/uploader-icons-2x.png); 92 background-size: 134px 15px; 93 } 94 } -
trunk/wp-includes/functions.php
r24594 r24695 3944 3944 <div id="wp-auth-check-bg"></div> 3945 3945 <div id="wp-auth-check"> 3946 <div class="wp-auth-check-close" tabindex="0" title="<?php esc_attr_e('Close'); ?>"></div> 3946 3947 <?php 3947 3948 … … 3958 3959 <?php _e('The login page will open in a new window. After logging in you can close it and return to this page.'); ?></p> 3959 3960 </div> 3960 <p class="wp-auth-check-close"><a href="#" class="button button-primary"><?php _e('Close'); ?></a></p>3961 3961 </div> 3962 3962 </div> … … 3975 3975 // If the user is logged in and we are outside the login grace period, bail. 3976 3976 if ( is_user_logged_in() && empty( $GLOBALS['login_grace_period'] ) ) 3977 return $response;3978 3979 return array_merge( $response, array( 'wp-auth-check' => ' 1' ) );3977 return array_merge( $response, array( 'wp-auth-check' => '1' ) ); 3978 3979 return array_merge( $response, array( 'wp-auth-check' => 'show' ) ); 3980 3980 } 3981 3981 -
trunk/wp-includes/js/wp-auth-check.js
r24655 r24695 1 1 // Interim login dialog 2 2 (function($){ 3 var wrap, check, scheduleTimeout;3 var wrap, check, next; 4 4 5 5 function show() { … … 33 33 hide(); 34 34 else 35 parent.css( 'max-height', height + 60 + 'px' );35 parent.css( 'max-height', height + 40 + 'px' ); 36 36 } else if ( ! body || ! body.length ) { 37 37 // Catch "silent" iframe origin exceptions in WebKit after another page is loaded in the iframe … … 75 75 76 76 wrap.fadeOut( 200, function() { 77 wrap.addClass('hidden').css('display', '') .find('.wp-auth-check-close').css('display', '');77 wrap.addClass('hidden').css('display', ''); 78 78 $('#wp-auth-check-frame').remove(); 79 79 }); … … 81 81 82 82 function schedule() { 83 check = false; 84 window.clearTimeout( scheduleTimeout ); 85 scheduleTimeout = window.setTimeout( function(){ check = 1; }, 300000 ); // 5 min. 83 var interval = parseInt( window.authcheckL10n.interval, 10 ) || 180; // in seconds, default 3 min. 84 next = ( new Date() ).getTime() + ( interval * 1000 ); 86 85 } 87 86 88 87 $( document ).on( 'heartbeat-tick.wp-auth-check', function( e, data ) { 89 if ( check === 2 )88 if ( data['wp-auth-check'] ) { 90 89 schedule(); 91 90 92 if ( data['wp-auth-check'] && wrap.hasClass('hidden') ) {93 show();94 } else if ( ! data['wp-auth-check'] && ! wrap.hasClass('hidden') ) {95 hide();91 if ( data['wp-auth-check'] == 'show' && wrap.hasClass('hidden') ) 92 show(); 93 else if ( data['wp-auth-check'] != 'show' && ! wrap.hasClass('hidden') ) 94 hide(); 96 95 } 96 }).on( 'heartbeat-send.wp-auth-check', function( e, data ) { 97 if ( ( new Date() ).getTime() > next ) 98 data['wp-auth-check'] = 1; 97 99 }).ready( function() { 98 100 schedule(); … … 101 103 hide(); 102 104 }); 103 // Bind later104 $( document ).on( 'heartbeat-send.wp-auth-check', function( e, data ) {105 var i, empty = true;106 // Check if something is using heartbeat. If yes, trigger the logged out check too.107 for ( i in data ) {108 if ( data.hasOwnProperty( i ) ) {109 empty = false;110 break;111 }112 }113 114 if ( check || ! empty )115 data['wp-auth-check'] = 1;116 117 if ( check )118 check = 2;119 });120 105 }); 121 106 -
trunk/wp-includes/script-loader.php
r24686 r24695 114 114 did_action( 'init' ) && $scripts->localize( 'wp-auth-check', 'authcheckL10n', array( 115 115 'beforeunload' => __('Your session has expired. You can log in again from this page or go to the login page.'), 116 'interval' => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ), 116 117 ) ); 117 118
Note: See TracChangeset
for help on using the changeset viewer.