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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jianliaoim/talk-os:talk-web/client/module/code-editor.coffee:2:completion | completion | 'Tab': (cm) ->
cm.replaceSelection ' ', 'end'
editor = @refs.editor
@editor = codemirror.fromTextArea editor, @option
@editor.on 'change', @onEditorChange
onEditorChange: ->
value = @editor.getValue()
@props.onChange value
renderEditor: ->
textarea | className: 'editor'
defaultValue: @props.text
readOnly: @props.readOnly
ref: 'editor'
onChange: @props.onChange
render: ->
className = cx
'lite-code-editor': true
"is-for-#{ @props.name }": @props.name?
div className: className,
@renderEditor() | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/code-editor.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/code-editor.coffee | 51 | 75 |
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:1:raw_corpus | raw_corpus | cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
settingsActions = require '../actions/settings'
dom = require '../util/dom'
DrawerStory = React.createFactory require './drawer-story'
ChannelCollection = React.createFactory r... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
settingsActions = require '../actions/settings'
dom = require '../util/dom'
DrawerStory = React.createFactory require '... | var ChannelCollection, DrawerStory, Immutable, PureRenderMixin, React, T, TeamDirectory, cx, div, dom, noscript, settingsActions;
cx = require('classnames');
React = require('react');
Immutable = require('immutable');
PureRenderMixin = require('react-addons-pure-render-mixin');
settingsActions = require('../action... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChannelCollection, DrawerStory, Immutable, PureRenderMixin, React, T, TeamDirectory, cx, div, dom, noscript, settingsActions;
cx = require('classnames');
React = require('react');
Immutable = require('immutable');
PureRenderMixin = require('react-addons-pur... | cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
settingsActions = require '../actions/settings'
dom = require '../util/dom'
DrawerStory = React.createFactory require './drawer-story'
ChannelCollection = React.createFactory r... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:1:completion | completion | cx = require 'classnames'
React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
settingsActions = require '../actions/settings'
dom = require '../util/dom'
DrawerStory = React.createFactory require './drawer-story'
ChannelCollection = React.createFactory r... | type: T.oneOfType([T.string, T.bool]).isRequired
getDefaultProps: ->
type: false
componentWillReceiveProps: (nextProps) ->
if nextProps.type
window.addEventListener 'click', @onWindowCloseDrawer
else
window.removeEventListener 'click', @onWindowCloseDrawer
componentWillUnmount: ->
w... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:2:raw_corpus | raw_corpus | if not inDrawer and inApp
settingsActions.closeDrawer()
renderTeamDirectory: ->
TeamDirectory
_teamId: @props._teamId
_userId: @props._userId
renderDrawerStory: ->
DrawerStory
_teamId: @props._teamId
_userId: @props._userId
story: @props.channel
renderCollection: ->
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 51 | 79 | ||
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if not inDrawer and inApp
settingsActions.closeDrawer()
renderTeamDirectory: ->
TeamDirectory
_teamId: @props._teamId
_userId: @props._userId
renderDrawerStory: ->
DrawerStory
_teamId: @props._teamId
_userId: @props._us... | if (!inDrawer && inApp) {
settingsActions.closeDrawer();
}
({
renderTeamDirectory: function() {
return TeamDirectory({
_teamId: this.props._teamId,
_userId: this.props._userId
});
},
renderDrawerStory: function() {
return DrawerStory({
_teamId: this.props._teamId,
_userId: t... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 51 | 79 |
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (!inDrawer && inApp) {
settingsActions.closeDrawer();
}
({
renderTeamDirectory: function() {
return TeamDirectory({
_teamId: this.props._teamId,
_userId: this.props._userId
});
},
renderDrawerStory: function() {
return DrawerStor... | if not inDrawer and inApp
settingsActions.closeDrawer()
renderTeamDirectory: ->
TeamDirectory
_teamId: @props._teamId
_userId: @props._userId
renderDrawerStory: ->
DrawerStory
_teamId: @props._teamId
_userId: @props._userId
story: @props.channel
renderCollection: ->
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 51 | 79 |
jianliaoim/talk-os:talk-web/client/app/team-drawer.coffee:2:completion | completion | if not inDrawer and inApp
settingsActions.closeDrawer()
renderTeamDirectory: ->
TeamDirectory
_teamId: @props._teamId
_userId: @props._userId
renderDrawerStory: ->
DrawerStory
_teamId: @props._teamId
_userId: @props._userId
story: @props.channel | renderCollection: ->
ChannelCollection
_teamId: @props._teamId
_channelId: @props.channel.get('_id')
_channelType: @props.channelType
render: ->
return null if @shouldDrawerClose()
div ref: 'root', className: cx('team-drawer', 'is-open': @props.type),
switch @props.type
wh... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-drawer.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-drawer.coffee | 51 | 79 |
meltingice/psd.js:lib/psd/layer_info/vector_stroke.coffee:1:raw_corpus | raw_corpus | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class VectorStroke extends LayerInfo
@shouldParse: (key) -> key is 'vstk'
parse: ->
@file.seek 4, true
@data = new Descriptor(@file).parse() | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/vector_stroke.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/vector_stroke.coffee | 1 | 9 | ||
meltingice/psd.js:lib/psd/layer_info/vector_stroke.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class VectorStroke extends LayerInfo
@shouldParse: (key) -> key is 'vstk'
parse: ->
@file.seek 4, true
@data = new Descriptor(@file).parse()
``` | var Descriptor, LayerInfo, VectorStroke;
LayerInfo = require('../layer_info.coffee');
Descriptor = require('../descriptor.coffee');
module.exports = VectorStroke = class VectorStroke extends LayerInfo {
static shouldParse(key) {
return key === 'vstk';
}
parse() {
this.file.seek(4, true);
return th... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/layer_info/vector_stroke.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/vector_stroke.coffee | 1 | 9 |
meltingice/psd.js:lib/psd/layer_info/vector_stroke.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Descriptor, LayerInfo, VectorStroke;
LayerInfo = require('../layer_info.coffee');
Descriptor = require('../descriptor.coffee');
module.exports = VectorStroke = class VectorStroke extends LayerInfo {
static shouldParse(key) {
return key === 'vstk';
}
... | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class VectorStroke extends LayerInfo
@shouldParse: (key) -> key is 'vstk'
parse: ->
@file.seek 4, true
@data = new Descriptor(@file).parse() | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/vector_stroke.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/vector_stroke.coffee | 1 | 9 |
meltingice/psd.js:lib/psd/layer_info/vector_stroke.coffee:1:completion | completion | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class VectorStroke extends LayerInfo | @shouldParse: (key) -> key is 'vstk'
parse: ->
@file.seek 4, true
@data = new Descriptor(@file).parse() | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/vector_stroke.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/vector_stroke.coffee | 1 | 9 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:raw_corpus | raw_corpus | throttle = require "lodash.throttle"
module.exports =
title: 'Play Audio'
description: 'Plays selected audio on typing.'
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/plugin/play-audio.coffee | 1 | 12 | ||
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
throttle = require "lodash.throttle"
module.exports =
title: 'Play Audio'
description: 'Plays selected audio on typing.'
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
... | var throttle;
throttle = require("lodash.throttle");
module.exports = {
title: 'Play Audio',
description: 'Plays selected audio on typing.',
enable: function(api) {
this.api = api;
return this.throttledPlayAudio = throttle(this.api.playAudio.bind(this.api), 100, {
trailing: false
});
},
on... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/plugin/play-audio.coffee | 1 | 12 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var throttle;
throttle = require("lodash.throttle");
module.exports = {
title: 'Play Audio',
description: 'Plays selected audio on typing.',
enable: function(api) {
this.api = api;
return this.throttledPlayAudio = throttle(this.api.playAudio.bind(th... | throttle = require "lodash.throttle"
module.exports =
title: 'Play Audio'
description: 'Plays selected audio on typing.'
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/plugin/play-audio.coffee | 1 | 12 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:completion | completion | throttle = require "lodash.throttle"
module.exports =
title: 'Play Audio'
description: 'Plays selected audio on typing.' | enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/plugin/play-audio.coffee | 1 | 12 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:raw_corpus | raw_corpus | throttle = require "lodash.throttle"
module.exports =
info:
title: 'Play Audio'
description: 'Plays selected audio on typing.'
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | 779de77e021589d3ab9a8e665e3210e91cdaa5f0 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/779de77e021589d3ab9a8e665e3210e91cdaa5f0/lib/plugin/play-audio.coffee | 1 | 13 | ||
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
throttle = require "lodash.throttle"
module.exports =
info:
title: 'Play Audio'
description: 'Plays selected audio on typing.'
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onIn... | var throttle;
throttle = require("lodash.throttle");
module.exports = {
info: {
title: 'Play Audio',
description: 'Plays selected audio on typing.'
},
enable: function(api) {
this.api = api;
return this.throttledPlayAudio = throttle(this.api.playAudio.bind(this.api), 100, {
trailing: false... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | 779de77e021589d3ab9a8e665e3210e91cdaa5f0 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/779de77e021589d3ab9a8e665e3210e91cdaa5f0/lib/plugin/play-audio.coffee | 1 | 13 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var throttle;
throttle = require("lodash.throttle");
module.exports = {
info: {
title: 'Play Audio',
description: 'Plays selected audio on typing.'
},
enable: function(api) {
this.api = api;
return this.throttledPlayAudio = throttle(this.api... | throttle = require "lodash.throttle"
module.exports =
info:
title: 'Play Audio'
description: 'Plays selected audio on typing.'
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | 779de77e021589d3ab9a8e665e3210e91cdaa5f0 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/779de77e021589d3ab9a8e665e3210e91cdaa5f0/lib/plugin/play-audio.coffee | 1 | 13 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:completion | completion | throttle = require "lodash.throttle"
module.exports =
info:
title: 'Play Audio'
description: 'Plays selected audio on typing.' | enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | 779de77e021589d3ab9a8e665e3210e91cdaa5f0 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/779de77e021589d3ab9a8e665e3210e91cdaa5f0/lib/plugin/play-audio.coffee | 1 | 13 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:raw_corpus | raw_corpus | throttle = require "lodash.throttle"
module.exports =
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | df2ce0d031fed4027cc3cdf72556b151155ce26c | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/df2ce0d031fed4027cc3cdf72556b151155ce26c/lib/plugin/play-audio.coffee | 1 | 9 | ||
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
throttle = require "lodash.throttle"
module.exports =
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio()
``` | var throttle;
throttle = require("lodash.throttle");
module.exports = {
enable: function(api) {
this.api = api;
return this.throttledPlayAudio = throttle(this.api.playAudio.bind(this.api), 100, {
trailing: false
});
},
onInput: function() {
return this.throttledPlayAudio();
}
}; | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | df2ce0d031fed4027cc3cdf72556b151155ce26c | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/df2ce0d031fed4027cc3cdf72556b151155ce26c/lib/plugin/play-audio.coffee | 1 | 9 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var throttle;
throttle = require("lodash.throttle");
module.exports = {
enable: function(api) {
this.api = api;
return this.throttledPlayAudio = throttle(this.api.playAudio.bind(this.api), 100, {
trailing: false
});
},
onInput: function() ... | throttle = require "lodash.throttle"
module.exports =
enable: (api) ->
@api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | df2ce0d031fed4027cc3cdf72556b151155ce26c | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/df2ce0d031fed4027cc3cdf72556b151155ce26c/lib/plugin/play-audio.coffee | 1 | 9 |
JoelBesada/activate-power-mode:lib/plugin/play-audio.coffee:1:completion | completion | throttle = require "lodash.throttle"
module.exports =
enable: (api) -> | @api = api
@throttledPlayAudio = throttle @api.playAudio.bind(@api), 100, trailing: false
onInput: ->
@throttledPlayAudio() | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/plugin/play-audio.coffee | MIT | df2ce0d031fed4027cc3cdf72556b151155ce26c | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/df2ce0d031fed4027cc3cdf72556b151155ce26c/lib/plugin/play-audio.coffee | 1 | 9 |
buttercoin/buttercoin:perf/pce_throughput.coffee:1:raw_corpus | raw_corpus | Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/trade_engine')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (->
deferred = Q.defer()
deferred.resolve(undefined)
... | CoffeeScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/pce_throughput.coffee | 1 | 44 | ||
buttercoin/buttercoin:perf/pce_throughput.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/trade_engine')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (-... | var Journal, PCE, Q, Tempfile, TradeEngine, count, journalFile, old_log, pce, replicationStub;
Tempfile = require('temporary/lib/file');
PCE = require('../lib/processingchainentrance');
Journal = require('../lib/journal');
TradeEngine = require('../lib/trade_engine');
//sinon = require('sinon')
Q = require('Q');
... | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/pce_throughput.coffee | 1 | 44 |
buttercoin/buttercoin:perf/pce_throughput.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Journal, PCE, Q, Tempfile, TradeEngine, count, journalFile, old_log, pce, replicationStub;
Tempfile = require('temporary/lib/file');
PCE = require('../lib/processingchainentrance');
Journal = require('../lib/journal');
TradeEngine = require('../lib/trade_en... | Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/trade_engine')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (->
deferred = Q.defer()
deferred.resolve(undefined)
... | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/pce_throughput.coffee | 1 | 44 |
buttercoin/buttercoin:perf/pce_throughput.coffee:1:completion | completion | Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/trade_engine')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (->
deferred = Q.defer()
deferred.resolve(undefined)
... | pce.start().then ->
startTime = process.hrtime()
qs = for n in [1..count]
pce.forward_operation({kind: 'test'})
#Q.fcall 1
submitTime = process.hrtime(startTime)
Q.all(qs).fail(->).fin(->
elapsedTime = process.hrtime(startTime)
elapsedTime = elapsedTime[0]*1000 + elapsedTime[1] / 1000000
s... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/pce_throughput.coffee | 1 | 44 |
buttercoin/buttercoin:perf/pce_throughput.coffee:1:raw_corpus | raw_corpus | Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/journal')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (->
deferred = Q.defer()
deferred.resolve(undefined)
{star... | CoffeeScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7 | 663 | https://github.com/buttercoin/buttercoin/blob/d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7/perf/pce_throughput.coffee | 1 | 44 | ||
buttercoin/buttercoin:perf/pce_throughput.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/journal')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (->
d... | var Journal, PCE, Q, Tempfile, TradeEngine, count, journalFile, old_log, pce, replicationStub;
Tempfile = require('temporary/lib/file');
PCE = require('../lib/processingchainentrance');
Journal = require('../lib/journal');
TradeEngine = require('../lib/journal');
//sinon = require('sinon')
Q = require('Q');
journ... | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7 | 663 | https://github.com/buttercoin/buttercoin/blob/d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7/perf/pce_throughput.coffee | 1 | 44 |
buttercoin/buttercoin:perf/pce_throughput.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Journal, PCE, Q, Tempfile, TradeEngine, count, journalFile, old_log, pce, replicationStub;
Tempfile = require('temporary/lib/file');
PCE = require('../lib/processingchainentrance');
Journal = require('../lib/journal');
TradeEngine = require('../lib/journal'... | Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/journal')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (->
deferred = Q.defer()
deferred.resolve(undefined)
{star... | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7 | 663 | https://github.com/buttercoin/buttercoin/blob/d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7/perf/pce_throughput.coffee | 1 | 44 |
buttercoin/buttercoin:perf/pce_throughput.coffee:1:completion | completion | Tempfile = require('temporary/lib/file')
PCE = require('../lib/processingchainentrance')
Journal = require('../lib/journal')
TradeEngine = require('../lib/journal')
#sinon = require('sinon')
Q = require('Q')
journalFile = new Tempfile
replicationStub = (->
deferred = Q.defer()
deferred.resolve(undefined)
{star... | pce.start().then ->
startTime = process.hrtime()
qs = for n in [1..count]
pce.forward_operation({kind: 'test'})
#Q.fcall 1
submitTime = process.hrtime(startTime)
Q.all(qs).fail(->).fin(->
elapsedTime = process.hrtime(startTime)
elapsedTime = elapsedTime[0]*1000 + elapsedTime[1] / 1000000
s... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/pce_throughput.coffee | MIT | d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7 | 663 | https://github.com/buttercoin/buttercoin/blob/d72d8d38a568ebf9bba42d9d3d53ea41ed71eea7/perf/pce_throughput.coffee | 1 | 44 |
Pagedraw/pagedraw:src/migrations/minor-migration.coffee:1:raw_corpus | raw_corpus | require('../../coffeescript-register-web')
require('../load_compiler')
{Doc} = require '../doc'
_l = require 'lodash'
{migration} = require './map_prod'
## DEBUG=true coffee src/migrations/minor-migration.coffee
## MIGRATION=true coffee src/migrations/minor-migration.coffee
migration 'minor-migration', (docjson) -... | CoffeeScript | Pagedraw/pagedraw | src/migrations/minor-migration.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/migrations/minor-migration.coffee | 1 | 15 | ||
Pagedraw/pagedraw:src/migrations/minor-migration.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('../../coffeescript-register-web')
require('../load_compiler')
{Doc} = require '../doc'
_l = require 'lodash'
{migration} = require './map_prod'
## DEBUG=true coffee src/migrations/minor-migration.coffee
## MIGRATION=true coffee src/migrations/minor-m... | var Doc, _l, migration;
require('../../coffeescript-register-web');
require('../load_compiler');
({Doc} = require('../doc'));
_l = require('lodash');
({migration} = require('./map_prod'));
//# DEBUG=true coffee src/migrations/minor-migration.coffee
//# MIGRATION=true coffee src/migrations/minor-migration.coffee
m... | CoffeeScript | JavaScript | Pagedraw/pagedraw | src/migrations/minor-migration.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/migrations/minor-migration.coffee | 1 | 15 |
Pagedraw/pagedraw:src/migrations/minor-migration.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Doc, _l, migration;
require('../../coffeescript-register-web');
require('../load_compiler');
({Doc} = require('../doc'));
_l = require('lodash');
({migration} = require('./map_prod'));
//# DEBUG=true coffee src/migrations/minor-migration.coffee
//# MIGRAT... | require('../../coffeescript-register-web')
require('../load_compiler')
{Doc} = require '../doc'
_l = require 'lodash'
{migration} = require './map_prod'
## DEBUG=true coffee src/migrations/minor-migration.coffee
## MIGRATION=true coffee src/migrations/minor-migration.coffee
migration 'minor-migration', (docjson) -... | JavaScript | CoffeeScript | Pagedraw/pagedraw | src/migrations/minor-migration.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/migrations/minor-migration.coffee | 1 | 15 |
Pagedraw/pagedraw:src/migrations/minor-migration.coffee:1:completion | completion | require('../../coffeescript-register-web')
require('../load_compiler')
{Doc} = require '../doc'
_l = require 'lodash' | {migration} = require './map_prod'
## DEBUG=true coffee src/migrations/minor-migration.coffee
## MIGRATION=true coffee src/migrations/minor-migration.coffee
migration 'minor-migration', (docjson) ->
return null if docjson == null
return Doc.deserialize(docjson).serialize() | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | src/migrations/minor-migration.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/migrations/minor-migration.coffee | 1 | 15 |
jashkenas/coffeescript:test/ranges.coffee:1:raw_corpus | raw_corpus | # Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [0..2]
arrayEq [0, 1] , [0..1]
arrayEq [0] , ... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 1 | 42 | ||
jashkenas/coffeescript:test/ranges.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [... | // Range Literals
// --------------
// TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
// shared array
var shared;
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
test("basic inclusive ranges", function() {
arrayEq([1, 2, 3], [1, 2, 3]);
arrayEq([0, 1, 2], [0, 1, 2]);
arrayEq([0, 1... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 1 | 42 |
jashkenas/coffeescript:test/ranges.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Range Literals
// --------------
// TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
// shared array
var shared;
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
test("basic inclusive ranges", function() {
arrayEq([1, 2, 3], [1, 2... | # Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [0..2]
arrayEq [0, 1] , [0..1]
arrayEq [0] , ... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 1 | 42 |
jashkenas/coffeescript:test/ranges.coffee:1:completion | completion | # Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [0..2]
arrayEq [0, 1] , [0..1]
arrayEq [0] , ... | arrayEq [0] , [0...1]
arrayEq [-1] , [-1...0]
arrayEq [-1, 0] , [-1...1]
arrayEq [-1, 0, 1], [-1...2]
arrayEq [], [1...1]
arrayEq [], [0...0]
arrayEq [], [-1...-1]
# Should not trigger implicit call, e.g. rest ... => rest(...)
arrayEq [1, 2, 3] , [1 ... 4]
arrayEq [0, 1, 2] , [0 ... 3]
... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 1 | 42 |
jashkenas/coffeescript:test/ranges.coffee:2:raw_corpus | raw_corpus | test "downward ranges", ->
arrayEq shared, [9..0].reverse()
arrayEq [5, 4, 3, 2] , [5..2]
arrayEq [2, 1, 0, -1], [2..-1]
arrayEq [3, 2, 1] , [3..1]
arrayEq [2, 1, 0] , [2..0]
arrayEq [1, 0] , [1..0]
arrayEq [0] , [0..0]
arrayEq [-1] , [-1..-1]
arrayEq [0, -1] , [0..-1]
arrayEq... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 44 | 83 | ||
jashkenas/coffeescript:test/ranges.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test "downward ranges", ->
arrayEq shared, [9..0].reverse()
arrayEq [5, 4, 3, 2] , [5..2]
arrayEq [2, 1, 0, -1], [2..-1]
arrayEq [3, 2, 1] , [3..1]
arrayEq [2, 1, 0] , [2..0]
arrayEq [1, 0] , [1..0]
arrayEq [0] , [0..0]
arrayEq [-1] ... | test("downward ranges", function() {
arrayEq(shared, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0].reverse());
arrayEq([5, 4, 3, 2], [5, 4, 3, 2]);
arrayEq([2, 1, 0, -1], [2, 1, 0, -1]);
arrayEq([3, 2, 1], [3, 2, 1]);
arrayEq([2, 1, 0], [2, 1, 0]);
arrayEq([1, 0], [1, 0]);
arrayEq([0], [0]);
arrayEq([-1], [-1]);
arr... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 44 | 83 |
jashkenas/coffeescript:test/ranges.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test("downward ranges", function() {
arrayEq(shared, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0].reverse());
arrayEq([5, 4, 3, 2], [5, 4, 3, 2]);
arrayEq([2, 1, 0, -1], [2, 1, 0, -1]);
arrayEq([3, 2, 1], [3, 2, 1]);
arrayEq([2, 1, 0], [2, 1, 0]);
arrayEq([1, 0], [1,... | test "downward ranges", ->
arrayEq shared, [9..0].reverse()
arrayEq [5, 4, 3, 2] , [5..2]
arrayEq [2, 1, 0, -1], [2..-1]
arrayEq [3, 2, 1] , [3..1]
arrayEq [2, 1, 0] , [2..0]
arrayEq [1, 0] , [1..0]
arrayEq [0] , [0..0]
arrayEq [-1] , [-1..-1]
arrayEq [0, -1] , [0..-1]
arrayEq... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 44 | 83 |
jashkenas/coffeescript:test/ranges.coffee:2:completion | completion | test "downward ranges", ->
arrayEq shared, [9..0].reverse()
arrayEq [5, 4, 3, 2] , [5..2]
arrayEq [2, 1, 0, -1], [2..-1]
arrayEq [3, 2, 1] , [3..1]
arrayEq [2, 1, 0] , [2..0]
arrayEq [1, 0] , [1..0]
arrayEq [0] , [0..0]
arrayEq [-1] , [-1..-1]
arrayEq [0, -1] , [0..-1]
arrayEq... | arrayEq [0] , [0...-1]
arrayEq [0, -1] , [0...-2]
arrayEq [1, 0] , [1...-1]
arrayEq [2, 1, 0], [2...-1]
test "ranges with variables as enpoints", ->
[a, b] = [1, 3]
arrayEq [1, 2, 3], [a..b]
arrayEq [1, 2] , [a...b]
b = -2
arrayEq [1, 0, -1, -2], [a..b]
arrayEq [1, 0, -1] , [a...b]
test... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 44 | 83 |
jashkenas/coffeescript:test/ranges.coffee:3:raw_corpus | raw_corpus | test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x from [20..30]
array1.push(x)
break if x is 25
ar... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 85 | 124 | ||
jashkenas/coffeescript:test/ranges.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x f... | var modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
test("large ranges are generated with looping constructs", function() {
var down, len, up;
down = (function() {
var results = [];
for (var i = 99; i >= 0; i--){ results.push(i); }
return results;
}).apply(this);
eq(100, (len = down.le... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 85 | 124 |
jashkenas/coffeescript:test/ranges.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
test("large ranges are generated with looping constructs", function() {
var down, len, up;
down = (function() {
var results = [];
for (var i = 99; i >= 0; i--){ results.push(i); }
ret... | test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x from [20..30]
array1.push(x)
break if x is 25
ar... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 85 | 124 |
jashkenas/coffeescript:test/ranges.coffee:3:completion | completion | test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x from [20..30]
array1.push(x)
break if x is 25
ar... | array2 = (x for x from [20..30] when x %% 2 == 0)
ok array2.join(' ') is '20 22 24 26 28 30'
test "#1012 slices with arguments object", ->
expected = [0..9]
argsAtStart = (-> [arguments[0]..9]) 0
arrayEq expected, argsAtStart
argsAtEnd = (-> [0..arguments[0]]) 9
arrayEq expected, argsAtEnd
argsAtBoth = (... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 85 | 124 |
jashkenas/coffeescript:test/ranges.coffee:4:raw_corpus | raw_corpus | testRange = (arg) ->
[from, to, step, expectedResult] = arg
r = (x for x in [from..to] by step)
arrayEq r, expectedResult
testData = [
[1, 5, 1, [1..5]]
[1, 5, -1, [1]]
[1, 5, up, [1..5]]
[1, 5, down, [1]]
[a, 5, 1, [1..5]]
[a, 5, -1, [1]]
[a, 5, up, [1..5]]
[a, 5, down, ... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 126 | 165 | ||
jashkenas/coffeescript:test/ranges.coffee:4:completion | completion | testRange = (arg) ->
[from, to, step, expectedResult] = arg
r = (x for x in [from..to] by step)
arrayEq r, expectedResult
testData = [
[1, 5, 1, [1..5]]
[1, 5, -1, [1]]
[1, 5, up, [1..5]]
[1, 5, down, [1]]
[a, 5, 1, [1..5]]
[a, 5, -1, [1]]
[a, 5, up, [1..5]]
[a, 5, down, ... | [a, b, 1, [1..5]]
[a, b, -1, [1]]
[a, b, up, [1..5]]
[a, b, down, [1]]
[5, 1, 1, [5]]
[5, 1, -1, [5..1]]
[5, 1, up, [5]]
[5, 1, down, [5..1]]
[5, a, 1, [5]]
[5, a, -1, [5..1]]
[5, a, up, [5]]
[5, a, down, [5..1]]
[b, 1, 1, [5]]
[b, 1, -1, [5..1]]
[b, 1, up, [5... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 126 | 165 |
jashkenas/coffeescript:test/ranges.coffee:5:raw_corpus | raw_corpus | [b, a, 1, [5]]
[b, a, -1, [5..1]]
[b, a, up, [5]]
[b, a, down, [5..1]]
]
testRange d for d in testData
test "#2047: from, to and step as variables", ->
up = 1
down = -1
a = 1
b = 5
r = (x for x in [a..b] by up)
arrayEq r, [1..5]
r = (x for x in [a..b] by down)
arrayEq r, [1]
r = (... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 167 | 197 | ||
jashkenas/coffeescript:test/ranges.coffee:5:completion | completion | [b, a, 1, [5]]
[b, a, -1, [5..1]]
[b, a, up, [5]]
[b, a, down, [5..1]]
]
testRange d for d in testData
test "#2047: from, to and step as variables", ->
up = 1
down = -1
a = 1
b = 5
r = (x for x in [a..b] by up) | arrayEq r, [1..5]
r = (x for x in [a..b] by down)
arrayEq r, [1]
r = (x for x in [b..a] by up)
arrayEq r, [5]
r = (x for x in [b..a] by down)
arrayEq r, [5..1]
a = 1
b = -1
step = 0
r = (x for x in [b..a] by step)
arrayEq r, [] | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | 9e80f6fa67828dc558b7c27f8d5b5e6835b894e7 | 16,577 | https://github.com/jashkenas/coffeescript/blob/9e80f6fa67828dc558b7c27f8d5b5e6835b894e7/test/ranges.coffee | 167 | 197 |
jashkenas/coffeescript:test/ranges.coffee:3:raw_corpus | raw_corpus | test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x from [20..30]
array1.push(x)
break if x is 25
ar... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | aef54aeaf74abf10f0faadca1ac72f955b1d8f45 | 16,577 | https://github.com/jashkenas/coffeescript/blob/aef54aeaf74abf10f0faadca1ac72f955b1d8f45/test/ranges.coffee | 85 | 118 | ||
jashkenas/coffeescript:test/ranges.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x f... | var modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
test("large ranges are generated with looping constructs", function() {
var down, len, up;
down = (function() {
var results = [];
for (var i = 99; i >= 0; i--){ results.push(i); }
return results;
}).apply(this);
eq(100, (len = down.le... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/ranges.coffee | MIT | aef54aeaf74abf10f0faadca1ac72f955b1d8f45 | 16,577 | https://github.com/jashkenas/coffeescript/blob/aef54aeaf74abf10f0faadca1ac72f955b1d8f45/test/ranges.coffee | 85 | 118 |
jashkenas/coffeescript:test/ranges.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
test("large ranges are generated with looping constructs", function() {
var down, len, up;
down = (function() {
var results = [];
for (var i = 99; i >= 0; i--){ results.push(i); }
ret... | test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x from [20..30]
array1.push(x)
break if x is 25
ar... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | aef54aeaf74abf10f0faadca1ac72f955b1d8f45 | 16,577 | https://github.com/jashkenas/coffeescript/blob/aef54aeaf74abf10f0faadca1ac72f955b1d8f45/test/ranges.coffee | 85 | 118 |
jashkenas/coffeescript:test/ranges.coffee:3:completion | completion | test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.length)
eq 99, up[len - 1]
test "for-from loops over ranges", ->
array1 = []
for x from [20..30]
array1.push(x)
break if x is 25
ar... | array1 = (x + 10 for x from [20..25])
ok array1.join(' ') is '30 31 32 33 34 35'
array2 = (x for x from [20..30] when x %% 2 == 0)
ok array2.join(' ') is '20 22 24 26 28 30'
test "#1012 slices with arguments object", ->
expected = [0..9]
argsAtStart = (-> [arguments[0]..9]) 0
arrayEq expected, argsAtStart... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | aef54aeaf74abf10f0faadca1ac72f955b1d8f45 | 16,577 | https://github.com/jashkenas/coffeescript/blob/aef54aeaf74abf10f0faadca1ac72f955b1d8f45/test/ranges.coffee | 85 | 118 |
jashkenas/coffeescript:test/ranges.coffee:1:raw_corpus | raw_corpus | # Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [0..2]
arrayEq [0, 1] , [0..1]
arrayEq [0] , ... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 1 | 43 | ||
jashkenas/coffeescript:test/ranges.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [... | // Range Literals
// --------------
// TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
// shared array
var shared;
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
test("basic inclusive ranges", function() {
arrayEq([1, 2, 3], [1, 2, 3]);
arrayEq([0, 1, 2], [0, 1, 2]);
arrayEq([0, 1... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 1 | 43 |
jashkenas/coffeescript:test/ranges.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Range Literals
// --------------
// TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
// shared array
var shared;
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
test("basic inclusive ranges", function() {
arrayEq([1, 2, 3], [1, 2... | # Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [0..2]
arrayEq [0, 1] , [0..1]
arrayEq [0] , ... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 1 | 43 |
jashkenas/coffeescript:test/ranges.coffee:1:completion | completion | # Range Literals
# --------------
# TODO: add indexing and method invocation tests: [1..4][0] is 1, [0...3].toString()
# shared array
shared = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
test "basic inclusive ranges", ->
arrayEq [1, 2, 3] , [1..3]
arrayEq [0, 1, 2] , [0..2]
arrayEq [0, 1] , [0..1]
arrayEq [0] , ... | arrayEq [0] , [0...1]
arrayEq [-1] , [-1...0]
arrayEq [-1, 0] , [-1...1]
arrayEq [-1, 0, 1], [-1...2]
arrayEq [], [1...1]
arrayEq [], [0...0]
arrayEq [], [-1...-1]
test "downward ranges", ->
arrayEq shared, [9..0].reverse()
arrayEq [5, 4, 3, 2] , [5..2]
arrayEq [2, 1, 0, -1], [2..-1]
... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 1 | 43 |
jashkenas/coffeescript:test/ranges.coffee:2:raw_corpus | raw_corpus | arrayEq [4, 3, 2], [4...1]
arrayEq [3, 2, 1], [3...0]
arrayEq [2, 1] , [2...0]
arrayEq [1] , [1...0]
arrayEq [] , [0...0]
arrayEq [] , [-1...-1]
arrayEq [0] , [0...-1]
arrayEq [0, -1] , [0...-2]
arrayEq [1, 0] , [1...-1]
arrayEq [2, 1, 0], [2...-1]
test "ranges with variabl... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 45 | 83 | ||
jashkenas/coffeescript:test/ranges.coffee:2:completion | completion | arrayEq [4, 3, 2], [4...1]
arrayEq [3, 2, 1], [3...0]
arrayEq [2, 1] , [2...0]
arrayEq [1] , [1...0]
arrayEq [] , [0...0]
arrayEq [] , [-1...-1]
arrayEq [0] , [0...-1]
arrayEq [0, -1] , [0...-2]
arrayEq [1, 0] , [1...-1]
arrayEq [2, 1, 0], [2...-1]
test "ranges with variabl... | test "ranges with expressions as endpoints", ->
[a, b] = [1, 3]
arrayEq [2, 3, 4, 5, 6], [(a+1)..2*b]
arrayEq [2, 3, 4, 5] , [(a+1)...2*b]
test "large ranges are generated with looping constructs", ->
down = [99..0]
eq 100, (len = down.length)
eq 0, down[len - 1]
up = [0...100]
eq 100, (len = up.l... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 45 | 83 |
jashkenas/coffeescript:test/ranges.coffee:3:raw_corpus | raw_corpus | test "for-from comprehensions over ranges", ->
array1 = (x + 10 for x from [20..25])
ok array1.join(' ') is '30 31 32 33 34 35'
array2 = (x for x from [20..30] when x %% 2 == 0)
ok array2.join(' ') is '20 22 24 26 28 30'
test "#1012 slices with arguments object", ->
expected = [0..9]
argsAtStart = (-> [ar... | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 85 | 102 | ||
jashkenas/coffeescript:test/ranges.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test "for-from comprehensions over ranges", ->
array1 = (x + 10 for x from [20..25])
ok array1.join(' ') is '30 31 32 33 34 35'
array2 = (x for x from [20..30] when x %% 2 == 0)
ok array2.join(' ') is '20 22 24 26 28 30'
test "#1012 slices with argument... | var modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
test("for-from comprehensions over ranges", function() {
var array1, array2, x;
array1 = (function() {
var ref, results;
ref = [20, 21, 22, 23, 24, 25];
results = [];
for (x of ref) {
results.push(x + 10);
}
return resul... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 85 | 102 |
jashkenas/coffeescript:test/ranges.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
test("for-from comprehensions over ranges", function() {
var array1, array2, x;
array1 = (function() {
var ref, results;
ref = [20, 21, 22, 23, 24, 25];
results = [];
for (x of re... | test "for-from comprehensions over ranges", ->
array1 = (x + 10 for x from [20..25])
ok array1.join(' ') is '30 31 32 33 34 35'
array2 = (x for x from [20..30] when x %% 2 == 0)
ok array2.join(' ') is '20 22 24 26 28 30'
test "#1012 slices with arguments object", ->
expected = [0..9]
argsAtStart = (-> [ar... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 85 | 102 |
jashkenas/coffeescript:test/ranges.coffee:3:completion | completion | test "for-from comprehensions over ranges", ->
array1 = (x + 10 for x from [20..25])
ok array1.join(' ') is '30 31 32 33 34 35'
array2 = (x for x from [20..30] when x %% 2 == 0)
ok array2.join(' ') is '20 22 24 26 28 30'
test "#1012 slices with arguments object", ->
expected = [0..9] | argsAtStart = (-> [arguments[0]..9]) 0
arrayEq expected, argsAtStart
argsAtEnd = (-> [0..arguments[0]]) 9
arrayEq expected, argsAtEnd
argsAtBoth = (-> [arguments[0]..arguments[1]]) 0, 9
arrayEq expected, argsAtBoth
test "#1409: creating large ranges outside of a function body", ->
CoffeeScript.eval '[0..10... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/ranges.coffee | MIT | b3896d08e8b7f457604fb210f962d5a1bd434d9c | 16,577 | https://github.com/jashkenas/coffeescript/blob/b3896d08e8b7f457604fb210f962d5a1bd434d9c/test/ranges.coffee | 85 | 102 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:1:raw_corpus | raw_corpus | exports.create = (_teamId, _targetId, type, success, fail) ->
config =
data:
_teamId: _teamId
_targetId: _targetId
type: type
api.notifications.create.post config
.then (resp) ->
dispatcher.handleViewAction
type: 'notification/create'
data: resp
success?()
.catch (erro... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 26 | 44 | ||
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.create = (_teamId, _targetId, type, success, fail) ->
config =
data:
_teamId: _teamId
_targetId: _targetId
type: type
api.notifications.create.post config
.then (resp) ->
dispatcher.handleViewAction
type: 'notificati... | exports.create = function(_teamId, _targetId, type, success, fail) {
var config;
config = {
data: {
_teamId: _teamId,
_targetId: _targetId,
type: type
}
};
api.notifications.create.post(config).then(function(resp) {
dispatcher.handleViewAction({
type: 'notification/create',
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 26 | 44 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.create = function(_teamId, _targetId, type, success, fail) {
var config;
config = {
data: {
_teamId: _teamId,
_targetId: _targetId,
type: type
}
};
api.notifications.create.post(config).then(function(resp) {
dispatcher.... | exports.create = (_teamId, _targetId, type, success, fail) ->
config =
data:
_teamId: _teamId
_targetId: _targetId
type: type
api.notifications.create.post config
.then (resp) ->
dispatcher.handleViewAction
type: 'notification/create'
data: resp
success?()
.catch (erro... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 26 | 44 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:1:completion | completion | exports.create = (_teamId, _targetId, type, success, fail) ->
config =
data:
_teamId: _teamId
_targetId: _targetId
type: type
api.notifications.create.post config
.then (resp) -> | dispatcher.handleViewAction
type: 'notification/create'
data: resp
success?()
.catch (error) ->
fail?()
return null
# http://talk.ci/doc/restful/notification.read.html | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 26 | 44 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:2:raw_corpus | raw_corpus | exports.read = (_teamId, { maxUpdatedAt, limit }, success, fail) ->
config =
queryParams: assign {},
{ _teamId }
{ maxUpdatedAt: new Date(maxUpdatedAt).valueOf() } if maxUpdatedAt?
{ limit } if limit?
api.notifications.read.get config
.then (resp) ->
dispatcher.handleViewAction
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 45 | 66 | ||
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.read = (_teamId, { maxUpdatedAt, limit }, success, fail) ->
config =
queryParams: assign {},
{ _teamId }
{ maxUpdatedAt: new Date(maxUpdatedAt).valueOf() } if maxUpdatedAt?
{ limit } if limit?
api.notifications.read.get config
... | exports.read = function(_teamId, {maxUpdatedAt, limit}, success, fail) {
var config;
config = {
queryParams: assign({}, {_teamId}, maxUpdatedAt != null ? {
maxUpdatedAt: new Date(maxUpdatedAt).valueOf()
} : void 0, limit != null ? {limit} : void 0)
};
return api.notifications.read.get(config).then... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 45 | 66 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.read = function(_teamId, {maxUpdatedAt, limit}, success, fail) {
var config;
config = {
queryParams: assign({}, {_teamId}, maxUpdatedAt != null ? {
maxUpdatedAt: new Date(maxUpdatedAt).valueOf()
} : void 0, limit != null ? {limit} : void 0... | exports.read = (_teamId, { maxUpdatedAt, limit }, success, fail) ->
config =
queryParams: assign {},
{ _teamId }
{ maxUpdatedAt: new Date(maxUpdatedAt).valueOf() } if maxUpdatedAt?
{ limit } if limit?
api.notifications.read.get config
.then (resp) ->
dispatcher.handleViewAction
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 45 | 66 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:2:completion | completion | exports.read = (_teamId, { maxUpdatedAt, limit }, success, fail) ->
config =
queryParams: assign {},
{ _teamId }
{ maxUpdatedAt: new Date(maxUpdatedAt).valueOf() } if maxUpdatedAt?
{ limit } if limit?
api.notifications.read.get config
.then (resp) ->
dispatcher.handleViewAction
... | data: { _teamId, data: resp }
success? resp
.catch ->
fail?()
# http://talk.ci/doc/restful/notification.update.html
# data:
# isPinned: Bool
# isMute: Bool
# unreadNum: Integer
# _latestReadMessageId: String | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 45 | 66 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:3:raw_corpus | raw_corpus | exports.update = (_notyId, data, success, fail) ->
config =
pathParams:
id: _notyId
data: assign {}, data
api.notifications.update.put config
.then (resp) ->
dispatcher.handleViewAction
type: 'notification/update'
data: resp
success? resp
###
* This method is built f... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 67 | 88 | ||
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.update = (_notyId, data, success, fail) ->
config =
pathParams:
id: _notyId
data: assign {}, data
api.notifications.update.put config
.then (resp) ->
dispatcher.handleViewAction
type: 'notification/update'
data... | exports.update = function(_notyId, data, success, fail) {
var config;
config = {
pathParams: {
id: _notyId
},
data: assign({}, data)
};
return api.notifications.update.put(config).then(function(resp) {
dispatcher.handleViewAction({
type: 'notification/update',
data: resp
})... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 67 | 88 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.update = function(_notyId, data, success, fail) {
var config;
config = {
pathParams: {
id: _notyId
},
data: assign({}, data)
};
return api.notifications.update.put(config).then(function(resp) {
dispatcher.handleViewAction({
... | exports.update = (_notyId, data, success, fail) ->
config =
pathParams:
id: _notyId
data: assign {}, data
api.notifications.update.put config
.then (resp) ->
dispatcher.handleViewAction
type: 'notification/update'
data: resp
success? resp
###
* This method is built f... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 67 | 88 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:3:completion | completion | exports.update = (_notyId, data, success, fail) ->
config =
pathParams:
id: _notyId
data: assign {}, data
api.notifications.update.put config
.then (resp) ->
dispatcher.handleViewAction
type: 'notification/update'
data: resp | success? resp
###
* This method is built for update some property
* of notification locally.
*
* @param {string} _notyId
* @param {object} data
*
* @return null
### | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 67 | 88 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:4:raw_corpus | raw_corpus | exports.clearUnread = (noty) ->
config =
pathParams:
id: noty.get('_id')
data:
_latestReadMessageId: noty.get '_emitterId' # _emitterId === _messageId
unreadNum: 0
_teamId = noty.get('_teamId')
_channelId = noty.get('_targetId')
deviceActions.clearingUnread(_teamId, _channelId, true)... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 90 | 117 | ||
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.clearUnread = (noty) ->
config =
pathParams:
id: noty.get('_id')
data:
_latestReadMessageId: noty.get '_emitterId' # _emitterId === _messageId
unreadNum: 0
_teamId = noty.get('_teamId')
_channelId = noty.get('_targetId')
... | exports.clearUnread = function(noty) {
var _channelId, _teamId, config;
config = {
pathParams: {
id: noty.get('_id')
},
data: {
_latestReadMessageId: noty.get('_emitterId'), // _emitterId === _messageId
unreadNum: 0
}
};
_teamId = noty.get('_teamId');
_channelId = noty.get('_... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 90 | 117 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.clearUnread = function(noty) {
var _channelId, _teamId, config;
config = {
pathParams: {
id: noty.get('_id')
},
data: {
_latestReadMessageId: noty.get('_emitterId'), // _emitterId === _messageId
unreadNum: 0
}
};
_t... | exports.clearUnread = (noty) ->
config =
pathParams:
id: noty.get('_id')
data:
_latestReadMessageId: noty.get '_emitterId' # _emitterId === _messageId
unreadNum: 0
_teamId = noty.get('_teamId')
_channelId = noty.get('_targetId')
deviceActions.clearingUnread(_teamId, _channelId, true)... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 90 | 117 |
jianliaoim/talk-os:talk-web/client/actions/notification.coffee:4:completion | completion | exports.clearUnread = (noty) ->
config =
pathParams:
id: noty.get('_id')
data:
_latestReadMessageId: noty.get '_emitterId' # _emitterId === _messageId
unreadNum: 0
_teamId = noty.get('_teamId')
_channelId = noty.get('_targetId')
deviceActions.clearingUnread(_teamId, _channelId, true)... | type: 'notification/pre-clear-team-unread'
data: noty
api.notifications.update.put(config)
.then (resp) ->
deviceActions.clearingUnread(_teamId, _channelId, false)
dispatcher.handleViewAction
type: 'notification/post-clear-team-unread'
data: resp
dispatcher.handleViewAction
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/notification.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/notification.coffee | 90 | 117 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:1:raw_corpus | raw_corpus | # Bootstrap Tags
# Max Lahey
# Monday, November 12, 2012
# todos
# 1) make suggestions list scrollable
# 2) popovers for tag data
# 3) ajax for tags, suggestions, and restrictions
# 4) restyle
# 5) backbone implementation
jQuery ->
$.tags = (element, options) ->
@suggestions = options.suggestions
@restrict... | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 1 | 39 | ||
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Bootstrap Tags
# Max Lahey
# Monday, November 12, 2012
# todos
# 1) make suggestions list scrollable
# 2) popovers for tag data
# 3) ajax for tags, suggestions, and restrictions
# 4) restyle
# 5) backbone implementation
jQuery ->
$.tags = (element, options)... | // Bootstrap Tags
// Max Lahey
// Monday, November 12, 2012
// todos
// 1) make suggestions list scrollable
// 2) popovers for tag data
// 3) ajax for tags, suggestions, and restrictions
// 4) restyle
// 5) backbone implementation
jQuery(function() {
return $.tags = function(element, options) {
this.suggestions ... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 1 | 39 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Bootstrap Tags
// Max Lahey
// Monday, November 12, 2012
// todos
// 1) make suggestions list scrollable
// 2) popovers for tag data
// 3) ajax for tags, suggestions, and restrictions
// 4) restyle
// 5) backbone implementation
jQuery(function() {
return $.ta... | # Bootstrap Tags
# Max Lahey
# Monday, November 12, 2012
# todos
# 1) make suggestions list scrollable
# 2) popovers for tag data
# 3) ajax for tags, suggestions, and restrictions
# 4) restyle
# 5) backbone implementation
jQuery ->
$.tags = (element, options) ->
@suggestions = options.suggestions
@restrict... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 1 | 39 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:1:completion | completion | # Bootstrap Tags
# Max Lahey
# Monday, November 12, 2012
# todos
# 1) make suggestions list scrollable
# 2) popovers for tag data
# 3) ajax for tags, suggestions, and restrictions
# 4) restyle
# 5) backbone implementation
jQuery ->
$.tags = (element, options) ->
@suggestions = options.suggestions
@restrict... | @tagData = ""
# hang on to so we know what we are
@$element = $ element
# add/remove methods
@removeTagClicked = (e) => # clicked remove tag anchor
if e.target.tagName == "A"
@removeTag e.target.previousSibling.textContent
$(e.target.parentNode).remove()
@removeLastTag = => ... | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 1 | 39 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:2:raw_corpus | raw_corpus | @addTag = (tag) => # adds specified tag to both structures
if (@restrictTo == false or @restrictTo.indexOf(tag) != -1) and @tagData.indexOf(tag) < 0
@tagsArray.push tag
@tagData = @tagsArray.join(',')
@renderTags @tagsArray
# toggles remove button color for a tag when moused over or o... | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 41 | 82 | ||
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@addTag = (tag) => # adds specified tag to both structures
if (@restrictTo == false or @restrictTo.indexOf(tag) != -1) and @tagData.indexOf(tag) < 0
@tagsArray.push tag
@tagData = @tagsArray.join(',')
@renderTags @tagsArray
# to... | this.addTag = (tag) => { // adds specified tag to both structures
if ((this.restrictTo === false || this.restrictTo.indexOf(tag) !== -1) && this.tagData.indexOf(tag) < 0) {
this.tagsArray.push(tag);
this.tagData = this.tagsArray.join(',');
return this.renderTags(this.tagsArray);
}
};
// toggles remove ... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 41 | 82 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.addTag = (tag) => { // adds specified tag to both structures
if ((this.restrictTo === false || this.restrictTo.indexOf(tag) !== -1) && this.tagData.indexOf(tag) < 0) {
this.tagsArray.push(tag);
this.tagData = this.tagsArray.join(',');
return this... | @addTag = (tag) => # adds specified tag to both structures
if (@restrictTo == false or @restrictTo.indexOf(tag) != -1) and @tagData.indexOf(tag) < 0
@tagsArray.push tag
@tagData = @tagsArray.join(',')
@renderTags @tagsArray
# toggles remove button color for a tag when moused over or o... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 41 | 82 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:2:completion | completion | @addTag = (tag) => # adds specified tag to both structures
if (@restrictTo == false or @restrictTo.indexOf(tag) != -1) and @tagData.indexOf(tag) < 0
@tagsArray.push tag
@tagData = @tagsArray.join(',')
@renderTags @tagsArray
# toggles remove button color for a tag when moused over or o... | e.target.value = ''
@renderTags @tagsArray
@hideSuggestions()
when 46, 8 # delete
if e.target.value == ''
@removeLastTag()
@hideSuggestions()
when 40 # down
if @input.val() == '' and (@suggestedIndex == -1 || !@suggestedIndex?)
... | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 41 | 82 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:3:raw_corpus | raw_corpus | # makeSuggestions creates auto suggestions that match the value in the input
# if overrideLengthCheck is set to true, then if the input value is empty (''), return all possible suggestions
@makeSuggestions = (e, overrideLengthCheck) =>
val = (if e.target.value? then e.target.value else e.target.textConten... | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 84 | 126 | ||
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# makeSuggestions creates auto suggestions that match the value in the input
# if overrideLengthCheck is set to true, then if the input value is empty (''), return all possible suggestions
@makeSuggestions = (e, overrideLengthCheck) =>
val = (if e.t... | // makeSuggestions creates auto suggestions that match the value in the input
// if overrideLengthCheck is set to true, then if the input value is empty (''), return all possible suggestions
this.makeSuggestions = (e, overrideLengthCheck) => {
var val;
val = (e.target.value != null ? e.target.value : e.target.textC... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 84 | 126 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// makeSuggestions creates auto suggestions that match the value in the input
// if overrideLengthCheck is set to true, then if the input value is empty (''), return all possible suggestions
this.makeSuggestions = (e, overrideLengthCheck) => {
var val;
val = (e... | # makeSuggestions creates auto suggestions that match the value in the input
# if overrideLengthCheck is set to true, then if the input value is empty (''), return all possible suggestions
@makeSuggestions = (e, overrideLengthCheck) =>
val = (if e.target.value? then e.target.value else e.target.textConten... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 84 | 126 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:3:completion | completion | # makeSuggestions creates auto suggestions that match the value in the input
# if overrideLengthCheck is set to true, then if the input value is empty (''), return all possible suggestions
@makeSuggestions = (e, overrideLengthCheck) =>
val = (if e.target.value? then e.target.value else e.target.textConten... | @input.val ''
@makeSuggestions e, false
@input.focus() # return focus to input so user can continue typing
@hideSuggestions()
@keyUpHandler = (e) =>
k = (if e.keyCode? then e.keyCode else e.which)
if (k != 40 and k != 38)
@makeSuggestions e, false
# display methods
@h... | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 84 | 126 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:4:raw_corpus | raw_corpus | @selectSuggestedMousedOut = (e) =>
$(e.target).removeClass('tags-suggestion-highlighted')
@selectSuggested = (i) => # shows the provided index of suggestion list for this element as highlighted (exclusion of others)
$('.tags-suggestion').removeClass('tags-suggestion-highlighted')
tagElement = $('... | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 128 | 171 | ||
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@selectSuggestedMousedOut = (e) =>
$(e.target).removeClass('tags-suggestion-highlighted')
@selectSuggested = (i) => # shows the provided index of suggestion list for this element as highlighted (exclusion of others)
$('.tags-suggestion').removeCl... | this.selectSuggestedMousedOut = (e) => {
return $(e.target).removeClass('tags-suggestion-highlighted');
};
this.selectSuggested = (i) => { // shows the provided index of suggestion list for this element as highlighted (exclusion of others)
var tagElement;
$('.tags-suggestion').removeClass('tags-suggestion-highli... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 128 | 171 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.selectSuggestedMousedOut = (e) => {
return $(e.target).removeClass('tags-suggestion-highlighted');
};
this.selectSuggested = (i) => { // shows the provided index of suggestion list for this element as highlighted (exclusion of others)
var tagElement;
$(... | @selectSuggestedMousedOut = (e) =>
$(e.target).removeClass('tags-suggestion-highlighted')
@selectSuggested = (i) => # shows the provided index of suggestion list for this element as highlighted (exclusion of others)
$('.tags-suggestion').removeClass('tags-suggestion-highlighted')
tagElement = $('... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 128 | 171 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:4:completion | completion | @selectSuggestedMousedOut = (e) =>
$(e.target).removeClass('tags-suggestion-highlighted')
@selectSuggested = (i) => # shows the provided index of suggestion list for this element as highlighted (exclusion of others)
$('.tags-suggestion').removeClass('tags-suggestion-highlighted')
tagElement = $('... | tagList.html('')
$.each tags, (i, tag) =>
tag = $(@formatTag i, tag)
$('a', tag).click @removeTagClicked
$('a', tag).mouseover @toggleCloseColor
$('a', tag).mouseout @toggleCloseColor
tagList.append tag
@adjustInputPosition()
@formatTag = (i, tag) ->
"<div ... | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 128 | 171 |
maxwells/bootstrap-tags:src/bootstrap-tags.coffee:5:raw_corpus | raw_corpus | @init()
@
$.fn.tags = (options) ->
return this.each ->
tags = new $.tags this, options | CoffeeScript | maxwells/bootstrap-tags | src/bootstrap-tags.coffee | MIT | cdbcbd2d390625f0fce80f884e5e034f8bff64e8 | 543 | https://github.com/maxwells/bootstrap-tags/blob/cdbcbd2d390625f0fce80f884e5e034f8bff64e8/src/bootstrap-tags.coffee | 173 | 179 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.