UPD: reset page list (menu.items + header.notifs) + UPD: notif now isn't array but object which key is the link + added proper CSS instead of VueJS inline style='...'
This commit is contained in:
parent
97bb6de0cf
commit
40598a5418
|
@ -110,6 +110,8 @@
|
|||
|
||||
transition: background .2s ease-in-out;
|
||||
}
|
||||
#header-notif .hnotif.emergency{ background-image: url('/image/header/notif/emergency.svg@aaaaaa'); }
|
||||
#header-notif .hnotif.event{ background-image: url('/image/header/notif/event.svg@aaaaaa'); }
|
||||
#header-notif .hnotif.message{ background-image: url('/image/header/notif/message.svg@aaaaaa'); }
|
||||
#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'); }
|
||||
|
@ -120,6 +122,8 @@
|
|||
background-image: url('/image/header/notif/bell.svg@ee9a31');
|
||||
}
|
||||
|
||||
#header-notif .hnotif.emergency:hover{ background-image: url('/image/header/notif/emergency.svg@f93e2b'); }
|
||||
#header-notif .hnotif.event:hover{ background-image: url('/image/header/notif/event.svg@2986d4'); }
|
||||
#header-notif .hnotif.message:hover{ background-image: url('/image/header/notif/message.svg@23c795'); }
|
||||
#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'); }
|
||||
|
|
|
@ -39,6 +39,11 @@
|
|||
color .2s ease-in-out;
|
||||
}
|
||||
|
||||
#MENU .menu-item[data-theme='emergency']{ background-image: url('/image/menu/emergency.svg@aaaaaa'); }
|
||||
#MENU .menu-item[data-theme='event']{ background-image: url('/image/menu/event.svg@aaaaaa'); }
|
||||
#MENU .menu-item[data-theme='inbox']{ background-image: url('/image/menu/messages.svg@aaaaaa'); }
|
||||
|
||||
/* HOVER */
|
||||
#MENU .menu-item:hover,
|
||||
#MENU .menu-item.active{
|
||||
color: #444;
|
||||
|
@ -46,6 +51,13 @@
|
|||
background-color: #eef2f5;
|
||||
}
|
||||
|
||||
#MENU .menu-item[data-theme='emergency']:hover{ background-image: url('/image/menu/emergency.svg@f93e2b'); }
|
||||
#MENU .menu-item[data-theme='event']:hover{ background-image: url('/image/menu/event.svg@2986d4'); }
|
||||
#MENU .menu-item[data-theme='inbox']:hover{ background-image: url('/image/menu/messages.svg@23c795'); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************/
|
||||
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
height="895"
|
||||
width="1004.5717"
|
||||
id="svg4195"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="emergency.svg">
|
||||
<metadata
|
||||
id="metadata4203">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs4201" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1056"
|
||||
id="namedview4199"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="0.46484375"
|
||||
inkscape:cx="363.40304"
|
||||
inkscape:cy="434.7744"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4195" />
|
||||
<path
|
||||
d="m 996.13961,799.247 -438.286,-767 C 546.45861,12.306 525.25261,0 502.28561,0 c -22.967,0 -44.173,12.306 -55.567,32.247 l -438.2860041,767 c -11.319,19.809 -11.238,44.144 0.213,63.876 C 20.096606,882.855 41.184606,895 63.999606,895 l 876.572004,0 c 22.814,0 43.903,-12.145 55.354,-31.877 11.45099,-19.732 11.53299,-44.067 0.214,-63.876 z M 566.28561,767 l -128,0 0,-128 128,0 0,128 z m 0,-192 -128,0 0,-256 128,0 0,256 z"
|
||||
id="fill-edit"
|
||||
inkscape:connector-curvature="0" />
|
||||
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
height="18.99975"
|
||||
id="Layer_1"
|
||||
version="1.2"
|
||||
viewBox="0 0 15.999 18.99975"
|
||||
width="15.999"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="event.svg"><metadata
|
||||
id="metadata4182"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs4180" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1056"
|
||||
id="namedview4178"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="14.024285"
|
||||
inkscape:cx="-4.2272722"
|
||||
inkscape:cy="9.948518"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" /><path
|
||||
d="m 13.656,2.30475 c -3.124,-3.073 -8.189,-3.073 -11.313,0 -3.124,3.074 -3.124,8.057 0,11.13 l 5.656,5.565 5.657,-5.565 c 3.124,-3.073 3.124,-8.056 0,-11.13 z m -5.657,8.195 c -0.668,0 -1.295,-0.26 -1.768,-0.732 -0.975,-0.975 -0.975,-2.561 0,-3.536 0.472,-0.472 1.1,-0.732 1.768,-0.732 0.668,0 1.296,0.26 1.768,0.732 0.975,0.975 0.975,2.562 0,3.536 -0.472,0.472 -1.1,0.732 -1.768,0.732 z"
|
||||
id="fill-edit"
|
||||
inkscape:connector-curvature="0" /></svg>
|
After Width: | Height: | Size: 2.0 KiB |
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
enable-background="new 0 0 52 52"
|
||||
id="Layer_1"
|
||||
version="1.1"
|
||||
viewBox="0 0 33.890625 36.996338"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="emergency.svg"
|
||||
width="33.890625"
|
||||
height="36.996338"><metadata
|
||||
id="metadata4206"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs4204" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1056"
|
||||
id="namedview4202"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="18.307692"
|
||||
inkscape:cx="16.945312"
|
||||
inkscape:cy="18.498169"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="1104"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" /><path
|
||||
style="fill:#f93e2b"
|
||||
d="m 17,0 c -0.552246,0 -1,0.4477539 -1,1 l 0,4.046875 C 13.653626,5.241516 11.500366,6.1166993 9.7285156,7.4726562 L 7.5292969,4.4160156 C 7.2060539,3.9677736 6.5825196,3.8652341 6.1347656,4.1894531 5.6865236,4.5117181 5.583496,5.1357424 5.90625,5.5839844 L 8.2382812,8.8242188 C 6.8918453,10.26593 5.899781,12.034973 5.390625,14 L 1,14 c -0.5522465,0 -1,0.447754 -1,1 0,0.552246 0.4477535,1 1,1 l 4.0449219,0 c -0.02734,0.329407 -0.048828,0.659851 -0.048828,0.996094 l 0,10.089844 c 0.325928,-0.05499 0.6567378,-0.08984 0.9980468,-0.08984 l 22.0000004,0 c 0.34143,0 0.675903,0.03479 1.001953,0.08984 l 0,-10.089844 c 0,-0.336243 -0.02349,-0.666687 -0.05078,-0.996094 l 3.945313,0 c 0.552246,0 1,-0.447754 1,-1 0,-0.552246 -0.447753,-1 -1,-1 l -4.289063,0 C 28.085813,12.006409 27.074646,10.212647 25.699219,8.7597656 L 27.984375,5.5839844 C 28.307129,5.1357424 28.204101,4.5117181 27.755859,4.1894531 27.307129,3.8666991 26.684082,3.9682616 26.361328,4.4160156 L 24.197266,7.421875 C 22.440675,6.096619 20.316468,5.240357 18,5.046875 L 18,1 C 18,0.4477539 17.552247,0 17,0 Z m -2,10 c 0.552247,0 1,0.447754 1,1 0,0.552246 -0.447753,1 -1,1 -1.654296,0 -3,1.345703 -3,3 0,0.552246 -0.447753,1 -1,1 -0.552246,0 -1,-0.447754 -1,-1 0,-2.756836 2.243165,-5 5,-5 z"
|
||||
id="fill-edit"
|
||||
inkscape:connector-curvature="0" /><path
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
d="m 5.9960938,28.996094 c -2.199951,0 -4,1.799988 -4,4 0,2.210022 1.800049,4 4,4 l 22.0000002,0 c 2.210022,0 4,-1.789978 4,-4 0,-2.200012 -1.789978,-4 -4,-4 l -22.0000002,0 z"
|
||||
inkscape:connector-curvature="0" /></svg>
|
After Width: | Height: | Size: 3.2 KiB |
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
height="44"
|
||||
viewBox="0 0 44 44"
|
||||
width="44"
|
||||
id="svg4303"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="event.svg">
|
||||
<metadata
|
||||
id="metadata4313">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs4311" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1056"
|
||||
id="namedview4309"
|
||||
showgrid="false"
|
||||
inkscape:zoom="9.8333333"
|
||||
inkscape:cx="27.246023"
|
||||
inkscape:cy="13.248375"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4303"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<path
|
||||
d="m 22,14 c -4.42,0 -8,3.58 -8,8 0,4.42 3.58,8 8,8 4.42,0 8,-3.58 8,-8 0,-4.42 -3.58,-8 -8,-8 z"
|
||||
id="fill-edit"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="m 20,0 0,4.1191406 C 11.66,5.0391406 5.0391406,11.66 4.1191406,20 L 0,20 0,24 4.1191406,24 C 5.0391406,32.34 11.66,38.960859 20,39.880859 L 20,44 l 4,0 0,-4.119141 C 32.34,38.960859 38.960859,32.34 39.880859,24 L 44,24 44,20 39.880859,20 C 38.960859,11.66 32.34,5.0391406 24,4.1191406 L 24,0 20,0 Z m 2,8 c 7.73,0 14,6.27 14,14 0,7.73 -6.27,14 -14,14 C 14.27,36 8,29.73 8,22 8,14.27 14.27,8 22,8 Z"
|
||||
id="path4857"
|
||||
inkscape:connector-curvature="0" />
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
|
@ -17,7 +17,7 @@
|
|||
height="19.183594"><metadata
|
||||
id="metadata4190"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs4188" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
|
@ -39,10 +39,13 @@
|
|||
inkscape:cx="14.033312"
|
||||
inkscape:cy="4.9732261"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-y="1104"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4176" /><path
|
||||
style="fill:#303030"
|
||||
d="M 2.048828,0 C 0.918458,0 0,0.922854 0,2.058594 l 0,10.851562 c 0,1.13086 0.918458,2.048829 2.048828,2.048829 l 2.634765,0 0,-0.699219 0,-9.759766 c 0,-1.13086 0.920412,-2.050781 2.050782,-2.050781 l 14.205078,0 0.701172,0 0,-0.390625 C 21.640615,0.922844 20.715828,0 19.580078,0 L 2.048828,0 Z m 5.552734,3.148438 c -1.55036,0 -2.216797,0.615655 -2.216797,2.166015 l 0,8.587891 c 0,1.54448 1.264114,2.808594 2.808594,2.808594 l 14.623047,0 c 0.19824,0 0.393551,0.06543 0.550781,0.185547 l 2.257813,1.732421 0.699218,0.554688 0,-14.673828 c 0,-0.0052 4e-5,-0.01039 0,-0.01563 -0.0059,-0.76167 -0.693388,-1.345703 -1.455078,-1.345703 l -0.605469,0 -16.662109,0 z m 3.212891,5.117187 9.378906,0 c 0.19336,0 0.349609,0.15625 0.349609,0.34961 0,0.193359 -0.156249,0.349609 -0.349609,0.349609 l -9.378906,0 c -0.19336,0 -0.34961,-0.15625 -0.34961,-0.349609 0,-0.19336 0.15625,-0.34961 0.34961,-0.34961 z m 1.634765,2.841797 6.109375,0 c 0.19336,0 0.351563,0.156249 0.351563,0.349609 0,0.19336 -0.158203,0.34961 -0.351563,0.34961 l -6.109375,0 c -0.19336,0 -0.349609,-0.15625 -0.349609,-0.34961 0,-0.19336 0.156249,-0.349609 0.349609,-0.349609 z"
|
||||
d="M 2.048828,0 C 0.918458,0 0,0.922854 0,2.058594 l 0,10.851562 c 0,1.13086 0.918458,2.048829 2.048828,2.048829 l 2.634765,0 0,-0.699219 0,-9.759766 c 0,-1.13086 0.920412,-2.050781 2.050782,-2.050781 l 14.205078,0 0.701172,0 0,-0.390625 C 21.640615,0.922844 20.715828,0 19.580078,0 L 2.048828,0 Z"
|
||||
id="fill-edit"
|
||||
inkscape:connector-curvature="0" /></svg>
|
||||
inkscape:connector-curvature="0" /><path
|
||||
style="fill:#303030"
|
||||
d="M 7.6015625 3.1484375 C 6.0512025 3.1484375 5.3847656 3.7640931 5.3847656 5.3144531 L 5.3847656 13.902344 C 5.3847656 15.446824 6.6488794 16.710938 8.1933594 16.710938 L 22.816406 16.710938 C 23.014646 16.710938 23.209957 16.776367 23.367188 16.896484 L 25.625 18.628906 L 26.324219 19.183594 L 26.324219 4.5097656 C 26.324219 4.5045656 26.324259 4.4993806 26.324219 4.4941406 C 26.318319 3.7324706 25.630831 3.1484375 24.869141 3.1484375 L 24.263672 3.1484375 L 7.6015625 3.1484375 z M 10.814453 8.265625 L 20.193359 8.265625 C 20.386719 8.265625 20.542969 8.4218744 20.542969 8.6152344 C 20.542969 8.8085934 20.386719 8.9648438 20.193359 8.9648438 L 10.814453 8.9648438 C 10.621093 8.9648438 10.464844 8.8085934 10.464844 8.6152344 C 10.464844 8.4218744 10.621093 8.265625 10.814453 8.265625 z M 12.449219 11.107422 L 18.558594 11.107422 C 18.751954 11.107422 18.910156 11.263671 18.910156 11.457031 C 18.910156 11.650391 18.751954 11.806641 18.558594 11.806641 L 12.449219 11.806641 C 12.255859 11.806641 12.099609 11.650391 12.099609 11.457031 C 12.099609 11.263671 12.255859 11.107422 12.449219 11.107422 z "
|
||||
id="path4211" /></svg>
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.1 KiB |
55
view/main.js
55
view/main.js
|
@ -48,56 +48,7 @@ gstore.data.func.nav(router, null);
|
|||
|
||||
/* (3) Set WebSocket channels
|
||||
---------------------------------------------------------*/
|
||||
/* (1) Connection channel */
|
||||
window.wsc_connect = wsc.channel('connect').listen(function(msg, err){
|
||||
|
||||
// {1} Manage error //
|
||||
if( msg == null && err != null )
|
||||
return infobox.show('Erreur de connexion WebSocket@connect ('+err+')', 'error', 3000);
|
||||
|
||||
// {2} Manage wsclient error //
|
||||
if( typeof msg.error != 'boolean' || msg.error !== false )
|
||||
return infobox.show('Erreur de connexion WebSocket@connect', 'warning', 3000);
|
||||
|
||||
// {3} If no data -> exit //
|
||||
if( msg.connected == null && msg.disconnected == null )
|
||||
return;
|
||||
|
||||
// {4} Add connected users to stack //
|
||||
if( msg.connected instanceof Array ){
|
||||
|
||||
// -1- add connected users
|
||||
console.log('Detected '+msg.connected.length+' connected user(s)');
|
||||
var lastLen = gstore.data.notif[0].data.length;
|
||||
gstore.data.notif[0].data = gstore.data.notif[0].data.concat( msg.connected );
|
||||
|
||||
// -2- make each user unique
|
||||
gstore.data.notif[0].data = gstore.data.notif[0].data.filter(function(item, i, arr){ return arr.indexOf(item) === i; });
|
||||
|
||||
// -3- Update count if not already on page
|
||||
if( router.app.$route.path != '/notifications' )
|
||||
gstore.data.notif[0].count += gstore.data.notif[0].data.length - lastLen;
|
||||
|
||||
}
|
||||
|
||||
// {5} Add disconnected users to stack //
|
||||
if( msg.disconnected instanceof Array ){
|
||||
|
||||
// -1- Remove each disconnected user
|
||||
console.log('Detected '+msg.disconnected.length+' disconnected user(s)');
|
||||
var lastLen = gstore.data.notif[0].data.length;
|
||||
gstore.data.notif[0].data = gstore.data.notif[0].data.filter(function(item){ return msg.disconnected.indexOf(item) === -1; });
|
||||
|
||||
// -2- Update count if not already on page
|
||||
if( router.app.$route.path != '/notifications' )
|
||||
gstore.data.notif[0].count += lastLen - gstore.data.notif[0].data.length;
|
||||
|
||||
}
|
||||
|
||||
}).send({name: _SERVER.session.name});
|
||||
|
||||
|
||||
/* (2) Message channel */
|
||||
/* (1) Message channel */
|
||||
window.wsc_chat = wsc.channel('chat').listen(function(msg, err){
|
||||
|
||||
// {1} Manage error //
|
||||
|
@ -118,10 +69,10 @@ window.wsc_chat = wsc.channel('chat').listen(function(msg, err){
|
|||
( new Audio('https://notificationsounds.com/message-tones/communication-channel-519/download/mp3') ).play();
|
||||
|
||||
// {5} Add messages to stack //
|
||||
gstore.data.notif[1].data = gstore.data.notif[1].data.concat( msg.msg );
|
||||
gstore.data.notif.inbox.data = gstore.data.notif.inbox.data.concat( msg.msg );
|
||||
|
||||
// {6} Add notification count if not already on page //
|
||||
if( router.app.$route.path != '/inbox' )
|
||||
gstore.data.notif[1].count += msg.msg.length;
|
||||
gstore.data.notif.inbox.count += msg.msg.length;
|
||||
|
||||
}).send({name: _SERVER.session.name});
|
|
@ -4,14 +4,14 @@ export default { 0: [
|
|||
path: '/dashboard/',
|
||||
component: require('./vue/container/dashboard.vue').default
|
||||
}, {
|
||||
path: '/profile/',
|
||||
component: require('./vue/container/profile.vue').default
|
||||
path: '/emergency/',
|
||||
component: require('./vue/container/emergency.vue').default
|
||||
}, {
|
||||
path: '/inbox/',
|
||||
component: require('./vue/container/inbox.vue').default
|
||||
}, {
|
||||
path: '/notifications/',
|
||||
component: require('./vue/container/notifications.vue').default
|
||||
path: '/event/',
|
||||
component: require('./vue/container/event.vue').default
|
||||
}, {
|
||||
path: '*',
|
||||
redirect: '/dashboard/'
|
||||
|
|
|
@ -9,27 +9,27 @@ gstore.add('info', {
|
|||
type: 'warning',
|
||||
message: 'Warning! blabla'
|
||||
});
|
||||
gstore.add('notif', [
|
||||
{ class: 'bell', link: 'notifications', data: [], count: 0 },
|
||||
{ class: 'message', link: 'inbox', data: [], count: 0 },
|
||||
{ class: 'search', link: 'search', data: [], count: 0 },
|
||||
{ class: 'menu', link: 'dashboard', data: [], count: 0 }
|
||||
])
|
||||
gstore.add('notif', {
|
||||
emergency: { class: 'emergency', data: [], count: 0 },
|
||||
event: { class: 'event', data: [], count: 0 },
|
||||
inbox: { class: 'message', data: [], count: 0 },
|
||||
dashboard: { class: 'menu', data: [], count: 0 }
|
||||
})
|
||||
|
||||
// Menu
|
||||
gstore.add('menu_item', {
|
||||
dashboard: {
|
||||
label: 'Dashboard',
|
||||
icon: 'dashboard'
|
||||
}, profile: {
|
||||
label: 'Profil',
|
||||
icon: 'profile'
|
||||
label: 'Accueil',
|
||||
theme: 'dashboard'
|
||||
}, emergency: {
|
||||
label: 'Urgences',
|
||||
theme: 'emergency'
|
||||
}, event: {
|
||||
label: 'Signalements',
|
||||
theme: 'event'
|
||||
}, inbox: {
|
||||
label: 'Messagerie instantannée',
|
||||
icon: 'messages'
|
||||
}, notifications: {
|
||||
label: 'Notifications',
|
||||
icon: 'bell'
|
||||
label: 'Messagerie',
|
||||
theme: 'inbox'
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -68,9 +68,9 @@ gstore.add('func', {
|
|||
gstore.data.menu_item_active = uri;
|
||||
|
||||
// {5} Manage notifications //
|
||||
for( var notif of gstore.data.notif )
|
||||
if( notif.link == uri ) // if notif links to current page
|
||||
notif.count = 0;
|
||||
for( var id in gstore.data.notif )
|
||||
if( id == uri ) // if notif links to current page
|
||||
gstore.data.notif[id].count = 0;
|
||||
|
||||
},
|
||||
toggleMenuSize: function(){ gstore.data.min_menu=!gstore.data.min_menu; },
|
||||
|
@ -84,7 +84,7 @@ gstore.add('func', {
|
|||
wsc_chat.send(JSON.stringify({message: msg}));
|
||||
|
||||
/* (3) Add locally */
|
||||
gstore.data.notif[1].data.push([ gstore.data.server.session.name, msg ]);
|
||||
gstore.data.notif.inbox.data.push([ gstore.data.server.session.name, msg ]);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div id='CONTAINER'>
|
||||
|
||||
NOTIFICATIONS
|
||||
EMERGENCY
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CONTAINER_NOTIFICATIONS',
|
||||
name: 'CONTAINER_EMERGENCY',
|
||||
data(){ return { gstore: gstore.data }; }
|
||||
}
|
||||
</script>
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div id='CONTAINER'>
|
||||
|
||||
PROFILE
|
||||
EVENT
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CONTAINER_PROFILE',
|
||||
name: 'CONTAINER_EVENT',
|
||||
data(){ return { gstore: gstore.data }; }
|
||||
}
|
||||
</script>
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
<div id='CONTAINER' class='message'>
|
||||
|
||||
<div v-for='(msg, id) in gstore.notif[1].data' :class="msg[0] == gstore.server.session.name ? 'me' : ''" :data-noauthor='id == 0 || gstore.notif[1].data[id-1][0] != gstore.notif[1].data[id][0] ? "1" : "0"'>
|
||||
<span class='author' v-text='msg[0]' v-if='id == 0 || gstore.notif[1].data[id-1][0] != msg[0]'></span>
|
||||
<div v-for='(msg, id) in gstore.notif.inbox.data' :class="msg[0] == gstore.server.session.name ? 'me' : ''" :data-noauthor='id == 0 || gstore.notif.inbox.data[id-1][0] != gstore.notif.inbox.data[id][0] ? "1" : "0"'>
|
||||
<span class='author' v-text='msg[0]' v-if='id == 0 || gstore.notif.inbox.data[id-1][0] != msg[0]'></span>
|
||||
<span class='content' v-html='bbcode(msg[1])'></span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<!-- Header Notif -->
|
||||
<div id='header-notif'>
|
||||
<div v-for='notif in gstore.notif' @click='show_notif(notif.link)' :class='"hnotif " + notif.class' :data-count='notif.count'></div>
|
||||
<div v-for='(notif, link) in gstore.notif' @click='show_notif(link)' :class='"hnotif " + notif.class' :data-count='notif.count'></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<div v-for='(item, index) in gstore.menu_item' class='menu-item-wrapper'>
|
||||
|
||||
<div :class="(index == gstore.menu_item_active) ? 'menu-item active' : 'menu-item'" @click='navigate(index)' :style='"background-image: url(/image/menu/" + item.icon + ".svg@333333"'>
|
||||
<div :class="(index == gstore.menu_item_active) ? 'menu-item active' : 'menu-item'" @click='navigate(index)' :data-theme='item.theme'>
|
||||
<span>{{ item.label }}</span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<!-- Body -->
|
||||
<div class='body'>
|
||||
<span v-for='n in gstore.notif[0].data'><b>{{ n }}</b> est connecté</span>
|
||||
<span v-for='n in gstore.notif.emergency.data'><b>{{ n }}</b> est connecté</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue