Skip to content
This repository was archived by the owner on Jun 23, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion repl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ if script_element?
BASE_PATH = script_element.src.split('/')[...-1].join '/'
SANDBOX_SRC = "#{BASE_PATH}/sandbox.html"
else
throw new Error 'JSREPL script element cannot be found. Make sure you have the ID "jsrepl-script" on it.'
elements = document.getElementsByTagName 'script'
for script_element in elements
if script_element.src.match /^(.*)\/jsrepl(\-\w+)?\.js(\?|$)/ isnt null
BASE_PATH = script_element.src.split('/')[...-1].join '/'
SANDBOX_SRC = "#{BASE_PATH}/sandbox.html"
break
if not BASE_PATH?
throw new Error 'JSREPL script element cannot be found. Make sure you have the ID "jsrepl-script" on it.'

class Loader
constructor: ->
Expand Down