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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Leonidas-from-XIV/node-xml2js:src/builder.coffee:5:raw_corpus | raw_corpus | # Case #3 Array data
else if Array.isArray child
for own index, entry of child
if typeof entry is 'string'
if @options.cdata && requiresCDATA entry
element = element.ele(key).raw(wrapCDATA entry).up()
else
element = ... | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 7173c245aab4c2b417cd4c24f0b54e697a369864 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/7173c245aab4c2b417cd4c24f0b54e697a369864/src/builder.coffee | 72 | 102 | ||
Leonidas-from-XIV/node-xml2js:src/builder.coffee:5:completion | completion | # Case #3 Array data
else if Array.isArray child
for own index, entry of child
if typeof entry is 'string'
if @options.cdata && requiresCDATA entry
element = element.ele(key).raw(wrapCDATA entry).up()
else
element = ... | # Case #5 String and remaining types
else
if typeof child is 'string' && @options.cdata && requiresCDATA child
element = element.ele(key).raw(wrapCDATA child).up()
else
if not child?
child = ''
element = element.ele(key, child.t... | CoffeeScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 7173c245aab4c2b417cd4c24f0b54e697a369864 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/7173c245aab4c2b417cd4c24f0b54e697a369864/src/builder.coffee | 72 | 102 |
Leonidas-from-XIV/node-xml2js:src/builder.coffee:1:raw_corpus | raw_corpus | requiresCDATA = (entry) ->
return entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0
# Note that we do this manually instead of using xmlbuilder's `.dat` method
# since it does not support escaping the CDATA close entity (throws an error if
# it exists, and if it's pre-escaped). | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 740e8008eb961184376388cd31bd92c38b179af6 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/740e8008eb961184376388cd31bd92c38b179af6/src/builder.coffee | 6 | 11 | ||
Leonidas-from-XIV/node-xml2js:src/builder.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
requiresCDATA = (entry) ->
return entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0
# Note that we do this manually instead of using xmlbuilder's `.dat` method
# since it does not support escaping the CDATA close entity (throws an e... | var requiresCDATA;
requiresCDATA = function(entry) {
return entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0;
};
// Note that we do this manually instead of using xmlbuilder's `.dat` method
// since it does not support escaping the CDATA close entity (throws an error if
// it exists, an... | CoffeeScript | JavaScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 740e8008eb961184376388cd31bd92c38b179af6 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/740e8008eb961184376388cd31bd92c38b179af6/src/builder.coffee | 6 | 11 |
Leonidas-from-XIV/node-xml2js:src/builder.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var requiresCDATA;
requiresCDATA = function(entry) {
return entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0;
};
// Note that we do this manually instead of using xmlbuilder's `.dat` method
// since it does not support escaping the ... | requiresCDATA = (entry) ->
return entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0
# Note that we do this manually instead of using xmlbuilder's `.dat` method
# since it does not support escaping the CDATA close entity (throws an error if
# it exists, and if it's pre-escaped). | JavaScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 740e8008eb961184376388cd31bd92c38b179af6 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/740e8008eb961184376388cd31bd92c38b179af6/src/builder.coffee | 6 | 11 |
Leonidas-from-XIV/node-xml2js:src/builder.coffee:4:raw_corpus | raw_corpus | class exports.Builder
constructor: (opts) ->
# copy this versions default options
@options = {}
@options[key] = value for own key, value of defaults["0.2"]
# overwrite them with the specified options, if any
@options[key] = value for own key, value of opts
buildObject: (rootObj) ->
attrkey ... | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 740e8008eb961184376388cd31bd92c38b179af6 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/740e8008eb961184376388cd31bd92c38b179af6/src/builder.coffee | 22 | 71 | ||
Leonidas-from-XIV/node-xml2js:src/builder.coffee:4:completion | completion | class exports.Builder
constructor: (opts) ->
# copy this versions default options
@options = {}
@options[key] = value for own key, value of defaults["0.2"]
# overwrite them with the specified options, if any
@options[key] = value for own key, value of opts
buildObject: (rootObj) ->
attrkey ... | if @options.cdata && requiresCDATA obj
element.raw wrapCDATA obj
else
element.txt obj
else
for own key, child of obj
# Case #1 Attribute
if key is attrkey
if typeof child is "object"
# Inserts tag attributes
for attr, ... | CoffeeScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 740e8008eb961184376388cd31bd92c38b179af6 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/740e8008eb961184376388cd31bd92c38b179af6/src/builder.coffee | 22 | 71 |
Leonidas-from-XIV/node-xml2js:src/builder.coffee:5:raw_corpus | raw_corpus | element = element.ele(key).raw(wrapCDATA entry).up()
else
element = element.ele(key, entry).up()
else
element = render(element.ele(key), entry).up()
# Case #4 Objects
else if typeof child is "object"
element = render(elemen... | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 740e8008eb961184376388cd31bd92c38b179af6 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/740e8008eb961184376388cd31bd92c38b179af6/src/builder.coffee | 72 | 97 | ||
Leonidas-from-XIV/node-xml2js:src/builder.coffee:5:completion | completion | element = element.ele(key).raw(wrapCDATA entry).up()
else
element = element.ele(key, entry).up()
else
element = render(element.ele(key), entry).up()
# Case #4 Objects
else if typeof child is "object"
element = render(elemen... | element = element.ele(key).raw(wrapCDATA child).up()
else
if not child?
child = ''
element = element.ele(key, child.toString()).up()
element
rootElement = builder.create(rootName, @options.xmldec, @options.doctype,
headless: @options.headless
... | CoffeeScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/builder.coffee | MIT | 740e8008eb961184376388cd31bd92c38b179af6 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/740e8008eb961184376388cd31bd92c38b179af6/src/builder.coffee | 72 | 97 |
jianliaoim/talk-os:talk-web/client/module/button-single-action.coffee:1:raw_corpus | raw_corpus | React = require 'react'
assign = require 'object-assign'
cx = require 'classnames'
T = React.PropTypes
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle
button = React.DOM.button
module.exports = React.createClass
displayName: 'single-action-button'
getInitialState: ->
isLoad... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/button-single-action.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/button-single-action.coffee | 1 | 43 | ||
jianliaoim/talk-os:talk-web/client/module/button-single-action.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
assign = require 'object-assign'
cx = require 'classnames'
T = React.PropTypes
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle
button = React.DOM.button
module.exports = React.createClass
displayName:... | var LiteLoadingCircle, React, T, assign, button, cx;
React = require('react');
assign = require('object-assign');
cx = require('classnames');
T = React.PropTypes;
LiteLoadingCircle = React.createFactory(require('react-lite-misc').LoadingCircle);
button = React.DOM.button;
module.exports = React.createClass({
d... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/button-single-action.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/button-single-action.coffee | 1 | 43 |
jianliaoim/talk-os:talk-web/client/module/button-single-action.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var LiteLoadingCircle, React, T, assign, button, cx;
React = require('react');
assign = require('object-assign');
cx = require('classnames');
T = React.PropTypes;
LiteLoadingCircle = React.createFactory(require('react-lite-misc').LoadingCircle);
button = Reac... | React = require 'react'
assign = require 'object-assign'
cx = require 'classnames'
T = React.PropTypes
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle
button = React.DOM.button
module.exports = React.createClass
displayName: 'single-action-button'
getInitialState: ->
isLoad... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/button-single-action.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/button-single-action.coffee | 1 | 43 |
jianliaoim/talk-os:talk-web/client/module/button-single-action.coffee:1:completion | completion | React = require 'react'
assign = require 'object-assign'
cx = require 'classnames'
T = React.PropTypes
LiteLoadingCircle = React.createFactory require('react-lite-misc').LoadingCircle
button = React.DOM.button
module.exports = React.createClass
displayName: 'single-action-button'
getInitialState: ->
isLoad... | @setState isLoading: true
@props.onClick @onComplete
content: ->
if @state.isLoading
LiteLoadingCircle
size: 32 # WARN: will cause problem on buttons with height != 32
stroke: 'white'
else
@props.children
render: ->
className = cx @props.className,
'button-single-... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/button-single-action.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/button-single-action.coffee | 1 | 43 |
buttercoin/buttercoin:lib/ews/ws_initiator.coffee:1:raw_corpus | raw_corpus | stump = require('stump')
enkihelpers = require('enkihelpers')
# EventEmitter = require('eemitterport').EventEmitter
EventEmitter = require('chained-emitter').EventEmitter
Q = require('q')
Connection = require('./ws_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitte... | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_initiator.coffee | MIT | a825a9ea31d695f8abb600f3f27ff635a839c0c2 | 663 | https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_initiator.coffee | 1 | 44 | ||
buttercoin/buttercoin:lib/ews/ws_initiator.coffee:1:completion | completion | stump = require('stump')
enkihelpers = require('enkihelpers')
# EventEmitter = require('eemitterport').EventEmitter
EventEmitter = require('chained-emitter').EventEmitter
Q = require('q')
Connection = require('./ws_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitte... | # Create Connection, hook up protocol, and get socket.connect
# - return promise to fire when connected
@connection = new Connection(this)
if @options.protocol
promise = @options.protocol.start(@connection)
else
throw Error("No Protocol in Initiator")
@connection.connect( @options.ws... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_initiator.coffee | MIT | a825a9ea31d695f8abb600f3f27ff635a839c0c2 | 663 | https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_initiator.coffee | 1 | 44 |
buttercoin/buttercoin:lib/ews/ws_initiator.coffee:1:raw_corpus | raw_corpus | stump = require('stump')
enkihelpers = require('enkihelpers')
# EventEmitter = require('eemitterport').EventEmitter
EventEmitter = require('chained-emitter').EventEmitter
Q = require('q')
Connection = require('./ws_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitte... | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_initiator.coffee | MIT | c87785c085716042476fba3dee430b2baaacc139 | 663 | https://github.com/buttercoin/buttercoin/blob/c87785c085716042476fba3dee430b2baaacc139/lib/ews/ws_initiator.coffee | 1 | 42 | ||
buttercoin/buttercoin:lib/ews/ws_initiator.coffee:1:completion | completion | stump = require('stump')
enkihelpers = require('enkihelpers')
# EventEmitter = require('eemitterport').EventEmitter
EventEmitter = require('chained-emitter').EventEmitter
Q = require('q')
Connection = require('./ws_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitte... | connect: () =>
# Create Connection, hook up protocol, and get socket.connect
# - return promise to fire when connected
@connection = new Connection(@)
if @options.protocol
promise = @options.protocol.start(@connection)
else
throw Error("No Protocol in Initiator")
@connection.conn... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_initiator.coffee | MIT | c87785c085716042476fba3dee430b2baaacc139 | 663 | https://github.com/buttercoin/buttercoin/blob/c87785c085716042476fba3dee430b2baaacc139/lib/ews/ws_initiator.coffee | 1 | 42 |
buttercoin/buttercoin:lib/ews/ws_initiator.coffee:1:raw_corpus | raw_corpus | stump = require('stump')
enkihelpers = require('enkihelpers')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./ws_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options, @parent) ->
if not @parent... | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_initiator.coffee | MIT | a029c1a623369cb4df0af6e982a2420b6c0d1a62 | 663 | https://github.com/buttercoin/buttercoin/blob/a029c1a623369cb4df0af6e982a2420b6c0d1a62/lib/ews/ws_initiator.coffee | 1 | 40 | ||
buttercoin/buttercoin:lib/ews/ws_initiator.coffee:1:completion | completion | stump = require('stump')
enkihelpers = require('enkihelpers')
EventEmitter = require('eemitterport').EventEmitter
Q = require('q')
Connection = require('./ws_connection')
# Protocol = require('./protocol')
module.exports = class Initiator extends EventEmitter
constructor: (@options, @parent) ->
if not @parent... | # Create Connection, hook up protocol, and get socket.connect
# - return promise to fire when connected
@connection = new Connection(@)
if @options.protocol
promise = @options.protocol.start(@connection)
else
throw Error("No Protocol in Initiator")
@connection.connect( @options.wscon... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_initiator.coffee | MIT | a029c1a623369cb4df0af6e982a2420b6c0d1a62 | 663 | https://github.com/buttercoin/buttercoin/blob/a029c1a623369cb4df0af6e982a2420b6c0d1a62/lib/ews/ws_initiator.coffee | 1 | 40 |
CaryLandholt/AngularFun:tasks/exec.coffee:1:raw_corpus | raw_corpus | ###global module, require###
module.exports = (grunt) ->
growl = require 'growl'
proc = require 'child_process'
grunt.registerHelper 'exec', (opts, done) ->
command = "#{opts.cmd} #{opts.args.join ' '}"
proc.exec command, opts.opts, (code, stdout, stderr) ->
return if not done
message = "Executed comma... | CoffeeScript | CaryLandholt/AngularFun | tasks/exec.coffee | MIT | 4d1f0e38f7f87729adcf7c80bc4242ce73098f46 | 672 | https://github.com/CaryLandholt/AngularFun/blob/4d1f0e38f7f87729adcf7c80bc4242ce73098f46/tasks/exec.coffee | 1 | 18 | ||
CaryLandholt/AngularFun:tasks/exec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global module, require###
module.exports = (grunt) ->
growl = require 'growl'
proc = require 'child_process'
grunt.registerHelper 'exec', (opts, done) ->
command = "#{opts.cmd} #{opts.args.join ' '}"
proc.exec command, opts.opts, (code, stdout, stder... | /*global module, require*/
module.exports = function(grunt) {
var growl, proc;
growl = require('growl');
proc = require('child_process');
return grunt.registerHelper('exec', function(opts, done) {
var command;
command = `${opts.cmd} ${opts.args.join(' ')}`;
return proc.exec(command, opts.opts, funct... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | tasks/exec.coffee | MIT | 4d1f0e38f7f87729adcf7c80bc4242ce73098f46 | 672 | https://github.com/CaryLandholt/AngularFun/blob/4d1f0e38f7f87729adcf7c80bc4242ce73098f46/tasks/exec.coffee | 1 | 18 |
CaryLandholt/AngularFun:tasks/exec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global module, require*/
module.exports = function(grunt) {
var growl, proc;
growl = require('growl');
proc = require('child_process');
return grunt.registerHelper('exec', function(opts, done) {
var command;
command = `${opts.cmd} ${opts.args.join... | ###global module, require###
module.exports = (grunt) ->
growl = require 'growl'
proc = require 'child_process'
grunt.registerHelper 'exec', (opts, done) ->
command = "#{opts.cmd} #{opts.args.join ' '}"
proc.exec command, opts.opts, (code, stdout, stderr) ->
return if not done
message = "Executed comma... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | tasks/exec.coffee | MIT | 4d1f0e38f7f87729adcf7c80bc4242ce73098f46 | 672 | https://github.com/CaryLandholt/AngularFun/blob/4d1f0e38f7f87729adcf7c80bc4242ce73098f46/tasks/exec.coffee | 1 | 18 |
CaryLandholt/AngularFun:tasks/exec.coffee:1:completion | completion | ###global module, require###
module.exports = (grunt) ->
growl = require 'growl'
proc = require 'child_process'
grunt.registerHelper 'exec', (opts, done) ->
command = "#{opts.cmd} #{opts.args.join ' '}" | proc.exec command, opts.opts, (code, stdout, stderr) ->
return if not done
message = "Executed command #{command}"
grunt.log.writeln message
growl message, title: 'Command Executed'
done(null, stdout, code) if code is 0
done code, stderr, code | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | tasks/exec.coffee | MIT | 4d1f0e38f7f87729adcf7c80bc4242ce73098f46 | 672 | https://github.com/CaryLandholt/AngularFun/blob/4d1f0e38f7f87729adcf7c80bc4242ce73098f46/tasks/exec.coffee | 1 | 18 |
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:1:raw_corpus | raw_corpus | require('../coffeescript-register-web')
fs = require 'fs'
path = require 'path'
_ = require 'lodash'
{promisify} = require 'util'
uuid = require 'uuid'
tar_stream = require 'tar-stream'
# translate Sketch -> Zip
{importFromSketch} = require './importer'
{Doc} = require '../src/doc'
{doc_infer_all_constraints} = requ... | CoffeeScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 1 | 50 | ||
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('../coffeescript-register-web')
fs = require 'fs'
path = require 'path'
_ = require 'lodash'
{promisify} = require 'util'
uuid = require 'uuid'
tar_stream = require 'tar-stream'
# translate Sketch -> Zip
{importFromSketch} = require './importer'
{Doc} ... | var Doc, MAX_SKETCH_SIZE, _, compileDoc, doc_infer_all_constraints, fs, importFromSketch, path, promisify, sketchfile_to_codefiles, tar_stream, temp_dir, uuid;
require('../coffeescript-register-web');
fs = require('fs');
path = require('path');
_ = require('lodash');
({promisify} = require('util'));
uuid = requir... | CoffeeScript | JavaScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 1 | 50 |
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Doc, MAX_SKETCH_SIZE, _, compileDoc, doc_infer_all_constraints, fs, importFromSketch, path, promisify, sketchfile_to_codefiles, tar_stream, temp_dir, uuid;
require('../coffeescript-register-web');
fs = require('fs');
path = require('path');
_ = require('lod... | require('../coffeescript-register-web')
fs = require 'fs'
path = require 'path'
_ = require 'lodash'
{promisify} = require 'util'
uuid = require 'uuid'
tar_stream = require 'tar-stream'
# translate Sketch -> Zip
{importFromSketch} = require './importer'
{Doc} = require '../src/doc'
{doc_infer_all_constraints} = requ... | JavaScript | CoffeeScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 1 | 50 |
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:1:completion | completion | require('../coffeescript-register-web')
fs = require 'fs'
path = require 'path'
_ = require 'lodash'
{promisify} = require 'util'
uuid = require 'uuid'
tar_stream = require 'tar-stream'
# translate Sketch -> Zip
{importFromSketch} = require './importer'
{Doc} = require '../src/doc'
{doc_infer_all_constraints} = requ... | scratch_dir = path.join(temp_dir, String(uuid.v4()))
return Promise.resolve()
.then ->
promisify(fs.mkdir)(scratch_dir)
.then ->
create_asset = (filename, data, content_type, callback) ->
asset_path = "/assets/#{filename}"
emit_file(asset_path, data)
cal... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 1 | 50 |
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:2:raw_corpus | raw_corpus | # could probably be implemented more generally as a Stream(File) -> TarStream
sketchfile_to_tarstream = (sketchfile_path, return_outstream) ->
tar_out_stream = tar_stream.pack()
return_outstream(tar_out_stream)
# returns promise resolved when sketchfile_to_tarstream resolves
return sketchfile_to_codefi... | CoffeeScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 51 | 70 | ||
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# could probably be implemented more generally as a Stream(File) -> TarStream
sketchfile_to_tarstream = (sketchfile_path, return_outstream) ->
tar_out_stream = tar_stream.pack()
return_outstream(tar_out_stream)
# returns promise resolved when sketchf... | // could probably be implemented more generally as a Stream(File) -> TarStream
var sketchfile_to_tarstream;
sketchfile_to_tarstream = function(sketchfile_path, return_outstream) {
var tar_out_stream;
tar_out_stream = tar_stream.pack();
return_outstream(tar_out_stream);
// returns promise resolved when sketchfi... | CoffeeScript | JavaScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 51 | 70 |
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// could probably be implemented more generally as a Stream(File) -> TarStream
var sketchfile_to_tarstream;
sketchfile_to_tarstream = function(sketchfile_path, return_outstream) {
var tar_out_stream;
tar_out_stream = tar_stream.pack();
return_outstream(tar_o... | # could probably be implemented more generally as a Stream(File) -> TarStream
sketchfile_to_tarstream = (sketchfile_path, return_outstream) ->
tar_out_stream = tar_stream.pack()
return_outstream(tar_out_stream)
# returns promise resolved when sketchfile_to_tarstream resolves
return sketchfile_to_codefi... | JavaScript | CoffeeScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 51 | 70 |
Pagedraw/pagedraw:sketch-importer/sketch-to-code-tar.coffee:2:completion | completion | # could probably be implemented more generally as a Stream(File) -> TarStream
sketchfile_to_tarstream = (sketchfile_path, return_outstream) ->
tar_out_stream = tar_stream.pack()
return_outstream(tar_out_stream)
# returns promise resolved when sketchfile_to_tarstream resolves
return sketchfile_to_codefi... | tar_out_stream.finalize()
##
sketchfile_to_tarstream(process.argv[2], ((outstream) ->
outstream.pipe(fs.createWriteStream(process.argv[3], 'utf-8'))
)).catch((err) ->
console.error(err)
process.exit(1)
) | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | sketch-importer/sketch-to-code-tar.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/sketch-to-code-tar.coffee | 51 | 70 |
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:raw_corpus | raw_corpus | ###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'app'
it 'Twitter username should be prepended with the @ sign', inject ['twitterfyFilter', (twitterfy) ->
twitterHandle ... | CoffeeScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | b668056a1a0a90e671ebd58d9751366012c83160 | 672 | https://github.com/CaryLandholt/AngularFun/blob/b668056a1a0a90e671ebd58d9751366012c83160/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 | ||
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'app'
it 'Twitter username should be prepended with the @ sign', in... | /*global define, describe, beforeEach, module, it, inject, expect*/
define(['libs/angularMocks', 'filters/twitterfy'], function() {
'use strict';
return describe('twitterfy filter', function() {
beforeEach(module('app'));
return it('Twitter username should be prepended with the @ sign', inject([
'twit... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | b668056a1a0a90e671ebd58d9751366012c83160 | 672 | https://github.com/CaryLandholt/AngularFun/blob/b668056a1a0a90e671ebd58d9751366012c83160/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 |
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define, describe, beforeEach, module, it, inject, expect*/
define(['libs/angularMocks', 'filters/twitterfy'], function() {
'use strict';
return describe('twitterfy filter', function() {
beforeEach(module('app'));
return it('Twitter username sho... | ###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'app'
it 'Twitter username should be prepended with the @ sign', inject ['twitterfyFilter', (twitterfy) ->
twitterHandle ... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | b668056a1a0a90e671ebd58d9751366012c83160 | 672 | https://github.com/CaryLandholt/AngularFun/blob/b668056a1a0a90e671ebd58d9751366012c83160/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 |
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:completion | completion | ###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'app' | it 'Twitter username should be prepended with the @ sign', inject ['twitterfyFilter', (twitterfy) ->
twitterHandle = 'CaryLandholt'
twitterfied = twitterfy twitterHandle
expect(twitterfied).not.toEqual(twitterHandle)
expect(twitterfied).toEqual("@#{twitterHandle}")
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | b668056a1a0a90e671ebd58d9751366012c83160 | 672 | https://github.com/CaryLandholt/AngularFun/blob/b668056a1a0a90e671ebd58d9751366012c83160/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 |
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:raw_corpus | raw_corpus | ###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'filters'
it 'Twitter username should be prepended with the @ sign', inject ['twitterfyFilter', (twitterfy) ->
twitterHan... | CoffeeScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | 7d4f2ab3dbad18bbb02c2804f71447834e30edef | 672 | https://github.com/CaryLandholt/AngularFun/blob/7d4f2ab3dbad18bbb02c2804f71447834e30edef/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 | ||
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'filters'
it 'Twitter username should be prepended with the @ sign'... | /*global define, describe, beforeEach, module, it, inject, expect*/
define(['libs/angularMocks', 'filters/twitterfy'], function() {
'use strict';
return describe('twitterfy filter', function() {
beforeEach(module('filters'));
return it('Twitter username should be prepended with the @ sign', inject([
'... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | 7d4f2ab3dbad18bbb02c2804f71447834e30edef | 672 | https://github.com/CaryLandholt/AngularFun/blob/7d4f2ab3dbad18bbb02c2804f71447834e30edef/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 |
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define, describe, beforeEach, module, it, inject, expect*/
define(['libs/angularMocks', 'filters/twitterfy'], function() {
'use strict';
return describe('twitterfy filter', function() {
beforeEach(module('filters'));
return it('Twitter username... | ###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'filters'
it 'Twitter username should be prepended with the @ sign', inject ['twitterfyFilter', (twitterfy) ->
twitterHan... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | 7d4f2ab3dbad18bbb02c2804f71447834e30edef | 672 | https://github.com/CaryLandholt/AngularFun/blob/7d4f2ab3dbad18bbb02c2804f71447834e30edef/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 |
CaryLandholt/AngularFun:test/scripts/filterSpecs/twitterfySpec.coffee:1:completion | completion | ###global define, describe, beforeEach, module, it, inject, expect###
define ['libs/angularMocks', 'filters/twitterfy'], ->
'use strict'
describe 'twitterfy filter', ->
beforeEach module 'filters' | it 'Twitter username should be prepended with the @ sign', inject ['twitterfyFilter', (twitterfy) ->
twitterHandle = 'CaryLandholt'
twitterfied = twitterfy twitterHandle
expect(twitterfied).not.toEqual(twitterHandle)
expect(twitterfied).toEqual("@#{twitterHandle}")
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | test/scripts/filterSpecs/twitterfySpec.coffee | MIT | 7d4f2ab3dbad18bbb02c2804f71447834e30edef | 672 | https://github.com/CaryLandholt/AngularFun/blob/7d4f2ab3dbad18bbb02c2804f71447834e30edef/test/scripts/filterSpecs/twitterfySpec.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'team-directory'
mixins: [ mixinQuery, mixinSubscribe ]
propTypes:
_teamId: T.string.isRequired
_userId: T.string.isRequired
onClose: T.func
getInitialState: ->
tab: 'members'
groups: @getGroups()
contacts: @getContacts()
invitations... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 27 | 76 | ||
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'team-directory'
mixins: [ mixinQuery, mixinSubscribe ]
propTypes:
_teamId: T.string.isRequired
_userId: T.string.isRequired
onClose: T.func
getInitialState: ->
tab: 'members'
groups: ... | module.exports = React.createClass({
displayName: 'team-directory',
mixins: [mixinQuery, mixinSubscribe],
propTypes: {
_teamId: T.string.isRequired,
_userId: T.string.isRequired,
onClose: T.func
},
getInitialState: function() {
return {
tab: 'members',
groups: this.getGroups(),
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'team-directory',
mixins: [mixinQuery, mixinSubscribe],
propTypes: {
_teamId: T.string.isRequired,
_userId: T.string.isRequired,
onClose: T.func
},
getInitialState: function() {
return {
... | module.exports = React.createClass
displayName: 'team-directory'
mixins: [ mixinQuery, mixinSubscribe ]
propTypes:
_teamId: T.string.isRequired
_userId: T.string.isRequired
onClose: T.func
getInitialState: ->
tab: 'members'
groups: @getGroups()
contacts: @getContacts()
invitations... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'team-directory'
mixins: [ mixinQuery, mixinSubscribe ]
propTypes:
_teamId: T.string.isRequired
_userId: T.string.isRequired
onClose: T.func
getInitialState: ->
tab: 'members'
groups: @getGroups()
contacts: @getContacts()
invitations... | getNum: (tab) ->
number =
switch tab
when 'members'
@state.contacts.size + @state.invitations.size
when 'groups'
@state.groups.size
if number > 0 then "(#{number})" else ''
onTabClick: (tab) ->
@setState tab: tab
closeTeamDrawer: ->
settingsActions.closeD... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:2:raw_corpus | raw_corpus | renderBody: ->
div className: 'body flex-vert flex-fill',
switch @state.tab
when 'members'
MemberBoard
_teamId: @props._teamId
_userId: @props._userId
contacts: @state.contacts
invitations: @state.invitations
leftContacts: @state.le... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 77 | 97 | ||
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
renderBody: ->
div className: 'body flex-vert flex-fill',
switch @state.tab
when 'members'
MemberBoard
_teamId: @props._teamId
_userId: @props._userId
contacts: @state.contacts
invitation... | ({
renderBody: function() {
return div({
className: 'body flex-vert flex-fill'
}, (function() {
switch (this.state.tab) {
case 'members':
return MemberBoard({
_teamId: this.props._teamId,
_userId: this.props._userId,
contacts: this.state.contac... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 77 | 97 |
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
renderBody: function() {
return div({
className: 'body flex-vert flex-fill'
}, (function() {
switch (this.state.tab) {
case 'members':
return MemberBoard({
_teamId: this.props._teamId,
_userId: this... | renderBody: ->
div className: 'body flex-vert flex-fill',
switch @state.tab
when 'members'
MemberBoard
_teamId: @props._teamId
_userId: @props._userId
contacts: @state.contacts
invitations: @state.invitations
leftContacts: @state.le... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 77 | 97 |
jianliaoim/talk-os:talk-web/client/app/team-directory.coffee:2:completion | completion | renderBody: ->
div className: 'body flex-vert flex-fill',
switch @state.tab
when 'members'
MemberBoard
_teamId: @props._teamId
_userId: @props._userId
contacts: @state.contacts
invitations: @state.invitations
leftContacts: @state.le... | when 'groups'
GroupBoard
_teamId: @props._teamId
_userId: @props._userId
groups: @state.groups
contacts: @state.contacts
render: ->
div className: 'team-directory flex-vert',
@renderHeader()
@renderBody() | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-directory.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-directory.coffee | 77 | 97 |
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:raw_corpus | raw_corpus | # This now works on at least npm v5.x, but still requires harmony-proxies flag
# To run `coffee --nodejs --harmony-proxies .play/es6Proxy.coffee`
class ObjectLike
constructor: (obj) ->
unless obj?
obj = {}
@dummy = obj
interceptor =
set: (receiver, key, value) =>
@dummy[key] = value
... | CoffeeScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 23eff752dc603ad9559c50739589d3ec673c07f7 | 460 | https://github.com/lmaccherone/node-localstorage/blob/23eff752dc603ad9559c50739589d3ec673c07f7/.play/es6Proxy.coffee | 1 | 21 | ||
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# This now works on at least npm v5.x, but still requires harmony-proxies flag
# To run `coffee --nodejs --harmony-proxies .play/es6Proxy.coffee`
class ObjectLike
constructor: (obj) ->
unless obj?
obj = {}
@dummy = obj
interceptor =
se... | // This now works on at least npm v5.x, but still requires harmony-proxies flag
// To run `coffee --nodejs --harmony-proxies .play/es6Proxy.coffee`
var ObjectLike, a;
ObjectLike = class ObjectLike {
constructor(obj) {
var interceptor;
if (obj == null) {
obj = {};
}
this.dummy = obj;
interce... | CoffeeScript | JavaScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 23eff752dc603ad9559c50739589d3ec673c07f7 | 460 | https://github.com/lmaccherone/node-localstorage/blob/23eff752dc603ad9559c50739589d3ec673c07f7/.play/es6Proxy.coffee | 1 | 21 |
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// This now works on at least npm v5.x, but still requires harmony-proxies flag
// To run `coffee --nodejs --harmony-proxies .play/es6Proxy.coffee`
var ObjectLike, a;
ObjectLike = class ObjectLike {
constructor(obj) {
var interceptor;
if (obj == null) {
... | # This now works on at least npm v5.x, but still requires harmony-proxies flag
# To run `coffee --nodejs --harmony-proxies .play/es6Proxy.coffee`
class ObjectLike
constructor: (obj) ->
unless obj?
obj = {}
@dummy = obj
interceptor =
set: (receiver, key, value) =>
@dummy[key] = value
... | JavaScript | CoffeeScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 23eff752dc603ad9559c50739589d3ec673c07f7 | 460 | https://github.com/lmaccherone/node-localstorage/blob/23eff752dc603ad9559c50739589d3ec673c07f7/.play/es6Proxy.coffee | 1 | 21 |
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:completion | completion | # This now works on at least npm v5.x, but still requires harmony-proxies flag
# To run `coffee --nodejs --harmony-proxies .play/es6Proxy.coffee`
class ObjectLike
constructor: (obj) ->
unless obj?
obj = {}
@dummy = obj
interceptor = | set: (receiver, key, value) =>
@dummy[key] = value
get: (receiver, key) =>
return @dummy[key]
return Proxy.create(interceptor, @dummy)
a = new ObjectLike()
a['something long'] = 10
console.log(a['something long']) | CoffeeScript | CoffeeScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 23eff752dc603ad9559c50739589d3ec673c07f7 | 460 | https://github.com/lmaccherone/node-localstorage/blob/23eff752dc603ad9559c50739589d3ec673c07f7/.play/es6Proxy.coffee | 1 | 21 |
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:raw_corpus | raw_corpus | class ArrayLike
constructor: (array) ->
unless array?
array = []
@dummy = array
interceptor = {
set: (receiver, index, value) ->
dummy[index] = value
get: (receiver, index) ->
index = parseInt(index)
if index < 0
return dummy[dummy.length + index]
... | CoffeeScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 7912ded3376077f89633aaf0c6c1cc9d00470566 | 460 | https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/.play/es6Proxy.coffee | 1 | 22 | ||
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ArrayLike
constructor: (array) ->
unless array?
array = []
@dummy = array
interceptor = {
set: (receiver, index, value) ->
dummy[index] = value
get: (receiver, index) ->
index = parseInt(index)
if in... | var ArrayLike, a;
ArrayLike = class ArrayLike {
constructor(array) {
var interceptor;
if (array == null) {
array = [];
}
this.dummy = array;
interceptor = {
set: function(receiver, index, value) {
return dummy[index] = value;
},
get: function(receiver, index) {
... | CoffeeScript | JavaScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 7912ded3376077f89633aaf0c6c1cc9d00470566 | 460 | https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/.play/es6Proxy.coffee | 1 | 22 |
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ArrayLike, a;
ArrayLike = class ArrayLike {
constructor(array) {
var interceptor;
if (array == null) {
array = [];
}
this.dummy = array;
interceptor = {
set: function(receiver, index, value) {
return dummy[index] = val... | class ArrayLike
constructor: (array) ->
unless array?
array = []
@dummy = array
interceptor = {
set: (receiver, index, value) ->
dummy[index] = value
get: (receiver, index) ->
index = parseInt(index)
if index < 0
return dummy[dummy.length + index]
... | JavaScript | CoffeeScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 7912ded3376077f89633aaf0c6c1cc9d00470566 | 460 | https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/.play/es6Proxy.coffee | 1 | 22 |
lmaccherone/node-localstorage:.play/es6Proxy.coffee:1:completion | completion | class ArrayLike
constructor: (array) ->
unless array?
array = []
@dummy = array
interceptor = {
set: (receiver, index, value) ->
dummy[index] = value
get: (receiver, index) -> | index = parseInt(index)
if index < 0
return dummy[dummy.length + index]
else
return dummy[index]
}
return Proxy(@dummy, interceptor)
a = new ArrayLike()
a['a'] = 1
console.log(a) | CoffeeScript | CoffeeScript | lmaccherone/node-localstorage | .play/es6Proxy.coffee | MIT | 7912ded3376077f89633aaf0c6c1cc9d00470566 | 460 | https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/.play/es6Proxy.coffee | 1 | 22 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:raw_corpus | raw_corpus | $inputor = null
app = null
describe "default callbacks", ->
$ = jQuery
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks =... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$inputor = null
app = null
describe "default callbacks", ->
$ = jQuery
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
before... | var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var $, callbacks, text;
$ = jQuery;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho({
at: "@",
data: fixtures["names"]
});
... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var $, callbacks, text;
$ = jQuery;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho(... | $inputor = null
app = null
describe "default callbacks", ->
$ = jQuery
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks =... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:completion | completion | $inputor = null
app = null
describe "default callbacks", ->
$ = jQuery
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks =... | it "refactor the data before save", ->
items = callbacks.beforeSave.call(app.controller(), fixtures["names"])
expect(items).toContain({"name":"Jacob"})
expect(items).toContain({"name":"Isabella"})
it "should match the key word following @", ->
query = callbacks.matcher.call(app, "@", text)
expect... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:raw_corpus | raw_corpus | it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, true)
expect(query).toBe("Jobs Blobs")
it "should mat... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, tru... | it("should match a space following @ if acceptSpaceBar flag set to true", function() {
var $inputor, query, text;
$inputor = $("#inputor4").atwho({
at: "@",
data: fixtures["names"],
acceptSpaceBar: true
});
text = $.trim($inputor.text());
query = callbacks.matcher.call(app, "@", text, false, true)... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should match a space following @ if acceptSpaceBar flag set to true", function() {
var $inputor, query, text;
$inputor = $("#inputor4").atwho({
at: "@",
data: fixtures["names"],
acceptSpaceBar: true
});
text = $.trim($inputor.text());
quer... | it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, true)
expect(query).toBe("Jobs Blobs")
it "should mat... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:completion | completion | it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, true)
expect(query).toBe("Jobs Blobs")
it "should mat... | expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy("remote_call")
$inputor.atwho
at: "@"
data: null,
callbacks:
remoteFilter: remote_call
simulateTypingIn $inputor
expect(remote_call).toHaveBeenC... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:raw_corpus | raw_corpus | it "don't sort the data without a query", ->
names = callbacks.beforeSave.call(app.controller(), fixtures["names"])
names = callbacks.sorter.call(app, "", names, "name")
expect(names[0]).toEqual({ name : 'Jacob' })
it "can eval temple", ->
map = {name: "username", nick: "nick_name"}
tpl = '<li da... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 87 | 122 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "don't sort the data without a query", ->
names = callbacks.beforeSave.call(app.controller(), fixtures["names"])
names = callbacks.sorter.call(app, "", names, "name")
expect(names[0]).toEqual({ name : 'Jacob' })
it "can eval temple", ->
map ... | it("don't sort the data without a query", function() {
var names;
names = callbacks.beforeSave.call(app.controller(), fixtures["names"]);
names = callbacks.sorter.call(app, "", names, "name");
return expect(names[0]).toEqual({
name: 'Jacob'
});
});
it("can eval temple", function() {
var html, map, resu... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 87 | 122 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("don't sort the data without a query", function() {
var names;
names = callbacks.beforeSave.call(app.controller(), fixtures["names"]);
names = callbacks.sorter.call(app, "", names, "name");
return expect(names[0]).toEqual({
name: 'Jacob'
});
});
i... | it "don't sort the data without a query", ->
names = callbacks.beforeSave.call(app.controller(), fixtures["names"])
names = callbacks.sorter.call(app, "", names, "name")
expect(names[0]).toEqual({ name : 'Jacob' })
it "can eval temple", ->
map = {name: "username", nick: "nick_name"}
tpl = '<li da... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 87 | 122 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:completion | completion | it "don't sort the data without a query", ->
names = callbacks.beforeSave.call(app.controller(), fixtures["names"])
names = callbacks.sorter.call(app, "", names, "name")
expect(names[0]).toEqual({ name : 'Jacob' })
it "can eval temple", ->
map = {name: "username", nick: "nick_name"}
tpl = '<li da... | expect(result).toBe(html)
it "can highlight the query", ->
html = '<li data-value="username">Ethan</li>'
highlighted = callbacks.highlighter.call(app, html, "e")
result = '<li data-value="username"> <strong>E</strong>than </li>'
expect(highlighted).toBe(result)
it "can insert the text which be ch... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/spec/javascripts/default_callbacks.spec.coffee | 87 | 122 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:raw_corpus | raw_corpus | it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, true)
expect(query).toBe("Jobs Blobs")
it "should mat... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 3c7f59385b9364e436dd11a8fef205fb6832f708 | 5,250 | https://github.com/ichord/At.js/blob/3c7f59385b9364e436dd11a8fef205fb6832f708/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, tru... | it("should match a space following @ if acceptSpaceBar flag set to true", function() {
var $inputor, query, text;
$inputor = $("#inputor4").atwho({
at: "@",
data: fixtures["names"],
acceptSpaceBar: true
});
text = $.trim($inputor.text());
query = callbacks.matcher.call(app, "@", text, false, true)... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 3c7f59385b9364e436dd11a8fef205fb6832f708 | 5,250 | https://github.com/ichord/At.js/blob/3c7f59385b9364e436dd11a8fef205fb6832f708/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should match a space following @ if acceptSpaceBar flag set to true", function() {
var $inputor, query, text;
$inputor = $("#inputor4").atwho({
at: "@",
data: fixtures["names"],
acceptSpaceBar: true
});
text = $.trim($inputor.text());
quer... | it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, true)
expect(query).toBe("Jobs Blobs")
it "should mat... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 3c7f59385b9364e436dd11a8fef205fb6832f708 | 5,250 | https://github.com/ichord/At.js/blob/3c7f59385b9364e436dd11a8fef205fb6832f708/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:completion | completion | it "should match a space following @ if acceptSpaceBar flag set to true", ->
$inputor = $("#inputor4").atwho at: "@", data: fixtures["names"], acceptSpaceBar: true
text = $.trim $inputor.text()
query = callbacks.matcher.call(app, "@", text, false, true)
expect(query).toBe("Jobs Blobs")
it "should mat... | expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy("remote_call")
$inputor.atwho
at: "@"
data: null,
callbacks:
remoteFilter: remote_call
simulateTypingIn $inputor
expect(remote_call).toHaveBeenC... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 3c7f59385b9364e436dd11a8fef205fb6832f708 | 5,250 | https://github.com/ichord/At.js/blob/3c7f59385b9364e436dd11a8fef205fb6832f708/spec/javascripts/default_callbacks.spec.coffee | 43 | 85 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:raw_corpus | raw_corpus | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | bf17d438bbaf47595c505ef27f738ff48b6c3356 | 5,250 | https://github.com/ichord/At.js/blob/bf17d438bbaf47595c505ef27f738ff48b6c3356/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
... | var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var callbacks, text;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho({
at: "@",
data: fixtures["names"]
});
return app = ... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | bf17d438bbaf47595c505ef27f738ff48b6c3356 | 5,250 | https://github.com/ichord/At.js/blob/bf17d438bbaf47595c505ef27f738ff48b6c3356/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var callbacks, text;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho({
at: "@",
... | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | bf17d438bbaf47595c505ef27f738ff48b6c3356 | 5,250 | https://github.com/ichord/At.js/blob/bf17d438bbaf47595c505ef27f738ff48b6c3356/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:completion | completion | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | it "refactor the data before save", ->
items = callbacks.beforeSave.call(app.controller(), fixtures["names"])
expect(items).toContain({"name":"Jacob"})
expect(items).toContain({"name":"Isabella"})
it "should match the key word following @", ->
query = callbacks.matcher.call(app, "@", text)
expect... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | bf17d438bbaf47595c505ef27f738ff48b6c3356 | 5,250 | https://github.com/ichord/At.js/blob/bf17d438bbaf47595c505ef27f738ff48b6c3356/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:raw_corpus | raw_corpus | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
... | var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var callbacks, text;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho({
at: "@",
data: fixtures["names"]
});
return app = ... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var callbacks, text;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho({
at: "@",
... | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:completion | completion | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | it "refactor the data before save", ->
items = callbacks.beforeSave.call(app.controller(), fixtures["names"])
expect(items).toContain({"name":"Jacob"})
expect(items).toContain({"name":"Isabella"})
it "should match the key word following @", ->
query = callbacks.matcher.call(app, "@", text)
expect... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:raw_corpus | raw_corpus | it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy(... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 43 | 87 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if s... | it("can filter numeric data", function() {
var numerics;
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"]);
numerics = callbacks.filter.call(app, "1", numerics, "name");
return expect(numerics).toContain({
name: 10
});
});
it("request data from remote by ajax if set remoteFilte... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 43 | 87 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("can filter numeric data", function() {
var numerics;
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"]);
numerics = callbacks.filter.call(app, "1", numerics, "name");
return expect(numerics).toContain({
name: 10
});
});
... | it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy(... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 43 | 87 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:completion | completion | it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy(... | numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.sorter.call(app, "1", numerics, "name")
expect(numerics[0].name).toBe 13
it "don't sort the data without a query", ->
names = callbacks.beforeSave.call(app.controller(), fixtures["names"])
names = callba... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 43 | 87 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:raw_corpus | raw_corpus | it "can highlight the query", ->
html = '<li data-value="username">Ethan</li>'
highlighted = callbacks.highlighter.call(app, html, "e")
result = '<li data-value="username"> <strong>E</strong>than </li>'
expect(highlighted).toBe(result)
it "can insert the text which be choosed", ->
spyOn(callbacks... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 89 | 103 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "can highlight the query", ->
html = '<li data-value="username">Ethan</li>'
highlighted = callbacks.highlighter.call(app, html, "e")
result = '<li data-value="username"> <strong>E</strong>than </li>'
expect(highlighted).toBe(result)
it "can ... | it("can highlight the query", function() {
var highlighted, html, result;
html = '<li data-value="username">Ethan</li>';
highlighted = callbacks.highlighter.call(app, html, "e");
result = '<li data-value="username"> <strong>E</strong>than </li>';
return expect(highlighted).toBe(result);
});
it("can insert th... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 89 | 103 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("can highlight the query", function() {
var highlighted, html, result;
html = '<li data-value="username">Ethan</li>';
highlighted = callbacks.highlighter.call(app, html, "e");
result = '<li data-value="username"> <strong>E</strong>than </li>';
return e... | it "can highlight the query", ->
html = '<li data-value="username">Ethan</li>'
highlighted = callbacks.highlighter.call(app, html, "e")
result = '<li data-value="username"> <strong>E</strong>than </li>'
expect(highlighted).toBe(result)
it "can insert the text which be choosed", ->
spyOn(callbacks... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 89 | 103 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:completion | completion | it "can highlight the query", ->
html = '<li data-value="username">Ethan</li>'
highlighted = callbacks.highlighter.call(app, html, "e")
result = '<li data-value="username"> <strong>E</strong>than </li>'
expect(highlighted).toBe(result)
it "can insert the text which be choosed", -> | spyOn(callbacks, "beforeInsert").and.callThrough()
triggerAtwhoAt $inputor
expect(callbacks.beforeInsert).toHaveBeenCalled()
it "can adjust offset before reposition", ->
spyOn(callbacks, "beforeReposition").and.callThrough()
triggerAtwhoAt $inputor
expect(callbacks.beforeReposition).toHaveBeenCal... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | b14e797f6663b3a90ccbd44f59af8f0c53481c7e | 5,250 | https://github.com/ichord/At.js/blob/b14e797f6663b3a90ccbd44f59af8f0c53481c7e/spec/javascripts/default_callbacks.spec.coffee | 89 | 103 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:raw_corpus | raw_corpus | it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy(... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 43 | 86 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if s... | it("can filter numeric data", function() {
var numerics;
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"]);
numerics = callbacks.filter.call(app, "1", numerics, "name");
return expect(numerics).toContain({
name: 10
});
});
it("request data from remote by ajax if set remoteFilte... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 43 | 86 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("can filter numeric data", function() {
var numerics;
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"]);
numerics = callbacks.filter.call(app, "1", numerics, "name");
return expect(numerics).toContain({
name: 10
});
});
... | it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy(... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 43 | 86 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:completion | completion | it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy(... | numerics = callbacks.beforeSave.call(app.controller(), fixtures["numerics"])
numerics = callbacks.sorter.call(app, "1", numerics, "name")
expect(numerics[0].name).toBe 13
it "don't sort the data without a query", ->
names = callbacks.beforeSave.call(app.controller(), fixtures["names"])
names = callba... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 43 | 86 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:raw_corpus | raw_corpus | it "can insert the text which be choosed", ->
spyOn(callbacks, "beforeInsert").and.callThrough()
triggerAtwhoAt $inputor
expect(callbacks.beforeInsert).toHaveBeenCalled()
it "can adjust offset before reposition", ->
spyOn(callbacks, "beforeReposition").and.callThrough()
triggerAtwhoAt $inputor
... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 88 | 96 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "can insert the text which be choosed", ->
spyOn(callbacks, "beforeInsert").and.callThrough()
triggerAtwhoAt $inputor
expect(callbacks.beforeInsert).toHaveBeenCalled()
it "can adjust offset before reposition", ->
spyOn(callbacks, "beforeRepo... | it("can insert the text which be choosed", function() {
spyOn(callbacks, "beforeInsert").and.callThrough();
triggerAtwhoAt($inputor);
return expect(callbacks.beforeInsert).toHaveBeenCalled();
});
it("can adjust offset before reposition", function() {
spyOn(callbacks, "beforeReposition").and.callThrough();
tr... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 88 | 96 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("can insert the text which be choosed", function() {
spyOn(callbacks, "beforeInsert").and.callThrough();
triggerAtwhoAt($inputor);
return expect(callbacks.beforeInsert).toHaveBeenCalled();
});
it("can adjust offset before reposition", function() {
spyOn... | it "can insert the text which be choosed", ->
spyOn(callbacks, "beforeInsert").and.callThrough()
triggerAtwhoAt $inputor
expect(callbacks.beforeInsert).toHaveBeenCalled()
it "can adjust offset before reposition", ->
spyOn(callbacks, "beforeReposition").and.callThrough()
triggerAtwhoAt $inputor
... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 88 | 96 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:3:completion | completion | it "can insert the text which be choosed", ->
spyOn(callbacks, "beforeInsert").and.callThrough()
triggerAtwhoAt $inputor
expect(callbacks.beforeInsert).toHaveBeenCalled() | it "can adjust offset before reposition", ->
spyOn(callbacks, "beforeReposition").and.callThrough()
triggerAtwhoAt $inputor
expect(callbacks.beforeReposition).toHaveBeenCalled() | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 1c1900ac52430ace4e772de533303db43743dca8 | 5,250 | https://github.com/ichord/At.js/blob/1c1900ac52430ace4e772de533303db43743dca8/spec/javascripts/default_callbacks.spec.coffee | 88 | 96 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:raw_corpus | raw_corpus | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532 | 5,250 | https://github.com/ichord/At.js/blob/4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 | ||
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
... | var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var callbacks, text;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho({
at: "@",
data: fixtures["names"]
});
return app = ... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532 | 5,250 | https://github.com/ichord/At.js/blob/4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $inputor, app;
$inputor = null;
app = null;
describe("default callbacks", function() {
var callbacks, text;
callbacks = null;
text = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#inputor").atwho({
at: "@",
... | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532 | 5,250 | https://github.com/ichord/At.js/blob/4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:1:completion | completion | $inputor = null
app = null
describe "default callbacks", ->
callbacks = null
text = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor").atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
beforeEach ->
text = $.trim $inputor.text()
callbacks = $.fn.atwho.... | it "refactor the data before save", ->
items = callbacks.beforeSave.call(app, fixtures["names"])
expect(items).toContain({"name":"Jacob"})
expect(items).toContain({"name":"Isabella"})
it "should match the key word following @", ->
query = callbacks.matcher.call(app, "@", text)
expect(query).toBe(... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532 | 5,250 | https://github.com/ichord/At.js/blob/4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532/spec/javascripts/default_callbacks.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/default_callbacks.spec.coffee:2:raw_corpus | raw_corpus | it "can filter numeric data", ->
numerics = callbacks.beforeSave.call(app, fixtures["numerics"])
numerics = callbacks.filter.call(app, "1", numerics, "name")
expect(numerics).toContain name: 10
it "request data from remote by ajax if set remoteFilter", ->
remote_call = jasmine.createSpy("remote_call"... | CoffeeScript | ichord/At.js | spec/javascripts/default_callbacks.spec.coffee | MIT | 4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532 | 5,250 | https://github.com/ichord/At.js/blob/4673922e4e43ccb85a3f85dbe0d8f4aae8c0a532/spec/javascripts/default_callbacks.spec.coffee | 43 | 86 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.