Changeset 684:1c085f019602

Show
Ignore:
Timestamp:
10/06/09 15:22:08 (4 years ago)
Author:
tgambet
Branch:
default
convert_revision:
svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@685
Message:

new setHash method which uses window.location.replace so that the root page is not recorded in the browser history. Works fine with ff3.5, should be tested further with other browsers

Location:
WebContent/scripts
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • WebContent/scripts/w3c_unicorn_index.js

    r616 r684  
    1 /* $Id: w3c_unicorn_index.js,v 1.13 2009-10-01 17:19:18 tgambet Exp $Id */ 
     1/* $Id: w3c_unicorn_index.js,v 1.14 2009-10-06 15:22:08 tgambet Exp $Id */ 
    22var W3C = { 
    33         
     
    341341                        W3C.FakeForm.setProperty('action', '#' + hash).submit(); 
    342342                } else { 
    343                         window.location.hash = '#' + hash; 
     343                        window.location.replace('#' + hash); 
     344                        //window.location.hash = '#' + hash; 
    344345                } 
    345346        } 
  • WebContent/scripts/w3c_unicorn_results.js

    r629 r684  
    1 /* $Id: w3c_unicorn_results.js,v 1.16 2009-10-02 12:23:59 tgambet Exp $Id */ 
     1/* $Id: w3c_unicorn_results.js,v 1.17 2009-10-06 15:22:08 tgambet Exp $Id */ 
    22var W3C = { 
    33         
    44        start: function() { 
    55                 
     6                document.addEvent('onHistoryChange') 
     7         
    68                W3C.Observers = $$('.observer'); 
    79                 
     
    3133                                W3C.toggle(section); 
    3234                        }); 
    33                          
    3435                }); 
    3536                 
     
    237238                        W3C.FakeForm.setProperty('action', '#' + hash).submit(); 
    238239                } else { 
    239                         window.location.hash = '#' + hash; 
     240                        window.location.replace('#' + hash); 
    240241                } 
    241242        } 
     
    244245window.addEvent('domready', W3C.start); 
    245246 
     247window.addEvent('onbeforeunload', function () { 
     248        console.log(history.toString()); 
     249        history.go(-2); 
     250}); 
     251