diff options
Diffstat (limited to 'javascript/demo')
-rw-r--r-- | javascript/demo/group_demo.js | 6 | ||||
-rw-r--r-- | javascript/demo/one_to_one_demo.html | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/javascript/demo/group_demo.js b/javascript/demo/group_demo.js index 42a3d84..7cd9e3e 100644 --- a/javascript/demo/group_demo.js +++ b/javascript/demo/group_demo.js @@ -489,4 +489,8 @@ function startDemo() { } -document.addEventListener("DOMContentLoaded", startDemo, false); +document.addEventListener("DOMContentLoaded", function() { + Olm.init().then(function() { + startDemo(); + }); +}, false); diff --git a/javascript/demo/one_to_one_demo.html b/javascript/demo/one_to_one_demo.html index fc7e654..a225e4a 100644 --- a/javascript/demo/one_to_one_demo.html +++ b/javascript/demo/one_to_one_demo.html @@ -2,7 +2,13 @@ <head> <script src="../olm.js"></script> <script> -document.addEventListener("DOMContentLoaded", function (event) { +document.addEventListener("DOMContentLoaded", function() { + Olm.init().then(function() { + demo(); + }); +}, false); + +function demo() { function progress(who, message) { var message_element = document.createElement("pre"); var progress = document.getElementById(who + "_progress"); @@ -109,7 +115,7 @@ document.addEventListener("DOMContentLoaded", function (event) { glue_encrypt("bob", "alice", b_session); glue_decrypt("alice", a_session); }); - }, false); +} </script> <body> |