diff --git a/client/scss/components/_asset-display.scss b/client/scss/components/_asset-display.scss index 20bcfd7d..6950815b 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,6 +16,3 @@ padding: 6px; border: 1px solid #d0d0d0; } -.vertical-split .asset-display { - height: 90vh; -} diff --git a/client/scss/components/_page-layout-show-lite.scss b/client/scss/components/_page-layout-show-lite.scss index fed72885..e243e757 100644 --- a/client/scss/components/_page-layout-show-lite.scss +++ b/client/scss/components/_page-layout-show-lite.scss @@ -2,6 +2,7 @@ flex: 1 0 auto; display: flex; flex-direction: column; + margin: $primary-padding; .content { flex: 1 0 auto; display: flex; diff --git a/index.js b/index.js index be30317c..2c2843c6 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,15 @@ 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({ + async: false, + dataType: 'text', 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..79d7eefa 100644 --- a/server/controllers/pages/sendVideoEmbedPage.js +++ b/server/controllers/pages/sendVideoEmbedPage.js @@ -3,8 +3,11 @@ const { details: { host } } = require('@config/siteConfig'); const sendVideoEmbedPage = ({ params }, res) => { const claimId = params.claimId; const name = params.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', { 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 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 59b5b52f..c9202662 100644 --- a/server/views/layouts/embed.handlebars +++ b/server/views/layouts/embed.handlebars @@ -1,16 +1,16 @@ -
+ -{{{body}}} +{{{ body }}} - \ No newline at end of file + diff --git a/test/test.html b/test/test-embed.html similarity index 99% rename from test/test.html rename to test/test-embed.html index 01a5d622..b0953586 100644 --- a/test/test.html +++ b/test/test-embed.html @@ -9,12 +9,16 @@ +no identifier, no ending
+no identifier, yes ending
+yes identifier, no ending
+yes identifier, yes ending
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 @@ + + + + + + +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
+ + +