From 67b5887ba516cd4f9be922aa1fc4fc0c719eb10c Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 2 Jul 2018 18:22:06 -0700 Subject: [PATCH 1/8] fixed layout path --- index.js | 11 ++++++----- server/controllers/pages/sendVideoEmbedPage.js | 2 +- server/views/embed.handlebars | 2 +- server/views/layouts/embed.handlebars | 10 +++++----- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index be30317c..75097f3b 100644 --- a/index.js +++ b/index.js @@ -16,7 +16,6 @@ checkForConfig('siteConfig'); const express = require('express'); const bodyParser = require('body-parser'); const expressHandlebars = require('express-handlebars'); -const Handlebars = require('handlebars'); const helmet = require('helmet'); const cookieSession = require('cookie-session'); const http = require('http'); @@ -81,11 +80,13 @@ function Server () { app.use(speechPassport.session()); // configure handlebars & register it with express app - const hbs = expressHandlebars.create({ + const viewsPath = Path.resolve(process.cwd(), 'node_modules/spee.ch/server/views'); + app.engine('handlebars', expressHandlebars({ defaultLayout: 'embed', - handlebars : Handlebars, - }); - app.engine('handlebars', hbs.engine); + partialsDir: Path.join(viewsPath, '/partials'), + layoutsDir: Path.join(viewsPath, '/layouts') + })); + app.set('views', viewsPath); app.set('view engine', 'handlebars'); // set the routes on the app diff --git a/server/controllers/pages/sendVideoEmbedPage.js b/server/controllers/pages/sendVideoEmbedPage.js index 01f6b1f4..a401360a 100644 --- a/server/controllers/pages/sendVideoEmbedPage.js +++ b/server/controllers/pages/sendVideoEmbedPage.js @@ -4,7 +4,7 @@ const sendVideoEmbedPage = ({ params }, res) => { const claimId = params.claimId; const name = params.name; // get and render the content - res.status(200).render('embed', { layout: 'embed', host, claimId, name }); + res.status(200).render('embed', { host, claimId, name }); }; module.exports = sendVideoEmbedPage; diff --git a/server/views/embed.handlebars b/server/views/embed.handlebars index eb6c4839..c0b2e4f5 100644 --- a/server/views/embed.handlebars +++ b/server/views/embed.handlebars @@ -1 +1 @@ - + diff --git a/server/views/layouts/embed.handlebars b/server/views/layouts/embed.handlebars index 59b5b52f..6626e1f5 100644 --- a/server/views/layouts/embed.handlebars +++ b/server/views/layouts/embed.handlebars @@ -3,14 +3,14 @@ {{{body}}} - \ No newline at end of file + -- 2.45.2 From af0595641ad082861594fc084452da9b413129a2 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 2 Jul 2018 22:47:18 -0700 Subject: [PATCH 2/8] testing iframe page --- index.js | 2 ++ server/controllers/pages/sendVideoEmbedPage.js | 3 +++ server/views/embed.handlebars | 5 ++++- server/views/layouts/embed.handlebars | 14 +++++++------- test/iframeTest.htm | 9 +++++++++ test/test.html | 6 ++++++ 6 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 test/iframeTest.htm diff --git a/index.js b/index.js index 75097f3b..2c2843c6 100644 --- a/index.js +++ b/index.js @@ -82,6 +82,8 @@ function Server () { // configure handlebars & register it with express app const viewsPath = Path.resolve(process.cwd(), 'node_modules/spee.ch/server/views'); app.engine('handlebars', expressHandlebars({ + async: false, + dataType: 'text', defaultLayout: 'embed', partialsDir: Path.join(viewsPath, '/partials'), layoutsDir: Path.join(viewsPath, '/layouts') diff --git a/server/controllers/pages/sendVideoEmbedPage.js b/server/controllers/pages/sendVideoEmbedPage.js index a401360a..3c4cf9af 100644 --- a/server/controllers/pages/sendVideoEmbedPage.js +++ b/server/controllers/pages/sendVideoEmbedPage.js @@ -3,6 +3,9 @@ const { details: { host } } = require('@config/siteConfig'); const sendVideoEmbedPage = ({ params }, res) => { const claimId = params.claimId; const name = params.name; + console.log('HOST:', host); + console.log('CLAIM ID:', claimId); + console.log('NAME:', name); // get and render the content res.status(200).render('embed', { host, claimId, name }); }; diff --git a/server/views/embed.handlebars b/server/views/embed.handlebars index c0b2e4f5..9cc0d40e 100644 --- a/server/views/embed.handlebars +++ b/server/views/embed.handlebars @@ -1 +1,4 @@ - + diff --git a/server/views/layouts/embed.handlebars b/server/views/layouts/embed.handlebars index 6626e1f5..c9202662 100644 --- a/server/views/layouts/embed.handlebars +++ b/server/views/layouts/embed.handlebars @@ -1,16 +1,16 @@ - + -{{{body}}} +{{{ body }}} diff --git a/test/iframeTest.htm b/test/iframeTest.htm new file mode 100644 index 00000000..22af6fef --- /dev/null +++ b/test/iframeTest.htm @@ -0,0 +1,9 @@ + + + + +

i frame:

+

yes identifier, yes ending

+ yes identifier, yes ending + + diff --git a/test/test.html b/test/test.html index 01a5d622..1d92227f 100644 --- a/test/test.html +++ b/test/test.html @@ -17,5 +17,11 @@ yes identifier, no ending

yes identifier, yes ending

yes identifier, yes ending +

i frame:

+ +

i frame:

+ -- 2.45.2 From 802f8ac7c306a2d95cde9388eec6f428a0d5d024 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 3 Jul 2018 09:03:58 -0700 Subject: [PATCH 3/8] updated test --- test/test.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/test.html b/test/test.html index 1d92227f..a594079b 100644 --- a/test/test.html +++ b/test/test.html @@ -17,11 +17,19 @@ yes identifier, no ending

yes identifier, yes ending

yes identifier, yes ending -

i frame:

- -

i frame:

+

i frame 1:

+ +

i frame 2:

+

i frame 3:

+ +

i frame 4:

+ -- 2.45.2 From 04a653fefb762017e5647d26da687343c555f261 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Thu, 12 Jul 2018 11:30:27 -0700 Subject: [PATCH 4/8] updated the iframe test page --- test/iframeTest.htm | 9 ------ test/{test.html => test-embed.html} | 18 +++--------- test/test-iframe.html | 44 +++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 23 deletions(-) delete mode 100644 test/iframeTest.htm rename test/{test.html => test-embed.html} (62%) create mode 100644 test/test-iframe.html diff --git a/test/iframeTest.htm b/test/iframeTest.htm deleted file mode 100644 index 22af6fef..00000000 --- a/test/iframeTest.htm +++ /dev/null @@ -1,9 +0,0 @@ - - - - -

i frame:

-

yes identifier, yes ending

- yes identifier, yes ending - - diff --git a/test/test.html b/test/test-embed.html similarity index 62% rename from test/test.html rename to test/test-embed.html index a594079b..b0953586 100644 --- a/test/test.html +++ b/test/test-embed.html @@ -9,27 +9,17 @@ test embed +

no identifier, no ending

no identifier, no ending +

no identifier, yes ending

no identifier, yes ending +

yes identifier, no ending

yes identifier, no ending +

yes identifier, yes ending

yes identifier, yes ending -

i frame 1:

- -

i frame 2:

- -

i frame 3:

- -

i frame 4:

- diff --git a/test/test-iframe.html b/test/test-iframe.html new file mode 100644 index 00000000..86e4dbff --- /dev/null +++ b/test/test-iframe.html @@ -0,0 +1,44 @@ + + + + + + + Document + + + +

i frame: weather.gov

+ + +

i frame: dev1.spee.ch video direct embed page

+ + +

i frame: dev1.spee.ch image direct asset

+ + +

i frame: image from internet

+ + +

i frame: giphy

+ + +

i frame: giphy 2

+ + + -- 2.45.2 From 7400fba3ad27c6e5203499b5c969ca06b579f955 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Thu, 12 Jul 2018 12:44:53 -0700 Subject: [PATCH 5/8] removed X-Frame-Option from video-embed response headers --- server/controllers/pages/sendVideoEmbedPage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/controllers/pages/sendVideoEmbedPage.js b/server/controllers/pages/sendVideoEmbedPage.js index 3c4cf9af..79d7eefa 100644 --- a/server/controllers/pages/sendVideoEmbedPage.js +++ b/server/controllers/pages/sendVideoEmbedPage.js @@ -3,9 +3,9 @@ const { details: { host } } = require('@config/siteConfig'); const sendVideoEmbedPage = ({ params }, res) => { const claimId = params.claimId; const name = params.name; - console.log('HOST:', host); - console.log('CLAIM ID:', claimId); - console.log('NAME:', name); + // test setting response headers + console.log('removing x-frame-options'); + res.removeHeader('X-Frame-Options'); // get and render the content res.status(200).render('embed', { host, claimId, name }); }; -- 2.45.2 From 8bc5074eb7958366ddadc787eb6b56f171f76500 Mon Sep 17 00:00:00 2001 From: Electron - Mark Firth Date: Sat, 14 Jul 2018 02:18:48 +1000 Subject: [PATCH 6/8] Margin Breaks Flex Vertical Alignment Removing the marking fixes vertical alignment issues when using Flex. --- client/scss/components/_page-layout-show-lite.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/scss/components/_page-layout-show-lite.scss b/client/scss/components/_page-layout-show-lite.scss index e243e757..b4d4976e 100644 --- a/client/scss/components/_page-layout-show-lite.scss +++ b/client/scss/components/_page-layout-show-lite.scss @@ -2,7 +2,7 @@ flex: 1 0 auto; display: flex; flex-direction: column; - margin: $primary-padding; + /*margin: $primary-padding;*/ .content { flex: 1 0 auto; display: flex; -- 2.45.2 From 235ebf19baef21f488178da07126a7bf951722e8 Mon Sep 17 00:00:00 2001 From: Electron - Mark Firth Date: Sat, 14 Jul 2018 02:26:04 +1000 Subject: [PATCH 7/8] Keeps Content In View Keeps content in view at any size. --- client/scss/components/_asset-display.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/scss/components/_asset-display.scss b/client/scss/components/_asset-display.scss index 6950815b..20bcfd7d 100644 --- a/client/scss/components/_asset-display.scss +++ b/client/scss/components/_asset-display.scss @@ -2,7 +2,7 @@ flex: 1 0 auto; display: flex; justify-content: center; - /*align-items: center;*/ + flex-direction: column; } @@ -16,3 +16,6 @@ padding: 6px; border: 1px solid #d0d0d0; } +.vertical-split .asset-display { + height: 90vh; +} -- 2.45.2 From c4794230d21d5d0876adff3e3c37da29069a0a08 Mon Sep 17 00:00:00 2001 From: Bill Bittner Date: Mon, 16 Jul 2018 11:23:28 -0700 Subject: [PATCH 8/8] Update _page-layout-show-lite.scss --- client/scss/components/_page-layout-show-lite.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/client/scss/components/_page-layout-show-lite.scss b/client/scss/components/_page-layout-show-lite.scss index b4d4976e..fed72885 100644 --- a/client/scss/components/_page-layout-show-lite.scss +++ b/client/scss/components/_page-layout-show-lite.scss @@ -2,7 +2,6 @@ flex: 1 0 auto; display: flex; flex-direction: column; - /*margin: $primary-padding;*/ .content { flex: 1 0 auto; display: flex; -- 2.45.2