X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.js;h=6714939b6c544cc982a8dbbbb35740f21fbe97cd;hb=5f13148449c73de92993b7961c077167563b84e5;hp=0b9b40230e848671d2150110417998770b50a65d;hpb=625022fdcf750f0aff8fcd699f7e9b89730e1d10;p=vchess.git diff --git a/client/src/main.js b/client/src/main.js index 0b9b4023..6714939b 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -1,7 +1,7 @@ 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; @@ -10,18 +10,9 @@ new Vue({ 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() }; + store.initialize(this.$route.path); + // NOTE: at this point, variants and tr(anslations) might be uninitialized + }, }).$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); -// });