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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mojs/mojs:src/shapes/rect.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
Bit = require('./bit').default
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaults.ratio = 1.43
_draw:->
super
p = @_props
ra... | CoffeeScript | mojs/mojs | src/shapes/rect.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/rect.coffee | 1 | 31 | ||
mojs/mojs:src/shapes/rect.coffee:1:completion | completion | # ignore coffescript sudo code
Bit = require('./bit').default
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaults.ratio = 1.43
_draw:->
super | p = @_props
radiusX = if p.radiusX? then p.radiusX else p.radius
radiusY = if p.radiusY? then p.radiusY else p.radius
@_setAttrIfChanged 'width', 2*radiusX
@_setAttrIfChanged 'height', 2*radiusY
@_setAttrIfChanged 'x', (p.width/2) - radiusX
@_setAttrIfChanged 'y', (p.height/2) - radiusY
@_se... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/rect.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/rect.coffee | 1 | 31 |
mojs/mojs:src/shapes/rect.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
Bit = require('./bit').default or require('./bit');
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaults.ratio = 1.43
_draw:->
super
... | CoffeeScript | mojs/mojs | src/shapes/rect.coffee | MIT | 768850a20165488e3098a3003b153e905266dac8 | 18,698 | https://github.com/mojs/mojs/blob/768850a20165488e3098a3003b153e905266dac8/src/shapes/rect.coffee | 1 | 31 | ||
mojs/mojs:src/shapes/rect.coffee:1:completion | completion | # ignore coffescript sudo code
Bit = require('./bit').default or require('./bit');
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaults.ratio = 1.43
_draw:->
super | p = @_props
radiusX = if p.radiusX? then p.radiusX else p.radius
radiusY = if p.radiusY? then p.radiusY else p.radius
@_setAttrIfChanged 'width', 2*radiusX
@_setAttrIfChanged 'height', 2*radiusY
@_setAttrIfChanged 'x', (p.width/2) - radiusX
@_setAttrIfChanged 'y', (p.height/2) - radiusY
@_se... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/rect.coffee | MIT | 768850a20165488e3098a3003b153e905266dac8 | 18,698 | https://github.com/mojs/mojs/blob/768850a20165488e3098a3003b153e905266dac8/src/shapes/rect.coffee | 1 | 31 |
jianliaoim/talk-os:talk-web/client/util/clock.coffee:1:raw_corpus | raw_corpus | Immutable = require 'immutable'
time = require './time'
interval = 10 * 1000
functions = Immutable.Map()
if typeof window isnt 'undefined'
clock = time.every interval, ->
functions.forEach (fn) ->
fn()
exports.add = (id, fn) ->
functions = functions.set(id, fn)
exports.remove = (id, fn) ->
fun... | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/clock.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/clock.coffee | 1 | 17 | ||
jianliaoim/talk-os:talk-web/client/util/clock.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Immutable = require 'immutable'
time = require './time'
interval = 10 * 1000
functions = Immutable.Map()
if typeof window isnt 'undefined'
clock = time.every interval, ->
functions.forEach (fn) ->
fn()
exports.add = (id, fn) ->
functions = ... | var Immutable, clock, functions, interval, time;
Immutable = require('immutable');
time = require('./time');
interval = 10 * 1000;
functions = Immutable.Map();
if (typeof window !== 'undefined') {
clock = time.every(interval, function() {
return functions.forEach(function(fn) {
return fn();
});
}... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/clock.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/clock.coffee | 1 | 17 |
jianliaoim/talk-os:talk-web/client/util/clock.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, clock, functions, interval, time;
Immutable = require('immutable');
time = require('./time');
interval = 10 * 1000;
functions = Immutable.Map();
if (typeof window !== 'undefined') {
clock = time.every(interval, function() {
return function... | Immutable = require 'immutable'
time = require './time'
interval = 10 * 1000
functions = Immutable.Map()
if typeof window isnt 'undefined'
clock = time.every interval, ->
functions.forEach (fn) ->
fn()
exports.add = (id, fn) ->
functions = functions.set(id, fn)
exports.remove = (id, fn) ->
fun... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/clock.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/clock.coffee | 1 | 17 |
jianliaoim/talk-os:talk-web/client/util/clock.coffee:1:completion | completion | Immutable = require 'immutable'
time = require './time'
interval = 10 * 1000
functions = Immutable.Map()
if typeof window isnt 'undefined' | clock = time.every interval, ->
functions.forEach (fn) ->
fn()
exports.add = (id, fn) ->
functions = functions.set(id, fn)
exports.remove = (id, fn) ->
functions = functions.delete(id) | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/clock.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/clock.coffee | 1 | 17 |
linemanjs/lineman:lib/accumulates-streams.coffee:1:raw_corpus | raw_corpus | module.exports = class AccumulatesStreams
constructor: (@stream, @writeToStdout = true, @event = "data") ->
@value = ""
accumulate: ->
@stream.on @event, (stuff) =>
chunk = String(stuff)
process.stdout.write(chunk) if @writeToStdout
@value += chunk
this
getValue: -> @value | CoffeeScript | linemanjs/lineman | lib/accumulates-streams.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/accumulates-streams.coffee | 1 | 12 | ||
linemanjs/lineman:lib/accumulates-streams.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class AccumulatesStreams
constructor: (@stream, @writeToStdout = true, @event = "data") ->
@value = ""
accumulate: ->
@stream.on @event, (stuff) =>
chunk = String(stuff)
process.stdout.write(chunk) if @writeToStdout
... | var AccumulatesStreams;
module.exports = AccumulatesStreams = class AccumulatesStreams {
constructor(stream, writeToStdout = true, event = "data") {
this.stream = stream;
this.writeToStdout = writeToStdout;
this.event = event;
this.value = "";
}
accumulate() {
this.stream.on(this.event, (stu... | CoffeeScript | JavaScript | linemanjs/lineman | lib/accumulates-streams.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/accumulates-streams.coffee | 1 | 12 |
linemanjs/lineman:lib/accumulates-streams.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var AccumulatesStreams;
module.exports = AccumulatesStreams = class AccumulatesStreams {
constructor(stream, writeToStdout = true, event = "data") {
this.stream = stream;
this.writeToStdout = writeToStdout;
this.event = event;
this.value = "";
... | module.exports = class AccumulatesStreams
constructor: (@stream, @writeToStdout = true, @event = "data") ->
@value = ""
accumulate: ->
@stream.on @event, (stuff) =>
chunk = String(stuff)
process.stdout.write(chunk) if @writeToStdout
@value += chunk
this
getValue: -> @value | JavaScript | CoffeeScript | linemanjs/lineman | lib/accumulates-streams.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/accumulates-streams.coffee | 1 | 12 |
linemanjs/lineman:lib/accumulates-streams.coffee:1:completion | completion | module.exports = class AccumulatesStreams
constructor: (@stream, @writeToStdout = true, @event = "data") ->
@value = ""
accumulate: ->
@stream.on @event, (stuff) => | chunk = String(stuff)
process.stdout.write(chunk) if @writeToStdout
@value += chunk
this
getValue: -> @value | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/accumulates-streams.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/accumulates-streams.coffee | 1 | 12 |
jianliaoim/talk-os:talk-web/client/app/team-name.coffee:1:raw_corpus | raw_corpus | cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
format = require '../util/format'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span, strong } = React.DOM
T = React.PropTypes
module.exports = React.createClass
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-name.coffee | 1 | 40 | ||
jianliaoim/talk-os:talk-web/client/app/team-name.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
format = require '../util/format'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span, strong } = React.DOM
... | var Icon, Immutable, PureRenderMixin, React, T, cx, div, format, span, strong;
cx = require('classnames');
React = require('react');
Immutable = require('immutable');
format = require('../util/format');
Icon = React.createFactory(require('../module/icon'));
PureRenderMixin = require('react-addons-pure-render-mixi... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-name.coffee | 1 | 40 |
jianliaoim/talk-os:talk-web/client/app/team-name.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Icon, Immutable, PureRenderMixin, React, T, cx, div, format, span, strong;
cx = require('classnames');
React = require('react');
Immutable = require('immutable');
format = require('../util/format');
Icon = React.createFactory(require('../module/icon'));
P... | cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
format = require '../util/format'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span, strong } = React.DOM
T = React.PropTypes
module.exports = React.createClass
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-name.coffee | 1 | 40 |
jianliaoim/talk-os:talk-web/client/app/team-name.coffee:1:completion | completion | cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
format = require '../util/format'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span, strong } = React.DOM
T = React.PropTypes
module.exports = React.createClass
... | data: T.instanceOf(Immutable.Map)
getDefaultProps: ->
showUnread: true
onClick: ->
@props.onClick @props.data.get('_id')
render: ->
unread = @props.data.get('unread')
className = cx 'team-name', 'item', 'line', 'flex-horiz', 'flex-vcenter',
'is-large': @props.large
div className: cla... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-name.coffee | 1 | 40 |
jianliaoim/talk-os:talk-web/client/module/light-overlay.coffee:1:raw_corpus | raw_corpus | React = require 'react'
div = React.createFactory 'div'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory (require './transition')
T = React.PropTypes
module.exports = React.createClass
displayName: 'light-overlay'
mixins: [mixinLayered]
propTypes:
show: T.bool.isRequired
na... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-overlay.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-overlay.coffee | 1 | 29 | ||
jianliaoim/talk-os:talk-web/client/module/light-overlay.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
div = React.createFactory 'div'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory (require './transition')
T = React.PropTypes
module.exports = React.createClass
displayName: 'light-overlay'
mixins: [mixin... | var React, T, Transition, div, mixinLayered;
React = require('react');
div = React.createFactory('div');
mixinLayered = require('../mixin/layered');
Transition = React.createFactory(require('./transition'));
T = React.PropTypes;
module.exports = React.createClass({
displayName: 'light-overlay',
mixins: [mixin... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/light-overlay.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-overlay.coffee | 1 | 29 |
jianliaoim/talk-os:talk-web/client/module/light-overlay.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var React, T, Transition, div, mixinLayered;
React = require('react');
div = React.createFactory('div');
mixinLayered = require('../mixin/layered');
Transition = React.createFactory(require('./transition'));
T = React.PropTypes;
module.exports = React.createC... | React = require 'react'
div = React.createFactory 'div'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory (require './transition')
T = React.PropTypes
module.exports = React.createClass
displayName: 'light-overlay'
mixins: [mixinLayered]
propTypes:
show: T.bool.isRequired
na... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-overlay.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-overlay.coffee | 1 | 29 |
jianliaoim/talk-os:talk-web/client/module/light-overlay.coffee:1:completion | completion | React = require 'react'
div = React.createFactory 'div'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory (require './transition')
T = React.PropTypes
module.exports = React.createClass
displayName: 'light-overlay'
mixins: [mixinLayered] | propTypes:
show: T.bool.isRequired
name: T.string
getDefaultProps: ->
name: 'default'
renderLayer: (afterTransition) ->
Transition transitionName: 'fade', enterTimeout: 200, leaveTimeout: 350,
if @props.show and afterTransition
div className: "light-overlay is-for-#{@props.name}",
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-overlay.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-overlay.coffee | 1 | 29 |
jianliaoim/talk-os:talk-account/server/util/url.coffee:1:raw_corpus | raw_corpus | config = require 'config'
Err = require 'err1st'
serializer = require 'serializer'
qs = require 'querystring'
module.exports = urlUtil =
buildCallbackUrl: (refer) -> config.accountUrl + "/union/callback/#{refer}"
buildResetPasswordUrl: (verifyData) ->
{randomCode, verifyCode} = verifyData
resetToken = ser... | CoffeeScript | jianliaoim/talk-os | talk-account/server/util/url.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/util/url.coffee | 1 | 34 | ||
jianliaoim/talk-os:talk-account/server/util/url.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
config = require 'config'
Err = require 'err1st'
serializer = require 'serializer'
qs = require 'querystring'
module.exports = urlUtil =
buildCallbackUrl: (refer) -> config.accountUrl + "/union/callback/#{refer}"
buildResetPasswordUrl: (verifyData) ->
{... | var Err, config, qs, serializer, urlUtil;
config = require('config');
Err = require('err1st');
serializer = require('serializer');
qs = require('querystring');
module.exports = urlUtil = {
buildCallbackUrl: function(refer) {
return config.accountUrl + `/union/callback/${refer}`;
},
buildResetPasswordUrl:... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/server/util/url.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/util/url.coffee | 1 | 34 |
jianliaoim/talk-os:talk-account/server/util/url.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Err, config, qs, serializer, urlUtil;
config = require('config');
Err = require('err1st');
serializer = require('serializer');
qs = require('querystring');
module.exports = urlUtil = {
buildCallbackUrl: function(refer) {
return config.accountUrl + `/... | config = require 'config'
Err = require 'err1st'
serializer = require 'serializer'
qs = require 'querystring'
module.exports = urlUtil =
buildCallbackUrl: (refer) -> config.accountUrl + "/union/callback/#{refer}"
buildResetPasswordUrl: (verifyData) ->
{randomCode, verifyCode} = verifyData
resetToken = ser... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/util/url.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/util/url.coffee | 1 | 34 |
jianliaoim/talk-os:talk-account/server/util/url.coffee:1:completion | completion | config = require 'config'
Err = require 'err1st'
serializer = require 'serializer'
qs = require 'querystring'
module.exports = urlUtil =
buildCallbackUrl: (refer) -> config.accountUrl + "/union/callback/#{refer}"
buildResetPasswordUrl: (verifyData) ->
{randomCode, verifyCode} = verifyData
resetToken = ser... | {randomCode, verifyCode} = verifyData
verifyToken = serializer.secureStringify
randomCode: randomCode
verifyCode: verifyCode
, config.accountCookieSecret
qsParams =
verifyToken: verifyToken
action: verifyData.action
config.accountUrl + "/verify-email?" + qs.stringify qsParams
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/util/url.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/util/url.coffee | 1 | 34 |
linemanjs/lineman:archetype/app/js/hello.coffee:1:raw_corpus | raw_corpus | window.helloText = -> 'Hello, World!'
window.hello = ->
html = JST['app/templates/hello.us'](text: helloText())
document.body.innerHTML += html
if window.addEventListener
window.addEventListener('DOMContentLoaded', hello, false)
else
window.attachEvent('onload', hello) | CoffeeScript | linemanjs/lineman | archetype/app/js/hello.coffee | MIT | 7f31050d0bfb3b3c08ade626e1b53133b06b95b1 | 1,168 | https://github.com/linemanjs/lineman/blob/7f31050d0bfb3b3c08ade626e1b53133b06b95b1/archetype/app/js/hello.coffee | 1 | 10 | ||
linemanjs/lineman:archetype/app/js/hello.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.helloText = -> 'Hello, World!'
window.hello = ->
html = JST['app/templates/hello.us'](text: helloText())
document.body.innerHTML += html
if window.addEventListener
window.addEventListener('DOMContentLoaded', hello, false)
else
window.attachEvent(... | window.helloText = function() {
return 'Hello, World!';
};
window.hello = function() {
var html;
html = JST['app/templates/hello.us']({
text: helloText()
});
return document.body.innerHTML += html;
};
if (window.addEventListener) {
window.addEventListener('DOMContentLoaded', hello, false);
} else {
... | CoffeeScript | JavaScript | linemanjs/lineman | archetype/app/js/hello.coffee | MIT | 7f31050d0bfb3b3c08ade626e1b53133b06b95b1 | 1,168 | https://github.com/linemanjs/lineman/blob/7f31050d0bfb3b3c08ade626e1b53133b06b95b1/archetype/app/js/hello.coffee | 1 | 10 |
linemanjs/lineman:archetype/app/js/hello.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
window.helloText = function() {
return 'Hello, World!';
};
window.hello = function() {
var html;
html = JST['app/templates/hello.us']({
text: helloText()
});
return document.body.innerHTML += html;
};
if (window.addEventListener) {
window.addEvent... | window.helloText = -> 'Hello, World!'
window.hello = ->
html = JST['app/templates/hello.us'](text: helloText())
document.body.innerHTML += html
if window.addEventListener
window.addEventListener('DOMContentLoaded', hello, false)
else
window.attachEvent('onload', hello) | JavaScript | CoffeeScript | linemanjs/lineman | archetype/app/js/hello.coffee | MIT | 7f31050d0bfb3b3c08ade626e1b53133b06b95b1 | 1,168 | https://github.com/linemanjs/lineman/blob/7f31050d0bfb3b3c08ade626e1b53133b06b95b1/archetype/app/js/hello.coffee | 1 | 10 |
linemanjs/lineman:archetype/app/js/hello.coffee:1:completion | completion | window.helloText = -> 'Hello, World!'
window.hello = ->
html = JST['app/templates/hello.us'](text: helloText())
document.body.innerHTML += html | if window.addEventListener
window.addEventListener('DOMContentLoaded', hello, false)
else
window.attachEvent('onload', hello) | CoffeeScript | CoffeeScript | linemanjs/lineman | archetype/app/js/hello.coffee | MIT | 7f31050d0bfb3b3c08ade626e1b53133b06b95b1 | 1,168 | https://github.com/linemanjs/lineman/blob/7f31050d0bfb3b3c08ade626e1b53133b06b95b1/archetype/app/js/hello.coffee | 1 | 10 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'topic-page'
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
router: T.instanceOf(Immutable.Map).isRequired
getInitialState: ->
isLoading: false
editorHeight: 170
messageEnd: false
topic: ... | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 28 | 77 | ||
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'topic-page'
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
router: T.instanceOf(Immutable.Map).isRequired
getInitialState: ->
isLoading: fals... | module.exports = React.createClass({
displayName: 'topic-page',
mixins: [mixinSubscribe],
propTypes: {
_teamId: T.string.isRequired,
_roomId: T.string.isRequired,
router: T.instanceOf(Immutable.Map).isRequired
},
getInitialState: function() {
return {
isLoading: false,
editorHeight... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 28 | 77 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'topic-page',
mixins: [mixinSubscribe],
propTypes: {
_teamId: T.string.isRequired,
_roomId: T.string.isRequired,
router: T.instanceOf(Immutable.Map).isRequired
},
getInitialState: function() {
... | module.exports = React.createClass
displayName: 'topic-page'
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
router: T.instanceOf(Immutable.Map).isRequired
getInitialState: ->
isLoading: false
editorHeight: 170
messageEnd: false
topic: ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 28 | 77 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'topic-page'
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_roomId: T.string.isRequired
router: T.instanceOf(Immutable.Map).isRequired
getInitialState: ->
isLoading: false
editorHeight: 170
messageEnd: false
topic: ... | members: @getMembers()
messages: @getMessages()
notifyBanner: @getNotifyBanner()
draftMessage: @state.draftMessage.set 'body', @getMessageDraft()
eventBus.emit 'dirty-action/new-message'
getTopic: ->
query.topicsByOne(recorder.getState(), @props._teamId, @props._roomId)
getMembers... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 28 | 77 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:2:raw_corpus | raw_corpus | unread = @state.topic.get('unread') or 0
if unread is 0 then return # no unread to clear
data =
_teamId: @props._teamId
_roomId: @props._roomId
_latestReadMessageId: find.maxId @state.messages
messageActions.messageClear data
isNewInGeneral: ->
prefs = query.prefs(recorder.getState(... | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 78 | 127 | ||
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:2:completion | completion | unread = @state.topic.get('unread') or 0
if unread is 0 then return # no unread to clear
data =
_teamId: @props._teamId
_roomId: @props._roomId
_latestReadMessageId: find.maxId @state.messages
messageActions.messageClear data
isNewInGeneral: ->
prefs = query.prefs(recorder.getState(... | if resp.length < 10
then @setState isLoading: false, messageEnd: true
else @setState isLoading: false
(resp) ->
console.error 'load history', resp
onMessageSubmit: (content, displayType) ->
_userId = query.userId(recorder.getState())
params =
_teamId: @props._teamId
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 78 | 127 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:3:raw_corpus | raw_corpus | @onClearUnread()
getTuned: ->
query.isTuned recorder.getState()
renderTitle: ->
if @state.topic?.get('topic')?
document.title = @state.topic.get('topic')
notify.favicon @state.topic.get('unread')
renderHeader: ->
TopicHeader
_teamId: @props._teamId
_roomId: @props._roomId
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 128 | 177 | ||
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@onClearUnread()
getTuned: ->
query.isTuned recorder.getState()
renderTitle: ->
if @state.topic?.get('topic')?
document.title = @state.topic.get('topic')
notify.favicon @state.topic.get('unread')
renderHeader: ->
TopicHeader
... | this.onClearUnread()({
getTuned: function() {
return query.isTuned(recorder.getState());
},
renderTitle: function() {
var ref;
if (((ref = this.state.topic) != null ? ref.get('topic') : void 0) != null) {
document.title = this.state.topic.get('topic');
return notify.favicon(this.state.topi... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 128 | 177 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.onClearUnread()({
getTuned: function() {
return query.isTuned(recorder.getState());
},
renderTitle: function() {
var ref;
if (((ref = this.state.topic) != null ? ref.get('topic') : void 0) != null) {
document.title = this.state.topic.ge... | @onClearUnread()
getTuned: ->
query.isTuned recorder.getState()
renderTitle: ->
if @state.topic?.get('topic')?
document.title = @state.topic.get('topic')
notify.favicon @state.topic.get('unread')
renderHeader: ->
TopicHeader
_teamId: @props._teamId
_roomId: @props._roomId
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 128 | 177 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:3:completion | completion | @onClearUnread()
getTuned: ->
query.isTuned recorder.getState()
renderTitle: ->
if @state.topic?.get('topic')?
document.title = @state.topic.get('topic')
notify.favicon @state.topic.get('unread')
renderHeader: ->
TopicHeader
_teamId: @props._teamId
_roomId: @props._roomId
... | end: @state.messageEnd
onScrollReachTop: @onScrollReachTop
onScrollReachBottom: @onScrollReachBottom
onScrollStayBottom: @onScrollStayBottom
onUnreadClick: @onScrollReachBottom
editorHeight: @state.editorHeight
unread: @state.topic?.get('unread') or 0
isTuned: @state.isTuned
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 128 | 177 |
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:4:raw_corpus | raw_corpus | _storyId: null
_channelId: null
_channelType: null
onSubmit: @onMessageSubmit
message: @state.draftMessage
render: ->
@renderTitle()
div className: 'topic-page', lang: lang.getText('dnd-guide'),
@renderHeader()
@renderMessageArea()
@renderEditor() | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 178 | 190 | ||
jianliaoim/talk-os:talk-web/client/guest-app/topic-page.coffee:4:completion | completion | _storyId: null
_channelId: null
_channelType: null
onSubmit: @onMessageSubmit
message: @state.draftMessage | render: ->
@renderTitle()
div className: 'topic-page', lang: lang.getText('dnd-guide'),
@renderHeader()
@renderMessageArea()
@renderEditor() | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/topic-page.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/topic-page.coffee | 178 | 190 |
snd/url-pattern:index.coffee:1:raw_corpus | raw_corpus | common = require './common'
pattern =
match: (url) ->
match = @regex.exec url
return null unless match?
captured = match.slice(1)
return captured if @isRegex
bound = {}
bound[@names[i]] = captured[i] for i in [0...captured.length]
bound
module.exports = (a... | CoffeeScript | snd/url-pattern | index.coffee | MIT | 3b934d491e99dd3dc23b84ef3cc70243545720a4 | 588 | https://github.com/snd/url-pattern/blob/3b934d491e99dd3dc23b84ef3cc70243545720a4/index.coffee | 1 | 23 | ||
snd/url-pattern:index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
common = require './common'
pattern =
match: (url) ->
match = @regex.exec url
return null unless match?
captured = match.slice(1)
return captured if @isRegex
bound = {}
bound[@names[i]] = captured[i] for i in... | var common, pattern;
common = require('./common');
pattern = {
match: function(url) {
var bound, captured, i, j, match, ref;
match = this.regex.exec(url);
if (match == null) {
return null;
}
captured = match.slice(1);
if (this.isRegex) {
return captured;
}
bound = {};
... | CoffeeScript | JavaScript | snd/url-pattern | index.coffee | MIT | 3b934d491e99dd3dc23b84ef3cc70243545720a4 | 588 | https://github.com/snd/url-pattern/blob/3b934d491e99dd3dc23b84ef3cc70243545720a4/index.coffee | 1 | 23 |
snd/url-pattern:index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var common, pattern;
common = require('./common');
pattern = {
match: function(url) {
var bound, captured, i, j, match, ref;
match = this.regex.exec(url);
if (match == null) {
return null;
}
captured = match.slice(1);
if (this.isRe... | common = require './common'
pattern =
match: (url) ->
match = @regex.exec url
return null unless match?
captured = match.slice(1)
return captured if @isRegex
bound = {}
bound[@names[i]] = captured[i] for i in [0...captured.length]
bound
module.exports = (a... | JavaScript | CoffeeScript | snd/url-pattern | index.coffee | MIT | 3b934d491e99dd3dc23b84ef3cc70243545720a4 | 588 | https://github.com/snd/url-pattern/blob/3b934d491e99dd3dc23b84ef3cc70243545720a4/index.coffee | 1 | 23 |
snd/url-pattern:index.coffee:1:completion | completion | common = require './common'
pattern =
match: (url) ->
match = @regex.exec url
return null unless match?
captured = match.slice(1)
return captured if @isRegex
bound = {} | bound[@names[i]] = captured[i] for i in [0...captured.length]
bound
module.exports = (arg) ->
isRegex = arg instanceof RegExp
unless ('string' is typeof arg) or isRegex
throw new TypeError 'argument must be a regex or a string'
p = Object.create pattern
p.isRegex = isRegex
p.regex =... | CoffeeScript | CoffeeScript | snd/url-pattern | index.coffee | MIT | 3b934d491e99dd3dc23b84ef3cc70243545720a4 | 588 | https://github.com/snd/url-pattern/blob/3b934d491e99dd3dc23b84ef3cc70243545720a4/index.coffee | 1 | 23 |
snd/url-pattern:index.coffee:1:raw_corpus | raw_corpus | _ = require 'underscore'
util = require './util'
module.exports = class
constructor: (arg) ->
if not (_.isRegExp(arg) or _.isString(arg))
throw new TypeError 'argument must be either a regex or a string'
@isRegex = _.isRegExp arg
@regex = util.toRegex arg
@names = uti... | CoffeeScript | snd/url-pattern | index.coffee | MIT | b7f1d2060e83973e3a5310ea3d7b299f58ad25bb | 588 | https://github.com/snd/url-pattern/blob/b7f1d2060e83973e3a5310ea3d7b299f58ad25bb/index.coffee | 1 | 24 | ||
snd/url-pattern:index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'underscore'
util = require './util'
module.exports = class
constructor: (arg) ->
if not (_.isRegExp(arg) or _.isString(arg))
throw new TypeError 'argument must be either a regex or a string'
@isRegex = _.isRegExp a... | var _, util;
_ = require('underscore');
util = require('./util');
module.exports = class {
constructor(arg) {
if (!(_.isRegExp(arg) || _.isString(arg))) {
throw new TypeError('argument must be either a regex or a string');
}
this.isRegex = _.isRegExp(arg);
this.regex = util.toRegex(arg);
... | CoffeeScript | JavaScript | snd/url-pattern | index.coffee | MIT | b7f1d2060e83973e3a5310ea3d7b299f58ad25bb | 588 | https://github.com/snd/url-pattern/blob/b7f1d2060e83973e3a5310ea3d7b299f58ad25bb/index.coffee | 1 | 24 |
snd/url-pattern:index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, util;
_ = require('underscore');
util = require('./util');
module.exports = class {
constructor(arg) {
if (!(_.isRegExp(arg) || _.isString(arg))) {
throw new TypeError('argument must be either a regex or a string');
}
this.isRegex = _.... | _ = require 'underscore'
util = require './util'
module.exports = class
constructor: (arg) ->
if not (_.isRegExp(arg) or _.isString(arg))
throw new TypeError 'argument must be either a regex or a string'
@isRegex = _.isRegExp arg
@regex = util.toRegex arg
@names = uti... | JavaScript | CoffeeScript | snd/url-pattern | index.coffee | MIT | b7f1d2060e83973e3a5310ea3d7b299f58ad25bb | 588 | https://github.com/snd/url-pattern/blob/b7f1d2060e83973e3a5310ea3d7b299f58ad25bb/index.coffee | 1 | 24 |
snd/url-pattern:index.coffee:1:completion | completion | _ = require 'underscore'
util = require './util'
module.exports = class
constructor: (arg) ->
if not (_.isRegExp(arg) or _.isString(arg))
throw new TypeError 'argument must be either a regex or a string'
@isRegex = _.isRegExp arg
@regex = util.toRegex arg | @names = util.getNames arg if not @isRegex
match: (url) ->
match = @regex.exec url
return null if not match?
captured = match[1..]
return captured if @isRegex
bound = {}
_.each _.zip(captured, @names), ([value, name]) -> bound[name] = value
bound | CoffeeScript | CoffeeScript | snd/url-pattern | index.coffee | MIT | b7f1d2060e83973e3a5310ea3d7b299f58ad25bb | 588 | https://github.com/snd/url-pattern/blob/b7f1d2060e83973e3a5310ea3d7b299f58ad25bb/index.coffee | 1 | 24 |
jianliaoim/talk-os:talk-web/client/mixin/layered.coffee:1:raw_corpus | raw_corpus | # Code mostly done at:
# http://stackoverflow.com/a/26789089/883571
React = require 'react'
ReactDOM = require 'react-dom'
util = require '../util/util'
time = require '../util/time'
module.exports =
# needs to implement
# renderLayer: (afterTransition) ->
# use afterTransition to control initial animation
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/mixin/layered.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/mixin/layered.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/mixin/layered.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Code mostly done at:
# http://stackoverflow.com/a/26789089/883571
React = require 'react'
ReactDOM = require 'react-dom'
util = require '../util/util'
time = require '../util/time'
module.exports =
# needs to implement
# renderLayer: (afterTransition) ... | // Code mostly done at:
// http://stackoverflow.com/a/26789089/883571
var React, ReactDOM, time, util;
React = require('react');
ReactDOM = require('react-dom');
util = require('../util/util');
time = require('../util/time');
module.exports = {
// needs to implement
// renderLayer: (afterTransition) ->
// u... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/mixin/layered.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/mixin/layered.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/mixin/layered.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Code mostly done at:
// http://stackoverflow.com/a/26789089/883571
var React, ReactDOM, time, util;
React = require('react');
ReactDOM = require('react-dom');
util = require('../util/util');
time = require('../util/time');
module.exports = {
// needs to i... | # Code mostly done at:
# http://stackoverflow.com/a/26789089/883571
React = require 'react'
ReactDOM = require 'react-dom'
util = require '../util/util'
time = require '../util/time'
module.exports =
# needs to implement
# renderLayer: (afterTransition) ->
# use afterTransition to control initial animation
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/mixin/layered.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/mixin/layered.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/mixin/layered.coffee:1:completion | completion | # Code mostly done at:
# http://stackoverflow.com/a/26789089/883571
React = require 'react'
ReactDOM = require 'react-dom'
util = require '../util/util'
time = require '../util/time'
module.exports =
# needs to implement
# renderLayer: (afterTransition) ->
# use afterTransition to control initial animation
... | componentDidUpdate: ->
@_renderLayer()
_renderLayer: ->
if @_target?
@_renderChildren()
return
if (not @props.show) and (not @_target?)
return
# so show but found no target
@_target = document.createElement 'div'
document.body.appendChild @_target
@bindWindowEvents?()
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/mixin/layered.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/mixin/layered.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/group-details.coffee:1:raw_corpus | raw_corpus | React = require 'react'
cx = require 'classnames'
Immutable = require 'immutable'
orders = require '../util/orders'
lang = require '../locales/lang'
Permission = require '../module/permission'
ContactItem = React.createFactory require './contact-item'
{ div, span, button } = React.DOM
T = React.PropTypes
l = lang... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/group-details.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/group-details.coffee | 1 | 37 | ||
jianliaoim/talk-os:talk-web/client/app/group-details.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
cx = require 'classnames'
Immutable = require 'immutable'
orders = require '../util/orders'
lang = require '../locales/lang'
Permission = require '../module/permission'
ContactItem = React.createFactory require './contact-item'
{ div,... | var ContactItem, Immutable, Permission, React, T, button, cx, div, l, lang, orders, span;
React = require('react');
cx = require('classnames');
Immutable = require('immutable');
orders = require('../util/orders');
lang = require('../locales/lang');
Permission = require('../module/permission');
ContactItem = Reac... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/group-details.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/group-details.coffee | 1 | 37 |
jianliaoim/talk-os:talk-web/client/app/group-details.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ContactItem, Immutable, Permission, React, T, button, cx, div, l, lang, orders, span;
React = require('react');
cx = require('classnames');
Immutable = require('immutable');
orders = require('../util/orders');
lang = require('../locales/lang');
Permission... | React = require 'react'
cx = require 'classnames'
Immutable = require 'immutable'
orders = require '../util/orders'
lang = require '../locales/lang'
Permission = require '../module/permission'
ContactItem = React.createFactory require './contact-item'
{ div, span, button } = React.DOM
T = React.PropTypes
l = lang... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/group-details.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/group-details.coffee | 1 | 37 |
jianliaoim/talk-os:talk-web/client/app/group-details.coffee:1:completion | completion | React = require 'react'
cx = require 'classnames'
Immutable = require 'immutable'
orders = require '../util/orders'
lang = require '../locales/lang'
Permission = require '../module/permission'
ContactItem = React.createFactory require './contact-item'
{ div, span, button } = React.DOM
T = React.PropTypes
l = lang... | displayName: 'group-details'
propTypes:
_teamId: T.string.isRequired
group: T.instanceOf(Immutable.Map).isRequired
contacts: T.instanceOf(Immutable.List).isRequired
render: ->
div className: 'group-details flex-vert',
div className: 'list thin-scroll',
@props.group.get('_memberIds').... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/group-details.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/group-details.coffee | 1 | 37 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:raw_corpus | raw_corpus | _ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item instanceof Spread
item.toArray()
else
... | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 1 | 50 | ||
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item... | var Spread, _;
_ = require("underscore");
module.exports = Spread = class Spread {
constructor(items, origin) {
this.items = items;
this.origin = origin;
}
// Recursively converts a spread to an array. So if I'm a nested spread,
// toArray will return a nested array.
toArray() {
return _.map(th... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 1 | 50 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Spread, _;
_ = require("underscore");
module.exports = Spread = class Spread {
constructor(items, origin) {
this.items = items;
this.origin = origin;
}
// Recursively converts a spread to an array. So if I'm a nested spread,
// toArray will r... | _ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item instanceof Spread
item.toArray()
else
... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 1 | 50 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:completion | completion | _ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item instanceof Spread
item.toArray()
else
... | else
bestRestOfOrigins = []
for item in value.items
curRestOfOrigins = Spread.origins(item)
if curRestOfOrigins.length > bestRestOfOrigins.length
bestRestOfOrigins = curRestOfOrigins
bestRestOfOrigins
restOfOrigins.unshift(value.origin)
ret... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 1 | 50 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:2:raw_corpus | raw_corpus | if item instanceof Spread
item.setAt(value, spreadEnv)
else
@items[index] = value
cloneSingleLevel: () ->
new Spread(@items.slice(), @origin)
Spread.reshapeLike = (spread, otherSpread, defaultValue = 0) ->
if not (spread instanceof Spread)
if not (otherSpread instanceof Spread)
retur... | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 51 | 80 | ||
cdglabs/apparatus:src/Dataflow/Spread.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if item instanceof Spread
item.setAt(value, spreadEnv)
else
@items[index] = value
cloneSingleLevel: () ->
new Spread(@items.slice(), @origin)
Spread.reshapeLike = (spread, otherSpread, defaultValue = 0) ->
if not (spread instanceof Sprea... | if (item instanceof Spread) {
item.setAt(value, spreadEnv);
} else {
this.items[index] = value;
}
({
cloneSingleLevel: function() {
return new Spread(this.items.slice(), this.origin);
}
});
Spread.reshapeLike = function(spread, otherSpread, defaultValue = 0) {
if (!(spread instanceof Spread)) {
if (... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 51 | 80 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (item instanceof Spread) {
item.setAt(value, spreadEnv);
} else {
this.items[index] = value;
}
({
cloneSingleLevel: function() {
return new Spread(this.items.slice(), this.origin);
}
});
Spread.reshapeLike = function(spread, otherSpread, defaultVal... | if item instanceof Spread
item.setAt(value, spreadEnv)
else
@items[index] = value
cloneSingleLevel: () ->
new Spread(@items.slice(), @origin)
Spread.reshapeLike = (spread, otherSpread, defaultValue = 0) ->
if not (spread instanceof Spread)
if not (otherSpread instanceof Spread)
retur... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 51 | 80 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:2:completion | completion | if item instanceof Spread
item.setAt(value, spreadEnv)
else
@items[index] = value
cloneSingleLevel: () ->
new Spread(@items.slice(), @origin)
Spread.reshapeLike = (spread, otherSpread, defaultValue = 0) ->
if not (spread instanceof Spread)
if not (otherSpread instanceof Spread)
retur... | else # spread instanceof Spread
if spread.origin == otherSpread.origin
return otherSpread.mapSingleLevel (otherItem, i) ->
Spread.reshapeLike(spread.items[i] ? defaultValue, otherItem)
else # spread.origin != otherSpread.origin
if otherSpread.isSpreadAlongOrigin(spread.origin)
# do... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Dataflow/Spread.coffee | 51 | 80 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:raw_corpus | raw_corpus | _ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item instanceof Spread
item.toArray()
else
... | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 6468bc5630827b0673f41ad19edb883b1dfb1530 | 1,052 | https://github.com/cdglabs/apparatus/blob/6468bc5630827b0673f41ad19edb883b1dfb1530/src/Dataflow/Spread.coffee | 1 | 36 | ||
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item... | var Spread, _;
_ = require("underscore");
module.exports = Spread = class Spread {
constructor(items, origin) {
this.items = items;
this.origin = origin;
}
// Recursively converts a spread to an array. So if I'm a nested spread,
// toArray will return a nested array.
toArray() {
return _.map(th... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 6468bc5630827b0673f41ad19edb883b1dfb1530 | 1,052 | https://github.com/cdglabs/apparatus/blob/6468bc5630827b0673f41ad19edb883b1dfb1530/src/Dataflow/Spread.coffee | 1 | 36 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Spread, _;
_ = require("underscore");
module.exports = Spread = class Spread {
constructor(items, origin) {
this.items = items;
this.origin = origin;
}
// Recursively converts a spread to an array. So if I'm a nested spread,
// toArray will r... | _ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item instanceof Spread
item.toArray()
else
... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 6468bc5630827b0673f41ad19edb883b1dfb1530 | 1,052 | https://github.com/cdglabs/apparatus/blob/6468bc5630827b0673f41ad19edb883b1dfb1530/src/Dataflow/Spread.coffee | 1 | 36 |
cdglabs/apparatus:src/Dataflow/Spread.coffee:1:completion | completion | _ = require "underscore"
module.exports = class Spread
constructor: (@items, @origin) ->
# Recursively converts a spread to an array. So if I'm a nested spread,
# toArray will return a nested array.
toArray: ->
_.map @items, (item) ->
if item instanceof Spread
item.toArray()
else
... | # Given a value, returns an array of its spread-origins (if it's a spread) or
# [] (otherwise). Assumes that spreads are homogeneous.
@origins: (value) ->
if value instanceof Spread
restOfOrigins =
if value.items.length == 0
[]
else
bestRestOfOrigins = []
for ... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Dataflow/Spread.coffee | MIT | 6468bc5630827b0673f41ad19edb883b1dfb1530 | 1,052 | https://github.com/cdglabs/apparatus/blob/6468bc5630827b0673f41ad19edb883b1dfb1530/src/Dataflow/Spread.coffee | 1 | 36 |
Glavin001/atom-beautify:src/beautifiers/htmlbeautifier.coffee:1:raw_corpus | raw_corpus | ###
Requires https://github.com/threedaymonk/htmlbeautifier
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class HTMLBeautifier extends Beautifier
name: "HTML Beautifier"
link: "https://github.com/threedaymonk/htmlbeautifier"
isPreInstalled: false
options: {
ERB:
indent_size... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/htmlbeautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/htmlbeautifier.coffee | 1 | 26 | ||
Glavin001/atom-beautify:src/beautifiers/htmlbeautifier.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires https://github.com/threedaymonk/htmlbeautifier
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class HTMLBeautifier extends Beautifier
name: "HTML Beautifier"
link: "https://github.com/threedaymonk/htmlbeautifier"
isPre... | /*
Requires https://github.com/threedaymonk/htmlbeautifier
*/
"use strict";
var Beautifier, HTMLBeautifier;
Beautifier = require('./beautifier');
module.exports = HTMLBeautifier = (function() {
class HTMLBeautifier extends Beautifier {
beautify(text, language, options) {
var tempFile;
console.log('e... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/htmlbeautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/htmlbeautifier.coffee | 1 | 26 |
Glavin001/atom-beautify:src/beautifiers/htmlbeautifier.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires https://github.com/threedaymonk/htmlbeautifier
*/
"use strict";
var Beautifier, HTMLBeautifier;
Beautifier = require('./beautifier');
module.exports = HTMLBeautifier = (function() {
class HTMLBeautifier extends Beautifier {
beautify(text, langua... | ###
Requires https://github.com/threedaymonk/htmlbeautifier
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class HTMLBeautifier extends Beautifier
name: "HTML Beautifier"
link: "https://github.com/threedaymonk/htmlbeautifier"
isPreInstalled: false
options: {
ERB:
indent_size... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/htmlbeautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/htmlbeautifier.coffee | 1 | 26 |
Glavin001/atom-beautify:src/beautifiers/htmlbeautifier.coffee:1:completion | completion | ###
Requires https://github.com/threedaymonk/htmlbeautifier
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class HTMLBeautifier extends Beautifier
name: "HTML Beautifier"
link: "https://github.com/threedaymonk/htmlbeautifier"
isPreInstalled: false
options: { | ERB:
indent_size: true
}
beautify: (text, language, options) ->
console.log('erb', options)
@run("htmlbeautifier", [
"--tab-stops", options.indent_size
tempFile = @tempFile("temp", text)
])
.then(=>
@readFile(tempFile)
) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/htmlbeautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/htmlbeautifier.coffee | 1 | 26 |
jianliaoim/talk-os:talk-web/client/app/story-name.coffee:1:raw_corpus | raw_corpus | React = require 'react'
colors = require '../util/colors'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'story-name'
mixins: [PureRenderMixin]
propTyp... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/story-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/story-name.coffee | 1 | 43 | ||
jianliaoim/talk-os:talk-web/client/app/story-name.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
colors = require '../util/colors'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span } = React.DOM
T = React.PropTypes
module.exports = React.createClass
display... | var Icon, PureRenderMixin, React, T, colors, div, span;
React = require('react');
colors = require('../util/colors');
Icon = React.createFactory(require('../module/icon'));
PureRenderMixin = require('react-addons-pure-render-mixin');
({div, span} = React.DOM);
T = React.PropTypes;
module.exports = React.createCl... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/story-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/story-name.coffee | 1 | 43 |
jianliaoim/talk-os:talk-web/client/app/story-name.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Icon, PureRenderMixin, React, T, colors, div, span;
React = require('react');
colors = require('../util/colors');
Icon = React.createFactory(require('../module/icon'));
PureRenderMixin = require('react-addons-pure-render-mixin');
({div, span} = React.DOM);... | React = require 'react'
colors = require '../util/colors'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'story-name'
mixins: [PureRenderMixin]
propTyp... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/story-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/story-name.coffee | 1 | 43 |
jianliaoim/talk-os:talk-web/client/app/story-name.coffee:1:completion | completion | React = require 'react'
colors = require '../util/colors'
Icon = React.createFactory require '../module/icon'
PureRenderMixin = require 'react-addons-pure-render-mixin'
{ div, span } = React.DOM
T = React.PropTypes
module.exports = React.createClass
displayName: 'story-name'
mixins: [PureRenderMixin]
propTyp... | showIcon: true
renderIcon: ->
return null unless @props.showIcon
switch @props.category
when 'file'
icon = 'paperclip-lean'
when 'link'
icon = 'chain'
when 'topic'
icon = 'idea'
Icon
name: icon
color: '#FFF'
backgroundColor: colors.story[@prop... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/story-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/story-name.coffee | 1 | 43 |
cdglabs/apparatus:src/View/Inspector.coffee:1:raw_corpus | raw_corpus | R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {className: "Inspector"},
R.div {className: "Header"}... | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 1 | 41 | ||
cdglabs/apparatus:src/View/Inspector.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {c... | var Model, R, Util;
R = require("./R");
Model = require("../Model/Model");
Util = require("../Util/Util");
R.create("Inspector", {
contextTypes: {
project: Model.Project
},
render: function() {
var element, project, ref, ref1;
project = this.context.project;
element = (ref = project.selectedPa... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 1 | 41 |
cdglabs/apparatus:src/View/Inspector.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Model, R, Util;
R = require("./R");
Model = require("../Model/Model");
Util = require("../Util/Util");
R.create("Inspector", {
contextTypes: {
project: Model.Project
},
render: function() {
var element, project, ref, ref1;
project = this.c... | R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {className: "Inspector"},
R.div {className: "Header"}... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 1 | 41 |
cdglabs/apparatus:src/View/Inspector.coffee:1:completion | completion | R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {className: "Inspector"},
R.div {className: "Header"}... | R.create "FullAttributesList",
propTypes:
element: Model.Element
context: ["Outline", "Inspector"]
render: ->
{element, context} = @props
R.div {className: "InspectorList"},
R.div {className: "ComponentSection"},
R.div {className: "ComponentSectionTitle"},
R.span {},
... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 1 | 41 |
cdglabs/apparatus:src/View/Inspector.coffee:2:raw_corpus | raw_corpus | _addVariable: ->
{element} = @props
element.addVariable()
R.create "VariablesList",
propTypes:
element: Model.Element
context: ["Outline", "Inspector"]
mixins: [R.AnnotateMixin]
render: ->
{element, context} = @props
R.div {className: "VariablesList"},
for attribute in element.v... | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 43 | 81 | ||
cdglabs/apparatus:src/View/Inspector.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_addVariable: ->
{element} = @props
element.addVariable()
R.create "VariablesList",
propTypes:
element: Model.Element
context: ["Outline", "Inspector"]
mixins: [R.AnnotateMixin]
render: ->
{element, context} = @props
R.div {clas... | ({
_addVariable: function() {
var element;
({element} = this.props);
return element.addVariable();
}
});
R.create("VariablesList", {
propTypes: {
element: Model.Element,
context: ["Outline", "Inspector"]
},
mixins: [R.AnnotateMixin],
render: function() {
var attribute, context, elem... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 43 | 81 |
cdglabs/apparatus:src/View/Inspector.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_addVariable: function() {
var element;
({element} = this.props);
return element.addVariable();
}
});
R.create("VariablesList", {
propTypes: {
element: Model.Element,
context: ["Outline", "Inspector"]
},
mixins: [R.AnnotateMixin],
... | _addVariable: ->
{element} = @props
element.addVariable()
R.create "VariablesList",
propTypes:
element: Model.Element
context: ["Outline", "Inspector"]
mixins: [R.AnnotateMixin]
render: ->
{element, context} = @props
R.div {className: "VariablesList"},
for attribute in element.v... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 43 | 81 |
cdglabs/apparatus:src/View/Inspector.coffee:2:completion | completion | _addVariable: ->
{element} = @props
element.addVariable()
R.create "VariablesList",
propTypes:
element: Model.Element
context: ["Outline", "Inspector"]
mixins: [R.AnnotateMixin]
render: ->
{element, context} = @props
R.div {className: "VariablesList"},
for attribute in element.v... | annotation: ->
# Used for drag reording.
{element: @props.element, context: @props.context}
R.create "ComponentSection",
propTypes:
component: Model.Component
context: ["Outline", "Inspector"]
render: ->
{component, context} = @props
R.div {className: "ComponentSection"},
R.div {cl... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 43 | 81 |
cdglabs/apparatus:src/View/Inspector.coffee:3:raw_corpus | raw_corpus | # NovelAttributesList is used to show attributes in the Outline. A design
# question is what attributes should be shown? We want to show anything that
# you might want to reference in another expression, and anything that might
# be useful in understanding a diagram (so that the outline is like the source
# code of the... | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 83 | 118 | ||
cdglabs/apparatus:src/View/Inspector.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# NovelAttributesList is used to show attributes in the Outline. A design
# question is what attributes should be shown? We want to show anything that
# you might want to reference in another expression, and anything that might
# be useful in understanding a diag... | // NovelAttributesList is used to show attributes in the Outline. A design
// question is what attributes should be shown? We want to show anything that
// you might want to reference in another expression, and anything that might
// be useful in understanding a diagram (so that the outline is like the source
// code o... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 83 | 118 |
cdglabs/apparatus:src/View/Inspector.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// NovelAttributesList is used to show attributes in the Outline. A design
// question is what attributes should be shown? We want to show anything that
// you might want to reference in another expression, and anything that might
// be useful in understanding a di... | # NovelAttributesList is used to show attributes in the Outline. A design
# question is what attributes should be shown? We want to show anything that
# you might want to reference in another expression, and anything that might
# be useful in understanding a diagram (so that the outline is like the source
# code of the... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 83 | 118 |
cdglabs/apparatus:src/View/Inspector.coffee:3:completion | completion | # NovelAttributesList is used to show attributes in the Outline. A design
# question is what attributes should be shown? We want to show anything that
# you might want to reference in another expression, and anything that might
# be useful in understanding a diagram (so that the outline is like the source
# code of the... | {project} = @context
R.div {className: "AttributesList"},
for attribute, i in element.allAttributes()
shouldShow = attribute.isNovel() or attribute.isVariantOf(Model.Variable)
if shouldShow
R.AttributeRow {key: Util.getId(attribute), attribute, context}
if element == project.e... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Inspector.coffee | 83 | 118 |
cdglabs/apparatus:src/View/Inspector.coffee:1:raw_corpus | raw_corpus | R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {className: "Inspector"},
R.div {className: "Header"}... | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 1 | 41 | ||
cdglabs/apparatus:src/View/Inspector.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {c... | var Model, R, Util;
R = require("./R");
Model = require("../Model/Model");
Util = require("../Util/Util");
R.create("Inspector", {
contextTypes: {
project: Model.Project
},
render: function() {
var element, project, ref, ref1;
project = this.context.project;
element = (ref = project.selectedPa... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 1 | 41 |
cdglabs/apparatus:src/View/Inspector.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Model, R, Util;
R = require("./R");
Model = require("../Model/Model");
Util = require("../Util/Util");
R.create("Inspector", {
contextTypes: {
project: Model.Project
},
render: function() {
var element, project, ref, ref1;
project = this.c... | R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {className: "Inspector"},
R.div {className: "Header"}... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 1 | 41 |
cdglabs/apparatus:src/View/Inspector.coffee:1:completion | completion | R = require "./R"
Model = require "../Model/Model"
Util = require "../Util/Util"
R.create "Inspector",
contextTypes:
project: Model.Project
render: ->
project = @context.project
element = project.selectedParticularElement?.element
R.div {className: "Inspector"},
R.div {className: "Header"}... | R.create "FullAttributesList",
propTypes:
element: Model.Element
render: ->
element = @props.element
R.div {className: "InspectorList"},
R.div {className: "ComponentSection"},
R.div {className: "ComponentSectionTitle"},
R.span {},
"Variables"
R.div {classNam... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 1 | 41 |
cdglabs/apparatus:src/View/Inspector.coffee:2:raw_corpus | raw_corpus | _addVariable: ->
{element} = @props
element.addVariable()
R.create "ComponentSection",
propTypes:
component: Model.Component
render: ->
component = @props.component
R.div {className: "ComponentSection"},
R.div {className: "ComponentSectionTitle"},
R.span,
component.la... | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 43 | 88 | ||
cdglabs/apparatus:src/View/Inspector.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_addVariable: ->
{element} = @props
element.addVariable()
R.create "ComponentSection",
propTypes:
component: Model.Component
render: ->
component = @props.component
R.div {className: "ComponentSection"},
R.div {className: "Compon... | ({
_addVariable: function() {
var element;
({element} = this.props);
return element.addVariable();
}
});
R.create("ComponentSection", {
propTypes: {
component: Model.Component
},
render: function() {
var attribute, component;
component = this.props.component;
return R.div({
... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 43 | 88 |
cdglabs/apparatus:src/View/Inspector.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_addVariable: function() {
var element;
({element} = this.props);
return element.addVariable();
}
});
R.create("ComponentSection", {
propTypes: {
component: Model.Component
},
render: function() {
var attribute, component;
comp... | _addVariable: ->
{element} = @props
element.addVariable()
R.create "ComponentSection",
propTypes:
component: Model.Component
render: ->
component = @props.component
R.div {className: "ComponentSection"},
R.div {className: "ComponentSectionTitle"},
R.span,
component.la... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 43 | 88 |
cdglabs/apparatus:src/View/Inspector.coffee:2:completion | completion | _addVariable: ->
{element} = @props
element.addVariable()
R.create "ComponentSection",
propTypes:
component: Model.Component
render: ->
component = @props.component
R.div {className: "ComponentSection"},
R.div {className: "ComponentSectionTitle"},
R.span,
component.la... | # you might want to reference in another expression, and anything that might
# be useful in understanding a diagram (so that the outline is like the source
# code of the diagram). Currently we show any attribute from a component that
# is novel and all variables.
R.create "NovelAttributesList",
propTypes:
element... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 43 | 88 |
cdglabs/apparatus:src/View/Inspector.coffee:3:raw_corpus | raw_corpus | _addVariable: ->
{element} = @props
element.addVariable() | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 90 | 92 | ||
cdglabs/apparatus:src/View/Inspector.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_addVariable: ->
{element} = @props
element.addVariable()
``` | ({
_addVariable: function() {
var element;
({element} = this.props);
return element.addVariable();
}
}); | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 90 | 92 |
cdglabs/apparatus:src/View/Inspector.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
_addVariable: function() {
var element;
({element} = this.props);
return element.addVariable();
}
});
``` | _addVariable: ->
{element} = @props
element.addVariable() | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/Inspector.coffee | 90 | 92 |
cdglabs/apparatus:src/View/Inspector.coffee:2:raw_corpus | raw_corpus | _addVariable: ->
{element} = @props
element.addVariable()
R.create "ComponentSection",
propTypes:
component: Model.Component
render: ->
component = @props.component
R.div {className: "ComponentSection"},
R.div {className: "ComponentSectionTitle"},
R.span,
component.la... | CoffeeScript | cdglabs/apparatus | src/View/Inspector.coffee | MIT | 33341b13fca2662eeb70581100c8419fca12cb41 | 1,052 | https://github.com/cdglabs/apparatus/blob/33341b13fca2662eeb70581100c8419fca12cb41/src/View/Inspector.coffee | 43 | 88 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.