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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
linemanjs/lineman:tasks/images.coffee:1:completion | completion | ###
Task: images
Description: copy images from 'app/img' & 'vendor/img' to 'generated' & 'dist'
Dependencies: grunt
Contributor: @searls
Configuration:
"root" - the path to which images will be copied under 'generated' and 'dist' (default: "img")
###
module.exports = (grunt) ->
_ = grunt.util._
copy = require("./.... | taskConfig = grunt.config.get("images")
targetConfig = grunt.config.get("images.#{target}")
destinationPath = "#{targetConfig.dest}/#{taskConfig.root}"
if grunt.config("images.#{target}.files")? or grunt.config("images.#{target}.src")?
grunt.warn """
The 'images' task implementation ... | CoffeeScript | CoffeeScript | linemanjs/lineman | tasks/images.coffee | MIT | 5d013b6f7bd0fbfeb9eb250c3da89021b84ab349 | 1,168 | https://github.com/linemanjs/lineman/blob/5d013b6f7bd0fbfeb9eb250c3da89021b84ab349/tasks/images.coffee | 1 | 34 |
linemanjs/lineman:tasks/images.coffee:1:raw_corpus | raw_corpus | ###
Task: images
Description: copy images from 'app/img' & 'vendor/img' to 'generated' & 'dist'
Dependencies: grunt
Contributor: @searls
Configuration:
"root" - the path to which images will be copied under 'generated' and 'dist' (default: "img")
###
module.exports = (grunt) ->
_ = grunt.util._
copy = require("./.... | CoffeeScript | linemanjs/lineman | tasks/images.coffee | MIT | 3428e18b30a667d4f4cdfd6462b7c59a43b16816 | 1,168 | https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/images.coffee | 1 | 26 | ||
linemanjs/lineman:tasks/images.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Task: images
Description: copy images from 'app/img' & 'vendor/img' to 'generated' & 'dist'
Dependencies: grunt
Contributor: @searls
Configuration:
"root" - the path to which images will be copied under 'generated' and 'dist' (default: "img")
###
module.expo... | /*
Task: images
Description: copy images from 'app/img' & 'vendor/img' to 'generated' & 'dist'
Dependencies: grunt
Contributor: @searls
Configuration:
"root" - the path to which images will be copied under 'generated' and 'dist' (default: "img")
*/
module.exports = function(grunt) {
var _, copy;
_ = grunt.util._;
... | CoffeeScript | JavaScript | linemanjs/lineman | tasks/images.coffee | MIT | 3428e18b30a667d4f4cdfd6462b7c59a43b16816 | 1,168 | https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/images.coffee | 1 | 26 |
linemanjs/lineman:tasks/images.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Task: images
Description: copy images from 'app/img' & 'vendor/img' to 'generated' & 'dist'
Dependencies: grunt
Contributor: @searls
Configuration:
"root" - the path to which images will be copied under 'generated' and 'dist' (default: "img")
*/
module.exports ... | ###
Task: images
Description: copy images from 'app/img' & 'vendor/img' to 'generated' & 'dist'
Dependencies: grunt
Contributor: @searls
Configuration:
"root" - the path to which images will be copied under 'generated' and 'dist' (default: "img")
###
module.exports = (grunt) ->
_ = grunt.util._
copy = require("./.... | JavaScript | CoffeeScript | linemanjs/lineman | tasks/images.coffee | MIT | 3428e18b30a667d4f4cdfd6462b7c59a43b16816 | 1,168 | https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/images.coffee | 1 | 26 |
linemanjs/lineman:tasks/images.coffee:1:completion | completion | ###
Task: images
Description: copy images from 'app/img' & 'vendor/img' to 'generated' & 'dist'
Dependencies: grunt
Contributor: @searls
Configuration:
"root" - the path to which images will be copied under 'generated' and 'dist' (default: "img")
###
module.exports = (grunt) ->
_ = grunt.util._
copy = require("./.... | grunt.registerTask "images", "copy images to dist/img", (target) ->
target = target || "dist"
@requiresConfig("images.files")
@requiresConfig("images.#{target}")
taskConfig = grunt.config.get("images")
targetConfig = grunt.config.get("images.#{target}")
destinationPath = "#{targetConfig.dest}/#{... | CoffeeScript | CoffeeScript | linemanjs/lineman | tasks/images.coffee | MIT | 3428e18b30a667d4f4cdfd6462b7c59a43b16816 | 1,168 | https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/images.coffee | 1 | 26 |
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:1:raw_corpus | raw_corpus | # 成员之间的权限管理模块
React = require 'react'
assign = require 'object-assign'
recorder = require 'actions-recorder'
Immutable = require 'immutable'
query = require '../query'
mixinSubscribe = require '../mixin/subscribe'
T = React.PropTypes
permission =
member: 0b110
admin: 0b100
owner: 0b000
accessLevel =
mem... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# 成员之间的权限管理模块
React = require 'react'
assign = require 'object-assign'
recorder = require 'actions-recorder'
Immutable = require 'immutable'
query = require '../query'
mixinSubscribe = require '../mixin/subscribe'
T = React.PropTypes
permission =
member: 0... | // 成员之间的权限管理模块
var Immutable, React, T, accessLevel, assign, create, hasPermission, mixinSubscribe, permission, query, recorder;
React = require('react');
assign = require('object-assign');
recorder = require('actions-recorder');
Immutable = require('immutable');
query = require('../query');
mixinSubscribe = requ... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// 成员之间的权限管理模块
var Immutable, React, T, accessLevel, assign, create, hasPermission, mixinSubscribe, permission, query, recorder;
React = require('react');
assign = require('object-assign');
recorder = require('actions-recorder');
Immutable = require('immutable'... | # 成员之间的权限管理模块
React = require 'react'
assign = require 'object-assign'
recorder = require 'actions-recorder'
Immutable = require 'immutable'
query = require '../query'
mixinSubscribe = require '../mixin/subscribe'
T = React.PropTypes
permission =
member: 0b110
admin: 0b100
owner: 0b000
accessLevel =
mem... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:1:completion | completion | # 成员之间的权限管理模块
React = require 'react'
assign = require 'object-assign'
recorder = require 'actions-recorder'
Immutable = require 'immutable'
query = require '../query'
mixinSubscribe = require '../mixin/subscribe'
T = React.PropTypes
permission =
member: 0b110
admin: 0b100
owner: 0b000
accessLevel =
mem... | allowedPermission = permission[targetRole]
if not accessLevel[userRole]?
throw Error "user role is unsupported: #{userRole}"
if not allowedPermission?
throw Error "target role is undefined: #{targetRole}"
(accessLevel[userRole] & allowedPermission) > 0
create = (ComponentClass) ->
React.createClass
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:2:raw_corpus | raw_corpus | getUser: ->
query.userFromContacts(recorder.getState(), @props._teamId)
getUserRole: ->
@state.user?.get('role') or 'member'
getTargetMemberPermission: ->
@props.contact.get('role') or 'member'
render: ->
userRole = @getUserRole()
isAllowed = hasPermission userRole, @getTarg... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 51 | 75 | ||
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
getUser: ->
query.userFromContacts(recorder.getState(), @props._teamId)
getUserRole: ->
@state.user?.get('role') or 'member'
getTargetMemberPermission: ->
@props.contact.get('role') or 'member'
render: ->
userRole = @getUser... | ({
getUser: function() {
return query.userFromContacts(recorder.getState(), this.props._teamId);
},
getUserRole: function() {
var ref;
return ((ref = this.state.user) != null ? ref.get('role') : void 0) || 'member';
},
getTargetMemberPermission: function() {
return this.props.contact.get('role... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 51 | 75 |
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
getUser: function() {
return query.userFromContacts(recorder.getState(), this.props._teamId);
},
getUserRole: function() {
var ref;
return ((ref = this.state.user) != null ? ref.get('role') : void 0) || 'member';
},
getTargetMemberPermissio... | getUser: ->
query.userFromContacts(recorder.getState(), @props._teamId)
getUserRole: ->
@state.user?.get('role') or 'member'
getTargetMemberPermission: ->
@props.contact.get('role') or 'member'
render: ->
userRole = @getUserRole()
isAllowed = hasPermission userRole, @getTarg... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 51 | 75 |
jianliaoim/talk-os:talk-web/client/module/permission-member.coffee:2:completion | completion | getUser: ->
query.userFromContacts(recorder.getState(), @props._teamId)
getUserRole: ->
@state.user?.get('role') or 'member'
getTargetMemberPermission: ->
@props.contact.get('role') or 'member'
render: ->
userRole = @getUserRole()
isAllowed = hasPermission userRole, @getTarg... | if isAllowed
props = assign {},
hasPermission: isAllowed
@props
React.createElement ComponentClass, props
else
null
module.exports =
create: create
hasPermission: hasPermission | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/permission-member.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/permission-member.coffee | 51 | 75 |
jianliaoim/talk-os:talk-api2x/test/servers/striker.coffee:1:raw_corpus | raw_corpus | express = require 'express'
_ = require 'lodash'
multer = require 'multer'
module.exports = app = express()
# for fetching image url content testing
fileData =
fileKey: '1107c714fa14c8b34aa01f82612a0141fc90'
fileName: 'thumbnail.png'
fileType: 'png'
fileSize: 1031231
fileCategory: 'image'
imageWidth: 192... | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/servers/striker.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/striker.coffee | 1 | 38 | ||
jianliaoim/talk-os:talk-api2x/test/servers/striker.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
express = require 'express'
_ = require 'lodash'
multer = require 'multer'
module.exports = app = express()
# for fetching image url content testing
fileData =
fileKey: '1107c714fa14c8b34aa01f82612a0141fc90'
fileName: 'thumbnail.png'
fileType: 'png'
fi... | var _, app, express, fileData, multer;
express = require('express');
_ = require('lodash');
multer = require('multer');
module.exports = app = express();
// for fetching image url content testing
fileData = {
fileKey: '1107c714fa14c8b34aa01f82612a0141fc90',
fileName: 'thumbnail.png',
fileType: 'png',
fileS... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/test/servers/striker.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/striker.coffee | 1 | 38 |
jianliaoim/talk-os:talk-api2x/test/servers/striker.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, app, express, fileData, multer;
express = require('express');
_ = require('lodash');
multer = require('multer');
module.exports = app = express();
// for fetching image url content testing
fileData = {
fileKey: '1107c714fa14c8b34aa01f82612a0141fc90',
... | express = require 'express'
_ = require 'lodash'
multer = require 'multer'
module.exports = app = express()
# for fetching image url content testing
fileData =
fileKey: '1107c714fa14c8b34aa01f82612a0141fc90'
fileName: 'thumbnail.png'
fileType: 'png'
fileSize: 1031231
fileCategory: 'image'
imageWidth: 192... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/servers/striker.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/striker.coffee | 1 | 38 |
jianliaoim/talk-os:talk-api2x/test/servers/striker.coffee:1:completion | completion | express = require 'express'
_ = require 'lodash'
multer = require 'multer'
module.exports = app = express()
# for fetching image url content testing
fileData =
fileKey: '1107c714fa14c8b34aa01f82612a0141fc90'
fileName: 'thumbnail.png'
fileType: 'png'
fileSize: 1031231
fileCategory: 'image'
imageWidth: 192... | options =
root: __dirname + '/public/image/'
headers:
'Content-Type': 'image/png'
res.sendFile 'thumbnail.png', options
app.post '/forremote', (req, res) ->
res.status(200).json fileData
app.post '/upload', (req, res) ->
if req.files?.file
res.status(200).json
fileKey: '1107c714fa14c8b3... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/servers/striker.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/striker.coffee | 1 | 38 |
jnordberg/wintersmith:src/core/environment.coffee:1:raw_corpus | raw_corpus | class Environment
### The Wintersmith environment. ###
constructor: (@config, @workDir, @logger) ->
# todo load default views templates and plugs
@views = {}
@generators = []
@templatePlugins = []
@contentPlugins = []
@contentsPath = @resolvePath @config.contents
@templatesPath = @reso... | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 14 | 63 | ||
jnordberg/wintersmith:src/core/environment.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Environment
### The Wintersmith environment. ###
constructor: (@config, @workDir, @logger) ->
# todo load default views templates and plugs
@views = {}
@generators = []
@templatePlugins = []
@contentPlugins = []
@contentsPath =... | var Environment;
Environment = class Environment {
/* The Wintersmith environment. */
constructor(config, workDir, logger) {
this.config = config;
this.workDir = workDir;
this.logger = logger;
// todo load default views templates and plugs
this.views = {};
this.generators = [];
this.tem... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 14 | 63 |
jnordberg/wintersmith:src/core/environment.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Environment;
Environment = class Environment {
/* The Wintersmith environment. */
constructor(config, workDir, logger) {
this.config = config;
this.workDir = workDir;
this.logger = logger;
// todo load default views templates and plugs
... | class Environment
### The Wintersmith environment. ###
constructor: (@config, @workDir, @logger) ->
# todo load default views templates and plugs
@views = {}
@generators = []
@templatePlugins = []
@contentPlugins = []
@contentsPath = @resolvePath @config.contents
@templatesPath = @reso... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 14 | 63 |
jnordberg/wintersmith:src/core/environment.coffee:1:completion | completion | class Environment
### The Wintersmith environment. ###
constructor: (@config, @workDir, @logger) ->
# todo load default views templates and plugs
@views = {}
@generators = []
@templatePlugins = []
@contentPlugins = []
@contentsPath = @resolvePath @config.contents
@templatesPath = @reso... | relativePath: (pathname) ->
### Resolve path relative to working directory. ###
path.relative @workDir, pathname
relativeContentsPath: (pathname) ->
### Resolve path relative to contents directory. ###
path.relative @contentsPath, pathname
registerContentPlugin: (group, pattern, plugin) ->
###... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 14 | 63 |
jnordberg/wintersmith:src/core/environment.coffee:2:raw_corpus | raw_corpus | pattern: pattern
class: plugin
registerGenerator: (generator) ->
### Add a generator to the environment. The generator function is called with the env and the
current content tree. It should return a object with nested ContentPlugin instances.
These will be merged into the final content tre... | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 64 | 113 | ||
jnordberg/wintersmith:src/core/environment.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
pattern: pattern
class: plugin
registerGenerator: (generator) ->
### Add a generator to the environment. The generator function is called with the env and the
current content tree. It should return a object with nested ContentPlugin instances... | ({
pattern: pattern({
class: plugin
}),
registerGenerator: function(generator) {
/* Add a generator to the environment. The generator function is called with the env and the
current content tree. It should return a object with nested ContentPlugin instances.
These will be merged into... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 64 | 113 |
jnordberg/wintersmith:src/core/environment.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
pattern: pattern({
class: plugin
}),
registerGenerator: function(generator) {
/* Add a generator to the environment. The generator function is called with the env and the
current content tree. It should return a object with nested Conten... | pattern: pattern
class: plugin
registerGenerator: (generator) ->
### Add a generator to the environment. The generator function is called with the env and the
current content tree. It should return a object with nested ContentPlugin instances.
These will be merged into the final content tre... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 64 | 113 |
jnordberg/wintersmith:src/core/environment.coffee:2:completion | completion | pattern: pattern
class: plugin
registerGenerator: (generator) ->
### Add a generator to the environment. The generator function is called with the env and the
current content tree. It should return a object with nested ContentPlugin instances.
These will be merged into the final content tre... | ### Resolve locals. ###
resolveModule = (moduleName) =>
if moduleName[0] is '.'
@resolvePath moduleName
else
moduleName
resolveLocals = (callback) =>
### Load locals json if neccessary. ###
if typeof @config.locals == 'string'
filename = @resolvePath @config.loc... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 64 | 113 |
jnordberg/wintersmith:src/core/environment.coffee:3:raw_corpus | raw_corpus | try
locals[moduleAlias] = require moduleName
callback()
catch error
callback error
, (error) -> callback error, locals
async.waterfall [
resolveLocals
addModules
], callback
load: (callback) ->
### Convenience method to load contents, templates and... | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 114 | 160 | ||
jnordberg/wintersmith:src/core/environment.coffee:3:completion | completion | try
locals[moduleAlias] = require moduleName
callback()
catch error
callback error
, (error) -> callback error, locals
async.waterfall [
resolveLocals
addModules
], callback
load: (callback) ->
### Convenience method to load contents, templates and... | build: (outputDir, callback) ->
### Build the content tree and render it to *outputDir*. ###
if arguments.length < 2
# *outputDir* is optional and if omitted config.output is used
callback = outputDir or ->
outputDir = @resolvePath @config.output
async.waterfall [
(callback) =>
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 114 | 160 |
jnordberg/wintersmith:src/core/environment.coffee:4:raw_corpus | raw_corpus | Environment.create = (config, workDir) ->
### Set up a new environment using the default logger, *config* can be
either a config object, a Config instance or a path to a config file. ###
if typeof config is 'string'
# working directory will be where the config file resides
workDir ?= path.dirname con... | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 162 | 177 | ||
jnordberg/wintersmith:src/core/environment.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Environment.create = (config, workDir) ->
### Set up a new environment using the default logger, *config* can be
either a config object, a Config instance or a path to a config file. ###
if typeof config is 'string'
# working directory will be wher... | Environment.create = function(config, workDir) {
/* Set up a new environment using the default logger, *config* can be
either a config object, a Config instance or a path to a config file. */
if (typeof config === 'string') {
// working directory will be where the config file resides
if (workDir == n... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 162 | 177 |
jnordberg/wintersmith:src/core/environment.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Environment.create = function(config, workDir) {
/* Set up a new environment using the default logger, *config* can be
either a config object, a Config instance or a path to a config file. */
if (typeof config === 'string') {
// working directory wil... | Environment.create = (config, workDir) ->
### Set up a new environment using the default logger, *config* can be
either a config object, a Config instance or a path to a config file. ###
if typeof config is 'string'
# working directory will be where the config file resides
workDir ?= path.dirname con... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 162 | 177 |
jnordberg/wintersmith:src/core/environment.coffee:4:completion | completion | Environment.create = (config, workDir) ->
### Set up a new environment using the default logger, *config* can be
either a config object, a Config instance or a path to a config file. ###
if typeof config is 'string'
# working directory will be where the config file resides
workDir ?= path.dirname con... | else
workDir ?= process.cwd()
if not config instanceof Config
config = new Config config
return new Environment config, workDir, logger
### Exports ### | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/core/environment.coffee | MIT | 1cad02556f9f384086b05d7d914be5dcacc13294 | 3,484 | https://github.com/jnordberg/wintersmith/blob/1cad02556f9f384086b05d7d914be5dcacc13294/src/core/environment.coffee | 162 | 177 |
CaryLandholt/AngularFun:tasks/coffeeLint.coffee:1:raw_corpus | raw_corpus | ###global module, require###
module.exports = (grunt) ->
coffeeLint = require 'coffeelint'
growl = require 'growl'
path = require 'path'
grunt.registerMultiTask 'coffeeLint', 'Lints CoffeeScript files', ->
src = @file.src
config = @data
files = grunt.file.expandFiles src
message = ''
files.forEach (fil... | CoffeeScript | CaryLandholt/AngularFun | tasks/coffeeLint.coffee | MIT | cd43dca080a58b235e08a141f44b186c98329fe7 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cd43dca080a58b235e08a141f44b186c98329fe7/tasks/coffeeLint.coffee | 1 | 31 | ||
CaryLandholt/AngularFun:tasks/coffeeLint.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global module, require###
module.exports = (grunt) ->
coffeeLint = require 'coffeelint'
growl = require 'growl'
path = require 'path'
grunt.registerMultiTask 'coffeeLint', 'Lints CoffeeScript files', ->
src = @file.src
config = @data
files = grunt.... | /*global module, require*/
module.exports = function(grunt) {
var coffeeLint, growl, path;
coffeeLint = require('coffeelint');
growl = require('growl');
path = require('path');
return grunt.registerMultiTask('coffeeLint', 'Lints CoffeeScript files', function() {
var config, files, message, src;
src = ... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | tasks/coffeeLint.coffee | MIT | cd43dca080a58b235e08a141f44b186c98329fe7 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cd43dca080a58b235e08a141f44b186c98329fe7/tasks/coffeeLint.coffee | 1 | 31 |
CaryLandholt/AngularFun:tasks/coffeeLint.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global module, require*/
module.exports = function(grunt) {
var coffeeLint, growl, path;
coffeeLint = require('coffeelint');
growl = require('growl');
path = require('path');
return grunt.registerMultiTask('coffeeLint', 'Lints CoffeeScript files', funct... | ###global module, require###
module.exports = (grunt) ->
coffeeLint = require 'coffeelint'
growl = require 'growl'
path = require 'path'
grunt.registerMultiTask 'coffeeLint', 'Lints CoffeeScript files', ->
src = @file.src
config = @data
files = grunt.file.expandFiles src
message = ''
files.forEach (fil... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | tasks/coffeeLint.coffee | MIT | cd43dca080a58b235e08a141f44b186c98329fe7 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cd43dca080a58b235e08a141f44b186c98329fe7/tasks/coffeeLint.coffee | 1 | 31 |
CaryLandholt/AngularFun:tasks/coffeeLint.coffee:1:completion | completion | ###global module, require###
module.exports = (grunt) ->
coffeeLint = require 'coffeelint'
growl = require 'growl'
path = require 'path'
grunt.registerMultiTask 'coffeeLint', 'Lints CoffeeScript files', ->
src = @file.src
config = @data
files = grunt.file.expandFiles src
message = ''
files.forEach (fil... | errors = coffeeLint.lint source, config
return if not errors.length
fullPath = path.resolve file
message += "#{fullPath}\n"
errors.forEach (error) ->
message += "##{error.lineNumber}: #{error.message}\n"
message += '\n'
return if not message.length
grunt.log.writeln message
growl message,... | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | tasks/coffeeLint.coffee | MIT | cd43dca080a58b235e08a141f44b186c98329fe7 | 672 | https://github.com/CaryLandholt/AngularFun/blob/cd43dca080a58b235e08a141f44b186c98329fe7/tasks/coffeeLint.coffee | 1 | 31 |
jianliaoim/talk-os:talk-api2x/server/jobs/sweep-guest.coffee:1:raw_corpus | raw_corpus | # Sweep out guest and send messages to their email boxes
Promise = require 'bluebird'
{socket, limbo} = require '../components'
{gmMailer} = require '../mailers'
{
MemberModel
RoomModel
MessageModel
} = limbo.use 'talk'
module.exports = (_userId) ->
MemberModel.find
user: _userId
room: $ne: null
... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/jobs/sweep-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/jobs/sweep-guest.coffee | 1 | 30 | ||
jianliaoim/talk-os:talk-api2x/server/jobs/sweep-guest.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Sweep out guest and send messages to their email boxes
Promise = require 'bluebird'
{socket, limbo} = require '../components'
{gmMailer} = require '../mailers'
{
MemberModel
RoomModel
MessageModel
} = limbo.use 'talk'
module.exports = (_userId) ->
Me... | // Sweep out guest and send messages to their email boxes
var MemberModel, MessageModel, Promise, RoomModel, gmMailer, limbo, socket;
Promise = require('bluebird');
({socket, limbo} = require('../components'));
({gmMailer} = require('../mailers'));
({MemberModel, RoomModel, MessageModel} = limbo.use('talk'));
modu... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/jobs/sweep-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/jobs/sweep-guest.coffee | 1 | 30 |
jianliaoim/talk-os:talk-api2x/server/jobs/sweep-guest.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Sweep out guest and send messages to their email boxes
var MemberModel, MessageModel, Promise, RoomModel, gmMailer, limbo, socket;
Promise = require('bluebird');
({socket, limbo} = require('../components'));
({gmMailer} = require('../mailers'));
({MemberMode... | # Sweep out guest and send messages to their email boxes
Promise = require 'bluebird'
{socket, limbo} = require '../components'
{gmMailer} = require '../mailers'
{
MemberModel
RoomModel
MessageModel
} = limbo.use 'talk'
module.exports = (_userId) ->
MemberModel.find
user: _userId
room: $ne: null
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/jobs/sweep-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/jobs/sweep-guest.coffee | 1 | 30 |
jianliaoim/talk-os:talk-api2x/server/jobs/sweep-guest.coffee:1:completion | completion | # Sweep out guest and send messages to their email boxes
Promise = require 'bluebird'
{socket, limbo} = require '../components'
{gmMailer} = require '../mailers'
{
MemberModel
RoomModel
MessageModel
} = limbo.use 'talk'
module.exports = (_userId) ->
MemberModel.find
user: _userId | room: $ne: null
isQuit: false
.populate 'room'
.execAsync()
.map (member) ->
return unless member.room
member.room.removeMemberAsync _userId
.then (room) ->
data = _roomId: room._id, _userId: _userId
socket.broadcast "team:#{room._teamId}", "room:leave", data
member.room.creat... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/jobs/sweep-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/jobs/sweep-guest.coffee | 1 | 30 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:raw_corpus | raw_corpus | 'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'MozAnimation': 'mozAnimationEnd'
'animation' : 'anim... | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 1 | 42 | ||
Pathgather/please-wait:spec/please_wait.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'M... | 'use strict';
describe('PleaseWait', function() {
var getTransitionEvent;
getTransitionEvent = function() {
var el, key, transitions, val;
el = document.createElement('fakeelement');
transitions = {
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': ... | CoffeeScript | JavaScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 1 | 42 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
'use strict';
describe('PleaseWait', function() {
var getTransitionEvent;
getTransitionEvent = function() {
var el, key, transitions, val;
el = document.createElement('fakeelement');
transitions = {
'WebkitAnimation': 'webkitAnimationEnd',
... | 'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'MozAnimation': 'mozAnimationEnd'
'animation' : 'anim... | JavaScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 1 | 42 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:completion | completion | 'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'MozAnimation': 'mozAnimationEnd'
'animation' : 'anim... | beforeEach () ->
if !originalHTML? then originalHTML = document.body.innerHTML
afterEach () ->
# Reset the body to its original state before each run. We could call finish, but we'll test that below
document.body.innerHTML = originalHTML
describe "when using the default template", ->
d... | CoffeeScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 1 | 42 |
Pathgather/please-wait:spec/please_wait.spec.coffee:2:raw_corpus | raw_corpus | describe "when setting a message", ->
it "sets the message", ->
pleaseWait.start({message: "Hi!"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
message = addedScreen.getElementsByClassName("pg-loading-message")[0]
expect(message.innerHTML).to... | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 44 | 82 | ||
Pathgather/please-wait:spec/please_wait.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "when setting a message", ->
it "sets the message", ->
pleaseWait.start({message: "Hi!"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
message = addedScreen.getElementsByClassName("pg-lo... | describe("when setting a message", function() {
return it("sets the message", function() {
var addedScreen, message;
pleaseWait.start({
message: "Hi!"
});
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0];
message = addedScreen.getElementsByClassName("pg-loading-mess... | CoffeeScript | JavaScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 44 | 82 |
Pathgather/please-wait:spec/please_wait.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("when setting a message", function() {
return it("sets the message", function() {
var addedScreen, message;
pleaseWait.start({
message: "Hi!"
});
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0];
messag... | describe "when setting a message", ->
it "sets the message", ->
pleaseWait.start({message: "Hi!"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
message = addedScreen.getElementsByClassName("pg-loading-message")[0]
expect(message.innerHTML).to... | JavaScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 44 | 82 |
Pathgather/please-wait:spec/please_wait.spec.coffee:2:completion | completion | describe "when setting a message", ->
it "sets the message", ->
pleaseWait.start({message: "Hi!"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
message = addedScreen.getElementsByClassName("pg-loading-message")[0]
expect(message.innerHTML).to... | expect(logo.src).toContain("logo.png")
describe "when the template has an element of class pg-loading-spinner", ->
it "sets the spinner", ->
pleaseWait.start({spinnerTemplate: "<div>Spin!</div>", template: "<div><div class='pg-loading-spinner'></div></div>"})
addedScreen = document.bo... | CoffeeScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 44 | 82 |
Pathgather/please-wait:spec/please_wait.spec.coffee:3:raw_corpus | raw_corpus | describe 'finish', ->
it "removes the loading screen from the body after it transitions out", ->
addedScreen = pleaseWait.start({logo: 'logo.png', spinnerTemplate: "<div></div>"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
expect(addedScreen).toBeDefined()
ple... | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 84 | 94 | ||
Pathgather/please-wait:spec/please_wait.spec.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'finish', ->
it "removes the loading screen from the body after it transitions out", ->
addedScreen = pleaseWait.start({logo: 'logo.png', spinnerTemplate: "<div></div>"})
addedScreen = document.body.getElementsByClassName("pg-loading-scre... | describe('finish', function() {
return it("removes the loading screen from the body after it transitions out", function() {
var addedScreen, event;
addedScreen = pleaseWait.start({
logo: 'logo.png',
spinnerTemplate: "<div></div>"
});
addedScreen = document.body.getElementsByClassName("pg-l... | CoffeeScript | JavaScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 84 | 94 |
Pathgather/please-wait:spec/please_wait.spec.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('finish', function() {
return it("removes the loading screen from the body after it transitions out", function() {
var addedScreen, event;
addedScreen = pleaseWait.start({
logo: 'logo.png',
spinnerTemplate: "<div></div>"
});
a... | describe 'finish', ->
it "removes the loading screen from the body after it transitions out", ->
addedScreen = pleaseWait.start({logo: 'logo.png', spinnerTemplate: "<div></div>"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
expect(addedScreen).toBeDefined()
ple... | JavaScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 84 | 94 |
Pathgather/please-wait:spec/please_wait.spec.coffee:3:completion | completion | describe 'finish', ->
it "removes the loading screen from the body after it transitions out", ->
addedScreen = pleaseWait.start({logo: 'logo.png', spinnerTemplate: "<div></div>"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
expect(addedScreen).toBeDefined() | pleaseWait.finish()
event = document.createEvent('Event')
event.initEvent(getTransitionEvent(), true, true)
addedScreen.dispatchEvent event
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
expect(addedScreen).not.toBeDefined() | CoffeeScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 34cdadf989d209e8f622bc2880654c018ea5af8f | 1,583 | https://github.com/Pathgather/please-wait/blob/34cdadf989d209e8f622bc2880654c018ea5af8f/spec/please_wait.spec.coffee | 84 | 94 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:raw_corpus | raw_corpus | 'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'MozAnimation': 'mozAnimationEnd'
'animation' : 'anim... | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 198385fbcf422eb5938255a36461b513bfb86cd6 | 1,583 | https://github.com/Pathgather/please-wait/blob/198385fbcf422eb5938255a36461b513bfb86cd6/spec/please_wait.spec.coffee | 1 | 50 | ||
Pathgather/please-wait:spec/please_wait.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'M... | 'use strict';
describe('PleaseWait', function() {
var getTransitionEvent;
getTransitionEvent = function() {
var el, key, transitions, val;
el = document.createElement('fakeelement');
transitions = {
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': ... | CoffeeScript | JavaScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 198385fbcf422eb5938255a36461b513bfb86cd6 | 1,583 | https://github.com/Pathgather/please-wait/blob/198385fbcf422eb5938255a36461b513bfb86cd6/spec/please_wait.spec.coffee | 1 | 50 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
'use strict';
describe('PleaseWait', function() {
var getTransitionEvent;
getTransitionEvent = function() {
var el, key, transitions, val;
el = document.createElement('fakeelement');
transitions = {
'WebkitAnimation': 'webkitAnimationEnd',
... | 'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'MozAnimation': 'mozAnimationEnd'
'animation' : 'anim... | JavaScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 198385fbcf422eb5938255a36461b513bfb86cd6 | 1,583 | https://github.com/Pathgather/please-wait/blob/198385fbcf422eb5938255a36461b513bfb86cd6/spec/please_wait.spec.coffee | 1 | 50 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:completion | completion | 'use strict';
describe 'PleaseWait', ->
getTransitionEvent = ->
el = document.createElement('fakeelement')
transitions =
'WebkitAnimation': 'webkitAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd',
'MozAnimation': 'mozAnimationEnd'
'animation' : 'anim... | # Reset the body to its original state before each run. We could call finish, but we'll test that below
document.body.innerHTML = originalHTML
describe "when using the default template", ->
it "requires a logo", ->
expect(-> pleaseWait.start({logo: null, spinnerTemplate: "<div></div>"})).toThro... | CoffeeScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 198385fbcf422eb5938255a36461b513bfb86cd6 | 1,583 | https://github.com/Pathgather/please-wait/blob/198385fbcf422eb5938255a36461b513bfb86cd6/spec/please_wait.spec.coffee | 1 | 50 |
Pathgather/please-wait:spec/please_wait.spec.coffee:2:raw_corpus | raw_corpus | loadingScreen = pleaseWait.start({logo: null, template: "<div></div>"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
expect(loadingScreen).toEqual(addedScreen)
expect(addedScreen.nodeName).toEqual("HEADER")
expect(loadingScreen.children[0].nodeName).toEqua... | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 198385fbcf422eb5938255a36461b513bfb86cd6 | 1,583 | https://github.com/Pathgather/please-wait/blob/198385fbcf422eb5938255a36461b513bfb86cd6/spec/please_wait.spec.coffee | 51 | 72 | ||
Pathgather/please-wait:spec/please_wait.spec.coffee:2:completion | completion | loadingScreen = pleaseWait.start({logo: null, template: "<div></div>"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
expect(loadingScreen).toEqual(addedScreen)
expect(addedScreen.nodeName).toEqual("HEADER")
expect(loadingScreen.children[0].nodeName).toEqua... | describe 'finish', ->
it "removes the loading screen from the body after it transitions out", ->
addedScreen = pleaseWait.start({logo: 'logo.png', spinnerTemplate: "<div></div>"})
addedScreen = document.body.getElementsByClassName("pg-loading-screen")[0]
expect(addedScreen).toBeDefined()
ple... | CoffeeScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 198385fbcf422eb5938255a36461b513bfb86cd6 | 1,583 | https://github.com/Pathgather/please-wait/blob/198385fbcf422eb5938255a36461b513bfb86cd6/spec/please_wait.spec.coffee | 51 | 72 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:raw_corpus | raw_corpus | 'use strict';
describe 'PleaseWait', ->
it "defines start & finish", ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined()
describe 'start', ->
describe "when using the default template", ->
it "requires a logo", ->
expect(-> pleaseWait.start({logo: null, spin... | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 3ef34ca56c47cddce4132a189a5ed3ecd3981b35 | 1,583 | https://github.com/Pathgather/please-wait/blob/3ef34ca56c47cddce4132a189a5ed3ecd3981b35/spec/please_wait.spec.coffee | 1 | 21 | ||
Pathgather/please-wait:spec/please_wait.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'use strict';
describe 'PleaseWait', ->
it "defines start & finish", ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined()
describe 'start', ->
describe "when using the default template", ->
it "requires a logo"... | 'use strict';
describe('PleaseWait', function() {
it("defines start & finish", function() {
expect(pleaseWait.start).toBeDefined();
return expect(pleaseWait.finish).toBeDefined();
});
return describe('start', function() {
describe("when using the default template", function() {
it("requires a lo... | CoffeeScript | JavaScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 3ef34ca56c47cddce4132a189a5ed3ecd3981b35 | 1,583 | https://github.com/Pathgather/please-wait/blob/3ef34ca56c47cddce4132a189a5ed3ecd3981b35/spec/please_wait.spec.coffee | 1 | 21 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
'use strict';
describe('PleaseWait', function() {
it("defines start & finish", function() {
expect(pleaseWait.start).toBeDefined();
return expect(pleaseWait.finish).toBeDefined();
});
return describe('start', function() {
describe("when using the ... | 'use strict';
describe 'PleaseWait', ->
it "defines start & finish", ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined()
describe 'start', ->
describe "when using the default template", ->
it "requires a logo", ->
expect(-> pleaseWait.start({logo: null, spin... | JavaScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 3ef34ca56c47cddce4132a189a5ed3ecd3981b35 | 1,583 | https://github.com/Pathgather/please-wait/blob/3ef34ca56c47cddce4132a189a5ed3ecd3981b35/spec/please_wait.spec.coffee | 1 | 21 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:completion | completion | 'use strict';
describe 'PleaseWait', ->
it "defines start & finish", ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined()
describe 'start', ->
describe "when using the default template", ->
it "requires a logo", -> | expect(-> pleaseWait.start({logo: null, spinnerTemplate: "<div></div>"})).toThrowError("Option 'logo' is required")
it "requires a spinner template", ->
expect(-> pleaseWait.start({logo: 'logo.png', spinnerTemplate: null})).toThrowError("Option 'spinnerTemplate' is required")
describe "when using a ... | CoffeeScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | 3ef34ca56c47cddce4132a189a5ed3ecd3981b35 | 1,583 | https://github.com/Pathgather/please-wait/blob/3ef34ca56c47cddce4132a189a5ed3ecd3981b35/spec/please_wait.spec.coffee | 1 | 21 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:raw_corpus | raw_corpus | 'use strict';
describe 'PleaseWait', ->
it 'defines start & finish', ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined() | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | b1a3111eab8d86ba5fd9ed8244136330ca53e320 | 1,583 | https://github.com/Pathgather/please-wait/blob/b1a3111eab8d86ba5fd9ed8244136330ca53e320/spec/please_wait.spec.coffee | 1 | 6 | ||
Pathgather/please-wait:spec/please_wait.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'use strict';
describe 'PleaseWait', ->
it 'defines start & finish', ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined()
``` | 'use strict';
describe('PleaseWait', function() {
return it('defines start & finish', function() {
expect(pleaseWait.start).toBeDefined();
return expect(pleaseWait.finish).toBeDefined();
});
}); | CoffeeScript | JavaScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | b1a3111eab8d86ba5fd9ed8244136330ca53e320 | 1,583 | https://github.com/Pathgather/please-wait/blob/b1a3111eab8d86ba5fd9ed8244136330ca53e320/spec/please_wait.spec.coffee | 1 | 6 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
'use strict';
describe('PleaseWait', function() {
return it('defines start & finish', function() {
expect(pleaseWait.start).toBeDefined();
return expect(pleaseWait.finish).toBeDefined();
});
});
``` | 'use strict';
describe 'PleaseWait', ->
it 'defines start & finish', ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined() | JavaScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | b1a3111eab8d86ba5fd9ed8244136330ca53e320 | 1,583 | https://github.com/Pathgather/please-wait/blob/b1a3111eab8d86ba5fd9ed8244136330ca53e320/spec/please_wait.spec.coffee | 1 | 6 |
Pathgather/please-wait:spec/please_wait.spec.coffee:1:completion | completion | 'use strict';
describe 'PleaseWait', -> | it 'defines start & finish', ->
expect(pleaseWait.start).toBeDefined()
expect(pleaseWait.finish).toBeDefined() | CoffeeScript | CoffeeScript | Pathgather/please-wait | spec/please_wait.spec.coffee | MIT | b1a3111eab8d86ba5fd9ed8244136330ca53e320 | 1,583 | https://github.com/Pathgather/please-wait/blob/b1a3111eab8d86ba5fd9ed8244136330ca53e320/spec/please_wait.spec.coffee | 1 | 6 |
yakyak/yakyak:src/ui/app.coffee:1:raw_corpus | raw_corpus | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 16 | 65 | ||
yakyak/yakyak:src/ui/app.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead ... | var applayout, contextmenu, conv, currentWindow, trayicon, viewstate;
window.onerror = function(msg, url, lineNo, columnNo, error) {
var hash;
hash = {msg, url, lineNo, columnNo, error};
return ipc.send('errorInWindow', hash);
};
// expose some selected tagg functions
trifl.tagg.expose(window, ...('ul li div sp... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 16 | 65 |
yakyak/yakyak:src/ui/app.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var applayout, contextmenu, conv, currentWindow, trayicon, viewstate;
window.onerror = function(msg, url, lineNo, columnNo, error) {
var hash;
hash = {msg, url, lineNo, columnNo, error};
return ipc.send('errorInWindow', hash);
};
// expose some selected tag... | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 16 | 65 |
yakyak/yakyak:src/ui/app.coffee:1:completion | completion | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | document.body.appendChild applayout.el
# intercept every event we listen to
# to make an 'alive' action to know
# the server is alive
do ->
ipcon = ipc.on.bind(ipc)
ipc.on = (n, fn) ->
ipcon n, (as...) ->
action 'alive', Date.now()
fn as...
# called when window is ready to show... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 16 | 65 |
yakyak/yakyak:src/ui/app.coffee:2:raw_corpus | raw_corpus | else if !remote.getGlobal('windowHideWhileCred')? ||
remote.getGlobal('windowHideWhileCred') != true
mainWindow.show()
#
#
# Get information on exceptions in main process
# - Exceptions that were caught
# - Window crashes
ipc.on 'expcetioninmain', (error) ->
console.log (msg = "Possible fata... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 66 | 115 | ||
yakyak/yakyak:src/ui/app.coffee:2:completion | completion | else if !remote.getGlobal('windowHideWhileCred')? ||
remote.getGlobal('windowHideWhileCred') != true
mainWindow.show()
#
#
# Get information on exceptions in main process
# - Exceptions that were caught
# - Window crashes
ipc.on 'expcetioninmain', (error) ->
console.log (msg = "Possible fata... | ipc.on 'searchentities:result', (ev, r) ->
action 'setsearchedentities', r.entity
ipc.on 'createconversation:result', (ev, c, name) ->
c.conversation_id = c.id # fix conversation payload
c.name = name if name
action 'createconversationdone', c
action 'setstate', viewstate.STATE_NORMAL
ipc.on 'syncal... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 66 | 115 |
yakyak/yakyak:src/ui/app.coffee:3:raw_corpus | raw_corpus | # register event listeners for on/offline
window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScre... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 116 | 165 | ||
yakyak/yakyak:src/ui/app.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# register event listeners for on/offline
window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
... | // register event listeners for on/offline
window.addEventListener('online', function() {
return action('wonline', true);
});
window.addEventListener('offline', function() {
return action('wonline', false);
});
window.addEventListener('unload', function(ev) {
var window;
if (process.platform === 'darwin' && ... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 116 | 165 |
yakyak/yakyak:src/ui/app.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// register event listeners for on/offline
window.addEventListener('online', function() {
return action('wonline', true);
});
window.addEventListener('offline', function() {
return action('wonline', false);
});
window.addEventListener('unload', function(ev) ... | # register event listeners for on/offline
window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScre... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 116 | 165 |
yakyak/yakyak:src/ui/app.coffee:3:completion | completion | # register event listeners for on/offline
window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScre... | ipc.send 'errorInWindow', 'Unresponsive window'
#
#
# Show a message
remote.getCurrentWindow().on 'responsive', () ->
notr "Back to normal again!", { id: 'unresponsive'}
# Listen to close and quit events
window.addEventListener 'beforeunload', (e) ->
if remote.getGlobal('forceClose')
return
hide ... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 116 | 165 |
yakyak/yakyak:src/ui/app.coffee:4:raw_corpus | raw_corpus | currentWindow.webContents.on 'context-menu', (e, params) ->
e.preventDefault()
canShow = [viewstate.STATE_NORMAL,
viewstate.STATE_ADD_CONVERSATION].includes(viewstate.state)
if canShow
contextmenu(params, viewstate).popup remote.getCurrentWindow()
# tell the startup state
action 'won... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 166 | 179 | ||
yakyak/yakyak:src/ui/app.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
currentWindow.webContents.on 'context-menu', (e, params) ->
e.preventDefault()
canShow = [viewstate.STATE_NORMAL,
viewstate.STATE_ADD_CONVERSATION].includes(viewstate.state)
if canShow
contextmenu(params, viewstate).popup remote... | var script;
currentWindow.webContents.on('context-menu', function(e, params) {
var canShow;
e.preventDefault();
canShow = [viewstate.STATE_NORMAL, viewstate.STATE_ADD_CONVERSATION].includes(viewstate.state);
if (canShow) {
return contextmenu(params, viewstate).popup(remote.getCurrentWindow());
}
});
// ... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 166 | 179 |
yakyak/yakyak:src/ui/app.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var script;
currentWindow.webContents.on('context-menu', function(e, params) {
var canShow;
e.preventDefault();
canShow = [viewstate.STATE_NORMAL, viewstate.STATE_ADD_CONVERSATION].includes(viewstate.state);
if (canShow) {
return contextmenu(params, vi... | currentWindow.webContents.on 'context-menu', (e, params) ->
e.preventDefault()
canShow = [viewstate.STATE_NORMAL,
viewstate.STATE_ADD_CONVERSATION].includes(viewstate.state)
if canShow
contextmenu(params, viewstate).popup remote.getCurrentWindow()
# tell the startup state
action 'won... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 166 | 179 |
yakyak/yakyak:src/ui/app.coffee:4:completion | completion | currentWindow.webContents.on 'context-menu', (e, params) ->
e.preventDefault()
canShow = [viewstate.STATE_NORMAL,
viewstate.STATE_ADD_CONVERSATION].includes(viewstate.state)
if canShow
contextmenu(params, viewstate).popup remote.getCurrentWindow() | # tell the startup state
action 'wonline', window.navigator.onLine
if process.platform == 'win32'
script = document.createElement('script')
script.src = 'http://twemoji.maxcdn.com/2/twemoji.min.js'
document.head.appendChild(script) | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/app.coffee | 166 | 179 |
yakyak/yakyak:src/ui/app.coffee:1:raw_corpus | raw_corpus | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 16 | 65 | ||
yakyak/yakyak:src/ui/app.coffee:1:completion | completion | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | # intercept every event we listen to
# to make an 'alive' action to know
# the server is alive
do ->
ipcon = ipc.on.bind(ipc)
ipc.on = (n, fn) ->
ipcon n, (as...) ->
action 'alive', Date.now()
fn as...
# called when window is ready to show
# note: could not use event here, as i... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 16 | 65 |
yakyak/yakyak:src/ui/app.coffee:2:raw_corpus | raw_corpus | mainWindow.show()
#
#
# Get information on exceptions in main process
# - Exceptions that were caught
# - Window crashes
ipc.on 'expcetioninmain', (error) ->
console.log (msg = "Possible fatal error on main process" +
", YakYak could stop working as expected."), error
notr msg, {stay: 0}
# wire up s... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 66 | 115 | ||
yakyak/yakyak:src/ui/app.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mainWindow.show()
#
#
# Get information on exceptions in main process
# - Exceptions that were caught
# - Window crashes
ipc.on 'expcetioninmain', (error) ->
console.log (msg = "Possible fatal error on main process" +
", YakYak could stop working a... | mainWindow.show();
// Get information on exceptions in main process
// - Exceptions that were caught
// - Window crashes
ipc.on('expcetioninmain', function(error) {
var msg;
console.log((msg = "Possible fatal error on main process" + ", YakYak could stop working as expected."), error);
return notr(msg, {
... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 66 | 115 |
yakyak/yakyak:src/ui/app.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
mainWindow.show();
// Get information on exceptions in main process
// - Exceptions that were caught
// - Window crashes
ipc.on('expcetioninmain', function(error) {
var msg;
console.log((msg = "Possible fatal error on main process" + ", YakYak could stop wo... | mainWindow.show()
#
#
# Get information on exceptions in main process
# - Exceptions that were caught
# - Window crashes
ipc.on 'expcetioninmain', (error) ->
console.log (msg = "Possible fatal error on main process" +
", YakYak could stop working as expected."), error
notr msg, {stay: 0}
# wire up s... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 66 | 115 |
yakyak/yakyak:src/ui/app.coffee:2:completion | completion | mainWindow.show()
#
#
# Get information on exceptions in main process
# - Exceptions that were caught
# - Window crashes
ipc.on 'expcetioninmain', (error) ->
console.log (msg = "Possible fatal error on main process" +
", YakYak could stop working as expected."), error
notr msg, {stay: 0}
# wire up s... | ipc.on 'createconversation:result', (ev, c, name) ->
c.conversation_id = c.id # fix conversation payload
c.name = name if name
action 'createconversationdone', c
action 'setstate', viewstate.STATE_NORMAL
ipc.on 'syncallnewevents:response', (ev, r) -> action 'handlesyncedevents', r
ipc.on 'syncrecentconv... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 66 | 115 |
yakyak/yakyak:src/ui/app.coffee:3:raw_corpus | raw_corpus | window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScreen false
if not remote.getGlobal('... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 116 | 165 | ||
yakyak/yakyak:src/ui/app.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
win... | window.addEventListener('online', function() {
return action('wonline', true);
});
window.addEventListener('offline', function() {
return action('wonline', false);
});
window.addEventListener('unload', function(ev) {
var window;
if (process.platform === 'darwin' && (typeof window !== "undefined" && window !=... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 116 | 165 |
yakyak/yakyak:src/ui/app.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
window.addEventListener('online', function() {
return action('wonline', true);
});
window.addEventListener('offline', function() {
return action('wonline', false);
});
window.addEventListener('unload', function(ev) {
var window;
if (process.platform === ... | window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScreen false
if not remote.getGlobal('... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 116 | 165 |
yakyak/yakyak:src/ui/app.coffee:3:completion | completion | window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScreen false
if not remote.getGlobal('... | #
#
# Show a message
remote.getCurrentWindow().on 'responsive', () ->
notr "Back to normal again!", { id: 'unresponsive'}
# Listen to close and quit events
window.addEventListener 'beforeunload', (e) ->
if remote.getGlobal('forceClose')
return
hide = (
# Mac os and the dock have a special ... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 116 | 165 |
yakyak/yakyak:src/ui/app.coffee:4:raw_corpus | raw_corpus | # contextmenu.popup remote.getCurrentWindow()
# return
#), false
# tell the startup state
action 'wonline', window.navigator.onLine
if process.platform == 'win32'
script = document.createElement('script')
script.src = 'http://twemoji.maxcdn.com/2/twemoji.min.js'
document.head.appendChild(script) | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 166 | 176 | ||
yakyak/yakyak:src/ui/app.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# contextmenu.popup remote.getCurrentWindow()
# return
#), false
# tell the startup state
action 'wonline', window.navigator.onLine
if process.platform == 'win32'
script = document.createElement('script')
script.src = 'http://twemoji.maxcdn.co... | // contextmenu.popup remote.getCurrentWindow()
// return
//), false
// tell the startup state
var script;
action('wonline', window.navigator.onLine);
if (process.platform === 'win32') {
script = document.createElement('script');
script.src = 'http://twemoji.maxcdn.com/2/twemoji.min.js';
document.head... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 166 | 176 |
yakyak/yakyak:src/ui/app.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// contextmenu.popup remote.getCurrentWindow()
// return
//), false
// tell the startup state
var script;
action('wonline', window.navigator.onLine);
if (process.platform === 'win32') {
script = document.createElement('script');
script.src = 'http:... | # contextmenu.popup remote.getCurrentWindow()
# return
#), false
# tell the startup state
action 'wonline', window.navigator.onLine
if process.platform == 'win32'
script = document.createElement('script')
script.src = 'http://twemoji.maxcdn.com/2/twemoji.min.js'
document.head.appendChild(script) | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 166 | 176 |
yakyak/yakyak:src/ui/app.coffee:4:completion | completion | # contextmenu.popup remote.getCurrentWindow()
# return
#), false
# tell the startup state | action 'wonline', window.navigator.onLine
if process.platform == 'win32'
script = document.createElement('script')
script.src = 'http://twemoji.maxcdn.com/2/twemoji.min.js'
document.head.appendChild(script) | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/app.coffee | 166 | 176 |
yakyak/yakyak:src/ui/app.coffee:1:raw_corpus | raw_corpus | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 1e989ec0c15f64c9e5de5116cd459a0cd5d60e47 | 3,762 | https://github.com/yakyak/yakyak/blob/1e989ec0c15f64c9e5de5116cd459a0cd5d60e47/src/ui/app.coffee | 16 | 65 | ||
yakyak/yakyak:src/ui/app.coffee:1:completion | completion | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | # intercept every event we listen to
# to make an 'alive' action to know
# the server is alive
do ->
ipcon = ipc.on.bind(ipc)
ipc.on = (n, fn) ->
ipcon n, (as...) ->
action 'alive', Date.now()
fn as...
# called when window is ready to show
# note: could not use event here, as i... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 1e989ec0c15f64c9e5de5116cd459a0cd5d60e47 | 3,762 | https://github.com/yakyak/yakyak/blob/1e989ec0c15f64c9e5de5116cd459a0cd5d60e47/src/ui/app.coffee | 16 | 65 |
yakyak/yakyak:src/ui/app.coffee:1:raw_corpus | raw_corpus | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd | 3,762 | https://github.com/yakyak/yakyak/blob/553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd/src/ui/app.coffee | 16 | 65 | ||
yakyak/yakyak:src/ui/app.coffee:1:completion | completion | window.onerror = (msg, url, lineNo, columnNo, error) ->
hash = {msg, url, lineNo, columnNo, error}
ipc.send 'errorInWindow', hash
# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split... | # intercept every event we listen to
# to make an 'alive' action to know
# the server is alive
do ->
ipcon = ipc.on.bind(ipc)
ipc.on = (n, fn) ->
ipcon n, (as...) ->
action 'alive', Date.now()
fn as...
# called when window is ready to show
# note: could not use event here, as i... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd | 3,762 | https://github.com/yakyak/yakyak/blob/553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd/src/ui/app.coffee | 16 | 65 |
yakyak/yakyak:src/ui/app.coffee:3:raw_corpus | raw_corpus | window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScreen false
if not remote.getGlobal('... | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd | 3,762 | https://github.com/yakyak/yakyak/blob/553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd/src/ui/app.coffee | 116 | 165 | ||
yakyak/yakyak:src/ui/app.coffee:3:completion | completion | window.addEventListener 'online', -> action 'wonline', true
window.addEventListener 'offline', -> action 'wonline', false
#
window.addEventListener 'unload', (ev) ->
if process.platform == 'darwin' && window?
if window.isFullScreen()
window.setFullScreen false
if not remote.getGlobal('... | #
#
# Show a message
remote.getCurrentWindow().on 'responsive', () ->
notr "Back to normal again!", { id: 'unresponsive'}
# Listen to close and quit events
window.addEventListener 'beforeunload', (e) ->
if remote.getGlobal('forceClose')
return
hide = (
# Mac os and the dock have a special ... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd | 3,762 | https://github.com/yakyak/yakyak/blob/553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd/src/ui/app.coffee | 116 | 165 |
yakyak/yakyak:src/ui/app.coffee:4:raw_corpus | raw_corpus | contextmenu.popup remote.getCurrentWindow()
return
), false
# tell the startup state
action 'wonline', window.navigator.onLine
if process.platform == 'win32'
script = document.createElement('script')
script.src = 'http://twemoji.maxcdn.com/2/twemoji.min.js'
document.head.appendChild(script) | CoffeeScript | yakyak/yakyak | src/ui/app.coffee | MIT | 553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd | 3,762 | https://github.com/yakyak/yakyak/blob/553c76e3aaaf5c7abbc8efbad602aa446bd1a5dd/src/ui/app.coffee | 166 | 176 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.