diff --git a/src/js/render.js b/src/js/render.js index afbb7ab..fa15333 100644 --- a/src/js/render.js +++ b/src/js/render.js @@ -1,6 +1,6 @@ import md from 'marked'; import { removeTags, slugify } from '../helpers'; -import { getWordsStats, getHomonymnNumber } from './utilities'; +import { getWordsStats, getHomonymnNumber, hasToken } from './utilities'; import { getMatchingSearchWords, highlightSearchTerm, getSearchFilters, getSearchTerm } from './search'; import { showSection } from './displayToggles'; import { @@ -122,6 +122,7 @@ export function renderWords() { let wordsHTML = ''; let openEditForms = getOpenEditForms(); let words = false; + const isPublic = hasToken() && window.currentDictionary.settings.isPublic; if (window.currentDictionary.words.length === 0) { wordsHTML = `
@@ -171,6 +172,8 @@ export function renderWords() { wordId: originalWord.wordId, }); const homonymnNumber = getHomonymnNumber(originalWord); + const shareLink = window.currentDictionary.hasOwnProperty('externalID') + ? window.location.pathname + window.currentDictionary.externalID + '/' + word.wordId : ''; wordsHTML += `

${word.name}${homonymnNumber > 0 ? ' ' + homonymnNumber.toString() + '' : ''}

@@ -179,6 +182,7 @@ export function renderWords() { Options