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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cdglabs/apparatus:src/View/R.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Dropzone, desugarPropType;
desugarPropType = function(propType) {
if (propType === Number) {
return React.PropTypes.number.isRequired;
} else if (propType === String) {
return React.PropTypes.string.isRequired;
} else if (propType === Boolean) {
... | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c4f8051fc1dce8c7050fdabb8c782a6a0122071f | 1,052 | https://github.com/cdglabs/apparatus/blob/c4f8051fc1dce8c7050fdabb8c782a6a0122071f/src/View/R.coffee | 55 | 101 |
cdglabs/apparatus:src/View/R.coffee:5:completion | completion | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | R.DragManager = require "./Manager/DragManager"
R.HoverManager = require "./Manager/HoverManager"
require "./Generic/EditableText"
require "./Generic/HTMLCanvas"
require "./Editor"
require "./Menubar"
require "./CreatePanel"
require "./ApparatusCanvas"
require "./RightPanel"
require "./Outline"
require "./Inspector"
r... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c4f8051fc1dce8c7050fdabb8c782a6a0122071f | 1,052 | https://github.com/cdglabs/apparatus/blob/c4f8051fc1dce8c7050fdabb8c782a6a0122071f/src/View/R.coffee | 55 | 101 |
cdglabs/apparatus:src/View/R.coffee:5:raw_corpus | raw_corpus | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c2564482c7207389c163d3f99ccf564d0eae351a | 1,052 | https://github.com/cdglabs/apparatus/blob/c2564482c7207389c163d3f99ccf564d0eae351a/src/View/R.coffee | 55 | 97 | ||
cdglabs/apparatus:src/View/R.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propT... | var desugarPropType;
desugarPropType = function(propType) {
if (propType === Number) {
return React.PropTypes.number.isRequired;
} else if (propType === String) {
return React.PropTypes.string.isRequired;
} else if (propType === Boolean) {
return React.PropTypes.bool.isRequired;
} else if (propType... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/R.coffee | MIT | c2564482c7207389c163d3f99ccf564d0eae351a | 1,052 | https://github.com/cdglabs/apparatus/blob/c2564482c7207389c163d3f99ccf564d0eae351a/src/View/R.coffee | 55 | 97 |
cdglabs/apparatus:src/View/R.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var desugarPropType;
desugarPropType = function(propType) {
if (propType === Number) {
return React.PropTypes.number.isRequired;
} else if (propType === String) {
return React.PropTypes.string.isRequired;
} else if (propType === Boolean) {
return... | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c2564482c7207389c163d3f99ccf564d0eae351a | 1,052 | https://github.com/cdglabs/apparatus/blob/c2564482c7207389c163d3f99ccf564d0eae351a/src/View/R.coffee | 55 | 97 |
cdglabs/apparatus:src/View/R.coffee:5:completion | completion | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | else
return React.PropTypes.instanceOf(propType).isRequired
R.DragManager = require "./Manager/DragManager"
R.HoverManager = require "./Manager/HoverManager"
require "./Generic/EditableText"
require "./Generic/HTMLCanvas"
require "./Editor"
require "./Menubar"
require "./CreatePanel"
require "./ApparatusCanva... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c2564482c7207389c163d3f99ccf564d0eae351a | 1,052 | https://github.com/cdglabs/apparatus/blob/c2564482c7207389c163d3f99ccf564d0eae351a/src/View/R.coffee | 55 | 97 |
cdglabs/apparatus:src/View/R.coffee:5:raw_corpus | raw_corpus | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/R.coffee | 55 | 98 | ||
cdglabs/apparatus:src/View/R.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propT... | var desugarPropType;
desugarPropType = function(propType) {
if (propType === Number) {
return React.PropTypes.number.isRequired;
} else if (propType === String) {
return React.PropTypes.string.isRequired;
} else if (propType === Boolean) {
return React.PropTypes.bool.isRequired;
} else if (propType... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/R.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/R.coffee | 55 | 98 |
cdglabs/apparatus:src/View/R.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var desugarPropType;
desugarPropType = function(propType) {
if (propType === Number) {
return React.PropTypes.number.isRequired;
} else if (propType === String) {
return React.PropTypes.string.isRequired;
} else if (propType === Boolean) {
return... | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/R.coffee | 55 | 98 |
cdglabs/apparatus:src/View/R.coffee:5:completion | completion | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | return React.PropTypes.instanceOf(propType).isRequired
R.DragManager = require "./Manager/DragManager"
R.HoverManager = require "./Manager/HoverManager"
require "./Generic/EditableText"
require "./Generic/HTMLCanvas"
require "./Picture"
require "./Editor"
require "./Menubar"
require "./CreatePanel"
require "./Can... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | fb837b40f040fa87bf52a8eecb66ad90a896e8a4 | 1,052 | https://github.com/cdglabs/apparatus/blob/fb837b40f040fa87bf52a8eecb66ad90a896e8a4/src/View/R.coffee | 55 | 98 |
cdglabs/apparatus:src/View/R.coffee:2:raw_corpus | raw_corpus | R.cx = (classNames) ->
Object.keys(classNames).filter((className) -> classNames[className]).join(" ")
# AnnotateMixin is used to annotate the created DOM Node with some extra
# information in an "expando" property called annotation. This is often useful
# when coordinating interactions with other Components. When us... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 15 | 32 | ||
cdglabs/apparatus:src/View/R.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
R.cx = (classNames) ->
Object.keys(classNames).filter((className) -> classNames[className]).join(" ")
# AnnotateMixin is used to annotate the created DOM Node with some extra
# information in an "expando" property called annotation. This is often useful
# when... | R.cx = function(classNames) {
return Object.keys(classNames).filter(function(className) {
return classNames[className];
}).join(" ");
};
// AnnotateMixin is used to annotate the created DOM Node with some extra
// information in an "expando" property called annotation. This is often useful
// when coordinating... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 15 | 32 |
cdglabs/apparatus:src/View/R.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
R.cx = function(classNames) {
return Object.keys(classNames).filter(function(className) {
return classNames[className];
}).join(" ");
};
// AnnotateMixin is used to annotate the created DOM Node with some extra
// information in an "expando" property calle... | R.cx = (classNames) ->
Object.keys(classNames).filter((className) -> classNames[className]).join(" ")
# AnnotateMixin is used to annotate the created DOM Node with some extra
# information in an "expando" property called annotation. This is often useful
# when coordinating interactions with other Components. When us... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 15 | 32 |
cdglabs/apparatus:src/View/R.coffee:2:completion | completion | R.cx = (classNames) ->
Object.keys(classNames).filter((className) -> classNames[className]).join(" ")
# AnnotateMixin is used to annotate the created DOM Node with some extra
# information in an "expando" property called annotation. This is often useful
# when coordinating interactions with other Components. When us... | componentDidUpdate: -> @_annotateDOMNode()
componentWillUnmount: -> @_clearAnnotation()
_annotateDOMNode: ->
el = @getDOMNode()
el.annotation = @annotation()
_clearAnnotation: ->
el = @getDOMNode()
delete el.annotation
} | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 15 | 32 |
cdglabs/apparatus:src/View/R.coffee:3:raw_corpus | raw_corpus | R.create = (name, spec) ->
# Component.displayName is used by React in its debugging messages.
spec.displayName = name
for typesProperty in ["propTypes", "childContextTypes", "contextTypes"]
if spec[typesProperty]
spec[typesProperty] = desugarPropTypes(spec[typesProperty])
component = React.createCl... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 35 | 47 | ||
cdglabs/apparatus:src/View/R.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
R.create = (name, spec) ->
# Component.displayName is used by React in its debugging messages.
spec.displayName = name
for typesProperty in ["propTypes", "childContextTypes", "contextTypes"]
if spec[typesProperty]
spec[typesProperty] = desugarPro... | R.create = function(name, spec) {
var component, i, len, ref, typesProperty;
// Component.displayName is used by React in its debugging messages.
spec.displayName = name;
ref = ["propTypes", "childContextTypes", "contextTypes"];
for (i = 0, len = ref.length; i < len; i++) {
typesProperty = ref[i];
if ... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 35 | 47 |
cdglabs/apparatus:src/View/R.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
R.create = function(name, spec) {
var component, i, len, ref, typesProperty;
// Component.displayName is used by React in its debugging messages.
spec.displayName = name;
ref = ["propTypes", "childContextTypes", "contextTypes"];
for (i = 0, len = ref.leng... | R.create = (name, spec) ->
# Component.displayName is used by React in its debugging messages.
spec.displayName = name
for typesProperty in ["propTypes", "childContextTypes", "contextTypes"]
if spec[typesProperty]
spec[typesProperty] = desugarPropTypes(spec[typesProperty])
component = React.createCl... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 35 | 47 |
cdglabs/apparatus:src/View/R.coffee:3:completion | completion | R.create = (name, spec) ->
# Component.displayName is used by React in its debugging messages.
spec.displayName = name
for typesProperty in ["propTypes", "childContextTypes", "contextTypes"]
if spec[typesProperty] | spec[typesProperty] = desugarPropTypes(spec[typesProperty])
component = React.createClass(spec)
R[name] = React.createFactory(component)
R.render = React.render | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | d03204982e2a6680a5ec0eed210624649f4f8db8 | 1,052 | https://github.com/cdglabs/apparatus/blob/d03204982e2a6680a5ec0eed210624649f4f8db8/src/View/R.coffee | 35 | 47 |
cdglabs/apparatus:src/View/R.coffee:5:raw_corpus | raw_corpus | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c9c228d5ec4b54323a250d71a0590223b4dba995 | 1,052 | https://github.com/cdglabs/apparatus/blob/c9c228d5ec4b54323a250d71a0590223b4dba995/src/View/R.coffee | 53 | 95 | ||
cdglabs/apparatus:src/View/R.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propT... | var desugarPropType;
desugarPropType = function(propType) {
if (propType === Number) {
return React.PropTypes.number.isRequired;
} else if (propType === String) {
return React.PropTypes.string.isRequired;
} else if (propType === Boolean) {
return React.PropTypes.bool.isRequired;
} else if (propType... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/R.coffee | MIT | c9c228d5ec4b54323a250d71a0590223b4dba995 | 1,052 | https://github.com/cdglabs/apparatus/blob/c9c228d5ec4b54323a250d71a0590223b4dba995/src/View/R.coffee | 53 | 95 |
cdglabs/apparatus:src/View/R.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var desugarPropType;
desugarPropType = function(propType) {
if (propType === Number) {
return React.PropTypes.number.isRequired;
} else if (propType === String) {
return React.PropTypes.string.isRequired;
} else if (propType === Boolean) {
return... | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c9c228d5ec4b54323a250d71a0590223b4dba995 | 1,052 | https://github.com/cdglabs/apparatus/blob/c9c228d5ec4b54323a250d71a0590223b4dba995/src/View/R.coffee | 53 | 95 |
cdglabs/apparatus:src/View/R.coffee:5:completion | completion | desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
return React.PropTypes.string.isRequired
else if propType == Boolean
return React.PropTypes.bool.isRequired
else if propType == Function
return React.PropTypes.func.isRequire... | else
return React.PropTypes.instanceOf(propType).isRequired
R.DragManager = require "./Manager/DragManager"
R.HoverManager = require "./Manager/HoverManager"
require "./Generic/EditableText"
require "./Generic/HTMLCanvas"
require "./Picture"
require "./Editor"
require "./Menubar"
require "./CreatePanel"
requi... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c9c228d5ec4b54323a250d71a0590223b4dba995 | 1,052 | https://github.com/cdglabs/apparatus/blob/c9c228d5ec4b54323a250d71a0590223b4dba995/src/View/R.coffee | 53 | 95 |
cdglabs/apparatus:src/View/R.coffee:1:raw_corpus | raw_corpus | # React = require "react"
_ = require "underscore"
Model = require "../Model/Model"
module.exports = R = {}
# Provide easy access to React.DOM
for own key, value of React.DOM
R[key] = value
# Utility (from React.addons.classSet)
R.cx = (classNames) ->
Object.keys(classNames).filter((className) -> classNames[c... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | cf852f8f3204e99b0b82086a5e12c68ca40a225e | 1,052 | https://github.com/cdglabs/apparatus/blob/cf852f8f3204e99b0b82086a5e12c68ca40a225e/src/View/R.coffee | 1 | 50 | ||
cdglabs/apparatus:src/View/R.coffee:1:completion | completion | # React = require "react"
_ = require "underscore"
Model = require "../Model/Model"
module.exports = R = {}
# Provide easy access to React.DOM
for own key, value of React.DOM
R[key] = value
# Utility (from React.addons.classSet)
R.cx = (classNames) ->
Object.keys(classNames).filter((className) -> classNames[c... | component = React.createClass(spec)
R[name] = React.createFactory(component)
R.render = React.render
desugarPropTypes = (propTypes) ->
return _.mapObject propTypes, desugarPropType
desugarPropType = (propType) ->
if propType == Number
return React.PropTypes.number.isRequired
else if propType == String
... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | cf852f8f3204e99b0b82086a5e12c68ca40a225e | 1,052 | https://github.com/cdglabs/apparatus/blob/cf852f8f3204e99b0b82086a5e12c68ca40a225e/src/View/R.coffee | 1 | 50 |
cdglabs/apparatus:src/View/R.coffee:2:raw_corpus | raw_corpus | return React.PropTypes.any
else if propType.isVariantOf?
# Custom propType for dealing with Nodes
return (props, propName, componentName) ->
prop = props[propName]
unless prop.isVariantOf(propType)
return new Error("In `#{componentName}`, property `#{propName}` is the wrong type.")
else
... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | cf852f8f3204e99b0b82086a5e12c68ca40a225e | 1,052 | https://github.com/cdglabs/apparatus/blob/cf852f8f3204e99b0b82086a5e12c68ca40a225e/src/View/R.coffee | 51 | 79 | ||
cdglabs/apparatus:src/View/R.coffee:2:completion | completion | return React.PropTypes.any
else if propType.isVariantOf?
# Custom propType for dealing with Nodes
return (props, propName, componentName) ->
prop = props[propName]
unless prop.isVariantOf(propType)
return new Error("In `#{componentName}`, property `#{propName}` is the wrong type.")
else
... | R.DragManager = require "./Manager/DragManager"
R.HoverManager = require "./Manager/HoverManager"
require "./Generic/EditableText"
require "./Generic/HTMLCanvas"
require "./Picture"
require "./Editor"
require "./Menubar"
require "./CreatePanel"
require "./Canvas"
require "./Outline"
require "./Inspector"
require "./At... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | cf852f8f3204e99b0b82086a5e12c68ca40a225e | 1,052 | https://github.com/cdglabs/apparatus/blob/cf852f8f3204e99b0b82086a5e12c68ca40a225e/src/View/R.coffee | 51 | 79 |
cdglabs/apparatus:src/View/R.coffee:2:raw_corpus | raw_corpus | return React.PropTypes.any
else if propType.isVariantOf?
# Custom propType for dealing with Nodes
return (props, propName, componentName) ->
prop = props[propName]
unless prop.isVariantOf(propType)
return new Error("In `#{componentName}`, property `#{propName}` is the wrong type.")
else
... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | 0e147747d8c6a2862ef7b8f0e22c165c796fa463 | 1,052 | https://github.com/cdglabs/apparatus/blob/0e147747d8c6a2862ef7b8f0e22c165c796fa463/src/View/R.coffee | 51 | 78 | ||
cdglabs/apparatus:src/View/R.coffee:2:completion | completion | return React.PropTypes.any
else if propType.isVariantOf?
# Custom propType for dealing with Nodes
return (props, propName, componentName) ->
prop = props[propName]
unless prop.isVariantOf(propType)
return new Error("In `#{componentName}`, property `#{propName}` is the wrong type.")
else
... | R.DragManager = require "./Manager/DragManager"
R.HoverManager = require "./Manager/HoverManager"
require "./Generic/EditableText"
require "./Generic/HTMLCanvas"
require "./Picture"
require "./Editor"
require "./CreatePanel"
require "./Canvas"
require "./Outline"
require "./Inspector"
require "./AttributeRow"
require ... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | 0e147747d8c6a2862ef7b8f0e22c165c796fa463 | 1,052 | https://github.com/cdglabs/apparatus/blob/0e147747d8c6a2862ef7b8f0e22c165c796fa463/src/View/R.coffee | 51 | 78 |
cdglabs/apparatus:src/View/R.coffee:2:raw_corpus | raw_corpus | return React.PropTypes.any
else if propType.isVariantOf?
# Custom propType for dealing with Nodes
return (props, propName, componentName) ->
prop = props[propName]
unless prop.isVariantOf(propType)
return new Error("In `#{componentName}`, property `#{propName}` is the wrong type.")
else
... | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c7b78df92ee1215a66ac90c9e56ad157a3ba9de0 | 1,052 | https://github.com/cdglabs/apparatus/blob/c7b78df92ee1215a66ac90c9e56ad157a3ba9de0/src/View/R.coffee | 51 | 77 | ||
cdglabs/apparatus:src/View/R.coffee:2:completion | completion | return React.PropTypes.any
else if propType.isVariantOf?
# Custom propType for dealing with Nodes
return (props, propName, componentName) ->
prop = props[propName]
unless prop.isVariantOf(propType)
return new Error("In `#{componentName}`, property `#{propName}` is the wrong type.")
else
... | R.DragManager = require "./Manager/DragManager"
R.HoverManager = require "./Manager/HoverManager"
require "./Generic/EditableText"
require "./Generic/HTMLCanvas"
require "./Picture"
require "./Editor"
require "./CreatePanel"
require "./Canvas"
require "./Outline"
require "./Inspector"
require "./AttributeRow"
require ... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/R.coffee | MIT | c7b78df92ee1215a66ac90c9e56ad157a3ba9de0 | 1,052 | https://github.com/cdglabs/apparatus/blob/c7b78df92ee1215a66ac90c9e56ad157a3ba9de0/src/View/R.coffee | 51 | 77 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:1:raw_corpus | raw_corpus | exports.create = (messageData) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']
_userId = store.getIn ['user', '_id']
isReading = false
if isTuned and isFocused
_teamId = messageData.get('_teamId')
_roomId = messageData.get(... | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 19 | 57 | ||
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.create = (messageData) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']
_userId = store.getIn ['user', '_id']
isReading = false
if isTuned and isFocused
_teamId = ... | exports.create = function(messageData) {
var _roomId, _storyId, _teamId, _toId, _userId, currentRoomId, currentStoryId, currentTeamId, currentToId, isFocused, isReading, isTuned, routerData, store;
store = recorder.getState();
isTuned = store.getIn(['device', 'isTuned']);
isFocused = store.getIn(['device', 'isF... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 19 | 57 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.create = function(messageData) {
var _roomId, _storyId, _teamId, _toId, _userId, currentRoomId, currentStoryId, currentTeamId, currentToId, isFocused, isReading, isTuned, routerData, store;
store = recorder.getState();
isTuned = store.getIn(['device',... | exports.create = (messageData) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']
_userId = store.getIn ['user', '_id']
isReading = false
if isTuned and isFocused
_teamId = messageData.get('_teamId')
_roomId = messageData.get(... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 19 | 57 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:1:completion | completion | exports.create = (messageData) ->
store = recorder.getState()
isTuned = store.getIn ['device', 'isTuned']
isFocused = store.getIn ['device', 'isFocused']
_userId = store.getIn ['user', '_id']
isReading = false
if isTuned and isFocused
_teamId = messageData.get('_teamId')
_roomId = messageData.get(... | currentToId = routerData.get('_toId')
currentStoryId = routerData.get('_storyId')
if currentTeamId is _teamId
if _roomId? and currentRoomId is _roomId
isReading = true
else if _toId? and currentToId is _toId
isReading = true
else if _storyId? and currentStoryId is _storyId
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 19 | 57 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:2:raw_corpus | raw_corpus | exports.remove = (actionData) ->
_toId = actionData.get '_toId'
_roomId = actionData.get '_roomId'
_teamId = actionData.get '_teamId'
_storyId = actionData.get '_storyId'
_messageId = actionData.get '_id'
_channelId = _toId or _roomId or _storyId
store = recorder.getState()
viewingAttachment = store.g... | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 58 | 80 | ||
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.remove = (actionData) ->
_toId = actionData.get '_toId'
_roomId = actionData.get '_roomId'
_teamId = actionData.get '_teamId'
_storyId = actionData.get '_storyId'
_messageId = actionData.get '_id'
_channelId = _toId or _roomId or _storyId
... | exports.remove = function(actionData) {
var _channelId, _messageId, _roomId, _storyId, _teamId, _toId, maybeMessage, maybyAttachment, ref, store, viewingAttachment;
_toId = actionData.get('_toId');
_roomId = actionData.get('_roomId');
_teamId = actionData.get('_teamId');
_storyId = actionData.get('_storyId');... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 58 | 80 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.remove = function(actionData) {
var _channelId, _messageId, _roomId, _storyId, _teamId, _toId, maybeMessage, maybyAttachment, ref, store, viewingAttachment;
_toId = actionData.get('_toId');
_roomId = actionData.get('_roomId');
_teamId = actionData.g... | exports.remove = (actionData) ->
_toId = actionData.get '_toId'
_roomId = actionData.get '_roomId'
_teamId = actionData.get '_teamId'
_storyId = actionData.get '_storyId'
_messageId = actionData.get '_id'
_channelId = _toId or _roomId or _storyId
store = recorder.getState()
viewingAttachment = store.g... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 58 | 80 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:2:completion | completion | exports.remove = (actionData) ->
_toId = actionData.get '_toId'
_roomId = actionData.get '_roomId'
_teamId = actionData.get '_teamId'
_storyId = actionData.get '_storyId'
_messageId = actionData.get '_id'
_channelId = _toId or _roomId or _storyId
store = recorder.getState()
viewingAttachment = store.g... | if viewingAttachment?
maybeMessage = store.getIn(['messages', _teamId, _channelId])?.find (message) ->
message.get('_id') is _messageId
if maybeMessage?
maybyAttachment = maybeMessage.get('attachments').find (attachment) ->
attachment.get('_id') is viewingAttachment
if maybyAttachment?... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 58 | 80 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:3:raw_corpus | raw_corpus | exports.checkUnreadMentions = ->
scrollerNode = document.querySelector('.message-area .scroller')
return if not scrollerNode
unreadsNode = document.querySelector('.message-timeline')?.querySelectorAll('.is-unread')
return if not unreadsNode
store = recorder.getState()
routerData = store.getIn ['router', '... | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 82 | 100 | ||
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.checkUnreadMentions = ->
scrollerNode = document.querySelector('.message-area .scroller')
return if not scrollerNode
unreadsNode = document.querySelector('.message-timeline')?.querySelectorAll('.is-unread')
return if not unreadsNode
store = re... | exports.checkUnreadMentions = function() {
var _channelId, _teamId, _userId, i, len, message, messageId, node, ref, results, routerData, scrollerNode, store, unreadsNode;
scrollerNode = document.querySelector('.message-area .scroller');
if (!scrollerNode) {
return;
}
unreadsNode = (ref = document.querySel... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 82 | 100 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.checkUnreadMentions = function() {
var _channelId, _teamId, _userId, i, len, message, messageId, node, ref, results, routerData, scrollerNode, store, unreadsNode;
scrollerNode = document.querySelector('.message-area .scroller');
if (!scrollerNode) {
... | exports.checkUnreadMentions = ->
scrollerNode = document.querySelector('.message-area .scroller')
return if not scrollerNode
unreadsNode = document.querySelector('.message-timeline')?.querySelectorAll('.is-unread')
return if not unreadsNode
store = recorder.getState()
routerData = store.getIn ['router', '... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 82 | 100 |
jianliaoim/talk-os:talk-web/client/handlers/message.coffee:3:completion | completion | exports.checkUnreadMentions = ->
scrollerNode = document.querySelector('.message-area .scroller')
return if not scrollerNode
unreadsNode = document.querySelector('.message-timeline')?.querySelectorAll('.is-unread')
return if not unreadsNode
store = recorder.getState()
routerData = store.getIn ['router', '... | _userId = store.getIn ['user', '_id']
_teamId = routerData.get('_teamId')
_channelId = lookup.getChannelId(routerData)
for node in unreadsNode
if dom.isElementInViewport(node, scrollerNode)
messageId = node.getAttribute('data-message-id')
message = query.messagesBy(store, _teamId, _channelId).fin... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/message.coffee | 82 | 100 |
lucasmotta/dploy:Gruntfile.coffee:1:raw_corpus | raw_corpus | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/Gruntfile.coffee | 1 | 47 | ||
lucasmotta/dploy:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
e... | module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.initConfig({
// Compile Coffee
coffee: {
sour... | CoffeeScript | JavaScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/Gruntfile.coffee | 1 | 47 |
lucasmotta/dploy:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.init... | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | JavaScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/Gruntfile.coffee | 1 | 47 |
lucasmotta/dploy:Gruntfile.coffee:1:completion | completion | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | source: ["src/**/*.coffee"]
# Bump files
bump:
options:
pushTo: "origin master"
# Publish to NPM
shell:
publish:
command: "npm publish"
# Watch for changes
watch:
coffee:
files: ["src/**/*.coffee"]
tasks: ["coffee"]
grunt.registerTask "default", ["coffeelint", "coffee"]
grunt... | CoffeeScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/Gruntfile.coffee | 1 | 47 |
lucasmotta/dploy:Gruntfile.coffee:1:raw_corpus | raw_corpus | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 75f1d774502c4db773dd6c7893ab2434fe82f76c | 973 | https://github.com/lucasmotta/dploy/blob/75f1d774502c4db773dd6c7893ab2434fe82f76c/Gruntfile.coffee | 1 | 47 | ||
lucasmotta/dploy:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
e... | module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.initConfig({
// Compile Coffee
coffee: {
sour... | CoffeeScript | JavaScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 75f1d774502c4db773dd6c7893ab2434fe82f76c | 973 | https://github.com/lucasmotta/dploy/blob/75f1d774502c4db773dd6c7893ab2434fe82f76c/Gruntfile.coffee | 1 | 47 |
lucasmotta/dploy:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.init... | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | JavaScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 75f1d774502c4db773dd6c7893ab2434fe82f76c | 973 | https://github.com/lucasmotta/dploy/blob/75f1d774502c4db773dd6c7893ab2434fe82f76c/Gruntfile.coffee | 1 | 47 |
lucasmotta/dploy:Gruntfile.coffee:1:completion | completion | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | source: ["src/**/*.coffee"]
# Bump files
bump:
options:
pushTo: "origin"
# Publish to NPM
shell:
publish:
command: "npm publish"
# Watch for changes
watch:
coffee:
files: ["src/**/*.coffee"]
tasks: ["coffee"]
grunt.registerTask "default", ["coffeelint", "coffee"]
grunt.regist... | CoffeeScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 75f1d774502c4db773dd6c7893ab2434fe82f76c | 973 | https://github.com/lucasmotta/dploy/blob/75f1d774502c4db773dd6c7893ab2434fe82f76c/Gruntfile.coffee | 1 | 47 |
lucasmotta/dploy:Gruntfile.coffee:1:raw_corpus | raw_corpus | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 2d467cc2142496b8f6a4b507d9891160d0d6b5d3 | 973 | https://github.com/lucasmotta/dploy/blob/2d467cc2142496b8f6a4b507d9891160d0d6b5d3/Gruntfile.coffee | 1 | 30 | ||
lucasmotta/dploy:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
e... | module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.initConfig({
// Compile Coffee
coffee: {
sour... | CoffeeScript | JavaScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 2d467cc2142496b8f6a4b507d9891160d0d6b5d3 | 973 | https://github.com/lucasmotta/dploy/blob/2d467cc2142496b8f6a4b507d9891160d0d6b5d3/Gruntfile.coffee | 1 | 30 |
lucasmotta/dploy:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.init... | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | JavaScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 2d467cc2142496b8f6a4b507d9891160d0d6b5d3 | 973 | https://github.com/lucasmotta/dploy/blob/2d467cc2142496b8f6a4b507d9891160d0d6b5d3/Gruntfile.coffee | 1 | 30 |
lucasmotta/dploy:Gruntfile.coffee:1:completion | completion | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | ext: ".js"
# Bump files
bump:
options:
pushTo: "origin"
# Watch for changes
watch:
coffee:
files: ["src/**/*.coffee"]
tasks: ["coffee"]
grunt.registerTask "default", ["coffee"] | CoffeeScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 2d467cc2142496b8f6a4b507d9891160d0d6b5d3 | 973 | https://github.com/lucasmotta/dploy/blob/2d467cc2142496b8f6a4b507d9891160d0d6b5d3/Gruntfile.coffee | 1 | 30 |
lucasmotta/dploy:Gruntfile.coffee:1:raw_corpus | raw_corpus | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 5e0668eed9bdc8b73099d77f21f6b219f6e159fa | 973 | https://github.com/lucasmotta/dploy/blob/5e0668eed9bdc8b73099d77f21f6b219f6e159fa/Gruntfile.coffee | 1 | 25 | ||
lucasmotta/dploy:Gruntfile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
e... | module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.initConfig({
// Compile Coffee
coffee: {
sour... | CoffeeScript | JavaScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 5e0668eed9bdc8b73099d77f21f6b219f6e159fa | 973 | https://github.com/lucasmotta/dploy/blob/5e0668eed9bdc8b73099d77f21f6b219f6e159fa/Gruntfile.coffee | 1 | 25 |
lucasmotta/dploy:Gruntfile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(grunt) {
// Load tasks
Object.keys(require("./package.json").devDependencies).forEach(function(dep) {
if (dep.substring(0, 6) === "grunt-") {
return grunt.loadNpmTasks(dep);
}
});
// Project configuration
grunt.init... | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
d... | JavaScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 5e0668eed9bdc8b73099d77f21f6b219f6e159fa | 973 | https://github.com/lucasmotta/dploy/blob/5e0668eed9bdc8b73099d77f21f6b219f6e159fa/Gruntfile.coffee | 1 | 25 |
lucasmotta/dploy:Gruntfile.coffee:1:completion | completion | module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true | cwd: "src"
src: ["**/*.coffee"]
dest: "lib"
ext: ".js"
# Watch for changes
watch:
coffee:
files: ["src/**/*.coffee"]
tasks: ["coffee"]
grunt.registerTask "default", ["coffee"] | CoffeeScript | CoffeeScript | lucasmotta/dploy | Gruntfile.coffee | MIT | 5e0668eed9bdc8b73099d77f21f6b219f6e159fa | 973 | https://github.com/lucasmotta/dploy/blob/5e0668eed9bdc8b73099d77f21f6b219f6e159fa/Gruntfile.coffee | 1 | 25 |
jianliaoim/talk-os:talk-api2x/server/observers/group.coffee:1:raw_corpus | raw_corpus | limbo = require 'limbo'
logger = require 'graceful-logger'
{socket} = require '../components'
{
GroupModel
} = limbo.use 'talk'
GroupSchema = GroupModel.schema
GroupSchema.pre 'save', (callback) ->
@_wasNew = @isNew
callback()
GroupSchema.post 'save', (group) ->
if @_wasNew
group.emit 'create', group
... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/observers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/observers/group.coffee | 1 | 28 | ||
jianliaoim/talk-os:talk-api2x/server/observers/group.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
limbo = require 'limbo'
logger = require 'graceful-logger'
{socket} = require '../components'
{
GroupModel
} = limbo.use 'talk'
GroupSchema = GroupModel.schema
GroupSchema.pre 'save', (callback) ->
@_wasNew = @isNew
callback()
GroupSchema.post 'save', (... | var GroupModel, GroupSchema, limbo, logger, socket;
limbo = require('limbo');
logger = require('graceful-logger');
({socket} = require('../components'));
({GroupModel} = limbo.use('talk'));
GroupSchema = GroupModel.schema;
GroupSchema.pre('save', function(callback) {
this._wasNew = this.isNew;
return callback... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/observers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/observers/group.coffee | 1 | 28 |
jianliaoim/talk-os:talk-api2x/server/observers/group.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var GroupModel, GroupSchema, limbo, logger, socket;
limbo = require('limbo');
logger = require('graceful-logger');
({socket} = require('../components'));
({GroupModel} = limbo.use('talk'));
GroupSchema = GroupModel.schema;
GroupSchema.pre('save', function(cal... | limbo = require 'limbo'
logger = require 'graceful-logger'
{socket} = require '../components'
{
GroupModel
} = limbo.use 'talk'
GroupSchema = GroupModel.schema
GroupSchema.pre 'save', (callback) ->
@_wasNew = @isNew
callback()
GroupSchema.post 'save', (group) ->
if @_wasNew
group.emit 'create', group
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/observers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/observers/group.coffee | 1 | 28 |
jianliaoim/talk-os:talk-api2x/server/observers/group.coffee:1:completion | completion | limbo = require 'limbo'
logger = require 'graceful-logger'
{socket} = require '../components'
{
GroupModel
} = limbo.use 'talk'
GroupSchema = GroupModel.schema
GroupSchema.pre 'save', (callback) ->
@_wasNew = @isNew
callback() | GroupSchema.post 'save', (group) ->
if @_wasNew
group.emit 'create', group
else
group.emit 'updated', group
GroupSchema.post 'create', (group) ->
socket.broadcast "team:#{group._teamId}", "group:create", group, group.socketId
GroupSchema.post 'updated', (group) ->
socket.broadcast "team:#{group._teamI... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/observers/group.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/observers/group.coffee | 1 | 28 |
Pagedraw/pagedraw:test/repo/lint-package-json.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
# Fails if any package.json deps start with an ^
# The ^ makes npm pick a version that number or higher, which
# can cause confusing bugs between team members
_l = require 'lodash'
chai = require 'chai'
assert = (condition) ->
chai.assert(condition(), condition.toString())
expect_has_no_u... | CoffeeScript | Pagedraw/pagedraw | test/repo/lint-package-json.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/repo/lint-package-json.coffee | 1 | 50 | ||
Pagedraw/pagedraw:test/repo/lint-package-json.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
# Fails if any package.json deps start with an ^
# The ^ makes npm pick a version that number or higher, which
# can cause confusing bugs between team members
_l = require 'lodash'
chai = require 'chai'
assert = (condition) ->
chai.a... | //!/usr/bin/env coffee
// Fails if any package.json deps start with an ^
// The ^ makes npm pick a version that number or higher, which
// can cause confusing bugs between team members
var _l, assert, chai, expect_has_no_unfrozen_deps;
_l = require('lodash');
chai = require('chai');
assert = function(condition) {
... | CoffeeScript | JavaScript | Pagedraw/pagedraw | test/repo/lint-package-json.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/repo/lint-package-json.coffee | 1 | 50 |
Pagedraw/pagedraw:test/repo/lint-package-json.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
// Fails if any package.json deps start with an ^
// The ^ makes npm pick a version that number or higher, which
// can cause confusing bugs between team members
var _l, assert, chai, expect_has_no_unfrozen_deps;
_l = require('lodash');
ch... | #!/usr/bin/env coffee
# Fails if any package.json deps start with an ^
# The ^ makes npm pick a version that number or higher, which
# can cause confusing bugs between team members
_l = require 'lodash'
chai = require 'chai'
assert = (condition) ->
chai.assert(condition(), condition.toString())
expect_has_no_u... | JavaScript | CoffeeScript | Pagedraw/pagedraw | test/repo/lint-package-json.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/repo/lint-package-json.coffee | 1 | 50 |
Pagedraw/pagedraw:test/repo/lint-package-json.coffee:2:raw_corpus | raw_corpus | # - Gabe, July 9 2018
assert -> depToVersion['react'] == '16.4.1'
assert -> depToVersion['react-dom'] == '16.4.1'
it 'ReactComponent.forceUpdate(callback) calls its callback as part of the same task', ->
# https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
# React... | CoffeeScript | Pagedraw/pagedraw | test/repo/lint-package-json.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/repo/lint-package-json.coffee | 51 | 78 | ||
Pagedraw/pagedraw:test/repo/lint-package-json.coffee:2:completion | completion | # - Gabe, July 9 2018
assert -> depToVersion['react'] == '16.4.1'
assert -> depToVersion['react-dom'] == '16.4.1'
it 'ReactComponent.forceUpdate(callback) calls its callback as part of the same task', ->
# https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
# React... | # Updated to React 16.4.1. I read React's code at that version and I *believe* forceUpdate is still synchronous
# but I'm not 100% positive. If it's not synchronous our cache is f*ed because we might be making mutations while in readonly mode.
# We should understand this better but I'm pushing this upgr... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | test/repo/lint-package-json.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/repo/lint-package-json.coffee | 51 | 78 |
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:1:raw_corpus | raw_corpus | React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
Space = React.createFactory require 'react-lite-space'
{div, input, form, button, span, a} = React.DOM
module.exports = React.createClass
displayName: 'reset-password'
propTypes:
onSubmi... | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
Space = React.createFactory require 'react-lite-space'
{div, input, form, button, span, a} = React.DOM
module.exports = React.createClass
... | var Immutable, React, Space, a, button, detect, div, form, input, locales, span;
React = require('react');
Immutable = require('immutable');
detect = require('../util/detect');
locales = require('../locales');
Space = React.createFactory(require('react-lite-space'));
({div, input, form, button, span, a} = React.D... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 1 | 50 |
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, React, Space, a, button, detect, div, form, input, locales, span;
React = require('react');
Immutable = require('immutable');
detect = require('../util/detect');
locales = require('../locales');
Space = React.createFactory(require('react-lite-sp... | React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
Space = React.createFactory require 'react-lite-space'
{div, input, form, button, span, a} = React.DOM
module.exports = React.createClass
displayName: 'reset-password'
propTypes:
onSubmi... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 1 | 50 |
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:1:completion | completion | React = require 'react'
Immutable = require 'immutable'
detect = require '../util/detect'
locales = require '../locales'
Space = React.createFactory require 'react-lite-space'
{div, input, form, button, span, a} = React.DOM
module.exports = React.createClass
displayName: 'reset-password'
propTypes:
onSubmi... | isConfirmOk: ->
@isPasswordOk() and (@state.password is @state.confirm)
onPasswordChange: (event) ->
@setState password: event.target.value, error: null
onConfirmChange: (event) ->
@setState confirm: event.target.value, error: null
onResetPassword: ->
if @isConfirmOk()
@props.onSubmit @st... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 1 | 50 |
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:2:raw_corpus | raw_corpus | div className: 'as-line-centered',
span className: 'hint-title', locales.get('setNewPassword', @props.language)
Space height: 35
div className: 'as-line',
input
value: @state.password, onChange: @onPasswordChange
type: 'password', placeholder: locales.get('passwordNoShort... | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 51 | 78 | ||
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
div className: 'as-line-centered',
span className: 'hint-title', locales.get('setNewPassword', @props.language)
Space height: 35
div className: 'as-line',
input
value: @state.password, onChange: @onPasswordChange
ty... | div({
className: 'as-line-centered'
}, span({
className: 'hint-title'
}, locales.get('setNewPassword', this.props.language)));
Space({
height: 35
});
div({
className: 'as-line'
}, input({
value: this.state.password,
onChange: this.onPasswordChange,
type: 'password',
placeholder: locales.get('passwordN... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 51 | 78 |
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
div({
className: 'as-line-centered'
}, span({
className: 'hint-title'
}, locales.get('setNewPassword', this.props.language)));
Space({
height: 35
});
div({
className: 'as-line'
}, input({
value: this.state.password,
onChange: this.onPasswordChange,
... | div className: 'as-line-centered',
span className: 'hint-title', locales.get('setNewPassword', @props.language)
Space height: 35
div className: 'as-line',
input
value: @state.password, onChange: @onPasswordChange
type: 'password', placeholder: locales.get('passwordNoShort... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 51 | 78 |
jianliaoim/talk-os:talk-account/client/app/reset-password.coffee:2:completion | completion | div className: 'as-line-centered',
span className: 'hint-title', locales.get('setNewPassword', @props.language)
Space height: 35
div className: 'as-line',
input
value: @state.password, onChange: @onPasswordChange
type: 'password', placeholder: locales.get('passwordNoShort... | if @isConfirmOk()
@renderOkIcon()
Space height: 35
if @state.error?
div className: 'as-line',
span className: 'hint-error', @state.error
Space height: 15
div className: 'as-line-filled',
if @props.isLoading
button className: 'button is-primary is... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/reset-password.coffee | 51 | 78 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:1:raw_corpus | raw_corpus | exports.getNewMessageInfo = ->
store = recorder.getStore()
routerData = store.getIn ['router', 'data']
user = store.get 'user'
if config.isGuest
topic = query.guestOnlyTopic store
_teamId: topic.get('_teamId')
_roomId: topic.get('_id')
_creatorId: user.get('_id')
creator: user
else
_t... | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 15 | 34 | ||
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.getNewMessageInfo = ->
store = recorder.getStore()
routerData = store.getIn ['router', 'data']
user = store.get 'user'
if config.isGuest
topic = query.guestOnlyTopic store
_teamId: topic.get('_teamId')
_roomId: topic.get('_id')
_c... | var cache;
exports.getNewMessageInfo = function() {
var routerData, store, topic, user;
store = recorder.getStore();
routerData = store.getIn(['router', 'data']);
user = store.get('user');
if (config.isGuest) {
topic = query.guestOnlyTopic(store);
return {
_teamId: topic.get('_teamId'),
_... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 15 | 34 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var cache;
exports.getNewMessageInfo = function() {
var routerData, store, topic, user;
store = recorder.getStore();
routerData = store.getIn(['router', 'data']);
user = store.get('user');
if (config.isGuest) {
topic = query.guestOnlyTopic(store);
... | exports.getNewMessageInfo = ->
store = recorder.getStore()
routerData = store.getIn ['router', 'data']
user = store.get 'user'
if config.isGuest
topic = query.guestOnlyTopic store
_teamId: topic.get('_teamId')
_roomId: topic.get('_id')
_creatorId: user.get('_id')
creator: user
else
_t... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 15 | 34 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:1:completion | completion | exports.getNewMessageInfo = ->
store = recorder.getStore()
routerData = store.getIn ['router', 'data']
user = store.get 'user'
if config.isGuest
topic = query.guestOnlyTopic store
_teamId: topic.get('_teamId')
_roomId: topic.get('_id')
_creatorId: user.get('_id') | creator: user
else
_teamId: routerData.get('_teamId')
_roomId: routerData.get('_roomId')
_toId: routerData.get('_toId')
_storyId: routerData.get('_storyId')
_creatorId: user.get('_id')
creator: user
cache = {} | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 15 | 34 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:2:raw_corpus | raw_corpus | deleteCacheKey = (fileId) ->
if cache[fileId]
cache[fileId] = undefined | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 35 | 37 | ||
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
deleteCacheKey = (fileId) ->
if cache[fileId]
cache[fileId] = undefined
``` | var deleteCacheKey;
deleteCacheKey = function(fileId) {
if (cache[fileId]) {
return cache[fileId] = void 0;
}
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 35 | 37 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var deleteCacheKey;
deleteCacheKey = function(fileId) {
if (cache[fileId]) {
return cache[fileId] = void 0;
}
};
``` | deleteCacheKey = (fileId) ->
if cache[fileId]
cache[fileId] = undefined | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 35 | 37 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:3:raw_corpus | raw_corpus | exports.create = ({fileInfo, metaData, xhr}) ->
cache[fileInfo.fileId] = xhr
fileActions.fileCreate fileInfo, metaData
window.requestAnimationFrame ->
eventBus.emit 'dirty-action/new-message' | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 39 | 44 | ||
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.create = ({fileInfo, metaData, xhr}) ->
cache[fileInfo.fileId] = xhr
fileActions.fileCreate fileInfo, metaData
window.requestAnimationFrame ->
eventBus.emit 'dirty-action/new-message'
``` | exports.create = function({fileInfo, metaData, xhr}) {
cache[fileInfo.fileId] = xhr;
fileActions.fileCreate(fileInfo, metaData);
return window.requestAnimationFrame(function() {
return eventBus.emit('dirty-action/new-message');
});
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 39 | 44 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.create = function({fileInfo, metaData, xhr}) {
cache[fileInfo.fileId] = xhr;
fileActions.fileCreate(fileInfo, metaData);
return window.requestAnimationFrame(function() {
return eventBus.emit('dirty-action/new-message');
});
};
``` | exports.create = ({fileInfo, metaData, xhr}) ->
cache[fileInfo.fileId] = xhr
fileActions.fileCreate fileInfo, metaData
window.requestAnimationFrame ->
eventBus.emit 'dirty-action/new-message' | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 39 | 44 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:3:completion | completion | exports.create = ({fileInfo, metaData, xhr}) ->
cache[fileInfo.fileId] = xhr | fileActions.fileCreate fileInfo, metaData
window.requestAnimationFrame ->
eventBus.emit 'dirty-action/new-message' | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 39 | 44 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:4:raw_corpus | raw_corpus | exports.abort = ({fileInfo}) ->
xhr = cache[fileInfo.fileId]
if xhr
xhr.abort() | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 46 | 49 | ||
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.abort = ({fileInfo}) ->
xhr = cache[fileInfo.fileId]
if xhr
xhr.abort()
``` | exports.abort = function({fileInfo}) {
var xhr;
xhr = cache[fileInfo.fileId];
if (xhr) {
return xhr.abort();
}
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 46 | 49 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.abort = function({fileInfo}) {
var xhr;
xhr = cache[fileInfo.fileId];
if (xhr) {
return xhr.abort();
}
};
``` | exports.abort = ({fileInfo}) ->
xhr = cache[fileInfo.fileId]
if xhr
xhr.abort() | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 46 | 49 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:4:completion | completion | exports.abort = ({fileInfo}) ->
xhr = cache[fileInfo.fileId] | if xhr
xhr.abort() | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 46 | 49 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:6:raw_corpus | raw_corpus | exports.success = ({fileData, fileInfo, metaData}) ->
deleteCacheKey(fileInfo.fileId)
fileActions.fileSuccess fileData, fileInfo, metaData
analytics.mixpanel 'file success',
fileSize: fileData.fileSize
fileCategory: fileData.fileCategory
imageWidth: fileData.imageWidth
imageHeight: fileData.imageH... | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 54 | 62 | ||
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.success = ({fileData, fileInfo, metaData}) ->
deleteCacheKey(fileInfo.fileId)
fileActions.fileSuccess fileData, fileInfo, metaData
analytics.mixpanel 'file success',
fileSize: fileData.fileSize
fileCategory: fileData.fileCategory
imageWi... | exports.success = function({fileData, fileInfo, metaData}) {
deleteCacheKey(fileInfo.fileId);
fileActions.fileSuccess(fileData, fileInfo, metaData);
return analytics.mixpanel('file success', {
fileSize: fileData.fileSize,
fileCategory: fileData.fileCategory,
imageWidth: fileData.imageWidth,
imageH... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 54 | 62 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.success = function({fileData, fileInfo, metaData}) {
deleteCacheKey(fileInfo.fileId);
fileActions.fileSuccess(fileData, fileInfo, metaData);
return analytics.mixpanel('file success', {
fileSize: fileData.fileSize,
fileCategory: fileData.fileCa... | exports.success = ({fileData, fileInfo, metaData}) ->
deleteCacheKey(fileInfo.fileId)
fileActions.fileSuccess fileData, fileInfo, metaData
analytics.mixpanel 'file success',
fileSize: fileData.fileSize
fileCategory: fileData.fileCategory
imageWidth: fileData.imageWidth
imageHeight: fileData.imageH... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 54 | 62 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:6:completion | completion | exports.success = ({fileData, fileInfo, metaData}) ->
deleteCacheKey(fileInfo.fileId)
fileActions.fileSuccess fileData, fileInfo, metaData
analytics.mixpanel 'file success', | fileSize: fileData.fileSize
fileCategory: fileData.fileCategory
imageWidth: fileData.imageWidth
imageHeight: fileData.imageHeight
mimeType: fileData.mimeType | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 54 | 62 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:7:raw_corpus | raw_corpus | exports.error = ({error, fileInfo, metaData}) ->
console.error arguments
localeKey = switch error
when upload.errorTypes.File_Not_Permitted
'uploader-files-not-accept'
when upload.errorTypes.File_Size_Exceeded
'uploader-files-exceed-size'
when upload.errorTypes.Type_Not_Allowed
'uploa... | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 64 | 93 | ||
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.error = ({error, fileInfo, metaData}) ->
console.error arguments
localeKey = switch error
when upload.errorTypes.File_Not_Permitted
'uploader-files-not-accept'
when upload.errorTypes.File_Size_Exceeded
'uploader-files-exceed-size'... | exports.error = function({error, fileInfo, metaData}) {
var localeKey, notifyText;
console.error(arguments);
localeKey = (function() {
switch (error) {
case upload.errorTypes.File_Not_Permitted:
return 'uploader-files-not-accept';
case upload.errorTypes.File_Size_Exceeded:
return '... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 64 | 93 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.error = function({error, fileInfo, metaData}) {
var localeKey, notifyText;
console.error(arguments);
localeKey = (function() {
switch (error) {
case upload.errorTypes.File_Not_Permitted:
return 'uploader-files-not-accept';
case... | exports.error = ({error, fileInfo, metaData}) ->
console.error arguments
localeKey = switch error
when upload.errorTypes.File_Not_Permitted
'uploader-files-not-accept'
when upload.errorTypes.File_Size_Exceeded
'uploader-files-exceed-size'
when upload.errorTypes.Type_Not_Allowed
'uploa... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 64 | 93 |
jianliaoim/talk-os:talk-web/client/handlers/file.coffee:7:completion | completion | exports.error = ({error, fileInfo, metaData}) ->
console.error arguments
localeKey = switch error
when upload.errorTypes.File_Not_Permitted
'uploader-files-not-accept'
when upload.errorTypes.File_Size_Exceeded
'uploader-files-exceed-size'
when upload.errorTypes.Type_Not_Allowed
'uploa... | null
else
'uploader-error'
if localeKey
notifyText = lang.getText(localeKey)
if fileInfo
notifyText += ": #{fileInfo.fileName}"
if notifyText
notifyActions.error notifyText
if fileInfo # 检查多文件的时候还没有fileInfo
deleteCacheKey(fileInfo.fileId)
fileActions.fileError fileInfo, meta... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/file.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/file.coffee | 64 | 93 |
jianliaoim/talk-os:talk-web/client/updater/mentioned-message.coffee:1:raw_corpus | raw_corpus | Immutable = require 'immutable'
isMap = Immutable.Map.isMap
# 根据 createdAt 排序搜索到的数据
sortByCreatedAt = (prev, next) ->
if not (isMap(prev) and isMap(next))
return 0
if not (prev.has('createdAt') and next.has('createdAt'))
return 0
prevDate = new Date(prev.get('createdAt'))
nextDate = new Date(next.ge... | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/mentioned-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/mentioned-message.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/updater/mentioned-message.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Immutable = require 'immutable'
isMap = Immutable.Map.isMap
# 根据 createdAt 排序搜索到的数据
sortByCreatedAt = (prev, next) ->
if not (isMap(prev) and isMap(next))
return 0
if not (prev.has('createdAt') and next.has('createdAt'))
return 0
prevDate = new ... | var Immutable, isMap, sortByCreatedAt;
Immutable = require('immutable');
isMap = Immutable.Map.isMap;
// 根据 createdAt 排序搜索到的数据
sortByCreatedAt = function(prev, next) {
var nextDate, prevDate;
if (!(isMap(prev) && isMap(next))) {
return 0;
}
if (!(prev.has('createdAt') && next.has('createdAt'))) {
ret... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/mentioned-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/mentioned-message.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.