From 314a4fb880c71bfe94c15931c678d111c61fea00 Mon Sep 17 00:00:00 2001
From: Luke Berndt
Date: Mon, 22 Feb 2021 21:43:19 -0500
Subject: [PATCH] Twitter cards
---
frontend/Dockerfile | 1 +
frontend/public/card.js | 34 -----------------
frontend/public/index.html | 1 +
frontend/server/card.ejs | 75 ++++++++++++++++++++++++++------------
frontend/server/index.ejs | 58 -----------------------------
frontend/server/index.js | 54 ++++++++++++++++++++++++---
6 files changed, 101 insertions(+), 122 deletions(-)
delete mode 100644 frontend/public/card.js
delete mode 100644 frontend/server/index.ejs
diff --git a/frontend/Dockerfile b/frontend/Dockerfile
index e5b8aea..09b56b2 100644
--- a/frontend/Dockerfile
+++ b/frontend/Dockerfile
@@ -21,4 +21,5 @@ RUN cp -a /tmp/node_modules /app
WORKDIR /app
COPY server /app
COPY --from=build /app/build /app/public
+RUN sed 's//<%- TWITTER_META%>/g' /app/public/index.html > /app/index.ejs
CMD ["node", "index.js"]
\ No newline at end of file
diff --git a/frontend/public/card.js b/frontend/public/card.js
deleted file mode 100644
index 8f06a9c..0000000
--- a/frontend/public/card.js
+++ /dev/null
@@ -1,34 +0,0 @@
-'use strict';
-
-// Create an instance
-let wavesurfer;
-
-// Init & load audio file
-document.addEventListener('DOMContentLoaded', function() {
- // Init
- wavesurfer = WaveSurfer.create({
- container: document.querySelector('#waveform'),
- waveColor: '#A8DBA8',
- progressColor: '#3B8686',
- backend: 'MediaElement',
- mediaControls: false
- });
-
- wavesurfer.once('ready', function() {
- console.log('Using wavesurfer.js ' + WaveSurfer.VERSION);
- });
-
- wavesurfer.on('error', function(e) {
- console.warn(e);
- });
-
- // Load audio from URL
- wavesurfer.load('https://s3.us-west-1.wasabisys.com/openmhz-west/media/dcfd-1039-1613917169.m4a');
-
- // toggle play button
- document
- .querySelector('[data-action="play"]')
- .addEventListener('click', wavesurfer.playPause.bind(wavesurfer));
-
-
-});
\ No newline at end of file
diff --git a/frontend/public/index.html b/frontend/public/index.html
index 47ae8c7..3cefde5 100644
--- a/frontend/public/index.html
+++ b/frontend/public/index.html
@@ -9,6 +9,7 @@
name="%REACT_APP_SITE_NAME%"
content="Listen to live Police and Fire radio broadcasts. Archived for 30 days and searchable."
/>
+
-
+ wavesurfer.on("error", function (e) {
+ console.warn(e);
+ });
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+