Update sql types; Add html input maxlength

This commit is contained in:
Robbie Antenesse 2019-05-17 11:39:00 -06:00
parent b6e6390dde
commit 502065b08a
4 changed files with 43 additions and 40 deletions

View File

@ -81,17 +81,17 @@
<div id="mobileWordFormShow">+</div>
<form id="wordForm">
<label>Word<span class="red">*</span><br>
<input id="wordName">
<input id="wordName" maxlength="200">
</label>
<label>Pronunciation<a class="label-button ipa-table-button">IPA Chart</a><br>
<input id="wordPronunciation" class="ipa-field"><br>
<input id="wordPronunciation" class="ipa-field" maxlength="200"><br>
<a class="label-help-button ipa-field-help-button">Field Help</a>
</label>
<label>Part of Speech<br>
<select id="wordPartOfSpeech" class="part-of-speech-select"></select>
</label>
<label>Definition<span class="red">*</span><br>
<input id="wordDefinition" placeholder="Equivalent words">
<input id="wordDefinition" maxlength="2500" placeholder="Equivalent words">
</label>
<label>Details<span class="red">*</span><a class="label-button maximize-button">Maximize</a><br>
<textarea id="wordDetails" placeholder="Markdown formatting allowed"></textarea>
@ -193,10 +193,10 @@
</nav>
<section id="editDescriptionTab">
<label>Name<br>
<input id="editName">
<input id="editName" maxlength="50">
</label>
<label>Specification<br>
<input id="editSpecification">
<input id="editSpecification" maxlength="50">
</label>
<label>Description<a class="label-button maximize-button">Maximize</a><br>
<textarea id="editDescription"></textarea>
@ -205,7 +205,7 @@
<section id="editDetailsTab" style="display:none;">
<label>Parts of Speech <small>(Comma Separated List)</small><br>
<input id="editPartsOfSpeech">
<input id="editPartsOfSpeech" maxlength="2500" placeholder="Noun,Adjective,Verb">
</label>
<label>Alphabetical Order <small>(Comma Separated List. Include every letter!)</small><br>
<input id="editAlphabeticalOrder" disabled value="English Alphabet">
@ -215,7 +215,7 @@
<div>
<label>Consonants<br>
<small>(Space separated list)</small><br>
<input id="editConsonants" class="ipa-field" placeholder="p b m n t ..."><br>
<input id="editConsonants" class="ipa-field" maxlength="100" placeholder="p b m n t ..."><br>
<a class="label-help-button ipa-field-help-button">Field Help</a>
<a class="label-button ipa-table-button">IPA Chart</a>
</label>
@ -223,7 +223,7 @@
<div>
<label>Vowels<br>
<small>(Space separated list)</small><br>
<input id="editVowels" class="ipa-field" placeholder="æ u e ɪ ..."><br>
<input id="editVowels" class="ipa-field" maxlength="100" placeholder="æ u e ɪ ..."><br>
<a class="label-help-button ipa-field-help-button">Field Help</a>
<a class="label-button ipa-table-button">IPA Chart</a>
</label>
@ -231,7 +231,7 @@
<div>
<label>Polyphthongs&nbsp;/ Blends<br>
<small>(Space separated list)</small><br>
<input id="editBlends" class="ipa-field" placeholder="ai ou ue ..."><br>
<input id="editBlends" class="ipa-field" maxlength="100" placeholder="ai ou ue ..."><br>
<a class="label-help-button ipa-field-help-button">Field Help</a>
<a class="label-button ipa-table-button">IPA Chart</a>
</label>
@ -241,29 +241,32 @@
<div class="split three">
<div>
<label>Onset<br>
<input id="editOnset">
<small>(Comma separated list)</small><br>
<input id="editOnset" maxlength="100" placeholder="Consonants,Vowels">
</label>
</div>
<div>
<label>Nucleus<br>
<input id="editNucleus">
<small>(Comma separated list)</small><br>
<input id="editNucleus" maxlength="100" placeholder="Vowels,Blends">
</label>
</div>
<div>
<label>Coda<br>
<input id="editCoda">
<small>(Comma separated list)</small><br>
<input id="editCoda" maxlength="100" placeholder="Any">
</label>
</div>
</div>
<label>Exceptions<br>
<label>Exceptions <small>(Markdown-enabled)</small><br>
<textarea id="editExceptions"></textarea>
</label>
<h3>Orthography</h3>
<label>Notes<a class="label-button maximize-button">Maximize</a><br>
<label>Notes <small>(Markdown-enabled)</small><a class="label-button maximize-button">Maximize</a><br>
<textarea id="editOrthography"></textarea>
</label>
<h3>Grammar</h3>
<label>Notes<a class="label-button maximize-button">Maximize</a><br>
<label>Notes <small>(Markdown-enabled)</small><a class="label-button maximize-button">Maximize</a><br>
<textarea id="editGrammar"></textarea>
</label>
</section>

View File

@ -11,10 +11,10 @@ export function renderLoginForm() {
<div>
<h2>Log In</h2>
<label>Email<br>
<input type="email" required id="loginEmail">
<input type="email" required id="loginEmail" maxlength="100">
</label>
<label>Password<br>
<input type="password" required id="loginPassword">
<input type="password" required id="loginPassword" maxlength="100">
</label>
<section id="loginErrorMessages"></section>
<a id="loginSubmit" class="button">Log In</a><br>
@ -26,16 +26,16 @@ export function renderLoginForm() {
<p>Plus if you allow us to send you emails, we'll make sure that you're the first to hear about any new features that get added or if any of our policies change for any reason. We'll never spam you or sell your information.</p>
<p>By creating an account, you are indicating that you agree to the Terms of Service and that you understand Lexiconga's Privacy Policy.</p>
<label>Email<br>
<input type="email" id="createNewEmail">
<input type="email" id="createNewEmail" maxlength="100">
</label>
<label>Password<br>
<input type="password" id="createNewPassword">
<input type="password" id="createNewPassword" maxlength="100">
</label>
<label>Confirm Password<br>
<input type="password" id="createNewConfirm">
<input type="password" id="createNewConfirm" maxlength="100">
</label>
<label>Public Name<br>
<input type="text" id="createNewPublicName">
<input type="text" id="createNewPublicName" maxlength="50">
</label>
<label>Allow Emails
<input type="checkbox" id="createNewAllowEmails">

View File

@ -244,15 +244,15 @@ export function renderEditForm(wordId = false) {
const word = window.currentDictionary.words.find(w => w.wordId === wordId);
if (word) {
const ipaPronunciationField = `<label>Pronunciation<a class="label-button ipa-table-button">IPA Chart</a><br>
<input id="wordPronunciation_${wordId}" class="ipa-field" value="${word.pronunciation}"><br>
<input id="wordPronunciation_${wordId}" class="ipa-field" maxlength="200" value="${word.pronunciation}"><br>
<a class="label-help-button ipa-field-help-button">Field Help</a>
</label>`;
const plainPronunciationField = `<label>Pronunciation<br>
<input id="wordPronunciation_${wordId}" value="${word.pronunciation}">
<input id="wordPronunciation_${wordId}" maxlength="200" value="${word.pronunciation}">
</label>`;
const editForm = `<form id="editForm_${wordId}" class="edit-form">
<label>Word<span class="red">*</span><br>
<input id="wordName_${wordId}" value="${word.name}">
<input id="wordName_${wordId}" maxlength="200" value="${word.name}">
</label>
${window.settings.useIPAPronunciationField ? ipaPronunciationField : plainPronunciationField}
<label>Part of Speech<br>
@ -261,7 +261,7 @@ export function renderEditForm(wordId = false) {
</select>
</label>
<label>Definition<span class="red">*</span><br>
<input id="wordDefinition_${wordId}" value="${word.definition}" placeholder="Equivalent words">
<input id="wordDefinition_${wordId}" maxlength="2500" value="${word.definition}" placeholder="Equivalent words">
</label>
<label>Details<span class="red">*</span><a class="label-button maximize-button">Maximize</a><br>
<textarea id="wordDetails_${wordId}" placeholder="Markdown formatting allowed">${word.details}</textarea>

View File

@ -10,9 +10,9 @@ CREATE TABLE IF NOT EXISTS `deleted_words` (
CREATE TABLE IF NOT EXISTS `dictionaries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` int(11) NOT NULL,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'New',
`specification` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Dictionary',
`description` text COLLATE utf8_unicode_ci NOT NULL DEFAULT 'A new dicitonary.' COMMENT 'Markdown',
`name` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'New',
`specification` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Dictionary',
`description` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Markdown. Default: "A new dictionary."',
`allow_duplicates` tinyint(1) NOT NULL DEFAULT 0,
`case_sensitive` tinyint(1) NOT NULL DEFAULT 0,
`sort_by_definition` tinyint(1) NOT NULL DEFAULT 0,
@ -33,16 +33,16 @@ DELIMITER ;
CREATE TABLE IF NOT EXISTS `dictionary_linguistics` (
`dictionary` int(11) NOT NULL,
`parts_of_speech` text NOT NULL DEFAULT '' COMMENT 'JSON array',
`consonants` text NOT NULL DEFAULT '' COMMENT 'JSON array',
`vowels` text NOT NULL DEFAULT '' COMMENT 'JSON array',
`blends` text NOT NULL DEFAULT '' COMMENT 'JSON array',
`onset` text NOT NULL DEFAULT '' COMMENT 'JSON array',
`nucleus` text NOT NULL DEFAULT '' COMMENT 'JSON array',
`coda` text NOT NULL DEFAULT '' COMMENT 'JSON array',
`exceptions` text NOT NULL DEFAULT '' COMMENT 'Markdown',
`orthography_notes` text NOT NULL DEFAULT '' COMMENT 'Markdown',
`grammar_notes` text NOT NULL DEFAULT '' COMMENT 'Markdown',
`parts_of_speech` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Comma-separated',
`consonants` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Space-separated',
`vowels` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Space-separated',
`blends` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Space-separated',
`onset` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Comma-separated',
`nucleus` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Comma-separated',
`coda` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Comma-separated',
`exceptions` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Markdown',
`orthography_notes` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Markdown',
`grammar_notes` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Markdown',
UNIQUE KEY `dictionary` (`dictionary`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -80,8 +80,8 @@ CREATE TABLE IF NOT EXISTS `words` (
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`pronunciation` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`part_of_speech` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`definition` text COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`details` text COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Markdown',
`definition` text COLLATE utf8_unicode_ci NOT NULL,
`details` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Markdown',
`last_updated` int(11) DEFAULT NULL,
`created_on` int(11) NOT NULL,
UNIQUE KEY `unique_index` (`dictionary`,`word_id`)