Rev2055, Don't add ? to url if start with # using replaceState and pushState

This commit is contained in:
shortcutme 2017-05-06 17:27:49 +02:00
parent e42631932b
commit 34a6337c01
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
3 changed files with 7 additions and 3 deletions

View file

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv): def __init__(self, argv):
self.version = "0.5.4" self.version = "0.5.4"
self.rev = 2054 self.rev = 2055
self.argv = argv self.argv = argv
self.action = None self.action = None
self.config_file = "zeronet.conf" self.config_file = "zeronet.conf"

View file

@ -149,7 +149,9 @@ class Wrapper
back = window.location.pathname back = window.location.pathname
if back.match /^\/[^\/]+$/ # Add / after site address if called without it if back.match /^\/[^\/]+$/ # Add / after site address if called without it
back += "/" back += "/"
if query.replace("?", "") if query.startsWith("#")
back = query
else if query.replace("?", "")
back += "?"+query.replace("?", "") back += "?"+query.replace("?", "")
return back return back

View file

@ -1005,7 +1005,9 @@ jQuery.extend( jQuery.easing,
if (back.match(/^\/[^\/]+$/)) { if (back.match(/^\/[^\/]+$/)) {
back += "/"; back += "/";
} }
if (query.replace("?", "")) { if (query.startsWith("#")) {
back = query;
} else if (query.replace("?", "")) {
back += "?" + query.replace("?", ""); back += "?" + query.replace("?", "");
} }
return back; return back;