id
stringlengths
34
124
type
stringclasses
4 values
prompt
stringlengths
0
4.95k
response
stringlengths
21
4.89k
source_lang
stringclasses
3 values
target_lang
stringclasses
2 values
repo
stringclasses
75 values
path
stringlengths
10
88
license
stringclasses
1 value
commit
stringlengths
40
40
stars
int64
431
18.7k
source_url
stringlengths
86
176
line_start
int64
1
214
line_end
int64
3
253
jianliaoim/talk-os:talk-web/client/module/light-modal.coffee:1:completion
completion
cx = require 'classnames' React = require 'react' keycode = require 'keycode' mixinLayered = require '../mixin/layered' Transition = React.createFactory require './transition' { a, div, span, noscript } = React.DOM T = React.PropTypes module.exports = React.createClass displayName: 'light-modal' mixins: [mixinL...
unbindWindowEvents: -> window.removeEventListener 'keydown', @onWindowKeydown onWindowKeydown: (event) -> if keycode(event.keyCode) is 'esc' @onCloseClick() onCloseClick: -> @props.onCloseClick() onBackdropClick: (event) -> event.stopPropagation() if not @props.showCornerClose && even...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/module/light-modal.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-modal.coffee
1
50
jianliaoim/talk-os:talk-web/client/module/light-modal.coffee:2:raw_corpus
raw_corpus
span className: 'name', @props.title span className: 'ti ti-remove', onClick: @onCloseClick @props.children render: -> null
CoffeeScript
jianliaoim/talk-os
talk-web/client/module/light-modal.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-modal.coffee
51
56
soyjavi/QuoJS:spec/2_ajax.coffee:1:raw_corpus
raw_corpus
describe "Ajax", -> url = "http://tapquo.com" it "can configure ajax settings", -> $$.ajaxSettings = async : false timeout : 1000 expect($$.ajaxSettings.async).toBeFalsy() expect($$.ajaxSettings.timeout).toEqual 1000 it "can make a ajax request", -> spyOn $$, "ajax" $$.ajax ...
CoffeeScript
soyjavi/QuoJS
spec/2_ajax.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/2_ajax.coffee
1
50
soyjavi/QuoJS:spec/2_ajax.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript describe "Ajax", -> url = "http://tapquo.com" it "can configure ajax settings", -> $$.ajaxSettings = async : false timeout : 1000 expect($$.ajaxSettings.async).toBeFalsy() expect($$.ajaxSettings.timeout).toEqual 1000 it "can ma...
describe("Ajax", function() { var url; url = "http://tapquo.com"; it("can configure ajax settings", function() { $$.ajaxSettings = { async: false, timeout: 1000 }; expect($$.ajaxSettings.async).toBeFalsy(); return expect($$.ajaxSettings.timeout).toEqual(1000); }); it("can make a aj...
CoffeeScript
JavaScript
soyjavi/QuoJS
spec/2_ajax.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/2_ajax.coffee
1
50
soyjavi/QuoJS:spec/2_ajax.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript describe("Ajax", function() { var url; url = "http://tapquo.com"; it("can configure ajax settings", function() { $$.ajaxSettings = { async: false, timeout: 1000 }; expect($$.ajaxSettings.async).toBeFalsy(); return expect($$.ajaxSet...
describe "Ajax", -> url = "http://tapquo.com" it "can configure ajax settings", -> $$.ajaxSettings = async : false timeout : 1000 expect($$.ajaxSettings.async).toBeFalsy() expect($$.ajaxSettings.timeout).toEqual 1000 it "can make a ajax request", -> spyOn $$, "ajax" $$.ajax ...
JavaScript
CoffeeScript
soyjavi/QuoJS
spec/2_ajax.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/2_ajax.coffee
1
50
soyjavi/QuoJS:spec/2_ajax.coffee:1:completion
completion
describe "Ajax", -> url = "http://tapquo.com" it "can configure ajax settings", -> $$.ajaxSettings = async : false timeout : 1000 expect($$.ajaxSettings.async).toBeFalsy() expect($$.ajaxSettings.timeout).toEqual 1000 it "can make a ajax request", -> spyOn $$, "ajax" $$.ajax ...
$$.ajax url : "http:/asdad" success : _success error : _error expect(_success).toHaveBeenCalled() expect(_error).not.toHaveBeenCalled() it "should execute the error callback function", -> spyOn($$, "ajax").andCallFake (options) -> options.error() _error = jasmine.createSpy() ...
CoffeeScript
CoffeeScript
soyjavi/QuoJS
spec/2_ajax.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/2_ajax.coffee
1
50
oozcitak/xmlbuilder-js:test/guards/raw.coffee:1:raw_corpus
raw_corpus
suite 'CDATA Guards:', -> test 'constructor', -> err( () -> xml('test').raw() Error "Missing raw text. parent: <test>" )
CoffeeScript
oozcitak/xmlbuilder-js
test/guards/raw.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/raw.coffee
1
7
oozcitak/xmlbuilder-js:test/guards/raw.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript suite 'CDATA Guards:', -> test 'constructor', -> err( () -> xml('test').raw() Error "Missing raw text. parent: <test>" ) ```
suite('CDATA Guards:', function() { return test('constructor', function() { return err(function() { return xml('test').raw(); }, Error, "Missing raw text. parent: <test>"); }); });
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
test/guards/raw.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/raw.coffee
1
7
oozcitak/xmlbuilder-js:test/guards/raw.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript suite('CDATA Guards:', function() { return test('constructor', function() { return err(function() { return xml('test').raw(); }, Error, "Missing raw text. parent: <test>"); }); }); ```
suite 'CDATA Guards:', -> test 'constructor', -> err( () -> xml('test').raw() Error "Missing raw text. parent: <test>" )
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
test/guards/raw.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/raw.coffee
1
7
oozcitak/xmlbuilder-js:test/guards/raw.coffee:1:completion
completion
suite 'CDATA Guards:', -> test 'constructor', -> err(
() -> xml('test').raw() Error "Missing raw text. parent: <test>" )
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
test/guards/raw.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/raw.coffee
1
7
gss/engine:src/engine/commands/Variable.coffee:1:raw_corpus
raw_corpus
Command = require('../Command') class Variable extends Command type: 'Variable' signature: [ property: ['String'] ] log: -> unlog: -> constructor: -> before: (args, engine, operation, continuation, scope, ascender, ascending) -> if (value = ascending?.values?[args[0]])? return value ...
CoffeeScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
1
50
gss/engine:src/engine/commands/Variable.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Command = require('../Command') class Variable extends Command type: 'Variable' signature: [ property: ['String'] ] log: -> unlog: -> constructor: -> before: (args, engine, operation, continuation, scope, ascender, ascending) -> if (val...
var Command, Variable; Command = require('../Command'); Variable = (function() { class Variable extends Command { log() {} unlog() {} constructor() {} before(args, engine, operation, continuation, scope, ascender, ascending) { var ref, value; if ((value = ascending != null ? (ref = as...
CoffeeScript
JavaScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
1
50
gss/engine:src/engine/commands/Variable.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Command, Variable; Command = require('../Command'); Variable = (function() { class Variable extends Command { log() {} unlog() {} constructor() {} before(args, engine, operation, continuation, scope, ascender, ascending) { var ref, ...
Command = require('../Command') class Variable extends Command type: 'Variable' signature: [ property: ['String'] ] log: -> unlog: -> constructor: -> before: (args, engine, operation, continuation, scope, ascender, ascending) -> if (value = ascending?.values?[args[0]])? return value ...
JavaScript
CoffeeScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
1
50
gss/engine:src/engine/commands/Variable.coffee:1:completion
completion
Command = require('../Command') class Variable extends Command type: 'Variable' signature: [ property: ['String'] ] log: -> unlog: -> constructor: -> before: (args, engine, operation, continuation, scope, ascender, ascending) -> if (value = ascending?.values?[args[0]])? return value ...
#if engine.replaced?[name] # delete engine.replaced[name] (engine.declared ||= {})[name] = variable return variable # Undeclare variable in given domain, outputs "null" once undeclare: (engine, variable, quick) -> if quick (engine.replaced ||= {})[variable.name] = variable else (en...
CoffeeScript
CoffeeScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
1
50
gss/engine:src/engine/commands/Variable.coffee:2:raw_corpus
raw_corpus
Variable.Expression.algebra = '+': (left, right) -> return left + right '-': (left, right) -> return left - right '*': (left, right) -> return left * right '/': (left, right) -> return left / right 'min': (left, right) -> return Math.min(left, right) 'max': (left, right) -> retu...
CoffeeScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
51
71
gss/engine:src/engine/commands/Variable.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Variable.Expression.algebra = '+': (left, right) -> return left + right '-': (left, right) -> return left - right '*': (left, right) -> return left * right '/': (left, right) -> return left / right 'min': (left, right) -> return ...
Variable.Expression.algebra = { '+': function(left, right) { return left + right; }, '-': function(left, right) { return left - right; }, '*': function(left, right) { return left * right; }, '/': function(left, right) { return left / right; }, 'min': function(left, right) { return ...
CoffeeScript
JavaScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
51
71
gss/engine:src/engine/commands/Variable.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Variable.Expression.algebra = { '+': function(left, right) { return left + right; }, '-': function(left, right) { return left - right; }, '*': function(left, right) { return left * right; }, '/': function(left, right) { return left / r...
Variable.Expression.algebra = '+': (left, right) -> return left + right '-': (left, right) -> return left - right '*': (left, right) -> return left * right '/': (left, right) -> return left / right 'min': (left, right) -> return Math.min(left, right) 'max': (left, right) -> retu...
JavaScript
CoffeeScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
51
71
gss/engine:src/engine/commands/Variable.coffee:2:completion
completion
Variable.Expression.algebra = '+': (left, right) -> return left + right '-': (left, right) -> return left - right '*': (left, right) -> return left * right
'/': (left, right) -> return left / right 'min': (left, right) -> return Math.min(left, right) 'max': (left, right) -> return Math.max(left, right) module.exports = Variable
CoffeeScript
CoffeeScript
gss/engine
src/engine/commands/Variable.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/commands/Variable.coffee
51
71
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:raw_corpus
raw_corpus
root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func root.itBehavesLike = (name) -> examples = sharedExamples[name] throw "No shar...
CoffeeScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func root.itBehavesLike = (na...
var _, grunt, root, sharedExamples; root = global; _ = require('underscore'); grunt = require('grunt'); sharedExamples = {}; root.sharedExamplesFor = function(name, func) { if (sharedExamples[name] != null) { throw `Shared examples named ${name} already exists!`; } return sharedExamples[name] = func; }; ...
CoffeeScript
JavaScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var _, grunt, root, sharedExamples; root = global; _ = require('underscore'); grunt = require('grunt'); sharedExamples = {}; root.sharedExamplesFor = function(name, func) { if (sharedExamples[name] != null) { throw `Shared examples named ${name} already ...
root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func root.itBehavesLike = (name) -> examples = sharedExamples[name] throw "No shar...
JavaScript
CoffeeScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:completion
completion
root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func
root.itBehavesLike = (name) -> examples = sharedExamples[name] throw "No shared examples named `#{name}` found!" unless examples? describe("Shared examples for #{name}", examples) _.each grunt.file.expand("#{__dirname}/shared-example-groups/**/*.{js,coffee}"), (f) -> require(f).registerExamples()
CoffeeScript
CoffeeScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:raw_corpus
raw_corpus
root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func root.itBehavesLike = (name) -> examples = sharedExamples[name] throw "No shar...
CoffeeScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4
1,168
https://github.com/linemanjs/lineman/blob/0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func root.itBehavesLike = (na...
var _, grunt, root, sharedExamples; root = global; _ = require('underscore'); grunt = require('grunt'); sharedExamples = {}; root.sharedExamplesFor = function(name, func) { if (sharedExamples[name] != null) { throw `Shared examples named ${name} already exists!`; } return sharedExamples[name] = func; }; ...
CoffeeScript
JavaScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4
1,168
https://github.com/linemanjs/lineman/blob/0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var _, grunt, root, sharedExamples; root = global; _ = require('underscore'); grunt = require('grunt'); sharedExamples = {}; root.sharedExamplesFor = function(name, func) { if (sharedExamples[name] != null) { throw `Shared examples named ${name} already ...
root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func root.itBehavesLike = (name) -> examples = sharedExamples[name] throw "No shar...
JavaScript
CoffeeScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4
1,168
https://github.com/linemanjs/lineman/blob/0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
linemanjs/lineman:test/spec-e2e/helpers/shared-example-groups.coffee:1:completion
completion
root = global _ = require('underscore') grunt = require('grunt') sharedExamples = {} root.sharedExamplesFor = (name, func) -> throw "Shared examples named #{name} already exists!" if sharedExamples[name]? sharedExamples[name] = func
root.itBehavesLike = (name) -> examples = sharedExamples[name] throw "No shared examples named `#{name}` found!" unless examples? describe("Shared examples for #{name}", examples) _(grunt.file.expand("#{__dirname}/shared-example-groups/**/*.{js,coffee}")).each (f) -> require(f).registerExamples()
CoffeeScript
CoffeeScript
linemanjs/lineman
test/spec-e2e/helpers/shared-example-groups.coffee
MIT
0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4
1,168
https://github.com/linemanjs/lineman/blob/0c4c84368a5dc3661eb53bb23d805fae0e1a6cd4/test/spec-e2e/helpers/shared-example-groups.coffee
1
16
jianliaoim/talk-os:talk-web/client/util/search.coffee:1:raw_corpus
raw_corpus
indexOfPinyins = (pinyins, query) -> return -1 if not pinyins if pinyins.first() is 'general' pinyins = pinyins.concat(generalPinyin.pinyins) pos = pinyins .map (pinyin) -> pinyin.indexOf(query) .filter (pos) -> pos >= 0 .min() if pos >= 0 then pos else -1 exports.indexOfPinyins = i...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
19
31
jianliaoim/talk-os:talk-web/client/util/search.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript indexOfPinyins = (pinyins, query) -> return -1 if not pinyins if pinyins.first() is 'general' pinyins = pinyins.concat(generalPinyin.pinyins) pos = pinyins .map (pinyin) -> pinyin.indexOf(query) .filter (pos) -> pos >= 0 .min() ...
var indexOfPinyins; indexOfPinyins = function(pinyins, query) { var pos; if (!pinyins) { return -1; } if (pinyins.first() === 'general') { pinyins = pinyins.concat(generalPinyin.pinyins); } pos = pinyins.map(function(pinyin) { return pinyin.indexOf(query); }).filter(function(pos) { return...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
19
31
jianliaoim/talk-os:talk-web/client/util/search.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOfPinyins; indexOfPinyins = function(pinyins, query) { var pos; if (!pinyins) { return -1; } if (pinyins.first() === 'general') { pinyins = pinyins.concat(generalPinyin.pinyins); } pos = pinyins.map(function(pinyin) { return pinyin...
indexOfPinyins = (pinyins, query) -> return -1 if not pinyins if pinyins.first() is 'general' pinyins = pinyins.concat(generalPinyin.pinyins) pos = pinyins .map (pinyin) -> pinyin.indexOf(query) .filter (pos) -> pos >= 0 .min() if pos >= 0 then pos else -1 exports.indexOfPinyins = i...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
19
31
jianliaoim/talk-os:talk-web/client/util/search.coffee:1:completion
completion
indexOfPinyins = (pinyins, query) -> return -1 if not pinyins if pinyins.first() is 'general' pinyins = pinyins.concat(generalPinyin.pinyins) pos = pinyins .map (pinyin) ->
pinyin.indexOf(query) .filter (pos) -> pos >= 0 .min() if pos >= 0 then pos else -1 exports.indexOfPinyins = indexOfPinyins
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
19
31
jianliaoim/talk-os:talk-web/client/util/search.coffee:2:raw_corpus
raw_corpus
exports.forMember = (member, query, opt = {}) -> searchQuery = query.toLowerCase() if detect.isTalkai(member) member = member.merge(xiaoaiPinyin) return true if member.get('name')?.toLowerCase().indexOf(searchQuery) >= 0 return true if indexOfPinyins(member.get('pinyins'), searchQuery) >= 0 return true if...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
33
46
jianliaoim/talk-os:talk-web/client/util/search.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forMember = (member, query, opt = {}) -> searchQuery = query.toLowerCase() if detect.isTalkai(member) member = member.merge(xiaoaiPinyin) return true if member.get('name')?.toLowerCase().indexOf(searchQuery) >= 0 return true if indexOfPinyins(...
exports.forMember = function(member, query, opt = {}) { var alias, aliasPinyin, ref, ref1, searchQuery; searchQuery = query.toLowerCase(); if (detect.isTalkai(member)) { member = member.merge(xiaoaiPinyin); } if (((ref = member.get('name')) != null ? ref.toLowerCase().indexOf(searchQuery) : void 0) >= 0) ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
33
46
jianliaoim/talk-os:talk-web/client/util/search.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forMember = function(member, query, opt = {}) { var alias, aliasPinyin, ref, ref1, searchQuery; searchQuery = query.toLowerCase(); if (detect.isTalkai(member)) { member = member.merge(xiaoaiPinyin); } if (((ref = member.get('name')) != null ? ...
exports.forMember = (member, query, opt = {}) -> searchQuery = query.toLowerCase() if detect.isTalkai(member) member = member.merge(xiaoaiPinyin) return true if member.get('name')?.toLowerCase().indexOf(searchQuery) >= 0 return true if indexOfPinyins(member.get('pinyins'), searchQuery) >= 0 return true if...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
33
46
jianliaoim/talk-os:talk-web/client/util/search.coffee:2:completion
completion
exports.forMember = (member, query, opt = {}) -> searchQuery = query.toLowerCase() if detect.isTalkai(member) member = member.merge(xiaoaiPinyin) return true if member.get('name')?.toLowerCase().indexOf(searchQuery) >= 0 return true if indexOfPinyins(member.get('pinyins'), searchQuery) >= 0 return true if...
alias = opt.getAlias?(member.get('_id'))?.toLowerCase() if alias aliasPinyin = pinyinUtil.make(alias) return true if alias.indexOf(searchQuery) >= 0 return true if indexOfPinyins(aliasPinyin.get('pinyins'), searchQuery) >= 0 return true if indexOfPinyins(aliasPinyin.get('pys'), searchQuery) >= 0 ret...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
33
46
jianliaoim/talk-os:talk-web/client/util/search.coffee:3:raw_corpus
raw_corpus
exports.forTopic = (topic, query) -> searchQuery = query.toLowerCase() return true if topic.get('topic')?.toLowerCase().indexOf(searchQuery) >= 0 return true if indexOfPinyins(topic.get('pinyins'), searchQuery) >= 0 return true if indexOfPinyins(topic.get('pys'), searchQuery) >= 0 return false
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
48
53
jianliaoim/talk-os:talk-web/client/util/search.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forTopic = (topic, query) -> searchQuery = query.toLowerCase() return true if topic.get('topic')?.toLowerCase().indexOf(searchQuery) >= 0 return true if indexOfPinyins(topic.get('pinyins'), searchQuery) >= 0 return true if indexOfPinyins(topic.get...
exports.forTopic = function(topic, query) { var ref, searchQuery; searchQuery = query.toLowerCase(); if (((ref = topic.get('topic')) != null ? ref.toLowerCase().indexOf(searchQuery) : void 0) >= 0) { return true; } if (indexOfPinyins(topic.get('pinyins'), searchQuery) >= 0) { return true; } if (in...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
48
53
jianliaoim/talk-os:talk-web/client/util/search.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forTopic = function(topic, query) { var ref, searchQuery; searchQuery = query.toLowerCase(); if (((ref = topic.get('topic')) != null ? ref.toLowerCase().indexOf(searchQuery) : void 0) >= 0) { return true; } if (indexOfPinyins(topic.get('pinyin...
exports.forTopic = (topic, query) -> searchQuery = query.toLowerCase() return true if topic.get('topic')?.toLowerCase().indexOf(searchQuery) >= 0 return true if indexOfPinyins(topic.get('pinyins'), searchQuery) >= 0 return true if indexOfPinyins(topic.get('pys'), searchQuery) >= 0 return false
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
48
53
jianliaoim/talk-os:talk-web/client/util/search.coffee:3:completion
completion
exports.forTopic = (topic, query) -> searchQuery = query.toLowerCase() return true if topic.get('topic')?.toLowerCase().indexOf(searchQuery) >= 0
return true if indexOfPinyins(topic.get('pinyins'), searchQuery) >= 0 return true if indexOfPinyins(topic.get('pys'), searchQuery) >= 0 return false
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
48
53
jianliaoim/talk-os:talk-web/client/util/search.coffee:4:raw_corpus
raw_corpus
exports.forStory = (story, query) -> return false if not story.get('title') searchQuery = query.toLowerCase() return true if story.get('title').toLowerCase().indexOf(searchQuery) >= 0 titlePinyin = pinyinUtil.make(story.get('title')) return true if indexOfPinyins(titlePinyin.get('pinyins'), searchQuery) >= 0 ...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
55
62
jianliaoim/talk-os:talk-web/client/util/search.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forStory = (story, query) -> return false if not story.get('title') searchQuery = query.toLowerCase() return true if story.get('title').toLowerCase().indexOf(searchQuery) >= 0 titlePinyin = pinyinUtil.make(story.get('title')) return true if inde...
exports.forStory = function(story, query) { var searchQuery, titlePinyin; if (!story.get('title')) { return false; } searchQuery = query.toLowerCase(); if (story.get('title').toLowerCase().indexOf(searchQuery) >= 0) { return true; } titlePinyin = pinyinUtil.make(story.get('title')); if (indexOfP...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
55
62
jianliaoim/talk-os:talk-web/client/util/search.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forStory = function(story, query) { var searchQuery, titlePinyin; if (!story.get('title')) { return false; } searchQuery = query.toLowerCase(); if (story.get('title').toLowerCase().indexOf(searchQuery) >= 0) { return true; } titlePinyi...
exports.forStory = (story, query) -> return false if not story.get('title') searchQuery = query.toLowerCase() return true if story.get('title').toLowerCase().indexOf(searchQuery) >= 0 titlePinyin = pinyinUtil.make(story.get('title')) return true if indexOfPinyins(titlePinyin.get('pinyins'), searchQuery) >= 0 ...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
55
62
jianliaoim/talk-os:talk-web/client/util/search.coffee:4:completion
completion
exports.forStory = (story, query) -> return false if not story.get('title') searchQuery = query.toLowerCase() return true if story.get('title').toLowerCase().indexOf(searchQuery) >= 0
titlePinyin = pinyinUtil.make(story.get('title')) return true if indexOfPinyins(titlePinyin.get('pinyins'), searchQuery) >= 0 return true if indexOfPinyins(titlePinyin.get('pys'), searchQuery) >= 0 return false
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
55
62
jianliaoim/talk-os:talk-web/client/util/search.coffee:5:raw_corpus
raw_corpus
exports.forMembers = (members, query, opt = {}) -> searchQuery = query.toLowerCase() members .filter (item) -> exports.forMember(item, query, opt)
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
64
68
jianliaoim/talk-os:talk-web/client/util/search.coffee:5:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forMembers = (members, query, opt = {}) -> searchQuery = query.toLowerCase() members .filter (item) -> exports.forMember(item, query, opt) ```
exports.forMembers = function(members, query, opt = {}) { var searchQuery; searchQuery = query.toLowerCase(); return members.filter(function(item) { return exports.forMember(item, query, opt); }); };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
64
68
jianliaoim/talk-os:talk-web/client/util/search.coffee:5:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forMembers = function(members, query, opt = {}) { var searchQuery; searchQuery = query.toLowerCase(); return members.filter(function(item) { return exports.forMember(item, query, opt); }); }; ```
exports.forMembers = (members, query, opt = {}) -> searchQuery = query.toLowerCase() members .filter (item) -> exports.forMember(item, query, opt)
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
64
68
jianliaoim/talk-os:talk-web/client/util/search.coffee:5:completion
completion
exports.forMembers = (members, query, opt = {}) -> searchQuery = query.toLowerCase()
members .filter (item) -> exports.forMember(item, query, opt)
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
64
68
jianliaoim/talk-os:talk-web/client/util/search.coffee:6:raw_corpus
raw_corpus
exports.forInvitations = (invitations, query) -> searchQuery = query.toLowerCase() invitations .filter (invitation) -> pa = invitation.get('name')?.toLowerCase().indexOf(searchQuery) invitation.set 'pos', pa pa >= 0 .sort (a, b) -> a.get('pos') - b.get('pos')
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
70
80
jianliaoim/talk-os:talk-web/client/util/search.coffee:6:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forInvitations = (invitations, query) -> searchQuery = query.toLowerCase() invitations .filter (invitation) -> pa = invitation.get('name')?.toLowerCase().indexOf(searchQuery) invitation.set 'pos', pa pa >= 0 .sort (a, b) -> a.get...
exports.forInvitations = function(invitations, query) { var searchQuery; searchQuery = query.toLowerCase(); return invitations.filter(function(invitation) { var pa, ref; pa = (ref = invitation.get('name')) != null ? ref.toLowerCase().indexOf(searchQuery) : void 0; invitation.set('pos', pa); return...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
70
80
jianliaoim/talk-os:talk-web/client/util/search.coffee:6:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forInvitations = function(invitations, query) { var searchQuery; searchQuery = query.toLowerCase(); return invitations.filter(function(invitation) { var pa, ref; pa = (ref = invitation.get('name')) != null ? ref.toLowerCase().indexOf(searchQue...
exports.forInvitations = (invitations, query) -> searchQuery = query.toLowerCase() invitations .filter (invitation) -> pa = invitation.get('name')?.toLowerCase().indexOf(searchQuery) invitation.set 'pos', pa pa >= 0 .sort (a, b) -> a.get('pos') - b.get('pos')
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
70
80
jianliaoim/talk-os:talk-web/client/util/search.coffee:6:completion
completion
exports.forInvitations = (invitations, query) -> searchQuery = query.toLowerCase() invitations .filter (invitation) ->
pa = invitation.get('name')?.toLowerCase().indexOf(searchQuery) invitation.set 'pos', pa pa >= 0 .sort (a, b) -> a.get('pos') - b.get('pos')
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
70
80
jianliaoim/talk-os:talk-web/client/util/search.coffee:7:raw_corpus
raw_corpus
exports.forTopics = (topics, query) -> topics .filter (item) -> exports.forTopic(item, query)
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
82
85
jianliaoim/talk-os:talk-web/client/util/search.coffee:7:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forTopics = (topics, query) -> topics .filter (item) -> exports.forTopic(item, query) ```
exports.forTopics = function(topics, query) { return topics.filter(function(item) { return exports.forTopic(item, query); }); };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
82
85
jianliaoim/talk-os:talk-web/client/util/search.coffee:7:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forTopics = function(topics, query) { return topics.filter(function(item) { return exports.forTopic(item, query); }); }; ```
exports.forTopics = (topics, query) -> topics .filter (item) -> exports.forTopic(item, query)
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
82
85
jianliaoim/talk-os:talk-web/client/util/search.coffee:7:completion
completion
exports.forTopics = (topics, query) -> topics
.filter (item) -> exports.forTopic(item, query)
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
82
85
jianliaoim/talk-os:talk-web/client/util/search.coffee:8:raw_corpus
raw_corpus
exports.forEmojis = (emojis, query) -> emojis.filter (name) -> name.indexOf(query) is 0
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
87
89
jianliaoim/talk-os:talk-web/client/util/search.coffee:8:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forEmojis = (emojis, query) -> emojis.filter (name) -> name.indexOf(query) is 0 ```
exports.forEmojis = function(emojis, query) { return emojis.filter(function(name) { return name.indexOf(query) === 0; }); };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
87
89
jianliaoim/talk-os:talk-web/client/util/search.coffee:8:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forEmojis = function(emojis, query) { return emojis.filter(function(name) { return name.indexOf(query) === 0; }); }; ```
exports.forEmojis = (emojis, query) -> emojis.filter (name) -> name.indexOf(query) is 0
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
87
89
jianliaoim/talk-os:talk-web/client/util/search.coffee:9:raw_corpus
raw_corpus
exports.forTags = (tags, query) -> searchQuery = query.trim().toLowerCase() if searchQuery.length > 0 tags.filter (tag) -> tag.get('name').toLowerCase().indexOf(searchQuery) >= 0 else tags # see util/configs-inte for styles
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
91
99
jianliaoim/talk-os:talk-web/client/util/search.coffee:9:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.forTags = (tags, query) -> searchQuery = query.trim().toLowerCase() if searchQuery.length > 0 tags.filter (tag) -> tag.get('name').toLowerCase().indexOf(searchQuery) >= 0 else tags # see util/configs-inte for styles ```
exports.forTags = function(tags, query) { var searchQuery; searchQuery = query.trim().toLowerCase(); if (searchQuery.length > 0) { return tags.filter(function(tag) { return tag.get('name').toLowerCase().indexOf(searchQuery) >= 0; }); } else { return tags; } }; // see util/configs-inte for s...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
91
99
jianliaoim/talk-os:talk-web/client/util/search.coffee:9:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.forTags = function(tags, query) { var searchQuery; searchQuery = query.trim().toLowerCase(); if (searchQuery.length > 0) { return tags.filter(function(tag) { return tag.get('name').toLowerCase().indexOf(searchQuery) >= 0; }); } else { ...
exports.forTags = (tags, query) -> searchQuery = query.trim().toLowerCase() if searchQuery.length > 0 tags.filter (tag) -> tag.get('name').toLowerCase().indexOf(searchQuery) >= 0 else tags # see util/configs-inte for styles
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
91
99
jianliaoim/talk-os:talk-web/client/util/search.coffee:9:completion
completion
exports.forTags = (tags, query) -> searchQuery = query.trim().toLowerCase() if searchQuery.length > 0 tags.filter (tag) ->
tag.get('name').toLowerCase().indexOf(searchQuery) >= 0 else tags # see util/configs-inte for styles
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
91
99
jianliaoim/talk-os:talk-web/client/util/search.coffee:10:raw_corpus
raw_corpus
exports.inteNames = (names, query) -> searchQuery = query.trim() if searchQuery.length is 0 return names names .filter (name) -> if name.id.toLowerCase().indexOf(searchQuery) >= 0 then return true if name.name.toLowerCase().indexOf(searchQuery) >= 0 then return true return false
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
100
108
jianliaoim/talk-os:talk-web/client/util/search.coffee:10:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.inteNames = (names, query) -> searchQuery = query.trim() if searchQuery.length is 0 return names names .filter (name) -> if name.id.toLowerCase().indexOf(searchQuery) >= 0 then return true if name.name.toLowerCase().indexOf(searchQuery...
exports.inteNames = function(names, query) { var searchQuery; searchQuery = query.trim(); if (searchQuery.length === 0) { return names; } return names.filter(function(name) { if (name.id.toLowerCase().indexOf(searchQuery) >= 0) { return true; } if (name.name.toLowerCase().indexOf(searchQ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
100
108
jianliaoim/talk-os:talk-web/client/util/search.coffee:10:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.inteNames = function(names, query) { var searchQuery; searchQuery = query.trim(); if (searchQuery.length === 0) { return names; } return names.filter(function(name) { if (name.id.toLowerCase().indexOf(searchQuery) >= 0) { return true...
exports.inteNames = (names, query) -> searchQuery = query.trim() if searchQuery.length is 0 return names names .filter (name) -> if name.id.toLowerCase().indexOf(searchQuery) >= 0 then return true if name.name.toLowerCase().indexOf(searchQuery) >= 0 then return true return false
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
100
108
jianliaoim/talk-os:talk-web/client/util/search.coffee:10:completion
completion
exports.inteNames = (names, query) -> searchQuery = query.trim() if searchQuery.length is 0 return names
names .filter (name) -> if name.id.toLowerCase().indexOf(searchQuery) >= 0 then return true if name.name.toLowerCase().indexOf(searchQuery) >= 0 then return true return false
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
100
108
jianliaoim/talk-os:talk-web/client/util/search.coffee:11:raw_corpus
raw_corpus
exports.immutableInteNames = (intes, query, language) -> searchQuery = query.trim() if searchQuery.length is 0 return intes intes.filter (inte) -> if inte.get('name').toLowerCase().indexOf(searchQuery) >= 0 then return true if inte.get('title').toLowerCase().indexOf(searchQuery) >= 0 then return true ...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
110
119
jianliaoim/talk-os:talk-web/client/util/search.coffee:11:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.immutableInteNames = (intes, query, language) -> searchQuery = query.trim() if searchQuery.length is 0 return intes intes.filter (inte) -> if inte.get('name').toLowerCase().indexOf(searchQuery) >= 0 then return true if inte.get('title')....
exports.immutableInteNames = function(intes, query, language) { var searchQuery; searchQuery = query.trim(); if (searchQuery.length === 0) { return intes; } return intes.filter(function(inte) { var summary; if (inte.get('name').toLowerCase().indexOf(searchQuery) >= 0) { return true; } ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
110
119
jianliaoim/talk-os:talk-web/client/util/search.coffee:11:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.immutableInteNames = function(intes, query, language) { var searchQuery; searchQuery = query.trim(); if (searchQuery.length === 0) { return intes; } return intes.filter(function(inte) { var summary; if (inte.get('name').toLowerCase().i...
exports.immutableInteNames = (intes, query, language) -> searchQuery = query.trim() if searchQuery.length is 0 return intes intes.filter (inte) -> if inte.get('name').toLowerCase().indexOf(searchQuery) >= 0 then return true if inte.get('title').toLowerCase().indexOf(searchQuery) >= 0 then return true ...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
110
119
jianliaoim/talk-os:talk-web/client/util/search.coffee:11:completion
completion
exports.immutableInteNames = (intes, query, language) -> searchQuery = query.trim() if searchQuery.length is 0 return intes intes.filter (inte) ->
if inte.get('name').toLowerCase().indexOf(searchQuery) >= 0 then return true if inte.get('title').toLowerCase().indexOf(searchQuery) >= 0 then return true summary = inte.get('summary').get(language) if summary.toLowerCase().indexOf(searchQuery) >= 0 then return true return false
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
110
119
jianliaoim/talk-os:talk-web/client/util/search.coffee:12:raw_corpus
raw_corpus
exports.inteItems = (items, query, topics) -> searchQuery = query.trim() if searchQuery.length is 0 return items items.filter (item) -> if item.get('title')?.toLowerCase().indexOf(searchQuery) >= 0 then return true if item.get('showname')?.toLowerCase().indexOf(searchQuery) >= 0 then return true i...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
121
136
jianliaoim/talk-os:talk-web/client/util/search.coffee:12:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.inteItems = (items, query, topics) -> searchQuery = query.trim() if searchQuery.length is 0 return items items.filter (item) -> if item.get('title')?.toLowerCase().indexOf(searchQuery) >= 0 then return true if item.get('showname')?.toLow...
exports.inteItems = function(items, query, topics) { var searchQuery; searchQuery = query.trim(); if (searchQuery.length === 0) { return items; } return items.filter(function(item) { var locale, ref, ref1, ref2, topic; if (((ref = item.get('title')) != null ? ref.toLowerCase().indexOf(searchQuery)...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
121
136
jianliaoim/talk-os:talk-web/client/util/search.coffee:12:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.inteItems = function(items, query, topics) { var searchQuery; searchQuery = query.trim(); if (searchQuery.length === 0) { return items; } return items.filter(function(item) { var locale, ref, ref1, ref2, topic; if (((ref = item.get('ti...
exports.inteItems = (items, query, topics) -> searchQuery = query.trim() if searchQuery.length is 0 return items items.filter (item) -> if item.get('title')?.toLowerCase().indexOf(searchQuery) >= 0 then return true if item.get('showname')?.toLowerCase().indexOf(searchQuery) >= 0 then return true i...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
121
136
jianliaoim/talk-os:talk-web/client/util/search.coffee:12:completion
completion
exports.inteItems = (items, query, topics) -> searchQuery = query.trim() if searchQuery.length is 0 return items items.filter (item) -> if item.get('title')?.toLowerCase().indexOf(searchQuery) >= 0 then return true if item.get('showname')?.toLowerCase().indexOf(searchQuery) >= 0 then return true i...
if item.get('category').toLowerCase().indexOf(searchQuery) >= 0 then return true topic = topics.find (topic) -> topic.get('_id') is item.get('_roomId') if topic? if topic.get('topic').toLowerCase().indexOf(searchQuery) >= 0 then return true if topic.get('isGeneral') locale = lang.getText('ro...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
121
136
jianliaoim/talk-os:talk-web/client/util/search.coffee:13:raw_corpus
raw_corpus
exports.inKeyword = (collection, keyword, opt = {}) -> keyword = keyword.toLowerCase() collection .filter (item) -> exports.forMember(item, keyword, opt) or exports.forTopic(item, keyword)
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
138
142
jianliaoim/talk-os:talk-web/client/util/search.coffee:13:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.inKeyword = (collection, keyword, opt = {}) -> keyword = keyword.toLowerCase() collection .filter (item) -> exports.forMember(item, keyword, opt) or exports.forTopic(item, keyword) ```
exports.inKeyword = function(collection, keyword, opt = {}) { keyword = keyword.toLowerCase(); return collection.filter(function(item) { return exports.forMember(item, keyword, opt) || exports.forTopic(item, keyword); }); };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
138
142
jianliaoim/talk-os:talk-web/client/util/search.coffee:13:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.inKeyword = function(collection, keyword, opt = {}) { keyword = keyword.toLowerCase(); return collection.filter(function(item) { return exports.forMember(item, keyword, opt) || exports.forTopic(item, keyword); }); }; ```
exports.inKeyword = (collection, keyword, opt = {}) -> keyword = keyword.toLowerCase() collection .filter (item) -> exports.forMember(item, keyword, opt) or exports.forTopic(item, keyword)
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
138
142
jianliaoim/talk-os:talk-web/client/util/search.coffee:13:completion
completion
exports.inKeyword = (collection, keyword, opt = {}) -> keyword = keyword.toLowerCase()
collection .filter (item) -> exports.forMember(item, keyword, opt) or exports.forTopic(item, keyword)
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/search.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/search.coffee
138
142
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:raw_corpus
raw_corpus
module.exports = currentStreak: 0 reached: false maxStreakReached: false disable: -> @destroy() onChangePane: (editor, editorElement) -> @reset() @setup editorElement if editor onInput: (editor, editorElement, cursor) -> @increaseStreak() reset: -> @container?.parentNode?.removeChi...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = currentStreak: 0 reached: false maxStreakReached: false disable: -> @destroy() onChangePane: (editor, editorElement) -> @reset() @setup editorElement if editor onInput: (editor, editorElement, cursor) -> @increaseSt...
module.exports = { currentStreak: 0, reached: false, maxStreakReached: false, disable: function() { return this.destroy(); }, onChangePane: function(editor, editorElement) { this.reset(); if (editor) { return this.setup(editorElement); } }, onInput: function(editor, editorElement, ...
CoffeeScript
JavaScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript module.exports = { currentStreak: 0, reached: false, maxStreakReached: false, disable: function() { return this.destroy(); }, onChangePane: function(editor, editorElement) { this.reset(); if (editor) { return this.setup(editorElement);...
module.exports = currentStreak: 0 reached: false maxStreakReached: false disable: -> @destroy() onChangePane: (editor, editorElement) -> @reset() @setup editorElement if editor onInput: (editor, editorElement, cursor) -> @increaseStreak() reset: -> @container?.parentNode?.removeChi...
JavaScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:completion
completion
module.exports = currentStreak: 0 reached: false maxStreakReached: false disable: -> @destroy() onChangePane: (editor, editorElement) -> @reset() @setup editorElement if editor onInput: (editor, editorElement, cursor) -> @increaseStreak() reset: -> @container?.parentNode?.removeChi...
@currentStreak = 0 @reached = false @maxStreakReached = false createElement: (name, parent)-> @element = document.createElement "div" @element.classList.add name parent.appendChild @element if parent @element setup: (editorElement) -> if not @container @maxStreak = @getMaxStreak(...
CoffeeScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:2:raw_corpus
raw_corpus
@streakTimeout = value * 1000 @endStreak() @debouncedEndStreak?.cancel() @debouncedEndStreak = debounce @endStreak.bind(this), @streakTimeout @opacityObserver?.dispose() @opacityObserver = atom.config.observe 'activate-power-mode.comboMode.opacity', (value) => @container?.st...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
55
104
JoelBesada/activate-power-mode:lib/combo-mode.coffee:2:completion
completion
@streakTimeout = value * 1000 @endStreak() @debouncedEndStreak?.cancel() @debouncedEndStreak = debounce @endStreak.bind(this), @streakTimeout @opacityObserver?.dispose() @opacityObserver = atom.config.observe 'activate-power-mode.comboMode.opacity', (value) => @container?.st...
@container.classList.remove "combo-zero" if @currentStreak > @maxStreak @increaseMaxStreak() @showExclamation() if @currentStreak > 0 and @currentStreak % @getConfig("exclamationEvery") is 0 if @currentStreak >= @getConfig("activationThreshold") and not @reached @reached = true @containe...
CoffeeScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
55
104
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:raw_corpus
raw_corpus
defer => @counter.classList.add "bump" refreshStreakBar: (leftTimeout = @streakTimeout) -> scale = leftTimeout / @streakTimeout @bar.style.transition = "none" @bar.style.transform = "scaleX(#{scale})" setTimeout => @bar.style.transform = "" @bar.style.transition = "transform #{left...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
105
154
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript defer => @counter.classList.add "bump" refreshStreakBar: (leftTimeout = @streakTimeout) -> scale = leftTimeout / @streakTimeout @bar.style.transition = "none" @bar.style.transform = "scaleX(#{scale})" setTimeout => @bar.style.trans...
defer(() => { return this.counter.classList.add("bump"); }); ({ refreshStreakBar: function(leftTimeout = this.streakTimeout) { var scale; scale = leftTimeout / this.streakTimeout; this.bar.style.transition = "none"; this.bar.style.transform = `scaleX(${scale})`; return setTimeout(() => { ...
CoffeeScript
JavaScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
105
154
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript defer(() => { return this.counter.classList.add("bump"); }); ({ refreshStreakBar: function(leftTimeout = this.streakTimeout) { var scale; scale = leftTimeout / this.streakTimeout; this.bar.style.transition = "none"; this.bar.style.transform = `...
defer => @counter.classList.add "bump" refreshStreakBar: (leftTimeout = @streakTimeout) -> scale = leftTimeout / @streakTimeout @bar.style.transition = "none" @bar.style.transform = "scaleX(#{scale})" setTimeout => @bar.style.transform = "" @bar.style.transition = "transform #{left...
JavaScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
105
154
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:completion
completion
defer => @counter.classList.add "bump" refreshStreakBar: (leftTimeout = @streakTimeout) -> scale = leftTimeout / @streakTimeout @bar.style.transition = "none" @bar.style.transform = "scaleX(#{scale})" setTimeout => @bar.style.transform = "" @bar.style.transition = "transform #{left...
hasReached: -> @reached getMaxStreak: -> maxStreak = localStorage.getItem "activate-power-mode.maxStreak" maxStreak = 0 if maxStreak is null maxStreak increaseMaxStreak: -> localStorage.setItem "activate-power-mode.maxStreak", @currentStreak @maxStreak = @currentStreak @max.textContent...
CoffeeScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
5d1989713f4204e3d12cbcc14325622e74b29dc9
3,570
https://github.com/JoelBesada/activate-power-mode/blob/5d1989713f4204e3d12cbcc14325622e74b29dc9/lib/combo-mode.coffee
105
154
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:raw_corpus
raw_corpus
module.exports = currentStreak: 0 reached: false maxStreakReached: false reset: -> @container?.parentNode?.removeChild @container destroy: -> @reset() @container = null @debouncedEndStreak?.cancel() @debouncedEndStreak = null @streakTimeoutObserver?.dispose() @opacityObserver?.di...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = currentStreak: 0 reached: false maxStreakReached: false reset: -> @container?.parentNode?.removeChild @container destroy: -> @reset() @container = null @debouncedEndStreak?.cancel() @debouncedEndStreak = null @...
module.exports = { currentStreak: 0, reached: false, maxStreakReached: false, reset: function() { var ref, ref1; return (ref = this.container) != null ? (ref1 = ref.parentNode) != null ? ref1.removeChild(this.container) : void 0 : void 0; }, destroy: function() { var ref, ref1, ref2; this.re...
CoffeeScript
JavaScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript module.exports = { currentStreak: 0, reached: false, maxStreakReached: false, reset: function() { var ref, ref1; return (ref = this.container) != null ? (ref1 = ref.parentNode) != null ? ref1.removeChild(this.container) : void 0 : void 0; }, des...
module.exports = currentStreak: 0 reached: false maxStreakReached: false reset: -> @container?.parentNode?.removeChild @container destroy: -> @reset() @container = null @debouncedEndStreak?.cancel() @debouncedEndStreak = null @streakTimeoutObserver?.dispose() @opacityObserver?.di...
JavaScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:completion
completion
module.exports = currentStreak: 0 reached: false maxStreakReached: false reset: -> @container?.parentNode?.removeChild @container destroy: -> @reset() @container = null @debouncedEndStreak?.cancel() @debouncedEndStreak = null @streakTimeoutObserver?.dispose() @opacityObserver?.di...
setup: (editorElement) -> if not @container @maxStreak = @getMaxStreak() @container = @createElement "streak-container" @container.classList.add "combo-zero" @title = @createElement "title", @container @title.textContent = "Combo" @max = @createElement "max", @container @ma...
CoffeeScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:2:raw_corpus
raw_corpus
editorElement.querySelector(".scroll-view").appendChild @container if @currentStreak leftTimeout = @streakTimeout - (performance.now() - @lastStreak) @refreshStreakBar leftTimeout @renderStreak() increaseStreak: -> @lastStreak = performance.now() @debouncedEndStreak() @currentStrea...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
55
104
JoelBesada/activate-power-mode:lib/combo-mode.coffee:2:completion
completion
editorElement.querySelector(".scroll-view").appendChild @container if @currentStreak leftTimeout = @streakTimeout - (performance.now() - @lastStreak) @refreshStreakBar leftTimeout @renderStreak() increaseStreak: -> @lastStreak = performance.now() @debouncedEndStreak() @currentStrea...
@refreshStreakBar() @renderStreak() endStreak: -> @currentStreak = 0 @reached = false @maxStreakReached = false @container.classList.add "combo-zero" @container.classList.remove "reached" @renderStreak() renderStreak: -> @counter.textContent = @currentStreak @counter.classList...
CoffeeScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
55
104
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:raw_corpus
raw_corpus
@bar.style.transform = "" @bar.style.transition = "transform #{leftTimeout}ms linear" , 100 showExclamation: (text = null) -> exclamation = document.createElement "span" exclamation.classList.add "exclamation" text = sample @getConfig "exclamationTexts" if text is null exclamation.textConte...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
105
144
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:completion
completion
@bar.style.transform = "" @bar.style.transition = "transform #{leftTimeout}ms linear" , 100 showExclamation: (text = null) -> exclamation = document.createElement "span" exclamation.classList.add "exclamation" text = sample @getConfig "exclamationTexts" if text is null exclamation.textConte...
maxStreak = localStorage.getItem "activate-power-mode.maxStreak" maxStreak = 0 if maxStreak is null maxStreak increaseMaxStreak: -> localStorage.setItem "activate-power-mode.maxStreak", @currentStreak @maxStreak = @currentStreak @max.textContent = "Max #{@maxStreak}" @showExclamation "NEW MAX...
CoffeeScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
7ecd27a30288312343399ad9e2f04f0efcb2bd0c
3,570
https://github.com/JoelBesada/activate-power-mode/blob/7ecd27a30288312343399ad9e2f04f0efcb2bd0c/lib/combo-mode.coffee
105
144
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:raw_corpus
raw_corpus
@bar.style.transform = "" @bar.style.transition = "transform #{leftTimeout}ms linear" , 100 showExclamation: (text = null) -> exclamation = document.createElement "span" exclamation.classList.add "exclamation" text = sample @getConfig "exclamationTexts" if text is null exclamation.textConte...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
c88955427331a07fa2556db0f2332e919a1a6a87
3,570
https://github.com/JoelBesada/activate-power-mode/blob/c88955427331a07fa2556db0f2332e919a1a6a87/lib/combo-mode.coffee
105
143
JoelBesada/activate-power-mode:lib/combo-mode.coffee:3:completion
completion
@bar.style.transform = "" @bar.style.transition = "transform #{leftTimeout}ms linear" , 100 showExclamation: (text = null) -> exclamation = document.createElement "span" exclamation.classList.add "exclamation" text = sample @getConfig "exclamationTexts" if text is null exclamation.textConte...
maxStreak = localStorage.getItem "activate-power-mode.maxStreak" maxStreak = 0 if maxStreak is null maxStreak increaseMaxStreak: -> localStorage.setItem "activate-power-mode.maxStreak", @currentStreak @maxStreak = @currentStreak @max.textContent = "Max #{@maxStreak}" @showExclamation "NEW MAX...
CoffeeScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
c88955427331a07fa2556db0f2332e919a1a6a87
3,570
https://github.com/JoelBesada/activate-power-mode/blob/c88955427331a07fa2556db0f2332e919a1a6a87/lib/combo-mode.coffee
105
143
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:raw_corpus
raw_corpus
module.exports = currentStreak: 0 reached: false maxStreakReached: false reset: -> @container?.parentNode?.removeChild @container destroy: -> @reset() @container = null @debouncedEndStreak?.cancel() @debouncedEndStreak = null @streakTimeoutObserver?.dispose() @opacityObserver?.di...
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
33cd77ad2f3ae30dd8577a1925e4aa805fed3b5b
3,570
https://github.com/JoelBesada/activate-power-mode/blob/33cd77ad2f3ae30dd8577a1925e4aa805fed3b5b/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = currentStreak: 0 reached: false maxStreakReached: false reset: -> @container?.parentNode?.removeChild @container destroy: -> @reset() @container = null @debouncedEndStreak?.cancel() @debouncedEndStreak = null @...
module.exports = { currentStreak: 0, reached: false, maxStreakReached: false, reset: function() { var ref, ref1; return (ref = this.container) != null ? (ref1 = ref.parentNode) != null ? ref1.removeChild(this.container) : void 0 : void 0; }, destroy: function() { var ref, ref1, ref2; this.re...
CoffeeScript
JavaScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
33cd77ad2f3ae30dd8577a1925e4aa805fed3b5b
3,570
https://github.com/JoelBesada/activate-power-mode/blob/33cd77ad2f3ae30dd8577a1925e4aa805fed3b5b/lib/combo-mode.coffee
5
54
JoelBesada/activate-power-mode:lib/combo-mode.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript module.exports = { currentStreak: 0, reached: false, maxStreakReached: false, reset: function() { var ref, ref1; return (ref = this.container) != null ? (ref1 = ref.parentNode) != null ? ref1.removeChild(this.container) : void 0 : void 0; }, des...
module.exports = currentStreak: 0 reached: false maxStreakReached: false reset: -> @container?.parentNode?.removeChild @container destroy: -> @reset() @container = null @debouncedEndStreak?.cancel() @debouncedEndStreak = null @streakTimeoutObserver?.dispose() @opacityObserver?.di...
JavaScript
CoffeeScript
JoelBesada/activate-power-mode
lib/combo-mode.coffee
MIT
33cd77ad2f3ae30dd8577a1925e4aa805fed3b5b
3,570
https://github.com/JoelBesada/activate-power-mode/blob/33cd77ad2f3ae30dd8577a1925e4aa805fed3b5b/lib/combo-mode.coffee
5
54