diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-03-21 16:41:40 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-03-21 16:41:40 +0100 |
commit | 339c59ba118915cbe05b51b7e0909b45ea160ce1 (patch) | |
tree | 6beaf22d29a4803c3a926bfd65528e1abfed51b7 /articles/ui/figs/taler-presence.js | |
parent | 6f3407606e076fd556e756fb2d505e4e58eb885e (diff) | |
download | wallet-core-339c59ba118915cbe05b51b7e0909b45ea160ce1.tar.xz |
moving here wallet papers forlder
Diffstat (limited to 'articles/ui/figs/taler-presence.js')
-rw-r--r-- | articles/ui/figs/taler-presence.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/articles/ui/figs/taler-presence.js b/articles/ui/figs/taler-presence.js new file mode 100644 index 000000000..2301bd27d --- /dev/null +++ b/articles/ui/figs/taler-presence.js @@ -0,0 +1,35 @@ +function handleInstall() { + var show = document.getElementsByClassName("taler-installed-show"); + var hide = document.getElementsByClassName("taler-installed-hide"); + for (var i = 0; i < show.length; i++) { + show[i].style.display = ""; + } + for (var i = 0; i < hide.length; i++) { + hide[i].style.display = "none"; + } +}; + +function handleUninstall() { + var show = document.getElementsByClassName("taler-installed-show"); + var hide = document.getElementsByClassName("taler-installed-hide"); + for (var i = 0; i < show.length; i++) { + show[i].style.display = "none"; + } + for (var i = 0; i < hide.length; i++) { + hide[i].style.display = ""; + } +}; + +function probeTaler() { + var eve = new Event("taler-probe"); + document.dispatchEvent(eve); +}; + +function initTaler() { + handleUninstall(); probeTaler(); +}; + +document.addEventListener("taler-wallet-present", handleInstall, false); +document.addEventListener("taler-unload", handleUninstall, false); +document.addEventListener("taler-load", handleInstall, false); +window.addEventListener("load", initTaler, false); |