I'd like to implement a toolbar on the host page that will "proxy" some of the editor toolbar functionality. I'd like to hide completely "File" menu and "Save" button. So, one thing is a way to tell the editor to not display some of the UI (File menu and Save button). The other thing is postMessage API extension with: 1. "Action_Save" command - just emit click on "Save" button 2. "Action_Print" command - just emit click on Print menu item 3. "Action_Export" command - just emit click on "Download as" with pre-selected output format. 4. "Export_Formats"/"Export_Formats_Resp" commands - to get supported export formats. This should return an array of: "label" - file type description "format" - file mimetype (used for input for "Action_Export"). BTW, is there a simple way to remove the logo element at all? I see that even with branding.css it's not so simple as it requires some style to move the menus/toolbars to the left. I'm using loolwsd 1.9.5.
(In reply to Aleksander Machniak from comment #0) > 1. "Action_Save" command - just emit click on "Save" button > 2. "Action_Print" command - just emit click on Print menu item > 3. "Action_Export" command - just emit click on "Download as" with > pre-selected output format. > 4. "Export_Formats"/"Export_Formats_Resp" commands - to get supported export > formats. This should return an array of: > "label" - file type description Should it (label) be a localized string ? Loleaflet has localisation string for descriptions like 'Download as X', X = PDF, ODT etc. > "format" - file mimetype (used for input for "Action_Export").
Yes, it should be localized. However, my button label already is "Export as" or "Download as", so the format label should not contain "Download as " prefix.
Pranav Kant committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/online/commit/?id=9c5928a87b91a58f37b8960453e9553c6020e1e8 tdf#103641: Convert 'wopi:' message to JSON formatted message
Pranav Kant committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/online/commit/?id=2168617d603a81eab62465a9b18d6f64b35e66da tdf#103641: Implement ability to hide save, print, export options
Pranav Kant committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/online/commit/?id=5219baaab0691fa6d727d966d0376b75061331f6 tdf#103641: WOPI: Implement Action_Save, Action_Print, Action_Export
Pranav Kant committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/online/commit/?id=e850ac836f566316d827a42e22e6bbe35f2c11e7 tdf#103641: Another Post message API - Get_Export_Formats
(In reply to Aleksander Machniak from comment #0) > I'd like to implement a toolbar on the host page that will "proxy" some of > the editor toolbar functionality. I'd like to hide completely "File" menu > and "Save" button. > > So, one thing is a way to tell the editor to not display some of the UI > (File menu and Save button). HideSaveOption HidePrintOption HideExportOption Set these to true and all of them would be hidden. You can also chose to hide them individually. File menu item will only dissappear if there are no items in it (obviously), which will happen if you turn all of above to true. > > The other thing is postMessage API extension with: > > 1. "Action_Save" command - just emit click on "Save" button > 2. "Action_Print" command - just emit click on Print menu item > 3. "Action_Export" command - just emit click on "Download as" with > pre-selected output format. > 4. "Export_Formats"/"Export_Formats_Resp" commands - to get supported export > formats. This should return an array of: > "label" - file type description > "format" - file mimetype (used for input for "Action_Export"). Have a look at loleaflet/reference.html where I have updated the documentation regarding these.
An obvious mistake fixed in https://gerrit.libreoffice.org/#/c/30842/ Please, review.
And I have another problem that I don't know how to fix/workaround. When posting Get_Export_Formats message (properly after receiving App_LoadingStatus) I don't get the response. In console I see TypeError: this._map._docLayer is undefined Maybe some race condition?
(In reply to Aleksander Machniak from comment #9) > And I have another problem that I don't know how to fix/workaround. When > posting Get_Export_Formats message (properly after receiving > App_LoadingStatus) I don't get the response. In console I see > > TypeError: this._map._docLayer is undefined > > Maybe some race condition? Ah, okay. I know whats up there, will push a fix soon. Thanks.
Another issue here. The Save button is properly hidden on .odt documents, but not when using .odp. Also, normally there's w2ui-break element on the right of the Save button. If we hide the button we should remove also that element, which is redundant.
(In reply to Aleksander Machniak from comment #9) > And I have another problem that I don't know how to fix/workaround. When > posting Get_Export_Formats message (properly after receiving > App_LoadingStatus) I don't get the response. In console I see > > TypeError: this._map._docLayer is undefined > > Maybe some race condition? Another problem here is that view information (number of users editing the document; their color, names etc.) is available only after document load finishes and currently App_LoadingStatus is emitted before that (when frame becomes ready) which means you can't send 'Get_Views' command (as opposed to what WOPI expects I guess) until document is loaded. There are two possible solutions 1. We can delay the App_LoadingStatus to emit after document is loaded, but then you won't be seeing any loleaflet's spinner till document is fully loaded and all tiles are visible. We only have a rotating spinner as of now, but we will have a progress bar there in future showing % of document load which can be quite useful information to show to the user (especially for large documents). 2. We can keep App_LoadingStatus before document load (in its current form) but add a new post message API - 'Document_Loaded' that tells outer frame that it can now use 'Get_View'
(In reply to Aleksander Machniak from comment #9) > And I have another problem that I don't know how to fix/workaround. When > posting Get_Export_Formats message (properly after receiving > App_LoadingStatus) I don't get the response. In console I see > > TypeError: this._map._docLayer is undefined This is also a similar problem like mentioned in Comment 12. All these layers and what export formats are available, we can't know till document is actually loaded.
(In reply to Pranav Kant from comment #12) > Another problem here is that view information (number of users editing the > document; their color, names etc.) is available only after document load > finishes and currently App_LoadingStatus is emitted before that (when frame > becomes ready) which means you can't send 'Get_Views' command (as opposed to > what WOPI expects I guess) until document is loaded. I don't really use Get_Views since I observed that View_Added is also sent for the current user. > There are two possible solutions > > 1. We can delay the App_LoadingStatus to emit after document is loaded, but > then you won't be seeing any loleaflet's spinner till document is fully > loaded and all tiles are visible. We only have a rotating spinner as of now, > but we will have a progress bar there in future showing % of document load > which can be quite useful information to show to the user (especially for > large documents). Loading spinner is not a big problem, I have a loading spinner on host page too (in the page corner, so less significant, but still). Displaying percentage would be useful though for bigger documents. > 2. We can keep App_LoadingStatus before document load (in its current form) > but add a new post message API - 'Document_Loaded' that tells outer frame > that it can now use 'Get_View' I think I could accept this solution if there's no other option.
Pranav Kant committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/online/commit/?id=d8a202bf1cc2a4cc343833348f08dcfdadbdd409 tdf#103641: Split App_LoadedStatus - Frame_Ready, Document_Loaded
Pranav Kant committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/online/commit/?id=26adebfcb06521bb7023f22ada041298c3c4aa3d tdf#103641: Fix save button visible for presentation
Pranav Kant committed a patch related to this issue. It has been pushed to "libreoffice-5-3": http://cgit.freedesktop.org/libreoffice/online/commit/?id=37266761c5d202ef173e49477b2a0e899e981127&h=libreoffice-5-3 tdf#103641: Hide redundant break after save too