You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 line
716 B

  1. // load all critical libraries
  2. wn.require("lib/js/lib/jquery.min.js");
  3. wn.require("lib/js/lib/history/history.min.js");
  4. /* overload links for ajax pages */
  5. $(document).bind('ready', function() {
  6. var base = window.location.href.split('#')[0];
  7. // convert hard links to softlinks
  8. $.each($('a[softlink!="false"]'), function(i, v) {
  9. // if linking on the same site
  10. if(v.href.substr(0, base.length)==base) {
  11. var path = (v.href.substr(base.length));
  12. // if hardlink, softlink it
  13. if(path.substr(0,1)!='#') {
  14. v.href = base + '#' + path;
  15. }
  16. }
  17. });
  18. // go to hash page if exists
  19. if(!wn.settings.no_history && window.location.hash) {
  20. wn.page.set(window.location.hash.substr(1));
  21. }
  22. });