summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-09-29 22:14:30 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-09-29 22:14:30 +0200
commit08baf335929724e18addfc553f42fe8a3b274a42 (patch)
treeca19d0bb21287bd2c19a3ac976653dd8a25a2cc0
parent463aca15fdeeb7fda838dcc7355d2365de5d703d (diff)
downloadtacticians-extension-08baf335929724e18addfc553f42fe8a3b274a42.zip
tacticians-extension-08baf335929724e18addfc553f42fe8a3b274a42.tar.bz2
Adds icon notification.
There might be a browser function to make a notification, but let's go with an icon change for now...
-rw-r--r--images/to-favicon-notification.svg522
-rw-r--r--src/background/src/Update/HandleServerReply.elm30
-rw-r--r--src/shared/Action/Ports.elm3
-rw-r--r--www/background.html1
-rw-r--r--www/script/init_background.js3
-rw-r--r--www/script/init_popup.js2
-rw-r--r--www/script/notification.js32
7 files changed, 580 insertions, 13 deletions
diff --git a/images/to-favicon-notification.svg b/images/to-favicon-notification.svg
new file mode 100644
index 0000000..fbee323
--- /dev/null
+++ b/images/to-favicon-notification.svg
@@ -0,0 +1,522 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="42mm"
+ height="42mm"
+ viewBox="0 0 42 42"
+ version="1.1"
+ id="svg8"
+ inkscape:version="0.92.2 5c3e80d, 2017-08-06"
+ sodipodi:docname="to-favicon-notification.svg"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ inkscape:export-xdpi="24.5634"
+ inkscape:export-ydpi="24.5634">
+ <defs
+ id="defs2" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.41421"
+ inkscape:cx="38.336134"
+ inkscape:cy="206.77468"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer2"
+ showgrid="false"
+ inkscape:snap-global="false"
+ showguides="false"
+ inkscape:window-width="958"
+ inkscape:window-height="1059"
+ inkscape:window-x="1"
+ inkscape:window-y="20"
+ inkscape:window-maximized="0"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
+ <metadata
+ id="metadata5">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-0.765209,-49.6575)">
+ <g
+ id="g1230"
+ transform="translate(7.96196,-0.001457)">
+ <g
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ style="fill:#e9ddaf;stroke:#483e37"
+ id="g1022">
+ <path
+ style="stroke-width:0.5"
+ d="M 25.8655,74.956 A 8.23368,8.23368 65.7815 0 1 21.7341,85.8426 8.23368,8.23368 65.7815 0 1 10.8475,81.7112 8.23368,8.23368 65.7815 0 1 14.9789,70.8246 8.23368,8.23368 65.7815 0 1 25.8655,74.956 Z"
+ id="path922"
+ inkscape:connector-curvature="0" />
+ <path
+ style="stroke-width:0.1"
+ d="M 24.9805,75.3541 A 7.26322,7.26322 65.7815 0 1 21.336,84.9576 7.26322,7.26322 65.7815 0 1 11.7326,81.3131 7.26322,7.26322 65.7815 0 1 15.377,71.7096 7.26322,7.26322 65.7815 0 1 24.9805,75.3541 Z"
+ id="path922-6"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill-rule:evenodd;stroke-width:0.1"
+ d="M 11.267,76.6753 14.8686,84.6824"
+ id="path945"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#path945"
+ id="use947"
+ transform="matrix(0.998771,-0.002732,-0.002732,0.993927,10.8154,-4.19754)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.100367" />
+ <path
+ style="fill-rule:evenodd;stroke-width:0.1"
+ d="M 12.2142,74.4725 13.7955,77.9881"
+ id="path945-7"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#path945-7"
+ id="use964"
+ transform="translate(7.3407,-3.3019)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <path
+ style="fill-rule:evenodd;stroke-width:0.100725"
+ d="M 13.6805,72.7924 19.4026,85.5138"
+ id="path945-7-3"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#path945-7-3"
+ id="use4555"
+ transform="translate(3.61138,-1.62442)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#path945-7-3"
+ id="use4555-6"
+ transform="matrix(0.838763,-0.356215,-0.356215,0.207063,35.516,74.1467)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.46231" />
+ <path
+ style="stroke-width:0.1"
+ d="M 20.0595,77.5008 A 1.89475,1.89475 65.7815 0 1 19.1088,80.006 1.89475,1.89475 65.7815 0 1 16.6035,79.0553 1.89475,1.89475 65.7815 0 1 17.5543,76.55 1.89475,1.89475 65.7815 0 1 20.0595,77.5008 Z"
+ id="path922-3"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="use4597"
+ d="M 25.5865,74.8736 A 0.316587,0.316587 65.7815 0 1 25.4277,75.2922 0.316587,0.316587 65.7815 0 1 25.0091,75.1334 0.316587,0.316587 65.7815 0 1 25.1679,74.7148 0.316587,0.316587 65.7815 0 1 25.5865,74.8736 Z"
+ style="stroke-width:0.1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="use4599"
+ d="M 15.4923,71.1942 A 0.316587,0.316587 65.7815 0 1 15.3334,71.6128 0.316587,0.316587 65.7815 0 1 14.9148,71.4539 0.316587,0.316587 65.7815 0 1 15.0737,71.0353 0.316587,0.316587 65.7815 0 1 15.4923,71.1942 Z"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4599"
+ id="use4601"
+ transform="translate(6.31649,14.0427)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4601"
+ id="use4603"
+ transform="translate(-6.18533,0.015093)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4603"
+ id="use4605"
+ transform="translate(-4.25392,-9.45721)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4605"
+ id="use4607"
+ transform="translate(10.3357,-4.64909)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4607"
+ id="use4609"
+ transform="translate(4.25286,9.45486)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <path
+ style="stroke-width:0.1"
+ d="M 19.1977,77.8884 A 0.94976,0.94976 0 0 1 18.7211,79.1442 0.94976,0.94976 0 0 1 17.4653,78.6676 0.94976,0.94976 0 0 1 17.9419,77.4119 0.94976,0.94976 0 0 1 19.1977,77.8884 Z"
+ id="path922-3-5"
+ inkscape:connector-curvature="0" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use964"
+ id="use5318"
+ transform="translate(3.38109,7.51676)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <path
+ inkscape:connector-curvature="0"
+ style="stroke-width:0.1"
+ d="M 20.5395,74.3183 C 19.9855,75.087 19.7004,76.5892 20.0495,77.3653 20.4057,78.1573 21.7335,79.1134 22.6545,79.0201 23.7901,78.3799 24.6144,76.416 24.7315,75.2593 23.7583,74.5579 21.8147,74.1113 20.5395,74.3183 Z M 20.7662,75.1426 C 21.6199,75.004 22.9211,75.303 23.5726,75.7725 23.4942,76.5469 22.9423,77.8616 22.182,78.2903 21.5655,78.3527 20.6768,77.7126 20.4383,77.1824 20.2046,76.6628 20.3953,75.6572 20.7662,75.1426 Z"
+ id="path4515" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#path4515"
+ id="use5298"
+ transform="matrix(-0.663442,0.748228,0.748228,0.663442,-28.0637,12.6232)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#path4515"
+ id="use5300"
+ transform="rotate(90,18.2449,78.2498)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use5300"
+ id="use5302"
+ transform="matrix(0.663442,-0.748228,-0.748228,-0.663442,64.7501,143.951)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4555-6"
+ id="use5320"
+ transform="translate(-5.697,-12.6654)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use5302"
+ id="use5304"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#path945-7"
+ id="use5316"
+ transform="translate(3.38109,7.51676)"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use5298"
+ id="use5312"
+ width="100%"
+ height="100%"
+ style="stroke-width:0.1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="use5330"
+ d="M 18.6202,78.1482 A 0.316587,0.316587 65.7815 0 1 18.4614,78.5668 0.316587,0.316587 65.7815 0 1 18.0428,78.4079 0.316587,0.316587 65.7815 0 1 18.2016,77.9893 0.316587,0.316587 65.7815 0 1 18.6202,78.1482 Z"
+ style="stroke-width:0.1" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4597"
+ id="use1241"
+ transform="translate(-13.9952,6.29513)"
+ width="100%"
+ height="100%" />
+ </g>
+ <path
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ sodipodi:nodetypes="ccccccccccccccc"
+ inkscape:connector-curvature="0"
+ d="M 24.2172,91.3106 C 22.7779,81.0634 18.8389,81.4851 13.3558,61.0857 14.4997,59.1718 19.3261,59.4097 21.0781,59.0713 18.644,58.8611 15.9915,58.8101 14.9749,57.5635 13.8334,57.9832 12.3265,58.6546 11.1557,59.4869 9.9924,56.0745 9.30559,54.2587 7.839,52.1345 9.26206,49.6789 6.57668,49.696 5.65755,50.1674 L 5.56442,50.2094 C 4.60266,50.5864 2.81307,52.588 5.59578,53.1464 6.21755,55.6517 7.12424,57.3684 8.91243,60.4988 7.5136,60.8257 6.01251,61.5112 4.94234,62.0892 5.20405,63.6763 3.48678,65.6985 2.03339,67.6624 3.44656,66.5729 6.46248,62.7974 8.65436,63.2065 20.3178,80.8179 17.3948,83.4917 24.124,91.3526 Z"
+ style="fill:#e9ddaf;fill-rule:evenodd;stroke:#483e37;stroke-width:0.5;stroke-miterlimit:88.800003"
+ id="path4526" />
+ <path
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path4547"
+ d="M 8.86646,60.6297 C 9.95389,60.3226 10.6623,59.8943 11.3659,59.4644"
+ style="fill:#e9ddaf;fill-opacity:0;fill-rule:evenodd;stroke:#483e37;stroke-width:0.1" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.28115,-0.493305)"
+ id="use4564"
+ xlink:href="#path4547"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4566"
+ xlink:href="#use4564"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4568"
+ xlink:href="#use4566"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4570"
+ xlink:href="#use4568"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4572"
+ xlink:href="#use4570"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4574"
+ xlink:href="#use4572"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4576"
+ xlink:href="#use4574"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4578"
+ xlink:href="#use4576"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4580"
+ xlink:href="#use4578"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4582"
+ xlink:href="#use4580"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4584"
+ xlink:href="#use4582"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4586"
+ xlink:href="#use4584"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.23254,-0.515498)"
+ id="use4588"
+ xlink:href="#use4586"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ height="100%"
+ width="100%"
+ transform="translate(-0.188539,-0.417955)"
+ id="use4590"
+ xlink:href="#use4588"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <use
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ transform="translate(-0.188523,-0.417919)"
+ height="100%"
+ width="100%"
+ id="use4592"
+ xlink:href="#use4590"
+ y="0"
+ x="0"
+ style="fill:#e9ddaf;stroke:#483e37" />
+ <path
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path4547-3"
+ d="M 8.69475,63.1703 C 10.181,63.5831 12.8752,62.0343 13.2687,61.0382"
+ style="fill:#e9ddaf;fill-opacity:0;fill-rule:evenodd;stroke:#483e37;stroke-width:0.1" />
+ <path
+ inkscape:export-ydpi="105.84057"
+ inkscape:export-xdpi="105.84057"
+ inkscape:export-filename="/home/nsensfel/to-logo.png"
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path4609"
+ d="M 11.2144,62.7344 24.1379,91.2554"
+ style="fill:#e9ddaf;fill-rule:evenodd;stroke:#483e37;stroke-width:0.05" />
+ </g>
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="Layer 2">
+ <circle
+ style="opacity:1;vector-effect:none;fill:#37abc8;fill-opacity:1;stroke:none;stroke-width:3.5212338;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill"
+ id="path4653"
+ cx="34.880402"
+ cy="7.3070498"
+ r="7" />
+ </g>
+</svg>
diff --git a/src/background/src/Update/HandleServerReply.elm b/src/background/src/Update/HandleServerReply.elm
index 116a60c..983043d 100644
--- a/src/background/src/Update/HandleServerReply.elm
+++ b/src/background/src/Update/HandleServerReply.elm
@@ -7,6 +7,8 @@ import Json.Encode
import Http
+import List
+
-- Extension -------------------------------------------------------------------
import Action.Ports
@@ -34,20 +36,28 @@ maybe_update_storage model cmds =
then
cmds
else
- (
- (Action.Ports.set_results
- (Json.Encode.encode
- 0
- (Json.Encode.list
- (List.map
- (Struct.Player.encode)
- (Array.toList model.players)
+ let
+ players_list = (Array.toList model.players)
+ in
+ (
+ (Action.Ports.set_results
+ (Json.Encode.encode
+ 0
+ (Json.Encode.list
+ (List.map (Struct.Player.encode) players_list)
)
)
)
+ ::
+ (
+ (
+ if (List.any (Struct.Player.has_active_battles) players_list)
+ then (Action.Ports.activate_notification ())
+ else (Action.Ports.disable_notification ())
+ )
+ :: cmds
+ )
)
- :: cmds
- )
handle_set_battles : (
(
diff --git a/src/shared/Action/Ports.elm b/src/shared/Action/Ports.elm
index c14d7f4..c42ff8b 100644
--- a/src/shared/Action/Ports.elm
+++ b/src/shared/Action/Ports.elm
@@ -8,4 +8,5 @@ port get_results : () -> (Cmd msg)
port results_in : (String -> msg) -> (Sub msg)
port set_results : (String) -> (Cmd msg)
-port set_signal : (Bool) -> (Cmd msg)
+port activate_notification : () -> (Cmd msg)
+port disable_notification : () -> (Cmd msg)
diff --git a/www/background.html b/www/background.html
index fd648a2..dc8d0e9 100644
--- a/www/background.html
+++ b/www/background.html
@@ -5,6 +5,7 @@
<body>
<script src="/www/script/params.js"></script>
<script src="/www/script/battles.js"></script>
+ <script src="/www/script/notification.js"></script>
<script src="/www/script/main_background.js"></script>
<script src="/www/script/init_background.js"></script>
</body>
diff --git a/www/script/init_background.js b/www/script/init_background.js
index 362ec43..51cdedf 100644
--- a/www/script/init_background.js
+++ b/www/script/init_background.js
@@ -1,6 +1,7 @@
tacticians_online.params.load();
-tacticians_online.app = Elm.Main.fullscreen(tacticians_online.params.get_params());
+tacticians_online.app = Elm.Main.fullscreen();
tacticians_online.params.attach_to(tacticians_online.app);
tacticians_online.battles.attach_to(tacticians_online.app);
+tacticians_online.notification.attach_to(tacticians_online.app);
diff --git a/www/script/init_popup.js b/www/script/init_popup.js
index 362ec43..3853867 100644
--- a/www/script/init_popup.js
+++ b/www/script/init_popup.js
@@ -1,6 +1,6 @@
tacticians_online.params.load();
-tacticians_online.app = Elm.Main.fullscreen(tacticians_online.params.get_params());
+tacticians_online.app = Elm.Main.fullscreen();
tacticians_online.params.attach_to(tacticians_online.app);
tacticians_online.battles.attach_to(tacticians_online.app);
diff --git a/www/script/notification.js b/www/script/notification.js
new file mode 100644
index 0000000..d997ba9
--- /dev/null
+++ b/www/script/notification.js
@@ -0,0 +1,32 @@
+/******************************************************************************/
+/** Notification Management ***************************************************/
+/******************************************************************************/
+var tacticians_online = tacticians_online || new Object();
+
+tacticians_online.notification = new Object();
+
+tacticians_online.notification.activate =
+function ()
+{
+ browser.browserAction.setIcon("images/to-favicon-notification.svg");
+}
+
+tacticians_online.notification.disable =
+function (encoded_notification)
+{
+ browser.browserAction.setIcon("images/to-favicon.svg");
+}
+
+tacticians_online.notification.attach_to =
+function (app)
+{
+ app.ports.activate_notification.subscribe
+ (
+ tacticians_online.notification.activate
+ );
+ app.ports.disable_notification.subscribe
+ (
+ tacticians_online.notification.disable
+ );
+}
+