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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:completion | completion | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null... | @connection.once 'open', @establish_protocol
@connection.connect( @options.wsconfig )
return @deferred.promise
establish_protocol: (conn) =>
conn.on 'parsed_data', (data) =>
@info 'GOT', data
conn.send_obj( {
kind: "ADD_DEPOSIT"
account: "peter"
amount: "5"
currency: '... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | 1a064c0b2d83e4a5854f132c02066a1a436c9eea | 663 | https://github.com/buttercoin/buttercoin/blob/1a064c0b2d83e4a5854f132c02066a1a436c9eea/lib/ews/websocket_initiator.coffee | 1 | 37 |
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:raw_corpus | raw_corpus | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | faa25592dfd2039ddfff95e849d4b7312c74bee4 | 663 | https://github.com/buttercoin/buttercoin/blob/faa25592dfd2039ddfff95e849d4b7312c74bee4/lib/ews/websocket_initiator.coffee | 1 | 30 | ||
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:completion | completion | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | @connection = new Connection(@)
@connection.once 'open', @establish_protocol
@connection.connect( @options.wsconfig )
return @deferred.promise
establish_protocol: (conn) =>
conn.on 'parsed_data', (data) =>
@info 'GOT', data
conn.send_obj( {kind: "ADD_DEPOSIT", account: "peter", amount: "5"... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | faa25592dfd2039ddfff95e849d4b7312c74bee4 | 663 | https://github.com/buttercoin/buttercoin/blob/faa25592dfd2039ddfff95e849d4b7312c74bee4/lib/ews/websocket_initiator.coffee | 1 | 30 |
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:raw_corpus | raw_corpus | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | 3ece68f78e0927ac5ce7f0357a8c4fd11c88894b | 663 | https://github.com/buttercoin/buttercoin/blob/3ece68f78e0927ac5ce7f0357a8c4fd11c88894b/lib/ews/websocket_initiator.coffee | 1 | 28 | ||
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:completion | completion | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | @deferred = Q.defer()
@connection = new Connection(@)
@connection.once 'open', @establish_protocol
@connection.connect( @options.wsconfig )
return @deferred.promise
establish_protocol: (conn) =>
conn.send_obj( {a: 6} )
if !module.parent
initiator = new Initiator( {wsconfig: 'ws://localhost:6... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | 3ece68f78e0927ac5ce7f0357a8c4fd11c88894b | 663 | https://github.com/buttercoin/buttercoin/blob/3ece68f78e0927ac5ce7f0357a8c4fd11c88894b/lib/ews/websocket_initiator.coffee | 1 | 28 |
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:raw_corpus | raw_corpus | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | 149b64d6ebf8cb2c4aa1ecf63b03191fc75549e8 | 663 | https://github.com/buttercoin/buttercoin/blob/149b64d6ebf8cb2c4aa1ecf63b03191fc75549e8/lib/ews/websocket_initiator.coffee | 1 | 28 | ||
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:completion | completion | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | @deferred = Q.defer()
@connection = new Connection(@)
@connection.once 'open', @establish_protocol
@connection.connect( @options.wsconfig )
return @deferred.promise
establish_protocol: (conn) =>
@info "OPEN"
if !module.parent
initiator = new Initiator( {wsconfig: 'ws://localhost:6150/'} )
... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | 149b64d6ebf8cb2c4aa1ecf63b03191fc75549e8 | 663 | https://github.com/buttercoin/buttercoin/blob/149b64d6ebf8cb2c4aa1ecf63b03191fc75549e8/lib/ews/websocket_initiator.coffee | 1 | 28 |
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:raw_corpus | raw_corpus | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | 52bf87ca00ba3bd7f29e07abfad68be5112fae0d | 663 | https://github.com/buttercoin/buttercoin/blob/52bf87ca00ba3bd7f29e07abfad68be5112fae0d/lib/ews/websocket_initiator.coffee | 1 | 28 | ||
buttercoin/buttercoin:lib/ews/websocket_initiator.coffee:1:completion | completion | stump = require('stump')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./websocket_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@node = null
... | @deferred = Q.defer()
@connection = new Connection(@)
@connection.once 'open', @establish_protocol
@connection.connect( @options.wsconfig )
return @deferred.promise
establish_protocol: (conn) =>
@info "OPEN"
if !module.parent
initiator = new Initiator( {wsconfig: 'ws://dev.getdeck.com:6150... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/websocket_initiator.coffee | MIT | 52bf87ca00ba3bd7f29e07abfad68be5112fae0d | 663 | https://github.com/buttercoin/buttercoin/blob/52bf87ca00ba3bd7f29e07abfad68be5112fae0d/lib/ews/websocket_initiator.coffee | 1 | 28 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:raw_corpus | raw_corpus | random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: -... | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 1 | 50 | ||
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager... | var ParticlesEffect, random;
random = require("lodash.random");
module.exports = ParticlesEffect = (function() {
class ParticlesEffect {
constructor(particleManager) {
this.title = particleManager.title;
this.description = particleManager.description;
this.image = particleManager.image;
... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ParticlesEffect, random;
random = require("lodash.random");
module.exports = ParticlesEffect = (function() {
class ParticlesEffect {
constructor(particleManager) {
this.title = particleManager.title;
this.description = particleManager.descri... | random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: -... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:completion | completion | random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: -... | while numParticles--
@particles.shift() if @particles.length >= @conf['totalCount.max']
if @particleManager.create?
particle = @particleManager.create position.left, position.top, colorGenerate, randomSize
else
particle = @createParticle position.left, position.top, colorGenerate, rand... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:raw_corpus | raw_corpus | if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
animate: (context) ->
return if not @particles.length
gco = context.globalCompositeOperation
context.globalCompositeOperation = "lighter"
for i in [@particles.length - 1 ..0]
... | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 51 | 68 | ||
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
animate: (context) ->
return if not @particles.length
gco = context.globalCompositeOperation
context.globalCompositeOperati... | if (this.particleManager.isDone(particle)) {
this.particles.splice(i, 1);
continue;
}
this.particleManager.update(particle);
({
animate: function(context) {
var gco, i, j, particle, ref;
if (!this.particles.length) {
return;
}
gco = context.globalCompositeOperation;
context.globalCompo... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 51 | 68 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (this.particleManager.isDone(particle)) {
this.particles.splice(i, 1);
continue;
}
this.particleManager.update(particle);
({
animate: function(context) {
var gco, i, j, particle, ref;
if (!this.particles.length) {
return;
}
gco = co... | if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
animate: (context) ->
return if not @particles.length
gco = context.globalCompositeOperation
context.globalCompositeOperation = "lighter"
for i in [@particles.length - 1 ..0]
... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 51 | 68 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:completion | completion | if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
animate: (context) ->
return if not @particles.length | gco = context.globalCompositeOperation
context.globalCompositeOperation = "lighter"
for i in [@particles.length - 1 ..0]
particle = @particles[i]
@particleManager.draw particle, context
context.globalCompositeOperation = gco | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect/particles.coffee | 51 | 68 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:raw_corpus | raw_corpus | random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: -... | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 1 | 50 | ||
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager... | var ParticlesEffect, random;
random = require("lodash.random");
module.exports = ParticlesEffect = (function() {
class ParticlesEffect {
constructor(particleManager) {
this.title = particleManager.title;
this.description = particleManager.description;
this.image = particleManager.image;
... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ParticlesEffect, random;
random = require("lodash.random");
module.exports = ParticlesEffect = (function() {
class ParticlesEffect {
constructor(particleManager) {
this.title = particleManager.title;
this.description = particleManager.descri... | random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: -... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:completion | completion | random = require "lodash.random"
module.exports = class ParticlesEffect
particles: []
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: -... | while numParticles--
@particles.shift() if @particles.length >= @conf['totalCount.max']
if @particleManager.create?
particle = @particleManager.create position.left, position.top, colorGenerate, randomSize
else
particle = @createParticle position.left, position.top, colorGenerate, rand... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:raw_corpus | raw_corpus | for i in [@particles.length - 1 ..0]
particle = @particles[i]
if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
@particleManager.draw particle, context
context.globalCompositeOperation = gco | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 51 | 62 | ||
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
for i in [@particles.length - 1 ..0]
particle = @particles[i]
if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
@particleManager.draw particle, context
context.glob... | var i, j, particle, ref;
for (i = j = ref = this.particles.length - 1; (ref <= 0 ? j <= 0 : j >= 0); i = ref <= 0 ? ++j : --j) {
particle = this.particles[i];
if (this.particleManager.isDone(particle)) {
this.particles.splice(i, 1);
continue;
}
this.particleManager.update(particle);
this.particleMana... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 51 | 62 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var i, j, particle, ref;
for (i = j = ref = this.particles.length - 1; (ref <= 0 ? j <= 0 : j >= 0); i = ref <= 0 ? ++j : --j) {
particle = this.particles[i];
if (this.particleManager.isDone(particle)) {
this.particles.splice(i, 1);
continue;
}
thi... | for i in [@particles.length - 1 ..0]
particle = @particles[i]
if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
@particleManager.draw particle, context
context.globalCompositeOperation = gco | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 51 | 62 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:completion | completion | for i in [@particles.length - 1 ..0]
particle = @particles[i]
if @particleManager.isDone particle
@particles.splice i, 1
continue | @particleManager.update particle
@particleManager.draw particle, context
context.globalCompositeOperation = gco | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect/particles.coffee | 51 | 62 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:raw_corpus | raw_corpus | random = require "lodash.random"
module.exports = class ParticlesEffect
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: ->
@reset()
... | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 1 | 50 | ||
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
random = require "lodash.random"
module.exports = class ParticlesEffect
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManage... | var ParticlesEffect, random;
random = require("lodash.random");
module.exports = ParticlesEffect = class ParticlesEffect {
constructor(particleManager) {
this.title = particleManager.title;
this.description = particleManager.description;
this.image = particleManager.image;
this.particleManager = par... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ParticlesEffect, random;
random = require("lodash.random");
module.exports = ParticlesEffect = class ParticlesEffect {
constructor(particleManager) {
this.title = particleManager.title;
this.description = particleManager.description;
this.image ... | random = require "lodash.random"
module.exports = class ParticlesEffect
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: ->
@reset()
... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:1:completion | completion | random = require "lodash.random"
module.exports = class ParticlesEffect
constructor: (particleManager) ->
@title = particleManager.title
@description = particleManager.description
@image = particleManager.image
@particleManager = particleManager
init: ->
@reset()
disable: ->
@reset()
... | particle = @particleManager.create position.left, position.top, colorGenerate, randomSize
else
particle = @createParticle position.left, position.top, colorGenerate, randomSize
@particleManager.init?(particle)
@particles.push particle
createParticle: (x, y, colorGenerate, randomSize) ->
... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:raw_corpus | raw_corpus | if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
@particleManager.draw particle, context
context.globalCompositeOperation = gco | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 51 | 60 | ||
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
@particleManager.draw particle, context
context.globalCompositeOperation = gco
``` | if (this.particleManager.isDone(particle)) {
this.particles.splice(i, 1);
continue;
}
this.particleManager.update(particle);
this.particleManager.draw(particle, context);
context.globalCompositeOperation = gco; | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 51 | 60 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (this.particleManager.isDone(particle)) {
this.particles.splice(i, 1);
continue;
}
this.particleManager.update(particle);
this.particleManager.draw(particle, context);
context.globalCompositeOperation = gco;
``` | if @particleManager.isDone particle
@particles.splice i, 1
continue
@particleManager.update particle
@particleManager.draw particle, context
context.globalCompositeOperation = gco | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 51 | 60 |
JoelBesada/activate-power-mode:lib/effect/particles.coffee:2:completion | completion | if @particleManager.isDone particle
@particles.splice i, 1
continue | @particleManager.update particle
@particleManager.draw particle, context
context.globalCompositeOperation = gco | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect/particles.coffee | MIT | 2d33f61abbb0dfc2634596b097b302edd0f2bd4b | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/2d33f61abbb0dfc2634596b097b302edd0f2bd4b/lib/effect/particles.coffee | 51 | 60 |
oozcitak/xmlbuilder-js:test/guards/cdata.coffee:1:raw_corpus | raw_corpus | suite 'CDATA Guards:', ->
test 'constructor', ->
err(
() -> xml('test').cdata()
Error
"Missing CDATA text. parent: <test>"
) | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/cdata.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/cdata.coffee | 1 | 7 | ||
oozcitak/xmlbuilder-js:test/guards/cdata.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'CDATA Guards:', ->
test 'constructor', ->
err(
() -> xml('test').cdata()
Error
"Missing CDATA text. parent: <test>"
)
``` | suite('CDATA Guards:', function() {
return test('constructor', function() {
return err(function() {
return xml('test').cdata();
}, Error, "Missing CDATA text. parent: <test>");
});
}); | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/guards/cdata.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/cdata.coffee | 1 | 7 |
oozcitak/xmlbuilder-js:test/guards/cdata.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('CDATA Guards:', function() {
return test('constructor', function() {
return err(function() {
return xml('test').cdata();
}, Error, "Missing CDATA text. parent: <test>");
});
});
``` | suite 'CDATA Guards:', ->
test 'constructor', ->
err(
() -> xml('test').cdata()
Error
"Missing CDATA text. parent: <test>"
) | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/cdata.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/cdata.coffee | 1 | 7 |
oozcitak/xmlbuilder-js:test/guards/cdata.coffee:1:completion | completion | suite 'CDATA Guards:', ->
test 'constructor', ->
err( | () -> xml('test').cdata()
Error
"Missing CDATA text. parent: <test>"
) | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/cdata.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/cdata.coffee | 1 | 7 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:raw_corpus | raw_corpus | Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options ) ->
serverOptions = {
host: options.host ? 'localhost',
... | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | b66728589b0582cfc1cc41f594fd2dc260cc75be | 663 | https://github.com/buttercoin/buttercoin/blob/b66728589b0582cfc1cc41f594fd2dc260cc75be/lib/engine_websocket_adapter.coffee | 1 | 50 | ||
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options ) ->
se... | var EngineWebsocketAdapter, Q, WebSocketServer;
Q = require('q');
WebSocketServer = require('ws').Server;
module.exports = EngineWebsocketAdapter = class EngineWebsocketAdapter {
constructor(pce) {
if (!pce) {
throw new Error('Cannot create EngineWebsocketAdapter without PCE');
}
this.pce = pce;
... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | b66728589b0582cfc1cc41f594fd2dc260cc75be | 663 | https://github.com/buttercoin/buttercoin/blob/b66728589b0582cfc1cc41f594fd2dc260cc75be/lib/engine_websocket_adapter.coffee | 1 | 50 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var EngineWebsocketAdapter, Q, WebSocketServer;
Q = require('q');
WebSocketServer = require('ws').Server;
module.exports = EngineWebsocketAdapter = class EngineWebsocketAdapter {
constructor(pce) {
if (!pce) {
throw new Error('Cannot create EngineWeb... | Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options ) ->
serverOptions = {
host: options.host ? 'localhost',
... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | b66728589b0582cfc1cc41f594fd2dc260cc75be | 663 | https://github.com/buttercoin/buttercoin/blob/b66728589b0582cfc1cc41f594fd2dc260cc75be/lib/engine_websocket_adapter.coffee | 1 | 50 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:completion | completion | Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options ) ->
serverOptions = {
host: options.host ? 'localhost',
... | @wss.on 'connection', (conn) =>
conn.on 'error', (err) =>
# TODO: come up with error API spec
console.log 'SOCKET ERROR: ', err
conn.close()
conn.on 'message', (message) =>
adapter.process_message(conn, message)
process_message: (conn, message) ->
# TODO: come up wit... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | b66728589b0582cfc1cc41f594fd2dc260cc75be | 663 | https://github.com/buttercoin/buttercoin/blob/b66728589b0582cfc1cc41f594fd2dc260cc75be/lib/engine_websocket_adapter.coffee | 1 | 50 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:raw_corpus | raw_corpus | Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options, callback ) ->
serverOptions = {
host: options.host ? 'loc... | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | c260f76580103d19dce6742873ea5d624b7db013 | 663 | https://github.com/buttercoin/buttercoin/blob/c260f76580103d19dce6742873ea5d624b7db013/lib/engine_websocket_adapter.coffee | 1 | 50 | ||
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options, callback )... | var EngineWebsocketAdapter, Q, WebSocketServer;
Q = require('q');
WebSocketServer = require('ws').Server;
module.exports = EngineWebsocketAdapter = class EngineWebsocketAdapter {
constructor(pce) {
if (!pce) {
throw new Error('Cannot create EngineWebsocketAdapter without PCE');
}
this.pce = pce;
... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | c260f76580103d19dce6742873ea5d624b7db013 | 663 | https://github.com/buttercoin/buttercoin/blob/c260f76580103d19dce6742873ea5d624b7db013/lib/engine_websocket_adapter.coffee | 1 | 50 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var EngineWebsocketAdapter, Q, WebSocketServer;
Q = require('q');
WebSocketServer = require('ws').Server;
module.exports = EngineWebsocketAdapter = class EngineWebsocketAdapter {
constructor(pce) {
if (!pce) {
throw new Error('Cannot create EngineWeb... | Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options, callback ) ->
serverOptions = {
host: options.host ? 'loc... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | c260f76580103d19dce6742873ea5d624b7db013 | 663 | https://github.com/buttercoin/buttercoin/blob/c260f76580103d19dce6742873ea5d624b7db013/lib/engine_websocket_adapter.coffee | 1 | 50 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:completion | completion | Q = require('q')
WebSocketServer = require('ws').Server
module.exports = class EngineWebsocketAdapter
constructor: (pce) ->
if not pce
throw new Error('Cannot create EngineWebsocketAdapter without PCE')
@pce = pce
start: ( options, callback ) ->
serverOptions = {
host: options.host ? 'loc... | @wss.on 'connection', (conn) =>
conn.on 'error', (err) =>
# TODO: come up with error API spec
console.log 'SOCKET ERROR: ', err
conn.close()
conn.on 'message', (message) =>
adapter.process_message(message)
process_message: (conn, message) ->
# TODO: come up with bett... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | c260f76580103d19dce6742873ea5d624b7db013 | 663 | https://github.com/buttercoin/buttercoin/blob/c260f76580103d19dce6742873ea5d624b7db013/lib/engine_websocket_adapter.coffee | 1 | 50 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:raw_corpus | raw_corpus | module.exports = class EngineWebsocketAdapter
constructor: ->
attach_to: (engine) =>
@engine = engine | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5 | 663 | https://github.com/buttercoin/buttercoin/blob/d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5/lib/engine_websocket_adapter.coffee | 1 | 5 | ||
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class EngineWebsocketAdapter
constructor: ->
attach_to: (engine) =>
@engine = engine
``` | var EngineWebsocketAdapter;
module.exports = EngineWebsocketAdapter = class EngineWebsocketAdapter {
constructor() {
this.attach_to = this.attach_to.bind(this);
}
attach_to(engine) {
return this.engine = engine;
}
}; | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5 | 663 | https://github.com/buttercoin/buttercoin/blob/d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5/lib/engine_websocket_adapter.coffee | 1 | 5 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var EngineWebsocketAdapter;
module.exports = EngineWebsocketAdapter = class EngineWebsocketAdapter {
constructor() {
this.attach_to = this.attach_to.bind(this);
}
attach_to(engine) {
return this.engine = engine;
}
};
``` | module.exports = class EngineWebsocketAdapter
constructor: ->
attach_to: (engine) =>
@engine = engine | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5 | 663 | https://github.com/buttercoin/buttercoin/blob/d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5/lib/engine_websocket_adapter.coffee | 1 | 5 |
buttercoin/buttercoin:lib/engine_websocket_adapter.coffee:1:completion | completion | module.exports = class EngineWebsocketAdapter
constructor: -> | attach_to: (engine) =>
@engine = engine | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/engine_websocket_adapter.coffee | MIT | d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5 | 663 | https://github.com/buttercoin/buttercoin/blob/d8a1f26bf65db1d969a0e84cbf7e3793caccdeb5/lib/engine_websocket_adapter.coffee | 1 | 5 |
mojotech/pioneer:test/widgets/list.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Widgets = @Widgets || {}
@Widgets.List = @Widget.List.extend
root: "ul"
childSelector: "li"
toArray: ->
@items().then (items) ->
$.map items, (item) ->
item.find().then (elm) -> elm.getText() | CoffeeScript | mojotech/pioneer | test/widgets/list.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/widgets/list.coffee | 1 | 11 | ||
mojotech/pioneer:test/widgets/list.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Widgets = @Widgets || {}
@Widgets.List = @Widget.List.extend
root: "ul"
childSelector: "li"
toArray: ->
@items().then (items) ->
$.map items, (item) ->
item.find().then (elm) -> elm.getText()
``` | module.exports = function() {
this.Widgets = this.Widgets || {};
return this.Widgets.List = this.Widget.List.extend({
root: "ul",
childSelector: "li",
toArray: function() {
return this.items().then(function(items) {
return $.map(items, function(item) {
return item.find().then(fun... | CoffeeScript | JavaScript | mojotech/pioneer | test/widgets/list.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/widgets/list.coffee | 1 | 11 |
mojotech/pioneer:test/widgets/list.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Widgets = this.Widgets || {};
return this.Widgets.List = this.Widget.List.extend({
root: "ul",
childSelector: "li",
toArray: function() {
return this.items().then(function(items) {
return $.map(items,... | module.exports = ->
@Widgets = @Widgets || {}
@Widgets.List = @Widget.List.extend
root: "ul"
childSelector: "li"
toArray: ->
@items().then (items) ->
$.map items, (item) ->
item.find().then (elm) -> elm.getText() | JavaScript | CoffeeScript | mojotech/pioneer | test/widgets/list.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/widgets/list.coffee | 1 | 11 |
mojotech/pioneer:test/widgets/list.coffee:1:completion | completion | module.exports = ->
@Widgets = @Widgets || {}
@Widgets.List = @Widget.List.extend
root: "ul" | childSelector: "li"
toArray: ->
@items().then (items) ->
$.map items, (item) ->
item.find().then (elm) -> elm.getText() | CoffeeScript | CoffeeScript | mojotech/pioneer | test/widgets/list.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/widgets/list.coffee | 1 | 11 |
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:1:raw_corpus | raw_corpus | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
T = React.PropTypes
cx = require 'classnames'
zeroRect = top: 0, bottom: 0, left: 0, right: 0
module.exports = React.createClass
displayName: 'light-menu'
mixins: [PureRenderMixin]
propTypes:
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
T = React.PropTypes
cx = require 'classnames'
zeroRect = top: 0, bottom: 0, left: 0, right: 0
module.exports = React.createClass
displayName: '... | var PureRenderMixin, React, T, cx, div, zeroRect;
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
div = React.createFactory('div');
T = React.PropTypes;
cx = require('classnames');
zeroRect = {
top: 0,
bottom: 0,
left: 0,
right: 0
};
module.exports = React.createCla... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PureRenderMixin, React, T, cx, div, zeroRect;
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
div = React.createFactory('div');
T = React.PropTypes;
cx = require('classnames');
zeroRect = {
top: 0,
bottom: 0,
l... | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
T = React.PropTypes
cx = require 'classnames'
zeroRect = top: 0, bottom: 0, left: 0, right: 0
module.exports = React.createClass
displayName: 'light-menu'
mixins: [PureRenderMixin]
propTypes:
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:1:completion | completion | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
T = React.PropTypes
cx = require 'classnames'
zeroRect = top: 0, bottom: 0, left: 0, right: 0
module.exports = React.createClass
displayName: 'light-menu'
mixins: [PureRenderMixin]
propTypes:
... | componentWillUnmount: ->
window.removeEventListener 'click', @onWindowClick
getRootPosition: ->
if @props.open and @_rootEl?
@_rootEl.getBoundingClientRect()
else
zeroRect
onWindowClick: ->
if @props.open
@props.onMenuToggle()
onHintClick: (event) ->
event.stopPropagation(... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:2:raw_corpus | raw_corpus | className = cx
'light-menu': true
'is-open': @props.open
'is-reached-bottom': reachBottom
'is-reached-left': reachLeft
div ref: 'root', className: className,
div className: 'hint', onClick: @onHintClick, @props.hint
if @props.open
div className: 'menu', onClick: @onMenuC... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 51 | 61 | ||
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
className = cx
'light-menu': true
'is-open': @props.open
'is-reached-bottom': reachBottom
'is-reached-left': reachLeft
div ref: 'root', className: className,
div className: 'hint', onClick: @onHintClick, @props.hint
if @pr... | var className;
className = cx({
'light-menu': true,
'is-open': this.props.open,
'is-reached-bottom': reachBottom,
'is-reached-left': reachLeft
});
div({
ref: 'root',
className: className
}, div({
className: 'hint',
onClick: this.onHintClick
}, this.props.hint), this.props.open ? div({
className: 'me... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 51 | 61 |
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var className;
className = cx({
'light-menu': true,
'is-open': this.props.open,
'is-reached-bottom': reachBottom,
'is-reached-left': reachLeft
});
div({
ref: 'root',
className: className
}, div({
className: 'hint',
onClick: this.onHintClick
}, thi... | className = cx
'light-menu': true
'is-open': @props.open
'is-reached-bottom': reachBottom
'is-reached-left': reachLeft
div ref: 'root', className: className,
div className: 'hint', onClick: @onHintClick, @props.hint
if @props.open
div className: 'menu', onClick: @onMenuC... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 51 | 61 |
jianliaoim/talk-os:talk-web/client/module/light-menu.coffee:2:completion | completion | className = cx
'light-menu': true
'is-open': @props.open
'is-reached-bottom': reachBottom
'is-reached-left': reachLeft | div ref: 'root', className: className,
div className: 'hint', onClick: @onHintClick, @props.hint
if @props.open
div className: 'menu', onClick: @onMenuClick,
@props.children | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-menu.coffee | 51 | 61 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:raw_corpus | raw_corpus | $scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion = 0
$scope.widgetContex... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
... | var dsDefinition;
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);
$scope.dataSource = dataService.get(dsDefinition);
// Initialize
if ($scope.dataSource != null) {
$scope.dataVersion = 0;
... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var dsDefinition;
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);
$scope.dataSource = dataService.get(dsDefinition);
// Initialize
if (... | $scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion = 0
$scope.widgetContex... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:completion | completion | $scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion = 0
$scope.widgetContex... | data = eventData.data[dsDefinition.resultSet].data
data = $scope.filterAndSortWidgetData(data)
# Check for no data
if $scope.widgetContext.nodata == true
$scope.htmlStrings = []
else
dataCopy = _.cloneDeep data
_.each dataC... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:3:raw_corpus | raw_corpus | # Data Source error
$scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
$scope.widgetContext.dataSourceError = true
$scope.widgetContext.dataSourceErrorMessage = data.error
$scope.widgetContext.nodata = null
$scope.widgetContext.loading = fal... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/htmlWidget.coffee | 81 | 104 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:3:completion | completion | # Data Source error
$scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
$scope.widgetContext.dataSourceError = true
$scope.widgetContext.dataSourceErrorMessage = data.error
$scope.widgetContext.nodata = null
$scope.widgetContext.loading = fal... | # Initialize the Data Source
$scope.dataSource.init dsDefinition
else
# Override the widget feature of exporting data, since there is no data
$scope.widgetContext.allowExport = false
# Check for hardcoded HTML
if $scope.widget.html?
$scope.htmlStrings.push $scop... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/htmlWidget.coffee | 81 | 104 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:raw_corpus | raw_corpus | if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initi... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/html/htmlWidget.coffee | 42 | 80 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$sco... | var dsDefinition;
if ($scope.widget.postHtml != null) {
$scope.postHtml = _.jsExec($scope.widget.postHtml);
}
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);
$scope.dataSource = dataServic... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/html/htmlWidget.coffee | 42 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var dsDefinition;
if ($scope.widget.postHtml != null) {
$scope.postHtml = _.jsExec($scope.widget.postHtml);
}
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.das... | if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initi... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/html/htmlWidget.coffee | 42 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:completion | completion | if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initi... | $scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
data = eventData.data[dsDefinition.resultSet].data
# Filter the data if the widget has "filters"
if $scope.widget.filters?
data = dataService.filter(data, $scope.widget.filters)
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/html/htmlWidget.coffee | 42 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:3:raw_corpus | raw_corpus | dataCopy = _.cloneDeep data
_.each dataCopy, (row, index) -> row.__index = index
# Compile HTML template with rows
$scope.htmlStrings = _.map dataCopy, _.partial(_.compile, $scope.widget.html)
if $scope.preHtml?
$scope.htmlStrings.uns... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/html/htmlWidget.coffee | 82 | 113 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:3:completion | completion | dataCopy = _.cloneDeep data
_.each dataCopy, (row, index) -> row.__index = index
# Compile HTML template with rows
$scope.htmlStrings = _.map dataCopy, _.partial(_.compile, $scope.widget.html)
if $scope.preHtml?
$scope.htmlStrings.uns... | $scope.dataSourceErrorMessage = data.error
$scope.nodata = null
$scope.loading = false
$scope.htmlStrings = []
# Data Source loading
$scope.$on 'dataSource:' + dsDefinition.name + ':loading', ->
$scope.loading = true
# Initialize the Data Source
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/html/htmlWidget.coffee | 82 | 113 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:raw_corpus | raw_corpus | if $scope.widget.preHtml?
$scope.preHtml = _.jsExec $scope.widget.preHtml
if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.das... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 82 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if $scope.widget.preHtml?
$scope.preHtml = _.jsExec $scope.widget.preHtml
if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
... | var dsDefinition;
if ($scope.widget.preHtml != null) {
$scope.preHtml = _.jsExec($scope.widget.preHtml);
}
if ($scope.widget.postHtml != null) {
$scope.postHtml = _.jsExec($scope.widget.postHtml);
}
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Load Data Source
dsDefinition = dash... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 82 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var dsDefinition;
if ($scope.widget.preHtml != null) {
$scope.preHtml = _.jsExec($scope.widget.preHtml);
}
if ($scope.widget.postHtml != null) {
$scope.postHtml = _.jsExec($scope.widget.postHtml);
}
$scope.reload = function() {
return $scope.dataSource.exe... | if $scope.widget.preHtml?
$scope.preHtml = _.jsExec $scope.widget.preHtml
if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.das... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 82 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:completion | completion | if $scope.widget.preHtml?
$scope.preHtml = _.jsExec $scope.widget.preHtml
if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.das... | $scope.dataVersion = eventData.version
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
data = eventData.data[dsDefinition.resultSet].data
# Filter the data if the widget has "filters"
if $scope.widget.filters?
data = data... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 82 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:raw_corpus | raw_corpus | if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.loadData = ->
$scope.loading = true
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
# Load data source
dsDefinition = dashboardService.getDataSource($scope.dashbo... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.loadData = ->
$scope.loading = true
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
# Load data source
ds... | if ($scope.widget.postHtml != null) {
$scope.postHtml = _.jsExec($scope.widget.postHtml);
}
$scope.loadData = function() {
var dsDefinition;
$scope.loading = true;
$scope.dataSourceError = false;
$scope.dataSourceErrorMessage = null;
// Load data source
dsDefinition = dashboardService.getDataSource($scop... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if ($scope.widget.postHtml != null) {
$scope.postHtml = _.jsExec($scope.widget.postHtml);
}
$scope.loadData = function() {
var dsDefinition;
$scope.loading = true;
$scope.dataSourceError = false;
$scope.dataSourceErrorMessage = null;
// Load data sourc... | if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.loadData = ->
$scope.loading = true
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
# Load data source
dsDefinition = dashboardService.getDataSource($scope.dashbo... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:2:completion | completion | if $scope.widget.postHtml?
$scope.postHtml = _.jsExec $scope.widget.postHtml
$scope.loadData = ->
$scope.loading = true
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
# Load data source
dsDefinition = dashboardService.getDataSource($scope.dashbo... | # Filter the data if the widget has filters
if $scope.widget.filters?
data = dataService.filter(data, $scope.widget.filters)
# Sort the data if the widget has sortBy
if $scope.widget.sortBy?
data = dataService.sort(data, $scope.widget.sortBy)
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/htmlWidget.coffee | 41 | 79 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:3:raw_corpus | raw_corpus | if $scope.preHtml?
$scope.htmlStrings.unshift $scope.preHtml
if $scope.postHtml?
$scope.htmlStrings.push $scope.postHtml
$scope.loading = false
, (errorMessage, status) ->
# Error callback
$scope.loading = false
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/htmlWidget.coffee | 81 | 111 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/htmlWidget.coffee:3:completion | completion | if $scope.preHtml?
$scope.htmlStrings.unshift $scope.preHtml
if $scope.postHtml?
$scope.htmlStrings.push $scope.postHtml
$scope.loading = false
, (errorMessage, status) ->
# Error callback
$scope.loading = false
... | , ->
# Loading callback
$scope.loading = true
$scope.reload = ->
$scope.dataSource.execute(true)
# Data Source - Repeater mode
if $scope.widget.dataSource?
$scope.loadData()
# No Data Source
else if $scope.widget.html?
$scope.htmlStrings.push $scope... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/htmlWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/htmlWidget.coffee | 81 | 111 |
jianliaoim/talk-os:talk-web/client/app/team-batch-invite.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'team-batch-invite'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf Immutable.List
team: T.object.isRequired
onClose: T.func.isRequired
getInitialState: ->
invitees: ''
makeInvitees: (data) ->
arr = []
data = data.split /\s|,|;... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-batch-invite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-batch-invite.coffee | 18 | 67 | ||
jianliaoim/talk-os:talk-web/client/app/team-batch-invite.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'team-batch-invite'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf Immutable.List
team: T.object.isRequired
onClose: T.func.isRequired
getInitialState: ->
invitees: ''
makeInvit... | module.exports = React.createClass({
displayName: 'team-batch-invite',
mixins: [PureRenderMixin],
propTypes: {
data: T.instanceOf(Immutable.List),
team: T.object.isRequired,
onClose: T.func.isRequired
},
getInitialState: function() {
return {
invitees: ''
};
},
makeInvitees: func... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-batch-invite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-batch-invite.coffee | 18 | 67 |
jianliaoim/talk-os:talk-web/client/app/team-batch-invite.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'team-batch-invite',
mixins: [PureRenderMixin],
propTypes: {
data: T.instanceOf(Immutable.List),
team: T.object.isRequired,
onClose: T.func.isRequired
},
getInitialState: function() {
retur... | module.exports = React.createClass
displayName: 'team-batch-invite'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf Immutable.List
team: T.object.isRequired
onClose: T.func.isRequired
getInitialState: ->
invitees: ''
makeInvitees: (data) ->
arr = []
data = data.split /\s|,|;... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-batch-invite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-batch-invite.coffee | 18 | 67 |
jianliaoim/talk-os:talk-web/client/app/team-batch-invite.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'team-batch-invite'
mixins: [PureRenderMixin]
propTypes:
data: T.instanceOf Immutable.List
team: T.object.isRequired
onClose: T.func.isRequired
getInitialState: ->
invitees: ''
makeInvitees: (data) ->
arr = []
data = data.split /\s|,|;... | 'emails'
else if util.isMobile el
'mobiles'
.toJS()
validInvitees: (data) ->
data.every (el) ->
util.isMobile(el) or util.isEmail(el)
onSubmit: ->
if @state.invitees.trim().length isnt 0
invitees = @makeInvitees @state.invitees
inviteesNew = []
max = 100
i... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-batch-invite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-batch-invite.coffee | 18 | 67 |
jianliaoim/talk-os:talk-web/client/app/team-batch-invite.coffee:2:raw_corpus | raw_corpus | teamActions.batchInvite @props.team.get('_id'), inviteesNew,
=>
@setState invitees: ''
@props.onClose()
notifyActions.success lang.getText('room-members-success')
->
notifyActions.error lang.getText('room-members-error')
else if inv... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-batch-invite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-batch-invite.coffee | 68 | 97 | ||
jianliaoim/talk-os:talk-web/client/app/team-batch-invite.coffee:2:completion | completion | teamActions.batchInvite @props.team.get('_id'), inviteesNew,
=>
@setState invitees: ''
@props.onClose()
notifyActions.success lang.getText('room-members-success')
->
notifyActions.error lang.getText('room-members-error')
else if inv... | render: ->
classNameButton = classnames
'button': true
'invite-submit': true
'is-disabled': @state.invitees.length is 0
div className: 'team-batch-invite',
textarea
className: 'email-textarea form-control'
placeholder: lang.getText 'batch-invite-textarea'
onChang... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-batch-invite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-batch-invite.coffee | 68 | 97 |
jianliaoim/talk-os:talk-web/client/util/loading-sentences.coffee:1:raw_corpus | raw_corpus | exports.list = list = [
'简聊正在努力加载中'
'简聊正在疯狂的敲着键盘把数据加载出来'
'简聊泡咖啡去了, 马上就来给你加载完'
'简聊正在思考一条有意思的加载消息'
'简聊正在下载内存中'
'感谢您使用简聊 :-)'
'简聊正在穿越中'
'简聊正在鱼塘捕鱼'
'简聊正在草丛里找bug'
'怎么还没加载完'
]
exports.get = (date) ->
list[date.getMinutes() % list.length] | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/loading-sentences.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/loading-sentences.coffee | 1 | 15 | ||
jianliaoim/talk-os:talk-web/client/util/loading-sentences.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.list = list = [
'简聊正在努力加载中'
'简聊正在疯狂的敲着键盘把数据加载出来'
'简聊泡咖啡去了, 马上就来给你加载完'
'简聊正在思考一条有意思的加载消息'
'简聊正在下载内存中'
'感谢您使用简聊 :-)'
'简聊正在穿越中'
'简聊正在鱼塘捕鱼'
'简聊正在草丛里找bug'
'怎么还没加载完'
]
exports.get = (date) ->
list[date.getMinutes() % list.length]
``` | var list;
exports.list = list = ['简聊正在努力加载中', '简聊正在疯狂的敲着键盘把数据加载出来', '简聊泡咖啡去了, 马上就来给你加载完', '简聊正在思考一条有意思的加载消息', '简聊正在下载内存中', '感谢您使用简聊 :-)', '简聊正在穿越中', '简聊正在鱼塘捕鱼', '简聊正在草丛里找bug', '怎么还没加载完'];
exports.get = function(date) {
return list[date.getMinutes() % list.length];
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/loading-sentences.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/loading-sentences.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/util/loading-sentences.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var list;
exports.list = list = ['简聊正在努力加载中', '简聊正在疯狂的敲着键盘把数据加载出来', '简聊泡咖啡去了, 马上就来给你加载完', '简聊正在思考一条有意思的加载消息', '简聊正在下载内存中', '感谢您使用简聊 :-)', '简聊正在穿越中', '简聊正在鱼塘捕鱼', '简聊正在草丛里找bug', '怎么还没加载完'];
exports.get = function(date) {
return list[date.getMinutes() % list.lengt... | exports.list = list = [
'简聊正在努力加载中'
'简聊正在疯狂的敲着键盘把数据加载出来'
'简聊泡咖啡去了, 马上就来给你加载完'
'简聊正在思考一条有意思的加载消息'
'简聊正在下载内存中'
'感谢您使用简聊 :-)'
'简聊正在穿越中'
'简聊正在鱼塘捕鱼'
'简聊正在草丛里找bug'
'怎么还没加载完'
]
exports.get = (date) ->
list[date.getMinutes() % list.length] | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/loading-sentences.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/loading-sentences.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/util/loading-sentences.coffee:1:completion | completion | exports.list = list = [
'简聊正在努力加载中'
'简聊正在疯狂的敲着键盘把数据加载出来'
'简聊泡咖啡去了, 马上就来给你加载完'
'简聊正在思考一条有意思的加载消息'
'简聊正在下载内存中'
'感谢您使用简聊 :-)' | '简聊正在穿越中'
'简聊正在鱼塘捕鱼'
'简聊正在草丛里找bug'
'怎么还没加载完'
]
exports.get = (date) ->
list[date.getMinutes() % list.length] | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/loading-sentences.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/loading-sentences.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/app/contact-name.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'contact-name'
mixins: [PureRenderMixin]
propTypes:
active: T.bool
hover: T.bool
isMe: T.bool
isQuit: T.bool
showAvatar: T.bool
showEmail: T.bool
showUnread: T.bool
onClick: T.func
onMouseEnter: T.func
_teamId: T.string.isReq... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/contact-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/contact-name.coffee | 20 | 69 | ||
jianliaoim/talk-os:talk-web/client/app/contact-name.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'contact-name'
mixins: [PureRenderMixin]
propTypes:
active: T.bool
hover: T.bool
isMe: T.bool
isQuit: T.bool
showAvatar: T.bool
showEmail: T.bool
showUnread: T.bool
onClick: T.... | module.exports = React.createClass({
displayName: 'contact-name',
mixins: [PureRenderMixin],
propTypes: {
active: T.bool,
hover: T.bool,
isMe: T.bool,
isQuit: T.bool,
showAvatar: T.bool,
showEmail: T.bool,
showUnread: T.bool,
onClick: T.func,
onMouseEnter: T.func,
_teamId: ... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/contact-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/contact-name.coffee | 20 | 69 |
jianliaoim/talk-os:talk-web/client/app/contact-name.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'contact-name',
mixins: [PureRenderMixin],
propTypes: {
active: T.bool,
hover: T.bool,
isMe: T.bool,
isQuit: T.bool,
showAvatar: T.bool,
showEmail: T.bool,
showUnread: T.bool,
o... | module.exports = React.createClass
displayName: 'contact-name'
mixins: [PureRenderMixin]
propTypes:
active: T.bool
hover: T.bool
isMe: T.bool
isQuit: T.bool
showAvatar: T.bool
showEmail: T.bool
showUnread: T.bool
onClick: T.func
onMouseEnter: T.func
_teamId: T.string.isReq... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/contact-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/contact-name.coffee | 20 | 69 |
jianliaoim/talk-os:talk-web/client/app/contact-name.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'contact-name'
mixins: [PureRenderMixin]
propTypes:
active: T.bool
hover: T.bool
isMe: T.bool
isQuit: T.bool
showAvatar: T.bool
showEmail: T.bool
showUnread: T.bool
onClick: T.func
onMouseEnter: T.func
_teamId: T.string.isReq... | onClick: (event) ->
# event.stopPropagation()
@props.onClick? @props.contact.get('_id'), event
onMouseEnter: ->
@props.onMouseEnter?()
renderName: ->
if @props.contact.get('_id') is 'all'
span className: 'name', lang.getText 'all-members'
else
UserAlias _userId: @props.contact.get(... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/contact-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/contact-name.coffee | 20 | 69 |
jianliaoim/talk-os:talk-web/client/app/contact-name.coffee:2:raw_corpus | raw_corpus | if @props.showAvatar
avatarStyle = if @props.contact.get('avatarUrl').length then { backgroundImage: "url(#{ @props.contact.get('avatarUrl') })" } else {}
span className: 'is-leading avatar img-circle img-24', style: avatarStyle
renderStates: ->
isGuest = @props.contact.get('isGuest')
isMe = @pro... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/contact-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/contact-name.coffee | 70 | 116 | ||
jianliaoim/talk-os:talk-web/client/app/contact-name.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @props.showAvatar
avatarStyle = if @props.contact.get('avatarUrl').length then { backgroundImage: "url(#{ @props.contact.get('avatarUrl') })" } else {}
span className: 'is-leading avatar img-circle img-24', style: avatarStyle
renderStates: ->
... | var avatarStyle;
if (this.props.showAvatar) {
avatarStyle = this.props.contact.get('avatarUrl').length ? {
backgroundImage: `url(${this.props.contact.get('avatarUrl')})`
} : {};
span({
className: 'is-leading avatar img-circle img-24',
style: avatarStyle
});
}
({
renderStates: function() {
va... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/contact-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/contact-name.coffee | 70 | 116 |
jianliaoim/talk-os:talk-web/client/app/contact-name.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var avatarStyle;
if (this.props.showAvatar) {
avatarStyle = this.props.contact.get('avatarUrl').length ? {
backgroundImage: `url(${this.props.contact.get('avatarUrl')})`
} : {};
span({
className: 'is-leading avatar img-circle img-24',
style: avat... | if @props.showAvatar
avatarStyle = if @props.contact.get('avatarUrl').length then { backgroundImage: "url(#{ @props.contact.get('avatarUrl') })" } else {}
span className: 'is-leading avatar img-circle img-24', style: avatarStyle
renderStates: ->
isGuest = @props.contact.get('isGuest')
isMe = @pro... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/contact-name.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/contact-name.coffee | 70 | 116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.