<!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" />
<title>[24695] trunk: Logged out warnings:</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/24695">24695</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2013-07-12 23:32:32 +0000 (Fri, 12 Jul 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Logged out warnings:
- Replace the Close button with an always visible "X" icon in the top/right corner.
- Check if the user is still logged in every 3 min. by default.
- Add 'wp_auth_check_interval' filter so the interval can be set from PHP.
See <a href="http://core.trac.wordpress.org/ticket/23295">#23295</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsswpadmincss">trunk/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunkwpincludescsswpauthcheckcss">trunk/wp-includes/css/wp-auth-check.css</a></li>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
<li><a href="#trunkwpincludesjswpauthcheckjs">trunk/wp-includes/js/wp-auth-check.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.css (24694 => 24695)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css  2013-07-12 22:58:49 UTC (rev 24694)
+++ trunk/wp-admin/css/wp-admin.css     2013-07-12 23:32:32 UTC (rev 24695)
</span><span class="lines">@@ -7187,7 +7187,7 @@
</span><span class="cx"> 
</span><span class="cx"> .interim-login #login {
</span><span class="cx">  padding: 0;
</span><del>-       margin: 25px auto 20px;
</del><ins>+        margin: 5px auto 20px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .interim-login.login h1 a {
</span></span></pre></div>
<a id="trunkwpincludescsswpauthcheckcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/css/wp-auth-check.css (24694 => 24695)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/css/wp-auth-check.css  2013-07-12 22:58:49 UTC (rev 24694)
+++ trunk/wp-includes/css/wp-auth-check.css     2013-07-12 23:32:32 UTC (rev 24695)
</span><span class="lines">@@ -24,10 +24,10 @@
</span><span class="cx">  overflow: hidden;
</span><span class="cx">  top: 40px;
</span><span class="cx">  bottom: 20px;
</span><del>-       max-height: 435px;
</del><ins>+        max-height: 415px;
</ins><span class="cx">   width: 380px;
</span><span class="cx">  margin: 0 0 0 -190px;
</span><del>-       padding: 0;
</del><ins>+        padding: 30px 0 0;
</ins><span class="cx">   background-color: #fbfbfb;
</span><span class="cx">  -webkit-border-radius: 3px;
</span><span class="cx">  border-radius: 3px;
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #wp-auth-check-wrap #wp-auth-check-form {
</span><del>-       background: url('../images/wpspin-2x.gif') no-repeat center center;
</del><ins>+        background: url(../images/wpspin-2x.gif) no-repeat center center;
</ins><span class="cx">   background-size: 16px 16px;
</span><span class="cx">  height: 100%;
</span><span class="cx"> }
</span><span class="lines">@@ -52,12 +52,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #wp-auth-check-wrap .wp-auth-check-close {
</span><del>-       bottom: 10px;
-       display: none;
</del><span class="cx">   position: absolute;
</span><del>-       right: 30px;
</del><ins>+        top: 8px;
+       right: 8px;
+       height: 14px;
+       width: 14px;
+       cursor: pointer;
+       background-image: url(../images/uploader-icons.png);
+       background-repeat: no-repeat;
+       background-position: -100px 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#wp-auth-check-wrap .wp-auth-check-close:focus {
+       outline: 1px dotted #888;
+}
+
</ins><span class="cx"> #wp-auth-check-wrap .wp-auth-fallback-expired {
</span><span class="cx">  outline: 0;
</span><span class="cx"> }
</span><span class="lines">@@ -65,7 +74,7 @@
</span><span class="cx"> #wp-auth-check-wrap .wp-auth-fallback {
</span><span class="cx">  font-size: 14px;
</span><span class="cx">  line-height: 21px;
</span><del>-       padding: 10px 25px;
</del><ins>+        padding: 0 25px;
</ins><span class="cx">   display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -74,3 +83,12 @@
</span><span class="cx">  display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+@media print,
+  (-o-min-device-pixel-ratio: 5/4),
+  (-webkit-min-device-pixel-ratio: 1.25),
+  (min-resolution: 120dpi) {
+       #wp-auth-check-wrap .wp-auth-check-close {
+               background-image: url(../images/uploader-icons-2x.png);
+               background-size: 134px 15px;
+       }
+}
</ins></span></pre></div>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (24694 => 24695)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php  2013-07-12 22:58:49 UTC (rev 24694)
+++ trunk/wp-includes/functions.php     2013-07-12 23:32:32 UTC (rev 24695)
</span><span class="lines">@@ -3943,6 +3943,7 @@
</span><span class="cx">  <div id="wp-auth-check-wrap" class="<?php echo $wrap_class; ?>">
</span><span class="cx">  <div id="wp-auth-check-bg"></div>
</span><span class="cx">  <div id="wp-auth-check">
</span><ins>+       <div class="wp-auth-check-close" tabindex="0" title="<?php esc_attr_e('Close'); ?>"></div>
</ins><span class="cx">   <?php
</span><span class="cx"> 
</span><span class="cx">  if ( $same_domain ) {
</span><span class="lines">@@ -3957,7 +3958,6 @@
</span><span class="cx">          <p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e('Please log in again.'); ?></a>
</span><span class="cx">          <?php _e('The login page will open in a new window. After logging in you can close it and return to this page.'); ?></p>
</span><span class="cx">  </div>
</span><del>-       <p class="wp-auth-check-close"><a href="#" class="button button-primary"><?php _e('Close'); ?></a></p>
</del><span class="cx">   </div>
</span><span class="cx">  </div>
</span><span class="cx">  <?php
</span><span class="lines">@@ -3974,9 +3974,9 @@
</span><span class="cx"> 
</span><span class="cx">  // If the user is logged in and we are outside the login grace period, bail.
</span><span class="cx">  if ( is_user_logged_in() && empty( $GLOBALS['login_grace_period'] ) )
</span><del>-               return $response;
</del><ins>+                return array_merge( $response, array( 'wp-auth-check' => '1' ) );
</ins><span class="cx"> 
</span><del>-       return array_merge( $response, array( 'wp-auth-check' => '1' ) );
</del><ins>+        return array_merge( $response, array( 'wp-auth-check' => 'show' ) );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -4018,4 +4018,4 @@
</span><span class="cx">          return 'ISO-8859-1';
</span><span class="cx"> 
</span><span class="cx">  return $charset;
</span><del>-}
</del><span class="cx">\ No newline at end of file
</span><ins>+}
</ins></span></pre></div>
<a id="trunkwpincludesjswpauthcheckjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/wp-auth-check.js (24694 => 24695)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/wp-auth-check.js    2013-07-12 22:58:49 UTC (rev 24694)
+++ trunk/wp-includes/js/wp-auth-check.js       2013-07-12 23:32:32 UTC (rev 24695)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> // Interim login dialog
</span><span class="cx"> (function($){
</span><del>-       var wrap, check, scheduleTimeout;
</del><ins>+        var wrap, check, next;
</ins><span class="cx"> 
</span><span class="cx">  function show() {
</span><span class="cx">          var parent = $('#wp-auth-check'), form = $('#wp-auth-check-form'), noframe = wrap.find('.wp-auth-fallback-expired'), frame, loaded = false;
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">                                  if ( body && body.hasClass('interim-login-success') )
</span><span class="cx">                                          hide();
</span><span class="cx">                                  else
</span><del>-                                               parent.css( 'max-height', height + 60 + 'px' );
</del><ins>+                                                parent.css( 'max-height', height + 40 + 'px' );
</ins><span class="cx">                           } else if ( ! body || ! body.length ) {
</span><span class="cx">                                  // Catch "silent" iframe origin exceptions in WebKit after another page is loaded in the iframe
</span><span class="cx">                                  wrap.addClass('fallback');
</span><span class="lines">@@ -74,49 +74,34 @@
</span><span class="cx">          }
</span><span class="cx"> 
</span><span class="cx">          wrap.fadeOut( 200, function() {
</span><del>-                       wrap.addClass('hidden').css('display', '').find('.wp-auth-check-close').css('display', '');
</del><ins>+                        wrap.addClass('hidden').css('display', '');
</ins><span class="cx">                   $('#wp-auth-check-frame').remove();
</span><span class="cx">          });
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function schedule() {
</span><del>-               check = false;
-               window.clearTimeout( scheduleTimeout );
-               scheduleTimeout = window.setTimeout( function(){ check = 1; }, 300000 ); // 5 min.
</del><ins>+                var interval = parseInt( window.authcheckL10n.interval, 10 ) || 180; // in seconds, default 3 min.
+               next = ( new Date() ).getTime() + ( interval * 1000 );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx">  $( document ).on( 'heartbeat-tick.wp-auth-check', function( e, data ) {
</span><del>-               if ( check === 2 )
</del><ins>+                if ( data['wp-auth-check'] ) {
</ins><span class="cx">                   schedule();
</span><span class="cx"> 
</span><del>-               if ( data['wp-auth-check'] && wrap.hasClass('hidden') ) {
-                       show();
-               } else if ( ! data['wp-auth-check'] && ! wrap.hasClass('hidden') ) {
-                       hide();
</del><ins>+                        if ( data['wp-auth-check'] == 'show' && wrap.hasClass('hidden') )
+                               show();
+                       else if ( data['wp-auth-check'] != 'show' && ! wrap.hasClass('hidden') )
+                               hide();
</ins><span class="cx">           }
</span><ins>+       }).on( 'heartbeat-send.wp-auth-check', function( e, data ) {
+               if ( ( new Date() ).getTime() > next )
+                       data['wp-auth-check'] = 1;
</ins><span class="cx">   }).ready( function() {
</span><span class="cx">          schedule();
</span><span class="cx">          wrap = $('#wp-auth-check-wrap');
</span><span class="cx">          wrap.find('.wp-auth-check-close').on( 'click', function(e) {
</span><span class="cx">                  hide();
</span><span class="cx">          });
</span><del>-               // Bind later
-               $( document ).on( 'heartbeat-send.wp-auth-check', function( e, data ) {
-                       var i, empty = true;
-                       // Check if something is using heartbeat. If yes, trigger the logged out check too.
-                       for ( i in data ) {
-                               if ( data.hasOwnProperty( i ) ) {
-                                       empty = false;
-                                       break;
-                               }
-                       }
-
-                       if ( check || ! empty )
-                               data['wp-auth-check'] = 1;
-
-                       if ( check )
-                               check = 2;
-               });
</del><span class="cx">   });
</span><span class="cx"> 
</span><span class="cx"> }(jQuery));
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (24694 => 24695)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php      2013-07-12 22:58:49 UTC (rev 24694)
+++ trunk/wp-includes/script-loader.php 2013-07-12 23:32:32 UTC (rev 24695)
</span><span class="lines">@@ -113,6 +113,7 @@
</span><span class="cx">  $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array('heartbeat'), false, 1 );
</span><span class="cx">  did_action( 'init' ) && $scripts->localize( 'wp-auth-check', 'authcheckL10n', array(
</span><span class="cx">          'beforeunload' => __('Your session has expired. You can log in again from this page or go to the login page.'),
</span><ins>+               'interval' => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ),
</ins><span class="cx">   ) );
</span><span class="cx"> 
</span><span class="cx">  $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array( 'wp-ajax-response', 'jquery-color' ), false, 1 );
</span></span></pre>
</div>
</div>

</body>
</html>