Remove unneeded console logs and code
This commit is contained in:
parent
29eeb06ce4
commit
85ab5e2b96
|
@ -8,7 +8,6 @@ export function request (data = {}, success = () => {}, error = () => {}/* , fai
|
|||
credentials: 'same-origin',
|
||||
}).then(res => res.json())
|
||||
.then(response => {
|
||||
console.log('Success:', JSON.stringify(response));
|
||||
if (response.error) {
|
||||
return error(response.data);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,6 @@ export function createAccount() {
|
|||
}).then(() => {
|
||||
createAccountErrorMessages.innerHTML = errorHTML;
|
||||
if (errorHTML === '') {
|
||||
console.log('creating account');
|
||||
request({
|
||||
action: 'create-account',
|
||||
email,
|
||||
|
@ -94,12 +93,9 @@ export function createAccount() {
|
|||
if (responseData.hasOwnProperty('dictionary')) {
|
||||
uploadWholeDictionary(); // Saves external id
|
||||
}
|
||||
return responseData;
|
||||
}, errorData => {
|
||||
errorHTML += `<p class="bold red">${errorData}</p>`;
|
||||
return errorData;
|
||||
}).then(responseData => {
|
||||
console.log(responseData);
|
||||
errorHTML += `<p class="bold red">${errorData}</p>`;
|
||||
}).then(() => {
|
||||
createAccountErrorMessages.innerHTML = errorHTML;
|
||||
if (errorHTML === '') {
|
||||
const loginModal = document.getElementById('loginModal');
|
||||
|
|
|
@ -16,7 +16,6 @@ export function dictionaryIsDefault() {
|
|||
delete currentDictionary.lastUpdated;
|
||||
delete currentDictionary.createdOn;
|
||||
delete currentDictionary.version;
|
||||
console.log(JSON.stringify(defaultDictionary) === JSON.stringify(currentDictionary));
|
||||
return JSON.stringify(defaultDictionary) === JSON.stringify(currentDictionary);
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ export function deleteDictionary() {
|
|||
export function confirmDeleteDictionary() {
|
||||
if (confirm(`Are you sure you want to delete your ${window.currentDictionary.name} ${window.currentDictionary.specification}?\n\nThis cannot be undone!`)) {
|
||||
const input = prompt(`If you really want to delete your ${window.currentDictionary.name} ${window.currentDictionary.specification} please type DELETE in the text box.\n\nAfter you confirm, cour dicitonary will be PERMANENTLY AND IRRETRIEVABLY DESTROYED!`);
|
||||
console.log(input);
|
||||
|
||||
if (input === 'DELETE') {
|
||||
deleteDictionary();
|
||||
document.getElementById('editModal').style.display = 'none';
|
||||
|
|
|
@ -62,7 +62,7 @@ export function hotKeyActions(event) {
|
|||
|
||||
function toggleDetailsDisplay() {
|
||||
const activeTab = document.querySelector('#detailsSection nav li.active');
|
||||
console.log(activeTab);
|
||||
|
||||
Array.from(document.querySelectorAll('#detailsSection nav li')).forEach(li => li.classList.remove('active'));
|
||||
if (activeTab) {
|
||||
switch(activeTab.innerText.trim().toLowerCase()) {
|
||||
|
@ -110,8 +110,6 @@ function maximizeTextarea() {
|
|||
const focused = document.activeElement;
|
||||
if (focused) {
|
||||
const maximizeButton = focused.parentElement.querySelector('.maximize-button');
|
||||
console.log(maximizeButton);
|
||||
console.log(maximizeButton.parentElement);
|
||||
if (maximizeButton) {
|
||||
renderMaximizedTextbox(maximizeButton);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ export function goToPage(page) {
|
|||
window.currentPage = parseFloat(page);
|
||||
|
||||
Array.from(document.getElementsByClassName('pagination')).forEach(pagination => {
|
||||
console.log('setting loader');
|
||||
pagination.innerHTML = `<span class="loader">Loading Page ${window.currentPage + 1}...</span>`;
|
||||
});
|
||||
|
||||
|
|
|
@ -330,7 +330,6 @@ export function renderIPATable(ipaTableButton) {
|
|||
|
||||
export function renderMaximizedTextbox(maximizeButton) {
|
||||
maximizeButton = typeof maximizeButton.target === 'undefined' || maximizeButton.target === '' ? maximizeButton : maximizeButton.target;
|
||||
console.log(maximizeButton.parentElement);
|
||||
const label = maximizeButton.parentElement.innerText.replace(/(\*|Maximize)/g, '').trim();
|
||||
const textBox = maximizeButton.parentElement.querySelector('textarea');
|
||||
const modalElement = document.createElement('section');
|
||||
|
|
|
@ -30,7 +30,6 @@ export function getSearchFilters() {
|
|||
const partsOfSpeech = document.querySelectorAll('#searchPartsOfSpeech input[type="checkbox"]');
|
||||
let checkedBoxes = 0;
|
||||
Array.from(partsOfSpeech).forEach(partOfSpeech => {
|
||||
// console.log('partOfSpeech Inner Text:', partOfSpeech.parentElement.innerText);
|
||||
const partOfSpeechLabel = partOfSpeech.parentElement.innerText.trim();
|
||||
filters.partsOfSpeech[partOfSpeechLabel] = partOfSpeech.checked;
|
||||
if (partOfSpeech.checked) checkedBoxes++;
|
||||
|
|
|
@ -93,13 +93,10 @@ function setupEditFormTabs() {
|
|||
function setupEditFormInteractions() {
|
||||
const preventDuplicatesBox = document.getElementById('editPreventDuplicates');
|
||||
preventDuplicatesBox.addEventListener('change', () => {
|
||||
console.log('changed');
|
||||
const caseSensitiveBox = document.getElementById('editCaseSensitive');
|
||||
if (preventDuplicatesBox.checked) {
|
||||
console.log('checked');
|
||||
caseSensitiveBox.disabled = false;
|
||||
} else {
|
||||
console.log('unchecked');
|
||||
caseSensitiveBox.disabled = true;
|
||||
caseSensitiveBox.checked = false;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ export function getSearchFilters() {
|
|||
const partsOfSpeech = document.querySelectorAll('#searchPartsOfSpeech input[type="checkbox"]');
|
||||
let checkedBoxes = 0;
|
||||
Array.from(partsOfSpeech).forEach(partOfSpeech => {
|
||||
// console.log('partOfSpeech Inner Text:', partOfSpeech.parentElement.innerText);
|
||||
const partOfSpeechLabel = partOfSpeech.parentElement.innerText.trim();
|
||||
filters.partsOfSpeech[partOfSpeechLabel] = partOfSpeech.checked;
|
||||
if (partOfSpeech.checked) checkedBoxes++;
|
||||
|
|
|
@ -144,6 +144,7 @@ export function deleteWord(wordId) {
|
|||
const wordIndex = window.currentDictionary.words.findIndex(word => word.wordId === wordId);
|
||||
if (wordIndex < 0) {
|
||||
console.error('Could not find word to delete');
|
||||
addMessage('Could not find word to delete. Please refresh your browser and try again.', 10000, 'error');
|
||||
} else {
|
||||
window.currentDictionary.words.splice(wordIndex, 1);
|
||||
addMessage('Word Deleted Successfully');
|
||||
|
@ -162,6 +163,7 @@ export function updateWord(word, wordId) {
|
|||
|
||||
if (wordIndex < 0) {
|
||||
console.error('Could not find word to update');
|
||||
addMessage('Could not find word to update. Please refresh your browser and try again.', 10000, 'error');
|
||||
} else {
|
||||
word.lastUpdated = getTimestampInSeconds();
|
||||
word.createdOn = window.currentDictionary.words[wordIndex].createdOn;
|
||||
|
@ -179,7 +181,6 @@ export function updateWord(word, wordId) {
|
|||
|
||||
export function confirmEditWord(id) {
|
||||
const wordId = typeof id.target !== 'undefined' ? parseInt(this.id.replace('editWordButton_', '')) : id;
|
||||
console.log(wordId);
|
||||
const name = document.getElementById('wordName_' + wordId).value,
|
||||
pronunciation = document.getElementById('wordPronunciation_' + wordId).value,
|
||||
partOfSpeech = document.getElementById('wordPartOfSpeech_' + wordId).value,
|
||||
|
@ -217,6 +218,7 @@ export function confirmDeleteWord(wordId) {
|
|||
|
||||
if (!word) {
|
||||
console.error('Something went wrong! Couldn\'t find word with id of ' + wordId);
|
||||
addMessage('Could not find word to delete. Please refresh your browser and try again.', 10000, 'error');
|
||||
} else {
|
||||
if (confirm(`Are you sure you want to delete "${word.name}"?`)) {
|
||||
if (confirm(`Just to double-check:\nDo you really want to delete "${word.name}"?\n\nYou won't be able to undo it!`)) {
|
||||
|
|
|
@ -2,12 +2,4 @@ $font: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubunt
|
|||
|
||||
$header-height: 60px;
|
||||
|
||||
// $dark: #bababa;
|
||||
// $mid: #dedede;
|
||||
// $light: #efefef;
|
||||
// $white: #ffffff;
|
||||
|
||||
// $red: #d42932;
|
||||
|
||||
// $border: 1px solid $dark;
|
||||
$general-padding: 20px;
|
|
@ -1,2 +0,0 @@
|
|||
// https://parceljs.org/code_splitting.html
|
||||
export function aaa () {console.log('aaa');};
|
Loading…
Reference in New Issue