diff --git a/common/app/common/uri.cljc b/common/app/common/uri.cljc new file mode 100644 index 000000000..45bb2cb61 --- /dev/null +++ b/common/app/common/uri.cljc @@ -0,0 +1,34 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) UXBOX Labs SL + +(ns app.common.uri + (:require + [app.common.data :as d] + [lambdaisland.uri :as u] + [lambdaisland.uri.normalize :as un])) + +(d/export u/uri) +(d/export u/join) +(d/export un/percent-encode) + +(defn query-string->map + [s] + (u/query-string->map s)) + +(defn default-encode-value + [v] + (if (keyword? v) (name v) v)) + +(defn map->query-string + ([params] (map->query-string params nil)) + ([params {:keys [value-fn key-fn] + :or {value-fn default-encode-value + key-fn identity}}] + (->> params + (into {} (comp + (remove #(nil? (second %))) + (map (fn [[k v]] [(key-fn k) (value-fn v)])))) + (u/map->query-string)))) diff --git a/frontend/gulpfile.js b/frontend/gulpfile.js index 57dc9b164..2ac9d26ff 100644 --- a/frontend/gulpfile.js +++ b/frontend/gulpfile.js @@ -68,23 +68,23 @@ function readManifest() { const content = JSON.parse(fs.readFileSync(path, {encoding: "utf8"})); const index = { - "config": "/js/config.js?ts=" + Date.now(), + "config": "js/config.js?ts=" + Date.now(), "polyfills": "js/polyfills.js?ts=" + Date.now(), }; for (let item of content) { - index[item.name] = "/js/" + item["output-name"]; + index[item.name] = "js/" + item["output-name"]; }; return index; } catch (e) { console.error("Error on reading manifest, using default."); return { - "config": "/js/config.js", + "config": "js/config.js", "polyfills": "js/polyfills.js", - "main": "/js/main.js", - "shared": "/js/shared.js", - "worker": "/js/worker.js" + "main": "js/main.js", + "shared": "js/shared.js", + "worker": "js/worker.js" }; } } diff --git a/frontend/resources/templates/index.mustache b/frontend/resources/templates/index.mustache index dc6e7c179..0b0dfd279 100644 --- a/frontend/resources/templates/index.mustache +++ b/frontend/resources/templates/index.mustache @@ -15,10 +15,9 @@ - + - +