From 921497ea52a2779cbc2d1f563c845ef8d4d377d1 Mon Sep 17 00:00:00 2001 From: mama Date: Mon, 15 Jan 2018 16:47:49 +0100 Subject: [PATCH] =?UTF-8?q?Pas=20d'en-t=C3=AAte=20en=20mode=20iframe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iframe.html | 1 + package.json | 25 ++++++++++++++++--------- source/components/pages/Header.js | 3 +++ source/components/themeColours.js | 8 ++------ source/containers/Layout.js | 2 +- source/utils.js | 5 +++++ 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/iframe.html b/iframe.html index 2b31edcc9..b1744a81e 100644 --- a/iframe.html +++ b/iframe.html @@ -23,6 +23,7 @@ var scriptEl = document.createElement('script') scriptEl.setAttribute('type', 'text/javascript') scriptEl.setAttribute('src', 'dist/bundle.js') scriptEl.setAttribute('couleur', '#' + couleur) +scriptEl.setAttribute('iframe', true) document.body.appendChild(scriptEl) diff --git a/package.json b/package.json index 7559a961b..e4090685e 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "reduce-reducers": "^0.1.2", "redux": "^3.7.2", "redux-form": "6.8.0", - "redux-saga": "^0.15.3", "reselect": "^3.0.1", "whatwg-fetch": "^2.0.3", "yaml-loader": "^0.5.0" @@ -95,13 +94,21 @@ }, "scripts": { "start": "node source/server.js", - "compile": "NODE_ENV='production' webpack --config source/webpack.config.js", - "surge": "npm run compile && surge --domain scientific-wish.surge.sh -p ./ && rm -rf dist/", - "test": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\"", - "test-watch": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch", - "test-meca": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch", - "test-rules": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/real-rules.test.js --watch", - "heroku-postbuild": "npm install --dev && webpack --config source/webpack.config.js --progress", - "test-inversions": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/inversion.test.js\" --watch" + "compile": + "NODE_ENV='production' webpack --config source/webpack.config.js", + "surge": + "npm run compile && surge --domain scientific-wish.surge.sh -p ./ && rm -rf dist/", + "test": + "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\"", + "test-watch": + "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch", + "test-meca": + "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch", + "test-rules": + "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/real-rules.test.js --watch", + "heroku-postbuild": + "npm install --dev && webpack --config source/webpack.config.js --progress", + "test-inversions": + "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/inversion.test.js\" --watch" } } diff --git a/source/components/pages/Header.js b/source/components/pages/Header.js index d25f44d57..38107d50b 100644 --- a/source/components/pages/Header.js +++ b/source/components/pages/Header.js @@ -1,6 +1,7 @@ import React, { Component } from 'react' import 'Components/pages/Header.css' import { Link } from 'react-router-dom' +import { getJsScriptAttribute } from '../../utils' export default class Header extends Component { state = { @@ -15,6 +16,8 @@ export default class Header extends Component { ) if (!displayHeader) return null + if (getJsScriptAttribute('iframe')()) return null + return (