loleaflet/html/framed.doc.html |   31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 393b6a9f366c5323bb32821fbb4c3137fcca0222
Author:     Ashod Nakashian <[email protected]>
AuthorDate: Sat Jun 15 20:56:28 2019 -0400
Commit:     Jan Holesovsky <[email protected]>
CommitDate: Fri Nov 15 11:14:11 2019 +0100

    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 <[email protected]>
    Tested-by: Andras Timar <[email protected]>
    (cherry picked from commit 89ae4278e849cd950f7df984e69715649dc724fb)
    Reviewed-on: https://gerrit.libreoffice.org/82704
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Jan Holesovsky <[email protected]>

diff --git a/loleaflet/html/framed.doc.html b/loleaflet/html/framed.doc.html
index 8fa875db4..93c606cdc 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) {
@@ -72,7 +96,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
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to