diff --git a/proj/map/asset/img/anglofrancaise.jpg b/proj/map/asset/img/anglofrancaise.jpg new file mode 100644 index 0000000..bddd64c Binary files /dev/null and b/proj/map/asset/img/anglofrancaise.jpg differ diff --git a/proj/map/asset/img/federal.jpg b/proj/map/asset/img/federal.jpg new file mode 100644 index 0000000..5392e88 Binary files /dev/null and b/proj/map/asset/img/federal.jpg differ diff --git a/proj/map/asset/js/edit.js b/proj/map/asset/js/edit.js index fa187d6..91ee744 100644 --- a/proj/map/asset/js/edit.js +++ b/proj/map/asset/js/edit.js @@ -30,6 +30,7 @@ let vm = new Vue({ editTabMarkerL: "0px", editTabMarkerW: "0px", editTabRollXOff: 0, + tabrollw: "300vw", newIng: { name: "", fr: "", @@ -38,15 +39,28 @@ let vm = new Vue({ } }, methods: { - obj2php: function(obj) { + obj2php: function(obj, dest) { data = JSON.stringify(obj) r = new XMLHttpRequest - r.open("POST", "asset/php/handler.php", true) + //r.open("POST", "asset/php/handler.php", true) + r.open("POST", "handler/" + dest, true) r.setRequestHeader( "Content-type", "application/json") r.send(data) }, + uploadIMG: function(){ + let handler = "asset/php/uploader.php" + fetch(handler, { + method: "POST", + body: new FormData(document.getElementById("edit-upload-form")) + }) + // .then((response) => response.json()) + .then((responseData) => { + console.log(responseData) + console.log(responseData.message) + }) + }, saveIng: function() { if (this.newIng.name !== "") { ingredients[this.newIng.name] = { @@ -55,7 +69,7 @@ let vm = new Vue({ it: this.newIng.it, } } - this.obj2php(ingredients) + this.obj2php(ingredients, "ing") }, setEditTab: function(ind) { let xoff = 0 @@ -63,10 +77,13 @@ let vm = new Vue({ case 'ind': xoff = 0; break; - case 'dish': + case 'resto': xoff = 1; break; - case 'resto': + case 'upload': + xoff = 2; + break; + default: xoff = 0; break; } diff --git a/proj/map/asset/json/ing.json b/proj/map/asset/json/ing.json index ddbc4c6..eccf177 100644 --- a/proj/map/asset/json/ing.json +++ b/proj/map/asset/json/ing.json @@ -1,137 +1 @@ -{ - "tomate": { - "fr": "tomate", - "en": "tomato", - "it": "pomodoro" - }, - "mozzarella": { - "fr": "mozzarella", - "en": "mozzarella", - "it": "mozzarella" - }, - "mozzarellaBufala": { - "fr": "mozzarella de bufflonne", - "en": "buffalo's mozzarella", - "it": "mozzarella di bufala" - }, - "saucissecalabraisepiquante": { - "fr": "saucisse calabraise piquante", - "en": "spicy sausage", - "it": "sopressata calabrese piccante" - }, - "jambonblanc": { - "fr": "jambon blanc", - "en": "white ham", - "it": "prosciutto cotto" - }, - "champignons": { - "fr": "champignons", - "en": "mushrooms", - "it": "funghi" - }, - "provoletta": { - "fr": "provoletta", - "en": "provoletta", - "it": "provoletta" - }, - "salsiccia": { - "fr": "chaire à saucisse", - "en": "sausage", - "it": "salsiccia" - }, - "chimichurri": { - "fr": "chimichurri", - "en": "chimichurri", - "it": "chimichurri" - }, - "gorgonzola": { - "fr": "gorgonzola", - "en": "gorgonzola", - "it": "gorgonzola" - }, - "parma": { - "fr": "parma", - "en": "jambon de Parme", - "it": "Parma ham" - }, - "noix": { - "fr": "noix", - "en": "nuts", - "it": "noci" - }, - "caprino": { - "fr": "fromage de chèvre", - "en": "goat cheese", - "it": "caprino" - }, - "honey": { - "fr": "miel", - "en": "honey", - "it": "miele" - }, - "bresaola": { - "fr": "bresaola", - "en": "bresaola", - "it": "bresaola" - }, - "roquette": { - "fr": "roquette", - "en": "aragula salad", - "it": "rucola" - }, - "crudaioladipomodoro": { - "fr": "tomates fraîches concassées", - "en": "fresh tomatoes", - "it": "crudaiola di pomodoro" - }, - "burrata": { - "fr": "burrata", - "en": "burrata", - "it": "burrata" - }, - "basilic": { - "fr": "basilic", - "en": "basil", - "it": "basilico" - }, - "thon": { - "fr": "thon", - "en": "tuna", - "it": "tono" - }, - "cipollaTropea": { - "fr": "oignons rouges de Tropea", - "en": "red onions from Tropea", - "it": "cipolla rossa di Tropea" - }, - "aubergines": { - "fr": "aubergines", - "en": "eggplants", - "it": "melanzane" - }, - "anchois": { - "fr": "anchois", - "en": "anchovies", - "it": "acciughe" - }, - "capres": { - "fr": "câpres", - "en": "capers", - "it": "capperi" - }, - "huileextravierge": { - "fr": "huile extra vierge", - "en": "extra olive oil", - "it": "olio extra vergine" - }, - "gnochgor": { - "fr": "Gnochi au Gorgonzolla", - "en": "gdlkfgdfg", - "it": "ksflskdfjl" - }, - "name": { - "fr": "", - "en": "", - "it": "" - } -} +{"tomate":{"fr":"tomate","en":"tomato","it":"pomodoro"},"mozzarella":{"fr":"mozzarella","en":"mozzarella","it":"mozzarella"},"mozzarellaBufala":{"fr":"mozzarella de bufflonne","en":"buffalo's mozzarella","it":"mozzarella di bufala"},"saucissecalabraisepiquante":{"fr":"saucisse calabraise piquante","en":"spicy sausage","it":"sopressata calabrese piccante"},"jambonblanc":{"fr":"jambon blanc","en":"white ham","it":"prosciutto cotto"},"champignons":{"fr":"champignons","en":"mushrooms","it":"funghi"},"provoletta":{"fr":"provoletta","en":"provoletta","it":"provoletta"},"salsiccia":{"fr":"chaire à saucisse","en":"sausage","it":"salsiccia"},"chimichurri":{"fr":"chimichurri","en":"chimichurri","it":"chimichurri"},"gorgonzola":{"fr":"gorgonzola","en":"gorgonzola","it":"gorgonzola"},"parma":{"fr":"parma","en":"jambon de Parme","it":"Parma ham"},"noix":{"fr":"noix","en":"nuts","it":"noci"},"caprino":{"fr":"fromage de chèvre","en":"goat cheese","it":"caprino"},"honey":{"fr":"miel","en":"honey","it":"miele"},"bresaola":{"fr":"bresaola","en":"bresaola","it":"bresaola"},"roquette":{"fr":"roquette","en":"aragula salad","it":"rucola"},"crudaioladipomodoro":{"fr":"tomates fraîches concassées","en":"fresh tomatoes","it":"crudaiola di pomodoro"},"burrata":{"fr":"burrata","en":"burrata","it":"burrata"},"basilic":{"fr":"basilic","en":"basil","it":"basilico"},"thon":{"fr":"thon","en":"tuna","it":"tono"},"cipollaTropea":{"fr":"oignons rouges de Tropea","en":"red onions from Tropea","it":"cipolla rossa di Tropea"},"aubergines":{"fr":"aubergines","en":"eggplants","it":"melanzane"},"anchois":{"fr":"anchois","en":"anchovies","it":"acciughe"},"capres":{"fr":"câpres","en":"capers","it":"capperi"},"huileextravierge":{"fr":"huile extra vierge","en":"extra olive oil","it":"olio extra vergine"},"gnochgor":{"fr":"Gnochi au Gorgonzolla","en":"gdlkfgdfg","it":"ksflskdfjl"},"name":{"fr":"","en":"","it":""},"Chocolat":{"fr":"chocolat","en":"chocolate","it":"cioccolato"},"chocolat":{"fr":"chocolat","en":"chocolate","it":"cioccolato"},"asperges":{"fr":"asperges","en":"asparagus","it":"asparagi"}} \ No newline at end of file diff --git a/proj/map/asset/php/edit.php b/proj/map/asset/php/edit.php index 8c530ee..3130a43 100644 --- a/proj/map/asset/php/edit.php +++ b/proj/map/asset/php/edit.php @@ -32,9 +32,13 @@ class="edit-tab-nav-link" v-on:click="setEditTab('ing')">Ings Dish + v-on:click="setEditTab('resto')">Resto + upload
-

Dishes

+

Resto

+ + +
+ +
+ +

Uploads

+ +
+ + + + + + + +
diff --git a/proj/map/asset/php/handler.php b/proj/map/asset/php/handler.php index 9c0a6d5..498aa34 100644 --- a/proj/map/asset/php/handler.php +++ b/proj/map/asset/php/handler.php @@ -1,11 +1,20 @@ diff --git a/proj/map/asset/php/home.php b/proj/map/asset/php/home.php index 3f5ec81..5774be8 100644 --- a/proj/map/asset/php/home.php +++ b/proj/map/asset/php/home.php @@ -52,7 +52,6 @@ - diff --git a/proj/map/asset/php/test.json b/proj/map/asset/php/test.json deleted file mode 100644 index 49f586d..0000000 --- a/proj/map/asset/php/test.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "tomate": { - "fr": "tomate", - "en": "tomato", - "it": "pomodoro" - }, - "mozzarella": { - "fr": "mozzarella", - "en": "mozzarella", - "it": "mozzarella" - }, - "mozzarellaBufala": { - "fr": "mozzarella de bufflonne", - "en": "buffalo's mozzarella", - "it": "mozzarella di bufala" - }, - "saucissecalabraisepiquante": { - "fr": "saucisse calabraise piquante", - "en": "spicy sausage", - "it": "sopressata calabrese piccante" - }, - "jambonblanc": { - "fr": "jambon blanc", - "en": "white ham", - "it": "prosciutto cotto" - }, - "champignons": { - "fr": "champignons", - "en": "mushrooms", - "it": "funghi" - }, - "provoletta": { - "fr": "provoletta", - "en": "provoletta", - "it": "provoletta" - }, - "salsiccia": { - "fr": "chaire à saucisse", - "en": "sausage", - "it": "salsiccia" - }, - "chimichurri": { - "fr": "chimichurri", - "en": "chimichurri", - "it": "chimichurri" - }, - "gorgonzola": { - "fr": "gorgonzola", - "en": "gorgonzola", - "it": "gorgonzola" - }, - "parma": { - "fr": "parma", - "en": "jambon de Parme", - "it": "Parma ham" - }, - "noix": { - "fr": "noix", - "en": "nuts", - "it": "noci" - }, - "caprino": { - "fr": "fromage de chèvre", - "en": "goat cheese", - "it": "caprino" - }, - "honey": { - "fr": "miel", - "en": "honey", - "it": "miele" - }, - "bresaola": { - "fr": "bresaola", - "en": "bresaola", - "it": "bresaola" - }, - "roquette": { - "fr": "roquette", - "en": "aragula salad", - "it": "rucola" - }, - "crudaioladipomodoro": { - "fr": "tomates fraîches concassées", - "en": "fresh tomatoes", - "it": "crudaiola di pomodoro" - }, - "burrata": { - "fr": "burrata", - "en": "burrata", - "it": "burrata" - }, - "basilic": { - "fr": "basilic", - "en": "basil", - "it": "basilico" - }, - "thon": { - "fr": "thon", - "en": "tuna", - "it": "tono" - }, - "cipollaTropea": { - "fr": "oignons rouges de Tropea", - "en": "red onions from Tropea", - "it": "cipolla rossa di Tropea" - }, - "aubergines": { - "fr": "aubergines", - "en": "eggplants", - "it": "melanzane" - }, - "anchois": { - "fr": "anchois", - "en": "anchovies", - "it": "acciughe" - }, - "capres": { - "fr": "câpres", - "en": "capers", - "it": "capperi" - }, - "huileextravierge": { - "fr": "huile extra vierge", - "en": "extra olive oil", - "it": "olio extra vergine" - }, - "gnochgor": { - "fr": "Gnochi au Gorgonzolla", - "en": "gdlkfgdfg", - "it": "ksflskdfjl" - }, - "name": { - "fr": "", - "en": "", - "it": "" - }, - "chocolat": { - "fr": "chocolat", - "en": "chocolate", - "it": "chocolate" - } -} diff --git a/proj/map/asset/php/test1.json b/proj/map/asset/php/test1.json deleted file mode 100644 index b6fc4c6..0000000 --- a/proj/map/asset/php/test1.json +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/proj/map/index.php b/proj/map/index.php index d149f99..fa52f1d 100644 --- a/proj/map/index.php +++ b/proj/map/index.php @@ -11,6 +11,8 @@ if ($uri[1] == '' || include ("asset/php/home.php"); } elseif ($uri[1] == 'edit' || $uri[3] == 'edit') { include("asset/php/edit.php"); +} elseif ($uri[1] == 'handler') { + include("asset/php/handler.php"); } else { echo "404"; echo $_SERVER['REQUEST_URI'];