Sha256: 9ca6cb336a8cb3f4a69e9e4ada91397fc5da0f211e6e42ed2a60c2e26450298c

Contents?: true

Size: 854 Bytes

Versions: 3

Compression:

Stored size: 854 Bytes

Contents

module.exports = iface = {}

global            = if typeof(window) isnt "undefined" then window else global

registry = {pages:{}, apis: {}, components: {}}

iface.loaded = ->
  _.extend(registry.apis, require("./apis"))
  _.extend(registry.pages, require("./pages"))
  _.extend(registry.components, require("./components"))
  iface

iface.setPage = (name, componentClass)->
  registry.pages[name] = componentClass

iface.setComponent = (name, componentClass)->
  registry.component[name] = componentClass

iface.setApi = (name, component)->
  registry.apis[name] = component

iface.getPage = (identifier)->
  registry.pages[identifier]

iface.getComponent = (identifier)->
  registry.components[identifier]

iface.getApi = (identifier)->
  registry.apis[identifier]

iface.globalized = ->
  for prop, val of iface
    global[prop] = iface[val]

  iface

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stylish-0.3.1 support/editor-app/development/src/registry.coffee
stylish-0.3.0 support/editor-app/development/src/registry.coffee
stylish-0.0.2 support/editor-app/development/src/registry.coffee