Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions browser/html/framed.doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -310,6 +334,12 @@ <h3>UI modification</h3>
<button onclick="ShowNotebookbar(true); return false;">Tabbed Toolbar</button>
</form>

<h3>Send UNO Commands</h3>
<form id="menubar-toggle">
<button onclick="sendBoldUNOCommand(); return false;">Send Bold UNO Command (and example without args)</button>
<button onclick="sendInsertBookMarkUNOCommand(); return false;">Send InsertBookmark UNO Command (an example with args)</button>
</form>

<h3>Document frame</h3>
<h4>If the frame fails to load click <a id="link">here and accept security bits</a></h4>
<h4>If the frame still fails to load ensure you have <code>localhost:*</code> included in your <code>net.frame_ancestors</code> in coolwsd.xml</h4>
Expand Down
2 changes: 2 additions & 0 deletions browser/src/map/handler/Map.WOPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down