From 96c88b5a1e668eb506db6db3544feadcf592db6f Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Fri, 1 Apr 2016 18:30:39 +0530 Subject: [PATCH] Use window.postMessage API for cross-domain frame communication Use filename as additional param to let the child frame know the name of the document easily. Use closebutton param to instruct the child frame about whether to show the close button, or not. --- js/documents.js | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/js/documents.js b/js/documents.js index 42bcec75..288fddb3 100644 --- a/js/documents.js +++ b/js/documents.js @@ -199,29 +199,22 @@ var documentsMain = { var viewer = urlsrc + 'WOPISrc=' + encodeURIComponent(documentsMain.url) + '&host=' + $('#wopi-url').val() + - '&permission=' + 'view' + - '×tamp=' + ''; + '&filename=' + title + + '&permission=' + 'view' + + '×tamp=' + '' + + '&closebutton=1'; var frame = '