/
editor.coffee
33 lines (22 loc) · 1.03 KB
/
editor.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
29
30
31
32
33
#= require controllers/editor
((plunker) ->
$.extend $.gritter.options,
position: "bottom-right"
plunker = _.defaults (@plunker or {}),
mediator: _.extend {}, Backbone.Events
models: {}
views: {}
controllers: {}
$ ->
# Controller for the editor environment
plunker.controller = new plunker.EditorController
window._gaq ||= []
plunker.mediator.on "event:import", (json, source) -> _gaq.push ["_trackEvent", "Editor", "Import", source]
plunker.mediator.on "event:load", (plunk, id) -> _gaq.push ["_trackEvent", "Editor", "Load", id]
plunker.mediator.on "event:save", (plunk) -> _gaq.push ["_trackEvent", "Editor", "Save", plunk.id]
plunker.mediator.on "event:delete", (plunk) -> _gaq.push ["_trackEvent", "Editor", "Delete", plunk.id]
plunker.mediator.on "event:preview-enable", (plunk) -> _gaq.push ["_trackEvent", "Preview", "Preview", plunk.id]
plunker.mediator.trigger "intent:reset"
Backbone.history.start
pushState: true
)(@plunker ||= {})