Skip to content

Commit

Permalink
Passing some UI Defaults to loleaflet frame
Browse files Browse the repository at this point in the history
These ui defaults determine some widget states
at the start of the document which is hidden or shown
Some of them such as Ruler Statusbar and Sidebar can be
hidden at start with this patch. If not set, collabora
online will assume they are true

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
  • Loading branch information
Mert Tumer committed Oct 20, 2020
1 parent 886ddb6 commit 454f23d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ const documentsMain = {

// form to post the access token for WOPISrc
const form = '<form id="loleafletform_viewer" name="loleafletform_viewer" target="loleafletframe_viewer" action="' + urlsrc + '" method="post">'
+ '<input name="access_token" value="' + accessToken + '" type="hidden"/></form>'
+ '<input name="access_token" value="' + accessToken + '" type="hidden"/>'
+ '<input name="ui_defaults" value="UIMode=notebookbar;TextRuler=false;TextStatusbar=true;TextSidebar=false;PresentationSidebar=false;PresentationStatusbar=true;SpreadsheetSidebar=false" type="hidden"/></form>'

// iframe that contains the Collabora Online Viewer
const frame = '<iframe id="loleafletframe_viewer" name="loleafletframe_viewer" nonce="' + btoa(getRequestToken()) + '" style="width:100%;height:100%;position:absolute;"/>'
Expand Down Expand Up @@ -225,7 +226,8 @@ const documentsMain = {

// form to post the access token for WOPISrc
var form = '<form id="loleafletform" name="loleafletform" target="loleafletframe" action="' + urlsrc + '" method="post">'
+ '<input name="access_token" value="' + accessToken + '" type="hidden"/></form>'
+ '<input name="access_token" value="' + accessToken + '" type="hidden"/>'
+ '<input name="ui_defaults" value="UIMode=notebookbar;TextRuler=true;TextStatusbar=true;TextSidebar=true;PresentationSidebar=true;PresentationStatusbar=true;SpreadsheetSidebar=true" type="hidden"/></form>'

// iframe that contains the Collabora Online
var frame = '<iframe id="loleafletframe" name="loleafletframe" nonce="' + btoa(getRequestToken()) + '" scrolling="no" allowfullscreen style="width:100%;height:100%;position:absolute;" />'
Expand Down

0 comments on commit 454f23d

Please sign in to comment.