[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.4-212-g946753b

Ruslan Zakirov ruz at bestpractical.com
Wed Jan 18 15:04:02 EST 2012


The branch, 4.0-trunk has been updated
       via  946753bfd54add7f2cab2ccdba8602d6433c78ed (commit)
       via  9a57c7900067930955d3731acabc982a45d355af (commit)
      from  be8d96a231adc2b6f468e9b2afc3f446dcc1c096 (commit)

Summary of changes:
 share/html/Elements/Login |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 9a57c7900067930955d3731acabc982a45d355af
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Nov 29 14:39:44 2011 -0500

    Preserve page anchors across login tangents
    
    Browsers carry over the anchor upon receiving a redirect response.  Take
    advantage of this by appending any anchor the login page has to the
    form's action.  When the login form is submitted successfully, a
    redirect is issued and the browser carries over the anchor as intended
    for the original page.
    
    Confusion might arise if the login page ever shares an anchor name with
    deeper pages.
    
    Unfortunately there's no way to get at the anchor from the server side
    at the time of tangent, otherwise we could simply stuff it into the
    NextPage entry and be done with it.

diff --git a/share/html/Elements/Login b/share/html/Elements/Login
index bc11bd4..9a4050a 100755
--- a/share/html/Elements/Login
+++ b/share/html/Elements/Login
@@ -76,6 +76,15 @@
 
 <input type="hidden" name="next" value="<% $next %>" />
 
+<script type="text/javascript">
+jQuery(function(){
+    if (window.location.hash) {
+        var form = jQuery("form[name=login]");
+        form.attr('action', form.attr('action') + '#' + window.location.hash.replace(/^#/, ''));
+    }
+});
+</script>
+
 <div class="button-row">
     <span class="input"><input type="submit" class="button" value="<&|/l&>Login</&>" /></span>
 </div>

commit 946753bfd54add7f2cab2ccdba8602d6433c78ed
Merge: be8d96a 9a57c79
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Jan 19 00:03:27 2012 +0400

    Merge remote-tracking branch 'origin/4.0/preserve-anchor-across-login' into 4.0-trunk


-----------------------------------------------------------------------


More information about the Rt-commit mailing list