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_splats.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
func: function(first, second, ...rest) {
return rest.join(' ');
},
result: func(1, 2, 3, 4, 5)
});
ok(result === "3 4 5");
({
gold: {
silver: {
bronze: {
the_field: {
last: null
}
}
}
}
});
``` | func: (first, second, rest...) ->
rest.join ' '
result: func 1, 2, 3, 4, 5
ok result is "3 4 5"
gold: silver: bronze: the_field: last: null | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 1 | 9 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:2:raw_corpus | raw_corpus | medalists: (first, second, third, rest..., unlucky) ->
gold: first
silver: second
bronze: third
the_field: rest.concat([last])
last: unlucky
contenders: [
"Michael Phelps"
"Liu Xiang"
"Yao Ming"
"Allyson Felix"
"Shawn Johnson"
"Roman Sebrle"
"Guo Jingjing"
"Tyson Gay"
"... | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 11 | 60 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
medalists: (first, second, third, rest..., unlucky) ->
gold: first
silver: second
bronze: third
the_field: rest.concat([last])
last: unlucky
contenders: [
"Michael Phelps"
"Liu Xiang"
"Yao Ming"
"Allyson Felix"
"Shawn Joh... | var splice = [].splice;
({
medalists: function(first, second, third, ...rest) {
var ref, unlucky;
ref = rest, [...rest] = ref, [unlucky] = splice.call(rest, -1);
return {
gold: first,
silver: second,
bronze: third,
the_field: rest.concat([last]),
last: unlucky
};
},
... | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 11 | 60 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var splice = [].splice;
({
medalists: function(first, second, third, ...rest) {
var ref, unlucky;
ref = rest, [...rest] = ref, [unlucky] = splice.call(rest, -1);
return {
gold: first,
silver: second,
bronze: third,
the_field: ... | medalists: (first, second, third, rest..., unlucky) ->
gold: first
silver: second
bronze: third
the_field: rest.concat([last])
last: unlucky
contenders: [
"Michael Phelps"
"Liu Xiang"
"Yao Ming"
"Allyson Felix"
"Shawn Johnson"
"Roman Sebrle"
"Guo Jingjing"
"Tyson Gay"
"... | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 11 | 60 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:2:completion | completion | medalists: (first, second, third, rest..., unlucky) ->
gold: first
silver: second
bronze: third
the_field: rest.concat([last])
last: unlucky
contenders: [
"Michael Phelps"
"Liu Xiang"
"Yao Ming"
"Allyson Felix"
"Shawn Johnson"
"Roman Sebrle"
"Guo Jingjing"
"Tyson Gay"
"... | ok bronze is "Liu Xiang"
ok last is "Usain Bolt"
ok the_field.length is 8
contenders.reverse()
medalists contenders[0...2]..., "Mighty Mouse", contenders[2...contenders.length]...
ok gold is "Usain Bolt"
ok silver is "Asafa Powell"
ok bronze is "Mighty Mouse"
ok last is "Michael Phelps"
ok the_field.length is 8
meda... | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 11 | 60 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:4:raw_corpus | raw_corpus | class Parent
meth: (args...) ->
args | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 83 | 85 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Parent
meth: (args...) ->
args
``` | var Parent;
Parent = class Parent {
meth(...args) {
return args;
}
}; | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 83 | 85 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Parent;
Parent = class Parent {
meth(...args) {
return args;
}
};
``` | class Parent
meth: (args...) ->
args | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 83 | 85 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:5:raw_corpus | raw_corpus | class Child extends Parent
meth: ->
nums: [3, 2, 1]
super nums...
ok (new Child()).meth().join(' ') is '3 2 1'
# Functions with splats being called with too few arguments.
pen: null | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 87 | 96 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Child extends Parent
meth: ->
nums: [3, 2, 1]
super nums...
ok (new Child()).meth().join(' ') is '3 2 1'
# Functions with splats being called with too few arguments.
pen: null
``` | var Child;
Child = class Child extends Parent {
meth() {
({
nums: [3, 2, 1]
});
return super.meth(...nums);
}
};
ok((new Child()).meth().join(' ') === '3 2 1');
({
// Functions with splats being called with too few arguments.
pen: null
}); | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 87 | 96 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Child;
Child = class Child extends Parent {
meth() {
({
nums: [3, 2, 1]
});
return super.meth(...nums);
}
};
ok((new Child()).meth().join(' ') === '3 2 1');
({
// Functions with splats being called with too few arguments.
pen: null... | class Child extends Parent
meth: ->
nums: [3, 2, 1]
super nums...
ok (new Child()).meth().join(' ') is '3 2 1'
# Functions with splats being called with too few arguments.
pen: null | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 87 | 96 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:5:completion | completion | class Child extends Parent
meth: ->
nums: [3, 2, 1]
super nums... | ok (new Child()).meth().join(' ') is '3 2 1'
# Functions with splats being called with too few arguments.
pen: null | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 87 | 96 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:6:raw_corpus | raw_corpus | method: (first, variable..., penultimate, ultimate) ->
pen: penultimate
method 1, 2, 3, 4, 5, 6, 7, 8, 9
ok pen is 8
method 1, 2, 3
ok pen is 2
method 1, 2
ok pen is 2 | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 97 | 107 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
method: (first, variable..., penultimate, ultimate) ->
pen: penultimate
method 1, 2, 3, 4, 5, 6, 7, 8, 9
ok pen is 8
method 1, 2, 3
ok pen is 2
method 1, 2
ok pen is 2
``` | var splice = [].splice;
({
method: function(first, ...variable) {
var penultimate, ref, ultimate;
ref = variable, [...variable] = ref, [penultimate, ultimate] = splice.call(variable, -2);
return {
pen: penultimate
};
}
});
method(1, 2, 3, 4, 5, 6, 7, 8, 9);
ok(pen === 8);
method(1, 2, 3);
... | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 97 | 107 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_splats.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var splice = [].splice;
({
method: function(first, ...variable) {
var penultimate, ref, ultimate;
ref = variable, [...variable] = ref, [penultimate, ultimate] = splice.call(variable, -2);
return {
pen: penultimate
};
}
});
method(1, 2, 3... | method: (first, variable..., penultimate, ultimate) ->
pen: penultimate
method 1, 2, 3, 4, 5, 6, 7, 8, 9
ok pen is 8
method 1, 2, 3
ok pen is 2
method 1, 2
ok pen is 2 | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_splats.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_splats.coffee | 97 | 107 |
oozcitak/xmlbuilder-js:test/basic/objectconsistency.coffee:1:raw_corpus | raw_corpus | suite 'Creating XML:', ->
test 'Object builder consistency', ->
obj =
ele: "simple element"
person:
name: "John"
'@age': 35
'?pi': 'mypi'
'#comment': 'Good guy'
'#cdata': 'well formed!'
unescaped:
'#raw': '&<>&'
... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/objectconsistency.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/objectconsistency.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:test/basic/objectconsistency.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Creating XML:', ->
test 'Object builder consistency', ->
obj =
ele: "simple element"
person:
name: "John"
'@age': 35
'?pi': 'mypi'
'#comment': 'Good guy'
'#cdata': 'well form... | suite('Creating XML:', function() {
return test('Object builder consistency', function() {
var obj, t1, t2;
obj = {
ele: "simple element",
person: {
name: "John",
'@age': 35,
'?pi': 'mypi',
'#comment': 'Good guy',
'#cdata': 'well formed!',
unescaped:... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/objectconsistency.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/objectconsistency.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:test/basic/objectconsistency.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Creating XML:', function() {
return test('Object builder consistency', function() {
var obj, t1, t2;
obj = {
ele: "simple element",
person: {
name: "John",
'@age': 35,
'?pi': 'mypi',
'#comment': 'Good guy... | suite 'Creating XML:', ->
test 'Object builder consistency', ->
obj =
ele: "simple element"
person:
name: "John"
'@age': 35
'?pi': 'mypi'
'#comment': 'Good guy'
'#cdata': 'well formed!'
unescaped:
'#raw': '&<>&'
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/objectconsistency.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/objectconsistency.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:test/basic/objectconsistency.coffee:1:completion | completion | suite 'Creating XML:', ->
test 'Object builder consistency', ->
obj =
ele: "simple element"
person:
name: "John"
'@age': 35
'?pi': 'mypi'
'#comment': 'Good guy'
'#cdata': 'well formed!'
unescaped:
'#raw': '&<>&'
... | t1 = xml('root', { headless: true }).ele(obj)
t2 = xml('root', { headless: true })
.ele('ele', 'simple element')
.up()
.ele('person')
.ele('name', 'John')
.up()
.att('age', 35)
.ins('pi', 'mypi')
.com('Good guy')
.dat('well formed!')
... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/objectconsistency.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/objectconsistency.coffee | 1 | 50 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:raw_corpus | raw_corpus | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
div class:'typing '+('typingnow' if c?.typing?.length), ->
return unless c
span class:'materia... | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/typinginfo.coffee | 1 | 17 | ||
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
div class:'typing '+('typingnow' if c?.typing?.length... | var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != null ? viewstate.selectedConv : void 0;
c = conv[conv_id... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != nul... | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
div class:'typing '+('typingnow' if c?.typing?.length), ->
return unless c
span class:'materia... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:completion | completion | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id] | div class:'typing '+('typingnow' if c?.typing?.length), ->
return unless c
span class:'material-icons', 'more_horiz' if c?.typing?.length
for t, i in (c.typing ? [])
name = nameof entity[t.user_id.chat_id]
span class:"typing_#{t.status}", name
pass ', ' if i <... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:raw_corpus | raw_corpus | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
div class:'typing '+('typingnow' if c?.typing?.length), ->
return unless c
span class:'materia... | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 6b074cae85d1acd7fb7776f21e600b322c8b4b30 | 3,762 | https://github.com/yakyak/yakyak/blob/6b074cae85d1acd7fb7776f21e600b322c8b4b30/src/ui/views/typinginfo.coffee | 1 | 17 | ||
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
div class:'typing '+('typingnow' if c?.typing?.length... | var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != null ? viewstate.selectedConv : void 0;
c = conv[conv_id... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 6b074cae85d1acd7fb7776f21e600b322c8b4b30 | 3,762 | https://github.com/yakyak/yakyak/blob/6b074cae85d1acd7fb7776f21e600b322c8b4b30/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != nul... | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
div class:'typing '+('typingnow' if c?.typing?.length), ->
return unless c
span class:'materia... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 6b074cae85d1acd7fb7776f21e600b322c8b4b30 | 3,762 | https://github.com/yakyak/yakyak/blob/6b074cae85d1acd7fb7776f21e600b322c8b4b30/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:completion | completion | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id] | div class:'typing '+('typingnow' if c?.typing?.length), ->
return unless c
span class:'material-icons', 'more_horiz' if c?.typing?.length
for t, i in (c.typing ? [])
name = nameof entity[t.user_id.chat_id]
span class:"typing_#{t.status}", name
pass ', ' if i <... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 6b074cae85d1acd7fb7776f21e600b322c8b4b30 | 3,762 | https://github.com/yakyak/yakyak/blob/6b074cae85d1acd7fb7776f21e600b322c8b4b30/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:raw_corpus | raw_corpus | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-ic... | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/typinginfo.coffee | 1 | 17 | ||
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' ... | var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != null ? viewstate.selectedConv : void 0;
c = conv[conv_id... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != nul... | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-ic... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:completion | completion | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id] | return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-icons', 'more_horiz' if c?.typing?.length
for t, i in (c.typing ? [])
name = nameof entity[t.user_id.chat_id]
span class:"typing_#{t.status}", name
pass ', ' if i < (c... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | db27f28d22c3d69531952f06693dbefaf3685533 | 3,762 | https://github.com/yakyak/yakyak/blob/db27f28d22c3d69531952f06693dbefaf3685533/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:raw_corpus | raw_corpus | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-ic... | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/typinginfo.coffee | 1 | 17 | ||
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' ... | var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != null ? viewstate.selectedConv : void 0;
c = conv[conv_id... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != nul... | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-ic... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:completion | completion | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id] | return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-icons', 'more_horiz' if c?.typing?.length
for t, i in (c.typing ? [])
name = nameof entity[t.user_id.chat_id]
span class:"typing_#{t.status}", name
pass ', ' if i < (c... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 9d5ec987bb380d1b6e2f588f509f15fd287300c3 | 3,762 | https://github.com/yakyak/yakyak/blob/9d5ec987bb380d1b6e2f588f509f15fd287300c3/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:raw_corpus | raw_corpus | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-ic... | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8e869a4f3f406618dbca8a7fdba85e2630fa923c | 3,762 | https://github.com/yakyak/yakyak/blob/8e869a4f3f406618dbca8a7fdba85e2630fa923c/src/ui/views/typinginfo.coffee | 1 | 17 | ||
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' ... | var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != null ? viewstate.selectedConv : void 0;
c = conv[conv_id... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8e869a4f3f406618dbca8a7fdba85e2630fa923c | 3,762 | https://github.com/yakyak/yakyak/blob/8e869a4f3f406618dbca8a7fdba85e2630fa923c/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var nameof, scrollToBottom;
({scrollToBottom} = require('./messages'));
({nameof} = require('../util'));
module.exports = view(function(models) {
var c, conv, conv_id, entity, ref, viewstate;
({viewstate, conv, entity} = models);
conv_id = viewstate != nul... | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id]
return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-ic... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8e869a4f3f406618dbca8a7fdba85e2630fa923c | 3,762 | https://github.com/yakyak/yakyak/blob/8e869a4f3f406618dbca8a7fdba85e2630fa923c/src/ui/views/typinginfo.coffee | 1 | 17 |
yakyak/yakyak:src/ui/views/typinginfo.coffee:1:completion | completion | {scrollToBottom} = require './messages'
{nameof} = require '../util'
module.exports = view (models) ->
{viewstate, conv, entity} = models
conv_id = viewstate?.selectedConv
c = conv[conv_id] | return unless c
div class:'typing '+('typingnow' if c?.typing?.length), ->
span class:'material-icons', 'more_horiz' if c?.typing?.length
for t, i in (c.typing ? [])
name = nameof entity[t.user_id.chat_id]
span class:"typing_#{t.status}", name
pass ', ' if i < (c... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/typinginfo.coffee | MIT | 8e869a4f3f406618dbca8a7fdba85e2630fa923c | 3,762 | https://github.com/yakyak/yakyak/blob/8e869a4f3f406618dbca8a7fdba85e2630fa923c/src/ui/views/typinginfo.coffee | 1 | 17 |
jianliaoim/talk-os:talk-api2x/server/config/locales/en.coffee:1:raw_corpus | raw_corpus | module.exports =
DEFAULT_ERROR: 'Undefined error'
CREATE_ERROR: (collection) -> "Create data error : #{collection}"
UPDATE_ERROR: (collection) -> "Update data error : #{collection}"
DELETE_ERROR: (collection) -> "Delete data error : #{collection}"
NOT_LOGIN: 'You are not login yet. Please login into your ac... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/en.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/en.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-api2x/server/config/locales/en.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
DEFAULT_ERROR: 'Undefined error'
CREATE_ERROR: (collection) -> "Create data error : #{collection}"
UPDATE_ERROR: (collection) -> "Update data error : #{collection}"
DELETE_ERROR: (collection) -> "Delete data error : #{collection}"
NOT... | module.exports = {
DEFAULT_ERROR: 'Undefined error',
CREATE_ERROR: function(collection) {
return `Create data error : ${collection}`;
},
UPDATE_ERROR: function(collection) {
return `Update data error : ${collection}`;
},
DELETE_ERROR: function(collection) {
return `Delete data error : ${collect... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/config/locales/en.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/en.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/config/locales/en.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
DEFAULT_ERROR: 'Undefined error',
CREATE_ERROR: function(collection) {
return `Create data error : ${collection}`;
},
UPDATE_ERROR: function(collection) {
return `Update data error : ${collection}`;
},
DELETE_ERROR: function(c... | module.exports =
DEFAULT_ERROR: 'Undefined error'
CREATE_ERROR: (collection) -> "Create data error : #{collection}"
UPDATE_ERROR: (collection) -> "Update data error : #{collection}"
DELETE_ERROR: (collection) -> "Delete data error : #{collection}"
NOT_LOGIN: 'You are not login yet. Please login into your ac... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/en.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/en.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/config/locales/en.coffee:1:completion | completion | module.exports =
DEFAULT_ERROR: 'Undefined error'
CREATE_ERROR: (collection) -> "Create data error : #{collection}"
UPDATE_ERROR: (collection) -> "Update data error : #{collection}"
DELETE_ERROR: (collection) -> "Delete data error : #{collection}"
NOT_LOGIN: 'You are not login yet. Please login into your ac... | INVALID_OBJECT: (args...) -> "Invalid object: #{args.join(', ')}"
NO_PERMISSION: 'You are not authorized to access'
TOKEN_EXPIRED: 'Your login session has expired. Please relogin and try again'
NOT_EDITABLE: (fields...) -> "The following fields are not editable:#{fields.join(', ')}"
ROOM_IS_ARCHIVED: "Topic is ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/en.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/en.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/config/locales/en.coffee:2:raw_corpus | raw_corpus | INVALID_REFER: "Incorrect synchronize resource"
PUSH_FAILED: "Push message failed %s"
INVALID_MAKR_TARGET: "Object is not allowed to be marked"
NAME_CONFLICT: "This name has been used."
CAN_NOT_ADD_INTEGRATION_IN_OFFICIAL_ROOMS: "Sorry you can not add integrations in officail rooms"
INTEGRATION_ERROR: "An err... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/en.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/en.coffee | 51 | 100 | ||
jianliaoim/talk-os:talk-api2x/server/config/locales/en.coffee:2:completion | completion | INVALID_REFER: "Incorrect synchronize resource"
PUSH_FAILED: "Push message failed %s"
INVALID_MAKR_TARGET: "Object is not allowed to be marked"
NAME_CONFLICT: "This name has been used."
CAN_NOT_ADD_INTEGRATION_IN_OFFICIAL_ROOMS: "Sorry you can not add integrations in officail rooms"
INTEGRATION_ERROR: "An err... | MESSAGE_STRUCTURE_ERROR: "Message structure error"
INVALID_SERVICE: "Invalid third party integration"
INVALID_RSS_URL: "Invalid RSS link"
########################## Define functions ##########################
inteErrorMessage: (integration, topic = '') ->
"""
The integration has an error, please check ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/en.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/en.coffee | 51 | 100 |
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:1:raw_corpus | raw_corpus | XMLDOMErrorHandler = require './XMLDOMErrorHandler'
XMLDOMStringList = require './XMLDOMStringList'
# Implements the DOMConfiguration interface
module.exports = class XMLDOMConfiguration
constructor: () ->
@defaultParams =
"canonical-form": false
"cdata-sections": false
"comments": false
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
XMLDOMErrorHandler = require './XMLDOMErrorHandler'
XMLDOMStringList = require './XMLDOMStringList'
# Implements the DOMConfiguration interface
module.exports = class XMLDOMConfiguration
constructor: () ->
@defaultParams =
"canonical-form": false
... | var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
XMLDOMErrorHandler = require('./XMLDOMErrorHandler');
XMLDOMStringList = require('./XMLDOMStringList');
// Implements the DOMConfiguration interface
module.exports = XMLDOMConfiguration = (function() {
class XMLDOMConfiguration {
constructor() {
... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
XMLDOMErrorHandler = require('./XMLDOMErrorHandler');
XMLDOMStringList = require('./XMLDOMStringList');
// Implements the DOMConfiguration interface
module.exports = XMLDOMConfiguration = (function()... | XMLDOMErrorHandler = require './XMLDOMErrorHandler'
XMLDOMStringList = require './XMLDOMStringList'
# Implements the DOMConfiguration interface
module.exports = class XMLDOMConfiguration
constructor: () ->
@defaultParams =
"canonical-form": false
"cdata-sections": false
"comments": false
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:1:completion | completion | XMLDOMErrorHandler = require './XMLDOMErrorHandler'
XMLDOMStringList = require './XMLDOMStringList'
# Implements the DOMConfiguration interface
module.exports = class XMLDOMConfiguration
constructor: () ->
@defaultParams =
"canonical-form": false
"cdata-sections": false
"comments": false
... | "well-formed": true
@params = clonedSelf = Object.create @defaultParams
# Returns the list of parameter names
Object.defineProperty @::, 'parameterNames', get: () ->
new XMLDOMStringList(Object.keys(@defaultParams))
# Gets the value of a parameter.
#
# `name` name of the parameter
getParameter:... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:2:raw_corpus | raw_corpus | # Sets the value of a parameter.
#
# `name` name of the parameter
# `value` new value or null if the user wishes to unset the parameter
setParameter: (name, value) ->
if value?
@params[name] = value
else
delete @params[name] | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 51 | 60 | ||
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Sets the value of a parameter.
#
# `name` name of the parameter
# `value` new value or null if the user wishes to unset the parameter
setParameter: (name, value) ->
if value?
@params[name] = value
else
delete @params[name]
``` | // Sets the value of a parameter.
// `name` name of the parameter
// `value` new value or null if the user wishes to unset the parameter
({
setParameter: function(name, value) {
if (value != null) {
return this.params[name] = value;
} else {
return delete this.params[name];
}
}
}); | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 51 | 60 |
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Sets the value of a parameter.
// `name` name of the parameter
// `value` new value or null if the user wishes to unset the parameter
({
setParameter: function(name, value) {
if (value != null) {
return this.params[name] = value;
} else {
... | # Sets the value of a parameter.
#
# `name` name of the parameter
# `value` new value or null if the user wishes to unset the parameter
setParameter: (name, value) ->
if value?
@params[name] = value
else
delete @params[name] | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 51 | 60 |
oozcitak/xmlbuilder-js:src/XMLDOMConfiguration.coffee:2:completion | completion | # Sets the value of a parameter.
#
# `name` name of the parameter
# `value` new value or null if the user wishes to unset the parameter | setParameter: (name, value) ->
if value?
@params[name] = value
else
delete @params[name] | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDOMConfiguration.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDOMConfiguration.coffee | 51 | 60 |
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:1:raw_corpus | raw_corpus | React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
lang = require '../locales/lang'
dispatcher = require '../dispatcher'
userActions = require '../actions/user'
div = React.createFactory 'div'
button = React.createFactory 'button'
input = React.crea... | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
lang = require '../locales/lang'
dispatcher = require '../dispatcher'
userActions = require '../actions/user'
div = React.createFactory 'div'
... | var Immutable, PureRenderMixin, React, button, cx, dispatcher, div, input, lang, userActions;
React = require('react');
Immutable = require('immutable');
PureRenderMixin = require('react-addons-pure-render-mixin');
lang = require('../locales/lang');
dispatcher = require('../dispatcher');
userActions = require('..... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, PureRenderMixin, React, button, cx, dispatcher, div, input, lang, userActions;
React = require('react');
Immutable = require('immutable');
PureRenderMixin = require('react-addons-pure-render-mixin');
lang = require('../locales/lang');
dispatcher... | React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
lang = require '../locales/lang'
dispatcher = require '../dispatcher'
userActions = require '../actions/user'
div = React.createFactory 'div'
button = React.createFactory 'button'
input = React.crea... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:1:completion | completion | React = require 'react'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
lang = require '../locales/lang'
dispatcher = require '../dispatcher'
userActions = require '../actions/user'
div = React.createFactory 'div'
button = React.createFactory 'button'
input = React.crea... | email: @props.data.get('email')
needSave: ->
giveName = @state.name.length > 0
nameChanged = @state.name isnt @props.data.get('name')
emailChanged = @state.email isnt @props.data.get('email')
giveName and (nameChanged or emailChanged)
onNameChange: (event) ->
@setState name: event.target.value... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:2:raw_corpus | raw_corpus | style =
padding: 20
div className: 'settings-profile paragraph', style: style,
div className: 'form-group',
div className: '', lang.getText('name')
input
type: 'text', className: 'form-control', value: @state.name
onChange: @onNameChange
div className: 'form-gr... | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 51 | 73 | ||
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
style =
padding: 20
div className: 'settings-profile paragraph', style: style,
div className: 'form-group',
div className: '', lang.getText('name')
input
type: 'text', className: 'form-control', value: @state.name
... | var style;
style = {
padding: 20
};
div({
className: 'settings-profile paragraph',
style: style
}, div({
className: 'form-group'
}, div({
className: ''
}, lang.getText('name')), input({
type: 'text',
className: 'form-control',
value: this.state.name,
onChange: this.onNameChange
})), div({
classNam... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 51 | 73 |
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var style;
style = {
padding: 20
};
div({
className: 'settings-profile paragraph',
style: style
}, div({
className: 'form-group'
}, div({
className: ''
}, lang.getText('name')), input({
type: 'text',
className: 'form-control',
value: this.state.na... | style =
padding: 20
div className: 'settings-profile paragraph', style: style,
div className: 'form-group',
div className: '', lang.getText('name')
input
type: 'text', className: 'form-control', value: @state.name
onChange: @onNameChange
div className: 'form-gr... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 51 | 73 |
jianliaoim/talk-os:talk-web/client/guest-app/settings-profile.coffee:2:completion | completion | style =
padding: 20
div className: 'settings-profile paragraph', style: style,
div className: 'form-group',
div className: '', lang.getText('name')
input
type: 'text', className: 'form-control', value: @state.name
onChange: @onNameChange
div className: 'form-gr... | input
type: 'text', className: 'form-control', value: @state.email
onChange: @onEmailChange
button
className: cx
'button': true
'is-primary': true
'is-extended': true
'last-line': true
'is-disabled': not @needSave()
onClick: @on... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/settings-profile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/settings-profile.coffee | 51 | 73 |
jianliaoim/talk-os:talk-api2x/server/schemas/search-favorite.coffee:1:raw_corpus | raw_corpus | {Schema} = require 'mongoose'
config = require 'config'
mongoosastic = require 'mongoosastic'
SearchMessageSchemaConstructor = require './constructors/search-message'
module.exports = SearchFavoriteSchema = SearchMessageSchemaConstructor()
return # @osv
SearchFavoriteSchema.add
_favoritedById:
type: Schema.Typ... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/search-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/search-favorite.coffee | 1 | 25 | ||
jianliaoim/talk-os:talk-api2x/server/schemas/search-favorite.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{Schema} = require 'mongoose'
config = require 'config'
mongoosastic = require 'mongoosastic'
SearchMessageSchemaConstructor = require './constructors/search-message'
module.exports = SearchFavoriteSchema = SearchMessageSchemaConstructor()
return # @osv
Search... | var Schema, SearchFavoriteSchema, SearchMessageSchemaConstructor, config, mongoosastic;
({Schema} = require('mongoose'));
config = require('config');
mongoosastic = require('mongoosastic');
SearchMessageSchemaConstructor = require('./constructors/search-message');
module.exports = SearchFavoriteSchema = SearchMess... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/schemas/search-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/search-favorite.coffee | 1 | 25 |
jianliaoim/talk-os:talk-api2x/server/schemas/search-favorite.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Schema, SearchFavoriteSchema, SearchMessageSchemaConstructor, config, mongoosastic;
({Schema} = require('mongoose'));
config = require('config');
mongoosastic = require('mongoosastic');
SearchMessageSchemaConstructor = require('./constructors/search-message... | {Schema} = require 'mongoose'
config = require 'config'
mongoosastic = require 'mongoosastic'
SearchMessageSchemaConstructor = require './constructors/search-message'
module.exports = SearchFavoriteSchema = SearchMessageSchemaConstructor()
return # @osv
SearchFavoriteSchema.add
_favoritedById:
type: Schema.Typ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/search-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/search-favorite.coffee | 1 | 25 |
jianliaoim/talk-os:talk-api2x/server/schemas/search-favorite.coffee:1:completion | completion | {Schema} = require 'mongoose'
config = require 'config'
mongoosastic = require 'mongoosastic'
SearchMessageSchemaConstructor = require './constructors/search-message'
module.exports = SearchFavoriteSchema = SearchMessageSchemaConstructor()
return # @osv
SearchFavoriteSchema.add
_favoritedById:
type: Schema.Typ... | es_index: 'not_analyzed'
_messageId:
type: Schema.Types.ObjectId
es_index: 'not_analyzed'
favoritedAt: type: Date
SearchFavoriteSchema.plugin mongoosastic,
index: 'talk_favorites_v2'
type: 'favorites'
host: config.searchHost
port: config.searchPort
protocol: config.searchProtocol
bulk: config.s... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/search-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/search-favorite.coffee | 1 | 25 |
gss/engine:src/engine/domains/Finite.coffee:1:raw_corpus | raw_corpus | Domain = require('../Domain')
Command = require('../Command')
Variable = require('../commands/Variable')
Constraint = require('../commands/Constraint')
class Finite extends Domain
priority: -10
#Solver: require('FD')
constructor: ->
super
#@solver = new FD.Space
variable: (name) ->
retu... | CoffeeScript | gss/engine | src/engine/domains/Finite.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Finite.coffee | 1 | 50 | ||
gss/engine:src/engine/domains/Finite.coffee:1:completion | completion | Domain = require('../Domain')
Command = require('../Command')
Variable = require('../commands/Variable')
Constraint = require('../commands/Constraint')
class Finite extends Domain
priority: -10
#Solver: require('FD')
constructor: ->
super
#@solver = new FD.Space
variable: (name) ->
retu... | return @solver.distinct.apply(@solver, arguments)
'<=': (left, right) ->
return @solver.lte left, right
'>=': (left, right) ->
return @solver.gte left, right
'<': (left, right) ->
return @solver.lt left, right
'>': (left, right) ->
return @solver.gt left, right
Finite.Variable = ... | CoffeeScript | CoffeeScript | gss/engine | src/engine/domains/Finite.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Finite.coffee | 1 | 50 |
gss/engine:src/engine/domains/Finite.coffee:2:raw_corpus | raw_corpus | '/': (left, right) ->
return @solver.divide left, right
module.exports = Finite | CoffeeScript | gss/engine | src/engine/domains/Finite.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Finite.coffee | 51 | 56 | ||
gss/engine:src/engine/domains/Finite.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'/': (left, right) ->
return @solver.divide left, right
module.exports = Finite
``` | ({
'/': function(left, right) {
return this.solver.divide(left, right);
}
});
module.exports = Finite; | CoffeeScript | JavaScript | gss/engine | src/engine/domains/Finite.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Finite.coffee | 51 | 56 |
gss/engine:src/engine/domains/Finite.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'/': function(left, right) {
return this.solver.divide(left, right);
}
});
module.exports = Finite;
``` | '/': (left, right) ->
return @solver.divide left, right
module.exports = Finite | JavaScript | CoffeeScript | gss/engine | src/engine/domains/Finite.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Finite.coffee | 51 | 56 |
gss/engine:src/engine/domains/Finite.coffee:2:completion | completion | '/': (left, right) ->
return @solver.divide left, right | module.exports = Finite | CoffeeScript | CoffeeScript | gss/engine | src/engine/domains/Finite.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Finite.coffee | 51 | 56 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.timeoutID = null;
// create HTML DOM of list view if i... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.tim... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | $menu.on 'mousemove.atwho-view','li', (e) =>
# If the mouse hasn't actually moved then exit.
return if lastCoordX == e.clientX and lastCoordY == e.clientY
lastCoordX = e.clientX
lastCoordY = e.clientY
$cur = $(e.currentTarget)
return if $cur.hasClass('cur')
$menu.find('.cur').r... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | if ($li = @$el.find ".cur").length
content = @context.insertContentFor $li
@context._stopDelayedCall()
@context.insert @context.callbacks("beforeInsert").call(@context, content, $li, e), $li
@context.trigger "inserted", [$li, e]
this.hide(e)
@stopShowing = yes if @context.getOpt("hide... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 53 | 102 | ||
ichord/At.js:src/view.coffee:2:completion | completion | if ($li = @$el.find ".cur").length
content = @context.insertContentFor $li
@context._stopDelayedCall()
@context.insert @context.callbacks("beforeInsert").call(@context, content, $li, e), $li
@context.trigger "inserted", [$li, e]
this.hide(e)
@stopShowing = yes if @context.getOpt("hide... | nextEl = next[0]
offset = nextEl.offsetTop + nextEl.offsetHeight + (if nextEl.nextSibling then nextEl.nextSibling.offsetHeight else 0)
@scrollTop Math.max(0, offset - this.$el.height())
prev: ->
cur = @$el.find('.cur').removeClass('cur')
prev = cur.prev()
prev = @$el.find('li:last') if not prev.l... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:3:raw_corpus | raw_corpus | @$el.show()
@$el.scrollTop 0
@context.trigger 'shown'
this.reposition(rect) if rect = @context.rect()
hide: (e, time) ->
return if not this.visible()
if isNaN(time)
@$el.hide()
@context.trigger 'hidden', [e]
else
callback = => this.hide()
clearTimeout @timeoutID
... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 103 | 136 | ||
ichord/At.js:src/view.coffee:3:completion | completion | @$el.show()
@$el.scrollTop 0
@context.trigger 'shown'
this.reposition(rect) if rect = @context.rect()
hide: (e, time) ->
return if not this.visible()
if isNaN(time)
@$el.hide()
@context.trigger 'hidden', [e]
else
callback = => this.hide()
clearTimeout @timeoutID
... | if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.getOpt('displayTpl')
for item in list
item = $.extend {}, item, {'atwho-at': @context.at}
li = @context.callbacks("tplEval").call(@context, tpl, item, "o... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/view.coffee | 103 | 136 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a84457485c0521286481433e31edb9edf4e0eb10 | 5,250 | https://github.com/ichord/At.js/blob/a84457485c0521286481433e31edb9edf4e0eb10/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.timeoutID = null;
// create HTML DOM of list view if i... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | a84457485c0521286481433e31edb9edf4e0eb10 | 5,250 | https://github.com/ichord/At.js/blob/a84457485c0521286481433e31edb9edf4e0eb10/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.tim... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a84457485c0521286481433e31edb9edf4e0eb10 | 5,250 | https://github.com/ichord/At.js/blob/a84457485c0521286481433e31edb9edf4e0eb10/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | $menu.on 'mousemove.atwho-view','li', (e) =>
# If the mouse hasn't actually moved then exit.
return if lastCoordX == e.clientX and lastCoordY == e.clientY
lastCoordX = e.clientX
lastCoordY = e.clientY
$cur = $(e.currentTarget)
return if $cur.hasClass('cur')
$menu.find('.cur').r... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a84457485c0521286481433e31edb9edf4e0eb10 | 5,250 | https://github.com/ichord/At.js/blob/a84457485c0521286481433e31edb9edf4e0eb10/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 84bf075a3f88490ef01c844d262d54399828ab62 | 5,250 | https://github.com/ichord/At.js/blob/84bf075a3f88490ef01c844d262d54399828ab62/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.timeoutID = null;
// create HTML DOM of list view if i... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 84bf075a3f88490ef01c844d262d54399828ab62 | 5,250 | https://github.com/ichord/At.js/blob/84bf075a3f88490ef01c844d262d54399828ab62/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.tim... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 84bf075a3f88490ef01c844d262d54399828ab62 | 5,250 | https://github.com/ichord/At.js/blob/84bf075a3f88490ef01c844d262d54399828ab62/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | $menu.on 'mousemove.atwho-view','li', (e) =>
# If the mouse hasn't actually moved then exit.
return if lastCoordX == e.clientX and lastCoordY == e.clientY
lastCoordX = e.clientX
lastCoordY = e.clientY
$cur = $(e.currentTarget)
return if $cur.hasClass('cur')
$menu.find('.cur').r... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 84bf075a3f88490ef01c844d262d54399828ab62 | 5,250 | https://github.com/ichord/At.js/blob/84bf075a3f88490ef01c844d262d54399828ab62/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | b4be4ddfd86106d065c9921af4d9cba71da33d50 | 5,250 | https://github.com/ichord/At.js/blob/b4be4ddfd86106d065c9921af4d9cba71da33d50/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.timeoutID = null;
// create HTML DOM of list view if i... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | b4be4ddfd86106d065c9921af4d9cba71da33d50 | 5,250 | https://github.com/ichord/At.js/blob/b4be4ddfd86106d065c9921af4d9cba71da33d50/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.tim... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | b4be4ddfd86106d065c9921af4d9cba71da33d50 | 5,250 | https://github.com/ichord/At.js/blob/b4be4ddfd86106d065c9921af4d9cba71da33d50/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | $menu.on 'mousemove.atwho-view','li', (e) =>
# If the mouse hasn't actually moved then exit.
return if lastCoordX == e.clientX and lastCoordY == e.clientY
lastCoordX = e.clientX
lastCoordY = e.clientY
$cur = $(e.currentTarget)
return if $cur.hasClass('cur')
$menu.find('.cur').r... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | b4be4ddfd86106d065c9921af4d9cba71da33d50 | 5,250 | https://github.com/ichord/At.js/blob/b4be4ddfd86106d065c9921af4d9cba71da33d50/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 3 | 52 | ||
ichord/At.js:src/view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does... | var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.timeoutID = null;
// create HTML DOM of list view if i... | CoffeeScript | JavaScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var View;
View = class View {
// @param controller [Object] The Controller.
constructor(context) {
this.context = context;
this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>");
this.$elUl = this.$el.children();
this.tim... | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | JavaScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:1:completion | completion | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@$elUl = @$el.children();
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEve... | $(e.currentTarget).addClass 'cur'
.on 'click.atwho-view', 'li', (e) =>
$menu.find('.cur').removeClass 'cur'
$(e.currentTarget).addClass 'cur'
this.choose(e)
e.preventDefault()
# Check if view is visible
#
# @return [Boolean]
visible: ->
@$el.is(":visible")
highlighted: ->
... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 3 | 52 |
ichord/At.js:src/view.coffee:2:raw_corpus | raw_corpus | reposition: (rect) ->
_window = if @context.app.iframeAsRoot then @context.app.window else window
if rect.bottom + @$el.height() - $(_window).scrollTop() > $(_window).height()
rect.bottom = rect.top - @$el.height()
if rect.left > overflowOffset = $(_window).width() - @$el.width() - 5
rect.left =... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 53 | 102 | ||
ichord/At.js:src/view.coffee:2:completion | completion | reposition: (rect) ->
_window = if @context.app.iframeAsRoot then @context.app.window else window
if rect.bottom + @$el.height() - $(_window).scrollTop() > $(_window).height()
rect.bottom = rect.top - @$el.height()
if rect.left > overflowOffset = $(_window).width() - @$el.width() - 5
rect.left =... | prev.addClass 'cur'
prevEl = prev[0]
offset = prevEl.offsetTop + prevEl.offsetHeight + (if prevEl.nextSibling then prevEl.nextSibling.offsetHeight else 0)
@scrollTop Math.max(0, offset - this.$el.height())
scrollTop: (scrollTop) ->
scrollDuration = @context.getOpt('scrollDuration')
if scrollDurat... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 53 | 102 |
ichord/At.js:src/view.coffee:3:raw_corpus | raw_corpus | @$el.hide()
@context.trigger 'hidden', [e]
else
callback = => this.hide()
clearTimeout @timeoutID
@timeoutID = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return
@$el.find('ul').empty()
... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 103 | 128 | ||
ichord/At.js:src/view.coffee:3:completion | completion | @$el.hide()
@context.trigger 'hidden', [e]
else
callback = => this.hide()
clearTimeout @timeoutID
@timeoutID = setTimeout callback, time
# render list view
render: (list) ->
if not ($.isArray(list) and list.length > 0)
this.hide()
return | @$el.find('ul').empty()
$ul = @$el.find('ul')
tpl = @context.getOpt('displayTpl')
for item in list
item = $.extend {}, item, {'atwho-at': @context.at}
li = @context.callbacks("tplEval").call(@context, tpl, item, "onDisplay")
$li = $ @context.callbacks("highlighter").call(@context, li, @co... | CoffeeScript | CoffeeScript | ichord/At.js | src/view.coffee | MIT | 9cd2453ead45c601c9d33148662504dc5ade92e5 | 5,250 | https://github.com/ichord/At.js/blob/9cd2453ead45c601c9d33148662504dc5ade92e5/src/view.coffee | 103 | 128 |
ichord/At.js:src/view.coffee:1:raw_corpus | raw_corpus | class View
# @param controller [Object] The Controller.
constructor: (@context) ->
@$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>")
@timeoutID = null
# create HTML DOM of list view if it does not exist
@context.$el.append(@$el)
this.bindEvent()
init: ->
id = @con... | CoffeeScript | ichord/At.js | src/view.coffee | MIT | a0e08a806ff67996d3fa20f52ece29f32077b39a | 5,250 | https://github.com/ichord/At.js/blob/a0e08a806ff67996d3fa20f52ece29f32077b39a/src/view.coffee | 3 | 52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.