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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ichord/At.js:src/default.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` set... | var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13,
CTRL: 17,
P: 80,
N: 78
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matcher.
// We can override them in `callbacks` settings.
... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | dea7f905a54abd351d68c768fd3d6bd4fc281e9c | 5,250 | https://github.com/ichord/At.js/blob/dea7f905a54abd351d68c768fd3d6bd4fc281e9c/src/default.coffee | 1 | 43 |
ichord/At.js:src/default.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13,
CTRL: 17,
P: 80,
N: 78
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matc... | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | dea7f905a54abd351d68c768fd3d6bd4fc281e9c | 5,250 | https://github.com/ichord/At.js/blob/dea7f905a54abd351d68c768fd3d6bd4fc281e9c/src/default.coffee | 1 | 43 |
ichord/At.js:src/default.coffee:1:completion | completion | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | # It would be called to restructure the data before At.js invokes `Model#save` to save data
# In default, At.js will convert it to a Hash Array.
#
# @param data [Array] data to refacotor.
# @return [Array] Data after refactor.
before_save: (data) ->
return data if not $.isArray data
for item in data
... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | dea7f905a54abd351d68c768fd3d6bd4fc281e9c | 5,250 | https://github.com/ichord/At.js/blob/dea7f905a54abd351d68c768fd3d6bd4fc281e9c/src/default.coffee | 1 | 43 |
ichord/At.js:src/default.coffee:2:raw_corpus | raw_corpus | # À
_a = decodeURI("%C3%80")
# ÿ
_y = decodeURI("%C3%BF")
regexp = new RegExp "#{flag}([A-Za-z#{_a}-#{_y}0-9_\+\-]*)$|#{flag}([^\\x00-\\xff]*)$",'gi'
match = regexp.exec subtext
if match then match[2] || match[1] else null
# ---------------------
# Filter data by matched string.
#
# @p... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | dea7f905a54abd351d68c768fd3d6bd4fc281e9c | 5,250 | https://github.com/ichord/At.js/blob/dea7f905a54abd351d68c768fd3d6bd4fc281e9c/src/default.coffee | 45 | 88 | ||
ichord/At.js:src/default.coffee:3:raw_corpus | raw_corpus | _results = []
for item in items
item.atwho_order = new String(item[search_key]).toLowerCase().indexOf query.toLowerCase()
_results.push item if item.atwho_order > -1
_results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [St... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | dea7f905a54abd351d68c768fd3d6bd4fc281e9c | 5,250 | https://github.com/ichord/At.js/blob/dea7f905a54abd351d68c768fd3d6bd4fc281e9c/src/default.coffee | 90 | 132 | ||
ichord/At.js:src/default.coffee:3:completion | completion | _results = []
for item in items
item.atwho_order = new String(item[search_key]).toLowerCase().indexOf query.toLowerCase()
_results.push item if item.atwho_order > -1
_results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [St... | #
# @return [String] highlighted string.
highlighter: (li, query) ->
return li if not query
regexp = new RegExp(">\\s*(\\w*?)(" + query.replace("+","\\+") + ")(\\w*)\\s*<", 'ig')
li.replace regexp, (str, $1, $2, $3) -> '> '+$1+'<strong>' + $2 + '</strong>'+$3+' <'
# What to do before inserting item's... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | dea7f905a54abd351d68c768fd3d6bd4fc281e9c | 5,250 | https://github.com/ichord/At.js/blob/dea7f905a54abd351d68c768fd3d6bd4fc281e9c/src/default.coffee | 90 | 132 |
ichord/At.js:src/default.coffee:3:raw_corpus | raw_corpus | _results = []
for item in items
item.atwho_order = new String(item[search_key]).toLowerCase().indexOf query.toLowerCase()
_results.push item if item.atwho_order > -1
_results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [St... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | b05d51a77ef9a02aa2dbcd72543ead335a5cb5a0 | 5,250 | https://github.com/ichord/At.js/blob/b05d51a77ef9a02aa2dbcd72543ead335a5cb5a0/src/default.coffee | 90 | 131 | ||
ichord/At.js:src/default.coffee:3:completion | completion | _results = []
for item in items
item.atwho_order = new String(item[search_key]).toLowerCase().indexOf query.toLowerCase()
_results.push item if item.atwho_order > -1
_results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [St... | #
# @return [String] highlighted string.
highlighter: (li, query) ->
return li if not query
regexp = new RegExp(">\\s*(\\w*?)(" + query.replace("+","\\+") + ")(\\w*)\\s*<", 'ig')
li.replace regexp, (str, $1, $2, $3) -> '> '+$1+'<strong>' + $2 + '</strong>'+$3+' <'
# What to do before inserting item's... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | b05d51a77ef9a02aa2dbcd72543ead335a5cb5a0 | 5,250 | https://github.com/ichord/At.js/blob/b05d51a77ef9a02aa2dbcd72543ead335a5cb5a0/src/default.coffee | 90 | 131 |
ichord/At.js:src/default.coffee:4:raw_corpus | raw_corpus | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | e1f65668e311c06d845164c49f303fdb6093cca6 | 5,250 | https://github.com/ichord/At.js/blob/e1f65668e311c06d845164c49f303fdb6093cca6/src/default.coffee | 133 | 153 | ||
ichord/At.js:src/default.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor,... | // Use it to wrapper the content that will be inserted into text field.
// @param $inputor [jQuery Object] the text field such as `textarea`
// @param content [String] the content
// @param sufix [String] the `suffix` setting
({
inserting_wrapper: function($inputor, content, suffix) {
var wrapped_content;
//... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | e1f65668e311c06d845164c49f303fdb6093cca6 | 5,250 | https://github.com/ichord/At.js/blob/e1f65668e311c06d845164c49f303fdb6093cca6/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Use it to wrapper the content that will be inserted into text field.
// @param $inputor [jQuery Object] the text field such as `textarea`
// @param content [String] the content
// @param sufix [String] the `suffix` setting
({
inserting_wrapper: function($inpu... | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | e1f65668e311c06d845164c49f303fdb6093cca6 | 5,250 | https://github.com/ichord/At.js/blob/e1f65668e311c06d845164c49f303fdb6093cca6/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:completion | completion | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | '' + content + suffix
else if $inputor.attr('contentEditable') == 'true'
suffix = if suffix == " " then " " else suffix
if /firefox/i.test(navigator.userAgent)
wrapped_content = "<span>#{content}#{suffix}</span>"
else
suffix = "<span contenteditable='false'>#{suffix}</span>"
... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | e1f65668e311c06d845164c49f303fdb6093cca6 | 5,250 | https://github.com/ichord/At.js/blob/e1f65668e311c06d845164c49f303fdb6093cca6/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:raw_corpus | raw_corpus | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f | 5,250 | https://github.com/ichord/At.js/blob/8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f/src/default.coffee | 133 | 153 | ||
ichord/At.js:src/default.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor,... | // Use it to wrapper the content that will be inserted into text field.
// @param $inputor [jQuery Object] the text field such as `textarea`
// @param content [String] the content
// @param sufix [String] the `suffix` setting
({
inserting_wrapper: function($inputor, content, suffix) {
var new_suffix, wrapped_con... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f | 5,250 | https://github.com/ichord/At.js/blob/8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Use it to wrapper the content that will be inserted into text field.
// @param $inputor [jQuery Object] the text field such as `textarea`
// @param content [String] the content
// @param sufix [String] the `suffix` setting
({
inserting_wrapper: function($inpu... | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f | 5,250 | https://github.com/ichord/At.js/blob/8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:completion | completion | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | '' + content + new_suffix
else if $inputor.attr('contentEditable') == 'true'
new_suffix = if suffix == "" then suffix else suffix or " "
if /firefox/i.test(navigator.userAgent)
wrapped_content = "<span>#{content}#{new_suffix}</span>"
else
suffix = "<span contenteditable='false... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f | 5,250 | https://github.com/ichord/At.js/blob/8fe3a54e980995b8a48e8b414fb5e34da5b8ba5f/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:raw_corpus | raw_corpus | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 27be07368db2a179f7d42994b072dae5f7c22839 | 5,250 | https://github.com/ichord/At.js/blob/27be07368db2a179f7d42994b072dae5f7c22839/src/default.coffee | 133 | 153 | ||
ichord/At.js:src/default.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor,... | // Use it to wrapper the content that will be inserted into text field.
// @param $inputor [jQuery Object] the text field such as `textarea`
// @param content [String] the content
// @param sufix [String] the `suffix` setting
({
inserting_wrapper: function($inputor, content, suffix) {
var new_suffix, wrapped_con... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 27be07368db2a179f7d42994b072dae5f7c22839 | 5,250 | https://github.com/ichord/At.js/blob/27be07368db2a179f7d42994b072dae5f7c22839/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Use it to wrapper the content that will be inserted into text field.
// @param $inputor [jQuery Object] the text field such as `textarea`
// @param content [String] the content
// @param sufix [String] the `suffix` setting
({
inserting_wrapper: function($inpu... | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 27be07368db2a179f7d42994b072dae5f7c22839 | 5,250 | https://github.com/ichord/At.js/blob/27be07368db2a179f7d42994b072dae5f7c22839/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:4:completion | completion | # Use it to wrapper the content that will be inserted into text field.
#
# @param $inputor [jQuery Object] the text field such as `textarea`
# @param content [String] the content
# @param sufix [String] the `suffix` setting
inserting_wrapper: ($inputor, content, suffix) ->
# ensure str is str.
# BTW: ... | '' + content + new_suffix
else if $inputor.attr('contentEditable') == 'true'
new_suffix = if suffix == "" then suffix else suffix or " "
if /firefox/i.test(navigator.userAgent)
wrapped_content = "<span>#{content}#{new_suffix}</span>"
else
suffix = "<span contenteditable='false... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 27be07368db2a179f7d42994b072dae5f7c22839 | 5,250 | https://github.com/ichord/At.js/blob/27be07368db2a179f7d42994b072dae5f7c22839/src/default.coffee | 133 | 153 |
ichord/At.js:src/default.coffee:1:raw_corpus | raw_corpus | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 1 | 46 | ||
ichord/At.js:src/default.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` set... | var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13,
CTRL: 17,
P: 80,
N: 78
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matcher.
// We can override them in `callbacks` settings.
... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 1 | 46 |
ichord/At.js:src/default.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13,
CTRL: 17,
P: 80,
N: 78
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matc... | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 1 | 46 |
ichord/At.js:src/default.coffee:1:completion | completion | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | # In default, At.js will convert it to a Hash Array.
#
# @param data [Array] data to refacotor.
# @return [Array] Data after refactor.
before_save: (data) ->
return data if not $.isArray data
for item in data
if $.isPlainObject item then item else name:item
# It would be called to match the `fl... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 1 | 46 |
ichord/At.js:src/default.coffee:2:raw_corpus | raw_corpus | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 48 | 88 | ||
ichord/At.js:src/default.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_k... | // ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_key) {
var _results, i, item, len;
// !!null #=> ... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_ke... | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:2:completion | completion | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | remote_filter: null
# remote_filter: (query, callback) ->
# $.ajax url,
# data: params
# success: (data) ->
# callback(data)
# Sorter data of course.
#
# @param query [String] matched string
# @param items [Array] data that was refactored
# @param search_key [String] at char to sear... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:3:raw_corpus | raw_corpus | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 90 | 139 | ||
ichord/At.js:src/default.coffee:3:completion | completion | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | # @param value [String] content to insert
# @param $li [jQuery Object] the chosen item
before_insert: (value, $li) ->
value
# You can adjust the menu's offset here.
#
# @param offset [Hash] offset will be applied to menu
# before_reposition: (offset) ->
# offset.left += 10
# offset.top += 10
... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 90 | 139 |
ichord/At.js:src/default.coffee:4:raw_corpus | raw_corpus | new_suffix = if suffix == "" then suffix else suffix or " "
if /firefox/i.test(navigator.userAgent)
wrapped_content = "<span>#{content}#{new_suffix}</span>"
else
suffix = "<span contenteditable='false'>#{new_suffix}<span>"
wrapped_content = "<span contenteditable='false'>#{conte... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 140 | 148 | ||
ichord/At.js:src/default.coffee:4:completion | completion | new_suffix = if suffix == "" then suffix else suffix or " "
if /firefox/i.test(navigator.userAgent)
wrapped_content = "<span>#{content}#{new_suffix}</span>"
else | suffix = "<span contenteditable='false'>#{new_suffix}<span>"
wrapped_content = "<span contenteditable='false'>#{content}#{suffix}</span>"
if @app.document.selection #ie 8
wrapped_content = "<span contenteditable='true'>#{content}</span>"
wrapped_content | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7ed28904c51e8fe61354aadbafbe06e2b27bd588 | 5,250 | https://github.com/ichord/At.js/blob/7ed28904c51e8fe61354aadbafbe06e2b27bd588/src/default.coffee | 140 | 148 |
ichord/At.js:src/default.coffee:1:raw_corpus | raw_corpus | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 699db4954bec0068274e6ae1a111c2b61f5fe5b5 | 5,250 | https://github.com/ichord/At.js/blob/699db4954bec0068274e6ae1a111c2b61f5fe5b5/src/default.coffee | 1 | 46 | ||
ichord/At.js:src/default.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` set... | var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13,
CTRL: 17,
P: 80,
N: 78
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matcher.
// We can override them in `callbacks` settings.
... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 699db4954bec0068274e6ae1a111c2b61f5fe5b5 | 5,250 | https://github.com/ichord/At.js/blob/699db4954bec0068274e6ae1a111c2b61f5fe5b5/src/default.coffee | 1 | 46 |
ichord/At.js:src/default.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13,
CTRL: 17,
P: 80,
N: 78
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matc... | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 699db4954bec0068274e6ae1a111c2b61f5fe5b5 | 5,250 | https://github.com/ichord/At.js/blob/699db4954bec0068274e6ae1a111c2b61f5fe5b5/src/default.coffee | 1 | 46 |
ichord/At.js:src/default.coffee:1:completion | completion | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
CTRL: 17
P: 80
N: 78
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `... | # In default, At.js will convert it to a Hash Array.
#
# @param data [Array] data to refacotor.
# @return [Array] Data after refactor.
before_save: (data) ->
return data if not $.isArray data
for item in data
if $.isPlainObject item then item else name:item
# It would be called to match the `fl... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 699db4954bec0068274e6ae1a111c2b61f5fe5b5 | 5,250 | https://github.com/ichord/At.js/blob/699db4954bec0068274e6ae1a111c2b61f5fe5b5/src/default.coffee | 1 | 46 |
ichord/At.js:src/default.coffee:2:raw_corpus | raw_corpus | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 70057691aff1afd7d2758a638437e75a0b3185e4 | 5,250 | https://github.com/ichord/At.js/blob/70057691aff1afd7d2758a638437e75a0b3185e4/src/default.coffee | 48 | 88 | ||
ichord/At.js:src/default.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_k... | // ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_key) {
var _results, i, item, len;
// !!null #=> ... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 70057691aff1afd7d2758a638437e75a0b3185e4 | 5,250 | https://github.com/ichord/At.js/blob/70057691aff1afd7d2758a638437e75a0b3185e4/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_ke... | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 70057691aff1afd7d2758a638437e75a0b3185e4 | 5,250 | https://github.com/ichord/At.js/blob/70057691aff1afd7d2758a638437e75a0b3185e4/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:2:completion | completion | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | remote_filter: null
# remote_filter: (query, callback) ->
# $.ajax url,
# data: params
# success: (data) ->
# callback(data)
# Sorter data of course.
#
# @param query [String] matched string
# @param items [Array] data that was refactored
# @param search_key [String] at char to sear... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 70057691aff1afd7d2758a638437e75a0b3185e4 | 5,250 | https://github.com/ichord/At.js/blob/70057691aff1afd7d2758a638437e75a0b3185e4/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:3:raw_corpus | raw_corpus | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | b0f6cebb379761ae1f17ec9202b986ae17ca0008 | 5,250 | https://github.com/ichord/At.js/blob/b0f6cebb379761ae1f17ec9202b986ae17ca0008/src/default.coffee | 90 | 126 | ||
ichord/At.js:src/default.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]... | _results.sort(function(a, b) {
return a.atwho_order - b.atwho_order({
// Eval template for every single item in display list.
// @param tpl [String] The template string.
// @param map [Hash] Data map to eval.
tpl_eval: function(tpl, map) {
var error;
try {
return tpl.replace(/\$\{... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | b0f6cebb379761ae1f17ec9202b986ae17ca0008 | 5,250 | https://github.com/ichord/At.js/blob/b0f6cebb379761ae1f17ec9202b986ae17ca0008/src/default.coffee | 90 | 126 |
ichord/At.js:src/default.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
_results.sort(function(a, b) {
return a.atwho_order - b.atwho_order({
// Eval template for every single item in display list.
// @param tpl [String] The template string.
// @param map [Hash] Data map to eval.
tpl_eval: function(tpl, map) {
... | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | b0f6cebb379761ae1f17ec9202b986ae17ca0008 | 5,250 | https://github.com/ichord/At.js/blob/b0f6cebb379761ae1f17ec9202b986ae17ca0008/src/default.coffee | 90 | 126 |
ichord/At.js:src/default.coffee:3:completion | completion | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | highlighter: (li, query) ->
return li if not query
regexp = new RegExp(">\\s*(\\w*?)(" + query.replace("+","\\+") + ")(\\w*)\\s*<", 'ig')
li.replace regexp, (str, $1, $2, $3) -> '> '+$1+'<strong>' + $2 + '</strong>'+$3+' <'
# What to do before inserting item's value into inputor.
#
# @param value [St... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | b0f6cebb379761ae1f17ec9202b986ae17ca0008 | 5,250 | https://github.com/ichord/At.js/blob/b0f6cebb379761ae1f17ec9202b986ae17ca0008/src/default.coffee | 90 | 126 |
ichord/At.js:src/default.coffee:3:raw_corpus | raw_corpus | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 4b4fbcd60b5315f4754317edc208befa93b92a1c | 5,250 | https://github.com/ichord/At.js/blob/4b4fbcd60b5315f4754317edc208befa93b92a1c/src/default.coffee | 90 | 126 | ||
ichord/At.js:src/default.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]... | _results.sort(function(a, b) {
return a.atwho_order - b.atwho_order({
// Eval template for every single item in display list.
// @param tpl [String] The template string.
// @param map [Hash] Data map to eval.
tpl_eval: function(tpl, map) {
var error;
try {
return tpl.replace(/\$\{... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 4b4fbcd60b5315f4754317edc208befa93b92a1c | 5,250 | https://github.com/ichord/At.js/blob/4b4fbcd60b5315f4754317edc208befa93b92a1c/src/default.coffee | 90 | 126 |
ichord/At.js:src/default.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
_results.sort(function(a, b) {
return a.atwho_order - b.atwho_order({
// Eval template for every single item in display list.
// @param tpl [String] The template string.
// @param map [Hash] Data map to eval.
tpl_eval: function(tpl, map) {
... | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 4b4fbcd60b5315f4754317edc208befa93b92a1c | 5,250 | https://github.com/ichord/At.js/blob/4b4fbcd60b5315f4754317edc208befa93b92a1c/src/default.coffee | 90 | 126 |
ichord/At.js:src/default.coffee:3:completion | completion | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | highlighter: (li, query) ->
return li if not query
regexp = new RegExp(">\\s*(\\w*)(" + query.replace("+","\\+") + ")(\\w*)\\s*<", 'ig')
li.replace regexp, (str, $1, $2, $3) -> '> '+$1+'<strong>' + $2 + '</strong>'+$3+' <'
# What to do before inserting item's value into inputor.
#
# @param value [Str... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 4b4fbcd60b5315f4754317edc208befa93b92a1c | 5,250 | https://github.com/ichord/At.js/blob/4b4fbcd60b5315f4754317edc208befa93b92a1c/src/default.coffee | 90 | 126 |
ichord/At.js:src/default.coffee:2:raw_corpus | raw_corpus | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/default.coffee | 48 | 88 | ||
ichord/At.js:src/default.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_k... | // ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_key) {
var _results, i, item, len;
// !!null #=> ... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_ke... | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:2:completion | completion | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | remote_filter: null
# remote_filter: (query, callback) ->
# $.ajax url,
# data: params
# success: (data) ->
# callback(data)
# Sorter data of course.
#
# @param query [String] matched string
# @param items [Array] data that was refactored
# @param search_key [String] at char to sear... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 52a41f551d3f7952c06b64e3f6f4485affe160ec | 5,250 | https://github.com/ichord/At.js/blob/52a41f551d3f7952c06b64e3f6f4485affe160ec/src/default.coffee | 48 | 88 |
ichord/At.js:src/default.coffee:3:raw_corpus | raw_corpus | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | ab9bd63d344e5bd67fbd5482caac03fb22bd1898 | 5,250 | https://github.com/ichord/At.js/blob/ab9bd63d344e5bd67fbd5482caac03fb22bd1898/src/default.coffee | 90 | 118 | ||
ichord/At.js:src/default.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]... | _results.sort(function(a, b) {
return a.atwho_order - b.atwho_order({
// Eval template for every single item in display list.
// @param tpl [String] The template string.
// @param map [Hash] Data map to eval.
tpl_eval: function(tpl, map) {
var error;
try {
return tpl.replace(/\$\{... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | ab9bd63d344e5bd67fbd5482caac03fb22bd1898 | 5,250 | https://github.com/ichord/At.js/blob/ab9bd63d344e5bd67fbd5482caac03fb22bd1898/src/default.coffee | 90 | 118 |
ichord/At.js:src/default.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
_results.sort(function(a, b) {
return a.atwho_order - b.atwho_order({
// Eval template for every single item in display list.
// @param tpl [String] The template string.
// @param map [Hash] Data map to eval.
tpl_eval: function(tpl, map) {
... | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | ab9bd63d344e5bd67fbd5482caac03fb22bd1898 | 5,250 | https://github.com/ichord/At.js/blob/ab9bd63d344e5bd67fbd5482caac03fb22bd1898/src/default.coffee | 90 | 118 |
ichord/At.js:src/default.coffee:3:completion | completion | _results.sort (a,b) -> a.atwho_order - b.atwho_order
# Eval template for every single item in display list.
#
# @param tpl [String] The template string.
# @param map [Hash] Data map to eval.
tpl_eval: (tpl, map) ->
try
tpl.replace /\$\{([^\}]*)\}/g, (tag, key, pos) -> map[key]
catch error
... | # @param li [String] HTML String after eval.
# @param query [String] matched query.
#
# @return [String] highlighted string.
highlighter: (li, query) ->
return li if not query
regexp = new RegExp(">\\s*(\\w*)(" + query.replace("+","\\+") + ")(\\w*)\\s*<", 'ig')
li.replace regexp, (str, $1, $2, $3) -... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | ab9bd63d344e5bd67fbd5482caac03fb22bd1898 | 5,250 | https://github.com/ichord/At.js/blob/ab9bd63d344e5bd67fbd5482caac03fb22bd1898/src/default.coffee | 90 | 118 |
ichord/At.js:src/default.coffee:1:raw_corpus | raw_corpus | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `$.atwho.Controller` object ... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51 | 5,250 | https://github.com/ichord/At.js/blob/4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51/src/default.coffee | 1 | 43 | ||
ichord/At.js:src/default.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The c... | var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matcher.
// We can override them in `callbacks` settings.
// @mixin
// The context of t... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51 | 5,250 | https://github.com/ichord/At.js/blob/4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51/src/default.coffee | 1 | 43 |
ichord/At.js:src/default.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DEFAULT_CALLBACKS, KEY_CODE;
KEY_CODE = {
DOWN: 40,
UP: 38,
ESC: 27,
TAB: 9,
ENTER: 13
};
// Functions set for handling and rendering the data.
// Others developers can override these methods to tweak At.js such as matcher.
// We can override them i... | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `$.atwho.Controller` object ... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51 | 5,250 | https://github.com/ichord/At.js/blob/4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51/src/default.coffee | 1 | 43 |
ichord/At.js:src/default.coffee:1:completion | completion | KEY_CODE =
DOWN: 40
UP: 38
ESC: 27
TAB: 9
ENTER: 13
# Functions set for handling and rendering the data.
# Others developers can override these methods to tweak At.js such as matcher.
# We can override them in `callbacks` settings.
#
# @mixin
#
# The context of these functions is `$.atwho.Controller` object ... | #
# @param data [Array] data to refacotor.
# @return [Array] Data after refactor.
before_save: (data) ->
return data if not $.isArray data
for item in data
if $.isPlainObject item then item else name:item
# It would be called to match the `flag`.
# It will match at start of line or after whites... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51 | 5,250 | https://github.com/ichord/At.js/blob/4896b46851f1aa8cf8ae6cf29b4fef9e9101ba51/src/default.coffee | 1 | 43 |
ichord/At.js:src/default.coffee:2:raw_corpus | raw_corpus | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/default.coffee | 45 | 85 | ||
ichord/At.js:src/default.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_k... | // ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_key) {
var _results, i, item, len;
// !!null #=> ... | CoffeeScript | JavaScript | ichord/At.js | src/default.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/default.coffee | 45 | 85 |
ichord/At.js:src/default.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ---------------------
// Filter data by matched string.
// @param query [String] Matched string.
// @param data [Array] data list
// @param search_key [String] at char for searching.
// @return [Array] result data.
({
filter: function(query, data, search_ke... | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | JavaScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/default.coffee | 45 | 85 |
ichord/At.js:src/default.coffee:2:completion | completion | # ---------------------
# Filter data by matched string.
#
# @param query [String] Matched string.
# @param data [Array] data list
# @param search_key [String] at char for searching.
#
# @return [Array] result data.
filter: (query, data, search_key) ->
# !!null #=> false; !!undefined #=> false; !!'... | remote_filter: null
# remote_filter: (query, callback) ->
# $.ajax url,
# data: params
# success: (data) ->
# render_view(data)
# Sorter data of course.
#
# @param query [String] matched string
# @param items [Array] data that was refactored
# @param search_key [String] at char to s... | CoffeeScript | CoffeeScript | ichord/At.js | src/default.coffee | MIT | 7569078e80d186c7f530356e57cf3339202efcd8 | 5,250 | https://github.com/ichord/At.js/blob/7569078e80d186c7f530356e57cf3339202efcd8/src/default.coffee | 45 | 85 |
JoelBesada/activate-power-mode:lib/activate-power-mode-view.coffee:1:raw_corpus | raw_corpus | module.exports =
class ActivatePowerModeView
constructor: (serializedState) ->
# Create root element
@element = document.createElement('div')
@element.classList.add('activate-power-mode')
# Create message element
message = document.createElement('div')
message.textContent = "The ActivatePower... | CoffeeScript | JoelBesada/activate-power-mode | lib/activate-power-mode-view.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/lib/activate-power-mode-view.coffee | 1 | 22 | ||
JoelBesada/activate-power-mode:lib/activate-power-mode-view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
class ActivatePowerModeView
constructor: (serializedState) ->
# Create root element
@element = document.createElement('div')
@element.classList.add('activate-power-mode')
# Create message element
message = document.createEl... | var ActivatePowerModeView;
module.exports = ActivatePowerModeView = class ActivatePowerModeView {
constructor(serializedState) {
var message;
// Create root element
this.element = document.createElement('div');
this.element.classList.add('activate-power-mode');
// Create message element
messa... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/activate-power-mode-view.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/lib/activate-power-mode-view.coffee | 1 | 22 |
JoelBesada/activate-power-mode:lib/activate-power-mode-view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ActivatePowerModeView;
module.exports = ActivatePowerModeView = class ActivatePowerModeView {
constructor(serializedState) {
var message;
// Create root element
this.element = document.createElement('div');
this.element.classList.add('activat... | module.exports =
class ActivatePowerModeView
constructor: (serializedState) ->
# Create root element
@element = document.createElement('div')
@element.classList.add('activate-power-mode')
# Create message element
message = document.createElement('div')
message.textContent = "The ActivatePower... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/activate-power-mode-view.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/lib/activate-power-mode-view.coffee | 1 | 22 |
JoelBesada/activate-power-mode:lib/activate-power-mode-view.coffee:1:completion | completion | module.exports =
class ActivatePowerModeView
constructor: (serializedState) ->
# Create root element
@element = document.createElement('div')
@element.classList.add('activate-power-mode')
# Create message element
message = document.createElement('div')
message.textContent = "The ActivatePower... | @element.appendChild(message)
# Returns an object that can be retrieved when package is activated
serialize: ->
# Tear down any state and detach
destroy: ->
@element.remove()
getElement: ->
@element | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/activate-power-mode-view.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/lib/activate-power-mode-view.coffee | 1 | 22 |
jianliaoim/talk-os:talk-web/client/guest-app/missing.coffee:1:raw_corpus | raw_corpus | React = require 'react'
lang = require '../locales/lang'
{div, pre, span, a} = React.DOM
correctExample = 'https://jianliao.com/rooms/<room_token>'
module.exports = React.createClass
displayName: 'app-missing'
render: ->
div className: 'app-missing',
div className: 'as-guide',
div className: '... | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/missing.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/missing.coffee | 1 | 20 | ||
jianliaoim/talk-os:talk-web/client/guest-app/missing.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
lang = require '../locales/lang'
{div, pre, span, a} = React.DOM
correctExample = 'https://jianliao.com/rooms/<room_token>'
module.exports = React.createClass
displayName: 'app-missing'
render: ->
div className: 'app-missing',
... | var React, a, correctExample, div, lang, pre, span;
React = require('react');
lang = require('../locales/lang');
({div, pre, span, a} = React.DOM);
correctExample = 'https://jianliao.com/rooms/<room_token>';
module.exports = React.createClass({
displayName: 'app-missing',
render: function() {
return div({
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/guest-app/missing.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/missing.coffee | 1 | 20 |
jianliaoim/talk-os:talk-web/client/guest-app/missing.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var React, a, correctExample, div, lang, pre, span;
React = require('react');
lang = require('../locales/lang');
({div, pre, span, a} = React.DOM);
correctExample = 'https://jianliao.com/rooms/<room_token>';
module.exports = React.createClass({
displayName: ... | React = require 'react'
lang = require '../locales/lang'
{div, pre, span, a} = React.DOM
correctExample = 'https://jianliao.com/rooms/<room_token>'
module.exports = React.createClass
displayName: 'app-missing'
render: ->
div className: 'app-missing',
div className: 'as-guide',
div className: '... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/missing.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/missing.coffee | 1 | 20 |
jianliaoim/talk-os:talk-web/client/guest-app/missing.coffee:1:completion | completion | React = require 'react'
lang = require '../locales/lang'
{div, pre, span, a} = React.DOM
correctExample = 'https://jianliao.com/rooms/<room_token>'
module.exports = React.createClass
displayName: 'app-missing' | render: ->
div className: 'app-missing',
div className: 'as-guide',
div className: 'as-icon'
span className: 'as-status-code', 404
div className: 'as-note',
div null, lang.getText('room-missing')
div null,
lang.getText('correct-guest-url')
a className:... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest-app/missing.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest-app/missing.coffee | 1 | 20 |
gss/engine:src/document/types/Gradient.coffee:1:raw_corpus | raw_corpus | Command = require('../../engine/Command')
class Gradient extends Command
type: 'Gradient'
constructor: (obj) ->
switch typeof obj
when 'object'
if Gradient[obj[0]]
return obj
@define
'linear-gradient': ->
'radial-gradient': ->
'repeating-linear-gradient': ->
'repeati... | CoffeeScript | gss/engine | src/document/types/Gradient.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/document/types/Gradient.coffee | 1 | 18 | ||
gss/engine:src/document/types/Gradient.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Command = require('../../engine/Command')
class Gradient extends Command
type: 'Gradient'
constructor: (obj) ->
switch typeof obj
when 'object'
if Gradient[obj[0]]
return obj
@define
'linear-gradient': ->
'radial-gradi... | var Command, Gradient;
Command = require('../../engine/Command');
Gradient = (function() {
class Gradient extends Command {
constructor(obj) {
switch (typeof obj) {
case 'object':
if (Gradient[obj[0]]) {
return obj;
}
}
}
};
Gradient.prototype.type =... | CoffeeScript | JavaScript | gss/engine | src/document/types/Gradient.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/document/types/Gradient.coffee | 1 | 18 |
gss/engine:src/document/types/Gradient.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Command, Gradient;
Command = require('../../engine/Command');
Gradient = (function() {
class Gradient extends Command {
constructor(obj) {
switch (typeof obj) {
case 'object':
if (Gradient[obj[0]]) {
return obj;
... | Command = require('../../engine/Command')
class Gradient extends Command
type: 'Gradient'
constructor: (obj) ->
switch typeof obj
when 'object'
if Gradient[obj[0]]
return obj
@define
'linear-gradient': ->
'radial-gradient': ->
'repeating-linear-gradient': ->
'repeati... | JavaScript | CoffeeScript | gss/engine | src/document/types/Gradient.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/document/types/Gradient.coffee | 1 | 18 |
gss/engine:src/document/types/Gradient.coffee:1:completion | completion | Command = require('../../engine/Command')
class Gradient extends Command
type: 'Gradient'
constructor: (obj) ->
switch typeof obj
when 'object'
if Gradient[obj[0]] | return obj
@define
'linear-gradient': ->
'radial-gradient': ->
'repeating-linear-gradient': ->
'repeating-radial-gradient': ->
module.exports = Gradient | CoffeeScript | CoffeeScript | gss/engine | src/document/types/Gradient.coffee | MIT | be430ea249f8030e11c8e03a8e170dcc8b8cf5fb | 2,854 | https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/document/types/Gradient.coffee | 1 | 18 |
Glavin001/atom-beautify:src/beautifiers/gofmt.coffee:1:raw_corpus | raw_corpus | ###
Requires http://golang.org/cmd/gofmt/
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Gofmt extends Beautifier
name: "gofmt"
link: "https://golang.org/cmd/gofmt/"
isPreInstalled: false
options: {
Go: true
}
beautify: (text, language, options) ->
@run("gofmt", [
... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/gofmt.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/gofmt.coffee | 1 | 20 | ||
Glavin001/atom-beautify:src/beautifiers/gofmt.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires http://golang.org/cmd/gofmt/
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Gofmt extends Beautifier
name: "gofmt"
link: "https://golang.org/cmd/gofmt/"
isPreInstalled: false
options: {
Go: true
}
bea... | /*
Requires http://golang.org/cmd/gofmt/
*/
"use strict";
var Beautifier, Gofmt;
Beautifier = require('./beautifier');
module.exports = Gofmt = (function() {
class Gofmt extends Beautifier {
beautify(text, language, options) {
return this.run("gofmt", [this.tempFile("input", text)]);
}
};
Gofmt.... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/gofmt.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/gofmt.coffee | 1 | 20 |
Glavin001/atom-beautify:src/beautifiers/gofmt.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires http://golang.org/cmd/gofmt/
*/
"use strict";
var Beautifier, Gofmt;
Beautifier = require('./beautifier');
module.exports = Gofmt = (function() {
class Gofmt extends Beautifier {
beautify(text, language, options) {
return this.run("gofmt",... | ###
Requires http://golang.org/cmd/gofmt/
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Gofmt extends Beautifier
name: "gofmt"
link: "https://golang.org/cmd/gofmt/"
isPreInstalled: false
options: {
Go: true
}
beautify: (text, language, options) ->
@run("gofmt", [
... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/gofmt.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/gofmt.coffee | 1 | 20 |
Glavin001/atom-beautify:src/beautifiers/gofmt.coffee:1:completion | completion | ###
Requires http://golang.org/cmd/gofmt/
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Gofmt extends Beautifier
name: "gofmt"
link: "https://golang.org/cmd/gofmt/" | isPreInstalled: false
options: {
Go: true
}
beautify: (text, language, options) ->
@run("gofmt", [
@tempFile("input", text)
]) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/gofmt.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/gofmt.coffee | 1 | 20 |
buttercoin/buttercoin:lib/buttercoin.coffee:1:raw_corpus | raw_corpus | API = require('./api')
Engine = require('./engine')
Front = require('./front/front')
logger = require('./logger')
module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@engine = new Engine()
@api = new API(@engine)
@front = new Front() | CoffeeScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | 707cf2c07b9cc684e27f65864bfc04d18b3bc9e5 | 663 | https://github.com/buttercoin/buttercoin/blob/707cf2c07b9cc684e27f65864bfc04d18b3bc9e5/lib/buttercoin.coffee | 1 | 11 | ||
buttercoin/buttercoin:lib/buttercoin.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
API = require('./api')
Engine = require('./engine')
Front = require('./front/front')
logger = require('./logger')
module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@engine = new Engine()
@api = new API(@engine)
@... | var API, Buttercoin, Engine, Front, logger;
API = require('./api');
Engine = require('./engine');
Front = require('./front/front');
logger = require('./logger');
module.exports = Buttercoin = (function() {
class Buttercoin {
constructor() {
this.engine = new Engine();
this.api = new API(this.engi... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | 707cf2c07b9cc684e27f65864bfc04d18b3bc9e5 | 663 | https://github.com/buttercoin/buttercoin/blob/707cf2c07b9cc684e27f65864bfc04d18b3bc9e5/lib/buttercoin.coffee | 1 | 11 |
buttercoin/buttercoin:lib/buttercoin.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var API, Buttercoin, Engine, Front, logger;
API = require('./api');
Engine = require('./engine');
Front = require('./front/front');
logger = require('./logger');
module.exports = Buttercoin = (function() {
class Buttercoin {
constructor() {
this.en... | API = require('./api')
Engine = require('./engine')
Front = require('./front/front')
logger = require('./logger')
module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@engine = new Engine()
@api = new API(@engine)
@front = new Front() | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | 707cf2c07b9cc684e27f65864bfc04d18b3bc9e5 | 663 | https://github.com/buttercoin/buttercoin/blob/707cf2c07b9cc684e27f65864bfc04d18b3bc9e5/lib/buttercoin.coffee | 1 | 11 |
buttercoin/buttercoin:lib/buttercoin.coffee:1:completion | completion | API = require('./api')
Engine = require('./engine')
Front = require('./front/front')
logger = require('./logger') | module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@engine = new Engine()
@api = new API(@engine)
@front = new Front() | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | 707cf2c07b9cc684e27f65864bfc04d18b3bc9e5 | 663 | https://github.com/buttercoin/buttercoin/blob/707cf2c07b9cc684e27f65864bfc04d18b3bc9e5/lib/buttercoin.coffee | 1 | 11 |
buttercoin/buttercoin:lib/buttercoin.coffee:1:raw_corpus | raw_corpus | ApiClient = require('./api_client')
Api = require('./api')
Front = require('./front/front')
logger = require('./logger')
module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@api = new Api()
@api_client = new ApiClient()
@front = new Front() | CoffeeScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | b3883959fae51deb41f351a8787c727a7e750ec9 | 663 | https://github.com/buttercoin/buttercoin/blob/b3883959fae51deb41f351a8787c727a7e750ec9/lib/buttercoin.coffee | 1 | 11 | ||
buttercoin/buttercoin:lib/buttercoin.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ApiClient = require('./api_client')
Api = require('./api')
Front = require('./front/front')
logger = require('./logger')
module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@api = new Api()
@api_client = new ApiClient(... | var Api, ApiClient, Buttercoin, Front, logger;
ApiClient = require('./api_client');
Api = require('./api');
Front = require('./front/front');
logger = require('./logger');
module.exports = Buttercoin = (function() {
class Buttercoin {
constructor() {
this.api = new Api();
this.api_client = new Ap... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | b3883959fae51deb41f351a8787c727a7e750ec9 | 663 | https://github.com/buttercoin/buttercoin/blob/b3883959fae51deb41f351a8787c727a7e750ec9/lib/buttercoin.coffee | 1 | 11 |
buttercoin/buttercoin:lib/buttercoin.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Api, ApiClient, Buttercoin, Front, logger;
ApiClient = require('./api_client');
Api = require('./api');
Front = require('./front/front');
logger = require('./logger');
module.exports = Buttercoin = (function() {
class Buttercoin {
constructor() {
... | ApiClient = require('./api_client')
Api = require('./api')
Front = require('./front/front')
logger = require('./logger')
module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@api = new Api()
@api_client = new ApiClient()
@front = new Front() | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | b3883959fae51deb41f351a8787c727a7e750ec9 | 663 | https://github.com/buttercoin/buttercoin/blob/b3883959fae51deb41f351a8787c727a7e750ec9/lib/buttercoin.coffee | 1 | 11 |
buttercoin/buttercoin:lib/buttercoin.coffee:1:completion | completion | ApiClient = require('./api_client')
Api = require('./api')
Front = require('./front/front')
logger = require('./logger') | module.exports = class Buttercoin
@set_log_level: logger.set_levels
constructor: ->
@api = new Api()
@api_client = new ApiClient()
@front = new Front() | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/buttercoin.coffee | MIT | b3883959fae51deb41f351a8787c727a7e750ec9 | 663 | https://github.com/buttercoin/buttercoin/blob/b3883959fae51deb41f351a8787c727a7e750ec9/lib/buttercoin.coffee | 1 | 11 |
Glavin001/atom-beautify:src/beautifiers/verilog-mode/index.coffee:1:raw_corpus | raw_corpus | ###
Requires emacs with verilog-mode https://www.veripool.org/wiki/verilog-mode
###
"use strict"
Beautifier = require('../beautifier')
path = require("path")
module.exports = class EmacsVerilogMode extends Beautifier
name: "Emacs Verilog Mode"
link: "https://www.veripool.org/projects/verilog-mode/"
isPreInstall... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/verilog-mode/index.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/verilog-mode/index.coffee | 1 | 50 | ||
Glavin001/atom-beautify:src/beautifiers/verilog-mode/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires emacs with verilog-mode https://www.veripool.org/wiki/verilog-mode
###
"use strict"
Beautifier = require('../beautifier')
path = require("path")
module.exports = class EmacsVerilogMode extends Beautifier
name: "Emacs Verilog Mode"
link: "https:... | /*
Requires emacs with verilog-mode https://www.veripool.org/wiki/verilog-mode
*/
"use strict";
var Beautifier, EmacsVerilogMode, path;
Beautifier = require('../beautifier');
path = require("path");
module.exports = EmacsVerilogMode = (function() {
class EmacsVerilogMode extends Beautifier {
beautify(text, lan... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/verilog-mode/index.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/verilog-mode/index.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/verilog-mode/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires emacs with verilog-mode https://www.veripool.org/wiki/verilog-mode
*/
"use strict";
var Beautifier, EmacsVerilogMode, path;
Beautifier = require('../beautifier');
path = require("path");
module.exports = EmacsVerilogMode = (function() {
class Emacs... | ###
Requires emacs with verilog-mode https://www.veripool.org/wiki/verilog-mode
###
"use strict"
Beautifier = require('../beautifier')
path = require("path")
module.exports = class EmacsVerilogMode extends Beautifier
name: "Emacs Verilog Mode"
link: "https://www.veripool.org/projects/verilog-mode/"
isPreInstall... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/verilog-mode/index.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/verilog-mode/index.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/verilog-mode/index.coffee:1:completion | completion | ###
Requires emacs with verilog-mode https://www.veripool.org/wiki/verilog-mode
###
"use strict"
Beautifier = require('../beautifier')
path = require("path")
module.exports = class EmacsVerilogMode extends Beautifier
name: "Emacs Verilog Mode"
link: "https://www.veripool.org/projects/verilog-mode/"
isPreInstall... | Verilog: {
emacs_script_path: true
}
}
beautify: (text, language, options) ->
emacs_script_path = options.emacs_script_path
if not emacs_script_path
emacs_script_path = path.resolve(__dirname, "verilog-mode.el")
@debug('verilog-beautifier', 'emacs script path: ' + emacs_script_path)
... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/verilog-mode/index.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/verilog-mode/index.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/verilog-mode/index.coffee:2:raw_corpus | raw_corpus | @debug('verilog-beautifier', 'emacs args: ' + args)
@exe("emacs").run(args, {ignoreReturnCode: false})
.then(=>
@readFile(tempFile)
) | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/verilog-mode/index.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/verilog-mode/index.coffee | 51 | 57 | ||
Glavin001/atom-beautify:src/beautifiers/verilog-mode/index.coffee:2:completion | completion | @debug('verilog-beautifier', 'emacs args: ' + args)
@exe("emacs").run(args, {ignoreReturnCode: false}) | .then(=>
@readFile(tempFile)
) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/verilog-mode/index.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/verilog-mode/index.coffee | 51 | 57 |
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:1:raw_corpus | raw_corpus | apiCallback = (req, res) ->
{err, result} = res
if err
err = new Err(err) unless err instanceof Err
logger.info req.method, req.url, err.stack if err.code is 100
res.status(err.status or 400).json
code: err.code
message: err.locale(req.getLocale()).message
data: err.data or {}
else
... | CoffeeScript | jianliaoim/talk-os | talk-account/server/initializers/routes.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee | 18 | 67 | ||
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
apiCallback = (req, res) ->
{err, result} = res
if err
err = new Err(err) unless err instanceof Err
logger.info req.method, req.url, err.stack if err.code is 100
res.status(err.status or 400).json
code: err.code
message: err.locale(re... | var apiCallback;
apiCallback = function(req, res) {
var err, result;
({err, result} = res);
if (err) {
if (!(err instanceof Err)) {
err = new Err(err);
}
if (err.code === 100) {
logger.info(req.method, req.url, err.stack);
}
return res.status(err.status || 400).json({
code: ... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/server/initializers/routes.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee | 18 | 67 |
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var apiCallback;
apiCallback = function(req, res) {
var err, result;
({err, result} = res);
if (err) {
if (!(err instanceof Err)) {
err = new Err(err);
}
if (err.code === 100) {
logger.info(req.method, req.url, err.stack);
}
r... | apiCallback = (req, res) ->
{err, result} = res
if err
err = new Err(err) unless err instanceof Err
logger.info req.method, req.url, err.stack if err.code is 100
res.status(err.status or 400).json
code: err.code
message: err.locale(req.getLocale()).message
data: err.data or {}
else
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/initializers/routes.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee | 18 | 67 |
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:1:completion | completion | apiCallback = (req, res) ->
{err, result} = res
if err
err = new Err(err) unless err instanceof Err
logger.info req.method, req.url, err.stack if err.code is 100
res.status(err.status or 400).json
code: err.code
message: err.locale(req.getLocale()).message
data: err.data or {}
else
... | app.get '/bind-mobile', renderer
app.get '/verify-mobile', renderer
app.get '/succeed-binding', renderer
app.get '/bind-email', renderer
app.get '/verify-email', renderer # callback page from email
app.get '/email/preview', to: 'email#preview' if config.debug
# static file server for developing
app.use '/build', ex... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/initializers/routes.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee | 18 | 67 |
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:2:raw_corpus | raw_corpus | app.post '/email/change', to: 'email#change'
app.post '/email/forcebind', to: 'email#forcebind'
app.post '/email/unbind', to: 'email#unbind'
app.post '/mobile/signinbyverifycode', to: 'mobile#signinByVerifyCode'
app.post '/mobile/resetpassword', to: 'mobile#resetPassword'
app.post '/mobile/sendverifycode', to: 'mo... | CoffeeScript | jianliaoim/talk-os | talk-account/server/initializers/routes.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee | 68 | 117 | ||
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
app.post '/email/change', to: 'email#change'
app.post '/email/forcebind', to: 'email#forcebind'
app.post '/email/unbind', to: 'email#unbind'
app.post '/mobile/signinbyverifycode', to: 'mobile#signinByVerifyCode'
app.post '/mobile/resetpassword', to: 'mobile#r... | app.post('/email/change', {
to: 'email#change'
});
app.post('/email/forcebind', {
to: 'email#forcebind'
});
app.post('/email/unbind', {
to: 'email#unbind'
});
app.post('/mobile/signinbyverifycode', {
to: 'mobile#signinByVerifyCode'
});
app.post('/mobile/resetpassword', {
to: 'mobile#resetPassword'
});
ap... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/server/initializers/routes.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee | 68 | 117 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.