Code coverage report for code/app.coffee

Statements: 0% (0 / 19)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 0% (0 / 15)      Ignored: none     

All files » code/ » app.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28                                                       
AppView     = React.createFactory require './views/app-view'
GraphStore = require './stores/graph-store'
CodapConnect = require './models/codap-connect'
 
getParameterByName = (name) ->
  name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]')
  regex = new RegExp "[#&]#{name}=([^&]*)"
  results = regex.exec(location.hash)
  if results is null then "" else decodeURIComponent results[1].replace(/\+/g, ' ')
 
window.initApp = (wireframes=false) ->
  opts =
    # Valid opts are:
    # graphStore: store for the node-link graph
    # url: Where to load json e.g.'json/serialized.json'
    # data: the json to load (compare with url above)
    graphStore: GraphStore.store
    url: getParameterByName 'url'
    data: getParameterByName 'data'
    simplified: getParameterByName 'simplified'
 
  opts.codapConnect = CodapConnect.instance 'building-models'
  appView = AppView opts
  elem = '#app'
 
  jsPlumb.bind 'ready', ->
    React.render appView, $(elem)[0]