summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-06-15 20:56:28 -0400
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-07-01 17:39:03 +0200
commit08fd7ef485b82deeeacf5d719df60217d6887635 (patch)
tree9a7700d2534f235de1c5c5a6fbc81920708e59c3
parentCleanup framed.doc.html sample (diff)
downloadonline-08fd7ef485b82deeeacf5d719df60217d6887635.tar.gz
online-08fd7ef485b82deeeacf5d719df60217d6887635.zip
leaflet: show/hide commands demo
This demonstrates the use of show and hide functionality via Show/Hide_Button and Show/Hide_Menu_Item postMessage events. Save and Print buttons and menu items are controlled in the demo. Change-Id: I81dfea816765da50a1c20699b460765ae35f60a6 Reviewed-on: https://gerrit.libreoffice.org/74130 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 439eb0b98bbedaf8ea2cf016bd2c3bae5c56a2cd)
-rw-r--r--loleaflet/html/framed.doc.html31
1 files changed, 30 insertions, 1 deletions
diff --git a/loleaflet/html/framed.doc.html b/loleaflet/html/framed.doc.html
index 894bc1c8f9..2b1cf3374a 100644
--- a/loleaflet/html/framed.doc.html
+++ b/loleaflet/html/framed.doc.html
@@ -46,6 +46,30 @@
});
}
+ function save() {
+ post({'MessageId': 'Action_Save',
+ 'Values': { 'Notify': true, }
+ });
+ }
+
+ function hide_commands(id) {
+ post({'MessageId': 'Hide_Menu_Item',
+ 'Values': { 'id': id, }
+ });
+ post({'MessageId': 'Hide_Button',
+ 'Values': { 'id': id, }
+ });
+ }
+
+ function show_commands(id) {
+ post({'MessageId': 'Show_Menu_Item',
+ 'Values': { 'id': id, }
+ });
+ post({'MessageId': 'Show_Button',
+ 'Values': { 'id': id, }
+ });
+ }
+
// This function is invoked when the iframe posts a message back.
function receiveMessage(event) {
@@ -78,7 +102,12 @@
</form>
<form id="insert-text-form">
- Click <button onclick="capitalize(); return false;">here</button> to capitalize selected text in the document:
+ Click <button onclick="capitalize(); return false;">here</button> to capitalize selected text in the document.</br></br>
+ <button onclick="save(); return false;">Save</button></br></br>
+ <button onclick="hide_commands('save'); return false;">Hide Save Commands</button>
+ <button onclick="show_commands('save'); return false;">Show Save Commands</button></br>
+ <button onclick="hide_commands('print'); return false;">Hide Print Commands</button>
+ <button onclick="show_commands('print'); return false;">Show Print Commands</button></br></br>
</form>
<!-- The hostname and pathnames below are obviously specific to my