Compare commits
No commits in common. "65cf421cbed0b0fb8244bbbc5404fc4ead7d6237" and "981490473f98f34b0630d226b68772b17baf465f" have entirely different histories.
65cf421cbe
...
981490473f
|
@ -4,9 +4,6 @@ This is the light-as-possible rewrite of Lexiconga.
|
|||
|
||||
## Installation
|
||||
|
||||
0. Some dev tools require build tools.
|
||||
- On Windows, install them with `npm install --global windows-build-tools`.
|
||||
- Alternatively, you can just install the newest Python and Visual Studio (with Desktop C++ devkit).
|
||||
1. Clone and run `yarn` and `composer install` to install dependencies.
|
||||
1. Import `src/structure.sql` into a database called 'lexiconga' on your MariaDB server to get the database structure.
|
||||
1. Copy `src/php/api/config.php.changeme` to `src/php/api/config.php` and update the values within to enable connections to your lexiconga database.
|
||||
|
|
35
ads.json
35
ads.json
|
@ -23,7 +23,7 @@
|
|||
"cta": "Learn to Play for Free!",
|
||||
"link": "https://guts.plus",
|
||||
"start": "June 1, 2019",
|
||||
"end": "December 31, 2099",
|
||||
"end": "March 1, 2020",
|
||||
"isPriority": false
|
||||
},
|
||||
{
|
||||
|
@ -32,34 +32,25 @@
|
|||
"cta": "Use RedFlag for Free",
|
||||
"link": "https://redflag.ga",
|
||||
"start": "June 1, 2019",
|
||||
"end": "December 31, 2099",
|
||||
"end": "January 1, 2020",
|
||||
"isPriority": false
|
||||
},
|
||||
{
|
||||
"header": "Looking for a New Book to Read?",
|
||||
"body": "Be among the first to crack open a great new fantasy world with The Legends of the Shattered Lands. Book 1 and 2 available now!",
|
||||
"cta": "Shop Now",
|
||||
"link": "https://amazon.com/S-S-Grove/e/B074SX2GYW",
|
||||
"start": "January 24, 2020",
|
||||
"end": "January 24, 2021",
|
||||
"header": "Get Theonite: Planet Adyn free!",
|
||||
"body": "\"This book is the superhero fantasy you didn't know you needed. Magic, Afrofuturism, and heart-pumping suspense - this book has it all!\" - WeReadFantasy.com",
|
||||
"cta": "Read Free Now",
|
||||
"link": "https://mailchi.mp/ce525124aec3/theonite-planet-adyn-free-copy",
|
||||
"start": "June 1, 2019",
|
||||
"end": "January 1, 2020",
|
||||
"isPriority": false
|
||||
},
|
||||
{
|
||||
"header": "Like the GUTS+ System?",
|
||||
"body": "Help contribute to the ongoing development of the GUTS+ System by buying the new, nicely-formatted PDF rule book! With imagery and some exclusive content, this is the best way to learn to play!",
|
||||
"header": "The Sword of Kaigen: A Theonite War Story",
|
||||
"body": "\"Fantasy and martial arts aficionados alike should enjoy this emotionally supercharged novel... which pierces readers' hearts with the precision of a samurai's razor-sharp blade.\" - Blue Ink Review",
|
||||
"cta": "Buy Now",
|
||||
"link": "https://alamantus.itch.io/guts-plus",
|
||||
"start": "December 4, 2019",
|
||||
"end": "July 1, 2020",
|
||||
"isPriority": false
|
||||
},
|
||||
{
|
||||
"header": "Like the GUTS+ System?",
|
||||
"body": "Help contribute to the ongoing development of the GUTS+ System by buying the new, nicely-formatted PDF rule book! With imagery and some exclusive content, this is the best way to learn to play!",
|
||||
"cta": "Buy Now",
|
||||
"link": "https://www.drivethrurpg.com/product/273132/The-GUTS-System-Core-Rule-Book-PDF",
|
||||
"start": "December 4, 2019",
|
||||
"end": "July 1, 2020",
|
||||
"link": "https://www.amazon.com/Sword-Kaigen-Theonite-War-Story/dp/172019386X/",
|
||||
"start": "June 1, 2019",
|
||||
"end": "January 1, 2020",
|
||||
"isPriority": false
|
||||
}
|
||||
]
|
16
package.json
16
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "lexiconga",
|
||||
"version": "2.1.7",
|
||||
"version": "2.1.3",
|
||||
"description": "The quick and easy dictionary builder for constructed languages.",
|
||||
"main": "template-index.html",
|
||||
"repository": "https://github.com/Alamantus/Lexiconga.git",
|
||||
|
@ -21,19 +21,19 @@
|
|||
"clear-cache": "rimraf .cache/{*,.*}"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^9.7.4",
|
||||
"concurrently": "^5.2.0",
|
||||
"autoprefixer": "^9.6.1",
|
||||
"concurrently": "^4.1.1",
|
||||
"cpx": "^1.5.0",
|
||||
"parcel-bundler": "^1.12.3",
|
||||
"parcel-plugin-goodie-bag": "^2.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"sass": "^1.26.5",
|
||||
"sharp": "^0.25.2"
|
||||
"rimraf": "^2.6.3",
|
||||
"sass": "^1.22.4",
|
||||
"sharp": "^0.22.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"marked": "^1.0.0",
|
||||
"marked": "^0.6.3",
|
||||
"normalize.css": "^8.0.1",
|
||||
"papaparse": "^5.1.1",
|
||||
"papaparse": "^4.6.3",
|
||||
"upup": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ export const DEFAULT_DICTIONARY = {
|
|||
partOfSpeech: '',
|
||||
definition: '',
|
||||
details: '',
|
||||
etymology: [],
|
||||
wordId: 0
|
||||
}, */
|
||||
],
|
||||
|
@ -55,7 +54,6 @@ export const DEFAULT_DICTIONARY = {
|
|||
export const DEFAULT_SETTINGS = {
|
||||
useIPAPronunciationField: true,
|
||||
useHotkeys: true,
|
||||
showAdvanced: false,
|
||||
defaultTheme: 'default',
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<p>
|
||||
<em>Hover over characters to see their Phondue shortcuts. Use Field Help to show full Phondue instructions.</em>
|
||||
<em>Hover over characters to see their Phondue shortcuts.</em>
|
||||
</p>
|
||||
<table className='table is-bordered'>
|
||||
<thead>
|
||||
|
@ -583,9 +583,6 @@
|
|||
<th id='cell_9_9' class='td-lbl' colspan="7">
|
||||
Diacritics
|
||||
</th>
|
||||
<th id='cell_9_10' class='td-lbl' colspan="1">
|
||||
Tones
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -650,42 +647,35 @@
|
|||
<td id='cell_10_13' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_10_14' class='td-btn'>
|
||||
<button title='O_ o_ _O _o'>
|
||||
<button title=''>
|
||||
̥
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_15' class='td-btn'>
|
||||
<button title='U_ u_ _U _u'>
|
||||
<button title=''>
|
||||
̬
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_16' class='td-btn'>
|
||||
<button title=':_ _:'>
|
||||
<button title=''>
|
||||
̤
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_17' class='td-btn'>
|
||||
<button title='~_ _~'>
|
||||
<button title=''>
|
||||
̰
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_18' class='td-btn'>
|
||||
<button title='_|'>
|
||||
<button title=''>
|
||||
̩
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_19' class='td-btn'>
|
||||
<button title='^_ _^'>
|
||||
<button title=''>
|
||||
̯
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_20' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_10_21' class='td-btn'>
|
||||
<button title='5|'>
|
||||
˥
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id='cell_11_0' class='td-lbl' colspan="1">
|
||||
|
@ -739,42 +729,35 @@
|
|||
<td id='cell_11_13' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_11_14' class='td-btn'>
|
||||
<button title='[_ _['>
|
||||
<button title=''>
|
||||
̪
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_11_15' class='td-btn'>
|
||||
<button title='{_ _{'>
|
||||
<button title=''>
|
||||
̼
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_11_16' class='td-btn'>
|
||||
<button title=']_ _]'>
|
||||
<button title=''>
|
||||
̺
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_11_17' class='td-btn'>
|
||||
<button title='#_ _# []'>
|
||||
<button title=''>
|
||||
̻
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_11_18' class='td-btn'>
|
||||
<button title='h^ ^h'>
|
||||
<button title=''>
|
||||
ʰ
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_11_19' class='td-btn'>
|
||||
<button title='>^ ^>'>
|
||||
<button title=''>
|
||||
̚
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_20' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_10_21' class='td-btn'>
|
||||
<button title='4|'>
|
||||
˦
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id='cell_12_0' class='td-lbl' colspan="1">
|
||||
|
@ -837,42 +820,35 @@
|
|||
<td id='cell_12_13' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_12_14' class='td-btn'>
|
||||
<button title='+_ _+'>
|
||||
<button title=''>
|
||||
̟
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_12_15' class='td-btn'>
|
||||
<button title='__'>
|
||||
<button title=''>
|
||||
̠
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_12_16' class='td-btn'>
|
||||
<button title=':^ ^:'>
|
||||
<button title=''>
|
||||
̈
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_12_17' class='td-btn'>
|
||||
<button title='x^ ^x'>
|
||||
<button title=''>
|
||||
̽
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_12_18' class='td-btn'>
|
||||
<button title="'-_ -'_">
|
||||
<button title=''>
|
||||
̝
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_12_19' class='td-btn'>
|
||||
<button title=',-_ -,_'>
|
||||
<button title=''>
|
||||
̞
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_20' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_10_21' class='td-btn'>
|
||||
<button title='3|'>
|
||||
˧
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id='cell_13_0' class='td-lbl' colspan="1">
|
||||
|
@ -901,7 +877,7 @@
|
|||
</button>
|
||||
</td>
|
||||
<td id='cell_13_9' class='td-btn'>
|
||||
<button title="')">
|
||||
<button title='")'>
|
||||
ʼ
|
||||
</button>
|
||||
</td>
|
||||
|
@ -920,45 +896,40 @@
|
|||
<td id='cell_13_13' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_13_14' class='td-btn'>
|
||||
<button title='w^ ^w'>
|
||||
<button title=''>
|
||||
ʷ
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_13_15' class='td-btn'>
|
||||
<button title='j^ ^j'>
|
||||
<button title=''>
|
||||
ʲ
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_13_16' class='td-btn'>
|
||||
<button title='h/^'>
|
||||
<button title=''>
|
||||
ᶣ
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_13_17' class='td-btn'>
|
||||
<button title='vO^ v0^'>
|
||||
<button title=''>
|
||||
ᶹ
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_13_18' class='td-btn'>
|
||||
<button title='XO^'>
|
||||
<button title=''>
|
||||
ˠ
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_13_19' class='td-btn'>
|
||||
<button title='?/^'>
|
||||
<button title=''>
|
||||
ˤ
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_13_20' class='td-btn'>
|
||||
<button title='~^ ^~'>
|
||||
<button title=''>
|
||||
̴
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_21' class='td-btn'>
|
||||
<button title='2|'>
|
||||
˨
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id='cell_14_0' class='td-lbl' colspan="1">
|
||||
|
@ -1021,42 +992,35 @@
|
|||
<td id='cell_14_13' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_14_14' class='td-btn'>
|
||||
<button title=')_ _)'>
|
||||
<button title=''>
|
||||
̹
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_14_15' class='td-btn'>
|
||||
<button title='(_ _('>
|
||||
<button title=''>
|
||||
̜
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_14_16' class='td-btn'>
|
||||
<button title='<|_ |<_'>
|
||||
<button title=''>
|
||||
̘
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_14_17' class='td-btn'>
|
||||
<button title='>|_ |>_'>
|
||||
<button title=''>
|
||||
̙
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_14_18' class='td-btn'>
|
||||
<button title='~^ ^~'>
|
||||
<button title=''>
|
||||
̃
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_14_19' class='td-btn'>
|
||||
<button title='>r r>'>
|
||||
<button title=''>
|
||||
˞
|
||||
</button>
|
||||
</td>
|
||||
<td id='cell_10_20' class='td-lbl'>
|
||||
</td>
|
||||
<td id='cell_10_21' class='td-btn'>
|
||||
<button title='1|'>
|
||||
˩
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id='cell_15_0' class='td-lbl' colspan="1">
|
||||
|
@ -1147,7 +1111,7 @@
|
|||
Suprasegmental
|
||||
</th>
|
||||
<td id='cell_16_12' class='td-btn'>
|
||||
<button title="''">
|
||||
<button title='""'>
|
||||
ˈ
|
||||
</button>
|
||||
</td>
|
||||
|
@ -1167,7 +1131,7 @@
|
|||
</button>
|
||||
</td>
|
||||
<td id='cell_16_16' class='td-btn'>
|
||||
<button title='u^ ^u'>
|
||||
<button title=''>
|
||||
̆
|
||||
</button>
|
||||
</td>
|
||||
|
|
|
@ -174,11 +174,10 @@ export function syncWords(remoteWords, deletedWords) {
|
|||
}
|
||||
|
||||
remoteWords.forEach(remoteWord => {
|
||||
const localWordIndex = words.findIndex(word => word.wordId === remoteWord.wordId);
|
||||
const localWord = words[localWordIndex];
|
||||
let localWord = words.find(word => word.wordId === remoteWord.wordId);
|
||||
if (localWord) {
|
||||
if (localWord.lastUpdated < remoteWord.lastUpdated) {
|
||||
words[localWordIndex] = remoteWord;
|
||||
localWord = remoteWord;
|
||||
} else if (localWord.lastUpdated > remoteWord.lastUpdated) {
|
||||
// Add more-recently-updated words to upload
|
||||
localWordsToUpload.push(localWord);
|
||||
|
|
|
@ -237,7 +237,7 @@ export function importWords() {
|
|||
console.error('Error Importing Word: ', err)
|
||||
});
|
||||
} else {
|
||||
const row = results.data;
|
||||
const row = results.data[0];
|
||||
const importedWord = addWord({
|
||||
name: removeTags(row.word).trim(),
|
||||
pronunciation: removeTags(row.pronunciation).trim(),
|
||||
|
|
|
@ -60,7 +60,7 @@ export function renderDetails() {
|
|||
const consonantHTML = `<p><strong>Consonants</strong><br>${consonants.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const vowelHTML = `<p><strong>Vowels</strong><br>${vowels.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const blendHTML = blends.length > 0 ? `<p><strong>Polyphthongs / Blends</strong><br>${blends.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>` : '';
|
||||
const phonologyNotesHTML = phonology.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(parseReferences(removeTags(phonology.notes))) + '</div>' : '';
|
||||
const phonologyNotesHTML = phonology.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(removeTags(phonology.notes)) + '</div>' : '';
|
||||
const phonologyHTML = `<h2>Phonology</h2>
|
||||
<div class="split two">
|
||||
<div>${consonantHTML}</div>
|
||||
|
@ -73,7 +73,7 @@ export function renderDetails() {
|
|||
const onsetHTML = `<p><strong>Onset</strong><br>${onset.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const nucleusHTML = `<p><strong>Nucleus</strong><br>${nucleus.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const codaHTML = `<p><strong>Coda</strong><br>${coda.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const phonotacticsNotesHTML = phonotactics.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(parseReferences(removeTags(phonotactics.notes))) + '</div>' : '';
|
||||
const phonotacticsNotesHTML = phonotactics.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(removeTags(phonotactics.notes)) + '</div>' : '';
|
||||
const phonotacticsHTML = onset.length + nucleus.length + coda.length + phonotacticsNotesHTML.length > 0
|
||||
? `<h2>Phonotactics</h2>
|
||||
${onset.length > 0 || nucleus.length > 0 || coda.length > 0
|
||||
|
@ -93,14 +93,14 @@ export function renderDetails() {
|
|||
}
|
||||
return false;
|
||||
}).filter(html => html !== false).join(' ')}</p>` : '';
|
||||
const orthographyNotesHTML = orthography.notes.trim().length > 0 ? '<p><strong>Notes</strong><br>' + md(parseReferences(removeTags(orthography.notes))) + '</div>' : '';
|
||||
const orthographyNotesHTML = orthography.notes.trim().length > 0 ? '<p><strong>Notes</strong><br>' + md(removeTags(orthography.notes)) + '</div>' : '';
|
||||
const orthographyHTML = translations.length + orthographyNotesHTML.length > 0
|
||||
? `<h2>Orthography</h2>
|
||||
${translationsHTML}
|
||||
${orthographyNotesHTML}`
|
||||
: '';
|
||||
const grammarHTML = grammar.notes.trim().length > 0 ? '<h2>Grammar</h2><div>'
|
||||
+ (grammar.notes.trim().length > 0 ? md(parseReferences(removeTags(grammar.notes))) : '')
|
||||
+ (grammar.notes.trim().length > 0 ? md(removeTags(grammar.notes)) : '')
|
||||
+ '</div>' : '';
|
||||
|
||||
detailsPanel.innerHTML = generalHTML + phonologyHTML + phonotacticsHTML + orthographyHTML + grammarHTML;
|
||||
|
|
|
@ -160,10 +160,8 @@ export function renderEditForm(wordId = false) {
|
|||
<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>
|
||||
</label>
|
||||
<label>
|
||||
<a id="expandAdvancedForm_${wordId}" class="small button expand-advanced-form">${window.settings.showAdvanced ? 'Hide' : 'Show'} Advanced Fields</a>
|
||||
</label>
|
||||
<div id="advancedForm_${wordId}" class="advanced-word-form" style="display:${window.settings.showAdvanced ? 'block' : 'none'};">
|
||||
<a id="expandAdvancedForm_${wordId}" class="expand-advanced-form">Show Advanced</a>
|
||||
<div id="advancedForm_${wordId}" class="advanced-word-form" style="display:none;">
|
||||
<label>Etymology / Root Words<br>
|
||||
<input id="wordEtymology_${wordId}" maxlength="2500" placeholder="comma,separated,root,words" value="${word.hasOwnProperty('etymology') ? word.etymology : ''}">
|
||||
</label>
|
||||
|
|
|
@ -9,7 +9,6 @@ export function loadSettings() {
|
|||
const storedSettings = window.localStorage.getItem(SETTINGS_KEY);
|
||||
window.settings = storedSettings ? JSON.parse(storedSettings) : cloneObject(DEFAULT_SETTINGS);
|
||||
toggleIPAPronunciationFields(false);
|
||||
toggleShowAdvancedFields();
|
||||
}
|
||||
|
||||
export function saveSettings() {
|
||||
|
@ -18,11 +17,10 @@ export function saveSettings() {
|
|||
}
|
||||
|
||||
export function openSettingsModal() {
|
||||
const { useIPAPronunciationField, useHotkeys, showAdvanced, defaultTheme } = window.settings;
|
||||
const { useIPAPronunciationField, useHotkeys, defaultTheme } = window.settings;
|
||||
|
||||
document.getElementById('settingsUseIPA').checked = useIPAPronunciationField;
|
||||
document.getElementById('settingsUseHotkeys').checked = useHotkeys;
|
||||
document.getElementById('settingsShowAdvanced').checked = showAdvanced;
|
||||
document.getElementById('settingsDefaultTheme').value = defaultTheme;
|
||||
|
||||
document.getElementById('settingsModal').style.display = '';
|
||||
|
@ -32,7 +30,6 @@ export function saveSettingsModal() {
|
|||
const updatedSettings = cloneObject(window.settings);
|
||||
updatedSettings.useIPAPronunciationField = document.getElementById('settingsUseIPA').checked;
|
||||
updatedSettings.useHotkeys = document.getElementById('settingsUseHotkeys').checked;
|
||||
updatedSettings.showAdvanced = document.getElementById('settingsShowAdvanced').checked;
|
||||
updatedSettings.defaultTheme = document.getElementById('settingsDefaultTheme').value;
|
||||
|
||||
if (hasToken()) {
|
||||
|
@ -65,7 +62,6 @@ export function saveSettingsModal() {
|
|||
saveSettings();
|
||||
toggleHotkeysEnabled();
|
||||
toggleIPAPronunciationFields();
|
||||
toggleShowAdvancedFields();
|
||||
} else {
|
||||
addMessage('No changes made to Settings.');
|
||||
}
|
||||
|
@ -105,30 +101,3 @@ export function toggleIPAPronunciationFields(render = true) {
|
|||
renderWords();
|
||||
}
|
||||
}
|
||||
|
||||
export function toggleShowAdvancedFields() {
|
||||
const buttons = document.getElementsByClassName('expand-advanced-form'),
|
||||
forms = document.getElementsByClassName('advanced-word-form');
|
||||
const formsWithFilledFields = [];
|
||||
|
||||
Array.from(forms).forEach(form => {
|
||||
const fields = form.querySelectorAll('input, textarea');
|
||||
const formHasFieldFilled = Array.from(fields).some(field => field.value.trim() !== '');
|
||||
if (window.settings.showAdvanced || formHasFieldFilled) {
|
||||
form.style.display = 'block';
|
||||
} else {
|
||||
form.style.display = 'none';
|
||||
}
|
||||
if (formHasFieldFilled) {
|
||||
formsWithFilledFields.push(form.id.replace('advancedForm', ''));
|
||||
}
|
||||
});
|
||||
Array.from(buttons).forEach(button => {
|
||||
const formHasFilledField = formsWithFilledFields.includes(button.id.replace('expandAdvancedForm', ''));
|
||||
if (window.settings.showAdvanced || formHasFilledField) {
|
||||
button.innerText = 'Hide Advanced Fields';
|
||||
} else {
|
||||
button.innerText = 'Show Advanced Fields';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ export function renderDetails() {
|
|||
const consonantHTML = `<p><strong>Consonants</strong><br>${consonants.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const vowelHTML = `<p><strong>Vowels</strong><br>${vowels.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const blendHTML = blends.length > 0 ? `<p><strong>Polyphthongs / Blends</strong><br>${blends.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>` : '';
|
||||
const phonologyNotesHTML = phonology.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(phonology.notes) + '</div>' : '';
|
||||
const phonologyNotesHTML = phonology.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(removeTags(phonology.notes)) + '</div>' : '';
|
||||
const phonologyHTML = `<h3>Phonology</h3>
|
||||
<div class="split two">
|
||||
<div>${consonantHTML}</div>
|
||||
|
@ -79,7 +79,7 @@ export function renderDetails() {
|
|||
const onsetHTML = `<p><strong>Onset</strong><br>${onset.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const nucleusHTML = `<p><strong>Nucleus</strong><br>${nucleus.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const codaHTML = `<p><strong>Coda</strong><br>${coda.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
|
||||
const phonotacticsNotesHTML = phonotactics.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(phonotactics.notes) + '</div>' : '';
|
||||
const phonotacticsNotesHTML = phonotactics.notes.trim().length > 0 ? '<p><strong>Notes</strong></p><div>' + md(removeTags(phonotactics.notes)) + '</div>' : '';
|
||||
const phonotacticsHTML = onset.length + nucleus.length + coda.length + phonotacticsNotesHTML.length > 0
|
||||
? `<h3>Phonotactics</h3>
|
||||
${onset.length > 0 || nucleus.length > 0 || coda.length > 0
|
||||
|
@ -99,17 +99,15 @@ export function renderDetails() {
|
|||
}
|
||||
return false;
|
||||
}).filter(html => html !== false).join(' ')}</p>` : '';
|
||||
const orthographyNotesHTML = orthography.notes.trim().length > 0 ? '<p><strong>Notes</strong><br>' + md(orthography.notes) + '</div>' : '';
|
||||
const orthographyNotesHTML = orthography.notes.trim().length > 0 ? '<p><strong>Notes</strong><br>' + md(removeTags(orthography.notes)) + '</div>' : '';
|
||||
const orthographyHTML = translations.length + orthographyNotesHTML.length > 0
|
||||
? `<h3>Orthography</h3>
|
||||
${translationsHTML}
|
||||
${orthographyNotesHTML}`
|
||||
: '';
|
||||
const grammarHTML = grammar.notes.trim().length > 0
|
||||
? '<h3>Grammar</h3><div>'
|
||||
+ (grammar.notes.trim().length > 0 ? md(grammar.notes) : '')
|
||||
+ '</div>'
|
||||
: '';
|
||||
const grammarHTML = grammar.notes.trim().length > 0 ? '<h3>Grammar</h3><div>'
|
||||
+ (grammar.notes.trim().length > 0 ? md(removeTags(grammar.notes)) : '')
|
||||
+ '</div>' : '';
|
||||
|
||||
detailsPanel.innerHTML = generalHTML + phonologyHTML + phonotacticsHTML + orthographyHTML + grammarHTML;
|
||||
}
|
||||
|
|
|
@ -160,10 +160,10 @@ export function expandAdvancedForm(id = false) {
|
|||
const button = typeof id.target !== 'undefined' ? this : document.getElementById('expandAdvancedForm' + (!wordId ? '' : wordId)),
|
||||
form = document.getElementById('advancedForm' + (!wordId ? '' : wordId));
|
||||
if (form.style.display !== 'block') {
|
||||
button.innerText = 'Hide Advanced Fields';
|
||||
button.innerText = 'Hide Advanced';
|
||||
form.style.display = 'block';
|
||||
} else {
|
||||
button.innerText = 'Show Advanced Fields';
|
||||
button.innerText = 'Show Advanced';
|
||||
form.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ export function submitWordForm() {
|
|||
};
|
||||
|
||||
if (removeTags(etymology).trim() !== '') {
|
||||
word.etymology = removeTags(etymology).split(',').map(w => w.trim()).filter(w => w.length > 0);
|
||||
word.etymology = removeTags(etymology).trim();
|
||||
}
|
||||
|
||||
if (validateWord(word)) {
|
||||
|
@ -209,7 +209,6 @@ export function clearWordForm() {
|
|||
document.getElementById('wordPartOfSpeech').value = '';
|
||||
document.getElementById('wordDefinition').value = '';
|
||||
document.getElementById('wordDetails').value = '';
|
||||
document.getElementById('wordEtymology').value = '';
|
||||
|
||||
document.getElementById('wordName').focus();
|
||||
}
|
||||
|
@ -284,7 +283,7 @@ export function confirmEditWord(id) {
|
|||
};
|
||||
|
||||
if (removeTags(etymology).trim() !== '') {
|
||||
word.etymology = removeTags(etymology).split(',').map(w => w.trim()).filter(w => w.length > 0);
|
||||
word.etymology = removeTags(etymology).trim();
|
||||
}
|
||||
|
||||
if (validateWord(word, wordId)) {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
# To resolve the issue with "Your connection to this site is not secure" message
|
||||
Header set Content-Security-Policy: upgrade-insecure-requests env=HTTPS
|
||||
|
||||
RewriteEngine On # Turn on the rewriting engine
|
||||
|
||||
RewriteRule ^view/([0-9]+)/([0-9]+)/?$ router.php?view=word&dict=$1&word=$2 [NC,L] # Handle word ids.
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
[
|
||||
{
|
||||
"header": "Minor Updates + 1 Important Fix",
|
||||
"body": "<p><em>March 4, 2020</em> – Lexiconga has been updated to fix a long-standing bug that prevented updated words from syncing between devices!</p><p>Check the <a href=\"https://github.com/Alamantus/Lexiconga/releases\" target=\"_blank\" rel=\"noopener\">Updates page</a> for the other minor updates.</p>",
|
||||
"expire": "April 4, 2020",
|
||||
"dismissId": "marchFixes1"
|
||||
"header": "New Features have Arrived!",
|
||||
"body": "<p><em>July 15, 2019</em> – Custom Alphabetical Order, Orthographic Translations, and Custom Styling are now here!</p><p>Check the <a href=\"https://github.com/Alamantus/Lexiconga/releases\" target=\"_blank\" rel=\"noopener\">Updates page</a> for all the new features and bug fixes!</p>",
|
||||
"expire": "January 1, 2020",
|
||||
"dismissId": "wave1"
|
||||
},
|
||||
{
|
||||
"header": "Welcome to Lexiconga 2.0!",
|
||||
"body": "<p><em>July 1, 2019</em> – Lexiconga has been rewritten from the ground up!</p><p>Check the <a href=\"https://github.com/Alamantus/Lexiconga/releases\" target=\"_blank\" rel=\"noopener\">Updates page</a> for all the new features, or click Help to get a refresher on how to use Lexiconga!</p>",
|
||||
"expire": "January 1, 2020",
|
||||
"dismissId": "welcome"
|
||||
}
|
||||
]
|
|
@ -215,10 +215,7 @@ WHERE dictionary=$dictionary";
|
|||
}
|
||||
|
||||
public function getWords ($user, $dictionary) {
|
||||
$query = "SELECT words.*, words_advanced.etymology FROM words
|
||||
LEFT JOIN words_advanced ON words_advanced.dictionary = words.dictionary AND words_advanced.word_id = words.word_id
|
||||
JOIN dictionaries ON dictionaries.id = words.dictionary
|
||||
WHERE words.dictionary=$dictionary AND dictionaries.user=$user";
|
||||
$query = "SELECT words.* FROM words JOIN dictionaries ON id = dictionary WHERE dictionary=$dictionary AND user=$user";
|
||||
$results = $this->db->query($query)->fetchAll();
|
||||
if ($results) {
|
||||
return array_map(function ($row) {
|
||||
|
@ -234,7 +231,7 @@ WHERE words.dictionary=$dictionary AND dictionaries.user=$user";
|
|||
);
|
||||
|
||||
if (!is_null($row['etymology'])) {
|
||||
$word['etymology'] = explode(',', $row['etymology']);
|
||||
$word['etymology'] = $row['etymology'];
|
||||
}
|
||||
|
||||
return $word;
|
||||
|
@ -262,48 +259,41 @@ WHERE words.dictionary=$dictionary AND dictionaries.user=$user";
|
|||
return true;
|
||||
}
|
||||
|
||||
$query1 = 'INSERT INTO words (dictionary, word_id, name, pronunciation, part_of_speech, definition, details, last_updated, created_on) VALUES ';
|
||||
$query2 = 'INSERT INTO words_advanced (dictionary, word_id, etymology) VALUES ';
|
||||
$params1 = array();
|
||||
$params2 = array();
|
||||
$query = 'INSERT INTO words (dictionary, word_id, name, pronunciation, part_of_speech, definition, details, etymology, last_updated, created_on) VALUES ';
|
||||
$params = array();
|
||||
$word_ids = array();
|
||||
$most_recent_word_update = 0;
|
||||
foreach($words as $word) {
|
||||
$last_updated = isset($word['lastUpdated']) ? $word['lastUpdated'] : $word['createdOn'];
|
||||
$last_updated = isset($word['lastUpdated']) ? $word['createdOn'] : $word['lastUpdated'];
|
||||
if ($most_recent_word_update < $last_updated) {
|
||||
$most_recent_word_update = $last_updated;
|
||||
}
|
||||
$word_ids[] = $word['wordId'];
|
||||
$query1 .= "(?, ?, ?, ?, ?, ?, ?, ?, ?), ";
|
||||
$params1[] = $dictionary;
|
||||
$params1[] = $word['wordId'];
|
||||
$params1[] = $word['name'];
|
||||
$params1[] = $word['pronunciation'];
|
||||
$params1[] = $word['partOfSpeech'];
|
||||
$params1[] = $word['definition'];
|
||||
$params1[] = $word['details'];
|
||||
$params1[] = $last_updated;
|
||||
$params1[] = $word['createdOn'];
|
||||
|
||||
$query2 .= "(?, ?, ?), ";
|
||||
$params2[] = $dictionary;
|
||||
$params2[] = $word['wordId'];
|
||||
$params2[] = isset($word['etymology']) ? implode(',', $word['etymology']) : null;
|
||||
$query .= "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?), ";
|
||||
$params[] = $dictionary;
|
||||
$params[] = $word['wordId'];
|
||||
$params[] = $word['name'];
|
||||
$params[] = $word['pronunciation'];
|
||||
$params[] = $word['partOfSpeech'];
|
||||
$params[] = $word['definition'];
|
||||
$params[] = $word['details'];
|
||||
$params[] = isset($word['etymology']) ? $word['etymology'] : null;
|
||||
$params[] = $last_updated;
|
||||
$params[] = $word['createdOn'];
|
||||
}
|
||||
$query1 = trim($query1, ', ') . ' ON DUPLICATE KEY UPDATE
|
||||
$query = trim($query, ', ') . ' ON DUPLICATE KEY UPDATE
|
||||
name=VALUES(name),
|
||||
pronunciation=VALUES(pronunciation),
|
||||
part_of_speech=VALUES(part_of_speech),
|
||||
definition=VALUES(definition),
|
||||
details=VALUES(details),
|
||||
etymology=VALUES(etymology),
|
||||
last_updated=VALUES(last_updated),
|
||||
created_on=VALUES(created_on)';
|
||||
$query2 = trim($query2, ', ') . ' ON DUPLICATE KEY UPDATE
|
||||
etymology=VALUES(etymology)';
|
||||
|
||||
$results1 = $this->db->execute($query1, $params1);
|
||||
$results = $this->db->execute($query, $params);
|
||||
|
||||
// if ($results1) {
|
||||
// if ($results) {
|
||||
// $database_words = $this->getWords($user, $dictionary);
|
||||
// $database_ids = array_map(function($database_word) { return $database_word['id']; }, $database_words);
|
||||
// $words_to_delete = array_filter($database_ids, function($database_id) use($word_ids) { return !in_array($database_id, $word_ids); });
|
||||
|
@ -313,11 +303,8 @@ etymology=VALUES(etymology)';
|
|||
// }
|
||||
// }
|
||||
|
||||
if ($results1 === true) {
|
||||
$results2 = $this->db->execute($query2, $params2);
|
||||
if ($results2 === true) {
|
||||
return $results1 && $results2;
|
||||
}
|
||||
if ($results) {
|
||||
return $results;
|
||||
}
|
||||
return array(
|
||||
'error' => $this->db->last_error_info,
|
||||
|
|
|
@ -44,20 +44,20 @@ class PublicDictionary {
|
|||
'consonants' => $result['consonants'] !== '' ? explode(' ', $result['consonants']) : array(),
|
||||
'vowels' => $result['vowels'] !== '' ? explode(' ', $result['vowels']) : array(),
|
||||
'blends' => $result['blends'] !== '' ? explode(' ', $result['blends']) : array(),
|
||||
'notes' => $this->parseReferences(strip_tags($result['phonology_notes']), $result['id']),
|
||||
'notes' => $result['phonology_notes'],
|
||||
),
|
||||
'phonotactics' => array(
|
||||
'onset' => $result['onset'] !== '' ? explode(',', $result['onset']) : array(),
|
||||
'nucleus' => $result['nucleus'] !== '' ? explode(',', $result['nucleus']) : array(),
|
||||
'coda' => $result['coda'] !== '' ? explode(',', $result['coda']) : array(),
|
||||
'notes' => $this->parseReferences(strip_tags($result['phonotactics_notes']), $result['id']),
|
||||
'notes' => $result['phonotactics_notes'],
|
||||
),
|
||||
'orthography' => array(
|
||||
'translations' => $result['translations'] !== '' ? explode(PHP_EOL, $result['translations']) : array(),
|
||||
'notes' => $this->parseReferences(strip_tags($result['orthography_notes']), $result['id']),
|
||||
'notes' => $result['orthography_notes'],
|
||||
),
|
||||
'grammar' => array(
|
||||
'notes' => $this->parseReferences(strip_tags($result['grammar_notes']), $result['id']),
|
||||
'notes' => $result['grammar_notes'],
|
||||
),
|
||||
),
|
||||
'settings' => array(
|
||||
|
|
|
@ -134,7 +134,7 @@ switch ($view) {
|
|||
oldLoad && oldLoad();
|
||||
if (UpUp) {
|
||||
UpUp.start({
|
||||
'cache-version': '2.1.7',
|
||||
'cache-version': '2.1.3',
|
||||
'content-url': 'offline.html',
|
||||
'assets': [
|
||||
\"" . implode('","', $files) . "\"
|
||||
|
|
|
@ -16,7 +16,6 @@ input:not([type="checkbox"]),
|
|||
select,
|
||||
textarea {
|
||||
font-size: 12pt;
|
||||
padding: 2px 3px;
|
||||
}
|
||||
|
||||
label {
|
||||
|
@ -31,7 +30,8 @@ label {
|
|||
}
|
||||
|
||||
input:not([type="checkbox"]):not([type="radio"]) {
|
||||
line-height: 1.6;
|
||||
padding-bottom: 2px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
input:not([type="checkbox"]):not([type="radio"]),
|
||||
|
@ -153,7 +153,6 @@ span .tag {
|
|||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
|
||||
.modal-background {
|
||||
position: absolute;
|
||||
|
|
|
@ -347,7 +347,7 @@ $nav-font-height: 16px;
|
|||
bottom: $general-padding;
|
||||
right: $general-padding;
|
||||
max-width: 300px;
|
||||
z-index: 15;
|
||||
z-index: 10;
|
||||
|
||||
.message {
|
||||
position: relative;
|
||||
|
|
|
@ -23,9 +23,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
.modal .modal-content .close-button {
|
||||
.modal {
|
||||
z-index: 10;
|
||||
|
||||
.modal-content .close-button {
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.split {
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
#top {
|
||||
background-color: $header-color;
|
||||
border-bottom: 1px solid darken($header-color, 2);
|
||||
box-shadow: none;
|
||||
box-shadow: 0px 4px 5px 0px $dark;
|
||||
|
||||
#title {
|
||||
#lexi {
|
||||
|
@ -156,13 +156,13 @@
|
|||
#wordForm {
|
||||
background-color: $word-form-color;
|
||||
border: 1px solid darken($word-form-color, 2);
|
||||
box-shadow: none;
|
||||
box-shadow: 4px 4px 5px 0px $dark;
|
||||
}
|
||||
|
||||
#mainColumn {
|
||||
background-color: $dictionary-color;
|
||||
border: 1px solid darken($dictionary-color, 2);
|
||||
box-shadow: none;
|
||||
box-shadow: 4px 4px 5px 0px $dark;
|
||||
}
|
||||
|
||||
#detailsSection {
|
||||
|
@ -184,7 +184,7 @@
|
|||
|
||||
.announcement {
|
||||
background-color: saturate(lighten($footer-color, 20%), 20%);
|
||||
box-shadow: none;
|
||||
box-shadow: 4px 4px 5px 0px $dark;
|
||||
}
|
||||
|
||||
.entry {
|
||||
|
@ -238,7 +238,7 @@
|
|||
#bottom {
|
||||
background-color: $footer-color;
|
||||
border-top: 1px solid darken($footer-color, 2);
|
||||
box-shadow: none;
|
||||
box-shadow: 0px -4px 5px 0px $dark;
|
||||
|
||||
a {
|
||||
color: $light;
|
||||
|
|
|
@ -86,18 +86,8 @@ CREATE TABLE IF NOT EXISTS `words` (
|
|||
`part_of_speech` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`definition` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`details` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Markdown',
|
||||
`etymology` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`last_updated` int(11) DEFAULT NULL,
|
||||
`created_on` int(11) NOT NULL,
|
||||
UNIQUE KEY `unique_index` (`dictionary`,`word_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER IF NOT EXISTS `delete_word_advanced` AFTER DELETE ON `words` FOR EACH ROW DELETE FROM words_advanced WHERE words_advanced.dictionary=old.dictionary AND words_advanced.word_id=old.word_id
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `words_advanced` (
|
||||
`dictionary` int(11) NOT NULL,
|
||||
`word_id` int(11) NOT NULL,
|
||||
`etymology` text NOT NULL COMMENT 'Comma-separated',
|
||||
UNIQUE KEY `dictionary_word_id` (`dictionary`,`word_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
|
|
@ -139,10 +139,8 @@
|
|||
<label>Details<span class="red">*</span><a class="label-button maximize-button">Maximize</a><br>
|
||||
<textarea id="wordDetails" placeholder="Markdown formatting allowed"></textarea>
|
||||
</label>
|
||||
<label>
|
||||
<a id="expandAdvancedForm" class="small button expand-advanced-form">Show Advanced Fields</a>
|
||||
</label>
|
||||
<div id="advancedForm" class="advanced-word-form" style="display:none;">
|
||||
<a id="expandAdvancedForm" class="expand-advanced-form">+ Advanced</a>
|
||||
<div id="advancedForm" style="display:none;">
|
||||
<label>Etymology / Root Words<br>
|
||||
<input id="wordEtymology" maxlength="2500" placeholder="comma,separated,root,words">
|
||||
</label>
|
||||
|
@ -214,11 +212,6 @@
|
|||
<small>Check this to enable keyboard combinations to perform different helpful actions.</small>
|
||||
</label>
|
||||
|
||||
<label>Show Advanced Fields By Default
|
||||
<input id="settingsShowAdvanced" type="checkbox"><br />
|
||||
<small>Check this to make the advanced fields show on word forms without needing to click the "Show Advanced Fields" button.</small>
|
||||
</label>
|
||||
|
||||
<label>Default Theme <small>(the theme new dictionaries will use)</small>
|
||||
<select id="settingsDefaultTheme">
|
||||
<option value="default">Default</option>
|
||||
|
|
Loading…
Reference in New Issue