on master help sign in
Remove jsaddleJs (correct one is in jsaddle-warp)
7e3f717Hamish Mackenzie
jsaddle/src/Language/Javascript/JSaddle/Run/Files.hs−36
@@ -13,7 +13,6 @@
13
13
14module Language.Javascript.JSaddle.Run.Files (
14module Language.Javascript.JSaddle.Run.Files (
15 indexHtml
15 indexHtml
16− , jsaddleJs
17 , initState
16 , initState
18 , runBatch
17 , runBatch
19 , ghcjsHelpers
18 , ghcjsHelpers
@@ -337,41 +336,6 @@ runBatch send sendSync = "\
337 \ runBatch(batch);\n\
336 \ runBatch(batch);\n\
338 \"
337 \"
339
338
340−-- Use this to generate this string for embedding
341−-- sed -e 's|\\|\\\\|g' -e 's|^| \\|' -e 's|$|\\n\\|' -e 's|"|\\"|g' data/jsaddle.js | pbcopy
342−jsaddleJs :: ByteString
343−jsaddleJs = "\
344− \if(typeof global !== \"undefined\") {\n\
345− \ global.window = global;\n\
346− \ global.WebSocket = require('ws');\n\
347− \}\n\
348− \\n\
349− \var connect = function() {\n\
350− \ var wsaddress =\n\
351− \ typeof window.location === \"undefined\"\n\
352− \ ? \"ws://localhost:3709/\"\n\
353− \ : window.location.protocol.replace('http', 'ws')+\"//\"+window.location.hostname+(window.location.port?(\":\"+window.location.port):\"\");\n\
354− \\n\
355− \ var ws = new WebSocket(wsaddress);\n\
356− \\n\
357− \ ws.onopen = function(e) {\n\
358− \ " <> initState <> "\
359− \\n\
360− \ ws.onmessage = function(e) {\n\
361− \ var batch = JSON.parse(e.data);\n\
362− \\n\
363− \ " <> runBatch (\a -> "ws.send(JSON.stringify(" <> a <> "));") Nothing <> "\
364− \ };\n\
365− \ };\n\
366− \ ws.onerror = function() {\n\
367− \ setTimeout(connect, 1000);\n\
368− \ };\n\
369− \}\n\
370− \\n\
371− \ " <> ghcjsHelpers <> "\
372− \connect();\n\
373− \"
374−
375ghcjsHelpers :: ByteString
339ghcjsHelpers :: ByteString
376ghcjsHelpers = "\
340ghcjsHelpers = "\
377 \function h$isNumber(o) {\
341 \function h$isNumber(o) {\