guardian/frontend — pull request #3823 by chrisfinch (2014-04-08 11:11:58+00:00)
Title: Formstack unsecured content madness

## Justifying this madness

The id team has been working on trying to implement an interactives style embeddable component that will allow editorial staff to create forms on formstack using wysiwyg tools and then embed that form in content via composer.

Due to the requirements on the forms, such as passing along signed in users details, the iframes the forms are in need to be served over HTTPS. This has cause any, mostly IE related problems with content being pulled in from the frontend stack of NGW that is not secure.

There are also other issues caused by loading in all of the NGW stack just for this small single page iframe.

This ***terrible code*** aims to knock all that on the head for the time being by **isolating** the formstack iframe and inlining all code for the running of the iframe within the page itself.

## What have I done?

I have taken all relevant css and javascript for the page, refactored it to remove all dependancies and inlined it in to the formstack page.

## What's the aim?

Ideally the formstack form should render and work as it currently does, but in isolation and hopefully in IE over HTTPS.

## Why this is a bad idea and what we are going to do about it

This is terrible because there is now a lot of repetition of identity css and javascript between the iframe page and the NGW frontend stack.

Currently this is unavoidable if we want to completely separate the page from the NGW require stack.

This is understood by the identity team and we will endeavour to find a better, more permanent, DRY'er solution in the future - but for the time being this will hopefully solve our HTTPS problems and allow IE users to benefit from the feature.

All of this has been run by the team including @rtyley and this stopgap solution should solve our current problem.