Skip to content

Commit 897149b

Browse files
replace whitespace with underscore for mode param
Firefox auto replaces %20 with whitespace, sharing the url with someone over a chat program could be problematic. The url detection could stop at the whitespace thus anoying anyone who clicks it.
1 parent c463601 commit 897149b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function lhash_update(history_step) {
2525
hash += "&mz=" + map.getZoom();
2626

2727
if(!/^[a-z0-9]{32}$/ig.exec(wvar.query)) {
28-
hash += "&qm=" + wvar.mode;
28+
hash += "&qm=" + wvar.mode.replace(/ /g, '_');
2929
}
3030

3131
if(follow_vehicle === null || manual_pan) {
@@ -123,7 +123,7 @@ function load_hash(no_refresh) {
123123
def.focus = v;
124124
break;
125125
case "qm":
126-
def.mode = v;
126+
def.mode = v.replace(/_/g, ' ');
127127
break;
128128
case "q":
129129
def.query = v;

0 commit comments

Comments
 (0)