Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

59 righe
1.9 KiB

  1. // Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
  2. //
  3. // MIT License (MIT)
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a
  6. // copy of this software and associated documentation files (the "Software"),
  7. // to deal in the Software without restriction, including without limitation
  8. // the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. // and/or sell copies of the Software, and to permit persons to whom the
  10. // Software is furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  19. // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  20. // OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. //
  22. // find files changed since last version
  23. if(!console) {
  24. var console = {
  25. log: function(txt) {
  26. alert(txt);
  27. }
  28. }
  29. }
  30. wn.versions.check();
  31. /* overload links for ajax pages */
  32. $(document).bind('ready', function() {
  33. var base = window.location.href.split('#')[0];
  34. // convert hard links to softlinks
  35. $.each($('a[softlink!="false"]'), function(i, v) {
  36. // if linking on the same site
  37. if(v.href.substr(0, base.length)==base) {
  38. var path = (v.href.substr(base.length));
  39. // if hardlink, softlink it
  40. if(path.substr(0,1)!='#') {
  41. v.href = base + '#' + path;
  42. }
  43. }
  44. });
  45. // go to hash page if exists
  46. if(!wn.settings.no_history && window.location.hash) {
  47. wn.page.set(window.location.hash.substr(1));
  48. }
  49. });