summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-11-09 08:38:23 +0100
committerTomaž Vajngerl <quikee@gmail.com>2018-11-09 09:06:33 +0100
commit582e461fb2fb566392b63a14efca7503133e838a (patch)
tree00136b5d06ded325f16d1c9d99f2404ae638b359
parent1a954fa44d4d12d68f8532afdd3f7b9282afe2a2 (diff)
vereign logging in and logging out
Change-Id: I33427c1451ae795e3692cb96a95488d85afb2db4 Reviewed-on: https://gerrit.libreoffice.org/63154 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--loleaflet/js/toolbar.js3
-rw-r--r--loleaflet/src/control/Signing.js24
2 files changed, 27 insertions, 0 deletions
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 5f5fe0007..2ceb076fe 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -231,6 +231,9 @@ function onClick(e, id, item, subItem) {
map.sendUnoCommand('.uno:StatusBarFunc', command);
});
}
+ else if (id === 'logout') {
+ map.signingLogout();
+ }
}
function setBorders(left, right, bottom, top, horiz, vert) {
diff --git a/loleaflet/src/control/Signing.js b/loleaflet/src/control/Signing.js
index b3034d59f..f12392705 100644
--- a/loleaflet/src/control/Signing.js
+++ b/loleaflet/src/control/Signing.js
@@ -3,7 +3,31 @@
* Document Signing
*/
+/* global window setupViamAPI */
+
+var library = null;
+
L.Map.include({
showSignDocument: function() {
+ this.signingLogin();
+ },
+ signingLogout: function() {
+ if (library) {
+ library.logout();
+ }
+ },
+ signingLogin: function() {
+ setupViamAPI(
+ 'signdocument-iframe-content',
+ {
+ onEvent: function(event) {
+ alert(event.type);
+ }
+ },
+ 'https://dev.vereign.com/api/js/iframe'
+ ).then(function(lib)
+ {
+ library = lib;
+ });
}
});