Skip to content
Snippets Groups Projects
Commit 795c7879 authored by Frank Steinberg's avatar Frank Steinberg
Browse files

Editor and gloassary updates.

parent 0d4e75bf
No related branches found
No related tags found
No related merge requests found
File moved
...@@ -3,9 +3,14 @@ ...@@ -3,9 +3,14 @@
border-bottom: 1px solid black; border-bottom: 1px solid black;
} }
div#editor button[title="copy"],
div#editor button[title="save"], div#editor button[title="save"],
div#editor button[title="cancel"] { div#editor button[title="cancel"] {
width: 70px; width: 70px;
background-color: white;
padding: 0px 3px;
margin: 0px 3px;
cursor: pointer;
} }
div#editor { div#editor {
display: none; display: none;
...@@ -34,17 +39,24 @@ div#editor-inner input { ...@@ -34,17 +39,24 @@ div#editor-inner input {
div#markup { div#markup {
font-family: courier; font-family: courier;
} }
div#original p, div#auto p, div#undo p {
margin:3px 8px;
}
div#original { div#original {
margin:10px; margin:2px 3px;
max-height: 100px;
overflow-y: auto;
font-size: 100%;
} }
div#auto { div#auto {
margin:10px; margin:2px 3px;
} max-height: 100px;
div#original:before { overflow-y: auto;
content: "Original: " }
} div#undo {
div#auto:before { margin:2px 3px;
content: "Google-Translate: " max-height: 100px;
overflow-y: auto;
} }
styleguide nav, styleguide *[source] { styleguide nav, styleguide *[source] {
......
...@@ -84,8 +84,12 @@ ...@@ -84,8 +84,12 @@
<div id="editor"> <div id="editor">
<div id="editor-inner"> <div id="editor-inner">
<p>Editing <span id="editstyleid">-</span> "<span id="editstylename">-</span>", element: <span id="editelemname">-</span>, last change: <span id="lastdate">-</span> by <span id="lastauthor">-</span></p> <p>Editing <span id="editstyleid">-</span> "<span id="editstylename">-</span>", element: <span id="editelemname">-</span>, last change: <span id="lastdate">-</span> by <span id="lastauthor">-</span></p>
<div>Original text:</div>
<div id="original">-</div> <div id="original">-</div>
<div>Auto translated text <button id="copy-auto" name="copy-auto" title="copy" onclick="copy_to_edit('auto')">copy</button> :</div>
<div id="auto">-</div> <div id="auto">-</div>
<div>Undo buffer <button id="copy-undo" name="copy-undo" title="copy" onclick="copy_to_edit('undo')">copy</button> :</div>
<div id="undo">-</div>
<p>Your short name (e.g. from hobbybrauer): <input type="text" name="author" id="author"/></p> <p>Your short name (e.g. from hobbybrauer): <input type="text" name="author" id="author"/></p>
<div id="pelleditor"> </div> <div id="pelleditor"> </div>
</div> </div>
......
...@@ -4,6 +4,7 @@ const pell = window.pell; ...@@ -4,6 +4,7 @@ const pell = window.pell;
const pelleditor = document.getElementById("pelleditor"); const pelleditor = document.getElementById("pelleditor");
const original = document.getElementById("original"); const original = document.getElementById("original");
const auto = document.getElementById("auto"); const auto = document.getElementById("auto");
const undo = document.getElementById("undo");
const markup = document.getElementById("markup"); const markup = document.getElementById("markup");
const render = document.getElementById("render"); const render = document.getElementById("render");
const author = document.getElementById("author"); const author = document.getElementById("author");
...@@ -43,7 +44,7 @@ pell.init({ ...@@ -43,7 +44,7 @@ pell.init({
}, },
{ {
name: 'save', name: 'save',
icon: '<div style="background-color:pink;">save</div>', icon: 'save',
title: 'save', title: 'save',
result: () => { result: () => {
...@@ -84,7 +85,7 @@ pell.init({ ...@@ -84,7 +85,7 @@ pell.init({
}, },
{ {
name: 'cancel', name: 'cancel',
icon: '<div style="background-color:pink;">cancel</div>', icon: 'cancel',
title: 'cancel', title: 'cancel',
result: () => { result: () => {
editor.style.display = "none"; editor.style.display = "none";
...@@ -220,12 +221,15 @@ function renderStyleguide(styleguide) { ...@@ -220,12 +221,15 @@ function renderStyleguide(styleguide) {
editelemname.innerText = element_name ? element_name : "-"; editelemname.innerText = element_name ? element_name : "-";
lastdate.innerText = editlastdate ? editlastdate : "original"; lastdate.innerText = editlastdate ? editlastdate : "original";
lastauthor.innerText = editlastauthor ? editlastauthor : "original"; lastauthor.innerText = editlastauthor ? editlastauthor : "original";
if (orig_element) { if (orig_element && original) {
original.innerHTML = orig_element.innerHTML; original.innerHTML = orig_element.innerHTML;
} }
if (auto_element) { if (auto_element && auto) {
auto.innerHTML = auto_element.innerHTML; auto.innerHTML = auto_element.innerHTML;
} }
if (undo) {
undo.innerHTML = edit_element.innerHTML;
}
if (markup) { if (markup) {
markup.innerText = edit_element.innerHTML; markup.innerText = edit_element.innerHTML;
} }
...@@ -268,3 +272,8 @@ function renderStyleguide(styleguide) { ...@@ -268,3 +272,8 @@ function renderStyleguide(styleguide) {
recalcTodo(); recalcTodo();
} }
function copy_to_edit(id) {
pelleditor.content.innerHTML = document.getElementById(id).innerHTML;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment