id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:completion | completion | ###global define###
define ['use!angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ->
$scope.searchTerm = ''
$scope.tweets = {}
$scop... | $location.path "/twitter/#{searchTerm}"
$scope.$on '$afterRouteChange', (event, currentRoute, priorRoute) ->
return if not currentRoute or not currentRoute.$route or not currentRoute.$route.controller or currentRoute.$route.controller isnt 'twitterController'
searchTerm = currentRoute.params.searchTerm
if... | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851 | 672 | https://github.com/CaryLandholt/AngularFun/blob/dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851/scripts/controllers/twitterController.coffee | 1 | 21 |
abe33/atom-pigments:spec/palette-spec.coffee:1:raw_corpus | raw_corpus | require './helpers/matchers'
Color = require '../lib/color'
Palette = require '../lib/palette'
describe 'Palette', ->
[palette, colors] = []
createVar = (name, color, path, line) ->
{name, color, path, line}
beforeEach ->
colors = [
createVar 'red', new Color('#ff0000'), 'file.styl', 0
cre... | CoffeeScript | abe33/atom-pigments | spec/palette-spec.coffee | MIT | 4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4 | 518 | https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/spec/palette-spec.coffee | 1 | 50 | ||
abe33/atom-pigments:spec/palette-spec.coffee:1:completion | completion | require './helpers/matchers'
Color = require '../lib/color'
Palette = require '../lib/palette'
describe 'Palette', ->
[palette, colors] = []
createVar = (name, color, path, line) ->
{name, color, path, line}
beforeEach ->
colors = [
createVar 'red', new Color('#ff0000'), 'file.styl', 0
cre... | describe '::getColorsNames', ->
it 'returns the names of the colors in the palette', ->
expect(palette.getColorsNames()).toEqual([
'red'
'green'
'blue'
'redCopy'
'red'
])
describe '::sortedByName', ->
it 'returns the colors and names sorted by name', ->
... | CoffeeScript | CoffeeScript | abe33/atom-pigments | spec/palette-spec.coffee | MIT | 4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4 | 518 | https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/spec/palette-spec.coffee | 1 | 50 |
abe33/atom-pigments:spec/palette-spec.coffee:1:raw_corpus | raw_corpus | require './spec-helper'
Color = require '../lib/color'
Palette = require '../lib/palette'
describe 'Palette', ->
[palette, colors] = []
createVar = (name, color, path, line) ->
{name, color, path, line}
beforeEach ->
colors = [
createVar 'red', new Color('#ff0000'), 'file.styl', 0
createVa... | CoffeeScript | abe33/atom-pigments | spec/palette-spec.coffee | MIT | 4fe151a7c41894f39656b9b1c1166fcfd5d27c28 | 518 | https://github.com/abe33/atom-pigments/blob/4fe151a7c41894f39656b9b1c1166fcfd5d27c28/spec/palette-spec.coffee | 1 | 50 | ||
abe33/atom-pigments:spec/palette-spec.coffee:1:completion | completion | require './spec-helper'
Color = require '../lib/color'
Palette = require '../lib/palette'
describe 'Palette', ->
[palette, colors] = []
createVar = (name, color, path, line) ->
{name, color, path, line}
beforeEach ->
colors = [
createVar 'red', new Color('#ff0000'), 'file.styl', 0
createVa... | describe '::getColorsNames', ->
it 'returns the names of the colors in the palette', ->
expect(palette.getColorsNames()).toEqual([
'red'
'green'
'blue'
'redCopy'
'red'
])
describe '::sortedByName', ->
it 'returns the colors and names sorted by name', ->
... | CoffeeScript | CoffeeScript | abe33/atom-pigments | spec/palette-spec.coffee | MIT | 4fe151a7c41894f39656b9b1c1166fcfd5d27c28 | 518 | https://github.com/abe33/atom-pigments/blob/4fe151a7c41894f39656b9b1c1166fcfd5d27c28/spec/palette-spec.coffee | 1 | 50 |
abe33/atom-pigments:spec/palette-spec.coffee:1:raw_corpus | raw_corpus | require './spec-helper'
Color = require '../lib/color'
Palette = require '../lib/palette'
describe 'Palette', ->
[palette, colors] = []
createVar = (name, color, path, line) ->
{name, color, path, line}
beforeEach ->
colors = [
createVar 'red', new Color '#ff0000', 'file.styl', 0
createVar... | CoffeeScript | abe33/atom-pigments | spec/palette-spec.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/spec/palette-spec.coffee | 1 | 50 | ||
abe33/atom-pigments:spec/palette-spec.coffee:1:completion | completion | require './spec-helper'
Color = require '../lib/color'
Palette = require '../lib/palette'
describe 'Palette', ->
[palette, colors] = []
createVar = (name, color, path, line) ->
{name, color, path, line}
beforeEach ->
colors = [
createVar 'red', new Color '#ff0000', 'file.styl', 0
createVar... | describe '::getColorsNames', ->
it 'returns the names of the colors in the palette', ->
expect(palette.getColorsNames()).toEqual([
'red'
'green'
'blue'
'redCopy'
'red'
])
describe '::sortedByName', ->
it 'returns the colors and names sorted by name', ->
... | CoffeeScript | CoffeeScript | abe33/atom-pigments | spec/palette-spec.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/spec/palette-spec.coffee | 1 | 50 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:raw_corpus | raw_corpus | Dialog = require "./dialog"
module.exports =
class RenameDialog extends Dialog
constructor: (@terminal) ->
super
prompt: "Rename"
iconClass: "icon-pencil"
placeholderText: @terminal.getName()
onConfirm: (newTitle) ->
@terminal.setName newTitle.trim()
@cancel() | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 1e555ee3a49902b203134072ff079ae580fdff10 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1e555ee3a49902b203134072ff079ae580fdff10/lib/rename-dialog.coffee | 1 | 13 | ||
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:completion | completion | Dialog = require "./dialog"
module.exports =
class RenameDialog extends Dialog
constructor: (@terminal) ->
super | prompt: "Rename"
iconClass: "icon-pencil"
placeholderText: @terminal.getName()
onConfirm: (newTitle) ->
@terminal.setName newTitle.trim()
@cancel() | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 1e555ee3a49902b203134072ff079ae580fdff10 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1e555ee3a49902b203134072ff079ae580fdff10/lib/rename-dialog.coffee | 1 | 13 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:raw_corpus | raw_corpus | Dialog = require "./dialog"
module.exports =
class RenameDialog extends Dialog
constructor: (@view) ->
super
prompt: "Rename"
iconClass: "icon-pencil"
placeholderText: @view.getName()
onConfirm: (newTitle) ->
@view.setName newTitle.trim()
@cancel() | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 2252b401b7c65d5b7af491721752f21632e999f8 | 478 | https://github.com/jeremyramin/terminal-plus/blob/2252b401b7c65d5b7af491721752f21632e999f8/lib/rename-dialog.coffee | 1 | 13 | ||
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:completion | completion | Dialog = require "./dialog"
module.exports =
class RenameDialog extends Dialog
constructor: (@view) ->
super | prompt: "Rename"
iconClass: "icon-pencil"
placeholderText: @view.getName()
onConfirm: (newTitle) ->
@view.setName newTitle.trim()
@cancel() | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 2252b401b7c65d5b7af491721752f21632e999f8 | 478 | https://github.com/jeremyramin/terminal-plus/blob/2252b401b7c65d5b7af491721752f21632e999f8/lib/rename-dialog.coffee | 1 | 13 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:raw_corpus | raw_corpus | Dialog = require "./dialog"
module.exports =
class RenameDialog extends Dialog
constructor: (@statusIcon) ->
super
prompt: "Rename"
iconClass: "icon-pencil"
placeholderText: @statusIcon.getName()
onConfirm: (newTitle) ->
@statusIcon.updateName newTitle.trim()
@cancel() | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 040c0e72707d0d66f86550afc8ba4ffb60037176 | 478 | https://github.com/jeremyramin/terminal-plus/blob/040c0e72707d0d66f86550afc8ba4ffb60037176/lib/rename-dialog.coffee | 1 | 13 | ||
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:completion | completion | Dialog = require "./dialog"
module.exports =
class RenameDialog extends Dialog
constructor: (@statusIcon) ->
super | prompt: "Rename"
iconClass: "icon-pencil"
placeholderText: @statusIcon.getName()
onConfirm: (newTitle) ->
@statusIcon.updateName newTitle.trim()
@cancel() | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 040c0e72707d0d66f86550afc8ba4ffb60037176 | 478 | https://github.com/jeremyramin/terminal-plus/blob/040c0e72707d0d66f86550afc8ba4ffb60037176/lib/rename-dialog.coffee | 1 | 13 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:raw_corpus | raw_corpus | {TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus rename-dialog', =>
@label 'Rename', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
@label 'Escape (Esc) to exit', style... | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | edc2595496780694aa416e7a8636a92a91c5d694 | 478 | https://github.com/jeremyramin/terminal-plus/blob/edc2595496780694aa416e7a8636a92a91c5d694/lib/rename-dialog.coffee | 1 | 34 | ||
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus rename-dialog', =>
@label 'Rename', outlet: 'promptText'
@subview 'miniEditor', new TextEditorVi... | var RenameDialog, TextEditorView, View;
({TextEditorView, View} = require('atom-space-pen-views'));
module.exports = RenameDialog = class RenameDialog extends View {
static content() {
return this.div({
class: 'terminal-plus rename-dialog'
}, () => {
this.label('Rename', {
outlet: 'promp... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | edc2595496780694aa416e7a8636a92a91c5d694 | 478 | https://github.com/jeremyramin/terminal-plus/blob/edc2595496780694aa416e7a8636a92a91c5d694/lib/rename-dialog.coffee | 1 | 34 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var RenameDialog, TextEditorView, View;
({TextEditorView, View} = require('atom-space-pen-views'));
module.exports = RenameDialog = class RenameDialog extends View {
static content() {
return this.div({
class: 'terminal-plus rename-dialog'
}, () =... | {TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus rename-dialog', =>
@label 'Rename', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
@label 'Escape (Esc) to exit', style... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | edc2595496780694aa416e7a8636a92a91c5d694 | 478 | https://github.com/jeremyramin/terminal-plus/blob/edc2595496780694aa416e7a8636a92a91c5d694/lib/rename-dialog.coffee | 1 | 34 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:completion | completion | {TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus rename-dialog', =>
@label 'Rename', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
@label 'Escape (Esc) to exit', style... | @miniEditor.on 'blur', => @close()
@miniEditor.getModel().setText @statusIcon.getName()
@miniEditor.getModel().selectAll()
attach: ->
@panel = atom.workspace.addModalPanel(item: this.element)
@miniEditor.focus()
@miniEditor.getModel().scrollToCursorPosition()
close: ->
panelToDestroy = @pa... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | edc2595496780694aa416e7a8636a92a91c5d694 | 478 | https://github.com/jeremyramin/terminal-plus/blob/edc2595496780694aa416e7a8636a92a91c5d694/lib/rename-dialog.coffee | 1 | 34 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:raw_corpus | raw_corpus | {$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
initialize: (@statusI... | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 1887fccfb2cc312f1b97cbf36728007c89f581e2 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1887fccfb2cc312f1b97cbf36728007c89f581e2/lib/rename-dialog.coffee | 1 | 32 | ||
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor'... | var $, RenameDialog, TextEditorView, View;
({$, TextEditorView, View} = require('atom-space-pen-views'));
module.exports = RenameDialog = class RenameDialog extends View {
static content() {
return this.div({
class: 'terminal-plus-rename-dialog'
}, () => {
this.label('Rename', {
class: '... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 1887fccfb2cc312f1b97cbf36728007c89f581e2 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1887fccfb2cc312f1b97cbf36728007c89f581e2/lib/rename-dialog.coffee | 1 | 32 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $, RenameDialog, TextEditorView, View;
({$, TextEditorView, View} = require('atom-space-pen-views'));
module.exports = RenameDialog = class RenameDialog extends View {
static content() {
return this.div({
class: 'terminal-plus-rename-dialog'
}... | {$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
initialize: (@statusI... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 1887fccfb2cc312f1b97cbf36728007c89f581e2 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1887fccfb2cc312f1b97cbf36728007c89f581e2/lib/rename-dialog.coffee | 1 | 32 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:completion | completion | {$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
initialize: (@statusI... | @miniEditor.getModel().setText @statusIcon.getName()
@miniEditor.getModel().selectAll()
attach: ->
@panel = atom.workspace.addModalPanel(item: this.element)
@miniEditor.focus()
@miniEditor.getModel().scrollToCursorPosition()
close: ->
panelToDestroy = @panel
@panel = null
panelToDestro... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 1887fccfb2cc312f1b97cbf36728007c89f581e2 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1887fccfb2cc312f1b97cbf36728007c89f581e2/lib/rename-dialog.coffee | 1 | 32 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:raw_corpus | raw_corpus | {$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
initialize: (@statusI... | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 119e2fd372a9a90f1aaf4231431daa8dd41a284f | 478 | https://github.com/jeremyramin/terminal-plus/blob/119e2fd372a9a90f1aaf4231431daa8dd41a284f/lib/rename-dialog.coffee | 1 | 32 | ||
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor'... | var $, RenameDialog, TextEditorView, View;
({$, TextEditorView, View} = require('atom-space-pen-views'));
module.exports = RenameDialog = class RenameDialog extends View {
static content() {
return this.div({
class: 'terminal-plus-rename-dialog'
}, () => {
this.label('Rename', {
class: '... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 119e2fd372a9a90f1aaf4231431daa8dd41a284f | 478 | https://github.com/jeremyramin/terminal-plus/blob/119e2fd372a9a90f1aaf4231431daa8dd41a284f/lib/rename-dialog.coffee | 1 | 32 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $, RenameDialog, TextEditorView, View;
({$, TextEditorView, View} = require('atom-space-pen-views'));
module.exports = RenameDialog = class RenameDialog extends View {
static content() {
return this.div({
class: 'terminal-plus-rename-dialog'
}... | {$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
initialize: (@statusI... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 119e2fd372a9a90f1aaf4231431daa8dd41a284f | 478 | https://github.com/jeremyramin/terminal-plus/blob/119e2fd372a9a90f1aaf4231431daa8dd41a284f/lib/rename-dialog.coffee | 1 | 32 |
jeremyramin/terminal-plus:lib/rename-dialog.coffee:1:completion | completion | {$, TextEditorView, View} = require 'atom-space-pen-views'
module.exports =
class RenameDialog extends View
@content: () ->
@div class: 'terminal-plus-rename-dialog', =>
@label 'Rename', class: 'icon', outlet: 'promptText'
@subview 'miniEditor', new TextEditorView(mini: true)
initialize: (@statusI... | @miniEditor.getModel().setText @statusIcon.getName()
@miniEditor.getModel().selectAll()
attach: ->
@panel = atom.workspace.addModalPanel(item: this.element)
@miniEditor.focus()
@miniEditor.getModel().scrollToCursorPosition()
close: ->
panelToDestroy = @panel
@panel = null
panelToDestro... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/rename-dialog.coffee | MIT | 119e2fd372a9a90f1aaf4231431daa8dd41a284f | 478 | https://github.com/jeremyramin/terminal-plus/blob/119e2fd372a9a90f1aaf4231431daa8dd41a284f/lib/rename-dialog.coffee | 1 | 32 |
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:1:raw_corpus | raw_corpus | React = require 'react'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
lang = require '../locales/lang'
detect = require '../util/detect'
mixinSubscribe = require '../mixin/subscribe'
LightDropdown = React.createFactory require '../... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
lang = require '../locales/lang'
detect = require '../util/detect'
mixinSubscribe = require '../mixin/sub... | var LightDropdown, PureRenderMixin, React, T, cx, detect, div, lang, mixinSubscribe, query, recorder;
React = require('react');
recorder = require('actions-recorder');
PureRenderMixin = require('react-addons-pure-render-mixin');
query = require('../query');
lang = require('../locales/lang');
detect = require('../... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var LightDropdown, PureRenderMixin, React, T, cx, detect, div, lang, mixinSubscribe, query, recorder;
React = require('react');
recorder = require('actions-recorder');
PureRenderMixin = require('react-addons-pure-render-mixin');
query = require('../query');
la... | React = require 'react'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
lang = require '../locales/lang'
detect = require '../util/detect'
mixinSubscribe = require '../mixin/subscribe'
LightDropdown = React.createFactory require '../... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:1:completion | completion | React = require 'react'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
lang = require '../locales/lang'
detect = require '../util/detect'
mixinSubscribe = require '../mixin/subscribe'
LightDropdown = React.createFactory require '../... | onItemClick: T.func.isRequired
getInitialState: ->
topics: @getTopics()
showMenu: false
componentDidMount: ->
@subscribe recorder, =>
@setState topics: @getTopics()
getTopics: ->
query.topicsBy(recorder.getState(), @props._teamId)
getTopicName: (topic) ->
if topic.get('isGeneral')... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:2:raw_corpus | raw_corpus | onMenuToggle: ->
@setState showMenu: (not @state.showMenu)
renderTopics: ->
_userId = query.userId(recorder.getState())
@state.topics
.filter (room) ->
detect.inChannel(room)
.map (topic) =>
onClick = =>
@props.onItemClick topic.get('_id')
div key: topic.get('_id'), cla... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 51 | 72 | ||
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
onMenuToggle: ->
@setState showMenu: (not @state.showMenu)
renderTopics: ->
_userId = query.userId(recorder.getState())
@state.topics
.filter (room) ->
detect.inChannel(room)
.map (topic) =>
onClick = =>
@props.onItemCl... | ({
onMenuToggle: function() {
return this.setState({
showMenu: !this.state.showMenu
});
},
renderTopics: function() {
var _userId;
_userId = query.userId(recorder.getState());
return this.state.topics.filter(function(room) {
return detect.inChannel(room);
}).map((topic) => {
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 51 | 72 |
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
onMenuToggle: function() {
return this.setState({
showMenu: !this.state.showMenu
});
},
renderTopics: function() {
var _userId;
_userId = query.userId(recorder.getState());
return this.state.topics.filter(function(room) {
re... | onMenuToggle: ->
@setState showMenu: (not @state.showMenu)
renderTopics: ->
_userId = query.userId(recorder.getState())
@state.topics
.filter (room) ->
detect.inChannel(room)
.map (topic) =>
onClick = =>
@props.onItemClick topic.get('_id')
div key: topic.get('_id'), cla... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 51 | 72 |
jianliaoim/talk-os:talk-web/client/app/topic-selector.coffee:2:completion | completion | onMenuToggle: ->
@setState showMenu: (not @state.showMenu)
renderTopics: ->
_userId = query.userId(recorder.getState())
@state.topics
.filter (room) ->
detect.inChannel(room)
.map (topic) =>
onClick = => | @props.onItemClick topic.get('_id')
div key: topic.get('_id'), className: 'item', onClick: onClick, @getTopicName(topic)
render: ->
LightDropdown
displayText: if @props.chosen? then @getChosenName()
defaultText: lang.getText('choose-a-topic')
name: 'topic-selector'
show: @state.show... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-selector.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-selector.coffee | 51 | 72 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'team-configs'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf(Immutable.Map)
hasPermission: T.bool.isRequired
onClose: T.func.isRequired
getInitialState: ->
name: @props.data.get 'name'
description: @props.data.get ... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 24 | 73 | ||
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'team-configs'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf(Immutable.Map)
hasPermission: T.bool.isRequired
onClose: T.func.isRequired
getInitialState: ->
name:... | module.exports = React.createClass({
displayName: 'team-configs',
mixins: [PureRenderMixin],
propTypes: {
data: T.instanceOf(Immutable.Map),
hasPermission: T.bool.isRequired,
onClose: T.func.isRequired
},
getInitialState: function() {
return {
name: this.props.data.get('name'),
des... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 24 | 73 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'team-configs',
mixins: [PureRenderMixin],
propTypes: {
data: T.instanceOf(Immutable.Map),
hasPermission: T.bool.isRequired,
onClose: T.func.isRequired
},
getInitialState: function() {
retu... | module.exports = React.createClass
displayName: 'team-configs'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf(Immutable.Map)
hasPermission: T.bool.isRequired
onClose: T.func.isRequired
getInitialState: ->
name: @props.data.get 'name'
description: @props.data.get ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 24 | 73 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'team-configs'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf(Immutable.Map)
hasPermission: T.bool.isRequired
onClose: T.func.isRequired
getInitialState: ->
name: @props.data.get 'name'
description: @props.data.get ... | onShortNameChange: (event) ->
if @props.hasPermission
if event.target.value.length > 0
isErrorShortName = not (/^[a-z_-]+$/i).test event.target.value
@setState
shortName: event.target.value
isErrorShortName: isErrorShortName
needSave: ->
isValidName = @state.name isnt @pr... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 24 | 73 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:2:raw_corpus | raw_corpus | if @state.isErrorShortName
return
data =
name: @state.name
description: @state.description
logoUrl: @state.logoUrl
if @state.shortName.trim().length then data.shortName = @state.shortName
teamActions.teamUpdate @props.data.get('_id'), data, (resp) =>
@props.onClose()
onSa... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 74 | 123 | ||
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @state.isErrorShortName
return
data =
name: @state.name
description: @state.description
logoUrl: @state.logoUrl
if @state.shortName.trim().length then data.shortName = @state.shortName
teamActions.teamUpdate @props.data.g... | var data;
if (this.state.isErrorShortName) {
return;
}
data = {
name: this.state.name,
description: this.state.description,
logoUrl: this.state.logoUrl
};
if (this.state.shortName.trim().length) {
data.shortName = this.state.shortName;
}
teamActions.teamUpdate(this.props.data.get('_id'), data, (resp) => {... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 74 | 123 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var data;
if (this.state.isErrorShortName) {
return;
}
data = {
name: this.state.name,
description: this.state.description,
logoUrl: this.state.logoUrl
};
if (this.state.shortName.trim().length) {
data.shortName = this.state.shortName;
}
teamActions.t... | if @state.isErrorShortName
return
data =
name: @state.name
description: @state.description
logoUrl: @state.logoUrl
if @state.shortName.trim().length then data.shortName = @state.shortName
teamActions.teamUpdate @props.data.get('_id'), data, (resp) =>
@props.onClose()
onSa... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 74 | 123 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:2:completion | completion | if @state.isErrorShortName
return
data =
name: @state.name
description: @state.description
logoUrl: @state.logoUrl
if @state.shortName.trim().length then data.shortName = @state.shortName
teamActions.teamUpdate @props.data.get('_id'), data, (resp) =>
@props.onClose()
onSa... | teamActions.teamUpdate @props.data.get('_id'), data
onLogoUpload: ->
uploadUtil.handleClick
accept: ".jpg,.jpeg,.bmp,.png"
onCreate: @onUploaderCreate
onSuccess: @onUploaderComplete
onError: handlers.fileError
onUploaderCreate: ({file}) ->
image = FileAPI.Image file
image.previ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 74 | 123 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:3:raw_corpus | raw_corpus | div className: 'logo-area', style: style, onClick: @onLogoUpload
else
div className: 'logo-area', onClick: @onLogoUpload, @props.data.get('name')[0]
render: ->
readOnly = (not @props.hasPermission)
className = cx 'form-group', { 'is-disabled': !@props.hasPermission }
div className: 'team-... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 124 | 173 | ||
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:3:completion | completion | div className: 'logo-area', style: style, onClick: @onLogoUpload
else
div className: 'logo-area', onClick: @onLogoUpload, @props.data.get('name')[0]
render: ->
readOnly = (not @props.hasPermission)
className = cx 'form-group', { 'is-disabled': !@props.hasPermission }
div className: 'team-... | input
type: 'text'
className: 'form-control'
readOnly: readOnly
value: @state.description
onChange: @onDescriptionChange
placeholder: lang.getText('team-description-placeholder')
# team shortname component
if !@props.hasPermission
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 124 | 173 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:4:raw_corpus | raw_corpus | readOnly: readOnly
className: 'form-control'
placeholder: lang.getText 'team-shortname-placeholder'
if not @state.isErrorShortName and @state.shortName.length
a className: 'link-icon', onClick: @onSaveShortName, lang.getText 'generate-shorturl'
else nosc... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 174 | 195 | ||
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
readOnly: readOnly
className: 'form-control'
placeholder: lang.getText 'team-shortname-placeholder'
if not @state.isErrorShortName and @state.shortName.length
a className: 'link-icon', onClick: @onSaveShortNam... | var buttonClass, ref;
({
readOnly: readOnly({
className: 'form-control',
placeholder: lang.getText('team-shortname-placeholder')
})
});
if (!this.state.isErrorShortName && this.state.shortName.length) {
a({
className: 'link-icon',
onClick: this.onSaveShortName
}, lang.getText('generate-shortur... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 174 | 195 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var buttonClass, ref;
({
readOnly: readOnly({
className: 'form-control',
placeholder: lang.getText('team-shortname-placeholder')
})
});
if (!this.state.isErrorShortName && this.state.shortName.length) {
a({
className: 'link-icon',
onClick: t... | readOnly: readOnly
className: 'form-control'
placeholder: lang.getText 'team-shortname-placeholder'
if not @state.isErrorShortName and @state.shortName.length
a className: 'link-icon', onClick: @onSaveShortName, lang.getText 'generate-shorturl'
else nosc... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 174 | 195 |
jianliaoim/talk-os:talk-web/client/app/team-configs.coffee:4:completion | completion | readOnly: readOnly
className: 'form-control'
placeholder: lang.getText 'team-shortname-placeholder'
if not @state.isErrorShortName and @state.shortName.length
a className: 'link-icon', onClick: @onSaveShortName, lang.getText 'generate-shorturl'
else nosc... | LiteCopyarea
text: (@props.data.get 'shortUrl') or ''
else
noscript()
div className: className,
if @props.hasPermission
buttonClass = cx 'button', 'is-primary', 'is-extended',
'is-disabled': not @needSave()
button className: buttonClass, onClick: @onSave,... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-configs.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-configs.coffee | 174 | 195 |
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['libs/angular'], (angular) ->
'use strict'
angular.module 'directives', [] | CoffeeScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/directives/directives.coffee | 1 | 6 | ||
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['libs/angular'], (angular) ->
'use strict'
angular.module 'directives', []
``` | /*global define*/
define(['libs/angular'], function(angular) {
'use strict';
return angular.module('directives', []);
}); | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/directives/directives.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['libs/angular'], function(angular) {
'use strict';
return angular.module('directives', []);
});
``` | ###global define###
define ['libs/angular'], (angular) ->
'use strict'
angular.module 'directives', [] | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/directives/directives.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:completion | completion | ###global define###
define ['libs/angular'], (angular) -> | 'use strict'
angular.module 'directives', [] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/directives/directives.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['angular'], (angular) ->
'use strict'
angular.module 'directives', [] | CoffeeScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/directives/directives.coffee | 1 | 6 | ||
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['angular'], (angular) ->
'use strict'
angular.module 'directives', []
``` | /*global define*/
define(['angular'], function(angular) {
'use strict';
return angular.module('directives', []);
}); | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/directives/directives.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['angular'], function(angular) {
'use strict';
return angular.module('directives', []);
});
``` | ###global define###
define ['angular'], (angular) ->
'use strict'
angular.module 'directives', [] | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/directives/directives.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/directives/directives.coffee:1:completion | completion | ###global define###
define ['angular'], (angular) -> | 'use strict'
angular.module 'directives', [] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/directives/directives.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/directives/directives.coffee | 1 | 6 |
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'inte-page'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string
settings: T.instanceOf(Immutable.List).isRequired
getInitialState: ->
tab: tabs[0]
topic: @getTopic()
team: @getTeam()
sho... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 48 | 97 | ||
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'inte-page'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string
settings: T.instanceOf(Immutable.List).isRequired
getInitialState: ->
tab: ta... | module.exports = React.createClass({
displayName: 'inte-page',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
_teamId: T.string.isRequired,
_roomId: T.string,
settings: T.instanceOf(Immutable.List).isRequired
},
getInitialState: function() {
return {
tab: tabs[0],
topic: t... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 48 | 97 |
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'inte-page',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
_teamId: T.string.isRequired,
_roomId: T.string,
settings: T.instanceOf(Immutable.List).isRequired
},
getInitialState: funct... | module.exports = React.createClass
displayName: 'inte-page'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string
settings: T.instanceOf(Immutable.List).isRequired
getInitialState: ->
tab: tabs[0]
topic: @getTopic()
team: @getTeam()
sho... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 48 | 97 |
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'inte-page'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string
settings: T.instanceOf(Immutable.List).isRequired
getInitialState: ->
tab: tabs[0]
topic: @getTopic()
team: @getTeam()
sho... | getTeam: ->
query.teamBy(recorder.getState(), @props._teamId)
getTopic: ->
query.topicsByOne(recorder.getState(), @props._teamId, @props._roomId)
getShowInteBanner: ->
query.settings(recorder.getState()).get('showInteBanner')
getAccounts: ->
recorder.getState().getIn ['accounts'] or Immutable.L... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 48 | 97 |
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:2:raw_corpus | raw_corpus | when 'manage-service' then analytics.openEditIntegration()
onPageSwitch: (category) ->
@setState category: category
onPageBack: (fromState) ->
if fromState
targetTab = tabs[2]
else
targetTab = tabs[0]
@setState category: null, tab: targetTab, activeInte: null
onInteEdit: (data) ->
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 98 | 147 | ||
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:2:completion | completion | when 'manage-service' then analytics.openEditIntegration()
onPageSwitch: (category) ->
@setState category: category
onPageBack: (fromState) ->
if fromState
targetTab = tabs[2]
else
targetTab = tabs[0]
@setState category: null, tab: targetTab, activeInte: null
onInteEdit: (data) ->
... | renderLists: ->
onClick = ->
thirdPartyIntes = @props.settings.filter (value, key) ->
not value.get('isCustomized')
customizedIntes = @props.settings.filter (value, key) ->
value.get('isCustomized')
div className: 'page',
LiteSwitchTabs
data: tabs, tab: @state.tab, iconMap: ta... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 98 | 147 |
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:3:raw_corpus | raw_corpus | div className: 'sidebar',
div className: 'feedback-survey',
span className: 'tip-guide', lang.getText('wish-talk')
a href: surveyLink, target: '_blank', lang.getText('join-survey')
renderPage: ->
pageProps =
_teamId: @props._teamId
_roomId: @state.topic.get('_id')
on... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 148 | 197 | ||
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
div className: 'sidebar',
div className: 'feedback-survey',
span className: 'tip-guide', lang.getText('wish-talk')
a href: surveyLink, target: '_blank', lang.getText('join-survey')
renderPage: ->
pageProps =
_teamId: @prop... | div({
className: 'sidebar'
}, div({
className: 'feedback-survey'
}, span({
className: 'tip-guide'
}, lang.getText('wish-talk')), a({
href: surveyLink,
target: '_blank'
}, lang.getText('join-survey'))));
({
renderPage: function() {
var pageProps, settings;
pageProps = {
_teamId: this.props._te... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 148 | 197 |
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
div({
className: 'sidebar'
}, div({
className: 'feedback-survey'
}, span({
className: 'tip-guide'
}, lang.getText('wish-talk')), a({
href: surveyLink,
target: '_blank'
}, lang.getText('join-survey'))));
({
renderPage: function() {
var pageProps, se... | div className: 'sidebar',
div className: 'feedback-survey',
span className: 'tip-guide', lang.getText('wish-talk')
a href: surveyLink, target: '_blank', lang.getText('join-survey')
renderPage: ->
pageProps =
_teamId: @props._teamId
_roomId: @state.topic.get('_id')
on... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 148 | 197 |
jianliaoim/talk-os:talk-web/client/app/inte-page.coffee:3:completion | completion | div className: 'sidebar',
div className: 'feedback-survey',
span className: 'tip-guide', lang.getText('wish-talk')
a href: surveyLink, target: '_blank', lang.getText('join-survey')
renderPage: ->
pageProps =
_teamId: @props._teamId
_roomId: @state.topic.get('_id')
on... | when 'rss' then InteRss pageProps
when 'github' then InteGithub pageProps
when 'teambition' then InteTeambition pageProps
when 'email' then InteEmail pageProps
when 'trello' then InteTrello pageProps
else lang.getText('error')
render: ->
bodyStyle =
h... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/inte-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/inte-page.coffee | 148 | 197 |
jianliaoim/talk-os:talk-web/client/handlers/notification.coffee:1:raw_corpus | raw_corpus | recorder = require 'actions-recorder'
dispatcher = require '../dispatcher'
unreadHandler = require './unread'
exports.update = (data) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']
routerData = store.getIn ['router', 'data']
_channel... | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/notification.coffee | 1 | 19 | ||
jianliaoim/talk-os:talk-web/client/handlers/notification.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
recorder = require 'actions-recorder'
dispatcher = require '../dispatcher'
unreadHandler = require './unread'
exports.update = (data) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']... | var dispatcher, recorder, unreadHandler;
recorder = require('actions-recorder');
dispatcher = require('../dispatcher');
unreadHandler = require('./unread');
exports.update = function(data) {
var _channelId, hasMoreUnread, isFocused, isReading, isTuned, routerData, store;
store = recorder.getState();
isTuned =... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/notification.coffee | 1 | 19 |
jianliaoim/talk-os:talk-web/client/handlers/notification.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var dispatcher, recorder, unreadHandler;
recorder = require('actions-recorder');
dispatcher = require('../dispatcher');
unreadHandler = require('./unread');
exports.update = function(data) {
var _channelId, hasMoreUnread, isFocused, isReading, isTuned, router... | recorder = require 'actions-recorder'
dispatcher = require '../dispatcher'
unreadHandler = require './unread'
exports.update = (data) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']
routerData = store.getIn ['router', 'data']
_channel... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/notification.coffee | 1 | 19 |
jianliaoim/talk-os:talk-web/client/handlers/notification.coffee:1:completion | completion | recorder = require 'actions-recorder'
dispatcher = require '../dispatcher'
unreadHandler = require './unread'
exports.update = (data) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']
routerData = store.getIn ['router', 'data'] | _channelId = routerData.get('_roomId') or routerData.get('_toId') or routerData.get('_storyId')
isReading = isTuned and isFocused and data.get('_targetId') is _channelId
hasMoreUnread = data.get('unreadNum') > data.get('oldUnreadNum')
dispatcher.handleServerAction {type: 'notification/update', data}
if isReadi... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/notification.coffee | 1 | 19 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= _.bindAll createClient()
PublishForwarder = ... | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 24974581a7830507f34b1e5c0bd79d425c0bf37c | 815 | https://github.com/octoblu/meshblu/blob/24974581a7830507f34b1e5c0bd79d425c0bf37c/lib/Publisher.coffee | 1 | 22 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@c... | var Publisher, _, async;
_ = require('lodash');
async = require('async');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var PublishForwarder, createClient;
this.publish = this.publish.bind(this);
({namespace: this.namespace} = options);
({client: this.client, devices:... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 24974581a7830507f34b1e5c0bd79d425c0bf37c | 815 | https://github.com/octoblu/meshblu/blob/24974581a7830507f34b1e5c0bd79d425c0bf37c/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Publisher, _, async;
_ = require('lodash');
async = require('async');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var PublishForwarder, createClient;
this.publish = this.publish.bind(this);
({namespace: this.nam... | _ = require 'lodash'
async = require 'async'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= _.bindAll createClient()
PublishForwarder = ... | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 24974581a7830507f34b1e5c0bd79d425c0bf37c | 815 | https://github.com/octoblu/meshblu/blob/24974581a7830507f34b1e5c0bd79d425c0bf37c/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= _.bindAll createClient()
PublishForwarder = ... | @publishForwarder = new PublishForwarder {publisher: @}, {@devices, @subscriptions}
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
return callback new Error 'Invalid message' unless message?
async.series [
async.apply @client.publish, channel, JSON.stringify(m... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 24974581a7830507f34b1e5c0bd79d425c0bf37c | 815 | https://github.com/octoblu/meshblu/blob/24974581a7830507f34b1e5c0bd79d425c0bf37c/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@clie... | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | abff314a103052ce78a370ce26eaca7978e4aece | 815 | https://github.com/octoblu/meshblu/blob/abff314a103052ce78a370ce26eaca7978e4aece/lib/Publisher.coffee | 1 | 22 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= '... | var PublishForwarder, Publisher, _, async;
_ = require('lodash');
async = require('async');
PublishForwarder = require('../src/publish-forwarder');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(this);
({namespace: this.n... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | abff314a103052ce78a370ce26eaca7978e4aece | 815 | https://github.com/octoblu/meshblu/blob/abff314a103052ce78a370ce26eaca7978e4aece/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PublishForwarder, Publisher, _, async;
_ = require('lodash');
async = require('async');
PublishForwarder = require('../src/publish-forwarder');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.pub... | _ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@clie... | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | abff314a103052ce78a370ce26eaca7978e4aece | 815 | https://github.com/octoblu/meshblu/blob/abff314a103052ce78a370ce26eaca7978e4aece/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@clie... | @publishForwarder = new PublishForwarder {publisher: @}, {@devices, @subscriptions}
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
return callback new Error 'Invalid message' unless message?
async.series [
async.apply @client.publish, channel, JSON.stringify(m... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | abff314a103052ce78a370ce26eaca7978e4aece | 815 | https://github.com/octoblu/meshblu/blob/abff314a103052ce78a370ce26eaca7978e4aece/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@clie... | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/Publisher.coffee | 1 | 22 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= '... | var PublishForwarder, Publisher, _, async;
_ = require('lodash');
async = require('async');
PublishForwarder = require('../src/publish-forwarder');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(this);
({namespace: this.n... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PublishForwarder, Publisher, _, async;
_ = require('lodash');
async = require('async');
PublishForwarder = require('../src/publish-forwarder');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.pub... | _ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@clie... | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client,@devices,@subscriptions} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@clie... | @publishForwarder = new PublishForwarder {publisher: @}, {@devices, @subscriptions}
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
return callback new Error 'Invalid message' unless message?
async.parallel [
async.apply @client.publish, channel, JSON.stringify... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/Publisher.coffee | 1 | 22 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
@publishForwarder = ... | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/lib/Publisher.coffee | 1 | 21 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redi... | var PublishForwarder, Publisher, async;
async = require('async');
PublishForwarder = require('../src/publish-forwarder');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(this);
({namespace: this.namespace} = options);
(... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/lib/Publisher.coffee | 1 | 21 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PublishForwarder, Publisher, async;
async = require('async');
PublishForwarder = require('../src/publish-forwarder');
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(th... | async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
@publishForwarder = ... | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/lib/Publisher.coffee | 1 | 21 |
octoblu/meshblu:lib/Publisher.coffee:1:completion | completion | async = require 'async'
PublishForwarder = require '../src/publish-forwarder'
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient() | @publishForwarder = new PublishForwarder publisher: @
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
return callback new Error 'Invalid message' unless message?
async.parallel [
async.apply @client.publish, channel, JSON.stringify(message)
async.apply @p... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/lib/Publisher.coffee | 1 | 21 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
return... | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 72cddd24e204d45824311c98318a4118e132281d | 815 | https://github.com/octoblu/meshblu/blob/72cddd24e204d45824311c98318a4118e132281d/lib/Publisher.coffee | 1 | 14 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>... | var Publisher;
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(this);
({namespace: this.namespace} = options);
({client: this.client} = dependencies);
if (this.namespace == null) {
this.namespace = 'meshblu';
... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 72cddd24e204d45824311c98318a4118e132281d | 815 | https://github.com/octoblu/meshblu/blob/72cddd24e204d45824311c98318a4118e132281d/lib/Publisher.coffee | 1 | 14 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Publisher;
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(this);
({namespace: this.namespace} = options);
({client: this.client} = dependencies);
if (this.na... | class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
return... | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 72cddd24e204d45824311c98318a4118e132281d | 815 | https://github.com/octoblu/meshblu/blob/72cddd24e204d45824311c98318a4118e132281d/lib/Publisher.coffee | 1 | 14 |
octoblu/meshblu:lib/Publisher.coffee:1:completion | completion | class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient() | publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
return callback new Error("Invalid message") unless message?
@client.publish channel, JSON.stringify(message), callback
module.exports = Publisher | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 72cddd24e204d45824311c98318a4118e132281d | 815 | https://github.com/octoblu/meshblu/blob/72cddd24e204d45824311c98318a4118e132281d/lib/Publisher.coffee | 1 | 14 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
@clien... | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 12672e10627e690e2e56bba865f71c38b8a90f25 | 815 | https://github.com/octoblu/meshblu/blob/12672e10627e690e2e56bba865f71c38b8a90f25/lib/Publisher.coffee | 1 | 13 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>... | var Publisher;
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(this);
({namespace: this.namespace} = options);
({client: this.client} = dependencies);
if (this.namespace == null) {
this.namespace = 'meshblu';
... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 12672e10627e690e2e56bba865f71c38b8a90f25 | 815 | https://github.com/octoblu/meshblu/blob/12672e10627e690e2e56bba865f71c38b8a90f25/lib/Publisher.coffee | 1 | 13 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Publisher;
Publisher = class Publisher {
constructor(options = {}, dependencies = {}) {
var createClient;
this.publish = this.publish.bind(this);
({namespace: this.namespace} = options);
({client: this.client} = dependencies);
if (this.na... | class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
@clien... | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 12672e10627e690e2e56bba865f71c38b8a90f25 | 815 | https://github.com/octoblu/meshblu/blob/12672e10627e690e2e56bba865f71c38b8a90f25/lib/Publisher.coffee | 1 | 13 |
octoblu/meshblu:lib/Publisher.coffee:1:completion | completion | class Publisher
constructor: (options={}, dependencies={}) ->
{@namespace} = options
{@client} = dependencies
@namespace ?= 'meshblu'
{createClient} = require './redis' | @client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
@client.publish channel, JSON.stringify(message), callback
module.exports = Publisher | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 12672e10627e690e2e56bba865f71c38b8a90f25 | 815 | https://github.com/octoblu/meshblu/blob/12672e10627e690e2e56bba865f71c38b8a90f25/lib/Publisher.coffee | 1 | 13 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | class Publisher
constructor: ({@namespace}={}, {@client}={}) ->
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
@client.publish channel, JSON.stringify(message), callback
... | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 93182ad65c614a724122fe7f2b487af93e79ed0f | 815 | https://github.com/octoblu/meshblu/blob/93182ad65c614a724122fe7f2b487af93e79ed0f/lib/Publisher.coffee | 1 | 11 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Publisher
constructor: ({@namespace}={}, {@client}={}) ->
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
@cl... | var Publisher;
Publisher = class Publisher {
constructor({namespace} = {}, {client} = {}) {
var createClient;
this.publish = this.publish.bind(this);
this.namespace = namespace;
this.client = client;
if (this.namespace == null) {
this.namespace = 'meshblu';
}
({createClient} = requi... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 93182ad65c614a724122fe7f2b487af93e79ed0f | 815 | https://github.com/octoblu/meshblu/blob/93182ad65c614a724122fe7f2b487af93e79ed0f/lib/Publisher.coffee | 1 | 11 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Publisher;
Publisher = class Publisher {
constructor({namespace} = {}, {client} = {}) {
var createClient;
this.publish = this.publish.bind(this);
this.namespace = namespace;
this.client = client;
if (this.namespace == null) {
this.n... | class Publisher
constructor: ({@namespace}={}, {@client}={}) ->
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient()
publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
@client.publish channel, JSON.stringify(message), callback
... | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 93182ad65c614a724122fe7f2b487af93e79ed0f | 815 | https://github.com/octoblu/meshblu/blob/93182ad65c614a724122fe7f2b487af93e79ed0f/lib/Publisher.coffee | 1 | 11 |
octoblu/meshblu:lib/Publisher.coffee:1:completion | completion | class Publisher
constructor: ({@namespace}={}, {@client}={}) ->
@namespace ?= 'meshblu'
{createClient} = require './redis'
@client ?= createClient() | publish: (type, uuid, message, callback) =>
channel = "#{@namespace}:#{type}:#{uuid}"
@client.publish channel, JSON.stringify(message), callback
module.exports = Publisher | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 93182ad65c614a724122fe7f2b487af93e79ed0f | 815 | https://github.com/octoblu/meshblu/blob/93182ad65c614a724122fe7f2b487af93e79ed0f/lib/Publisher.coffee | 1 | 11 |
octoblu/meshblu:lib/Publisher.coffee:1:raw_corpus | raw_corpus | class Publisher
constructor: ({@uuid, @namespace}, {@client}={}) ->
{createClient} = require './redis'
@client ?= createClient()
_channel: =>
"#{@namespace}:#{@uuid}"
publish: (message, callback) =>
@client.publish @_channel(), JSON.stringify(message), callback
module.exports = Publisher | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 32803658e5d5b6cdd2553cd353c4d589d36e5306 | 815 | https://github.com/octoblu/meshblu/blob/32803658e5d5b6cdd2553cd353c4d589d36e5306/lib/Publisher.coffee | 1 | 12 | ||
octoblu/meshblu:lib/Publisher.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Publisher
constructor: ({@uuid, @namespace}, {@client}={}) ->
{createClient} = require './redis'
@client ?= createClient()
_channel: =>
"#{@namespace}:#{@uuid}"
publish: (message, callback) =>
@client.publish @_channel(), JSON.string... | var Publisher;
Publisher = class Publisher {
constructor({uuid, namespace}, {client} = {}) {
var createClient;
this._channel = this._channel.bind(this);
this.publish = this.publish.bind(this);
this.uuid = uuid;
this.namespace = namespace;
this.client = client;
({createClient} = require('.... | CoffeeScript | JavaScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 32803658e5d5b6cdd2553cd353c4d589d36e5306 | 815 | https://github.com/octoblu/meshblu/blob/32803658e5d5b6cdd2553cd353c4d589d36e5306/lib/Publisher.coffee | 1 | 12 |
octoblu/meshblu:lib/Publisher.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Publisher;
Publisher = class Publisher {
constructor({uuid, namespace}, {client} = {}) {
var createClient;
this._channel = this._channel.bind(this);
this.publish = this.publish.bind(this);
this.uuid = uuid;
this.namespace = namespace;
... | class Publisher
constructor: ({@uuid, @namespace}, {@client}={}) ->
{createClient} = require './redis'
@client ?= createClient()
_channel: =>
"#{@namespace}:#{@uuid}"
publish: (message, callback) =>
@client.publish @_channel(), JSON.stringify(message), callback
module.exports = Publisher | JavaScript | CoffeeScript | octoblu/meshblu | lib/Publisher.coffee | MIT | 32803658e5d5b6cdd2553cd353c4d589d36e5306 | 815 | https://github.com/octoblu/meshblu/blob/32803658e5d5b6cdd2553cd353c4d589d36e5306/lib/Publisher.coffee | 1 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.