Show link to word after adding it and focus on Word field.
Only for newly added words.
This commit is contained in:
parent
7fb4dfbb70
commit
6e9d11ec0c
|
@ -26,12 +26,10 @@ if ($_GET['adminoverride'] == 'dictionarytotext') {
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<contents>
|
<contents>
|
||||||
<?php if ($notificationMessage) { ?>
|
<div id="notificationArea" style="display:<?php echo (($notificationMessage) ? "block" : "none"); ?>;">
|
||||||
<div id="notificationArea">
|
|
||||||
<span id="notificationCloseButton" class="clickable" onclick="document.getElementById('notificationArea').style.display='none';">Close</span>
|
<span id="notificationCloseButton" class="clickable" onclick="document.getElementById('notificationArea').style.display='none';">Close</span>
|
||||||
<?php echo $notificationMessage; ?>
|
<div id="notificationMessage"><?php echo $notificationMessage; ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
|
||||||
<div id="leftColumn">
|
<div id="leftColumn">
|
||||||
<form id="wordEntryForm">
|
<form id="wordEntryForm">
|
||||||
<label><span>Word</span>
|
<label><span>Word</span>
|
||||||
|
|
|
@ -103,10 +103,11 @@ function AddWord() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentDictionary.words.push({name: word, pronunciation: pronunciation, partOfSpeech: partOfSpeech, simpleDefinition: simpleDefinition, longDefinition: longDefinition, wordId: currentDictionary.nextWordId++});
|
currentDictionary.words.push({name: word, pronunciation: pronunciation, partOfSpeech: partOfSpeech, simpleDefinition: simpleDefinition, longDefinition: longDefinition, wordId: currentDictionary.nextWordId++});
|
||||||
|
FocusAfterAddingNewWord();
|
||||||
|
NewWordNotification(word);
|
||||||
SaveAndUpdateDictionary(false);
|
SaveAndUpdateDictionary(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
errorMessageArea.innerHTML = "";
|
errorMessageArea.innerHTML = "";
|
||||||
} else {
|
} else {
|
||||||
if (word == "") {
|
if (word == "") {
|
||||||
|
|
12
js/ui.js
12
js/ui.js
|
@ -100,3 +100,15 @@ function HideSettings() {
|
||||||
document.getElementById("settingsScreen").style.display = "none";
|
document.getElementById("settingsScreen").style.display = "none";
|
||||||
document.getElementById("wordEntryForm").style.display = (currentDictionary.settings.isComplete) ? "none" : "block";
|
document.getElementById("wordEntryForm").style.display = (currentDictionary.settings.isComplete) ? "none" : "block";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function NewWordNotification(word) {
|
||||||
|
var notificationArea = document.getElementById("notificationArea");
|
||||||
|
var notificationMessage = document.getElementById("notificationMessage");
|
||||||
|
var wordId = currentDictionary.nextWordId - 1;
|
||||||
|
notificationArea.style.display = "block";
|
||||||
|
notificationMessage.innerHTML = "New Word Added: <a href='#" + wordId.toString() + "'>" + word + "</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
function FocusAfterAddingNewWord() {
|
||||||
|
document.getElementById("word").focus();
|
||||||
|
}
|
Loading…
Reference in New Issue