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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:10:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
del: -> 5
ok del() is 5
# Ensure that functions can have a trailing comma in their argument list
``` | ({
del: function() {
return 5;
}
});
ok(del() === 5);
// Ensure that functions can have a trailing comma in their argument list | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 110 | 113 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:10:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
del: function() {
return 5;
}
});
ok(del() === 5);
// Ensure that functions can have a trailing comma in their argument list
``` | del: -> 5
ok del() is 5
# Ensure that functions can have a trailing comma in their argument list | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 110 | 113 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:11:raw_corpus | raw_corpus | mult: (x, mids..., y) ->
x: * n for n in mids
x: * y
ok mult(1, 2,) is 2
ok mult(1, 2, 3,) is 6
ok mult(10,[1..6]...,) is 7200
# Test for inline functions with parentheses and implicit calls. | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 114 | 123 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:11:completion | completion | mult: (x, mids..., y) ->
x: * n for n in mids
x: * y
ok mult(1, 2,) is 2 | ok mult(1, 2, 3,) is 6
ok mult(10,[1..6]...,) is 7200
# Test for inline functions with parentheses and implicit calls. | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 114 | 123 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:13:raw_corpus | raw_corpus | result: combine (-> 1 + 2), 3
ok result is 9
# Test for calls/parens/multiline-chains. | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 125 | 130 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:13:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
result: combine (-> 1 + 2), 3
ok result is 9
# Test for calls/parens/multiline-chains.
``` | ({
result: combine((function() {
return 1 + 2;
}), 3)
});
ok(result === 9);
// Test for calls/parens/multiline-chains. | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 125 | 130 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:13:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
result: combine((function() {
return 1 + 2;
}), 3)
});
ok(result === 9);
// Test for calls/parens/multiline-chains.
``` | result: combine (-> 1 + 2), 3
ok result is 9
# Test for calls/parens/multiline-chains. | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 125 | 130 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:14:raw_corpus | raw_corpus | f: (x) -> x
result: (f 1).toString()
.length
ok result is 1
# Test implicit calls in functions in parens: | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 131 | 138 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:14:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
f: (x) -> x
result: (f 1).toString()
.length
ok result is 1
# Test implicit calls in functions in parens:
``` | ({
f: function(x) {
return x;
},
result: (f(1)).toString().length
});
ok(result === 1);
// Test implicit calls in functions in parens: | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 131 | 138 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:14:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
f: function(x) {
return x;
},
result: (f(1)).toString().length
});
ok(result === 1);
// Test implicit calls in functions in parens:
``` | f: (x) -> x
result: (f 1).toString()
.length
ok result is 1
# Test implicit calls in functions in parens: | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 131 | 138 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:15:raw_corpus | raw_corpus | result: ((val) ->
[].push val
val
)(10)
ok result is 10
# More paren compilation tests: | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 139 | 147 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:15:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
result: ((val) ->
[].push val
val
)(10)
ok result is 10
# More paren compilation tests:
``` | ({
result: (function(val) {
[].push(val);
return val;
})(10)
});
ok(result === 10);
// More paren compilation tests: | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 139 | 147 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:15:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
result: (function(val) {
[].push(val);
return val;
})(10)
});
ok(result === 10);
// More paren compilation tests:
``` | result: ((val) ->
[].push val
val
)(10)
ok result is 10
# More paren compilation tests: | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 139 | 147 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:16:raw_corpus | raw_corpus | reverse: (obj) -> obj.reverse()
ok reverse([1, 2].concat 3).join(' ') is '3 2 1'
# Passing multiple functions without paren-wrapping is legal, and should compile. | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 148 | 151 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:16:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
reverse: (obj) -> obj.reverse()
ok reverse([1, 2].concat 3).join(' ') is '3 2 1'
# Passing multiple functions without paren-wrapping is legal, and should compile.
``` | ({
reverse: function(obj) {
return obj.reverse();
}
});
ok(reverse([1, 2].concat(3)).join(' ') === '3 2 1');
// Passing multiple functions without paren-wrapping is legal, and should compile. | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 148 | 151 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:16:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
reverse: function(obj) {
return obj.reverse();
}
});
ok(reverse([1, 2].concat(3)).join(' ') === '3 2 1');
// Passing multiple functions without paren-wrapping is legal, and should compile.
``` | reverse: (obj) -> obj.reverse()
ok reverse([1, 2].concat 3).join(' ') is '3 2 1'
# Passing multiple functions without paren-wrapping is legal, and should compile. | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 148 | 151 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:18:raw_corpus | raw_corpus | result: sum ->
7 + 9
, ->
1 + 3
ok result is 20 | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 153 | 157 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:18:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
result: sum ->
7 + 9
, ->
1 + 3
ok result is 20
``` | ({
result: sum(function() {
return 7 + 9;
}, function() {
return 1 + 3;
})
});
ok(result === 20); | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 153 | 157 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:18:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
result: sum(function() {
return 7 + 9;
}, function() {
return 1 + 3;
})
});
ok(result === 20);
``` | result: sum ->
7 + 9
, ->
1 + 3
ok result is 20 | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 153 | 157 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_functions.coffee:18:completion | completion | result: sum ->
7 + 9 | , ->
1 + 3
ok result is 20 | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_functions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_functions.coffee | 153 | 157 |
jnordberg/wintersmith:lib/cli/common.coffee:1:raw_corpus | raw_corpus | exports.getOptions = (argv={}, callback) ->
### resolves options with the hierarchy: argv > configfile > defaults
returns a options object ###
# normalize argv
for key, item of defaults
if argv[item.alias]?
argv[key] = argv[item.alias]
workDir = path.resolve (argv.chdir or process.cwd())
log... | CoffeeScript | jnordberg/wintersmith | lib/cli/common.coffee | MIT | f01b0c9862c0cb38dbd62af492e2955581fd974e | 3,484 | https://github.com/jnordberg/wintersmith/blob/f01b0c9862c0cb38dbd62af492e2955581fd974e/lib/cli/common.coffee | 43 | 92 | ||
jnordberg/wintersmith:lib/cli/common.coffee:1:completion | completion | exports.getOptions = (argv={}, callback) ->
### resolves options with the hierarchy: argv > configfile > defaults
returns a options object ###
# normalize argv
for key, item of defaults
if argv[item.alias]?
argv[key] = argv[item.alias]
workDir = path.resolve (argv.chdir or process.cwd())
log... | logger.verbose "no config file found"
callback null, {}
(options, callback) ->
logger.verbose 'options:', options
for key of defaults
# assing defaults to missing conf options
options[key] ?= defaults[key].default
# ovveride conf and default options with any command lin... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | lib/cli/common.coffee | MIT | f01b0c9862c0cb38dbd62af492e2955581fd974e | 3,484 | https://github.com/jnordberg/wintersmith/blob/f01b0c9862c0cb38dbd62af492e2955581fd974e/lib/cli/common.coffee | 43 | 92 |
jnordberg/wintersmith:lib/cli/common.coffee:2:raw_corpus | raw_corpus | else
callback null, options
(options, callback) ->
logger.verbose 'resolved options:', options
logger.verbose 'checking that all paths are valid'
paths = ['output', 'articles', 'templates', 'static']
async.forEach paths, (filepath, callback) ->
path.exists options[filepath], ... | CoffeeScript | jnordberg/wintersmith | lib/cli/common.coffee | MIT | f01b0c9862c0cb38dbd62af492e2955581fd974e | 3,484 | https://github.com/jnordberg/wintersmith/blob/f01b0c9862c0cb38dbd62af492e2955581fd974e/lib/cli/common.coffee | 93 | 107 | ||
jnordberg/wintersmith:lib/cli/common.coffee:2:completion | completion | else
callback null, options
(options, callback) ->
logger.verbose 'resolved options:', options
logger.verbose 'checking that all paths are valid'
paths = ['output', 'articles', 'templates', 'static']
async.forEach paths, (filepath, callback) -> | path.exists options[filepath], (exists) ->
if exists
callback()
else
callback new Error "#{ filepath } path invalid (#{ options[filepath] })"
, (error) ->
callback error, options
], callback | CoffeeScript | CoffeeScript | jnordberg/wintersmith | lib/cli/common.coffee | MIT | f01b0c9862c0cb38dbd62af492e2955581fd974e | 3,484 | https://github.com/jnordberg/wintersmith/blob/f01b0c9862c0cb38dbd62af492e2955581fd974e/lib/cli/common.coffee | 93 | 107 |
nicolaskruchten/pivottable:src/gchart_renderers.coffee:1:raw_corpus | raw_corpus | callWithJQuery = (pivotModule) ->
if typeof exports is "object" and typeof module is "object" # CommonJS
pivotModule require("jquery")
else if typeof define is "function" and define.amd # AMD
define ["jquery"], pivotModule
# Plain browser env
else
pivotModule jQuery
callWithJQue... | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 1 | 50 | ||
nicolaskruchten/pivottable:src/gchart_renderers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
callWithJQuery = (pivotModule) ->
if typeof exports is "object" and typeof module is "object" # CommonJS
pivotModule require("jquery")
else if typeof define is "function" and define.amd # AMD
define ["jquery"], pivotModule
# Plain brow... | var callWithJQuery;
callWithJQuery = function(pivotModule) {
if (typeof exports === "object" && typeof module === "object") { // CommonJS
return pivotModule(require("jquery"));
} else if (typeof define === "function" && define.amd) { // AMD
return define(["jquery"], pivotModule);
} else {
// Plain br... | CoffeeScript | JavaScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 1 | 50 |
nicolaskruchten/pivottable:src/gchart_renderers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var callWithJQuery;
callWithJQuery = function(pivotModule) {
if (typeof exports === "object" && typeof module === "object") { // CommonJS
return pivotModule(require("jquery"));
} else if (typeof define === "function" && define.amd) { // AMD
return defi... | callWithJQuery = (pivotModule) ->
if typeof exports is "object" and typeof module is "object" # CommonJS
pivotModule require("jquery")
else if typeof define is "function" and define.amd # AMD
define ["jquery"], pivotModule
# Plain browser env
else
pivotModule jQuery
callWithJQue... | JavaScript | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 1 | 50 |
nicolaskruchten/pivottable:src/gchart_renderers.coffee:1:completion | completion | callWithJQuery = (pivotModule) ->
if typeof exports is "object" and typeof module is "object" # CommonJS
pivotModule require("jquery")
else if typeof define is "function" and define.amd # AMD
define ["jquery"], pivotModule
# Plain browser env
else
pivotModule jQuery
callWithJQue... | colKeys.push [] if colKeys.length == 0
fullAggName = pivotData.aggregatorName
if pivotData.valAttrs.length
fullAggName += "(#{pivotData.valAttrs.join(", ")})"
headers = (h.join("-") for h in rowKeys)
headers.unshift ""
numCharsInHAxis = 0
if chartType == "Sca... | CoffeeScript | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 1 | 50 |
nicolaskruchten/pivottable:src/gchart_renderers.coffee:2:raw_corpus | raw_corpus | else
dataArray = [headers]
for colKey in colKeys
row = [colKey.join("-")]
numCharsInHAxis += row[0].length
for rowKey in rowKeys
agg = pivotData.getAggregator(rowKey, colKey)
if agg.value()?
... | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 51 | 100 | ||
nicolaskruchten/pivottable:src/gchart_renderers.coffee:2:completion | completion | else
dataArray = [headers]
for colKey in colKeys
row = [colKey.join("-")]
numCharsInHAxis += row[0].length
for rowKey in rowKeys
agg = pivotData.getAggregator(rowKey, colKey)
if agg.value()?
... | title += " #{opts.localeStrings.by} #{groupByTitle}" if groupByTitle != ""
options =
title: title
hAxis: {title: hAxisTitle, slantedText: numCharsInHAxis > 50}
vAxis: {title: vAxisTitle}
tooltip: { textStyle: { fontName: 'Arial', fontSize: 12 } }
if char... | CoffeeScript | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 51 | 100 |
nicolaskruchten/pivottable:src/gchart_renderers.coffee:3:raw_corpus | raw_corpus | google.visualization.events.addListener editor, 'ok', ->
editor.getChartWrapper().draw(result[0])
editor.openDialog(wrapper)
return result
$.pivotUtilities.gchart_renderers =
"Line Chart": makeGoogleChart("LineChart")
"Bar Chart": makeGoogleChart("ColumnChart")
... | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 101 | 111 | ||
nicolaskruchten/pivottable:src/gchart_renderers.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
google.visualization.events.addListener editor, 'ok', ->
editor.getChartWrapper().draw(result[0])
editor.openDialog(wrapper)
return result
$.pivotUtilities.gchart_renderers =
"Line Chart": makeGoogleChart("LineChar... | google.visualization.events.addListener(editor, 'ok', function() {
return editor.getChartWrapper().draw(result[0]);
});
editor.openDialog(wrapper);
return result;
$.pivotUtilities.gchart_renderers = {
"Line Chart": makeGoogleChart("LineChart"),
"Bar Chart": makeGoogleChart("ColumnChart"),
"Stacked Bar Chart"... | CoffeeScript | JavaScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 101 | 111 |
nicolaskruchten/pivottable:src/gchart_renderers.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
google.visualization.events.addListener(editor, 'ok', function() {
return editor.getChartWrapper().draw(result[0]);
});
editor.openDialog(wrapper);
return result;
$.pivotUtilities.gchart_renderers = {
"Line Chart": makeGoogleChart("LineChart"),
"Bar Chart"... | google.visualization.events.addListener editor, 'ok', ->
editor.getChartWrapper().draw(result[0])
editor.openDialog(wrapper)
return result
$.pivotUtilities.gchart_renderers =
"Line Chart": makeGoogleChart("LineChart")
"Bar Chart": makeGoogleChart("ColumnChart")
... | JavaScript | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 101 | 111 |
nicolaskruchten/pivottable:src/gchart_renderers.coffee:3:completion | completion | google.visualization.events.addListener editor, 'ok', ->
editor.getChartWrapper().draw(result[0])
editor.openDialog(wrapper)
return result | $.pivotUtilities.gchart_renderers =
"Line Chart": makeGoogleChart("LineChart")
"Bar Chart": makeGoogleChart("ColumnChart")
"Stacked Bar Chart": makeGoogleChart("ColumnChart", isStacked: true)
"Area Chart": makeGoogleChart("AreaChart", isStacked: true)
"Scatter Chart": makeGoogleC... | CoffeeScript | CoffeeScript | nicolaskruchten/pivottable | src/gchart_renderers.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/src/gchart_renderers.coffee | 101 | 111 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $element = $(element)
$parent = $element.parent()
scope.$watch 'widget', (widget) ->
# Wire-up fullscreen button if available
if widget.allowFullscreen
$parent.find('.widget-fullscreen').on 'click', ->
$element.fullScr... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $element = $(element)
$parent = $element.parent()
scope.$watch 'widget', (widget) ->
# Wire-up fullscreen button if available
if widget.allowFullscreen
$parent.find('.widget-fullscreen').on 'click', ->
$element.fullScr... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 42 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | # Wire-up fullscreen button if available
if widget.allowFullscreen
$parent.find('.widget-fullscreen').click ->
$element.fullScreen(true)
return
scope.$watch 'layout', (layout) ->
return unless layout?
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 08680403c1ab72b7789517426293681c2224eada | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/08680403c1ab72b7789517426293681c2224eada/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 44 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 08680403c1ab72b7789517426293681c2224eada | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/08680403c1ab72b7789517426293681c2224eada/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 44 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 08680403c1ab72b7789517426293681c2224eada | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/08680403c1ab72b7789517426293681c2224eada/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 44 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $parent = $element.parent()
scope.$watch 'widget', (widget) ->
# Wire-up fullscreen button if available
if widget.allowFullscreen
$parent.find('.widget-fullscreen').click ->
$element.fullScreen(true)
return
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 08680403c1ab72b7789517426293681c2224eada | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/08680403c1ab72b7789517426293681c2224eada/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 44 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 43 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $element = $(element)
$parent = $element.parent()
scope.$watch 'widget', (widget) ->
# Wire-up fullscreen button if available
if widget.allowFullscreen
$parent.find('.widget-fullscreen').click ->
$element.fullScreen(tr... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/bc4b0328fb9e7d1f539ede0b874aba475a4c8f0d/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 46 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 46 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 46 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | scope.$watch 'widget', (widget) ->
# Ignore the widget if hidden is set
return if widget.hidden == true
# Wire-up fullscreen button if available
if widget.allowFullscreen
$parent.find('.widget-fullscreen').click ->
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee | 1 | 46 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:1:raw_corpus | raw_corpus | _initRobot = (service) ->
conditions = service: service.name, isRobot: true
keyMapping =
name: 'title'
avatarUrl: 'iconUrl'
$robot = UserModel.findOneAsync conditions
.then (robot) ->
if robot
isntModified = Object.keys(keyMapping).every (key) -> robot[key] is service[keyMapping[key]]
... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 25 | 68 | ||
jianliaoim/talk-os:talk-api2x/server/service.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_initRobot = (service) ->
conditions = service: service.name, isRobot: true
keyMapping =
name: 'title'
avatarUrl: 'iconUrl'
$robot = UserModel.findOneAsync conditions
.then (robot) ->
if robot
isntModified = Object.keys(keyMapping).ev... | var _initRobot, _tokenToService, app, express;
_initRobot = function(service) {
var $robot, conditions, keyMapping;
conditions = {
service: service.name,
isRobot: true
};
keyMapping = {
name: 'title',
avatarUrl: 'iconUrl'
};
$robot = UserModel.findOneAsync(conditions).then(function(robot) {... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 25 | 68 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _initRobot, _tokenToService, app, express;
_initRobot = function(service) {
var $robot, conditions, keyMapping;
conditions = {
service: service.name,
isRobot: true
};
keyMapping = {
name: 'title',
avatarUrl: 'iconUrl'
};
$robot = Us... | _initRobot = (service) ->
conditions = service: service.name, isRobot: true
keyMapping =
name: 'title'
avatarUrl: 'iconUrl'
$robot = UserModel.findOneAsync conditions
.then (robot) ->
if robot
isntModified = Object.keys(keyMapping).every (key) -> robot[key] is service[keyMapping[key]]
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 25 | 68 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:1:completion | completion | _initRobot = (service) ->
conditions = service: service.name, isRobot: true
keyMapping =
name: 'title'
avatarUrl: 'iconUrl'
$robot = UserModel.findOneAsync conditions
.then (robot) ->
if robot
isntModified = Object.keys(keyMapping).every (key) -> robot[key] is service[keyMapping[key]]
... | options = upsert: true, new: true
UserModel.findOneAndUpdateAsync conditions, update, options
.then (robot) ->
robot = robot[0] if toString.call(robot) is '[object Array]'
throw new Error("Service #{service.name} load robot failed") unless robot
service.robot = robot
return $robot
# Initialize a... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 25 | 68 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:2:raw_corpus | raw_corpus | serviceLoader.getServiceByToken = (token) ->
name = _tokenToService[token]
return Promise.reject(new Err('INVALID_SERVICE')) unless name
serviceLoader.load name | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 70 | 73 | ||
jianliaoim/talk-os:talk-api2x/server/service.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
serviceLoader.getServiceByToken = (token) ->
name = _tokenToService[token]
return Promise.reject(new Err('INVALID_SERVICE')) unless name
serviceLoader.load name
``` | serviceLoader.getServiceByToken = function(token) {
var name;
name = _tokenToService[token];
if (!name) {
return Promise.reject(new Err('INVALID_SERVICE'));
}
return serviceLoader.load(name);
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 70 | 73 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
serviceLoader.getServiceByToken = function(token) {
var name;
name = _tokenToService[token];
if (!name) {
return Promise.reject(new Err('INVALID_SERVICE'));
}
return serviceLoader.load(name);
};
``` | serviceLoader.getServiceByToken = (token) ->
name = _tokenToService[token]
return Promise.reject(new Err('INVALID_SERVICE')) unless name
serviceLoader.load name | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 70 | 73 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:2:completion | completion | serviceLoader.getServiceByToken = (token) ->
name = _tokenToService[token] | return Promise.reject(new Err('INVALID_SERVICE')) unless name
serviceLoader.load name | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 70 | 73 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:4:raw_corpus | raw_corpus | serviceLoader.settings = ->
unless serviceLoader.$settings
serviceLoader.$settings = Promise.map serviceNames, (serviceName) -> serviceLoader.load serviceName
.filter (service) -> not service.isHidden
.map (service) -> service.toJSON()
serviceLoader.$settings | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 78 | 83 | ||
jianliaoim/talk-os:talk-api2x/server/service.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
serviceLoader.settings = ->
unless serviceLoader.$settings
serviceLoader.$settings = Promise.map serviceNames, (serviceName) -> serviceLoader.load serviceName
.filter (service) -> not service.isHidden
.map (service) -> service.toJSON()
serviceLoad... | serviceLoader.settings = function() {
if (!serviceLoader.$settings) {
serviceLoader.$settings = Promise.map(serviceNames, function(serviceName) {
return serviceLoader.load(serviceName);
}).filter(function(service) {
return !service.isHidden;
}).map(function(service) {
return service.toJS... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 78 | 83 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
serviceLoader.settings = function() {
if (!serviceLoader.$settings) {
serviceLoader.$settings = Promise.map(serviceNames, function(serviceName) {
return serviceLoader.load(serviceName);
}).filter(function(service) {
return !service.isHidden;
... | serviceLoader.settings = ->
unless serviceLoader.$settings
serviceLoader.$settings = Promise.map serviceNames, (serviceName) -> serviceLoader.load serviceName
.filter (service) -> not service.isHidden
.map (service) -> service.toJSON()
serviceLoader.$settings | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 78 | 83 |
jianliaoim/talk-os:talk-api2x/server/service.coffee:4:completion | completion | serviceLoader.settings = ->
unless serviceLoader.$settings
serviceLoader.$settings = Promise.map serviceNames, (serviceName) -> serviceLoader.load serviceName | .filter (service) -> not service.isHidden
.map (service) -> service.toJSON()
serviceLoader.$settings | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/service.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/service.coffee | 78 | 83 |
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'topic-guest-mode'
mixins: [PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map).isRequired
hasPermission: T.bool.isRequired
onUrlOver: (event) ->
event.target.select()
onRegenerateClick: ->
roomActions.roomUpdateGuest @props.topic.... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 21 | 70 | ||
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'topic-guest-mode'
mixins: [PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map).isRequired
hasPermission: T.bool.isRequired
onUrlOver: (event) ->
event.target.select()
onRegenera... | module.exports = React.createClass({
displayName: 'topic-guest-mode',
mixins: [PureRenderMixin],
propTypes: {
topic: T.instanceOf(Immutable.Map).isRequired,
hasPermission: T.bool.isRequired
},
onUrlOver: function(event) {
return event.target.select();
},
onRegenerateClick: function() {
ret... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 21 | 70 |
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'topic-guest-mode',
mixins: [PureRenderMixin],
propTypes: {
topic: T.instanceOf(Immutable.Map).isRequired,
hasPermission: T.bool.isRequired
},
onUrlOver: function(event) {
return event.target.s... | module.exports = React.createClass
displayName: 'topic-guest-mode'
mixins: [PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map).isRequired
hasPermission: T.bool.isRequired
onUrlOver: (event) ->
event.target.select()
onRegenerateClick: ->
roomActions.roomUpdateGuest @props.topic.... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 21 | 70 |
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'topic-guest-mode'
mixins: [PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map).isRequired
hasPermission: T.bool.isRequired
onUrlOver: (event) ->
event.target.select()
onRegenerateClick: ->
roomActions.roomUpdateGuest @props.topic.... | if resp.isGuestVisible
text = lang.getText('history-visible-to-guests')
else
text = lang.getText('history-invisible-to-guests')
notifyActions.info text
render: ->
div className: 'modal-paragraph',
div className: 'modal-name', lang.getText('guest-mode')
if @props.to... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 21 | 70 |
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:2:raw_corpus | raw_corpus | if @props.hasPermission
p className: 'line',
button className: 'button is-default', onClick: @onEnableClick,
lang.getText('generate–guest-link')
if @props.topic.get('guestUrl')?
spanClass = cx 'ti', 'history',
'ti-tick': @props.topic.get('isGuestVisible')
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 71 | 81 | ||
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @props.hasPermission
p className: 'line',
button className: 'button is-default', onClick: @onEnableClick,
lang.getText('generate–guest-link')
if @props.topic.get('guestUrl')?
spanClass = cx 'ti', 'history',
... | var spanClass;
if (this.props.hasPermission) {
p({
className: 'line'
}, button({
className: 'button is-default',
onClick: this.onEnableClick
}, lang.getText('generate–guest-link')));
}
if (this.props.topic.get('guestUrl') != null) {
spanClass = cx('ti', 'history', {
'ti-tick': this.props.topic... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 71 | 81 |
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var spanClass;
if (this.props.hasPermission) {
p({
className: 'line'
}, button({
className: 'button is-default',
onClick: this.onEnableClick
}, lang.getText('generate–guest-link')));
}
if (this.props.topic.get('guestUrl') != null) {
spanClass ... | if @props.hasPermission
p className: 'line',
button className: 'button is-default', onClick: @onEnableClick,
lang.getText('generate–guest-link')
if @props.topic.get('guestUrl')?
spanClass = cx 'ti', 'history',
'ti-tick': @props.topic.get('isGuestVisible')
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 71 | 81 |
jianliaoim/talk-os:talk-web/client/app/topic-guest-mode.coffee:2:completion | completion | if @props.hasPermission
p className: 'line',
button className: 'button is-default', onClick: @onEnableClick,
lang.getText('generate–guest-link')
if @props.topic.get('guestUrl')? | spanClass = cx 'ti', 'history',
'ti-tick': @props.topic.get('isGuestVisible')
'is-disabled': not @props.hasPermission
p className:'radio', onClick: @onVisibleClick,
span className: spanClass
lang.getText('guest-views-history') | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-guest-mode.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-guest-mode.coffee | 71 | 81 |
kelp404/angular-form-builder:src/provider.coffee:1:raw_corpus | raw_corpus | ###
component:
It is like a class.
The base components are textInput, textArea, select, check, radio.
User can custom the form with components.
formObject:
It is like an object (an instance of the component).
User can custom the label, description, required and validation... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 1 | 43 | ||
kelp404/angular-form-builder:src/provider.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
component:
It is like a class.
The base components are textInput, textArea, select, check, radio.
User can custom the form with components.
formObject:
It is like an object (an instance of the component).
User c... | /*
component:
It is like a class.
The base components are textInput, textArea, select, check, radio.
User can custom the form with components.
formObject:
It is like an object (an instance of the component).
User can custom the label, description, required and validation ... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 1 | 43 |
kelp404/angular-form-builder:src/provider.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
component:
It is like a class.
The base components are textInput, textArea, select, check, radio.
User can custom the form with components.
formObject:
It is like an object (an instance of the component).
User can ... | ###
component:
It is like a class.
The base components are textInput, textArea, select, check, radio.
User can custom the form with components.
formObject:
It is like an object (an instance of the component).
User can custom the label, description, required and validation... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 1 | 43 |
kelp404/angular-form-builder:src/provider.coffee:1:completion | completion | ###
component:
It is like a class.
The base components are textInput, textArea, select, check, radio.
User can custom the form with components.
formObject:
It is like an object (an instance of the component).
User can custom the label, description, required and validation... | # ----------------------------------------
# properties
# ----------------------------------------
# all components
@components = {}
@componentsArray = []
# all groups of components
@groups = []
# forms
# builder mode: `fb-builder` you could drag and drop to build the form.
# ... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 1 | 43 |
kelp404/angular-form-builder:src/provider.coffee:2:raw_corpus | raw_corpus | @convertComponent = (name, component) ->
result =
name: name
group: component.group ? 'Default'
label: component.label ? ''
description: component.description ? ''
placeholder: component.placeholder ? ''
required: component.required ? no
... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 45 | 94 | ||
kelp404/angular-form-builder:src/provider.coffee:2:completion | completion | @convertComponent = (name, component) ->
result =
name: name
group: component.group ? 'Default'
label: component.label ? ''
description: component.description ? ''
placeholder: component.placeholder ? ''
required: component.required ? no
... | label: formObject.label ? component.label
description: formObject.description ? component.description
placeholder: formObject.placeholder ? component.placeholder
options: formObject.options ? component.options
required: formObject.required ? component.required
res... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 45 | 94 |
kelp404/angular-form-builder:src/provider.coffee:3:raw_corpus | raw_corpus | required: yes / no
validation: RegExp
options: []
template: html template
popoverTemplate: html template
###
if not @components[name]?
# regist the new component
newComponent = @convertComponent name, component
@componen... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 95 | 110 | ||
kelp404/angular-form-builder:src/provider.coffee:3:completion | completion | required: yes / no
validation: RegExp
options: []
template: html template
popoverTemplate: html template
###
if not @components[name]?
# regist the new component | newComponent = @convertComponent name, component
@components[name] = newComponent
@componentsArray.push newComponent
if newComponent.group not in @groups
@groups.push newComponent.group
else
console.error "The component #{name} was registered."
... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 95 | 110 |
kelp404/angular-form-builder:src/provider.coffee:4:raw_corpus | raw_corpus | @addFormObject = (name, formObject={}) =>
###
Insert the form Object into the form at last.
###
@forms[name] ?= []
@insertFormObject name, @forms[name].length, formObject
@insertFormObject = (name, index, formObject={}) =>
###
Insert the form object into the ... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 112 | 152 | ||
kelp404/angular-form-builder:src/provider.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@addFormObject = (name, formObject={}) =>
###
Insert the form Object into the form at last.
###
@forms[name] ?= []
@insertFormObject name, @forms[name].length, formObject
@insertFormObject = (name, index, formObject={}... | this.addFormObject = (name, formObject = {}) => {
var base;
/*
Insert the form Object into the form at last.
*/
if ((base = this.forms)[name] == null) {
base[name] = [];
}
return this.insertFormObject(name, this.forms[name].length, formObject);
};
this.insertFormObject = (name, index, formObject = {}... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 112 | 152 |
kelp404/angular-form-builder:src/provider.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.addFormObject = (name, formObject = {}) => {
var base;
/*
Insert the form Object into the form at last.
*/
if ((base = this.forms)[name] == null) {
base[name] = [];
}
return this.insertFormObject(name, this.forms[name].length, formObject);
};... | @addFormObject = (name, formObject={}) =>
###
Insert the form Object into the form at last.
###
@forms[name] ?= []
@insertFormObject name, @forms[name].length, formObject
@insertFormObject = (name, index, formObject={}) =>
###
Insert the form object into the ... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 112 | 152 |
kelp404/angular-form-builder:src/provider.coffee:4:completion | completion | @addFormObject = (name, formObject={}) =>
###
Insert the form Object into the form at last.
###
@forms[name] ?= []
@insertFormObject name, @forms[name].length, formObject
@insertFormObject = (name, index, formObject={}) =>
###
Insert the form object into the ... | required:
###
@forms[name] ?= []
if index > @forms.length then index = @forms.length
else if index < 0 then index = 0
@forms[name].splice index, 0, @convertFormObject(name, formObject)
@reIndexFormObject name
@removeFormObject = (name, index) =>
###
R... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 112 | 152 |
kelp404/angular-form-builder:src/provider.coffee:5:raw_corpus | raw_corpus | components: @components
componentsArray: @componentsArray
groups: @groups
forms: @forms
registerComponent: @registerComponent
addFormObject: @addFormObject
insertFormObject: @insertFormObject
removeFormObject: @removeFormObject
@get.$inject = ['$injector']
... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 154 | 164 | ||
kelp404/angular-form-builder:src/provider.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
components: @components
componentsArray: @componentsArray
groups: @groups
forms: @forms
registerComponent: @registerComponent
addFormObject: @addFormObject
insertFormObject: @insertFormObject
removeFormObjec... | ({
components: this.components({
componentsArray: this.componentsArray,
groups: this.groups,
forms: this.forms,
registerComponent: this.registerComponent,
addFormObject: this.addFormObject,
insertFormObject: this.insertFormObject,
removeFormObject: this.removeFormObject
})
});
this.get.... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 154 | 164 |
kelp404/angular-form-builder:src/provider.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
components: this.components({
componentsArray: this.componentsArray,
groups: this.groups,
forms: this.forms,
registerComponent: this.registerComponent,
addFormObject: this.addFormObject,
insertFormObject: this.insertFormObject,
remo... | components: @components
componentsArray: @componentsArray
groups: @groups
forms: @forms
registerComponent: @registerComponent
addFormObject: @addFormObject
insertFormObject: @insertFormObject
removeFormObject: @removeFormObject
@get.$inject = ['$injector']
... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 154 | 164 |
kelp404/angular-form-builder:src/provider.coffee:5:completion | completion | components: @components
componentsArray: @componentsArray
groups: @groups
forms: @forms
registerComponent: @registerComponent | addFormObject: @addFormObject
insertFormObject: @insertFormObject
removeFormObject: @removeFormObject
@get.$inject = ['$injector']
@$get = @get
return | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | ce576078419bc136cb80406ba482578fad5df25f | 600 | https://github.com/kelp404/angular-form-builder/blob/ce576078419bc136cb80406ba482578fad5df25f/src/provider.coffee | 154 | 164 |
kelp404/angular-form-builder:src/provider.coffee:2:raw_corpus | raw_corpus | @convertComponent = (name, component) ->
result =
name: name
group: component.group ? 'Default'
label: component.label ? ''
description: component.description ? ''
placeholder: component.placeholder ? ''
required: component.required ? no
... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | baacbfa9a0d7eca474e51ac0698b366e7d770f7c | 600 | https://github.com/kelp404/angular-form-builder/blob/baacbfa9a0d7eca474e51ac0698b366e7d770f7c/src/provider.coffee | 45 | 94 | ||
kelp404/angular-form-builder:src/provider.coffee:2:completion | completion | @convertComponent = (name, component) ->
result =
name: name
group: component.group ? 'Default'
label: component.label ? ''
description: component.description ? ''
placeholder: component.placeholder ? ''
required: component.required ? no
... | label: formObject.label ? component.label
description: formObject.description ? component.description
placeholder: formObject.placeholder ? component.placeholder
options: formObject.options ? component.options
required: formObject.required ? component.required
res... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | baacbfa9a0d7eca474e51ac0698b366e7d770f7c | 600 | https://github.com/kelp404/angular-form-builder/blob/baacbfa9a0d7eca474e51ac0698b366e7d770f7c/src/provider.coffee | 45 | 94 |
kelp404/angular-form-builder:src/provider.coffee:3:raw_corpus | raw_corpus | ###
if not @components[name]?
# regist the new component
newComponent = @convertComponent name, component
@components[name] = newComponent
@componentsArray.push newComponent
if newComponent.group not in @groups
@groups.push newComponent... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | baacbfa9a0d7eca474e51ac0698b366e7d770f7c | 600 | https://github.com/kelp404/angular-form-builder/blob/baacbfa9a0d7eca474e51ac0698b366e7d770f7c/src/provider.coffee | 95 | 105 | ||
kelp404/angular-form-builder:src/provider.coffee:3:completion | completion | ###
if not @components[name]?
# regist the new component
newComponent = @convertComponent name, component
@components[name] = newComponent | @componentsArray.push newComponent
if newComponent.group not in @groups
@groups.push newComponent.group
else
console.error "The component #{name} was registered."
return | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | baacbfa9a0d7eca474e51ac0698b366e7d770f7c | 600 | https://github.com/kelp404/angular-form-builder/blob/baacbfa9a0d7eca474e51ac0698b366e7d770f7c/src/provider.coffee | 95 | 105 |
kelp404/angular-form-builder:src/provider.coffee:4:raw_corpus | raw_corpus | @addFormObject = (name, formObject={}) =>
###
Insert the form Object into the form at last.
###
@forms[name] ?= []
@insertFormObject name, @forms[name].length, formObject
@insertFormObject = (name, index, formObject={}) =>
###
Insert the form object into the ... | CoffeeScript | kelp404/angular-form-builder | src/provider.coffee | MIT | baacbfa9a0d7eca474e51ac0698b366e7d770f7c | 600 | https://github.com/kelp404/angular-form-builder/blob/baacbfa9a0d7eca474e51ac0698b366e7d770f7c/src/provider.coffee | 107 | 145 | ||
kelp404/angular-form-builder:src/provider.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@addFormObject = (name, formObject={}) =>
###
Insert the form Object into the form at last.
###
@forms[name] ?= []
@insertFormObject name, @forms[name].length, formObject
@insertFormObject = (name, index, formObject={}... | this.addFormObject = (name, formObject = {}) => {
var base;
/*
Insert the form Object into the form at last.
*/
if ((base = this.forms)[name] == null) {
base[name] = [];
}
return this.insertFormObject(name, this.forms[name].length, formObject);
};
this.insertFormObject = (name, index, formObject = {}... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/provider.coffee | MIT | baacbfa9a0d7eca474e51ac0698b366e7d770f7c | 600 | https://github.com/kelp404/angular-form-builder/blob/baacbfa9a0d7eca474e51ac0698b366e7d770f7c/src/provider.coffee | 107 | 145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.