import Vue from "vue";
import App from "./App.vue";
import router from "./router";
-import { ajax } from "./utils/ajax";
+import { store } from "./store";
Vue.config.productionTip = false;
render: function(h) {
return h(App);
},
- created: function() {
- //alert("test");
- ajax("http://localhost:3000/variants", "GET", variantArray => {
- console.log("Got variants:");
- console.log(variantArray);
- });
- },
+ created: function() {
+ window.doClick = (elemId) => { document.getElementById(elemId).click() };
+ document.addEventListener("keydown", (e) => {
+ if (e.code === "Escape")
+ {
+ let modalBoxes = document.querySelectorAll("[id^='modal']");
+ modalBoxes.forEach(m => {
+ if (m.checked)
+ m.checked = false;
+ });
+ }
+ });
+ // NOTE: store.initialize(this.$route.path); doesn't work
+ store.initialize(window.location.href.split("#")[1].split("?")[0]);
+ },
}).$mount("#app");
-
-// TODO: get rules, dynamic import
-// Load a rules page (AJAX)
-// router.get("/rules/:vname([a-zA-Z0-9]+)", access.ajax, (req,res) => {
-// const lang = selectLanguage(req, res);
-// res.render("rules/" + req.params["vname"] + "/" + lang);
-// });