diff --git a/index.html b/index.html
index 1135e688..a5ee0595 100644
--- a/index.html
+++ b/index.html
@@ -77,6 +77,10 @@
+
+
+
+
diff --git a/js/index.js b/js/index.js
index fa091189..3ed7cf96 100644
--- a/js/index.js
+++ b/js/index.js
@@ -99,6 +99,15 @@ $(function() {
extra_body: '',
bundleAndExecute: defaultBundleAndExecute
};
+ } else if (backend === "halogen") {
+ return {
+ backend: "halogen",
+ endpoint: "https://compile.purescript.org/halogen",
+ mainGist: "15536d7b4c66ac512b2c8dca98e0e3d3",
+ extra_styling: '',
+ extra_body: '',
+ bundleAndExecute: defaultBundleAndExecute
+ };
} else { // core
return {
backend: "core",
@@ -249,27 +258,6 @@ $(function() {
.empty()
.append($iframe);
- var iframe = $iframe.get(0).contentWindow.document;
- iframe.open();
- iframe.write(
- [''
- , ''
- , ' '
- , ' '
- , ' '
- , ' '
- , ' Try PureScript!'
- , ' '
- , backend.extra_styling
- , ' '
- , ' '
- , backend.extra_body
- , ' '
- , ''
- ].join('\n')
- );
- iframe.close();
-
// Replace any require() statements with the PS['...'] form using a regex substitution.
var replaced = js.replace(/require\("[^"]*"\)/g, function(s) {
@@ -287,23 +275,29 @@ $(function() {
var scripts = [bundle, wrapped].join("\n");
- var script = iframe.createElement('script');
- script.appendChild(iframe.createTextNode(scripts));
-
- $('iframe').ready(function() {
- var checkExists = setInterval(function() {
- var body = iframe.getElementsByTagName('body')[0];
- if (body) {
- body.onclick = function() {
- hideMenus();
- };
- body.appendChild(script);
- clearInterval(checkExists);
- }
- }, 100);
-
- });
-
+ var iframe = $iframe.get(0).contentWindow.document;
+ iframe.open();
+ iframe.write(
+ [''
+ , ''
+ , ' '
+ , ' '
+ , ' '
+ , ' '
+ , ' Try PureScript!'
+ , ' '
+ , backend.extra_styling
+ , ' '
+ , ' '
+ , backend.extra_body
+ , ' '
+ , ' '
+ , ''
+ ].join('\n')
+ );
+ iframe.close();
};
var compile = function() {