Added Dictionary description field

This commit is contained in:
Robbie Antenesse 2015-10-27 23:41:01 -06:00
parent decf674ea0
commit f81aed185a
3 changed files with 21 additions and 2 deletions

View File

@ -40,7 +40,7 @@ input, textarea {
padding-left: 5px;
}
label textarea {
#longDefinition {
width: 350px;
height: 200px;
}
@ -123,7 +123,11 @@ longdefinition {
left: 10%;
right: 10%;
bottom: 10%;
padding: 5%;
min-width: 350px;
min-height: 500px;
padding: 5px 5% 5%;
overflow-y: auto;
overflow-x: hidden;
background: #ffffff;
border-radius: 5px;
border: 1px solid black;
@ -138,6 +142,13 @@ longdefinition {
#settingsForm {
width: 100%;
padding: 0;
margin: 0;
}
#dictionaryDescriptionEdit {
width: 280px;
height: 130px;
}
#settingsErrorMessage {
@ -154,4 +165,5 @@ longdefinition {
display: block;
float: left;
width: 300px;
margin: 0 30px 0 0;
}

View File

@ -65,6 +65,9 @@
<span>Dictionary name</span>
<input type="text" id="dictionaryNameEdit" />
</label>
<label><span>Dictionary Description/Rules</span>
<textarea id="dictionaryDescriptionEdit"></textarea>
</label>
<label>
<span>Parts of Speech</span>
<input type="text" id="dictionaryPartsOfSpeechEdit" />

View File

@ -2,6 +2,7 @@
var currentDictionary = {
name: "New",
description: "A new dictionary.",
words: [],
settings: {
caseSensitive: false,
@ -260,6 +261,7 @@ function ManagementArea(itemIndex) {
function ShowSettings() {
document.getElementById("settingsScreen").style.display = "block";
document.getElementById("dictionaryNameEdit").value = htmlEntitiesParse(currentDictionary.name);
document.getElementById("dictionaryDescriptionEdit").value = htmlEntitiesParse(currentDictionary.description);
document.getElementById("dictionaryPartsOfSpeechEdit").value = htmlEntitiesParse(currentDictionary.settings.partsOfSpeech);
document.getElementById("dictionaryIsComplete").checked = currentDictionary.settings.isComplete;
}
@ -269,6 +271,8 @@ function SaveSettings() {
currentDictionary.name = htmlEntities(document.getElementById("dictionaryNameEdit").value);
}
currentDictionary.description = htmlEntities(document.getElementById("dictionaryDescriptionEdit").value);
CheckForPartsOfSpeechChange();
currentDictionary.settings.isComplete = document.getElementById("dictionaryIsComplete").checked;