summaryrefslogtreecommitdiff
path: root/help3
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2021-11-10 17:48:33 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2021-11-10 21:53:29 +0100
commit5bc05ecf10babbe3216443206078be482d2f5246 (patch)
treef40ebbbd3e8c0be1477d885576deb02de33687b0 /help3
parentcd86424a47e358335e108f3aa26565e3a2e3143c (diff)
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.hallot@libreoffice.org> Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3')
-rw-r--r--help3/xhpeditor/index.php1
-rw-r--r--help3/xhpeditor/menu.php8
-rw-r--r--help3/xhpeditor/snippets.js16
-rw-r--r--help3/xhpeditor/xhpeditor.css4
4 files changed, 19 insertions, 10 deletions
diff --git a/help3/xhpeditor/index.php b/help3/xhpeditor/index.php
index 2e08facb..05457a56 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 d14f8afe..f9153849 100644
--- a/help3/xhpeditor/menu.php
+++ b/help3/xhpeditor/menu.php
@@ -58,7 +58,6 @@
<a href="#" onclick="tip()">&lt;tip&gt;</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">
@@ -110,6 +109,13 @@
</div>
</div>
<div class="dropdown">
+ <button class="dropbtn">Images</button>
+ <div class="dropdown-content">
+ <a href="#" onclick="image_par()">&lt;image&gt;</a>
+ <a href="#" onclick="object_par()">&lt;object&gt;</a>
+ </div>
+ </div>
+ <div class="dropdown">
<button class="dropbtn">Tools</button>
<div class="dropdown-content">
<input type="submit" form="CMtextarea" name="render_page" value="Render page"/>
diff --git a/help3/xhpeditor/snippets.js b/help3/xhpeditor/snippets.js
index 82b3b4f5..fa17cd0c 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 8fb29113..e7923730 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;