dev #199

Closed
sora wants to merge 21 commits from dev into master
3 changed files with 53 additions and 124 deletions
Showing only changes of commit b5918a47cb - Show all commits

View File

@@ -1,4 +1,4 @@
import journey_wrapper from './types/wrapper';
import journey_wrapper from '../types/wrapper';
/* LIST HELPERS */
export const filter_selected = function (journey: journey_wrapper, list: geoloc[], step: boolean) {
@@ -38,4 +38,15 @@ export const journey_del_place = function (journey: journey_wrapper, tpe: String
case "flight": return journey.leg_get().travel.splice(idx, 1);
default: return true;
}
}
export const journey_from_url = function () {
const path = window.location.pathname.slice(1).split('/')
const hash = window.location.hash.slice(1).split('_')
return {
edit: ["view", "short"].indexOf(path.at(0) || "") == -1,
id: path.at(-1) || String.gen_id(16).toString(),
leg: parseInt(hash.at(0) || '0'),
day: parseInt(hash.at(1) || '0')
}
}