Remove unneeded console logs and code

This commit is contained in:
Robbie Antenesse 2019-06-10 12:39:45 -06:00
parent 0d18722c83
commit c1327b337d
13 changed files with 7 additions and 30 deletions

View File

@ -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);
}

View File

@ -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');

View File

@ -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);
}

View File

@ -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';

View File

@ -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);
}

View File

@ -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>`;
});

View File

@ -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');

View File

@ -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++;

View File

@ -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;
}

View File

@ -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++;

View File

@ -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!`)) {

View File

@ -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;

View File

@ -1,2 +0,0 @@
// https://parceljs.org/code_splitting.html
export function aaa () {console.log('aaa');};