From 66d8eb39ebdcd3fdf2749c0614e7f33afd572837 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 8 Dec 2017 00:59:01 +0100 Subject: [PATCH 1/4] fix: view.main (added geolocation) | upd: vue.emergency|vue.event (added geolocation use) --- view/main.js | 4 +++- view/vue/container/emergency.vue | 2 +- view/vue/container/event.vue | 21 +++++++++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/view/main.js b/view/main.js index 4e094b6..29a67d6 100755 --- a/view/main.js +++ b/view/main.js @@ -60,4 +60,6 @@ delete window._router_; /* (4) Get geolocation ---------------------------------------------------------*/ -navigator.geolocation && navigator.geolocation.getCurrentPosition(function(a, b){ console.log(this, a, b); }, null); +navigator.geolocation && navigator.geolocation.getCurrentPosition(function(loc){ + gstore.data.loc = [ loc.coords.latitude, loc.coords.longitude ]; +}, null); diff --git a/view/vue/container/emergency.vue b/view/vue/container/emergency.vue index 4b291b3..73687ad 100644 --- a/view/vue/container/emergency.vue +++ b/view/vue/container/emergency.vue @@ -55,7 +55,7 @@ export default { /* (2) Prepare request */ var rq = { message: this.gstore.new_msg.emergency, - location: [1.1, 2.2], + location: this.gstore.loc, username: this.gstore.server.session.name }; diff --git a/view/vue/container/event.vue b/view/vue/container/event.vue index 9c7f8ac..91fad1f 100644 --- a/view/vue/container/event.vue +++ b/view/vue/container/event.vue @@ -49,14 +49,27 @@ export default { if( msg.trim().length == 0 ) return; - /* (2) Send message to WebSocket */ - wsc_event.send(JSON.stringify({message: msg, location: [1.1, 2.2]})); + /* (2) Prepare request */ + var rq = { + message: this.gstore.new_msg.event, + location: this.gstore.loc, + username: this.gstore.server.session.name + }; /* (3) Add loader */ gstore.data.msg_pending.event = true; - /* (4) Empty input */ - this.gstore.new_msg.event = ''; + /* (4) Send request */ + api.call("POST message/event/"+this.dep, rq, function(rs){ + + // {1} If error -> exit // + if( rs.error != 0 ) + return; + + // {2} Empty input // + gstore.data.new_msg.event = ''; + + }); }, bbcode: function(msg){ From 438607a1e6989e8068569ded69582066775d2047 Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Fri, 8 Dec 2017 01:22:03 +0100 Subject: [PATCH 2/4] upd: build.router.controller (add _SERVER.session.connected) upd: public_html.header = (add icon logout) upd: public_html.signup-form (add backlink to login) upd: view.vue.header = (change icon if connected or not) upd: view.vue.signup-form = (add backling to login) --- build/router/controller/js.php | 3 ++- public_html/css/header.css | 2 ++ public_html/css/signup-form.css | 7 +++++++ view/vue/header.vue | 15 +++++++++++++-- view/vue/signup-form.vue | 16 +++++++++++++++- 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/build/router/controller/js.php b/build/router/controller/js.php index 263b708..a4fc5b5 100644 --- a/build/router/controller/js.php +++ b/build/router/controller/js.php @@ -26,7 +26,8 @@ echo "window._SERVER = ".json_encode([ 'session' => [ - 'name' => $_SESSION['NAME'] + 'name' => $_SESSION['NAME'], + 'connected' => count($_SESSION['ADMIN']) + count($_SESSION['USER']) > 0 ] ])."\n"; diff --git a/public_html/css/header.css b/public_html/css/header.css index 11191b4..7120d70 100644 --- a/public_html/css/header.css +++ b/public_html/css/header.css @@ -116,6 +116,7 @@ #header-notif .hnotif.search{ background-image: url('/image/header/notif/search.svg@aaaaaa'); } #header-notif .hnotif.menu{ background-image: url('/image/header/notif/menu.svg@aaaaaa'); } #header-notif .hnotif.login{ background-image: url('/image/header/notif/login.svg@aaaaaa'); } +#header-notif .hnotif.logout{ background-image: url('/image/header/notif/logout.svg@aaaaaa'); } /* HOVER */ #header-notif .hnotif:hover{ @@ -129,6 +130,7 @@ #header-notif .hnotif.search:hover{ background-image: url('/image/header/notif/search.svg@ae51da'); } #header-notif .hnotif.menu:hover{ background-image: url('/image/header/notif/menu.svg@4a8ad8'); } #header-notif .hnotif.login:hover{ background-image: url('/image/header/notif/login.svg@660088'); } +#header-notif .hnotif.logout:hover{ background-image: url('/image/header/notif/logout.svg@660088'); } diff --git a/public_html/css/signup-form.css b/public_html/css/signup-form.css index f6e01ac..be66aab 100644 --- a/public_html/css/signup-form.css +++ b/public_html/css/signup-form.css @@ -106,4 +106,11 @@ border-style: solid; border-width: 1px; outline: none; +} + +#SIGNUP-FORM > .body > form > #membre{ + font-size: 0.8em; + color: #006eff; + text-decoration: underline; + margin-top: 8px; } \ No newline at end of file diff --git a/view/vue/header.vue b/view/vue/header.vue index c20ef36..3d872fe 100644 --- a/view/vue/header.vue +++ b/view/vue/header.vue @@ -13,7 +13,8 @@
- + +
@@ -24,7 +25,12 @@