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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jnordberg/wintersmith:src/plugins/markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
... | var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
};
options.highlight = function(code, lang) {
va... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 0f7469f5ba91e8da23552515089a90e4337bb6bb | 3,484 | https://github.com/jnordberg/wintersmith/blob/0f7469f5ba91e8da23552515089a90e4337bb6bb/src/plugins/markdown.coffee | 19 | 37 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
... | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
try
lang = 'cpp' if lang is 'c'
return hljs.h... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 0f7469f5ba91e8da23552515089a90e4337bb6bb | 3,484 | https://github.com/jnordberg/wintersmith/blob/0f7469f5ba91e8da23552515089a90e4337bb6bb/src/plugins/markdown.coffee | 19 | 37 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:completion | completion | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
try
lang = 'cpp' if lang is 'c' | return hljs.highlight(lang, code).value
catch error
# if lang is unrecognized or nonexistent try to autodetect language
try
hljs.highlightAuto(code).value
catch error
return code
marked.setOptions options
return marked content | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 0f7469f5ba91e8da23552515089a90e4337bb6bb | 3,484 | https://github.com/jnordberg/wintersmith/blob/0f7469f5ba91e8da23552515089a90e4337bb6bb/src/plugins/markdown.coffee | 19 | 37 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:raw_corpus | raw_corpus | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
if lang?
try
lang = 'cpp' if lang is 'c'
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aec04be65e2e3a78bde8d8a152c948c49a6ba5da | 3,484 | https://github.com/jnordberg/wintersmith/blob/aec04be65e2e3a78bde8d8a152c948c49a6ba5da/src/plugins/markdown.coffee | 19 | 36 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
... | var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
};
options.highlight = function(code, lang) {
va... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aec04be65e2e3a78bde8d8a152c948c49a6ba5da | 3,484 | https://github.com/jnordberg/wintersmith/blob/aec04be65e2e3a78bde8d8a152c948c49a6ba5da/src/plugins/markdown.coffee | 19 | 36 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
... | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
if lang?
try
lang = 'cpp' if lang is 'c'
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aec04be65e2e3a78bde8d8a152c948c49a6ba5da | 3,484 | https://github.com/jnordberg/wintersmith/blob/aec04be65e2e3a78bde8d8a152c948c49a6ba5da/src/plugins/markdown.coffee | 19 | 36 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:completion | completion | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
if lang?
try | lang = 'cpp' if lang is 'c'
return hljs.highlight(lang, code).value
catch error
return code
else
return code
marked.setOptions options
return marked content | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aec04be65e2e3a78bde8d8a152c948c49a6ba5da | 3,484 | https://github.com/jnordberg/wintersmith/blob/aec04be65e2e3a78bde8d8a152c948c49a6ba5da/src/plugins/markdown.coffee | 19 | 36 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:raw_corpus | raw_corpus | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
link = null
uriParts = url.par... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 3a74ce75fe658517840a1a36314c3ff01762b410 | 3,484 | https://github.com/jnordberg/wintersmith/blob/3a74ce75fe658517840a1a36314c3ff01762b410/src/plugins/markdown.coffee | 17 | 61 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._reso... | var parseMarkdownSync;
parseMarkdownSync = function(content, markdown, baseUrl, options) {
/* Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 3a74ce75fe658517840a1a36314c3ff01762b410 | 3,484 | https://github.com/jnordberg/wintersmith/blob/3a74ce75fe658517840a1a36314c3ff01762b410/src/plugins/markdown.coffee | 17 | 61 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, markdown, baseUrl, options) {
/* Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. */
marked... | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
link = null
uriParts = url.par... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 3a74ce75fe658517840a1a36314c3ff01762b410 | 3,484 | https://github.com/jnordberg/wintersmith/blob/3a74ce75fe658517840a1a36314c3ff01762b410/src/plugins/markdown.coffee | 17 | 61 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:completion | completion | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
link = null
uriParts = url.par... | else
try
nav = nav[part]
link = nav.getUrl() + [uriParts.hash] if nav.getUrl
catch error
# error while navigating in content tree
break
link ?= url.resolve baseUrl, uri
options.highlight = (code, lang) ->
if lang?
try
lang = ... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 3a74ce75fe658517840a1a36314c3ff01762b410 | 3,484 | https://github.com/jnordberg/wintersmith/blob/3a74ce75fe658517840a1a36314c3ff01762b410/src/plugins/markdown.coffee | 17 | 61 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:raw_corpus | raw_corpus | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
async.parallel
metadata: (callback) ->
parseMetadata metadata, callback
markdown: (call... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 9b610439cc3dfd0ec295fb31f1ed8e621232db98 | 3,484 | https://github.com/jnordberg/wintersmith/blob/9b610439cc3dfd0ec295fb31f1ed8e621232db98/src/plugins/markdown.coffee | 86 | 117 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
async.parallel
metadata: (callback) ->
... | var JsonPage, markdown, metadata, result;
if (content.slice(0, 3) === '---') {
// "Front Matter"
result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
if ((result != null ? result.length : void 0) === 3) {
metadata = result[1];
markdown = result[2];
}
}
async.parallel({
metadata: functi... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 9b610439cc3dfd0ec295fb31f1ed8e621232db98 | 3,484 | https://github.com/jnordberg/wintersmith/blob/9b610439cc3dfd0ec295fb31f1ed8e621232db98/src/plugins/markdown.coffee | 86 | 117 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var JsonPage, markdown, metadata, result;
if (content.slice(0, 3) === '---') {
// "Front Matter"
result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
if ((result != null ? result.length : void 0) === 3) {
metadata = result[1];
markdown ... | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
async.parallel
metadata: (callback) ->
parseMetadata metadata, callback
markdown: (call... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 9b610439cc3dfd0ec295fb31f1ed8e621232db98 | 3,484 | https://github.com/jnordberg/wintersmith/blob/9b610439cc3dfd0ec295fb31f1ed8e621232db98/src/plugins/markdown.coffee | 86 | 117 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:completion | completion | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
async.parallel
metadata: (callback) ->
parseMetadata metadata, callback
markdown: (call... | JsonPage.fromFile = (filepath, callback) ->
async.waterfall [
async.apply env.utils.readJSON, filepath.full
(metadata, callback) =>
markdown = metadata.content or ''
page = new this filepath, metadata, markdown
callback null, page
], callback
# register the plugins
env.r... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 9b610439cc3dfd0ec295fb31f1ed8e621232db98 | 3,484 | https://github.com/jnordberg/wintersmith/blob/9b610439cc3dfd0ec295fb31f1ed8e621232db98/src/plugins/markdown.coffee | 86 | 117 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:raw_corpus | raw_corpus | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 779e6e3333837885f1dc9e58fa79bb2ffae43864 | 3,484 | https://github.com/jnordberg/wintersmith/blob/779e6e3333837885f1dc9e58fa79bb2ffae43864/src/plugins/markdown.coffee | 37 | 86 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:2:completion | completion | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | MarkdownPage.extractMetadata buffer.toString(), callback
(result, callback) =>
{markdown, metadata} = result
page = new this filepath, metadata, markdown
callback null, page
], callback
MarkdownPage.extractMetadata = (content, callback) ->
parseMetadata = (source, callback) ->
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 779e6e3333837885f1dc9e58fa79bb2ffae43864 | 3,484 | https://github.com/jnordberg/wintersmith/blob/779e6e3333837885f1dc9e58fa79bb2ffae43864/src/plugins/markdown.coffee | 37 | 86 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:raw_corpus | raw_corpus | # split metadata and markdown content
metadata = ''
markdown = content
if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
async.parallel
me... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 779e6e3333837885f1dc9e58fa79bb2ffae43864 | 3,484 | https://github.com/jnordberg/wintersmith/blob/779e6e3333837885f1dc9e58fa79bb2ffae43864/src/plugins/markdown.coffee | 87 | 122 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:3:completion | completion | # split metadata and markdown content
metadata = ''
markdown = content
if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
async.parallel
me... | class JsonPage extends MarkdownPage
### Plugin that allows pages to be created with just metadata form a JSON file ###
JsonPage.fromFile = (filepath, callback) ->
async.waterfall [
async.apply env.utils.readJSON, filepath.full
(metadata, callback) =>
markdown = metadata.content or ''
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 779e6e3333837885f1dc9e58fa79bb2ffae43864 | 3,484 | https://github.com/jnordberg/wintersmith/blob/779e6e3333837885f1dc9e58fa79bb2ffae43864/src/plugins/markdown.coffee | 87 | 122 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:raw_corpus | raw_corpus | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | d69b75b1d763f3db2799160eabf6d19462bb5421 | 3,484 | https://github.com/jnordberg/wintersmith/blob/d69b75b1d763f3db2799160eabf6d19462bb5421/src/plugins/markdown.coffee | 37 | 86 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:2:completion | completion | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | MarkdownPage.extractMetadata buffer.toString(), callback
(result, callback) =>
{markdown, metadata} = result
page = new this filepath, metadata, markdown
callback null, page
], callback
MarkdownPage.extractMetadata = (content, callback) ->
parseMetadata = (source, callback) ->
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | d69b75b1d763f3db2799160eabf6d19462bb5421 | 3,484 | https://github.com/jnordberg/wintersmith/blob/d69b75b1d763f3db2799160eabf6d19462bb5421/src/plugins/markdown.coffee | 37 | 86 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:raw_corpus | raw_corpus | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 6b79e2c13bf14a412652edd47eb019102dcf9924 | 3,484 | https://github.com/jnordberg/wintersmith/blob/6b79e2c13bf14a412652edd47eb019102dcf9924/src/plugins/markdown.coffee | 37 | 86 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:2:completion | completion | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | MarkdownPage.extractMetadata buffer.toString(), callback
(result, callback) =>
{markdown, metadata} = result
page = new this filepath, metadata, markdown
callback null, page
], callback
MarkdownPage.extractMetadata = (content, callback) ->
parseMetadata = (source, callback) ->
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 6b79e2c13bf14a412652edd47eb019102dcf9924 | 3,484 | https://github.com/jnordberg/wintersmith/blob/6b79e2c13bf14a412652edd47eb019102dcf9924/src/plugins/markdown.coffee | 37 | 86 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:raw_corpus | raw_corpus | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content, options
for token in tokens
switch token.type
when 'c... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 26221269972085a0013694dd05fc91c179e20ca1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/26221269972085a0013694dd05fc91c179e20ca1/src/plugins/markdown.coffee | 18 | 38 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content, options
... | var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
var error, i, len, token, tokens;
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
};
tokens = mark... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 26221269972085a0013694dd05fc91c179e20ca1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/26221269972085a0013694dd05fc91c179e20ca1/src/plugins/markdown.coffee | 18 | 38 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
var error, i, len, token, tokens;
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
... | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content, options
for token in tokens
switch token.type
when 'c... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 26221269972085a0013694dd05fc91c179e20ca1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/26221269972085a0013694dd05fc91c179e20ca1/src/plugins/markdown.coffee | 18 | 38 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:completion | completion | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content, options
for token in tokens
switch token.type | when 'code'
try
if token.lang?
token.text = hljs.highlight(token.lang, token.text).value
else
token.text = hljs.highlightAuto(token.text).value
token.escaped = true
catch error
# hljs.highlight throws if lang is unknown
return marked.par... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 26221269972085a0013694dd05fc91c179e20ca1 | 3,484 | https://github.com/jnordberg/wintersmith/blob/26221269972085a0013694dd05fc91c179e20ca1/src/plugins/markdown.coffee | 18 | 38 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:raw_corpus | raw_corpus | marked.InlineLexer.prototype.outputLink = (cap, link) ->
link.href = @_resolveLink link.href
return @_outputLink cap, link | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 6eae4dde431dd7a45da2df918fee8293139dbeb4 | 3,484 | https://github.com/jnordberg/wintersmith/blob/6eae4dde431dd7a45da2df918fee8293139dbeb4/src/plugins/markdown.coffee | 13 | 15 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
marked.InlineLexer.prototype.outputLink = (cap, link) ->
link.href = @_resolveLink link.href
return @_outputLink cap, link
``` | marked.InlineLexer.prototype.outputLink = function(cap, link) {
link.href = this._resolveLink(link.href);
return this._outputLink(cap, link);
}; | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 6eae4dde431dd7a45da2df918fee8293139dbeb4 | 3,484 | https://github.com/jnordberg/wintersmith/blob/6eae4dde431dd7a45da2df918fee8293139dbeb4/src/plugins/markdown.coffee | 13 | 15 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
marked.InlineLexer.prototype.outputLink = function(cap, link) {
link.href = this._resolveLink(link.href);
return this._outputLink(cap, link);
};
``` | marked.InlineLexer.prototype.outputLink = (cap, link) ->
link.href = @_resolveLink link.href
return @_outputLink cap, link | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 6eae4dde431dd7a45da2df918fee8293139dbeb4 | 3,484 | https://github.com/jnordberg/wintersmith/blob/6eae4dde431dd7a45da2df918fee8293139dbeb4/src/plugins/markdown.coffee | 13 | 15 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:raw_corpus | raw_corpus | parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tokens
switch token.type
when 'code'
try
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 1e0dffcd10667bd0350b9153da066d2c4bb0af00 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1e0dffcd10667bd0350b9153da066d2c4bb0af00/src/plugins/markdown.coffee | 16 | 36 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tok... | var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl) {
var error, i, len, token, tokens;
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
};
tokens = marked.lexer(... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 1e0dffcd10667bd0350b9153da066d2c4bb0af00 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1e0dffcd10667bd0350b9153da066d2c4bb0af00/src/plugins/markdown.coffee | 16 | 36 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl) {
var error, i, len, token, tokens;
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return u... | parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tokens
switch token.type
when 'code'
try
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 1e0dffcd10667bd0350b9153da066d2c4bb0af00 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1e0dffcd10667bd0350b9153da066d2c4bb0af00/src/plugins/markdown.coffee | 16 | 36 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:completion | completion | parseMarkdownSync = (content, baseUrl) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
tokens = marked.lexer content
for token in tokens
switch token.type | when 'code'
try
if token.lang?
token.text = hljs.highlight(token.lang, token.text).value
else
token.text = hljs.highlightAuto(token.text).value
token.escaped = true
catch error
# hljs.highlight throws if lang is unknown
return marked.par... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 1e0dffcd10667bd0350b9153da066d2c4bb0af00 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1e0dffcd10667bd0350b9153da066d2c4bb0af00/src/plugins/markdown.coffee | 16 | 36 |
jnordberg/wintersmith:src/plugins/markdown.coffee:4:raw_corpus | raw_corpus | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 1e0dffcd10667bd0350b9153da066d2c4bb0af00 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1e0dffcd10667bd0350b9153da066d2c4bb0af00/src/plugins/markdown.coffee | 38 | 87 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:4:completion | completion | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | callback null, page
], callback
MarkdownPage.extractMetadata = (content, callback) ->
parseMetadata = (source, callback) ->
return callback(null, {}) unless source.length > 0
try
callback null, yaml.load(source) or {}
catch error
if error.problem? and error.problemMark?
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 1e0dffcd10667bd0350b9153da066d2c4bb0af00 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1e0dffcd10667bd0350b9153da066d2c4bb0af00/src/plugins/markdown.coffee | 38 | 87 |
jnordberg/wintersmith:src/plugins/markdown.coffee:4:raw_corpus | raw_corpus | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f | 3,484 | https://github.com/jnordberg/wintersmith/blob/c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f/src/plugins/markdown.coffee | 38 | 87 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:4:completion | completion | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | ], callback
MarkdownPage.extractMetadata = (content, callback) ->
parseMetadata = (source, callback) ->
return callback(null, {}) unless source.length > 0
try
callback null, yaml.load(source) or {}
catch error
callback error
# split metadata and markdown content
metadat... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f | 3,484 | https://github.com/jnordberg/wintersmith/blob/c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f/src/plugins/markdown.coffee | 38 | 87 |
jnordberg/wintersmith:src/plugins/markdown.coffee:5:raw_corpus | raw_corpus | callback null, markdown
, callback
class JsonPage extends MarkdownPage
### Plugin that allows pages to be created with just metadata form a JSON file ###
JsonPage.fromFile = (filepath, callback) ->
async.waterfall [
async.apply env.utils.readJSON, filepath.full
(metadata, callback) =>
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f | 3,484 | https://github.com/jnordberg/wintersmith/blob/c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f/src/plugins/markdown.coffee | 88 | 108 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:5:completion | completion | callback null, markdown
, callback
class JsonPage extends MarkdownPage
### Plugin that allows pages to be created with just metadata form a JSON file ###
JsonPage.fromFile = (filepath, callback) ->
async.waterfall [
async.apply env.utils.readJSON, filepath.full
(metadata, callback) => | markdown = metadata.content or ''
page = new this filepath, metadata, markdown
callback null, page
], callback
# register the plugins
env.registerContentPlugin 'pages', '**/*.*(markdown|mkd|md)', MarkdownPage
env.registerContentPlugin 'pages', '**/*.json', JsonPage
# done!
callback() | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f | 3,484 | https://github.com/jnordberg/wintersmith/blob/c9efc8b503a1a4248f5b6a14d7bc672f7d9ad89f/src/plugins/markdown.coffee | 88 | 108 |
jianliaoim/talk-os:talk-web/client/updater/tagged-message.coffee:1:raw_corpus | raw_corpus | exports.read = (store, messagesList) ->
store.set 'taggedMessages', messagesList.filter (message) ->
maybeTags = message.get('tags')
maybeTags and maybeTags.size > 0 | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tagged-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tagged-message.coffee | 1 | 4 | ||
jianliaoim/talk-os:talk-web/client/updater/tagged-message.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.read = (store, messagesList) ->
store.set 'taggedMessages', messagesList.filter (message) ->
maybeTags = message.get('tags')
maybeTags and maybeTags.size > 0
``` | exports.read = function(store, messagesList) {
return store.set('taggedMessages', messagesList.filter(function(message) {
var maybeTags;
maybeTags = message.get('tags');
return maybeTags && maybeTags.size > 0;
}));
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/tagged-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tagged-message.coffee | 1 | 4 |
jianliaoim/talk-os:talk-web/client/updater/tagged-message.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.read = function(store, messagesList) {
return store.set('taggedMessages', messagesList.filter(function(message) {
var maybeTags;
maybeTags = message.get('tags');
return maybeTags && maybeTags.size > 0;
}));
};
``` | exports.read = (store, messagesList) ->
store.set 'taggedMessages', messagesList.filter (message) ->
maybeTags = message.get('tags')
maybeTags and maybeTags.size > 0 | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tagged-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tagged-message.coffee | 1 | 4 |
jianliaoim/talk-os:talk-web/client/updater/tagged-message.coffee:1:completion | completion | exports.read = (store, messagesList) ->
store.set 'taggedMessages', messagesList.filter (message) -> | maybeTags = message.get('tags')
maybeTags and maybeTags.size > 0 | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tagged-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tagged-message.coffee | 1 | 4 |
jianliaoim/talk-os:talk-web/client/util/lookup.coffee:1:raw_corpus | raw_corpus | exports.getMessageChannelId = (messageData, _userId) ->
_roomId = messageData.get('_roomId')
_storyId = messageData.get('_storyId')
_toId = messageData.get('_toId')
_creatorId = messageData.get('_creatorId')
isMe = _toId is _userId
_roomId or _storyId or (if isMe then _creatorId else _toId)
exports.getChan... | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/lookup.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/lookup.coffee | 1 | 24 | ||
jianliaoim/talk-os:talk-web/client/util/lookup.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.getMessageChannelId = (messageData, _userId) ->
_roomId = messageData.get('_roomId')
_storyId = messageData.get('_storyId')
_toId = messageData.get('_toId')
_creatorId = messageData.get('_creatorId')
isMe = _toId is _userId
_roomId or _storyId... | exports.getMessageChannelId = function(messageData, _userId) {
var _creatorId, _roomId, _storyId, _toId, isMe;
_roomId = messageData.get('_roomId');
_storyId = messageData.get('_storyId');
_toId = messageData.get('_toId');
_creatorId = messageData.get('_creatorId');
isMe = _toId === _userId;
return _roomI... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/lookup.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/lookup.coffee | 1 | 24 |
jianliaoim/talk-os:talk-web/client/util/lookup.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.getMessageChannelId = function(messageData, _userId) {
var _creatorId, _roomId, _storyId, _toId, isMe;
_roomId = messageData.get('_roomId');
_storyId = messageData.get('_storyId');
_toId = messageData.get('_toId');
_creatorId = messageData.get('_c... | exports.getMessageChannelId = (messageData, _userId) ->
_roomId = messageData.get('_roomId')
_storyId = messageData.get('_storyId')
_toId = messageData.get('_toId')
_creatorId = messageData.get('_creatorId')
isMe = _toId is _userId
_roomId or _storyId or (if isMe then _creatorId else _toId)
exports.getChan... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/lookup.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/lookup.coffee | 1 | 24 |
jianliaoim/talk-os:talk-web/client/util/lookup.coffee:1:completion | completion | exports.getMessageChannelId = (messageData, _userId) ->
_roomId = messageData.get('_roomId')
_storyId = messageData.get('_storyId')
_toId = messageData.get('_toId')
_creatorId = messageData.get('_creatorId')
isMe = _toId is _userId
_roomId or _storyId or (if isMe then _creatorId else _toId)
exports.getChan... | _toId or _roomId or _storyId
exports.getChannelType = (channelData) ->
if channelData.has('_toId')
'chat'
else if channelData.has('_roomId')
'room'
else if channelData.has('_storyId')
'story'
else
throw Error 'undefined channel type' | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/lookup.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/lookup.coffee | 1 | 24 |
jianliaoim/talk-os:talk-web/client/module/permission.coffee:1:raw_corpus | raw_corpus | hasPermission = (userRole, allowedPermission) ->
if not accessLevel[userRole]?
throw Error "user role is unsupported: #{userRole}"
if not allowedPermission?
throw Error "permission is undefined: #{allowedPermission}"
(accessLevel[userRole] & allowedPermission) > 0
componentMode =
hide: 'hide' # 权限不够的话不... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 23 | 39 | ||
jianliaoim/talk-os:talk-web/client/module/permission.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
hasPermission = (userRole, allowedPermission) ->
if not accessLevel[userRole]?
throw Error "user role is unsupported: #{userRole}"
if not allowedPermission?
throw Error "permission is undefined: #{allowedPermission}"
(accessLevel[userRole] & allowed... | var componentMode, hasPermission;
hasPermission = function(userRole, allowedPermission) {
if (accessLevel[userRole] == null) {
throw Error(`user role is unsupported: ${userRole}`);
}
if (allowedPermission == null) {
throw Error(`permission is undefined: ${allowedPermission}`);
}
return (accessLevel[u... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 23 | 39 |
jianliaoim/talk-os:talk-web/client/module/permission.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var componentMode, hasPermission;
hasPermission = function(userRole, allowedPermission) {
if (accessLevel[userRole] == null) {
throw Error(`user role is unsupported: ${userRole}`);
}
if (allowedPermission == null) {
throw Error(`permission is undefin... | hasPermission = (userRole, allowedPermission) ->
if not accessLevel[userRole]?
throw Error "user role is unsupported: #{userRole}"
if not allowedPermission?
throw Error "permission is undefined: #{allowedPermission}"
(accessLevel[userRole] & allowedPermission) > 0
componentMode =
hide: 'hide' # 权限不够的话不... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 23 | 39 |
jianliaoim/talk-os:talk-web/client/module/permission.coffee:1:completion | completion | hasPermission = (userRole, allowedPermission) ->
if not accessLevel[userRole]?
throw Error "user role is unsupported: #{userRole}"
if not allowedPermission?
throw Error "permission is undefined: #{allowedPermission}"
(accessLevel[userRole] & allowedPermission) > 0
componentMode = | hide: 'hide' # 权限不够的话不显示
propogate: 'propogate' # 权限不同会改变样式
# This create func require _teamId
# to define if the user has right permission,
# but maybe we could use other way to make this work.
# just a note.
# | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 23 | 39 |
jianliaoim/talk-os:talk-web/client/module/permission.coffee:2:raw_corpus | raw_corpus | create = (ComponentClass, allowedPermission, mode = componentMode.hide) ->
React.createClass
displayName: 'Permission ' + ComponentClass.displayName
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string
getInitialState: ->
user: @getUser()
com... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 41 | 84 | ||
jianliaoim/talk-os:talk-web/client/module/permission.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
create = (ComponentClass, allowedPermission, mode = componentMode.hide) ->
React.createClass
displayName: 'Permission ' + ComponentClass.displayName
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string... | var create;
create = function(ComponentClass, allowedPermission, mode = componentMode.hide) {
return React.createClass({
displayName: 'Permission ' + ComponentClass.displayName,
mixins: [mixinSubscribe],
propTypes: {
_teamId: T.string.isRequired,
_creatorId: T.string
},
getInitialStat... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 41 | 84 |
jianliaoim/talk-os:talk-web/client/module/permission.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var create;
create = function(ComponentClass, allowedPermission, mode = componentMode.hide) {
return React.createClass({
displayName: 'Permission ' + ComponentClass.displayName,
mixins: [mixinSubscribe],
propTypes: {
_teamId: T.string.isRequire... | create = (ComponentClass, allowedPermission, mode = componentMode.hide) ->
React.createClass
displayName: 'Permission ' + ComponentClass.displayName
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string
getInitialState: ->
user: @getUser()
com... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 41 | 84 |
jianliaoim/talk-os:talk-web/client/module/permission.coffee:2:completion | completion | create = (ComponentClass, allowedPermission, mode = componentMode.hide) ->
React.createClass
displayName: 'Permission ' + ComponentClass.displayName
mixins: [mixinSubscribe]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string
getInitialState: ->
user: @getUser()
com... | getUser: ->
query.userFromContacts(recorder.getState(), @props._teamId)
getUserRole: ->
@state.user?.get('role') or 'member'
render: ->
userRole = @getUserRole()
isAllowed = hasPermission userRole, allowedPermission
isCreator = @isCreator()
componentHasPermission = isCreat... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission.coffee | 41 | 84 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:raw_corpus | raw_corpus | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.... | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | b1d617f7a8490397470c19cf86b0c64953d839fa | 663 | https://github.com/buttercoin/buttercoin/blob/b1d617f7a8490397470c19cf86b0c64953d839fa/lib/trade_engine.coffee | 1 | 17 | ||
buttercoin/buttercoin:lib/trade_engine.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handl... | var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
execute_operation(op) {
// Makes calls into datastore... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | b1d617f7a8490397470c19cf86b0c64953d839fa | 663 | https://github.com/buttercoin/buttercoin/blob/b1d617f7a8490397470c19cf86b0c64953d839fa/lib/trade_engine.coffee | 1 | 17 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
ex... | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | b1d617f7a8490397470c19cf86b0c64953d839fa | 663 | https://github.com/buttercoin/buttercoin/blob/b1d617f7a8490397470c19cf86b0c64953d839fa/lib/trade_engine.coffee | 1 | 17 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:completion | completion | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: -> | @datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.ADD_DEPOSIT
return "foo"
#return @datastore.add_deposit( op )
else
throw Error("Unknown Operation" + JSON.stringify(op)) | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | b1d617f7a8490397470c19cf86b0c64953d839fa | 663 | https://github.com/buttercoin/buttercoin/blob/b1d617f7a8490397470c19cf86b0c64953d839fa/lib/trade_engine.coffee | 1 | 17 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:raw_corpus | raw_corpus | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
###
if op.kind == ope... | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | d8303a44fbbf4d8edc243b04a3a5e40377af3615 | 663 | https://github.com/buttercoin/buttercoin/blob/d8303a44fbbf4d8edc243b04a3a5e40377af3615/lib/trade_engine.coffee | 1 | 18 | ||
buttercoin/buttercoin:lib/trade_engine.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handl... | var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
execute_operation(op) {
// Makes calls into datastore... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | d8303a44fbbf4d8edc243b04a3a5e40377af3615 | 663 | https://github.com/buttercoin/buttercoin/blob/d8303a44fbbf4d8edc243b04a3a5e40377af3615/lib/trade_engine.coffee | 1 | 18 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
ex... | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
###
if op.kind == ope... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | d8303a44fbbf4d8edc243b04a3a5e40377af3615 | 663 | https://github.com/buttercoin/buttercoin/blob/d8303a44fbbf4d8edc243b04a3a5e40377af3615/lib/trade_engine.coffee | 1 | 18 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:completion | completion | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore | execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
###
if op.kind == operations.ADD_DEPOSIT
datastore.add_deposit( op )
else
###
throw Error("Unknown Operation") | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | d8303a44fbbf4d8edc243b04a3a5e40377af3615 | 663 | https://github.com/buttercoin/buttercoin/blob/d8303a44fbbf4d8edc243b04a3a5e40377af3615/lib/trade_engine.coffee | 1 | 18 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:raw_corpus | raw_corpus | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations... | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | c1e15fc3841af44bd188994416f3e4a4a7d46c8f | 663 | https://github.com/buttercoin/buttercoin/blob/c1e15fc3841af44bd188994416f3e4a4a7d46c8f/lib/trade_engine.coffee | 1 | 19 | ||
buttercoin/buttercoin:lib/trade_engine.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handl... | var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
execute_operation(op) {
var retval;
// Makes call... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | c1e15fc3841af44bd188994416f3e4a4a7d46c8f | 663 | https://github.com/buttercoin/buttercoin/blob/c1e15fc3841af44bd188994416f3e4a4a7d46c8f/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
ex... | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | c1e15fc3841af44bd188994416f3e4a4a7d46c8f | 663 | https://github.com/buttercoin/buttercoin/blob/c1e15fc3841af44bd188994416f3e4a4a7d46c8f/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:completion | completion | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore | execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.ADD_DEPOSIT
retval = @datastore.add_deposit( op )
else
throw Error("Unknown Operation" + JSON.stringify(op))
# call callback with retval | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | c1e15fc3841af44bd188994416f3e4a4a7d46c8f | 663 | https://github.com/buttercoin/buttercoin/blob/c1e15fc3841af44bd188994416f3e4a4a7d46c8f/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:raw_corpus | raw_corpus | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations... | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 77bdcec5d890976d4f02b71666d7265840e0c172 | 663 | https://github.com/buttercoin/buttercoin/blob/77bdcec5d890976d4f02b71666d7265840e0c172/lib/trade_engine.coffee | 1 | 19 | ||
buttercoin/buttercoin:lib/trade_engine.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handl... | var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
execute_operation(op) {
var retval;
// Makes call... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 77bdcec5d890976d4f02b71666d7265840e0c172 | 663 | https://github.com/buttercoin/buttercoin/blob/77bdcec5d890976d4f02b71666d7265840e0c172/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('./operations');
DataStore = require('./datastore/datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
ex... | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 77bdcec5d890976d4f02b71666d7265840e0c172 | 663 | https://github.com/buttercoin/buttercoin/blob/77bdcec5d890976d4f02b71666d7265840e0c172/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:completion | completion | Q = require('q')
operations = require('./operations')
DataStore = require('./datastore/datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore | execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.ADD_DEPOSIT
retval = datastore.add_deposit( op )
else
throw Error("Unknown Operation")
# call callback with retval | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 77bdcec5d890976d4f02b71666d7265840e0c172 | 663 | https://github.com/buttercoin/buttercoin/blob/77bdcec5d890976d4f02b71666d7265840e0c172/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:raw_corpus | raw_corpus | Q = require('q')
operations = require('operations')
DataStore = require('datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.ADD_DEPOSIT
... | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 1f186911398a725c15be4770d1a60bffb6454c4e | 663 | https://github.com/buttercoin/buttercoin/blob/1f186911398a725c15be4770d1a60bffb6454c4e/lib/trade_engine.coffee | 1 | 19 | ||
buttercoin/buttercoin:lib/trade_engine.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
operations = require('operations')
DataStore = require('datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks f... | var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('operations');
DataStore = require('datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
execute_operation(op) {
var retval;
// Makes calls into datasto... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 1f186911398a725c15be4770d1a60bffb6454c4e | 663 | https://github.com/buttercoin/buttercoin/blob/1f186911398a725c15be4770d1a60bffb6454c4e/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DataStore, Q, TradeEngine, operations;
Q = require('q');
operations = require('operations');
DataStore = require('datastore');
module.exports = TradeEngine = class TradeEngine {
constructor() {
this.datastore = new DataStore();
}
execute_operatio... | Q = require('q')
operations = require('operations')
DataStore = require('datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore
execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.ADD_DEPOSIT
... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 1f186911398a725c15be4770d1a60bffb6454c4e | 663 | https://github.com/buttercoin/buttercoin/blob/1f186911398a725c15be4770d1a60bffb6454c4e/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:completion | completion | Q = require('q')
operations = require('operations')
DataStore = require('datastore')
module.exports = class TradeEngine
constructor: ->
@datastore = new DataStore | execute_operation: (op) ->
# Makes calls into datastore and then handles callbacks for operation.
if op.kind == operations.ADD_DEPOSIT
retval = datastore.add_deposit( op )
else
throw Error("Unknown Operation")
# call callback with retval | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | 1f186911398a725c15be4770d1a60bffb6454c4e | 663 | https://github.com/buttercoin/buttercoin/blob/1f186911398a725c15be4770d1a60bffb6454c4e/lib/trade_engine.coffee | 1 | 19 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:raw_corpus | raw_corpus | Q = require('q')
module.exports = class TradeEngine
constructor: ->
execute_operation: (operation) ->
# Makes calls into datastore and then handles callbacks for operation.
# call into data store
# -> result
# call callbacks | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | ee3136019d81cc7fe8dcf1e57accdae927fec83f | 663 | https://github.com/buttercoin/buttercoin/blob/ee3136019d81cc7fe8dcf1e57accdae927fec83f/lib/trade_engine.coffee | 1 | 12 | ||
buttercoin/buttercoin:lib/trade_engine.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
module.exports = class TradeEngine
constructor: ->
execute_operation: (operation) ->
# Makes calls into datastore and then handles callbacks for operation.
# call into data store
# -> result
# call callbacks
``` | var Q, TradeEngine;
Q = require('q');
module.exports = TradeEngine = class TradeEngine {
constructor() {}
execute_operation(operation) {}
};
// Makes calls into datastore and then handles callbacks for operation.
// call into data store
// -> result
// call callbacks | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | ee3136019d81cc7fe8dcf1e57accdae927fec83f | 663 | https://github.com/buttercoin/buttercoin/blob/ee3136019d81cc7fe8dcf1e57accdae927fec83f/lib/trade_engine.coffee | 1 | 12 |
buttercoin/buttercoin:lib/trade_engine.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Q, TradeEngine;
Q = require('q');
module.exports = TradeEngine = class TradeEngine {
constructor() {}
execute_operation(operation) {}
};
// Makes calls into datastore and then handles callbacks for operation.
// call into data store
// -> result
// c... | Q = require('q')
module.exports = class TradeEngine
constructor: ->
execute_operation: (operation) ->
# Makes calls into datastore and then handles callbacks for operation.
# call into data store
# -> result
# call callbacks | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/trade_engine.coffee | MIT | ee3136019d81cc7fe8dcf1e57accdae927fec83f | 663 | https://github.com/buttercoin/buttercoin/blob/ee3136019d81cc7fe8dcf1e57accdae927fec83f/lib/trade_engine.coffee | 1 | 12 |
jianliaoim/talk-os:talk-web/test/spec/actions/inte.spec.coffee:1:raw_corpus | raw_corpus | xdescribe 'Actions: inte', ->
beforeEach ->
@action = require 'actions/inte'
@api = require 'network/api'
describe 'Method: inteFetch', ->
it 'should call api', ->
spyOn(@api.integrations.read, 'get').and.callThrough()
teamId = 1
config =
queryParams:
_teamId: team... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/inte.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/inte.spec.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/test/spec/actions/inte.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
xdescribe 'Actions: inte', ->
beforeEach ->
@action = require 'actions/inte'
@api = require 'network/api'
describe 'Method: inteFetch', ->
it 'should call api', ->
spyOn(@api.integrations.read, 'get').and.callThrough()
teamId = 1
... | xdescribe('Actions: inte', function() {
beforeEach(function() {
this.action = require('actions/inte');
return this.api = require('network/api');
});
describe('Method: inteFetch', function() {
return it('should call api', function() {
var config, teamId;
spyOn(this.api.integrations.read, 'g... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/test/spec/actions/inte.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/inte.spec.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/test/spec/actions/inte.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
xdescribe('Actions: inte', function() {
beforeEach(function() {
this.action = require('actions/inte');
return this.api = require('network/api');
});
describe('Method: inteFetch', function() {
return it('should call api', function() {
var con... | xdescribe 'Actions: inte', ->
beforeEach ->
@action = require 'actions/inte'
@api = require 'network/api'
describe 'Method: inteFetch', ->
it 'should call api', ->
spyOn(@api.integrations.read, 'get').and.callThrough()
teamId = 1
config =
queryParams:
_teamId: team... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/inte.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/inte.spec.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/test/spec/actions/inte.spec.coffee:1:completion | completion | xdescribe 'Actions: inte', ->
beforeEach ->
@action = require 'actions/inte'
@api = require 'network/api'
describe 'Method: inteFetch', ->
it 'should call api', ->
spyOn(@api.integrations.read, 'get').and.callThrough()
teamId = 1
config =
queryParams:
_teamId: team... | pathParams:
id: inteId
data: data
@action.inteUpdate(inteId, data)
expect(@api.integrations.update.put).toHaveBeenCalledWith config
describe 'Method: inteCreate', ->
it 'should call api', ->
spyOn(@api.integrations.create, 'post').and.callThrough()
data = {}
conf... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/inte.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/inte.spec.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/test/spec/actions/inte.spec.coffee:2:raw_corpus | raw_corpus | @action.inteRemove(inte)
expect(@api.integrations.remove.delete).toHaveBeenCalledWith config
describe 'Method: checkRss', ->
it 'should call api', ->
spyOn(@api.integrations.checkrss, 'get').and.callThrough()
url = 'http://example.com'
config =
queryParams:
url: url
... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/inte.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/inte.spec.coffee | 51 | 71 | ||
jianliaoim/talk-os:talk-web/test/spec/actions/inte.spec.coffee:2:completion | completion | @action.inteRemove(inte)
expect(@api.integrations.remove.delete).toHaveBeenCalledWith config
describe 'Method: checkRss', ->
it 'should call api', ->
spyOn(@api.integrations.checkrss, 'get').and.callThrough()
url = 'http://example.com'
config =
queryParams: | url: url
@action.checkRss(url)
expect(@api.integrations.checkrss.get).toHaveBeenCalledWith config
describe 'Method: getSettings', ->
it 'should call api', ->
spyOn(@api.services.settings, 'get').and.callThrough()
@action.getSettings()
expect(@api.services.settings.get).toHaveBeenCa... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/actions/inte.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/actions/inte.spec.coffee | 51 | 71 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:raw_corpus | raw_corpus | "use strict"
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
... | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 7173c245aab4c2b417cd4c24f0b54e697a369864 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/7173c245aab4c2b417cd4c24f0b54e697a369864/src/processors.coffee | 1 | 23 | ||
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"use strict"
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.str... | "use strict";
var prefixMatch;
// matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + str.slice(1);
};
exports.stripPrefix = fun... | CoffeeScript | JavaScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 7173c245aab4c2b417cd4c24f0b54e697a369864 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/7173c245aab4c2b417cd4c24f0b54e697a369864/src/processors.coffee | 1 | 23 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
"use strict";
var prefixMatch;
// matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLo... | "use strict"
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
... | JavaScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 7173c245aab4c2b417cd4c24f0b54e697a369864 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/7173c245aab4c2b417cd4c24f0b54e697a369864/src/processors.coffee | 1 | 23 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:completion | completion | "use strict"
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1) | exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
exports.parseNumbers = (str) ->
if !isNaN str
str = if str % 1 == 0 then parseInt str, 10 else parseFloat str
return str
exports.parseBooleans = (str) ->
if /^(?:true|false)$/i.test(str)
str = str.toLowerCase() == 'true'
return str | CoffeeScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 7173c245aab4c2b417cd4c24f0b54e697a369864 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/7173c245aab4c2b417cd4c24f0b54e697a369864/src/processors.coffee | 1 | 23 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:raw_corpus | raw_corpus | "use strict";
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
... | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | df391301e7bde72a90fb1ba7345d062cd693d4de | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/df391301e7bde72a90fb1ba7345d062cd693d4de/src/processors.coffee | 1 | 22 | ||
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"use strict";
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.str... | "use strict";
var prefixMatch;
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + str.slice(1);
};
exports.stripPrefix = function(str) {
return str.replace(prefixMatch, ''... | CoffeeScript | JavaScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | df391301e7bde72a90fb1ba7345d062cd693d4de | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/df391301e7bde72a90fb1ba7345d062cd693d4de/src/processors.coffee | 1 | 22 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
"use strict";
var prefixMatch;
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + str.slice(1);
};
exports.stripPrefix... | "use strict";
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
... | JavaScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | df391301e7bde72a90fb1ba7345d062cd693d4de | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/df391301e7bde72a90fb1ba7345d062cd693d4de/src/processors.coffee | 1 | 22 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:completion | completion | "use strict";
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) -> | return str.replace prefixMatch, ''
exports.parseNumbers = (str) ->
if !isNaN str
str = if str % 1 == 0 then parseInt str, 10 else parseFloat str
return str
exports.parseBooleans = (str) ->
if /^(?:true|false)$/i.test(str)
str = str.toLowerCase() == 'true'
return str | CoffeeScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | df391301e7bde72a90fb1ba7345d062cd693d4de | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/df391301e7bde72a90fb1ba7345d062cd693d4de/src/processors.coffee | 1 | 22 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:raw_corpus | raw_corpus | # matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
exports.parse... | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 11e11cf2a1c33b8d9836860ebd8191041690fcfa | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/11e11cf2a1c33b8d9836860ebd8191041690fcfa/src/processors.coffee | 1 | 21 | ||
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (st... | // matches all xml prefixes, except for `xmlns:`
var prefixMatch;
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + str.slice(1);
};
exports.stripPrefix = function(str) {
... | CoffeeScript | JavaScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 11e11cf2a1c33b8d9836860ebd8191041690fcfa | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/11e11cf2a1c33b8d9836860ebd8191041690fcfa/src/processors.coffee | 1 | 21 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// matches all xml prefixes, except for `xmlns:`
var prefixMatch;
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + st... | # matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
exports.parse... | JavaScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 11e11cf2a1c33b8d9836860ebd8191041690fcfa | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/11e11cf2a1c33b8d9836860ebd8191041690fcfa/src/processors.coffee | 1 | 21 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:completion | completion | # matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) -> | return str.replace prefixMatch, ''
exports.parseNumbers = (str) ->
if !isNaN str
str = if str % 1 == 0 then parseInt str, 10 else parseFloat str
return str
exports.parseBooleans = (str) ->
if /^(?:true|false)$/i.test(str)
str = str.toLowerCase() == 'true'
return str | CoffeeScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 11e11cf2a1c33b8d9836860ebd8191041690fcfa | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/11e11cf2a1c33b8d9836860ebd8191041690fcfa/src/processors.coffee | 1 | 21 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:raw_corpus | raw_corpus | # matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
exports.parse... | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 9678bba6ee805685781d69053c271129d25c5647 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/9678bba6ee805685781d69053c271129d25c5647/src/processors.coffee | 1 | 16 | ||
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (st... | // matches all xml prefixes, except for `xmlns:`
var prefixMatch;
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + str.slice(1);
};
exports.stripPrefix = function(str) {
... | CoffeeScript | JavaScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 9678bba6ee805685781d69053c271129d25c5647 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/9678bba6ee805685781d69053c271129d25c5647/src/processors.coffee | 1 | 16 |
Leonidas-from-XIV/node-xml2js:src/processors.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// matches all xml prefixes, except for `xmlns:`
var prefixMatch;
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + st... | # matches all xml prefixes, except for `xmlns:`
prefixMatch = new RegExp /(?!xmlns)^.*:/
exports.normalize = (str) ->
return str.toLowerCase()
exports.firstCharLowerCase = (str) ->
return str.charAt(0).toLowerCase() + str.slice(1)
exports.stripPrefix = (str) ->
return str.replace prefixMatch, ''
exports.parse... | JavaScript | CoffeeScript | Leonidas-from-XIV/node-xml2js | src/processors.coffee | MIT | 9678bba6ee805685781d69053c271129d25c5647 | 4,965 | https://github.com/Leonidas-from-XIV/node-xml2js/blob/9678bba6ee805685781d69053c271129d25c5647/src/processors.coffee | 1 | 16 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.