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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
outsideris/popularconvention:src/batch.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
schedule.scheduleJob descriptionRule, ->
service.findDescription true, ->
# batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule()
archiveRule.hour = [new schedule.Range(0, 23)]
archiveRule.minute = [10]
... | var archiveRule, getOneDayAgo;
schedule.scheduleJob(descriptionRule, function() {
return service.findDescription(true, function() {});
});
// batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule();
archiveRule.hour = [new schedule.Range(0, 23)];
archiveRule.m... | CoffeeScript | JavaScript | outsideris/popularconvention | src/batch.coffee | MIT | 93ae42b3f37162e82e7a5c37c4ff0db534b4befe | 730 | https://github.com/outsideris/popularconvention/blob/93ae42b3f37162e82e7a5c37c4ff0db534b4befe/src/batch.coffee | 51 | 69 |
outsideris/popularconvention:src/batch.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var archiveRule, getOneDayAgo;
schedule.scheduleJob(descriptionRule, function() {
return service.findDescription(true, function() {});
});
// batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule();
archive... | schedule.scheduleJob descriptionRule, ->
service.findDescription true, ->
# batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule()
archiveRule.hour = [new schedule.Range(0, 23)]
archiveRule.minute = [10]
schedule.scheduleJob archiveRule, ->
datetime = getOneD... | JavaScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | 93ae42b3f37162e82e7a5c37c4ff0db534b4befe | 730 | https://github.com/outsideris/popularconvention/blob/93ae42b3f37162e82e7a5c37c4ff0db534b4befe/src/batch.coffee | 51 | 69 |
outsideris/popularconvention:src/batch.coffee:2:completion | completion | schedule.scheduleJob descriptionRule, ->
service.findDescription true, ->
# batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule()
archiveRule.hour = [new schedule.Range(0, 23)]
archiveRule.minute = [10]
schedule.scheduleJob archiveRule, -> | datetime = getOneDayAgo()
service.fetchGithubArchive datetime, (err) ->
if err?
logger.error "fetcharchive", {err: err}
else
logger.info 'fetched githubarchive', {datetime: datetime}
getOneDayAgo = ->
moment().add('d', -1).format("YYYY-MM-DD-H") | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | 93ae42b3f37162e82e7a5c37c4ff0db534b4befe | 730 | https://github.com/outsideris/popularconvention/blob/93ae42b3f37162e82e7a5c37c4ff0db534b4befe/src/batch.coffee | 51 | 69 |
outsideris/popularconvention:src/batch.coffee:1:raw_corpus | raw_corpus | # # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = require './service'
helpers = (require './helpers')
http = req... | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | 11baa66e24873ab8404ecdd32b09cdaa66ace8e0 | 730 | https://github.com/outsideris/popularconvention/blob/11baa66e24873ab8404ecdd32b09cdaa66ace8e0/src/batch.coffee | 1 | 50 | ||
outsideris/popularconvention:src/batch.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = requir... | // # service layer
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, archiveDir, descriptionRule, fs, helpers, hljs, http, logger, moment, parser, path, persistence, processRule, schedule, service, spawn, s... | CoffeeScript | JavaScript | outsideris/popularconvention | src/batch.coffee | MIT | 11baa66e24873ab8404ecdd32b09cdaa66ace8e0 | 730 | https://github.com/outsideris/popularconvention/blob/11baa66e24873ab8404ecdd32b09cdaa66ace8e0/src/batch.coffee | 1 | 50 |
outsideris/popularconvention:src/batch.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # service layer
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, archiveDir, descriptionRule, fs, helpers, hljs, http, logger, moment, parser, path... | # # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = require './service'
helpers = (require './helpers')
http = req... | JavaScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | 11baa66e24873ab8404ecdd32b09cdaa66ace8e0 | 730 | https://github.com/outsideris/popularconvention/blob/11baa66e24873ab8404ecdd32b09cdaa66ace8e0/src/batch.coffee | 1 | 50 |
outsideris/popularconvention:src/batch.coffee:1:completion | completion | # # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = require './service'
helpers = (require './helpers')
http = req... | fs.exists archiveDir, (exist) ->
if not exist then fs.mkdirSync archiveDir
# batch to process timetile imported from github archive
processRule = new schedule.RecurrenceRule()
processRule.hour = [new schedule.Range(0, 23)]
processRule.minute = [10, 30, 50]
schedule.scheduleJob processRule, ->
service.processTimel... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | 11baa66e24873ab8404ecdd32b09cdaa66ace8e0 | 730 | https://github.com/outsideris/popularconvention/blob/11baa66e24873ab8404ecdd32b09cdaa66ace8e0/src/batch.coffee | 1 | 50 |
outsideris/popularconvention:src/batch.coffee:1:raw_corpus | raw_corpus | # # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = require './service'
helpers = (require './helpers')
http = req... | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 1 | 50 | ||
outsideris/popularconvention:src/batch.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = requir... | // # service layer
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, archiveDir, descriptionRule, fs, helpers, hljs, http, logger, parser, path, persistence, processRule, schedule, service, spawn, summarize... | CoffeeScript | JavaScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 1 | 50 |
outsideris/popularconvention:src/batch.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # service layer
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var _, archiveDir, descriptionRule, fs, helpers, hljs, http, logger, parser, path, persis... | # # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = require './service'
helpers = (require './helpers')
http = req... | JavaScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 1 | 50 |
outsideris/popularconvention:src/batch.coffee:1:completion | completion | # # service layer
#
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
logger = (require './helpers').logger
schedule = require 'node-schedule'
service = require './service'
helpers = (require './helpers')
http = req... | fs.exists archiveDir, (exist) ->
if not exist then fs.mkdirSync archiveDir
# batch to process timetile imported from github archive
processRule = new schedule.RecurrenceRule()
processRule.hour = [new schedule.Range(0, 23)]
processRule.minute = [10, 30, 50]
schedule.scheduleJob processRule, ->
service.processTimel... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 1 | 50 |
outsideris/popularconvention:src/batch.coffee:2:raw_corpus | raw_corpus | schedule.scheduleJob descriptionRule, ->
service.findDescription true, ->
# batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule()
archiveRule.hour = [new schedule.Range(0, 23)]
archiveRule.minute = [10]
schedule.scheduleJob archiveRule, ->
datetime = getYest... | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 51 | 73 | ||
outsideris/popularconvention:src/batch.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
schedule.scheduleJob descriptionRule, ->
service.findDescription true, ->
# batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule()
archiveRule.hour = [new schedule.Range(0, 23)]
archiveRule.minute = [10]
... | var archiveRule, getYesterday;
schedule.scheduleJob(descriptionRule, function() {
return service.findDescription(true, function() {});
});
// batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule();
archiveRule.hour = [new schedule.Range(0, 23)];
archiveRule.m... | CoffeeScript | JavaScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 51 | 73 |
outsideris/popularconvention:src/batch.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var archiveRule, getYesterday;
schedule.scheduleJob(descriptionRule, function() {
return service.findDescription(true, function() {});
});
// batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule();
archive... | schedule.scheduleJob descriptionRule, ->
service.findDescription true, ->
# batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule()
archiveRule.hour = [new schedule.Range(0, 23)]
archiveRule.minute = [10]
schedule.scheduleJob archiveRule, ->
datetime = getYest... | JavaScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 51 | 73 |
outsideris/popularconvention:src/batch.coffee:2:completion | completion | schedule.scheduleJob descriptionRule, ->
service.findDescription true, ->
# batch to fetch json file from githubarchive and import to mongoDB
archiveRule = new schedule.RecurrenceRule()
archiveRule.hour = [new schedule.Range(0, 23)]
archiveRule.minute = [10]
schedule.scheduleJob archiveRule, ->
datetime = getYest... | if err?
logger.error "fetcharchive", {err: err}
else
logger.info 'fetched githubarchive', {datetime: datetime}
getYesterday = ->
now = new Date
year = now.getFullYear()
month = "0#{now.getMonth() + 1}".slice(-2)
date = "0#{now.getDate() - 1}".slice(-2)
time = now.toLocaleTimeString().substr(0... | CoffeeScript | CoffeeScript | outsideris/popularconvention | src/batch.coffee | MIT | ae97e12345333c7c3623476dd0ef29fea80353f0 | 730 | https://github.com/outsideris/popularconvention/blob/ae97e12345333c7c3623476dd0ef29fea80353f0/src/batch.coffee | 51 | 73 |
AriaMinaei/pretty-error:test/ParsedError.coffee:1:raw_corpus | raw_corpus | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->
describe "constructor()", ->
it "should accept Err... | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 6 | 55 | ||
AriaMinaei/pretty-error:test/ParsedError.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->... | var error;
error = function(what) {
var e;
if (typeof what === 'string') {
return error(function() {
throw Error(what);
});
} else if (what instanceof Function) {
try {
what();
return null;
} catch (error1) {
e = error1;
return e;
}
} else {
throw Error("ba... | CoffeeScript | JavaScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 6 | 55 |
AriaMinaei/pretty-error:test/ParsedError.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var error;
error = function(what) {
var e;
if (typeof what === 'string') {
return error(function() {
throw Error(what);
});
} else if (what instanceof Function) {
try {
what();
return null;
} catch (error1) {
e = error... | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->
describe "constructor()", ->
it "should accept Err... | JavaScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 6 | 55 |
AriaMinaei/pretty-error:test/ParsedError.coffee:1:completion | completion | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->
describe "constructor()", ->
it "should accept Err... | describe "message", ->
it "should return the original error message", ->
e = new ParsedError error 'a'
e.message.should.equal 'a'
describe "multiline message", ->
it "should return the original error message", ->
e = new ParsedError error 'a \n b \n c'
e.message.should.equal 'a \n b \... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 6 | 55 |
AriaMinaei/pretty-error:test/ParsedError.coffee:2:raw_corpus | raw_corpus | it.skip "should return original error arguments", ->
e = new ParsedError error -> a.b = c
e.arguments.should.be.eql ['a']
describe "stack", ->
it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.should.be.equal e.error.stack
describe "trace", ->
... | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 56 | 87 | ||
AriaMinaei/pretty-error:test/ParsedError.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it.skip "should return original error arguments", ->
e = new ParsedError error -> a.b = c
e.arguments.should.be.eql ['a']
describe "stack", ->
it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.... | it.skip("should return original error arguments", function() {
var e;
e = new ParsedError(error(function() {
return a.b = c;
}));
return e.arguments.should.be.eql(['a']);
});
describe("stack", function() {
return it("should return original error stack", function() {
var e;
e = new ParsedError(err... | CoffeeScript | JavaScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 56 | 87 |
AriaMinaei/pretty-error:test/ParsedError.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it.skip("should return original error arguments", function() {
var e;
e = new ParsedError(error(function() {
return a.b = c;
}));
return e.arguments.should.be.eql(['a']);
});
describe("stack", function() {
return it("should return original error stac... | it.skip "should return original error arguments", ->
e = new ParsedError error -> a.b = c
e.arguments.should.be.eql ['a']
describe "stack", ->
it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.should.be.equal e.error.stack
describe "trace", ->
... | JavaScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 56 | 87 |
AriaMinaei/pretty-error:test/ParsedError.coffee:2:completion | completion | it.skip "should return original error arguments", ->
e = new ParsedError error -> a.b = c
e.arguments.should.be.eql ['a']
describe "stack", ->
it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.should.be.equal e.error.stack
describe "trace", ->
... | 'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'packageName', 'shortenedPath', 'shortenedAddr'
item.path.should.equal module.filename.replace(/[\\]+/g, '/')
item.line.should.be.a 'number'
item.col.should.be.a 'number'
describe "_rectifyPath()", ->
... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ae492ce4faf051741f17b689b5b4d62f41b9ccf6 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ae492ce4faf051741f17b689b5b4d62f41b9ccf6/test/ParsedError.coffee | 56 | 87 |
AriaMinaei/pretty-error:test/ParsedError.coffee:1:raw_corpus | raw_corpus | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->
describe "constructor()", ->
it "should accept Err... | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 6 | 55 | ||
AriaMinaei/pretty-error:test/ParsedError.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->... | var error;
error = function(what) {
var e;
if (typeof what === 'string') {
return error(function() {
throw Error(what);
});
} else if (what instanceof Function) {
try {
what();
return null;
} catch (error1) {
e = error1;
return e;
}
} else {
throw Error("ba... | CoffeeScript | JavaScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 6 | 55 |
AriaMinaei/pretty-error:test/ParsedError.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var error;
error = function(what) {
var e;
if (typeof what === 'string') {
return error(function() {
throw Error(what);
});
} else if (what instanceof Function) {
try {
what();
return null;
} catch (error1) {
e = error... | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->
describe "constructor()", ->
it "should accept Err... | JavaScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 6 | 55 |
AriaMinaei/pretty-error:test/ParsedError.coffee:1:completion | completion | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
describe "ParsedError", ->
describe "constructor()", ->
it "should accept Err... | describe "message", ->
it "should return the original error message", ->
e = new ParsedError error 'a'
e.message.should.equal 'a'
describe "kind", ->
it "should return 'Error' for normal error", ->
e = new ParsedError error 'a'
e.kind.should.equal 'Error'
it "should recognize 'Re... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 6 | 55 |
AriaMinaei/pretty-error:test/ParsedError.coffee:2:raw_corpus | raw_corpus | it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.should.be.equal e.error.stack
describe "trace", ->
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item... | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 56 | 82 | ||
AriaMinaei/pretty-error:test/ParsedError.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.should.be.equal e.error.stack
describe "trace", ->
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b... | it("should return original error stack", function() {
var e;
e = new ParsedError(error(function() {
return a.b = c;
}));
return e.stack.should.be.equal(e.error.stack);
});
describe("trace", function() {
return it("should include correct information about each trace item", function() {
var e, item;
... | CoffeeScript | JavaScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 56 | 82 |
AriaMinaei/pretty-error:test/ParsedError.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should return original error stack", function() {
var e;
e = new ParsedError(error(function() {
return a.b = c;
}));
return e.stack.should.be.equal(e.error.stack);
});
describe("trace", function() {
return it("should include correct information a... | it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.should.be.equal e.error.stack
describe "trace", ->
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item... | JavaScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 56 | 82 |
AriaMinaei/pretty-error:test/ParsedError.coffee:2:completion | completion | it "should return original error stack", ->
e = new ParsedError error -> a.b = c
e.stack.should.be.equal e.error.stack
describe "trace", ->
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item... | 'line', 'jsCol', 'jsLine'
'packageName', 'shortenedPath', 'shortenedAddr'
item.path.should.equal module.filename.replace(/[\\]+/g, '/')
item.line.should.be.a 'number'
item.col.should.be.a 'number'
describe "_rectifyPath()", ->
it "should work", ->
ParsedError::_rectifyPath('F:/a... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | test/ParsedError.coffee | MIT | ba54889c642f3e2a56eb5e657c09c6cac6e4712e | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/ba54889c642f3e2a56eb5e657c09c6cac6e4712e/test/ParsedError.coffee | 56 | 82 |
huacnlee/social-share-button:app/assets/javascripts/social-share-button/wechat.coffee:1:raw_corpus | raw_corpus | #= require jquery.qrcode.min
window.SocialShareWeChatButton =
init: (opts={}) ->
$wDialog = "<div id='ss-wechat-dialog' class='ss-wechat-dialog'>
<div class='wechat-popup-header'>
<span>#{opts.header}</span>
<a href='#' onclick='return false;' class='wech... | CoffeeScript | huacnlee/social-share-button | app/assets/javascripts/social-share-button/wechat.coffee | MIT | 0a7949f7f6883c81747a43d39f78122dd6b80dd2 | 581 | https://github.com/huacnlee/social-share-button/blob/0a7949f7f6883c81747a43d39f78122dd6b80dd2/app/assets/javascripts/social-share-button/wechat.coffee | 1 | 44 | ||
huacnlee/social-share-button:app/assets/javascripts/social-share-button/wechat.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#= require jquery.qrcode.min
window.SocialShareWeChatButton =
init: (opts={}) ->
$wDialog = "<div id='ss-wechat-dialog' class='ss-wechat-dialog'>
<div class='wechat-popup-header'>
<span>#{opts.header}</span>
... | //= require jquery.qrcode.min
window.SocialShareWeChatButton = {
init: function(opts = {}) {
var $wDialog;
$wDialog = `<div id='ss-wechat-dialog' class='ss-wechat-dialog'> <div class='wechat-popup-header'> <span>${opts.header}</span> <a href='#' onclick='return false;' class='wechat-popup-close'>×</a> </div> ... | CoffeeScript | JavaScript | huacnlee/social-share-button | app/assets/javascripts/social-share-button/wechat.coffee | MIT | 0a7949f7f6883c81747a43d39f78122dd6b80dd2 | 581 | https://github.com/huacnlee/social-share-button/blob/0a7949f7f6883c81747a43d39f78122dd6b80dd2/app/assets/javascripts/social-share-button/wechat.coffee | 1 | 44 |
huacnlee/social-share-button:app/assets/javascripts/social-share-button/wechat.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//= require jquery.qrcode.min
window.SocialShareWeChatButton = {
init: function(opts = {}) {
var $wDialog;
$wDialog = `<div id='ss-wechat-dialog' class='ss-wechat-dialog'> <div class='wechat-popup-header'> <span>${opts.header}</span> <a href='#' onclick='... | #= require jquery.qrcode.min
window.SocialShareWeChatButton =
init: (opts={}) ->
$wDialog = "<div id='ss-wechat-dialog' class='ss-wechat-dialog'>
<div class='wechat-popup-header'>
<span>#{opts.header}</span>
<a href='#' onclick='return false;' class='wech... | JavaScript | CoffeeScript | huacnlee/social-share-button | app/assets/javascripts/social-share-button/wechat.coffee | MIT | 0a7949f7f6883c81747a43d39f78122dd6b80dd2 | 581 | https://github.com/huacnlee/social-share-button/blob/0a7949f7f6883c81747a43d39f78122dd6b80dd2/app/assets/javascripts/social-share-button/wechat.coffee | 1 | 44 |
huacnlee/social-share-button:app/assets/javascripts/social-share-button/wechat.coffee:1:completion | completion | #= require jquery.qrcode.min
window.SocialShareWeChatButton =
init: (opts={}) ->
$wDialog = "<div id='ss-wechat-dialog' class='ss-wechat-dialog'>
<div class='wechat-popup-header'>
<span>#{opts.header}</span>
<a href='#' onclick='return false;' class='wech... | qrcode: (opts={}) ->
unless $("#ss-wechat-dialog").length
@init(opts)
@bindEvents()
$wBody = $('#ss-wechat-dialog-qr')
$wBody.empty()
$wBody.qrcode
width: 200
height: 200
text: opts.url
$wContainer = $("#ss-wechat-dialog")
top = ($(window).height() - $w... | CoffeeScript | CoffeeScript | huacnlee/social-share-button | app/assets/javascripts/social-share-button/wechat.coffee | MIT | 0a7949f7f6883c81747a43d39f78122dd6b80dd2 | 581 | https://github.com/huacnlee/social-share-button/blob/0a7949f7f6883c81747a43d39f78122dd6b80dd2/app/assets/javascripts/social-share-button/wechat.coffee | 1 | 44 |
yakyak/yakyak:src/ui/views/convadd.coffee:2:raw_corpus | raw_corpus | mayRestoreInitialValues = (models) ->
# If there is an initial value we set it an then invalidate it
{convsettings} = models
initialName = convsettings.getInitialName()
if initialName != null
setTimeout ->
name = document.querySelector '.name-input'
name.value = initialNa... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 6 | 24 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mayRestoreInitialValues = (models) ->
# If there is an initial value we set it an then invalidate it
{convsettings} = models
initialName = convsettings.getInitialName()
if initialName != null
setTimeout ->
name = document.query... | var mayRestoreInitialValues;
mayRestoreInitialValues = function(models) {
var convsettings, initialName, initialSearchQuery;
// If there is an initial value we set it an then invalidate it
({convsettings} = models);
initialName = convsettings.getInitialName();
if (initialName !== null) {
setTimeout(funct... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 6 | 24 |
yakyak/yakyak:src/ui/views/convadd.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var mayRestoreInitialValues;
mayRestoreInitialValues = function(models) {
var convsettings, initialName, initialSearchQuery;
// If there is an initial value we set it an then invalidate it
({convsettings} = models);
initialName = convsettings.getInitialNam... | mayRestoreInitialValues = (models) ->
# If there is an initial value we set it an then invalidate it
{convsettings} = models
initialName = convsettings.getInitialName()
if initialName != null
setTimeout ->
name = document.querySelector '.name-input'
name.value = initialNa... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 6 | 24 |
yakyak/yakyak:src/ui/views/convadd.coffee:2:completion | completion | mayRestoreInitialValues = (models) ->
# If there is an initial value we set it an then invalidate it
{convsettings} = models
initialName = convsettings.getInitialName()
if initialName != null
setTimeout ->
name = document.querySelector '.name-input'
name.value = initialNa... | initialSearchQuery = convsettings.getInitialSearchQuery()
if initialSearchQuery != null
setTimeout ->
search = document.querySelector '.search-input'
search.value = initialSearchQuery if search
, 1
setTimeout ->
group = document.querySelector '.group'
grou... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 6 | 24 |
yakyak/yakyak:src/ui/views/convadd.coffee:3:raw_corpus | raw_corpus | inputSetValue = (sel, val) ->
setTimeout ->
el = document.querySelector sel
el.value = val if el != null
, 1
null | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 26 | 31 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
inputSetValue = (sel, val) ->
setTimeout ->
el = document.querySelector sel
el.value = val if el != null
, 1
null
``` | var inputSetValue;
inputSetValue = function(sel, val) {
setTimeout(function() {
var el;
el = document.querySelector(sel);
if (el !== null) {
return el.value = val;
}
}, 1);
return null;
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 26 | 31 |
yakyak/yakyak:src/ui/views/convadd.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var inputSetValue;
inputSetValue = function(sel, val) {
setTimeout(function() {
var el;
el = document.querySelector(sel);
if (el !== null) {
return el.value = val;
}
}, 1);
return null;
};
``` | inputSetValue = (sel, val) ->
setTimeout ->
el = document.querySelector sel
el.value = val if el != null
, 1
null | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 26 | 31 |
yakyak/yakyak:src/ui/views/convadd.coffee:3:completion | completion | inputSetValue = (sel, val) ->
setTimeout ->
el = document.querySelector sel | el.value = val if el != null
, 1
null | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 26 | 31 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:raw_corpus | raw_corpus | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edit:Conversation edit'
else
h1 i18n.__ ... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 33 | 82 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edi... | module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
class: 'convadd'
}, function() {
var style;
... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
... | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edit:Conversation edit'
else
h1 i18n.__ ... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:completion | completion | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edit:Conversation edit'
else
h1 i18n.__ ... | div class: 'input', ->
div ->
input
class: 'search-input'
placeholder: i18n.__ 'conversation.search:Search people'
onkeyup: (e) ->
chilledaction 'searchentities', e.currentTarget.value, 7
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | cid = r?.id?.chat_id
ctLocal = ''
ctInfo = ''
console.debug('meme', r.properties, entity[cid])
if entity[cid]?.type == 0
ctLocal = 'ct-local'
ctInfo = 'Internal Contact' + "\r\n"
if (r.properties?.ema... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 83 | 132 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | cid = r?.id?.chat_id
ctLocal = ''
ctInfo = ''
console.debug('meme', r.properties, entity[cid])
if entity[cid]?.type == 0
ctLocal = 'ct-local'
ctInfo = 'Internal Contact' + "\r\n"
if (r.properties?.ema... | ctLocal = ''
ctInfo = ''
if entity[cid]?.type == 0
ctLocal = 'ct-local'
ctInfo = 'Internal Contact' + "\r\n"
if (r.properties?.emails?[0] ? entity[cid]?.emails?[0])
ctInfo += (r.properties?.emails?[0] ? entity[ci... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 83 | 132 |
yakyak/yakyak:src/ui/views/convadd.coffee:6:raw_corpus | raw_corpus | , onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
span i18n.__('conversation.delete:Delete conversation')
else
div class:'button'
, title: i18n.__('conversation.leave:Leave conversation')... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 133 | 152 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:6:completion | completion | , onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
span i18n.__('conversation.delete:Delete conversation')
else
div class:'button'
, title: i18n.__('conversation.leave:Leave conversation')... | div class:'validate', ->
disabled = null
if convsettings.selectedEntities.length <= 0
disabled = disabled: 'disabled'
div disabled, class:'button'
, onclick:onclickaction('saveconversation'), ->
span class:'material-icons', 'done'
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/convadd.coffee | 133 | 152 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | cid = r?.id?.chat_id
email = (r.properties?.email?[0] ? entity[cid]?.emails?[0]);
li class: 'selected', title: email, ->
drawAvatar cid, viewstate, entity
, (r.properties?.photo_url ? entity[cid]?.photo_url)
, email
... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a71b9fe77d7bcc856690ae3a0d907818ffe81987 | 3,762 | https://github.com/yakyak/yakyak/blob/a71b9fe77d7bcc856690ae3a0d907818ffe81987/src/ui/views/convadd.coffee | 83 | 131 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | cid = r?.id?.chat_id
email = (r.properties?.email?[0] ? entity[cid]?.emails?[0]);
li class: 'selected', title: email, ->
drawAvatar cid, viewstate, entity
, (r.properties?.photo_url ? entity[cid]?.photo_url)
, email
... | if editing
div class:'leave', ->
if conversation?.type?.indexOf('ONE_TO_ONE') > 0
div class:'button'
, title: i18n.__('conversation.delete:Delete conversation')
, onclick:onclickaction('deleteconv'), ->
span ... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a71b9fe77d7bcc856690ae3a0d907818ffe81987 | 3,762 | https://github.com/yakyak/yakyak/blob/a71b9fe77d7bcc856690ae3a0d907818ffe81987/src/ui/views/convadd.coffee | 83 | 131 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | cid = r?.id?.chat_id
email = (r.properties?.email?[0] ? entity[cid]?.email?[0]);
li class: 'selected', title: email, ->
drawAvatar cid, viewstate, entity
, (r.properties?.photo_url ? entity[cid]?.photo_url)
, email
... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 2b2f88284cfe741d312f7333019bfd6fccb39145 | 3,762 | https://github.com/yakyak/yakyak/blob/2b2f88284cfe741d312f7333019bfd6fccb39145/src/ui/views/convadd.coffee | 83 | 131 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | cid = r?.id?.chat_id
email = (r.properties?.email?[0] ? entity[cid]?.email?[0]);
li class: 'selected', title: email, ->
drawAvatar cid, viewstate, entity
, (r.properties?.photo_url ? entity[cid]?.photo_url)
, email
... | if editing
div class:'leave', ->
if conversation?.type?.indexOf('ONE_TO_ONE') > 0
div class:'button'
, title: i18n.__('conversation.delete:Delete conversation')
, onclick:onclickaction('deleteconv'), ->
span ... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 2b2f88284cfe741d312f7333019bfd6fccb39145 | 3,762 | https://github.com/yakyak/yakyak/blob/2b2f88284cfe741d312f7333019bfd6fccb39145/src/ui/views/convadd.coffee | 83 | 131 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | cid = r?.id?.chat_id
ctLocal = ''
ctInfo = ''
if entity[cid]?.type == 0
ctLocal = 'ct-local'
ctInfo = 'Internal Contact' + "\r\n"
if (r.properties?.email?[0] ? entity[cid]?.email?[0])
ctInfo += (r... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | ac968a09e55ba4ea25dffb7aa42a1af30e46274b | 3,762 | https://github.com/yakyak/yakyak/blob/ac968a09e55ba4ea25dffb7aa42a1af30e46274b/src/ui/views/convadd.coffee | 83 | 132 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | cid = r?.id?.chat_id
ctLocal = ''
ctInfo = ''
if entity[cid]?.type == 0
ctLocal = 'ct-local'
ctInfo = 'Internal Contact' + "\r\n"
if (r.properties?.email?[0] ? entity[cid]?.email?[0])
ctInfo += (r... | ctInfo = 'Internal Contact' + "\r\n"
if (r.properties?.email?[0] ? entity[cid]?.email?[0])
ctInfo += (r.properties?.email?[0] ? entity[cid]?.email?[0]) + "\r\n"
if r.properties?.organization
ctInfo += r.properties?.organization + "\r\n"
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | ac968a09e55ba4ea25dffb7aa42a1af30e46274b | 3,762 | https://github.com/yakyak/yakyak/blob/ac968a09e55ba4ea25dffb7aa42a1af30e46274b/src/ui/views/convadd.coffee | 83 | 132 |
yakyak/yakyak:src/ui/views/convadd.coffee:6:raw_corpus | raw_corpus | div class:'button'
, title: i18n.__('conversation.leave:Leave conversation')
, onclick:onclickaction('leaveconv'), ->
span class:'material-icons', 'close'
span i18n.__('conversation.leave:Leave conversation')
div class:'val... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | ac968a09e55ba4ea25dffb7aa42a1af30e46274b | 3,762 | https://github.com/yakyak/yakyak/blob/ac968a09e55ba4ea25dffb7aa42a1af30e46274b/src/ui/views/convadd.coffee | 133 | 148 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
div class:'button'
, title: i18n.__('conversation.leave:Leave conversation')
, onclick:onclickaction('leaveconv'), ->
span class:'material-icons', 'close'
span i18n.__('conver... | div({
class: 'button',
title: i18n.__('conversation.leave:Leave conversation'),
onclick: onclickaction('leaveconv')
}, function() {
span({
class: 'material-icons'
}, 'close');
return span(i18n.__('conversation.leave:Leave conversation'));
});
div({
class: 'validate'
}, function() {
var disabled;
... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | ac968a09e55ba4ea25dffb7aa42a1af30e46274b | 3,762 | https://github.com/yakyak/yakyak/blob/ac968a09e55ba4ea25dffb7aa42a1af30e46274b/src/ui/views/convadd.coffee | 133 | 148 |
yakyak/yakyak:src/ui/views/convadd.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
div({
class: 'button',
title: i18n.__('conversation.leave:Leave conversation'),
onclick: onclickaction('leaveconv')
}, function() {
span({
class: 'material-icons'
}, 'close');
return span(i18n.__('conversation.leave:Leave conversation'));
});
div({... | div class:'button'
, title: i18n.__('conversation.leave:Leave conversation')
, onclick:onclickaction('leaveconv'), ->
span class:'material-icons', 'close'
span i18n.__('conversation.leave:Leave conversation')
div class:'val... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | ac968a09e55ba4ea25dffb7aa42a1af30e46274b | 3,762 | https://github.com/yakyak/yakyak/blob/ac968a09e55ba4ea25dffb7aa42a1af30e46274b/src/ui/views/convadd.coffee | 133 | 148 |
yakyak/yakyak:src/ui/views/convadd.coffee:6:completion | completion | div class:'button'
, title: i18n.__('conversation.leave:Leave conversation')
, onclick:onclickaction('leaveconv'), ->
span class:'material-icons', 'close'
span i18n.__('conversation.leave:Leave conversation')
div class:'val... | if convsettings.selectedEntities.length <= 0
disabled = disabled: 'disabled'
div disabled, class:'button'
, onclick:onclickaction('saveconversation'), ->
span class:'material-icons', 'done'
span i18n.__ "actions.ok:OK"
mayRestoreInitialVa... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | ac968a09e55ba4ea25dffb7aa42a1af30e46274b | 3,762 | https://github.com/yakyak/yakyak/blob/ac968a09e55ba4ea25dffb7aa42a1af30e46274b/src/ui/views/convadd.coffee | 133 | 148 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | cid = r?.id?.chat_id
li class: 'selected', ->
drawAvatar(cid, viewstate, entity)
p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 39e8c438d6f6401e39be9bb77e20643e0401c3e7 | 3,762 | https://github.com/yakyak/yakyak/blob/39e8c438d6f6401e39be9bb77e20643e0401c3e7/src/ui/views/convadd.coffee | 83 | 126 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | cid = r?.id?.chat_id
li class: 'selected', ->
drawAvatar(cid, viewstate, entity)
p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
... | div class:'button'
, title: i18n.__('conversation.delete:Delete conversation')
, onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
span i18n.__('conversation.delete:Delete conversation')
el... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 39e8c438d6f6401e39be9bb77e20643e0401c3e7 | 3,762 | https://github.com/yakyak/yakyak/blob/39e8c438d6f6401e39be9bb77e20643e0401c3e7/src/ui/views/convadd.coffee | 83 | 126 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:raw_corpus | raw_corpus | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edit'
else
h1 i18n.__ 'conversation.new'... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/convadd.coffee | 33 | 82 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edi... | module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
class: 'convadd'
}, function() {
var style;
... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
... | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edit'
else
h1 i18n.__ 'conversation.new'... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:completion | completion | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'conversation.edit'
else
h1 i18n.__ 'conversation.new'... | div class: 'input', ->
div ->
input
class: 'search-input'
placeholder: i18n.__ 'conversation.search'
onkeyup: (e) ->
chilledaction 'searchentities', e.currentTarget.value, 7
action 'co... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | cid = r?.id?.chat_id
li class: 'selected', ->
drawAvatar(cid, viewstate, entity)
p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/convadd.coffee | 83 | 124 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | cid = r?.id?.chat_id
li class: 'selected', ->
drawAvatar(cid, viewstate, entity)
p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
... | if conversation?.type?.indexOf('ONE_TO_ONE') > 0
div class:'button', title: i18n.__('conversation.delete')
, onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
span i18n.__('conversation.delete')
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/convadd.coffee | 83 | 124 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:raw_corpus | raw_corpus | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'Conversation edit'
else
h1 i18n.__ 'New conversation'... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a39f0e9e0ff32ba2f891b57d033961c3161b801e | 3,762 | https://github.com/yakyak/yakyak/blob/a39f0e9e0ff32ba2f891b57d033961c3161b801e/src/ui/views/convadd.coffee | 33 | 82 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'Conversation edi... | module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
class: 'convadd'
}, function() {
var style;
... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a39f0e9e0ff32ba2f891b57d033961c3161b801e | 3,762 | https://github.com/yakyak/yakyak/blob/a39f0e9e0ff32ba2f891b57d033961c3161b801e/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
... | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'Conversation edit'
else
h1 i18n.__ 'New conversation'... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a39f0e9e0ff32ba2f891b57d033961c3161b801e | 3,762 | https://github.com/yakyak/yakyak/blob/a39f0e9e0ff32ba2f891b57d033961c3161b801e/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:completion | completion | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing
h1 i18n.__ 'Conversation edit'
else
h1 i18n.__ 'New conversation'... | div class: 'input', ->
div ->
input
class: 'search-input'
placeholder: i18n.__ 'Search people'
onkeyup: (e) ->
chilledaction 'searchentities', e.currentTarget.value, 7
action 'conversa... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a39f0e9e0ff32ba2f891b57d033961c3161b801e | 3,762 | https://github.com/yakyak/yakyak/blob/a39f0e9e0ff32ba2f891b57d033961c3161b801e/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | cid = r?.id?.chat_id
li class: 'selected', ->
drawAvatar(cid, viewstate, entity)
p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a39f0e9e0ff32ba2f891b57d033961c3161b801e | 3,762 | https://github.com/yakyak/yakyak/blob/a39f0e9e0ff32ba2f891b57d033961c3161b801e/src/ui/views/convadd.coffee | 83 | 124 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | cid = r?.id?.chat_id
li class: 'selected', ->
drawAvatar(cid, viewstate, entity)
p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
... | if conversation?.type?.indexOf('ONE_TO_ONE') > 0
div class:'button', title: i18n.__('Delete conversation')
, onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
span i18n.__('Delete conversation')
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | a39f0e9e0ff32ba2f891b57d033961c3161b801e | 3,762 | https://github.com/yakyak/yakyak/blob/a39f0e9e0ff32ba2f891b57d033961c3161b801e/src/ui/views/convadd.coffee | 83 | 124 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:raw_corpus | raw_corpus | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing then h1 'Conversation edit' else h1 'New conversation'
style = {}
if not convset... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 224a39ccdfe55b11b93940c637756c5357ce2e26 | 3,762 | https://github.com/yakyak/yakyak/blob/224a39ccdfe55b11b93940c637756c5357ce2e26/src/ui/views/convadd.coffee | 33 | 82 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing then h1 'Conversation edit' else h1 'New... | module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
class: 'convadd'
}, function() {
var style;
... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 224a39ccdfe55b11b93940c637756c5357ce2e26 | 3,762 | https://github.com/yakyak/yakyak/blob/224a39ccdfe55b11b93940c637756c5357ce2e26/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = view(function(models) {
var conv, conversation, convsettings, editing, entity, viewstate;
({viewstate, convsettings, entity, conv} = models);
editing = convsettings.id !== null;
conversation = conv[viewstate.selectedConv];
return div({
... | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing then h1 'Conversation edit' else h1 'New conversation'
style = {}
if not convset... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 224a39ccdfe55b11b93940c637756c5357ce2e26 | 3,762 | https://github.com/yakyak/yakyak/blob/224a39ccdfe55b11b93940c637756c5357ce2e26/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:completion | completion | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing then h1 'Conversation edit' else h1 'New conversation'
style = {}
if not convset... | class: 'search-input'
placeholder:'Search people'
onkeyup: (e) ->
chilledaction 'searchentities', e.currentTarget.value, 7
action 'conversationquery', e.currentTarget.value, 7
div class: 'input', ->
div ->
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 224a39ccdfe55b11b93940c637756c5357ce2e26 | 3,762 | https://github.com/yakyak/yakyak/blob/224a39ccdfe55b11b93940c637756c5357ce2e26/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
convsettings.searchedEntities.forEach (r) ->
cid = r?.id?.chat_id
if unique(r) in selected_ids... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 224a39ccdfe55b11b93940c637756c5357ce2e26 | 3,762 | https://github.com/yakyak/yakyak/blob/224a39ccdfe55b11b93940c637756c5357ce2e26/src/ui/views/convadd.coffee | 83 | 121 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
convsettings.searchedEntities.forEach (r) ->
cid = r?.id?.chat_id
if unique(r) in selected_ids... | div class:'button', title:'Delete conversation'
, onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
span 'Delete conversation'
else
div class:'button', title:'Leave conversation'
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 224a39ccdfe55b11b93940c637756c5357ce2e26 | 3,762 | https://github.com/yakyak/yakyak/blob/224a39ccdfe55b11b93940c637756c5357ce2e26/src/ui/views/convadd.coffee | 83 | 121 |
yakyak/yakyak:src/ui/views/convadd.coffee:6:raw_corpus | raw_corpus | drawInitials = (entity, cid) ->
entity.needEntity(cid)
initials = initialsof entity[cid]
div class:'initials', initials | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/views/convadd.coffee | 123 | 126 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
drawInitials = (entity, cid) ->
entity.needEntity(cid)
initials = initialsof entity[cid]
div class:'initials', initials
``` | var drawInitials;
drawInitials = function(entity, cid) {
var initials;
entity.needEntity(cid);
initials = initialsof(entity[cid]);
return div({
class: 'initials'
}, initials);
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/views/convadd.coffee | 123 | 126 |
yakyak/yakyak:src/ui/views/convadd.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var drawInitials;
drawInitials = function(entity, cid) {
var initials;
entity.needEntity(cid);
initials = initialsof(entity[cid]);
return div({
class: 'initials'
}, initials);
};
``` | drawInitials = (entity, cid) ->
entity.needEntity(cid)
initials = initialsof entity[cid]
div class:'initials', initials | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/views/convadd.coffee | 123 | 126 |
yakyak/yakyak:src/ui/views/convadd.coffee:6:completion | completion | drawInitials = (entity, cid) ->
entity.needEntity(cid) | initials = initialsof entity[cid]
div class:'initials', initials | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/views/convadd.coffee | 123 | 126 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
convsettings.searchedEntities.forEach (r) ->
cid = r?.id?.chat_id
if unique(r) in selected_ids then retu... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 7436d1cb9c8be24ecc705c776af2e07bf527148e | 3,762 | https://github.com/yakyak/yakyak/blob/7436d1cb9c8be24ecc705c776af2e07bf527148e/src/ui/views/convadd.coffee | 83 | 123 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | p nameof r.properties
, onclick:(e) -> if not editing then action 'deselectentity', r
selected_ids = (unique(c) for c in convsettings.selectedEntities)
convsettings.searchedEntities.forEach (r) ->
cid = r?.id?.chat_id
if unique(r) in selected_ids then retu... | if editing
div class:'leave', ->
if conversation?.type?.indexOf('ONE_TO_ONE') > 0
div class:'button', title:'Delete conversation',
onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
span 'Delete conversation'
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | 7436d1cb9c8be24ecc705c776af2e07bf527148e | 3,762 | https://github.com/yakyak/yakyak/blob/7436d1cb9c8be24ecc705c776af2e07bf527148e/src/ui/views/convadd.coffee | 83 | 123 |
yakyak/yakyak:src/ui/views/convadd.coffee:4:raw_corpus | raw_corpus | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing then h1 'Conversation edit' else h1 'New conversation'
style = {}
if not convsettings.... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | bdc910cc389b85374a9bc287a1848e12bc6d563f | 3,762 | https://github.com/yakyak/yakyak/blob/bdc910cc389b85374a9bc287a1848e12bc6d563f/src/ui/views/convadd.coffee | 33 | 82 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:4:completion | completion | module.exports = view (models) ->
{viewstate, convsettings, entity, conv} = models
editing = convsettings.id != null
conversation = conv[viewstate.selectedConv]
div class: 'convadd', ->
if editing then h1 'Conversation edit' else h1 'New conversation'
style = {}
if not convsettings.... | class: 'search-input'
placeholder:'Search people'
onkeyup: (e) ->
chilledaction 'searchentities', e.currentTarget.value, 7
action 'conversationquery', e.currentTarget.value, 7
div class: 'input', ->
div ->
p -... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | bdc910cc389b85374a9bc287a1848e12bc6d563f | 3,762 | https://github.com/yakyak/yakyak/blob/bdc910cc389b85374a9bc287a1848e12bc6d563f/src/ui/views/convadd.coffee | 33 | 82 |
yakyak/yakyak:src/ui/views/convadd.coffee:5:raw_corpus | raw_corpus | purl += "?sz=50" unless viewstate?.showAnimatedThumbs
img src:fixlink(purl), onerror: ->
this.outerHTML = drawInitials(entity, cid)
else
drawInitials(entity, cid)
p nameof r.properties
, onclick:(e) -> if... | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | bdc910cc389b85374a9bc287a1848e12bc6d563f | 3,762 | https://github.com/yakyak/yakyak/blob/bdc910cc389b85374a9bc287a1848e12bc6d563f/src/ui/views/convadd.coffee | 83 | 128 | ||
yakyak/yakyak:src/ui/views/convadd.coffee:5:completion | completion | purl += "?sz=50" unless viewstate?.showAnimatedThumbs
img src:fixlink(purl), onerror: ->
this.outerHTML = drawInitials(entity, cid)
else
drawInitials(entity, cid)
p nameof r.properties
, onclick:(e) -> if... | , onclick:(e) -> action 'selectentity', r
if editing
div class:'leave', ->
if conversation?.type?.indexOf('ONE_TO_ONE') > 0
div class:'button', title:'Delete conversation',
onclick:onclickaction('deleteconv'), ->
span class:'material-icons', 'close'
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/convadd.coffee | MIT | bdc910cc389b85374a9bc287a1848e12bc6d563f | 3,762 | https://github.com/yakyak/yakyak/blob/bdc910cc389b85374a9bc287a1848e12bc6d563f/src/ui/views/convadd.coffee | 83 | 128 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof arguments[0] isnt 'o... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
... | var skeleton;
skeleton = function() {
var settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
settings = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
// Storage for the functions provided by the user.
ws_handlers = {};
... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
settings = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
// Storage for the f... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof arguments[0] isnt 'o... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof arguments[0] isnt 'o... | context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
if typeof arguments[0] isnt 'object'
context.socket.emit.apply context.socket, arguments
else
for k, v of arguments[0]... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
switch settings['databag']
when 'this' then r.handler.apply(sammy_context.params, [ctx])
when 'param' then r.handler.apply(ctx, [sammy_context.p... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 52 | 84 | ||
mauricemach/zappa:src/client.coffee:2:completion | completion | ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
switch settings['databag']
when 'this' then r.handler.apply(sammy_context.params, [ctx])
when 'param' then r.handler.apply(ctx, [sammy_context.p... | app: app
socket: context.socket
id: context.socket.id
data: data
emit: context.emit
for name, helper of helpers
do (name, helper) ->
ctx[name] = ->
helper.apply(ctx, arguments)
switch settin... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 52 | 84 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | @build = (version, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};") | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 86 | 89 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};")
``` | this.build = function(version, settings) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('settings = null;', `var settings = ${JSON.stringify(settings)};`);
}; | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 86 | 89 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, settings) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('settings = null;', `var settings = ${JSON.stringify(settings)};`);
};
``` | @build = (version, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};") | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 86 | 89 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.