Commit fb64ce14 authored by Bady's avatar Bady
Browse files

Merge branch 'devel' into 'master'

Papercut improvements

See merge request !3
parents 34c11748 d3a6cb1b
......@@ -99,13 +99,43 @@
}
}
form {
margin: 20px auto 0;
input[type="submit"] {
border: none;
border-radius: 5px;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
#knowledge-form {
text-align: center;
}
#knowledge-input, #knowledge-submit, #knowledge-edit {
margin: 10px auto;
}
form input[type="text"] {
#knowledge-input {
border: none;
border-radius: 5px;
width: 420px;
padding: 10px;
}
#knowledge-submit {
background: #008CBA;
font-size: 14px;
color: white;
}
#knowledge-edit {
background: #e5721f;
display: none;
}
#knowledge {
......@@ -139,6 +169,17 @@
margin: auto;
text-align: center;
}
@media only screen and (max-width: 480px) {
#knowledge-form {
margin-top: -15vh;
}
#knowledge-input {
width: 280px;
}
}
</style>
</head>
......@@ -459,8 +500,9 @@
</svg>
<form id="knowledge-form">
<input type="text" id="knowledge-input">
<input type="submit" value="Submit" onclick="event.preventDefault(); addKnowledgeItem();">
<input id="knowledge-input" type="text" maxlength="50">
<input id="knowledge-submit" type="submit" value="Submit" onclick="event.preventDefault(); addKnowledgeItem();">
<input id="knowledge-edit" type="submit" value="Edit" onclick="event.preventDefault(); editKnowledgeItem();">
</form>
<div id="knowledge"></div>
......@@ -493,6 +535,15 @@
leaftext = document.getElementById('knowledge-input').value;
var leafdata = { "leaftext": leaftext }
socket.emit("leaf text", leafdata);
document.getElementById("knowledge-input").style.display = "none";
document.getElementById("knowledge-submit").style.display = "none";
document.getElementById("knowledge-edit").style.display = "block";
}
function editKnowledgeItem() {
document.getElementById("knowledge-input").style.display = "block";
document.getElementById("knowledge-submit").style.display = "block";
document.getElementById("knowledge-edit").style.display = "none";
}
socket.on('leaf data', (leafdata) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment