This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if @websocket.readyState == 0 | |
| @websocket.onopen => | |
| @_send_data(json, id) | |
| else | |
| @_send_data(json, id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Demo.module "Entities", (Entities, App, Backbone, Marionette, $, _) -> | |
| App.reqres.setHandler "users:entities", -> | |
| promise = $.Deferred() | |
| App.request("socket:get:users").then | |
| (value) -> promise.resolve(value) | |
| promise.promise() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Demo.module "Entities", (Entities, App, Backbone, Marionette, $, _) -> | |
| class Entities.RubyModules extends Entities.Model | |
| App.reqres.setHandler "users:entities", -> | |
| promise = $.Deferred() | |
| App.request("socket:get:users").then | |
| (value) -> promise.resolve(value) | |
| promise.promise() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Demo.module "Entities", (Entities, App, Backbone, Marionette, $, _) -> | |
| class Entities.RubyModules extends Entities.Model | |
| App.reqres.setHandler "users:entities", -> | |
| promise = $.Deferred() | |
| App.request("socket:get:users").then | |
| (value) -> promise.resolve(value) | |
| promise.promise() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="wrap"> | |
| <div id="header-region"></div> | |
| <div class="container-fluid"> | |
| <div class="row-fluid"> | |
| <div class="span3"> | |
| <div class="well sidebar-nav"> | |
| <div id="sidebar-region"></div> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class @SocketAdapter | |
| constructor: (@aggregator, @socket_url) -> | |
| @websocket = new WebSocket(@socket_url) | |
| @websocket.onmessage = message_processor | |
| publish: (args...) => | |
| @aggregator.trigger args... | |
| message_processor: (event) => | |
| message = JSON.parse(event.data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Backbone.Marionette.Renderer.render = (template, data) -> | |
| path = JST["backbone/apps/" + template] | |
| unless path | |
| throw "Template #{template} not found!" | |
| path(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun coffee-init () | |
| (font-lock-add-keywords nil my-extra-keywords) | |
| (define-key coffee-mode-map | |
| (kbd "M-i") 'indent-relative) | |
| (define-key coffee-mode-map | |
| (kbd "M-j") (lambda () (interactive) (forward-line 1) (indent-relative)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (add-hook 'coffee-mode-hook | |
| '(lambda () | |
| (define-key dired-mode-map | |
| (kbd "M-j") '(lambda () (forward-line 1) (indent-relative))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Dialogs.module "EventsApp.Edit", (Edit, App, Backbone, Marionette, $, _) -> | |
| Edit.Controller = | |
| edit: (event) -> | |
| console.log "edit called", event | |
| console.log @ |