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

View File

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

View File

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