const Handlebars = require('handlebars'); const config = require('../config/speechConfig.js'); module.exports = { googleAnalytics () { const googleApiKey = config.analytics.googleId; const gaCode = ``; return new Handlebars.SafeString(gaCode); }, addOpenGraph ({ ogTitle, contentType, ogDescription, thumbnail, showUrl, source, ogThumbnailContentType }) { const ogTitleTag = ``; const ogUrlTag = ``; const ogSiteNameTag = ``; const ogDescriptionTag = ``; const ogImageWidthTag = ''; const ogImageHeightTag = ''; const basicTags = `${ogTitleTag} ${ogUrlTag} ${ogSiteNameTag} ${ogDescriptionTag} ${ogImageWidthTag} ${ogImageHeightTag}`; let ogImageTag = ``; let ogImageTypeTag = ``; let ogTypeTag = ``; if (contentType === 'video/mp4') { const ogVideoTag = ``; const ogVideoSecureUrlTag = ``; const ogVideoTypeTag = ``; ogImageTag = ``; ogImageTypeTag = ``; ogTypeTag = ``; return new Handlebars.SafeString(`${basicTags} ${ogImageTag} ${ogImageTypeTag} ${ogTypeTag} ${ogVideoTag} ${ogVideoSecureUrlTag} ${ogVideoTypeTag}`); } else { if (contentType === 'image/gif') { ogTypeTag = ``; }; return new Handlebars.SafeString(`${basicTags} ${ogImageTag} ${ogImageTypeTag} ${ogTypeTag}`); } }, addTwitterCard ({ contentType, source, embedUrl, directFileUrl }) { const basicTwitterTags = ``; if (contentType === 'video/mp4') { const twitterName = ''; const twitterPlayer = ``; const twitterPlayerWidth = ''; const twitterTextPlayerWidth = ''; const twitterPlayerHeight = ''; const twitterPlayerStream = ``; const twitterPlayerStreamContentType = ''; return new Handlebars.SafeString(`${basicTwitterTags} ${twitterName} ${twitterPlayer} ${twitterPlayerWidth} ${twitterTextPlayerWidth} ${twitterPlayerHeight} ${twitterPlayerStream} ${twitterPlayerStreamContentType}`); } else { const twitterCard = ''; return new Handlebars.SafeString(`${basicTwitterTags} ${twitterCard}`); } }, ifConditional (varOne, operator, varTwo, options) { switch (operator) { case '===': return (varOne === varTwo) ? options.fn(this) : options.inverse(this); case '!==': return (varOne !== varTwo) ? options.fn(this) : options.inverse(this); case '<': return (varOne < varTwo) ? options.fn(this) : options.inverse(this); case '<=': return (varOne <= varTwo) ? options.fn(this) : options.inverse(this); case '>': return (varOne > varTwo) ? options.fn(this) : options.inverse(this); case '>=': return (varOne >= varTwo) ? options.fn(this) : options.inverse(this); case '&&': return (varOne && varTwo) ? options.fn(this) : options.inverse(this); case '||': return (varOne || varTwo) ? options.fn(this) : options.inverse(this); case 'mod3': return ((parseInt(varOne) % 3) === 0) ? options.fn(this) : options.inverse(this); default: return options.inverse(this); } }, };