mirror of
https://github.com/octoleo/plantuml-server.git
synced 2024-12-22 16:58:54 +00:00
This commit is contained in:
parent
823b506900
commit
f62ba44e7d
@ -35,7 +35,9 @@
|
|||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
document.myCodeMirror = CodeMirror.fromTextArea(
|
document.myCodeMirror = CodeMirror.fromTextArea(
|
||||||
document.getElementById("text"),
|
document.getElementById("text"),
|
||||||
{ lineNumbers: true }
|
{ lineNumbers: true,
|
||||||
|
extraKeys: {Tab: false, "Shift-Tab": false}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -56,24 +58,27 @@
|
|||||||
<div id="content">
|
<div id="content">
|
||||||
<%-- CONTENT --%>
|
<%-- CONTENT --%>
|
||||||
<form method="post" accept-charset="utf-8" action="<%= hostpath %>/form">
|
<form method="post" accept-charset="utf-8" action="<%= hostpath %>/form">
|
||||||
<p>
|
<p> <label for="text">UML Editor Content</label>
|
||||||
<textarea id="text" name="text" cols="120" rows="10"><%= net.sourceforge.plantuml.servlet.PlantUmlServlet.stringToHTMLString(decoded) %></textarea>
|
<textarea id="text" name="text" cols="120" rows="10"><%= net.sourceforge.plantuml.servlet.PlantUmlServlet.stringToHTMLString(decoded) %></textarea>
|
||||||
<input type="submit" />
|
<input type="submit" value="Submit" title="Submit Code and generate diagram"/>
|
||||||
|
<input type="submit" value="Copy Content to Clipboard" title="Copy Content to the clipboard" onclick="copyToClipboard('text','Content');return false; ">
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<hr/>
|
<hr/>
|
||||||
<p>You can enter here a previously generated URL:</p>
|
<p>You can enter here a previously generated URL:</p>
|
||||||
<form method="post" action="<%= hostpath %>/form">
|
<form method="post" action="<%= hostpath %>/form">
|
||||||
<p>
|
<p> <label for="url">previously generated URL</label>
|
||||||
<input name="url" type="text" size="150" value="<%= imgurl %>" />
|
<input id="url" name="url" type="text" size="150" value="<%= imgurl %>" />
|
||||||
<br/>
|
<br/>
|
||||||
<input type="submit"/>
|
<input type="submit" value="Decode URL" title="Decode URL and show code and diagram"/>
|
||||||
|
<input type="submit" value="Copy URL to Clipboard" title="Copy URL to the clipboard" onclick="copyToClipboard('url','URL');return false; ">
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<% if (hasImg) { %>
|
<% if (hasImg) { %>
|
||||||
<hr/>
|
<hr/>
|
||||||
<a href="<%= svgurl %>">View as SVG</a>
|
<a href="<%= imgurl %>" title="View diagram as PNG">View as PNG</a>
|
||||||
<a href="<%= txturl %>">View as ASCII Art</a>
|
<a href="<%= svgurl %>" title="View diagram as SVG">View as SVG</a>
|
||||||
|
<a href="<%= txturl %>" title="View diagram as ASCII Art">View as ASCII Art</a>
|
||||||
<% if (hasMap) { %>
|
<% if (hasMap) { %>
|
||||||
<a href="<%= mapurl %>">View Map Data</a>
|
<a href="<%= mapurl %>">View Map Data</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
@ -86,6 +91,33 @@
|
|||||||
</p>
|
</p>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
var clipboard_write=false;
|
||||||
|
var clipboard_read=false;
|
||||||
|
|
||||||
|
if (navigator.permissions){
|
||||||
|
navigator.permissions.query({ name: "clipboard-write" }).then((result) => {
|
||||||
|
if (result.state == "granted" || result.state == "prompt") {
|
||||||
|
clipboard_write = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
navigator.permissions.query({ name: "clipboard-read" }).then((result) => {
|
||||||
|
if (result.state == "granted" || result.state == "prompt") {
|
||||||
|
clipboard_read = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function copyToClipboard(fieldid, fielddesc) {
|
||||||
|
if (clipboard_write == true){
|
||||||
|
var copyText = '';
|
||||||
|
copyText = document.getElementById(fieldid).value;
|
||||||
|
navigator.clipboard.writeText(document.getElementById(fieldid).value)
|
||||||
|
alert(fielddesc + " copied to clipboard");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<%-- FOOTER --%>
|
<%-- FOOTER --%>
|
||||||
<%@ include file="footer.jspf" %>
|
<%@ include file="footer.jspf" %>
|
||||||
</body>
|
</body>
|
||||||
|
@ -24,17 +24,29 @@ h1, p, #content a {
|
|||||||
|
|
||||||
/* Form inputs */
|
/* Form inputs */
|
||||||
#content textarea, #content .CodeMirror, #content input[type=text] {
|
#content textarea, #content .CodeMirror, #content input[type=text] {
|
||||||
background-color: #ffc;
|
background-color: #ffffff;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: medium;
|
font-size: medium;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
|
border: 3px solid #ccc !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content input[type=text] {
|
#content input[type=text] {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#content input[type="submit"] {
|
||||||
|
margin-top: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
background: #fafafa;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content input[type="submit"]:hover {
|
||||||
|
background: #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Diagram */
|
/* Diagram */
|
||||||
#content #diagram {
|
#content #diagram {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
Loading…
Reference in New Issue
Block a user