This commit is contained in:
Robbie Antenesse 2019-07-19 10:04:56 -06:00
commit 466e5e84c6
9 changed files with 39 additions and 31 deletions

View File

@ -13,7 +13,7 @@
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:title" content="Advertising on Lexiconga"> <meta property="og:title" content="Advertising on Lexiconga">
<meta property="og:description" content="Buy advertisement space on Lexiconga"> <meta property="og:description" content="Buy advertisement space on Lexiconga">
<meta property="og:image" content="processedImages/logo.png"> <meta property="og:image" content="processedImages/social.jpg">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:image:alt" content="Lexiconga logo"> <meta name="twitter:image:alt" content="Lexiconga logo">

View File

@ -9,7 +9,7 @@ if (!fs.existsSync(folder)) {
const favicon = sharp('./src/images/favicon.svg'); const favicon = sharp('./src/images/favicon.svg');
sharp('./src/images/logo.svg').toFile(folder + 'logo.png', (err, info) => { sharp('./src/images/social.jpg').toFile(folder + 'social.jpg', (err, info) => {
if (err) return console.error(err); if (err) return console.error(err);
console.log(info); console.log(info);
}); });

View File

@ -12,7 +12,7 @@
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:title" content="Lexiconga (OFFLINE)"> <meta property="og:title" content="Lexiconga (OFFLINE)">
<meta property="og:description" content="The quick and easy (offline) dictionary builder for constructed languages."> <meta property="og:description" content="The quick and easy (offline) dictionary builder for constructed languages.">
<meta property="og:image" content="processedImages/logo.png"> <meta property="og:image" content="processedImages/social.jpg">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:image:alt" content="Lexiconga logo"> <meta name="twitter:image:alt" content="Lexiconga logo">

BIN
src/images/social.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -54,14 +54,14 @@ export function renderDetails() {
const alphabeticalOrderHTML = `<p><strong>Alphabetical Order</strong><br>${ const alphabeticalOrderHTML = `<p><strong>Alphabetical Order</strong><br>${
(alphabeticalOrder.length > 0 ? alphabeticalOrder : ['English Alphabet']).map(letter => `<span class="tag">${letter}</span>`).join(' ') (alphabeticalOrder.length > 0 ? alphabeticalOrder : ['English Alphabet']).map(letter => `<span class="tag">${letter}</span>`).join(' ')
}</div>`; }</div>`;
const generalHTML = `<h3>General</h3>${partsOfSpeechHTML}${alphabeticalOrderHTML}`; const generalHTML = `<h2>General</h2>${partsOfSpeechHTML}${alphabeticalOrderHTML}`;
const { consonants, vowels, blends } = phonology const { consonants, vowels, blends } = phonology
const consonantHTML = `<p><strong>Consonants</strong><br>${consonants.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`; 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 vowelHTML = `<p><strong>Vowels</strong><br>${vowels.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>`;
const blendHTML = blends.length > 0 ? `<p><strong>Polyphthongs&nbsp;/&nbsp;Blends</strong><br>${blends.map(letter => `<span class="tag">${letter}</span>`).join(' ')}</p>` : ''; const blendHTML = blends.length > 0 ? `<p><strong>Polyphthongs&nbsp;/&nbsp;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(removeTags(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> const phonologyHTML = `<h2>Phonology</h2>
<div class="split two"> <div class="split two">
<div>${consonantHTML}</div> <div>${consonantHTML}</div>
<div>${vowelHTML}</div> <div>${vowelHTML}</div>
@ -75,7 +75,7 @@ export function renderDetails() {
const codaHTML = `<p><strong>Coda</strong><br>${coda.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(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 const phonotacticsHTML = onset.length + nucleus.length + coda.length + phonotacticsNotesHTML.length > 0
? `<h3>Phonotactics</h3> ? `<h2>Phonotactics</h2>
${onset.length > 0 || nucleus.length > 0 || coda.length > 0 ${onset.length > 0 || nucleus.length > 0 || coda.length > 0
? `<div class="split three"> ? `<div class="split three">
<div>${onsetHTML}</div> <div>${onsetHTML}</div>
@ -95,11 +95,11 @@ export function renderDetails() {
}).filter(html => html !== false).join(' ')}</p>` : ''; }).filter(html => html !== false).join(' ')}</p>` : '';
const orthographyNotesHTML = orthography.notes.trim().length > 0 ? '<p><strong>Notes</strong><br>' + md(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 const orthographyHTML = translations.length + orthographyNotesHTML.length > 0
? `<h3>Orthography</h3> ? `<h2>Orthography</h2>
${translationsHTML} ${translationsHTML}
${orthographyNotesHTML}` ${orthographyNotesHTML}`
: ''; : '';
const grammarHTML = grammar.notes.trim().length > 0 ? '<h3>Grammar</h3><div>' const grammarHTML = grammar.notes.trim().length > 0 ? '<h2>Grammar</h2><div>'
+ (grammar.notes.trim().length > 0 ? md(removeTags(grammar.notes)) : '') + (grammar.notes.trim().length > 0 ? md(removeTags(grammar.notes)) : '')
+ '</div>' : ''; + '</div>' : '';

View File

@ -9,6 +9,17 @@ if ($show_upgrade_screen) {
$view = isset($_GET['view']) ? $_GET['view'] : false; $view = isset($_GET['view']) ? $_GET['view'] : false;
function utf8ize($d) {
if (is_array($d)) {
foreach ($d as $k => $v) {
$d[$k] = utf8ize($v);
}
} else if (is_string ($d)) {
return mb_convert_encoding($d, 'UTF-8', 'UTF-8');
}
return $d;
}
switch ($view) { switch ($view) {
case 'dictionary': { case 'dictionary': {
$html = file_get_contents(realpath(dirname(__FILE__) . '/./template-view.html')); $html = file_get_contents(realpath(dirname(__FILE__) . '/./template-view.html'));
@ -22,7 +33,7 @@ switch ($view) {
$html = str_replace('{{dict}}', $dict, $html); $html = str_replace('{{dict}}', $dict, $html);
$html = str_replace('{{dict_name}}', $dictionary_data['name'] . ' ' . $dictionary_data['specification'], $html); $html = str_replace('{{dict_name}}', $dictionary_data['name'] . ' ' . $dictionary_data['specification'], $html);
$html = str_replace('{{public_name}}', $dictionary_data['createdBy'], $html); $html = str_replace('{{public_name}}', $dictionary_data['createdBy'], $html);
$dictionary_json = json_encode($dictionary_data); $dictionary_json = json_encode(utf8ize($dictionary_data));
$html = str_replace('{{dict_json}}', addslashes($dictionary_json), $html); $html = str_replace('{{dict_json}}', addslashes($dictionary_json), $html);
} else { } else {
$html = str_replace('{{dict}}', 'error', $html); $html = str_replace('{{dict}}', 'error', $html);
@ -61,7 +72,7 @@ switch ($view) {
$html = str_replace('{{dict}}', $dict, $html); $html = str_replace('{{dict}}', $dict, $html);
$html = str_replace('{{dict_name}}', $word_data['name'] . ' in the ' . $dictionary_name, $html); $html = str_replace('{{dict_name}}', $word_data['name'] . ' in the ' . $dictionary_name, $html);
$html = str_replace('{{public_name}}', $dictionary_data['createdBy'], $html); $html = str_replace('{{public_name}}', $dictionary_data['createdBy'], $html);
$dictionary_json = json_encode($dictionary_data); $dictionary_json = json_encode(utf8ize($dictionary_data));
$html = str_replace('{{dict_json}}', addslashes($dictionary_json), $html); $html = str_replace('{{dict_json}}', addslashes($dictionary_json), $html);
} else { } else {
$html = str_replace('{{dict}}', 'error', $html); $html = str_replace('{{dict}}', 'error', $html);
@ -80,10 +91,6 @@ switch ($view) {
$announcements = json_decode($announcements, true); $announcements = json_decode($announcements, true);
$announcements_html = ''; $announcements_html = '';
foreach ($announcements as $announcement) { foreach ($announcements as $announcement) {
if (isset($announcement['dismissId']) && isset($_COOKIE['announcement-' . $announcement['dismissId']])) {
continue;
}
$expire = strtotime($announcement['expire']); $expire = strtotime($announcement['expire']);
if (time() < $expire) { if (time() < $expire) {
$announcements_html .= '<article class="announcement"' . (isset($announcement['dismissId']) ? ' id="announcement-' . $announcement['dismissId'] . '"' : '') . ' data-expires="' . $announcement['expire'] . '"> $announcements_html .= '<article class="announcement"' . (isset($announcement['dismissId']) ? ' id="announcement-' . $announcement['dismissId'] . '"' : '') . ' data-expires="' . $announcement['expire'] . '">
@ -123,7 +130,7 @@ switch ($view) {
oldLoad && oldLoad(); oldLoad && oldLoad();
if (UpUp) { if (UpUp) {
UpUp.start({ UpUp.start({
'cache-version': '2.1.0', 'cache-version': '2.1.1',
'content-url': 'offline.html', 'content-url': 'offline.html',
'assets': [ 'assets': [
\"" . implode('","', $files) . "\" \"" . implode('","', $files) . "\"

View File

@ -8,6 +8,10 @@ p, span {
} }
} }
h2 {
margin-bottom: 5px;
}
input:not([type="checkbox"]), input:not([type="checkbox"]),
select, select,
textarea { textarea {
@ -19,10 +23,7 @@ label {
font-weight: bold; font-weight: bold;
line-height: 120%; line-height: 120%;
cursor: pointer; cursor: pointer;
&:not(:last-child) {
margin-bottom: $general-padding; margin-bottom: $general-padding;
}
small { small {
font-weight: normal; font-weight: normal;

View File

@ -12,7 +12,7 @@
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:title" content="Lexiconga"> <meta property="og:title" content="Lexiconga">
<meta property="og:description" content="The quick and easy dictionary builder for constructed languages."> <meta property="og:description" content="The quick and easy dictionary builder for constructed languages.">
<meta property="og:image" content="processedImages/logo.png"> <meta property="og:image" content="processedImages/social.jpg">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:image:alt" content="Lexiconga logo"> <meta name="twitter:image:alt" content="Lexiconga logo">
@ -147,7 +147,7 @@
<section id="mainColumn"> <section id="mainColumn">
{{announcements}} {{announcements}}
<section id="detailsSection"> <section id="detailsSection">
<h2 id="dictionaryName">Dictionary Name</h2> <h1 id="dictionaryName">Dictionary Name</h1>
<nav> <nav>
<ul> <ul>
<li>Description</li><li>Details</li><li>Stats</li><li id="editDictionaryButton">Edit</li> <li>Description</li><li>Details</li><li>Stats</li><li id="editDictionaryButton">Edit</li>
@ -194,7 +194,7 @@
<section> <section>
<form class="split two"> <form class="split two">
<div> <div>
<h3>General Settings</h3> <h2>General Settings</h2>
<label>Use IPA Auto-Fill <label>Use IPA Auto-Fill
<input id="settingsUseIPA" type="checkbox" checked><br /> <input id="settingsUseIPA" type="checkbox" checked><br />
<small>Check this to use character combinations to input International Phonetic Alphabet characters into <small>Check this to use character combinations to input International Phonetic Alphabet characters into
@ -267,7 +267,7 @@
</a>&nbsp; </a>&nbsp;
<small>Leave blank for default (case-insensitive ASCII/Unicode sorting)</small> <small>Leave blank for default (case-insensitive ASCII/Unicode sorting)</small>
</label> </label>
<h3>Phonology</h3> <h2>Phonology</h2>
<div class="split three"> <div class="split three">
<div> <div>
<label>Consonants<br> <label>Consonants<br>
@ -294,10 +294,10 @@
</label> </label>
</div> </div>
</div> </div>
<label>Notes <small>(Markdown-enabled)</small><br> <label>Notes <small>(Markdown-enabled)</small><a class="label-button maximize-button">Maximize</a><br>
<textarea id="editPhonologyNotes"></textarea> <textarea id="editPhonologyNotes"></textarea>
</label> </label>
<h3>Phonotactics</h3> <h2>Phonotactics</h2>
<div class="split three"> <div class="split three">
<div> <div>
<label>Onset<br> <label>Onset<br>
@ -318,10 +318,10 @@
</label> </label>
</div> </div>
</div> </div>
<label>Notes <small>(Markdown-enabled)</small><br> <label>Notes <small>(Markdown-enabled)</small><a class="label-button maximize-button">Maximize</a><br>
<textarea id="editPhonotacticsNotes"></textarea> <textarea id="editPhonotacticsNotes"></textarea>
</label> </label>
<h3>Orthography</h3> <h2>Orthography</h2>
<label>Translations <small>(One translation per line)</small><a class="label-button maximize-button">Maximize</a><br> <label>Translations <small>(One translation per line)</small><a class="label-button maximize-button">Maximize</a><br>
<textarea id="editTranslations" placeholder="ai=I <textarea id="editTranslations" placeholder="ai=I
AA=ay AA=ay
@ -332,7 +332,7 @@ ou=ow"></textarea>
<label>Notes <small>(Markdown-enabled)</small><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> <textarea id="editOrthography"></textarea>
</label> </label>
<h3>Grammar</h3> <h2>Grammar</h2>
<label>Notes <small>(Markdown-enabled)</small><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> <textarea id="editGrammar"></textarea>
</label> </label>
@ -371,7 +371,7 @@ ou=ow"></textarea>
</section> </section>
<section id="editActionsTab" style="display:none;"> <section id="editActionsTab" style="display:none;">
<h3>Import&nbsp;/ Export</h3> <h2>Import&nbsp;/ Export</h2>
<div class="split two"> <div class="split two">
<div> <div>
<p> <p>

View File

@ -13,7 +13,7 @@
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:title" content="{{dict_name}}"> <meta property="og:title" content="{{dict_name}}">
<meta property="og:description" content="A Lexiconga dictionary by {{public_name}}"> <meta property="og:description" content="A Lexiconga dictionary by {{public_name}}">
<meta property="og:image" content="processedImages/logo.png"> <meta property="og:image" content="processedImages/social.jpg">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:image:alt" content="Lexiconga logo"> <meta name="twitter:image:alt" content="Lexiconga logo">
@ -81,7 +81,7 @@
<label>Exact Words <label>Exact Words
<input type="checkbox" id="searchExactWords"> <input type="checkbox" id="searchExactWords">
</label> </label>
<label>Translations <label style="display:none;">Translations
<input type="checkbox" id="searchOrthography"> <input type="checkbox" id="searchOrthography">
</label> </label>
</div> </div>