Changeset 24655
- Timestamp:
- 07/11/2013 12:44:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/wp-auth-check.js
r24528 r24655 1 1 // Interim login dialog 2 2 (function($){ 3 var wrap, check, scheduleTimeout , hideTimeout;3 var wrap, check, scheduleTimeout; 4 4 5 5 function show() { … … 23 23 } catch(e) { 24 24 wrap.addClass('fallback'); 25 parent.css( 'max-height', '' ); 25 26 form.remove(); 26 27 noframe.focus(); … … 29 30 30 31 if ( height ) { 31 if ( body && body.hasClass('interim-login-success') ) { 32 height += 35; 33 parent.find('.wp-auth-check-close').show(); 34 wrap.data('logged-in', 1); 35 hideTimeout = setTimeout( function() { hide(); }, 3000 ); 36 } 37 38 parent.css( 'max-height', height + 60 + 'px' ); 32 if ( body && body.hasClass('interim-login-success') ) 33 hide(); 34 else 35 parent.css( 'max-height', height + 60 + 'px' ); 36 } else if ( ! body || ! body.length ) { 37 // Catch "silent" iframe origin exceptions in WebKit after another page is loaded in the iframe 38 wrap.addClass('fallback'); 39 parent.css( 'max-height', '' ); 40 form.remove(); 41 noframe.focus(); 39 42 } 40 43 }).attr( 'src', form.data('src') ); … … 48 51 frame.focus(); 49 52 // WebKit doesn't throw an error if the iframe fails to load because of "X-Frame-Options: DENY" header. 50 // Wait for 5sec. and switch to the fallback text.53 // Wait for 10 sec. and switch to the fallback text. 51 54 setTimeout( function() { 52 55 if ( ! loaded ) { … … 55 58 noframe.focus(); 56 59 } 57 }, 5000 );60 }, 10000 ); 58 61 } else { 59 62 noframe.focus(); … … 63 66 function hide() { 64 67 $(window).off( 'beforeunload.wp-auth-check' ); 65 window.clearTimeout( hideTimeout );66 68 67 69 // When on the Edit Post screen, speed up heartbeat after the user logs in to quickly refresh nonces … … 90 92 if ( data['wp-auth-check'] && wrap.hasClass('hidden') ) { 91 93 show(); 92 } else if ( ! data['wp-auth-check'] && ! wrap.hasClass('hidden') && ! wrap.data('logged-in')) {94 } else if ( ! data['wp-auth-check'] && ! wrap.hasClass('hidden') ) { 93 95 hide(); 94 96 } 95 97 }).ready( function() { 96 98 schedule(); 97 wrap = $('#wp-auth-check-wrap') .data( 'logged-in', 0 );99 wrap = $('#wp-auth-check-wrap'); 98 100 wrap.find('.wp-auth-check-close').on( 'click', function(e) { 99 101 hide();
Note: See TracChangeset
for help on using the changeset viewer.