Compare commits
3 Commits
5ba84abd0e
...
5fbd06a035
Author | SHA1 | Date |
---|---|---|
Robbie Antenesse | 5fbd06a035 | |
Robbie Antenesse | 466e5e84c6 | |
Robbie Antenesse | b2db35982f |
|
@ -245,13 +245,18 @@ export function importWords() {
|
|||
definition: removeTags(row.definition).trim(),
|
||||
details: removeTags(row.explanation).trim(),
|
||||
wordId: getNextId(),
|
||||
}, false, false, false);
|
||||
}, false);
|
||||
|
||||
importedWords.push(importedWord);
|
||||
|
||||
// Sort and save every 500 words, just in case something goes wrong on large imports
|
||||
if (importedWords.length % 500 == 499) {
|
||||
sortWords(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
saveDictionary(false);
|
||||
sortWords(false);
|
||||
renderAll();
|
||||
importWordsField.value = '';
|
||||
document.getElementById('editModal').style.display = 'none';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { addWord } from './wordManagement';
|
||||
import { getCookie } from './StackOverflow/cookie';
|
||||
|
||||
export function getNextId() {
|
||||
|
|
|
@ -173,6 +173,14 @@ export function submitWordForm() {
|
|||
|
||||
if (validateWord(word)) {
|
||||
addWord(word);
|
||||
sortWords(true);
|
||||
|
||||
if (upload && hasToken()) {
|
||||
import('./account/index.js').then(account => {
|
||||
account.uploadWord(word);
|
||||
});
|
||||
}
|
||||
|
||||
clearWordForm();
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +195,7 @@ export function clearWordForm() {
|
|||
document.getElementById('wordName').focus();
|
||||
}
|
||||
|
||||
export function addWord(word, render = true, message = true, upload = true) {
|
||||
export function addWord(word, message = true) {
|
||||
const timestamp = getTimestampInSeconds();
|
||||
word.lastUpdated = timestamp;
|
||||
word.createdOn = timestamp;
|
||||
|
@ -195,13 +203,6 @@ export function addWord(word, render = true, message = true, upload = true) {
|
|||
if (message) {
|
||||
addMessage(`<a href="#${word.wordId}">${word.name}</a> Created Successfully`, 30000);
|
||||
}
|
||||
sortWords(render);
|
||||
|
||||
if (upload && hasToken()) {
|
||||
import('./account/index.js').then(account => {
|
||||
account.uploadWord(word);
|
||||
});
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ switch ($view) {
|
|||
oldLoad && oldLoad();
|
||||
if (UpUp) {
|
||||
UpUp.start({
|
||||
'cache-version': '2.1.1',
|
||||
'cache-version': '2.1.2',
|
||||
'content-url': 'offline.html',
|
||||
'assets': [
|
||||
\"" . implode('","', $files) . "\"
|
||||
|
|
Loading…
Reference in New Issue