help3/xhpeditor/index.php | 1 + help3/xhpeditor/menu.php | 8 +++++++- help3/xhpeditor/snippets.js | 16 +++++++++++----- help3/xhpeditor/xhpeditor.css | 4 ---- 4 files changed, 19 insertions(+), 10 deletions(-)
New commits: commit 5bc05ecf10babbe3216443206078be482d2f5246 Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Wed Nov 10 17:48:33 2021 -0300 Commit: Olivier Hallot <olivier.hal...@libreoffice.org> CommitDate: Wed Nov 10 21:53:29 2021 +0100 Add images and objects to xhpeditor menu Change-Id: I78c81c378e26a862446befa6f6a1f46ad13bf08d Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/125012 Tested-by: Olivier Hallot <olivier.hal...@libreoffice.org> Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/help3/xhpeditor/index.php b/help3/xhpeditor/index.php index 2e08fac..05457a5 100644 --- a/help3/xhpeditor/index.php +++ b/help3/xhpeditor/index.php @@ -14,6 +14,7 @@ $xhp = $_POST["xhpdoc"]; <html> <head> <meta charset="utf-8"/> +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> <title>LibreOffice XHP Editor</title> <link rel="shortcut icon" href="favicon.ico"/> <link type="text/css" rel="stylesheet" href="cm/lib/codemirror.css"> diff --git a/help3/xhpeditor/menu.php b/help3/xhpeditor/menu.php index d14f8af..f915384 100644 --- a/help3/xhpeditor/menu.php +++ b/help3/xhpeditor/menu.php @@ -58,7 +58,6 @@ <a href="#" onclick="tip()"><tip></a> <a href="#" onclick="bascode_par()">bascode-par</a> <a href="#" onclick="pycode_par()">pycode-par</a> - <a href="#" onclick="image_par()">image-par</a> </div> </div> <div class="dropdown"> @@ -109,6 +108,13 @@ <a href="#" onclick="tLink()"><link></a> </div> </div> + <div class="dropdown"> + <button class="dropbtn">Images</button> + <div class="dropdown-content"> + <a href="#" onclick="image_par()"><image></a> + <a href="#" onclick="object_par()"><object></a> + </div> + </div> <div class="dropdown"> <button class="dropbtn">Tools</button> <div class="dropdown-content"> diff --git a/help3/xhpeditor/snippets.js b/help3/xhpeditor/snippets.js index 82b3b4f..fa17cd0 100644 --- a/help3/xhpeditor/snippets.js +++ b/help3/xhpeditor/snippets.js @@ -67,11 +67,6 @@ function pycode_par() { editor.replaceSelection(a1 + editor.doc.getSelection() + a2,''); } -function image_par() { - var a1 = '<paragraph role="image" id="' + random('par') + '"><image src="media/CHANGE-ME" id="' + random('img') + '" width="" height=""><alt id="' + random('alt') +'">'; - var a2 = '</alt></image></paragraph>'; - editor.replaceSelection(a1 + editor.doc.getSelection() + a2,''); -} // Tables // simple table cell function tCell (role,text){ @@ -229,6 +224,17 @@ function tEmbedvar(){ editor.replaceSelection(a1 + editor.doc.getSelection() + a2,''); } +// Images Objects +function image_par() { + var a1 = '<paragraph role="image" id="' + random('par') + '"><image src="media/CHANGE-ME" id="' + random('img') + '" width="CHANGE ME" height="CHANGE ME"><alt id="' + random('alt') +'">'; + var a2 = '</alt></image></paragraph>'; + editor.replaceSelection(a1 + editor.doc.getSelection() + a2,''); +} +function object_par() { + var a1 = '<paragraph role="image" id="' + random('par') + '"><object data="media/CHANGE-ME" id="' + random('img') + '" type="CHANGE mime-type" width="CHANGE ME" height="CHANGE ME"></object></paragraph>'; + editor.replaceRange(a1, editor.doc.getCursor()); +} + /* javascript code for snippets (originally for KDE kate)*/ function fileName() { return document.fileName(); } function fileUrl() { return document.url(); } diff --git a/help3/xhpeditor/xhpeditor.css b/help3/xhpeditor/xhpeditor.css index 8fb2911..e792373 100644 --- a/help3/xhpeditor/xhpeditor.css +++ b/help3/xhpeditor/xhpeditor.css @@ -9,10 +9,6 @@ /* css for the main editor web page */ - - - - .form_area{ border:1px solid grey; height: auto;