Skip to content

Commit

Permalink
[#167][Crum/Flashcards] Nag Hammadi References only Show in DEV Mode.
Browse files Browse the repository at this point in the history
They're too obtrusive. We will hide them for now, and let's think about
them later.

We also make them visible in `dev` mode, so we can see them when we want
to.
  • Loading branch information
pishoyg committed Oct 15, 2024
1 parent 48669c9 commit a8cf784
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions flashcards/constants/a_coptic_dictionary/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const CLS_SPELLING_COMMA = 'spelling-comma';
const CLS_TYPE = 'type';
const CLS_SPELLING = 'spelling';
const CLS_SISTER_KEY = 'sister-key';
const CLS_NAG_HAMMADI = 'nag-hammadi';

const LOOKUP_URL_PREFIX = 'https://remnqymi.com/crum/?query=';
const DAWOUD_OFFSET = 16;
Expand Down Expand Up @@ -99,7 +100,7 @@ Array.prototype.forEach.call(
if (lastChar === 'a' || lastChar === 'b') {
pageNumber = pageNumber.slice(0, -1);
}
moveElement(el, 'a', {'href': `#crum${pageNumber}`});
moveElement(el, 'a', { 'href': `#crum${pageNumber}` });
});

// Handle CLS_CRUM_PAGE_EXTERNAL class.
Expand Down Expand Up @@ -186,7 +187,7 @@ Array.prototype.forEach.call(
document.getElementsByClassName(CLS_DAWOUD_PAGE),
(el: HTMLElement): void => {
el.classList.add(CLS_LINK);
moveElement(el, 'a', {'href': `#dawoud${el.innerHTML.slice(0, -1)}`});
moveElement(el, 'a', { 'href': `#dawoud${el.innerHTML.slice(0, -1)}` });
});

// Handle CLS_DRV_KEY class.
Expand Down Expand Up @@ -295,9 +296,8 @@ function devState(): DevState {

function dev(): void {
const state = devState();
Array.prototype.forEach.call(
document.getElementsByClassName(CLS_DEV),
(el: HTMLElement) => {
document.querySelectorAll(`.${CLS_DEV},.${CLS_NAG_HAMMADI}`).forEach(
(el: Element) => {
if (state === 'true') {
el.removeAttribute('hidden');
} else {
Expand Down
1 change: 1 addition & 0 deletions site/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ table {
}

.nag-hammadi {
display: none;
opacity: 0.5;
}

Expand Down

0 comments on commit a8cf784

Please sign in to comment.