diff --git a/client/build/components/DropzoneInstructionsDisplay/index.js b/client/build/components/DropzoneInstructionsDisplay/index.js index fdaec59e..04139032 100644 --- a/client/build/components/DropzoneInstructionsDisplay/index.js +++ b/client/build/components/DropzoneInstructionsDisplay/index.js @@ -9,22 +9,26 @@ var _react = _interopRequireDefault(require("react")); var _FormFeedbackDisplay = _interopRequireDefault(require("@components/FormFeedbackDisplay")); +var _Row = _interopRequireDefault(require("@components/Row")); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var DropzoneInstructionsDisplay = function DropzoneInstructionsDisplay(_ref) { var fileError = _ref.fileError; return _react.default.createElement("div", { className: 'dropzone-instructions-display' - }, _react.default.createElement("p", { + }, _react.default.createElement(_Row.default, null, _react.default.createElement("p", { className: 'text--large' - }, "Drag & drop image or video here to publish"), _react.default.createElement("p", { + }, "Drag & drop image or video here to publish")), _react.default.createElement(_Row.default, null, _react.default.createElement("p", { className: 'text--small' - }, "OR"), _react.default.createElement("p", { + }, "OR")), fileError ? _react.default.createElement("div", null, _react.default.createElement(_Row.default, null, _react.default.createElement("p", { className: 'text--large text--underline' - }, "CHOOSE FILE"), _react.default.createElement(_FormFeedbackDisplay.default, { + }, "CHOOSE FILE")), _react.default.createElement(_FormFeedbackDisplay.default, { errorMessage: fileError, defaultMessage: false - })); + })) : _react.default.createElement("p", { + className: 'text--large text--underline' + }, "CHOOSE FILE")); }; var _default = DropzoneInstructionsDisplay; diff --git a/client/scss/_variables.scss b/client/scss/_variables.scss index 2716def5..26f125d8 100644 --- a/client/scss/_variables.scss +++ b/client/scss/_variables.scss @@ -8,6 +8,7 @@ $failure-color: red; $primary-padding: 3em; $secondary-padding: 2em; +$tertiary-padding: 1em; $thin-padding: 0.3em; $full-width-thin-padding: calc(100% - 0.6em); diff --git a/client/scss/components/_nav-bar.scss b/client/scss/components/_nav-bar.scss index e61211bf..8d5e3f37 100644 --- a/client/scss/components/_nav-bar.scss +++ b/client/scss/components/_nav-bar.scss @@ -8,7 +8,7 @@ } .nav-bar-link { - padding: $secondary-padding; + padding: calc(1em - 2px); display: inline-block; } diff --git a/client/src/components/DropzoneInstructionsDisplay/index.jsx b/client/src/components/DropzoneInstructionsDisplay/index.jsx index cb06392b..3f13c69f 100644 --- a/client/src/components/DropzoneInstructionsDisplay/index.jsx +++ b/client/src/components/DropzoneInstructionsDisplay/index.jsx @@ -1,16 +1,29 @@ import React from 'react'; import FormFeedbackDisplay from '@components/FormFeedbackDisplay'; +import Row from '@components/Row'; const DropzoneInstructionsDisplay = ({fileError}) => { return (
-

Drag & drop image or video here to publish

-

OR

-

CHOOSE FILE

- + +

Drag & drop image or video here to publish

+
+ +

OR

+
+ { fileError ? ( +
+ +

CHOOSE FILE

+
+ +
+ ) : ( +

CHOOSE FILE

+ )}
); }; 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 eb6c4839..6b1a4ed6 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 @@ 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 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

+ + +