diff --git a/browser/html/framed.doc.html b/browser/html/framed.doc.html index 3d606da498fec..32104ded7ea07 100644 --- a/browser/html/framed.doc.html +++ b/browser/html/framed.doc.html @@ -30,6 +30,30 @@ window.frames[0].postMessage(JSON.stringify(msg), '*'); } + function sendBoldUNOCommand() { + post({'MessageId': 'Send_UNO_Command', + 'Values': { 'Command': '.uno:Bold' } + }); + } + + function sendInsertBookMarkUNOCommand() { + post({'MessageId': 'Send_UNO_Command', + 'Values': { + 'Command': '.uno:InsertBookmark', + 'Args': { + Bookmark: { + type: 'string', + value: 'Test Insert BookMark' + }, + BookmarkText: { + type: 'string', + value: 'Text of the Test Insert BookMark' + } + } + } + }); + } + function insertText(text) { post({'MessageId': 'CallPythonScript', 'SendTime': Date.now(), @@ -310,6 +334,12 @@

UI modification

+

Send UNO Commands

+ +

Document frame

If the frame fails to load click here and accept security bits

If the frame still fails to load ensure you have localhost:* included in your net.frame_ancestors in coolwsd.xml

diff --git a/browser/src/map/handler/Map.WOPI.js b/browser/src/map/handler/Map.WOPI.js index 51ac57899aac8..fd315e2da56b9 100644 --- a/browser/src/map/handler/Map.WOPI.js +++ b/browser/src/map/handler/Map.WOPI.js @@ -319,6 +319,8 @@ L.Map.WOPI = L.Handler.extend({ else if (msg.MessageId === 'Insert_Button' && msg.Values && msg.Values.id && msg.Values.imgurl) { this._map.uiManager.insertButton(msg.Values); + } else if (msg.MessageId === 'Send_UNO_Command' && msg.Values && msg.Values.Command) { + this._map.sendUnoCommand(msg.Values.Command, msg.Values.Args || ''); } else if (msg.MessageId === 'Disable_Default_UIAction') { // Disable the default handler and action for a UI command.