diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-08-27 12:24:28 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-09-01 13:57:36 +0200 |
commit | f6699ec9cb01faaec541ff091e2496e1b1bd7753 (patch) | |
tree | 1299a1dedf3de098653f407f225e7f38517a88a5 | |
parent | 734b2e1f111286d332ef0799b7d2c99d5b7a6bd6 (diff) | |
download | einfach-signieren-f6699ec9cb01faaec541ff091e2496e1b1bd7753.tar.gz einfach-signieren-f6699ec9cb01faaec541ff091e2496e1b1bd7753.tar.bz2 einfach-signieren-f6699ec9cb01faaec541ff091e2496e1b1bd7753.zip |
IE postMessage fix, IE only supports Strings to be send via PostMessage use JSON Stringify and Parse to pass data
5 files changed, 16 insertions, 15 deletions
diff --git a/simpleSigning/src/main/resources/js/error_response.js b/simpleSigning/src/main/resources/js/error_response.js index 8d7e5a4..a8373ff 100644 --- a/simpleSigning/src/main/resources/js/error_response.js +++ b/simpleSigning/src/main/resources/js/error_response.js @@ -6,4 +6,4 @@ var msg = { cause: "##REPLACE##CAUSE##" }; -postman.postMessage(msg, "##REPLACE##TARGETURL##", parent);
\ No newline at end of file +postman.postMessage(JSON.stringify(msg), "##REPLACE##TARGETURL##", parent);
\ No newline at end of file diff --git a/simpleSigning/src/main/resources/js/pdfas.js b/simpleSigning/src/main/resources/js/pdfas.js index a08d0f4..d058bec 100644 --- a/simpleSigning/src/main/resources/js/pdfas.js +++ b/simpleSigning/src/main/resources/js/pdfas.js @@ -263,18 +263,19 @@ pdfAs.doErrorCB = function(eventId, error, cause) { pdfAs.messageHandler = function(event) { if(event.origin !== pdfAsOrigin) return; - console.log('message received: ' + event.data, event); - if(event.data.suc || event.data.err) { - pdfAs.checkOverlay(event.data.eventId); - if(event.data.suc) { - console.log('Success Message: ' + event.data.suc.pdfUrl); - pdfAs.doSuccessCB(event.data.eventId, event.data.suc.pdfUrl); - } else if(event.data.err) { - console.log('Error Message: ' + event.data.err.msg); - pdfAs.doErrorCB(event.data.eventId, event.data.err.error, event.data.err.cause); + data = JSON.parse(event.data); + console.log('message received: ' + data, event); + if(data.suc || data.err) { + pdfAs.checkOverlay(data.eventId); + if(data.suc) { + console.log('Success Message: ' + data.suc.pdfUrl); + pdfAs.doSuccessCB(data.eventId, data.suc.pdfUrl); + } else if(data.err) { + console.log('Error Message: ' + data.err.msg); + pdfAs.doErrorCB(data.eventId, data.err.error, data.err.cause); } - } else if(event.data.resize) { - pdfAs.autoResize(event.data.resize, event.data.height, event.data.width); + } else if(data.resize) { + pdfAs.autoResize(data.resize, data.height, data.width); } }; diff --git a/simpleSigning/src/main/resources/js/resize_response.js b/simpleSigning/src/main/resources/js/resize_response.js index 8c67403..ef3ba0f 100644 --- a/simpleSigning/src/main/resources/js/resize_response.js +++ b/simpleSigning/src/main/resources/js/resize_response.js @@ -7,4 +7,4 @@ var msg = { width: document.body.scrollWidth }; -postman.postMessage(msg, "##REPLACE##TARGETURL##", parent);
\ No newline at end of file +postman.postMessage(JSON.stringify(msg), "##REPLACE##TARGETURL##", parent);
\ No newline at end of file diff --git a/simpleSigning/src/main/resources/js/resizing_response.js b/simpleSigning/src/main/resources/js/resizing_response.js index 3748a12..484c9b5 100644 --- a/simpleSigning/src/main/resources/js/resizing_response.js +++ b/simpleSigning/src/main/resources/js/resizing_response.js @@ -7,4 +7,4 @@ var msg = { width: ##REPLACE##WIDTH## }; -postman.postMessage(msg, "##REPLACE##TARGETURL##", parent);
\ No newline at end of file +postman.postMessage(JSON.stringify(msg), "##REPLACE##TARGETURL##", parent);
\ No newline at end of file diff --git a/simpleSigning/src/main/resources/js/success_response.js b/simpleSigning/src/main/resources/js/success_response.js index 3ad7f9a..c421537 100644 --- a/simpleSigning/src/main/resources/js/success_response.js +++ b/simpleSigning/src/main/resources/js/success_response.js @@ -7,4 +7,4 @@ var msg = { eventId: eID }; -postman.postMessage(msg, "##REPLACE##TARGETURL##", parent);
\ No newline at end of file +postman.postMessage(JSON.stringify(msg), "##REPLACE##TARGETURL##", parent);
\ No newline at end of file |