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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jeremyramin/terminal-plus:spec/terminal-plus-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
TerminalPlus = require '../lib/terminal-plus'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
... | var TerminalPlus;
TerminalPlus = require('../lib/terminal-plus');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the `f` to unfocus the block.
describe("TerminalPlus", function()... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | spec/terminal-plus-spec.coffee | MIT | e9dfeb4ceb8aad183da5d3f64394f275ab17cdee | 478 | https://github.com/jeremyramin/terminal-plus/blob/e9dfeb4ceb8aad183da5d3f64394f275ab17cdee/spec/terminal-plus-spec.coffee | 1 | 50 |
jeremyramin/terminal-plus:spec/terminal-plus-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TerminalPlus;
TerminalPlus = require('../lib/terminal-plus');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the `f` to... | TerminalPlus = require '../lib/terminal-plus'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "TerminalPlus", ->
[workspaceElement, activati... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | spec/terminal-plus-spec.coffee | MIT | e9dfeb4ceb8aad183da5d3f64394f275ab17cdee | 478 | https://github.com/jeremyramin/terminal-plus/blob/e9dfeb4ceb8aad183da5d3f64394f275ab17cdee/spec/terminal-plus-spec.coffee | 1 | 50 |
jeremyramin/terminal-plus:spec/terminal-plus-spec.coffee:1:completion | completion | TerminalPlus = require '../lib/terminal-plus'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "TerminalPlus", ->
[workspaceElement, activati... | activationPromise
runs ->
expect(workspaceElement.querySelector('.terminal-plus')).toExist()
terminalPlusElement = workspaceElement.querySelector('.terminal-plus')
expect(terminalPlusElement).toExist()
terminalPlusPanel = atom.workspace.panelForItem(terminalPlusElement)
... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | spec/terminal-plus-spec.coffee | MIT | e9dfeb4ceb8aad183da5d3f64394f275ab17cdee | 478 | https://github.com/jeremyramin/terminal-plus/blob/e9dfeb4ceb8aad183da5d3f64394f275ab17cdee/spec/terminal-plus-spec.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | restrict: 'A'
link: (scope, element, attrs) ->
scope.$watch attrs.htmlRepeater, (htmlStrings) ->
template = ''
_.each htmlStrings, (html) ->
template += html
compiledValue = $compile(template)(scope)
# Replace t... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | restrict: 'A'
link: (scope, element, attrs) ->
scope.$watch attrs.htmlRepeater, (htmlStrings) ->
template = ''
_.each htmlStrings, (html) ->
template += html
compiledValue = $compile(template)(scope)
# Replace t... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/html/directives.htmlRepeater.coffee | 1 | 36 |
octoblu/meshblu:test/lib/SocketIOThrottle-spec.coffee:1:raw_corpus | raw_corpus | SocketIOThrottle = require '../../lib/SocketIOThrottle'
describe 'SocketIOThrottle', ->
describe '->throttle', ->
it 'should probably be tested', -> | CoffeeScript | octoblu/meshblu | test/lib/SocketIOThrottle-spec.coffee | MIT | edf1db3062b6872de5f1b418aced623e9dafa587 | 815 | https://github.com/octoblu/meshblu/blob/edf1db3062b6872de5f1b418aced623e9dafa587/test/lib/SocketIOThrottle-spec.coffee | 1 | 5 | ||
octoblu/meshblu:test/lib/SocketIOThrottle-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
SocketIOThrottle = require '../../lib/SocketIOThrottle'
describe 'SocketIOThrottle', ->
describe '->throttle', ->
it 'should probably be tested', ->
``` | var SocketIOThrottle;
SocketIOThrottle = require('../../lib/SocketIOThrottle');
describe('SocketIOThrottle', function() {
return describe('->throttle', function() {
return it('should probably be tested', function() {});
});
}); | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/SocketIOThrottle-spec.coffee | MIT | edf1db3062b6872de5f1b418aced623e9dafa587 | 815 | https://github.com/octoblu/meshblu/blob/edf1db3062b6872de5f1b418aced623e9dafa587/test/lib/SocketIOThrottle-spec.coffee | 1 | 5 |
octoblu/meshblu:test/lib/SocketIOThrottle-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var SocketIOThrottle;
SocketIOThrottle = require('../../lib/SocketIOThrottle');
describe('SocketIOThrottle', function() {
return describe('->throttle', function() {
return it('should probably be tested', function() {});
});
});
``` | SocketIOThrottle = require '../../lib/SocketIOThrottle'
describe 'SocketIOThrottle', ->
describe '->throttle', ->
it 'should probably be tested', -> | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/SocketIOThrottle-spec.coffee | MIT | edf1db3062b6872de5f1b418aced623e9dafa587 | 815 | https://github.com/octoblu/meshblu/blob/edf1db3062b6872de5f1b418aced623e9dafa587/test/lib/SocketIOThrottle-spec.coffee | 1 | 5 |
octoblu/meshblu:test/lib/SocketIOThrottle-spec.coffee:1:completion | completion | SocketIOThrottle = require '../../lib/SocketIOThrottle' | describe 'SocketIOThrottle', ->
describe '->throttle', ->
it 'should probably be tested', -> | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/SocketIOThrottle-spec.coffee | MIT | edf1db3062b6872de5f1b418aced623e9dafa587 | 815 | https://github.com/octoblu/meshblu/blob/edf1db3062b6872de5f1b418aced623e9dafa587/test/lib/SocketIOThrottle-spec.coffee | 1 | 5 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:raw_corpus | raw_corpus | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
constructor: (file, header, @layer) ->
# We copy the layer's width and height to private variables because, as you'll see below,
# the dimensions can change if w... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/channel_image.coffee | 11 | 60 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:completion | completion | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
constructor: (file, header, @layer) ->
# We copy the layer's width and height to private variables because, as you'll see below,
# the dimensions can change if w... | # The height of the image.
height: -> @_height
# The number of color channels in the image.
channels: -> @layer.channels
# Parse the image data. The resulting image data will be formatted to match the Javascript
# Canvas color format, e.g. `[R, G, B, A, R, G, B, A]`.
parse: ->
@chanPos = 0
for cha... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/channel_image.coffee | 11 | 60 |
meltingice/psd.js:lib/psd/channel_image.coffee:2:raw_corpus | raw_corpus | @length = @_width * @_height
start = @file.tell()
@parseImageData()
finish = @file.tell()
if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height
@processImageData()
# Initiates parsing of the image data, wh... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/channel_image.coffee | 61 | 87 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:2:completion | completion | @length = @_width * @_height
start = @file.tell()
@parseImageData()
finish = @file.tell()
if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height | @processImageData()
# Initiates parsing of the image data, which is based on the compression type of the channel. Every
# channel defines it's own compression type, unlike the full PSD preview, which has a single compression
# type for the entire image.
parseImageData: ->
@compression = @parseCompression()... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/channel_image.coffee | 61 | 87 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:raw_corpus | raw_corpus | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
constructor: (file, header, @layer) ->
# We copy the layer's width and height to private variables because, as you'll see below,
# the dimensions can change if w... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | b4031b340ad829a2275e7739f944139746b1df7f | 2,846 | https://github.com/meltingice/psd.js/blob/b4031b340ad829a2275e7739f944139746b1df7f/lib/psd/channel_image.coffee | 11 | 60 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:completion | completion | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
constructor: (file, header, @layer) ->
# We copy the layer's width and height to private variables because, as you'll see below,
# the dimensions can change if w... | # The height of the image.
height: -> @_height
# The number of color channels in the image.
channels: -> @layer.channels
# Parse the image data. The resulting image data will be formatted to match the Javascript
# Canvas color format, e.g. `[R, G, B, A, R, G, B, A]`.
parse: ->
@chanPos = 0
for cha... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | b4031b340ad829a2275e7739f944139746b1df7f | 2,846 | https://github.com/meltingice/psd.js/blob/b4031b340ad829a2275e7739f944139746b1df7f/lib/psd/channel_image.coffee | 11 | 60 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:raw_corpus | raw_corpus | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
constructor: (file, header, @layer) ->
# We copy the layer's width and height to private variables because, as you'll see below,
# the dimensions can change if w... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | e6f041259756b67021bcaf1136655263fe6c3c8a | 2,846 | https://github.com/meltingice/psd.js/blob/e6f041259756b67021bcaf1136655263fe6c3c8a/lib/psd/channel_image.coffee | 11 | 60 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:completion | completion | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
constructor: (file, header, @layer) ->
# We copy the layer's width and height to private variables because, as you'll see below,
# the dimensions can change if w... | # The height of the image.
height: -> @_height
# The number of color channels in the image.
channels: -> @layer.channels
# Parse the image data. The resulting image data will be formatted to match the Javascript
# Canvas color format, e.g. `[R, G, B, A, R, G, B, A]`.
parse: ->
@chanPos = 0
for cha... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | e6f041259756b67021bcaf1136655263fe6c3c8a | 2,846 | https://github.com/meltingice/psd.js/blob/e6f041259756b67021bcaf1136655263fe6c3c8a/lib/psd/channel_image.coffee | 11 | 60 |
meltingice/psd.js:lib/psd/channel_image.coffee:2:raw_corpus | raw_corpus | @_height = @layer.height
@length = @_width * @_height
start = @file.tell()
@parseImageData()
finish = @file.tell()
if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height
@processImageData()
# Initiat... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | e6f041259756b67021bcaf1136655263fe6c3c8a | 2,846 | https://github.com/meltingice/psd.js/blob/e6f041259756b67021bcaf1136655263fe6c3c8a/lib/psd/channel_image.coffee | 61 | 88 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:2:completion | completion | @_height = @layer.height
@length = @_width * @_height
start = @file.tell()
@parseImageData()
finish = @file.tell()
if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height | @processImageData()
# Initiates parsing of the image data, which is based on the compression type of the channel. Every
# channel defines it's own compression type, unlike the full PSD preview, which has a single compression
# type for the entire image.
parseImageData: ->
@compression = @parseCompression()... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | e6f041259756b67021bcaf1136655263fe6c3c8a | 2,846 | https://github.com/meltingice/psd.js/blob/e6f041259756b67021bcaf1136655263fe6c3c8a/lib/psd/channel_image.coffee | 61 | 88 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:raw_corpus | raw_corpus | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
#
# @param [File] The PSD File reference.
# @param [Header] The PSD header.
# @param [Layer] The PSD layer for this image.
constructor: (file, header, @layer) ->... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 1c60f45829aedf679e551095a85fddacd486b888 | 2,846 | https://github.com/meltingice/psd.js/blob/1c60f45829aedf679e551095a85fddacd486b888/lib/psd/channel_image.coffee | 11 | 60 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:completion | completion | module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
# Creates a new ChannelImage.
#
# @param [File] The PSD File reference.
# @param [Header] The PSD header.
# @param [Layer] The PSD layer for this image.
constructor: (file, header, @layer) ->... | # The width of the image.
width: -> @_width
# The height of the image.
height: -> @_height
# The number of color channels in the image.
channels: -> @layer.channels
# Parse the image data. The resulting image data will be formatted to match the Javascript
# Canvas color format, e.g. `[R, G, B, A, R, G,... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 1c60f45829aedf679e551095a85fddacd486b888 | 2,846 | https://github.com/meltingice/psd.js/blob/1c60f45829aedf679e551095a85fddacd486b888/lib/psd/channel_image.coffee | 11 | 60 |
meltingice/psd.js:lib/psd/channel_image.coffee:2:raw_corpus | raw_corpus | @_height = @layer.height
@length = @_width * @_height
start = @file.tell()
@parseImageData()
finish = @file.tell()
if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height
@processImageData()
# @privat... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 1c60f45829aedf679e551095a85fddacd486b888 | 2,846 | https://github.com/meltingice/psd.js/blob/1c60f45829aedf679e551095a85fddacd486b888/lib/psd/channel_image.coffee | 61 | 86 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:2:completion | completion | @_height = @layer.height
@length = @_width * @_height
start = @file.tell()
@parseImageData()
finish = @file.tell()
if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width | @_height = @layer.height
@processImageData()
# @private
parseImageData: ->
@compression = @parseCompression()
switch @compression
when 0 then @parseRaw()
when 1 then @parseRLE()
when 2, 3 then @parseZip()
else @file.seek(@endPos) | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 1c60f45829aedf679e551095a85fddacd486b888 | 2,846 | https://github.com/meltingice/psd.js/blob/1c60f45829aedf679e551095a85fddacd486b888/lib/psd/channel_image.coffee | 61 | 86 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
Image = require './image.coffee'
ImageFormat = require './image_format.coffee'
module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
constructor: (file, header, @layer) ->
@_width = @layer.width
@_height = @la... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 67a3772c0953bc9a20b07f10343debc5495e3713 | 2,846 | https://github.com/meltingice/psd.js/blob/67a3772c0953bc9a20b07f10343debc5495e3713/lib/psd/channel_image.coffee | 1 | 50 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:completion | completion | _ = require 'lodash'
Image = require './image.coffee'
ImageFormat = require './image_format.coffee'
module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
constructor: (file, header, @layer) ->
@_width = @layer.width
@_height = @la... | height: -> @_height
channels: -> @layer.channels
parse: ->
@chanPos = 0
for chan in @channelsInfo
if chan.length <= 0
@parseCompression()
continue
@chan = chan
if chan.id < -1
@_width = @layer.mask.width
@_height = @layer.mask.height
else
@_... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 67a3772c0953bc9a20b07f10343debc5495e3713 | 2,846 | https://github.com/meltingice/psd.js/blob/67a3772c0953bc9a20b07f10343debc5495e3713/lib/psd/channel_image.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/channel_image.coffee:2:raw_corpus | raw_corpus | if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height
@processImageData()
parseImageData: ->
@compression = @parseCompression()
switch @compression
when 0 then @parseRaw()
when 1 then @parseRLE()
when 2, 3... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 67a3772c0953bc9a20b07f10343debc5495e3713 | 2,846 | https://github.com/meltingice/psd.js/blob/67a3772c0953bc9a20b07f10343debc5495e3713/lib/psd/channel_image.coffee | 51 | 66 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height
@processImageData()
parseImageData: ->
@compression = @parseCompression()
switch @compression
when 0 then ... | if (finish !== start + this.chan.length) {
this.file.seek(start + this.chan.length);
}
this._width = this.layer.width;
this._height = this.layer.height;
this.processImageData();
({
parseImageData: function() {
this.compression = this.parseCompression();
switch (this.compression) {
case 0:
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 67a3772c0953bc9a20b07f10343debc5495e3713 | 2,846 | https://github.com/meltingice/psd.js/blob/67a3772c0953bc9a20b07f10343debc5495e3713/lib/psd/channel_image.coffee | 51 | 66 |
meltingice/psd.js:lib/psd/channel_image.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (finish !== start + this.chan.length) {
this.file.seek(start + this.chan.length);
}
this._width = this.layer.width;
this._height = this.layer.height;
this.processImageData();
({
parseImageData: function() {
this.compression = this.parseCompression();... | if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height
@processImageData()
parseImageData: ->
@compression = @parseCompression()
switch @compression
when 0 then @parseRaw()
when 1 then @parseRLE()
when 2, 3... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 67a3772c0953bc9a20b07f10343debc5495e3713 | 2,846 | https://github.com/meltingice/psd.js/blob/67a3772c0953bc9a20b07f10343debc5495e3713/lib/psd/channel_image.coffee | 51 | 66 |
meltingice/psd.js:lib/psd/channel_image.coffee:2:completion | completion | if finish isnt start + @chan.length
@file.seek(start + @chan.length)
@_width = @layer.width
@_height = @layer.height
@processImageData() | parseImageData: ->
@compression = @parseCompression()
switch @compression
when 0 then @parseRaw()
when 1 then @parseRLE()
when 2, 3 then @parseZip()
else @file.seek(@endPos) | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | 67a3772c0953bc9a20b07f10343debc5495e3713 | 2,846 | https://github.com/meltingice/psd.js/blob/67a3772c0953bc9a20b07f10343debc5495e3713/lib/psd/channel_image.coffee | 51 | 66 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
Image = require './image.coffee'
ImageFormat = require './image_format.coffee'
module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
constructor: (file, header, @layer) ->
super(file, header)
@channelsInfo = ... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | f92d255ce85a63a336aedf83424ffa13f756cbec | 2,846 | https://github.com/meltingice/psd.js/blob/f92d255ce85a63a336aedf83424ffa13f756cbec/lib/psd/channel_image.coffee | 1 | 50 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
Image = require './image.coffee'
ImageFormat = require './image_format.coffee'
module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
constructor: (file, header,... | var ChannelImage, Image, ImageFormat, _;
_ = require('lodash');
Image = require('./image.coffee');
ImageFormat = require('./image_format.coffee');
module.exports = ChannelImage = (function() {
class ChannelImage extends Image {
constructor(file, header, layer) {
super(file, header);
this.layer = l... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | f92d255ce85a63a336aedf83424ffa13f756cbec | 2,846 | https://github.com/meltingice/psd.js/blob/f92d255ce85a63a336aedf83424ffa13f756cbec/lib/psd/channel_image.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChannelImage, Image, ImageFormat, _;
_ = require('lodash');
Image = require('./image.coffee');
ImageFormat = require('./image_format.coffee');
module.exports = ChannelImage = (function() {
class ChannelImage extends Image {
constructor(file, header, l... | _ = require 'lodash'
Image = require './image.coffee'
ImageFormat = require './image_format.coffee'
module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
constructor: (file, header, @layer) ->
super(file, header)
@channelsInfo = ... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | f92d255ce85a63a336aedf83424ffa13f756cbec | 2,846 | https://github.com/meltingice/psd.js/blob/f92d255ce85a63a336aedf83424ffa13f756cbec/lib/psd/channel_image.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/channel_image.coffee:1:completion | completion | _ = require 'lodash'
Image = require './image.coffee'
ImageFormat = require './image_format.coffee'
module.exports = class ChannelImage extends Image
@includes ImageFormat.LayerRAW
@includes ImageFormat.LayerRLE
constructor: (file, header, @layer) ->
super(file, header)
@channelsInfo = ... | parse: ->
@chanPos = 0
for chan in @channelsInfo
if chan.length <= 0
@parseCompression()
continue
@chan = chan
if chan.id < -1
@width = @layer.mask.width
@height = @layer.mask.height
else
@width = @layer.width
@height = @layer.height
... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | f92d255ce85a63a336aedf83424ffa13f756cbec | 2,846 | https://github.com/meltingice/psd.js/blob/f92d255ce85a63a336aedf83424ffa13f756cbec/lib/psd/channel_image.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/channel_image.coffee:2:raw_corpus | raw_corpus | @width = @layer.width
@height = @layer.height
@processImageData() | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | f92d255ce85a63a336aedf83424ffa13f756cbec | 2,846 | https://github.com/meltingice/psd.js/blob/f92d255ce85a63a336aedf83424ffa13f756cbec/lib/psd/channel_image.coffee | 51 | 54 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
Image = require './image.coffee'
module.exports = class ChannelImage extends Image
constructor: (file, header, @layer) ->
@width = @layer.width
@height = @layer.height
super(file, header)
@channelsInfo = @layer.channelsInfo
@hasMask = _.any @channelsInfo, (c) -> c.id < -1
... | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | c895ffd782a64323324b3d744bb3bbbece05398f | 2,846 | https://github.com/meltingice/psd.js/blob/c895ffd782a64323324b3d744bb3bbbece05398f/lib/psd/channel_image.coffee | 1 | 50 | ||
meltingice/psd.js:lib/psd/channel_image.coffee:1:completion | completion | _ = require 'lodash'
Image = require './image.coffee'
module.exports = class ChannelImage extends Image
constructor: (file, header, @layer) ->
@width = @layer.width
@height = @layer.height
super(file, header)
@channelsInfo = @layer.channelsInfo
@hasMask = _.any @channelsInfo, (c) -> c.id < -1
... | if chan.length <= 0
@parseCompression()
continue
@chan = chan
if chan.id < -1
@width = @layer.mask.width
@height = @layer.mask.height
else
@width = @layer.width
@height = @layer.height
@length = @width * @height
start = @file.tell()
... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/channel_image.coffee | MIT | c895ffd782a64323324b3d744bb3bbbece05398f | 2,846 | https://github.com/meltingice/psd.js/blob/c895ffd782a64323324b3d744bb3bbbece05398f/lib/psd/channel_image.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:raw_corpus | raw_corpus | do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
Blackberry: /(BlackBerry|BB10|Playbook).*Version\/([\d.]+)/
FirefoxOS: /(Mozilla).*Mobile[^\/]... | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 544e96a228407a716427c3532813d9c7d9d78c7f | 2,055 | https://github.com/soyjavi/QuoJS/blob/544e96a228407a716427c3532813d9c7d9d78c7f/src/quo.environment.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.environment.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
Blackberry: /(BlackBerry|BB10|Playbook).*Vers... | (function($$) {
var IS_WEBKIT, SUPPORTED_OS, _current, _detectBrowser, _detectEnvironment, _detectOS, _detectScreen;
_current = null;
IS_WEBKIT = /WebKit\/([\d.]+)/;
SUPPORTED_OS = {
Android: /(Android)\s+([\d.]+)/,
ipad: /(iPad).*OS\s([\d_]+)/,
iphone: /(iPhone\sOS)\s([\d_]+)/,
Blackberry: /(Bl... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 544e96a228407a716427c3532813d9c7d9d78c7f | 2,055 | https://github.com/soyjavi/QuoJS/blob/544e96a228407a716427c3532813d9c7d9d78c7f/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
(function($$) {
var IS_WEBKIT, SUPPORTED_OS, _current, _detectBrowser, _detectEnvironment, _detectOS, _detectScreen;
_current = null;
IS_WEBKIT = /WebKit\/([\d.]+)/;
SUPPORTED_OS = {
Android: /(Android)\s+([\d.]+)/,
ipad: /(iPad).*OS\s([\d_]+)/,
... | do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
Blackberry: /(BlackBerry|BB10|Playbook).*Version\/([\d.]+)/
FirefoxOS: /(Mozilla).*Mobile[^\/]... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 544e96a228407a716427c3532813d9c7d9d78c7f | 2,055 | https://github.com/soyjavi/QuoJS/blob/544e96a228407a716427c3532813d9c7d9d78c7f/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:completion | completion | do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
Blackberry: /(BlackBerry|BB10|Playbook).*Version\/([\d.]+)/
FirefoxOS: /(Mozilla).*Mobile[^\/]... | user_agent = navigator.userAgent
environment = {}
environment.browser = _detectBrowser(user_agent)
environment.os = _detectOS(user_agent)
environment.isMobile = !!environment.os
environment.screen = _detectScreen()
environment
_detectBrowser = (user_agent) ->
... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 544e96a228407a716427c3532813d9c7d9d78c7f | 2,055 | https://github.com/soyjavi/QuoJS/blob/544e96a228407a716427c3532813d9c7d9d78c7f/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:raw_corpus | raw_corpus | do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(BlackBerry).*Version\/([\d.]+)/
blackberryPlaybook: /(PlayBook).*Version\/([\d.]... | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.environment.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.environment.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(BlackBerry).*Version\/([\d.]+)/... | (function($$) {
var IS_WEBKIT, SUPPORTED_OS, _current, _detectBrowser, _detectEnvironment, _detectOS, _detectScreen;
_current = null;
IS_WEBKIT = /WebKit\/([\d.]+)/;
SUPPORTED_OS = {
Android: /(Android)\s+([\d.]+)/,
ipad: /(iPad).*OS\s([\d_]+)/,
iphone: /(iPhone\sOS)\s([\d_]+)/,
blackberry: /(Bl... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
(function($$) {
var IS_WEBKIT, SUPPORTED_OS, _current, _detectBrowser, _detectEnvironment, _detectOS, _detectScreen;
_current = null;
IS_WEBKIT = /WebKit\/([\d.]+)/;
SUPPORTED_OS = {
Android: /(Android)\s+([\d.]+)/,
ipad: /(iPad).*OS\s([\d_]+)/,
... | do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(BlackBerry).*Version\/([\d.]+)/
blackberryPlaybook: /(PlayBook).*Version\/([\d.]... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:completion | completion | do ($$ = Quo) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(BlackBerry).*Version\/([\d.]+)/
blackberryPlaybook: /(PlayBook).*Version\/([\d.]... | _detectEnvironment = ->
user_agent = navigator.userAgent
environment = {}
environment.browser = _detectBrowser(user_agent)
environment.os = _detectOS(user_agent)
environment.isMobile = !!environment.os
environment.screen = _detectScreen()
environment
_detectB... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:raw_corpus | raw_corpus | ###
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(Black... | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.environment.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.environment.coffee:1:completion | completion | ###
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(Black... | $$.isOnline = ->
navigator.onLine
_detectEnvironment = ->
user_agent = navigator.userAgent
environment = {}
environment.browser = _detectBrowser(user_agent)
environment.os = _detectOS(user_agent)
environment.isMobile = !!environment.os
environment.screen = _d... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:2:raw_corpus | raw_corpus | break
detected_os
_detectScreen = ->
width: window.innerWidth
height: window.innerHeight
return
) Quo | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.environment.coffee | 51 | 60 | ||
soyjavi/QuoJS:src/quo.environment.coffee:2:completion | completion | break
detected_os
_detectScreen = ->
width: window.innerWidth | height: window.innerHeight
return
) Quo | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.environment.coffee | 51 | 60 |
soyjavi/QuoJS:src/quo.environment.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /... | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 7d3da91800fc9a9a7eab38ef998768d778ec2ede | 2,055 | https://github.com/soyjavi/QuoJS/blob/7d3da91800fc9a9a7eab38ef998768d778ec2ede/src/quo.environment.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.environment.coffee:1:completion | completion | ###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /... | $$.isOnline = ->
navigator.onLine
_detectEnvironment = ->
user_agent = navigator.userAgent
environment = {}
environment.browser = _detectBrowser(user_agent)
environment.os = _detectOS(user_agent)
environment.isMobile = !!environment.os
environment.screen = _d... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 7d3da91800fc9a9a7eab38ef998768d778ec2ede | 2,055 | https://github.com/soyjavi/QuoJS/blob/7d3da91800fc9a9a7eab38ef998768d778ec2ede/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /... | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.environment.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.environment.coffee:1:completion | completion | ###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /... | $$.isOnline = ->
navigator.onLine
_detectEnvironment = ->
user_agent = navigator.userAgent
environment = {}
environment.browser = _detectBrowser(user_agent)
environment.os = _detectOS(user_agent)
environment.isMobile = !!environment.os
environment.screen = _d... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:2:raw_corpus | raw_corpus | detected_os
_detectScreen = ->
width: window.innerWidth
height: window.innerHeight
return
) Quo | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.environment.coffee | 51 | 59 | ||
soyjavi/QuoJS:src/quo.environment.coffee:2:completion | completion | detected_os
_detectScreen = ->
width: window.innerWidth | height: window.innerHeight
return
) Quo | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.environment.coffee | 51 | 59 |
soyjavi/QuoJS:src/quo.environment.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(B... | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | e3eeda403f011e9dddfa389f3e894c138eb9cec4 | 2,055 | https://github.com/soyjavi/QuoJS/blob/e3eeda403f011e9dddfa389f3e894c138eb9cec4/src/quo.environment.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.environment.coffee:1:completion | completion | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(B... | $$.isOnline = ->
navigator.onLine
_detectEnvironment = ->
user_agent = navigator.userAgent
environment = {}
environment.browser = _detectBrowser(user_agent)
environment.os = _detectOS(user_agent)
environment.isMobile = !!environment.os
environment.screen = _d... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | e3eeda403f011e9dddfa389f3e894c138eb9cec4 | 2,055 | https://github.com/soyjavi/QuoJS/blob/e3eeda403f011e9dddfa389f3e894c138eb9cec4/src/quo.environment.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.environment.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(B... | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 27a6117dbd521ad5d555abf20e120556c6000301 | 2,055 | https://github.com/soyjavi/QuoJS/blob/27a6117dbd521ad5d555abf20e120556c6000301/src/quo.environment.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.environment.coffee:1:completion | completion | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
_current = null
IS_WEBKIT = /WebKit\/([\d.]+)/
SUPPORTED_OS =
Android: /(Android)\s+([\d.]+)/
ipad: /(iPad).*OS\s([\d_]+)/
iphone: /(iPhone\sOS)\s([\d_]+)/
blackberry: /(B... | $$.isOnline = ->
navigator.onLine
_detectEnvironment = ->
user_agent = navigator.userAgent
environment = {}
environment.browser = _detectBrowser(user_agent)
environment.os = _detectOS(user_agent)
environment.isMobile = (if (environment.os) then true else false)
... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.environment.coffee | MIT | 27a6117dbd521ad5d555abf20e120556c6000301 | 2,055 | https://github.com/soyjavi/QuoJS/blob/27a6117dbd521ad5d555abf20e120556c6000301/src/quo.environment.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/perltidy.coffee:1:raw_corpus | raw_corpus | ###
Requires [perltidy](http://perltidy.sourceforge.net)
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class PerlTidy extends Beautifier
name: "Perltidy"
link: "http://perltidy.sourceforge.net/"
isPreInstalled: false
options: {
Perl: true
}
cli: (options) ->
if not option... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/perltidy.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/perltidy.coffee | 1 | 32 | ||
Glavin001/atom-beautify:src/beautifiers/perltidy.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires [perltidy](http://perltidy.sourceforge.net)
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class PerlTidy extends Beautifier
name: "Perltidy"
link: "http://perltidy.sourceforge.net/"
isPreInstalled: false
options: {
... | /*
Requires [perltidy](http://perltidy.sourceforge.net)
*/
"use strict";
var Beautifier, PerlTidy;
Beautifier = require('./beautifier');
module.exports = PerlTidy = (function() {
class PerlTidy extends Beautifier {
cli(options) {
if (options.perltidy_path == null) {
return new Error("'Perl Perltid... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/perltidy.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/perltidy.coffee | 1 | 32 |
Glavin001/atom-beautify:src/beautifiers/perltidy.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires [perltidy](http://perltidy.sourceforge.net)
*/
"use strict";
var Beautifier, PerlTidy;
Beautifier = require('./beautifier');
module.exports = PerlTidy = (function() {
class PerlTidy extends Beautifier {
cli(options) {
if (options.perltidy_... | ###
Requires [perltidy](http://perltidy.sourceforge.net)
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class PerlTidy extends Beautifier
name: "Perltidy"
link: "http://perltidy.sourceforge.net/"
isPreInstalled: false
options: {
Perl: true
}
cli: (options) ->
if not option... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/perltidy.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/perltidy.coffee | 1 | 32 |
Glavin001/atom-beautify:src/beautifiers/perltidy.coffee:1:completion | completion | ###
Requires [perltidy](http://perltidy.sourceforge.net)
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class PerlTidy extends Beautifier
name: "Perltidy"
link: "http://perltidy.sourceforge.net/"
isPreInstalled: false
options: {
Perl: true
}
cli: (options) -> | if not options.perltidy_path?
return new Error("'Perl Perltidy Path' not set!" +
" Please set this in the Atom Beautify package settings.")
else
return options.perltidy_path
beautify: (text, language, options) ->
@run("perltidy", [
'--standard-output'
'--standard-error-output'... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/perltidy.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/perltidy.coffee | 1 | 32 |
jsdf/coffee-react-transform:src/serialiser.coffee:1:raw_corpus | raw_corpus | module.exports = serialise = (parseTree) ->
env = {serialiseNode}
if parseTree.children and
parseTree.children.length and
parseTree.children[0].type is $.CJSX_PRAGMA
env.domObject = parseTree.children[0].value
else
env.domObject = 'React.DOM'
env.serialiseNode(parseTree) | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 11 | 20 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = serialise = (parseTree) ->
env = {serialiseNode}
if parseTree.children and
parseTree.children.length and
parseTree.children[0].type is $.CJSX_PRAGMA
env.domObject = parseTree.children[0].value
else
env.domObject = 'React.DOM'
... | var serialise;
module.exports = serialise = function(parseTree) {
var env;
env = {serialiseNode};
if (parseTree.children && parseTree.children.length && parseTree.children[0].type === $.CJSX_PRAGMA) {
env.domObject = parseTree.children[0].value;
} else {
env.domObject = 'React.DOM';
}
return env.se... | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 11 | 20 |
jsdf/coffee-react-transform:src/serialiser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var serialise;
module.exports = serialise = function(parseTree) {
var env;
env = {serialiseNode};
if (parseTree.children && parseTree.children.length && parseTree.children[0].type === $.CJSX_PRAGMA) {
env.domObject = parseTree.children[0].value;
} else... | module.exports = serialise = (parseTree) ->
env = {serialiseNode}
if parseTree.children and
parseTree.children.length and
parseTree.children[0].type is $.CJSX_PRAGMA
env.domObject = parseTree.children[0].value
else
env.domObject = 'React.DOM'
env.serialiseNode(parseTree) | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 11 | 20 |
jsdf/coffee-react-transform:src/serialiser.coffee:1:completion | completion | module.exports = serialise = (parseTree) ->
env = {serialiseNode}
if parseTree.children and
parseTree.children.length and
parseTree.children[0].type is $.CJSX_PRAGMA | env.domObject = parseTree.children[0].value
else
env.domObject = 'React.DOM'
env.serialiseNode(parseTree) | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 11 | 20 |
jsdf/coffee-react-transform:src/serialiser.coffee:2:raw_corpus | raw_corpus | serialiseNode = (node) ->
unless serialisers[node.type]?
throw new Error("unknown parseTree node type #{node.type}")
serialised = serialisers[node.type](node, this)
unless typeof serialised is 'string' or serialised is null
throw new Error("serialiser #{node.type} didn\'t return a string")
serialised | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 22 | 31 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
serialiseNode = (node) ->
unless serialisers[node.type]?
throw new Error("unknown parseTree node type #{node.type}")
serialised = serialisers[node.type](node, this)
unless typeof serialised is 'string' or serialised is null
throw new Error("serial... | var serialiseNode;
serialiseNode = function(node) {
var serialised;
if (serialisers[node.type] == null) {
throw new Error(`unknown parseTree node type ${node.type}`);
}
serialised = serialisers[node.type](node, this);
if (!(typeof serialised === 'string' || serialised === null)) {
throw new Error(`se... | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 22 | 31 |
jsdf/coffee-react-transform:src/serialiser.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var serialiseNode;
serialiseNode = function(node) {
var serialised;
if (serialisers[node.type] == null) {
throw new Error(`unknown parseTree node type ${node.type}`);
}
serialised = serialisers[node.type](node, this);
if (!(typeof serialised === 'str... | serialiseNode = (node) ->
unless serialisers[node.type]?
throw new Error("unknown parseTree node type #{node.type}")
serialised = serialisers[node.type](node, this)
unless typeof serialised is 'string' or serialised is null
throw new Error("serialiser #{node.type} didn\'t return a string")
serialised | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 22 | 31 |
jsdf/coffee-react-transform:src/serialiser.coffee:2:completion | completion | serialiseNode = (node) ->
unless serialisers[node.type]?
throw new Error("unknown parseTree node type #{node.type}")
serialised = serialisers[node.type](node, this) | unless typeof serialised is 'string' or serialised is null
throw new Error("serialiser #{node.type} didn\'t return a string")
serialised | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 22 | 31 |
jsdf/coffee-react-transform:src/serialiser.coffee:3:raw_corpus | raw_corpus | genericBranchSerialiser = (node, env) ->
node.children
.map((child) -> env.serialiseNode child)
.join('') | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 33 | 36 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
genericBranchSerialiser = (node, env) ->
node.children
.map((child) -> env.serialiseNode child)
.join('')
``` | var genericBranchSerialiser;
genericBranchSerialiser = function(node, env) {
return node.children.map(function(child) {
return env.serialiseNode(child);
}).join('');
}; | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 33 | 36 |
jsdf/coffee-react-transform:src/serialiser.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var genericBranchSerialiser;
genericBranchSerialiser = function(node, env) {
return node.children.map(function(child) {
return env.serialiseNode(child);
}).join('');
};
``` | genericBranchSerialiser = (node, env) ->
node.children
.map((child) -> env.serialiseNode child)
.join('') | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 33 | 36 |
jsdf/coffee-react-transform:src/serialiser.coffee:3:completion | completion | genericBranchSerialiser = (node, env) ->
node.children | .map((child) -> env.serialiseNode child)
.join('') | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 33 | 36 |
jsdf/coffee-react-transform:src/serialiser.coffee:5:raw_corpus | raw_corpus | serialiseAttributePairs = (children) ->
# whitespace (particularly newlines) must be maintained
# to ensure line number parity
# sort children into whitespace and semantic (non whitespace) groups
# this seems wrong :\
[whitespaceChildren, semanticChildren] = children.reduce((partitionedChildren, child) ->
... | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 40 | 89 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
serialiseAttributePairs = (children) ->
# whitespace (particularly newlines) must be maintained
# to ensure line number parity
# sort children into whitespace and semantic (non whitespace) groups
# this seems wrong :\
[whitespaceChildren, semanticChild... | var serialiseAttributePairs, serialisers;
serialiseAttributePairs = function(children) {
var child, childIndex, indexOfLastSemanticChild, isBeforeLastSemanticChild, semanticChildren, serialisedChild, serialisedChildren, whitespaceChildren;
// whitespace (particularly newlines) must be maintained
// to ensure lin... | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 40 | 89 |
jsdf/coffee-react-transform:src/serialiser.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var serialiseAttributePairs, serialisers;
serialiseAttributePairs = function(children) {
var child, childIndex, indexOfLastSemanticChild, isBeforeLastSemanticChild, semanticChildren, serialisedChild, serialisedChildren, whitespaceChildren;
// whitespace (parti... | serialiseAttributePairs = (children) ->
# whitespace (particularly newlines) must be maintained
# to ensure line number parity
# sort children into whitespace and semantic (non whitespace) groups
# this seems wrong :\
[whitespaceChildren, semanticChildren] = children.reduce((partitionedChildren, child) ->
... | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 40 | 89 |
jsdf/coffee-react-transform:src/serialiser.coffee:5:completion | completion | serialiseAttributePairs = (children) ->
# whitespace (particularly newlines) must be maintained
# to ensure line number parity
# sort children into whitespace and semantic (non whitespace) groups
# this seems wrong :\
[whitespaceChildren, semanticChildren] = children.reduce((partitionedChildren, child) ->
... | # escaping newlines within attr object helps avoid
# parse errors in tags which span multiple lines
serialisedChild.replace('\n',' \\\n')
else
# but escaped newline at end of attr object is not allowed
serialisedChild
else
null # whitespace wit... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 40 | 89 |
jsdf/coffee-react-transform:src/serialiser.coffee:6:raw_corpus | raw_corpus | for child in node.children
serialisedChild = env.serialiseNode child
if child? # filter empty text nodes
if WHITESPACE_ONLY.test serialisedChild
accumulatedWhitespace += serialisedChild
else
serialisedChildren.push(accumulatedWhitespace + serialisedChild)
accumu... | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 90 | 139 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
for child in node.children
serialisedChild = env.serialiseNode child
if child? # filter empty text nodes
if WHITESPACE_ONLY.test serialisedChild
accumulatedWhitespace += serialisedChild
else
serialisedChildren.push(... | var accumulatedWhitespace, child, i, len, prefix, ref, serialisedChild;
ref = node.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
serialisedChild = env.serialiseNode(child);
if (child != null) {
if (WHITESPACE_ONLY.test(serialisedChild)) {
accumulatedWhitespace += serialisedChi... | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 90 | 139 |
jsdf/coffee-react-transform:src/serialiser.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var accumulatedWhitespace, child, i, len, prefix, ref, serialisedChild;
ref = node.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
serialisedChild = env.serialiseNode(child);
if (child != null) {
if (WHITESPACE_ONLY.test(serialise... | for child in node.children
serialisedChild = env.serialiseNode child
if child? # filter empty text nodes
if WHITESPACE_ONLY.test serialisedChild
accumulatedWhitespace += serialisedChild
else
serialisedChildren.push(accumulatedWhitespace + serialisedChild)
accumu... | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 90 | 139 |
jsdf/coffee-react-transform:src/serialiser.coffee:6:completion | completion | for child in node.children
serialisedChild = env.serialiseNode child
if child? # filter empty text nodes
if WHITESPACE_ONLY.test serialisedChild
accumulatedWhitespace += serialisedChild
else
serialisedChildren.push(accumulatedWhitespace + serialisedChild)
accumu... | serialiseAttributePairs(node.children)
else
serialiseAttributePairs(node.children)
CJSX_ATTR_PAIR: (node, env) ->
node.children
.map((child) -> env.serialiseNode child)
.join(': ')
CJSX_ATTR_SPREAD: (node, env) ->
node.value
# leaf nodes
CS: genericLeafSerialiser
CS_COMMENT: g... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 90 | 139 |
jsdf/coffee-react-transform:src/serialiser.coffee:7:raw_corpus | raw_corpus | if containsNewlines(text)
if WHITESPACE_ONLY.test text
text
else
# this is not very efficient
leftSpace = text.match TEXT_LEADING_WHITESPACE
rightSpace = text.match TEXT_TRAILING_WHITESPACE
if leftSpace
leftTrim = text.indexOf('\n')
else
l... | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 140 | 174 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if containsNewlines(text)
if WHITESPACE_ONLY.test text
text
else
# this is not very efficient
leftSpace = text.match TEXT_LEADING_WHITESPACE
rightSpace = text.match TEXT_TRAILING_WHITESPACE
if leftSpace
... | var escapedText, leftSpace, leftTrim, rightSpace, rightTrim, trimmedText;
if (containsNewlines(text)) {
if (WHITESPACE_ONLY.test(text)) {
text;
} else {
// this is not very efficient
leftSpace = text.match(TEXT_LEADING_WHITESPACE);
rightSpace = text.match(TEXT_TRAILING_WHITESPACE);
if (leftSpac... | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 140 | 174 |
jsdf/coffee-react-transform:src/serialiser.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var escapedText, leftSpace, leftTrim, rightSpace, rightTrim, trimmedText;
if (containsNewlines(text)) {
if (WHITESPACE_ONLY.test(text)) {
text;
} else {
// this is not very efficient
leftSpace = text.match(TEXT_LEADING_WHITESPACE);
rightSpace =... | if containsNewlines(text)
if WHITESPACE_ONLY.test text
text
else
# this is not very efficient
leftSpace = text.match TEXT_LEADING_WHITESPACE
rightSpace = text.match TEXT_TRAILING_WHITESPACE
if leftSpace
leftTrim = text.indexOf('\n')
else
l... | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 140 | 174 |
jsdf/coffee-react-transform:src/serialiser.coffee:7:completion | completion | if containsNewlines(text)
if WHITESPACE_ONLY.test text
text
else
# this is not very efficient
leftSpace = text.match TEXT_LEADING_WHITESPACE
rightSpace = text.match TEXT_TRAILING_WHITESPACE
if leftSpace
leftTrim = text.indexOf('\n')
else
l... | trimmedText = text.substring(leftTrim, rightTrim)
# decode html entities to chars
# escape string special chars except newlines
# output to multiline string literal for line parity
escapedText = stringEscape(entityDecode(trimmedText), preserveNewlines: true)
'"""'+escapedText+'"... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 140 | 174 |
jsdf/coffee-react-transform:src/serialiser.coffee:8:raw_corpus | raw_corpus | containsNewlines = (text) -> text.indexOf('\n') > -1
SPACES_ONLY = /^\s+$/
WHITESPACE_ONLY = /^[\n\s]+$/
# leading and trailing whitespace which contains a newline
TEXT_LEADING_WHITESPACE = /^\s*?\n\s*/
TEXT_TRAILING_WHITESPACE = /\s*?\n\s*?$/ | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 176 | 184 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
containsNewlines = (text) -> text.indexOf('\n') > -1
SPACES_ONLY = /^\s+$/
WHITESPACE_ONLY = /^[\n\s]+$/
# leading and trailing whitespace which contains a newline
TEXT_LEADING_WHITESPACE = /^\s*?\n\s*/
TEXT_TRAILING_WHITESPACE = /\s*?\n\s*?$/
``` | var SPACES_ONLY, TEXT_LEADING_WHITESPACE, TEXT_TRAILING_WHITESPACE, WHITESPACE_ONLY, containsNewlines;
containsNewlines = function(text) {
return text.indexOf('\n') > -1;
};
SPACES_ONLY = /^\s+$/;
WHITESPACE_ONLY = /^[\n\s]+$/;
// leading and trailing whitespace which contains a newline
TEXT_LEADING_WHITESPACE = ... | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 176 | 184 |
jsdf/coffee-react-transform:src/serialiser.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var SPACES_ONLY, TEXT_LEADING_WHITESPACE, TEXT_TRAILING_WHITESPACE, WHITESPACE_ONLY, containsNewlines;
containsNewlines = function(text) {
return text.indexOf('\n') > -1;
};
SPACES_ONLY = /^\s+$/;
WHITESPACE_ONLY = /^[\n\s]+$/;
// leading and trailing whitesp... | containsNewlines = (text) -> text.indexOf('\n') > -1
SPACES_ONLY = /^\s+$/
WHITESPACE_ONLY = /^[\n\s]+$/
# leading and trailing whitespace which contains a newline
TEXT_LEADING_WHITESPACE = /^\s*?\n\s*/
TEXT_TRAILING_WHITESPACE = /\s*?\n\s*?$/ | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 176 | 184 |
jsdf/coffee-react-transform:src/serialiser.coffee:8:completion | completion | containsNewlines = (text) -> text.indexOf('\n') > -1
SPACES_ONLY = /^\s+$/ | WHITESPACE_ONLY = /^[\n\s]+$/
# leading and trailing whitespace which contains a newline
TEXT_LEADING_WHITESPACE = /^\s*?\n\s*/
TEXT_TRAILING_WHITESPACE = /\s*?\n\s*?$/ | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | 16100ba4a885d941ab47741683ff45c72dce475e | 431 | https://github.com/jsdf/coffee-react-transform/blob/16100ba4a885d941ab47741683ff45c72dce475e/src/serialiser.coffee | 176 | 184 |
jsdf/coffee-react-transform:src/serialiser.coffee:4:raw_corpus | raw_corpus | genericLeafSerialiser = (node, env) -> node.value
serialise.serialisers = serialisers =
ROOT: genericBranchSerialiser
CJSX_PRAGMA: -> null
CJSX_EL: (node, env) ->
serialisedChildren = []
accumulatedWhitespace = ''
for child in node.children
serialisedChild = env.serialiseNode child
if ... | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | ca3455aa6d41d22adb293c0d904f0e9048c4160e | 431 | https://github.com/jsdf/coffee-react-transform/blob/ca3455aa6d41d22adb293c0d904f0e9048c4160e/src/serialiser.coffee | 39 | 88 | ||
jsdf/coffee-react-transform:src/serialiser.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
genericLeafSerialiser = (node, env) -> node.value
serialise.serialisers = serialisers =
ROOT: genericBranchSerialiser
CJSX_PRAGMA: -> null
CJSX_EL: (node, env) ->
serialisedChildren = []
accumulatedWhitespace = ''
for child in node.children
... | var genericLeafSerialiser, serialisers;
genericLeafSerialiser = function(node, env) {
return node.value;
};
serialise.serialisers = serialisers = {
ROOT: genericBranchSerialiser,
CJSX_PRAGMA: function() {
return null;
},
CJSX_EL: function(node, env) {
var accumulatedWhitespace, child, i, len, prefix... | CoffeeScript | JavaScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | ca3455aa6d41d22adb293c0d904f0e9048c4160e | 431 | https://github.com/jsdf/coffee-react-transform/blob/ca3455aa6d41d22adb293c0d904f0e9048c4160e/src/serialiser.coffee | 39 | 88 |
jsdf/coffee-react-transform:src/serialiser.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var genericLeafSerialiser, serialisers;
genericLeafSerialiser = function(node, env) {
return node.value;
};
serialise.serialisers = serialisers = {
ROOT: genericBranchSerialiser,
CJSX_PRAGMA: function() {
return null;
},
CJSX_EL: function(node, env)... | genericLeafSerialiser = (node, env) -> node.value
serialise.serialisers = serialisers =
ROOT: genericBranchSerialiser
CJSX_PRAGMA: -> null
CJSX_EL: (node, env) ->
serialisedChildren = []
accumulatedWhitespace = ''
for child in node.children
serialisedChild = env.serialiseNode child
if ... | JavaScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | ca3455aa6d41d22adb293c0d904f0e9048c4160e | 431 | https://github.com/jsdf/coffee-react-transform/blob/ca3455aa6d41d22adb293c0d904f0e9048c4160e/src/serialiser.coffee | 39 | 88 |
jsdf/coffee-react-transform:src/serialiser.coffee:4:completion | completion | genericLeafSerialiser = (node, env) -> node.value
serialise.serialisers = serialisers =
ROOT: genericBranchSerialiser
CJSX_PRAGMA: -> null
CJSX_EL: (node, env) ->
serialisedChildren = []
accumulatedWhitespace = ''
for child in node.children
serialisedChild = env.serialiseNode child
if ... | prefix+node.value+'('+serialisedChildren.join(', ')+')'
CJSX_ESC: (node, env) ->
childrenSerialised = node.children
.map((child) -> env.serialiseNode child)
.join('')
'('+childrenSerialised+')'
CJSX_ATTRIBUTES: (node, env) ->
# whitespace (particularly newlines) must be maintained
# to... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | src/serialiser.coffee | MIT | ca3455aa6d41d22adb293c0d904f0e9048c4160e | 431 | https://github.com/jsdf/coffee-react-transform/blob/ca3455aa6d41d22adb293c0d904f0e9048c4160e/src/serialiser.coffee | 39 | 88 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.