From 4a1dd7aae410b6f8a04633e93382dad2aed3a152 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Wed, 29 May 2019 00:02:22 -0600 Subject: [PATCH] Add share links to words (word view not added yet) --- src/js/render.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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