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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abe33/atom-pigments:lib/color-scanner.coffee:1:raw_corpus | raw_corpus | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
new RegExp(@registry.getRegExp(), 'g')
getR... | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | fccbdeb8e6b926940f667b37d9d593f158261d10 | 518 | https://github.com/abe33/atom-pigments/blob/fccbdeb8e6b926940f667b37d9d593f158261d10/lib/color-scanner.coffee | 1 | 40 | ||
abe33/atom-pigments:lib/color-scanner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegE... | var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} = {}) {
this.context = context;
this.parser = t... | CoffeeScript | JavaScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | fccbdeb8e6b926940f667b37d9d593f158261d10 | 518 | https://github.com/abe33/atom-pigments/blob/fccbdeb8e6b926940f667b37d9d593f158261d10/lib/color-scanner.coffee | 1 | 40 |
abe33/atom-pigments:lib/color-scanner.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} ... | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
new RegExp(@registry.getRegExp(), 'g')
getR... | JavaScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | fccbdeb8e6b926940f667b37d9d593f158261d10 | 518 | https://github.com/abe33/atom-pigments/blob/fccbdeb8e6b926940f667b37d9d593f158261d10/lib/color-scanner.coffee | 1 | 40 |
abe33/atom-pigments:lib/color-scanner.coffee:1:completion | completion | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
new RegExp(@registry.getRegExp(), 'g')
getR... | if match = regexp.exec(text)
[matchText] = match
{lastIndex} = regexp
color = @parser.parse(matchText, scope)
# return unless color?
if (index = matchText.indexOf(color.colorExpression)) > 0
lastIndex += -matchText.length + index + color.colorExpression.length
matchText ... | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | fccbdeb8e6b926940f667b37d9d593f158261d10 | 518 | https://github.com/abe33/atom-pigments/blob/fccbdeb8e6b926940f667b37d9d593f158261d10/lib/color-scanner.coffee | 1 | 40 |
abe33/atom-pigments:lib/color-scanner.coffee:1:raw_corpus | raw_corpus | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
new RegExp(@registry.getRegExp(), 'g')
getR... | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 36f562cc2c51fe076f776f2e84d707d978a9e906 | 518 | https://github.com/abe33/atom-pigments/blob/36f562cc2c51fe076f776f2e84d707d978a9e906/lib/color-scanner.coffee | 1 | 38 | ||
abe33/atom-pigments:lib/color-scanner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegE... | var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} = {}) {
this.context = context;
this.parser = t... | CoffeeScript | JavaScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 36f562cc2c51fe076f776f2e84d707d978a9e906 | 518 | https://github.com/abe33/atom-pigments/blob/36f562cc2c51fe076f776f2e84d707d978a9e906/lib/color-scanner.coffee | 1 | 38 |
abe33/atom-pigments:lib/color-scanner.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} ... | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
new RegExp(@registry.getRegExp(), 'g')
getR... | JavaScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 36f562cc2c51fe076f776f2e84d707d978a9e906 | 518 | https://github.com/abe33/atom-pigments/blob/36f562cc2c51fe076f776f2e84d707d978a9e906/lib/color-scanner.coffee | 1 | 38 |
abe33/atom-pigments:lib/color-scanner.coffee:1:completion | completion | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
new RegExp(@registry.getRegExp(), 'g')
getR... | if match = regexp.exec(text)
[matchText] = match
{lastIndex} = regexp
color = @parser.parse(matchText, scope)
if (index = matchText.indexOf(color.colorExpression)) > 0
lastIndex += -matchText.length + index + color.colorExpression.length
matchText = color.colorExpression
... | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 36f562cc2c51fe076f776f2e84d707d978a9e906 | 518 | https://github.com/abe33/atom-pigments/blob/36f562cc2c51fe076f776f2e84d707d978a9e906/lib/color-scanner.coffee | 1 | 38 |
abe33/atom-pigments:lib/color-scanner.coffee:1:raw_corpus | raw_corpus | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
@regexp = new RegExp(@registry.getRegExp(), 'g... | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | b8918c7ec066777bd5243c753779e638b7238887 | 518 | https://github.com/abe33/atom-pigments/blob/b8918c7ec066777bd5243c753779e638b7238887/lib/color-scanner.coffee | 1 | 38 | ||
abe33/atom-pigments:lib/color-scanner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegE... | var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} = {}) {
this.context = context;
this.parser = t... | CoffeeScript | JavaScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | b8918c7ec066777bd5243c753779e638b7238887 | 518 | https://github.com/abe33/atom-pigments/blob/b8918c7ec066777bd5243c753779e638b7238887/lib/color-scanner.coffee | 1 | 38 |
abe33/atom-pigments:lib/color-scanner.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} ... | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
@regexp = new RegExp(@registry.getRegExp(), 'g... | JavaScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | b8918c7ec066777bd5243c753779e638b7238887 | 518 | https://github.com/abe33/atom-pigments/blob/b8918c7ec066777bd5243c753779e638b7238887/lib/color-scanner.coffee | 1 | 38 |
abe33/atom-pigments:lib/color-scanner.coffee:1:completion | completion | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
@regexp = new RegExp(@registry.getRegExp(), 'g... | if match = @regexp.exec(text)
[matchText] = match
{lastIndex} = @regexp
color = @parser.parse(matchText, scope)
if (index = matchText.indexOf(color.colorExpression)) > 0
lastIndex += -matchText.length + index + color.colorExpression.length
matchText = color.colorExpression
... | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | b8918c7ec066777bd5243c753779e638b7238887 | 518 | https://github.com/abe33/atom-pigments/blob/b8918c7ec066777bd5243c753779e638b7238887/lib/color-scanner.coffee | 1 | 38 |
abe33/atom-pigments:lib/color-scanner.coffee:1:raw_corpus | raw_corpus | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
@regexp = new RegExp(@registry.getRegExp(), 'g... | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 85cec032e06bb0e06b45873652cd0627c90189d7 | 518 | https://github.com/abe33/atom-pigments/blob/85cec032e06bb0e06b45873652cd0627c90189d7/lib/color-scanner.coffee | 1 | 35 | ||
abe33/atom-pigments:lib/color-scanner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegE... | var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} = {}) {
this.context = context;
this.parser = t... | CoffeeScript | JavaScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 85cec032e06bb0e06b45873652cd0627c90189d7 | 518 | https://github.com/abe33/atom-pigments/blob/85cec032e06bb0e06b45873652cd0627c90189d7/lib/color-scanner.coffee | 1 | 35 |
abe33/atom-pigments:lib/color-scanner.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor({context} ... | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
@regexp = new RegExp(@registry.getRegExp(), 'g... | JavaScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 85cec032e06bb0e06b45873652cd0627c90189d7 | 518 | https://github.com/abe33/atom-pigments/blob/85cec032e06bb0e06b45873652cd0627c90189d7/lib/color-scanner.coffee | 1 | 35 |
abe33/atom-pigments:lib/color-scanner.coffee:1:completion | completion | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: ({@context}={}) ->
@parser = @context.parser
@registry = @context.registry
getRegExp: ->
@regexp = new RegExp(@registry.getRegExp(), 'g... | if match = @regexp.exec(text)
[matchText] = match
{lastIndex} = @regexp
color = @parser.parse(matchText)
if (index = matchText.indexOf(color.colorExpression)) > 0
lastIndex += -matchText.length + index + color.colorExpression.length
matchText = color.colorExpression
colo... | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 85cec032e06bb0e06b45873652cd0627c90189d7 | 518 | https://github.com/abe33/atom-pigments/blob/85cec032e06bb0e06b45873652cd0627c90189d7/lib/color-scanner.coffee | 1 | 35 |
abe33/atom-pigments:lib/color-scanner.coffee:1:raw_corpus | raw_corpus | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: (params={}) ->
{@parser, @context} = params
@parser ?= new ColorParser
getRegExp: ->
registry = getRegistry(@context)
@regexp = ne... | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-scanner.coffee | 1 | 37 | ||
abe33/atom-pigments:lib/color-scanner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: (params={}) ->
{@parser, @context} = params
@parser ?= new ColorParser
getRegExp: ... | var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor(params = {}) {
({parser: this.parser, context: this.context} ... | CoffeeScript | JavaScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-scanner.coffee | 1 | 37 |
abe33/atom-pigments:lib/color-scanner.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ColorParser, ColorScanner, countLines, getRegistry;
({countLines} = require('./utils'));
({getRegistry} = require('./color-expressions'));
ColorParser = require('./color-parser');
module.exports = ColorScanner = class ColorScanner {
constructor(params = {... | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: (params={}) ->
{@parser, @context} = params
@parser ?= new ColorParser
getRegExp: ->
registry = getRegistry(@context)
@regexp = ne... | JavaScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-scanner.coffee | 1 | 37 |
abe33/atom-pigments:lib/color-scanner.coffee:1:completion | completion | {countLines} = require './utils'
{getRegistry} = require './color-expressions'
ColorParser = require './color-parser'
module.exports =
class ColorScanner
constructor: (params={}) ->
{@parser, @context} = params
@parser ?= new ColorParser
getRegExp: ->
registry = getRegistry(@context)
@regexp = ne... | if match = @regexp.exec(text)
[matchText] = match
{lastIndex} = @regexp
color = @parser.parse(matchText, @context)
if (index = matchText.indexOf(color.colorExpression)) > 0
lastIndex += -matchText.length + index + color.colorExpression.length
matchText = color.colorExpression
... | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/color-scanner.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-scanner.coffee | 1 | 37 |
jianliaoim/talk-os:talk-web/packing/asset-links.coffee:1:raw_corpus | raw_corpus | config = require 'config'
if config.env is 'dev'
assetLinks =
main: "http://talk.bi:#{config.webpackDevPort}/main.js"
vendor: "http://talk.bi:#{config.webpackDevPort}/vendor.js"
style: null
else
assets = require '../packing/assets'
cdnPrefix = "#{config.cdn}/talk-web/"
if config.useCDN
prefix ... | CoffeeScript | jianliaoim/talk-os | talk-web/packing/asset-links.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/packing/asset-links.coffee | 1 | 21 | ||
jianliaoim/talk-os:talk-web/packing/asset-links.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
config = require 'config'
if config.env is 'dev'
assetLinks =
main: "http://talk.bi:#{config.webpackDevPort}/main.js"
vendor: "http://talk.bi:#{config.webpackDevPort}/vendor.js"
style: null
else
assets = require '../packing/assets'
cdnPrefix = ... | var assetLinks, assets, cdnPrefix, config, prefix;
config = require('config');
if (config.env === 'dev') {
assetLinks = {
main: `http://talk.bi:${config.webpackDevPort}/main.js`,
vendor: `http://talk.bi:${config.webpackDevPort}/vendor.js`,
style: null
};
} else {
assets = require('../packing/assets'... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/packing/asset-links.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/packing/asset-links.coffee | 1 | 21 |
jianliaoim/talk-os:talk-web/packing/asset-links.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assetLinks, assets, cdnPrefix, config, prefix;
config = require('config');
if (config.env === 'dev') {
assetLinks = {
main: `http://talk.bi:${config.webpackDevPort}/main.js`,
vendor: `http://talk.bi:${config.webpackDevPort}/vendor.js`,
style: nu... | config = require 'config'
if config.env is 'dev'
assetLinks =
main: "http://talk.bi:#{config.webpackDevPort}/main.js"
vendor: "http://talk.bi:#{config.webpackDevPort}/vendor.js"
style: null
else
assets = require '../packing/assets'
cdnPrefix = "#{config.cdn}/talk-web/"
if config.useCDN
prefix ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/packing/asset-links.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/packing/asset-links.coffee | 1 | 21 |
jianliaoim/talk-os:talk-web/packing/asset-links.coffee:1:completion | completion | config = require 'config'
if config.env is 'dev'
assetLinks =
main: "http://talk.bi:#{config.webpackDevPort}/main.js"
vendor: "http://talk.bi:#{config.webpackDevPort}/vendor.js"
style: null
else
assets = require '../packing/assets'
cdnPrefix = "#{config.cdn}/talk-web/" | if config.useCDN
prefix = cdnPrefix
else
prefix = '/'
assetLinks =
main: "#{prefix}#{assets.main[0]}"
style: "#{prefix}#{assets.main[1]}"
vendor: "#{prefix}#{assets.vendor}"
module.exports = assetLinks | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/packing/asset-links.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/packing/asset-links.coffee | 1 | 21 |
jianliaoim/talk-os:talk-web/client/app/snippet-attachment.coffee:1:raw_corpus | raw_corpus | xss = require 'xss'
React = require 'react'
CodeViewer = React.createFactory require '../module/code-viewer'
div = React.createFactory 'div'
T = React.PropTypes
module.exports = React.createClass
displayName: 'snippet-attachment'
propTypes:
getCodeType: T.func
onClick: T.func
attachment: T.obj... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/snippet-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/snippet-attachment.coffee | 1 | 44 | ||
jianliaoim/talk-os:talk-web/client/app/snippet-attachment.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
xss = require 'xss'
React = require 'react'
CodeViewer = React.createFactory require '../module/code-viewer'
div = React.createFactory 'div'
T = React.PropTypes
module.exports = React.createClass
displayName: 'snippet-attachment'
propTypes:
getCodeTy... | var CodeViewer, React, T, div, xss;
xss = require('xss');
React = require('react');
CodeViewer = React.createFactory(require('../module/code-viewer'));
div = React.createFactory('div');
T = React.PropTypes;
module.exports = React.createClass({
displayName: 'snippet-attachment',
propTypes: {
getCodeType: T... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/snippet-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/snippet-attachment.coffee | 1 | 44 |
jianliaoim/talk-os:talk-web/client/app/snippet-attachment.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var CodeViewer, React, T, div, xss;
xss = require('xss');
React = require('react');
CodeViewer = React.createFactory(require('../module/code-viewer'));
div = React.createFactory('div');
T = React.PropTypes;
module.exports = React.createClass({
displayName: ... | xss = require 'xss'
React = require 'react'
CodeViewer = React.createFactory require '../module/code-viewer'
div = React.createFactory 'div'
T = React.PropTypes
module.exports = React.createClass
displayName: 'snippet-attachment'
propTypes:
getCodeType: T.func
onClick: T.func
attachment: T.obj... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/snippet-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/snippet-attachment.coffee | 1 | 44 |
jianliaoim/talk-os:talk-web/client/app/snippet-attachment.coffee:1:completion | completion | xss = require 'xss'
React = require 'react'
CodeViewer = React.createFactory require '../module/code-viewer'
div = React.createFactory 'div'
T = React.PropTypes
module.exports = React.createClass
displayName: 'snippet-attachment'
propTypes:
getCodeType: T.func
onClick: T.func
attachment: T.obj... | return null if not @props.attachment.data.title?.length
div className: 'title', @props.attachment.data.title
renderContent: ->
if @props.getCodeType?
codeType = @props.getCodeType @props.attachment.data.codeType
else if @props.attachment.data.codeType?.length
codeType = @props.attachment.data... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/snippet-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/snippet-attachment.coffee | 1 | 44 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:raw_corpus | raw_corpus | { assign } = require './Utility'
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of ... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{ assign } = require './Utility'
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline`... | var XMLWriterBase, assign,
hasProp = {}.hasOwnProperty;
({assign} = require('./Utility'));
// Base class for XML writers
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentation string
... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var XMLWriterBase, assign,
hasProp = {}.hasOwnProperty;
({assign} = require('./Utility'));
// Base class for XML writers
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prin... | { assign } = require './Utility'
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of ... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:completion | completion | { assign } = require './Utility'
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of ... | # `options` writer options
filterOptions: (options) ->
options or= {}
options = assign {}, @options, options
filteredOptions = {}
filteredOptions.pretty = options.pretty or false
filteredOptions.allowEmpty = options.allowEmpty or false
if filteredOptions.pretty
filteredOptions.indent = ... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | return filteredOptions
# Returns the indentation string for the current level
#
# `node` current node
# `options` writer options
# `level` current indentation level
space: (node, options, level) ->
if options.pretty
indentLevel = (level or 0) + options.offset + 1
if indentLevel > 0
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 51 | 73 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
return filteredOptions
# Returns the indentation string for the current level
#
# `node` current node
# `options` writer options
# `level` current indentation level
space: (node, options, level) ->
if options.pretty
indentLevel = (level or ... | return filteredOptions({
// Returns the indentation string for the current level
// `node` current node
// `options` writer options
// `level` current indentation level
space: function(node, options, level) {
var indentLevel;
if (options.pretty) {
indentLevel = (level || 0) + options.offset + 1... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 51 | 73 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
return filteredOptions({
// Returns the indentation string for the current level
// `node` current node
// `options` writer options
// `level` current indentation level
space: function(node, options, level) {
var indentLevel;
if (options.pretty) ... | return filteredOptions
# Returns the indentation string for the current level
#
# `node` current node
# `options` writer options
# `level` current indentation level
space: (node, options, level) ->
if options.pretty
indentLevel = (level or 0) + options.offset + 1
if indentLevel > 0
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 51 | 73 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:completion | completion | return filteredOptions
# Returns the indentation string for the current level
#
# `node` current node
# `options` writer options
# `level` current indentation level
space: (node, options, level) ->
if options.pretty
indentLevel = (level or 0) + options.offset + 1
if indentLevel > 0 | return new Array(indentLevel).join(options.indent)
return ''
# Returns the newline string
#
# `node` current node
# `options` writer options
# `level` current indentation level
endline: (node, options, level) ->
options.newline | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLWriterBase.coffee | 51 | 73 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:raw_corpus | raw_corpus | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 63d51436618d67eee703abc4c720a732d13036ee | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/63d51436618d67eee703abc4c720a732d13036ee/src/XMLWriterBase.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.off... | // Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentation string
// `options.newline` newline sequence
//... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 63d51436618d67eee703abc4c720a732d13036ee | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/63d51436618d67eee703abc4c720a732d13036ee/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentat... | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 63d51436618d67eee703abc4c720a732d13036ee | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/63d51436618d67eee703abc4c720a732d13036ee/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:completion | completion | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | @offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = options.spacebeforeslash ? ''
if @spacebeforeslash is true then @spacebeforeslash = ' '
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own ke... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 63d51436618d67eee703abc4c720a732d13036ee | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/63d51436618d67eee703abc4c720a732d13036ee/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | @indent = ''
@newline = ''
@offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = if "spacebeforeslash" of options then options.spacebeforeslash else ''
if @spacebeforeslash is true then @spacebeforeslash = ' '
# create local copies of these two for later
@newlinedefault = @newline... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 63d51436618d67eee703abc4c720a732d13036ee | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/63d51436618d67eee703abc4c720a732d13036ee/src/XMLWriterBase.coffee | 51 | 78 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:completion | completion | @indent = ''
@newline = ''
@offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = if "spacebeforeslash" of options then options.spacebeforeslash else ''
if @spacebeforeslash is true then @spacebeforeslash = ' '
# create local copies of these two for later
@newlinedefault = @newline... | @[key] = value
return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 63d51436618d67eee703abc4c720a732d13036ee | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/63d51436618d67eee703abc4c720a732d13036ee/src/XMLWriterBase.coffee | 51 | 78 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:raw_corpus | raw_corpus | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 66c7de90d77216db2667a707bd615be5a55f441d | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/66c7de90d77216db2667a707bd615be5a55f441d/src/XMLWriterBase.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.off... | // Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentation string
// `options.newline` newline sequence
//... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 66c7de90d77216db2667a707bd615be5a55f441d | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/66c7de90d77216db2667a707bd615be5a55f441d/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentat... | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 66c7de90d77216db2667a707bd615be5a55f441d | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/66c7de90d77216db2667a707bd615be5a55f441d/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:completion | completion | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | @offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = options.spacebeforeslash ? ''
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key, value of options.writer or {}
@[key] = value
# Mod... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 66c7de90d77216db2667a707bd615be5a55f441d | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/66c7de90d77216db2667a707bd615be5a55f441d/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | @newline = ''
@offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = if "spacebeforeslash" of options then options.spacebeforeslash else ''
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 66c7de90d77216db2667a707bd615be5a55f441d | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/66c7de90d77216db2667a707bd615be5a55f441d/src/XMLWriterBase.coffee | 51 | 76 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:completion | completion | @newline = ''
@offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = if "spacebeforeslash" of options then options.spacebeforeslash else ''
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key... | return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 66c7de90d77216db2667a707bd615be5a55f441d | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/66c7de90d77216db2667a707bd615be5a55f441d/src/XMLWriterBase.coffee | 51 | 76 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:raw_corpus | raw_corpus | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | d50956674dbbf940149f9a8386b2fbe8780daab4 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d50956674dbbf940149f9a8386b2fbe8780daab4/src/XMLWriterBase.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.off... | // Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentation string
// `options.newline` newline sequence
//... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | d50956674dbbf940149f9a8386b2fbe8780daab4 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d50956674dbbf940149f9a8386b2fbe8780daab4/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentat... | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | d50956674dbbf940149f9a8386b2fbe8780daab4 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d50956674dbbf940149f9a8386b2fbe8780daab4/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:completion | completion | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | @newline = ''
@offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = ''
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key, value of options.writer or {}
@[key] = value
# Modifies ... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | d50956674dbbf940149f9a8386b2fbe8780daab4 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d50956674dbbf940149f9a8386b2fbe8780daab4/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | @indent = ''
@newline = ''
@offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = ''
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key, value of options.writer or {}
@[key] = v... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | d50956674dbbf940149f9a8386b2fbe8780daab4 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d50956674dbbf940149f9a8386b2fbe8780daab4/src/XMLWriterBase.coffee | 51 | 76 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:completion | completion | @indent = ''
@newline = ''
@offset = 0
@dontprettytextnodes = 0
@spacebeforeslash = ''
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key, value of options.writer or {}
@[key] = v... | return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | d50956674dbbf940149f9a8386b2fbe8780daab4 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d50956674dbbf940149f9a8386b2fbe8780daab4/src/XMLWriterBase.coffee | 51 | 76 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:raw_corpus | raw_corpus | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 391b6387f18a0f311d0166b09578eae1a8aa6c28 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/391b6387f18a0f311d0166b09578eae1a8aa6c28/src/XMLWriterBase.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.off... | // Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentation string
// `options.newline` newline sequence
//... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 391b6387f18a0f311d0166b09578eae1a8aa6c28 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/391b6387f18a0f311d0166b09578eae1a8aa6c28/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentat... | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 391b6387f18a0f311d0166b09578eae1a8aa6c28 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/391b6387f18a0f311d0166b09578eae1a8aa6c28/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:completion | completion | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | @dontprettytextnodes = 0
# create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key, value of options.writer or {}
@[key] = value
# Modifies writer options
set: (options) ->
options or= {}
@pretty =... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 391b6387f18a0f311d0166b09578eae1a8aa6c28 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/391b6387f18a0f311d0166b09578eae1a8aa6c28/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | # create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key, value of options.writer or {}
@[key] = value
return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 391b6387f18a0f311d0166b09578eae1a8aa6c28 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/391b6387f18a0f311d0166b09578eae1a8aa6c28/src/XMLWriterBase.coffee | 51 | 71 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:completion | completion | # create local copies of these two for later
@newlinedefault = @newline
@prettydefault = @pretty
# overwrite default properties
for own key, value of options.writer or {}
@[key] = value
return @ | # returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 391b6387f18a0f311d0166b09578eae1a8aa6c28 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/391b6387f18a0f311d0166b09578eae1a8aa6c28/src/XMLWriterBase.coffee | 51 | 71 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:raw_corpus | raw_corpus | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.off... | // Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentation string
// `options.newline` newline sequence
//... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentat... | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:completion | completion | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | @dontprettytextnodes = 0
# overwrite default properties
for own key, value of options.writer or {}
@[key] = value
# Modifies writer options
set: (options) ->
options or= {}
@pretty = options.pretty if "pretty" of options
@allowEmpty = options.allowEmpty if "allowEmpty" of options
if... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 51 | 62 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
''
``` | return this({
// returns the indentation string for the current level
space: function(level) {
var indent;
if (this.pretty) {
indent = (level || 0) + this.offset + 1;
if (indent > 0) {
return new Array(indent).join(this.indent);
} else {
return '';
}
} else {
... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 51 | 62 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
return this({
// returns the indentation string for the current level
space: function(level) {
var indent;
if (this.pretty) {
indent = (level || 0) + this.offset + 1;
if (indent > 0) {
return new Array(indent).join(this.indent);
... | return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 51 | 62 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:completion | completion | return @
# returns the indentation string for the current level
space: (level) ->
if @pretty
indent = (level or 0) + @offset + 1 | if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 3f86e199720d1085a849f28246d615fd3252cf1c | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/3f86e199720d1085a849f28246d615fd3252cf1c/src/XMLWriterBase.coffee | 51 | 62 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:raw_corpus | raw_corpus | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 2bc90b6009d64d68bf19cffb6a34d8a00963ecbf | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/2bc90b6009d64d68bf19cffb6a34d8a00963ecbf/src/XMLWriterBase.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.off... | // Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentation string
// `options.newline` newline sequence
//... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 2bc90b6009d64d68bf19cffb6a34d8a00963ecbf | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/2bc90b6009d64d68bf19cffb6a34d8a00963ecbf/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Base class for XML writers
var XMLWriterBase,
hasProp = {}.hasOwnProperty;
module.exports = XMLWriterBase = class XMLWriterBase {
// Initializes a new instance of `XMLWriterBase`
// `options.pretty` pretty prints the result
// `options.indent` indentat... | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 2bc90b6009d64d68bf19cffb6a34d8a00963ecbf | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/2bc90b6009d64d68bf19cffb6a34d8a00963ecbf/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:1:completion | completion | # Base class for XML writers
module.exports = class XMLWriterBase
# Initializes a new instance of `XMLWriterBase`
#
# `options.pretty` pretty prints the result
# `options.indent` indentation string
# `options.newline` newline sequence
# `options.offset` a fixed number of indentations to add to every line
... | for own key, value of options.writer or {}
@[key] = value
# Modifies writer options
set: (options) ->
options or= {}
@pretty = options.pretty if "pretty" of options
@allowEmpty = options.allowEmpty if "allowEmpty" of options
if @pretty
@indent = if "indent" of options then options.inde... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 2bc90b6009d64d68bf19cffb6a34d8a00963ecbf | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/2bc90b6009d64d68bf19cffb6a34d8a00963ecbf/src/XMLWriterBase.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 2bc90b6009d64d68bf19cffb6a34d8a00963ecbf | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/2bc90b6009d64d68bf19cffb6a34d8a00963ecbf/src/XMLWriterBase.coffee | 51 | 58 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
''
``` | var indent;
if (this.pretty) {
indent = (level || 0) + this.offset + 1;
if (indent > 0) {
new Array(indent).join(this.indent);
} else {
'';
}
} else {
'';
} | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 2bc90b6009d64d68bf19cffb6a34d8a00963ecbf | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/2bc90b6009d64d68bf19cffb6a34d8a00963ecbf/src/XMLWriterBase.coffee | 51 | 58 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var indent;
if (this.pretty) {
indent = (level || 0) + this.offset + 1;
if (indent > 0) {
new Array(indent).join(this.indent);
} else {
'';
}
} else {
'';
}
``` | if @pretty
indent = (level or 0) + @offset + 1
if indent > 0
new Array(indent).join(@indent)
else
''
else
'' | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | 2bc90b6009d64d68bf19cffb6a34d8a00963ecbf | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/2bc90b6009d64d68bf19cffb6a34d8a00963ecbf/src/XMLWriterBase.coffee | 51 | 58 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:raw_corpus | raw_corpus | if @pretty
new Array((level or 0) + @offset + 1).join(@indent)
else
'' | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | ab0c6d3649828decfdd0c4b0e16021a3f300cc47 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ab0c6d3649828decfdd0c4b0e16021a3f300cc47/src/XMLWriterBase.coffee | 51 | 54 | ||
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @pretty
new Array((level or 0) + @offset + 1).join(@indent)
else
''
``` | if (this.pretty) {
new Array((level || 0) + this.offset + 1).join(this.indent);
} else {
'';
} | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | ab0c6d3649828decfdd0c4b0e16021a3f300cc47 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ab0c6d3649828decfdd0c4b0e16021a3f300cc47/src/XMLWriterBase.coffee | 51 | 54 |
oozcitak/xmlbuilder-js:src/XMLWriterBase.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (this.pretty) {
new Array((level || 0) + this.offset + 1).join(this.indent);
} else {
'';
}
``` | if @pretty
new Array((level or 0) + @offset + 1).join(@indent)
else
'' | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLWriterBase.coffee | MIT | ab0c6d3649828decfdd0c4b0e16021a3f300cc47 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ab0c6d3649828decfdd0c4b0e16021a3f300cc47/src/XMLWriterBase.coffee | 51 | 54 |
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:1:raw_corpus | raw_corpus | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
keyboard = require '../util/keyboard'
emojiUtil = require '../util/emoji'
div = React.createFactory 'div'
span = React.createFactory 'span'
T = React.PropTypes
cx = require 'classnames'
module.exports = React.createClass
displayNa... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
keyboard = require '../util/keyboard'
emojiUtil = require '../util/emoji'
div = React.createFactory 'div'
span = React.createFactory 'span'
T = React.PropTypes
cx = require 'cl... | var PureRenderMixin, React, T, cx, div, emojiUtil, keyboard, span;
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
keyboard = require('../util/keyboard');
emojiUtil = require('../util/emoji');
div = React.createFactory('div');
span = React.createFactory('span');
T = React.P... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PureRenderMixin, React, T, cx, div, emojiUtil, keyboard, span;
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
keyboard = require('../util/keyboard');
emojiUtil = require('../util/emoji');
div = React.createFactory('d... | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
keyboard = require '../util/keyboard'
emojiUtil = require '../util/emoji'
div = React.createFactory 'div'
span = React.createFactory 'span'
T = React.PropTypes
cx = require 'classnames'
module.exports = React.createClass
displayNa... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:1:completion | completion | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
keyboard = require '../util/keyboard'
emojiUtil = require '../util/emoji'
div = React.createFactory 'div'
span = React.createFactory 'span'
T = React.PropTypes
cx = require 'classnames'
module.exports = React.createClass
displayNa... | @setState index: 0
componentDidMount: ->
window.addEventListener 'keydown', @onWindowKeydown
componentWillUnmount: ->
window.removeEventListener 'keydown', @onWindowKeydown
# methods
moveSelectUp: ->
if @props.suggests.length < 2 then return
if @state.index is 0
then @setState index: @pr... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:2:raw_corpus | raw_corpus | # event handlers
onItemClick: (emoji) ->
@props.onSelect emoji
onWindowKeydown: (event) ->
switch event.keyCode
when keyboard.up then @moveSelectUp()
when keyboard.down then @moveSelectDown()
when keyboard.enter then @selectCurrent()
when keyboard.tab then @selectCurrent()
rende... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 51 | 75 | ||
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# event handlers
onItemClick: (emoji) ->
@props.onSelect emoji
onWindowKeydown: (event) ->
switch event.keyCode
when keyboard.up then @moveSelectUp()
when keyboard.down then @moveSelectDown()
when keyboard.enter then @selectCurrent... | // event handlers
({
onItemClick: function(emoji) {
return this.props.onSelect(emoji);
},
onWindowKeydown: function(event) {
switch (event.keyCode) {
case keyboard.up:
return this.moveSelectUp();
case keyboard.down:
return this.moveSelectDown();
case keyboard.enter:
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 51 | 75 |
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// event handlers
({
onItemClick: function(emoji) {
return this.props.onSelect(emoji);
},
onWindowKeydown: function(event) {
switch (event.keyCode) {
case keyboard.up:
return this.moveSelectUp();
case keyboard.down:
return ... | # event handlers
onItemClick: (emoji) ->
@props.onSelect emoji
onWindowKeydown: (event) ->
switch event.keyCode
when keyboard.up then @moveSelectUp()
when keyboard.down then @moveSelectDown()
when keyboard.enter then @selectCurrent()
when keyboard.tab then @selectCurrent()
rende... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 51 | 75 |
jianliaoim/talk-os:talk-web/client/app/emoji-menu.coffee:2:completion | completion | # event handlers
onItemClick: (emoji) ->
@props.onSelect emoji
onWindowKeydown: (event) ->
switch event.keyCode
when keyboard.up then @moveSelectUp()
when keyboard.down then @moveSelectDown()
when keyboard.enter then @selectCurrent()
when keyboard.tab then @selectCurrent() | render: ->
div className: 'emoji-menu menu thin-scroll',
@props.suggests.map (emoji, index) =>
onClick = =>
@onItemClick emoji
className = cx 'item line',
'is-active': @state.index is index
div className: className, onClick: onClick, key: emoji,
span dan... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/emoji-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/emoji-menu.coffee | 51 | 75 |
jeremyfa/yaml.js:src/Pattern.coffee:1:raw_corpus | raw_corpus | class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: null
# @property [Object] The dictionary mapping n... | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 4 | 53 | ||
jeremyfa/yaml.js:src/Pattern.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: ... | var Pattern;
Pattern = (function() {
class Pattern {
// Constructor
// @param [String] rawRegex The raw regex string defining the pattern
constructor(rawRegex, modifiers = '') {
var _char, capturingBracketNumber, cleanedRegex, i, len, mapping, name, part, subChar;
cleanedRegex = '';
l... | CoffeeScript | JavaScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 4 | 53 |
jeremyfa/yaml.js:src/Pattern.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Pattern;
Pattern = (function() {
class Pattern {
// Constructor
// @param [String] rawRegex The raw regex string defining the pattern
constructor(rawRegex, modifiers = '') {
var _char, capturingBracketNumber, cleanedRegex, i, len, mapping... | class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: null
# @property [Object] The dictionary mapping n... | JavaScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 4 | 53 |
jeremyfa/yaml.js:src/Pattern.coffee:1:completion | completion | class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: null
# @property [Object] The dictionary mapping n... | i = 0
while i < len
_char = rawRegex.charAt(i)
if _char is '\\'
# Ignore next character
cleanedRegex += rawRegex[i..i+1]
i++
else if _char is '('
# Increase bracket number, only if it is capturing
... | CoffeeScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 4 | 53 |
jeremyfa/yaml.js:src/Pattern.coffee:2:raw_corpus | raw_corpus | if name.length > 0
# Associate a name with a capturing bracket number
mapping ?= {}
mapping[name] = capturingBracketNumber
break
else
... | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 54 | 103 | ||
jeremyfa/yaml.js:src/Pattern.coffee:2:completion | completion | if name.length > 0
# Associate a name with a capturing bracket number
mapping ?= {}
mapping[name] = capturingBracketNumber
break
else
... | # Executes the pattern's regex and returns the matching values
#
# @param [String] str The string to use to execute the pattern
#
# @return [Array] The matching values extracted from capturing brackets or null if nothing matched
#
exec: (str) ->
@regex.lastIndex = 0
matches = @re... | CoffeeScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 54 | 103 |
jeremyfa/yaml.js:src/Pattern.coffee:3:raw_corpus | raw_corpus | #
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occurenc... | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 104 | 139 | ||
jeremyfa/yaml.js:src/Pattern.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replace... | ({
test: function(str) {
this.regex.lastIndex = 0;
return this.regex.test(str);
},
// Replaces occurences matching with the pattern's regex with replacement
// @param [String] str The source string to perform replacements
// @param [String] replacement The string to use in place of each replaced occu... | CoffeeScript | JavaScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 104 | 139 |
jeremyfa/yaml.js:src/Pattern.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
test: function(str) {
this.regex.lastIndex = 0;
return this.regex.test(str);
},
// Replaces occurences matching with the pattern's regex with replacement
// @param [String] str The source string to perform replacements
// @param [String] repla... | #
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occurenc... | JavaScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 104 | 139 |
jeremyfa/yaml.js:src/Pattern.coffee:3:completion | completion | #
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occurenc... | # Replaces occurences matching with the pattern's regex with replacement and
# get both the replaced string and the number of replaced occurences in the string.
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occ... | CoffeeScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | efe8ce18704ae43383e4177aa7de1a2619bd4e67 | 887 | https://github.com/jeremyfa/yaml.js/blob/efe8ce18704ae43383e4177aa7de1a2619bd4e67/src/Pattern.coffee | 104 | 139 |
jeremyfa/yaml.js:src/Pattern.coffee:3:raw_corpus | raw_corpus | #
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occurenc... | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | 7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7 | 887 | https://github.com/jeremyfa/yaml.js/blob/7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7/src/Pattern.coffee | 104 | 139 | ||
jeremyfa/yaml.js:src/Pattern.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replace... | ({
test: function(str) {
this.regex.lastIndex = 0;
return this.regex.test(str);
},
// Replaces occurences matching with the pattern's regex with replacement
// @param [String] str The source string to perform replacements
// @param [String] replacement The string to use in place of each replaced occu... | CoffeeScript | JavaScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | 7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7 | 887 | https://github.com/jeremyfa/yaml.js/blob/7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7/src/Pattern.coffee | 104 | 139 |
jeremyfa/yaml.js:src/Pattern.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
test: function(str) {
this.regex.lastIndex = 0;
return this.regex.test(str);
},
// Replaces occurences matching with the pattern's regex with replacement
// @param [String] str The source string to perform replacements
// @param [String] repla... | #
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occurenc... | JavaScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | 7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7 | 887 | https://github.com/jeremyfa/yaml.js/blob/7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7/src/Pattern.coffee | 104 | 139 |
jeremyfa/yaml.js:src/Pattern.coffee:3:completion | completion | #
test: (str) ->
@regex.lastIndex = 0
return @regex.test str
# Replaces occurences matching with the pattern's regex with replacement
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occurenc... | # Replaces occurences matching with the pattern's regex with replacement and
# get both the replaced string and the number of replaced occurences in the string.
#
# @param [String] str The source string to perform replacements
# @param [String] replacement The string to use in place of each replaced occ... | CoffeeScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | 7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7 | 887 | https://github.com/jeremyfa/yaml.js/blob/7b12c5a5c5bf8fbf89a73e67f5b08e75904435d7/src/Pattern.coffee | 104 | 139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.