commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
123177c3f7f70b1c8a6dce1b852545892a41df8c
lib/index.js
lib/index.js
var canvas = document.getElementById('game'); var context = canvas.getContext('2d'); var Ball = function(x, y, radius, context) { this.x = x; this.y = y; this.radius = radius || 10; this.startAngle = 0; this.endAngle = (Math.PI / 180) * 360; this.context = context } Ball.prototype.draw = function () { context.arc(this.x, this.y, this.radius, this.startAngle, this.endAngle); context.fillStyle = "white" context.fill(); return this; }; Ball.prototype.move = function () { if (this.x < canvas.width - this.radius){ this.x++; } return this; }; var golfBall = new Ball(350, 550, 5, 0); requestAnimationFrame(function gameLoop() { context.beginPath(); context.clearRect(0, 0, canvas.width, canvas.height); context.closePath(); golfBall.draw().move(); requestAnimationFrame(gameLoop); }); module.exports = Ball;
var canvas = document.getElementById('game'); var context = canvas.getContext('2d'); var Ball = function(x, y, radius, context) { this.x = x; this.y = y; this.radius = radius || 10; this.startAngle = 0; this.endAngle = (Math.PI / 180) * 360; this.context = context this.speed = 0 } Ball.prototype.draw = function () { context.arc(this.x, this.y, this.radius, this.startAngle, this.endAngle); context.fillStyle = "white" context.fill(); return this; }; Ball.prototype.move = function () { if (this.x < canvas.width - this.radius && this.y < canvas.height - this.radius ){ this.x += this.speed; // this.y += this.speed; } return this; }; var golfBall = new Ball(350, 450, 5, 0); requestAnimationFrame(function gameLoop() { context.beginPath(); context.clearRect(0, 0, canvas.width, canvas.height); context.closePath(); golfBall.draw().move(); requestAnimationFrame(gameLoop); }); module.exports = Ball;
Add ball speed and change move function
Add ball speed and change move function
JavaScript
mit
brennanholtzclaw/game_time,brennanholtzclaw/game_time
--- +++ @@ -8,6 +8,7 @@ this.startAngle = 0; this.endAngle = (Math.PI / 180) * 360; this.context = context + this.speed = 0 } Ball.prototype.draw = function () { @@ -18,13 +19,14 @@ }; Ball.prototype.move = function () { - if (this.x < canvas.width - this.radius){ - this.x++; + if (this.x < canvas.width - this.radius && this.y < canvas.height - this.radius ){ + this.x += this.speed; + // this.y += this.speed; } return this; }; -var golfBall = new Ball(350, 550, 5, 0); +var golfBall = new Ball(350, 450, 5, 0); requestAnimationFrame(function gameLoop() { context.beginPath();
f567d423ca0b94f236a38c45e51958d203582fd1
src/controller/templates/Controller.js
src/controller/templates/Controller.js
'use strict' const Controller = require('trails-controller') /** * @module <%= name %>Controller * @description Generated Trails.js Controller. */ module.exports = class <%= name %>Controller extends Controller { }
'use strict' /** * @module <%= name %>Controller * @description Generated Trails.js Controller. */ module.exports = class <%= name %>Controller { }
Remove controller extends on template file
Remove controller extends on template file
JavaScript
mit
jaumard/generator-trails,tnunes/generator-trails,konstantinzolotarev/generator-trails
--- +++ @@ -1,12 +1,10 @@ 'use strict' - -const Controller = require('trails-controller') /** * @module <%= name %>Controller * @description Generated Trails.js Controller. */ -module.exports = class <%= name %>Controller extends Controller { +module.exports = class <%= name %>Controller { }
3474af3e09940dd7a9e25f308bf4e3467ab4159c
resources/assets/components/DropdownFilter/index.js
resources/assets/components/DropdownFilter/index.js
import React from 'react'; import { map } from 'lodash'; class DropdownFilter extends React.Component { constructor() { super(); this.change = this.change.bind(this); } componentDidMount() { const type = this.props.options.type; const defaultValue = this.props.options.default; this.props.updateFilters({ [type]: defaultValue }); } change(event) { const type = this.props.options.type; this.props.updateFilters({ [type]: event.target.value }); } render() { return ( <div className="container__block -third"> <h2 className="heading -delta">{this.props.header}</h2> <div className="select"> <select onChange={(event) => this.change(event)}> {map(this.props.options.values, (option, key) => ( <option value={key} key={key}>{option}</option> ))} </select> </div> </div> ) } } export default DropdownFilter;
import React from 'react'; import { map } from 'lodash'; import PropTypes from 'prop-types'; class DropdownFilter extends React.Component { constructor() { super(); this.change = this.change.bind(this); } componentDidMount() { const type = this.props.options.type; const defaultValue = this.props.options.default; this.props.updateFilters({ [type]: defaultValue }); } change(event) { const type = this.props.options.type; this.props.updateFilters({ [type]: event.target.value }); } render() { return ( <div className="container__block -third"> <h2 className="heading -delta">{this.props.header}</h2> <div className="select"> <select onChange={event => this.change(event)}> {map(this.props.options.values, (option, key) => ( <option value={key} key={key}>{option}</option> ))} </select> </div> </div> ); } } DropdownFilter.propTypes = { options: PropTypes.shape({ default: PropTypes.string, type: PropTypes.string, values: PropTypes.object, }).isRequired, updateFilters: PropTypes.func, header: PropTypes.string.isRequired, }; DropdownFilter.defaultProps = { updateFilters: null, }; export default DropdownFilter;
Add proptype validation to DropDownFilter component
Add proptype validation to DropDownFilter component
JavaScript
mit
DoSomething/rogue,DoSomething/rogue,DoSomething/rogue
--- +++ @@ -1,5 +1,6 @@ import React from 'react'; import { map } from 'lodash'; +import PropTypes from 'prop-types'; class DropdownFilter extends React.Component { constructor() { @@ -23,19 +24,33 @@ render() { return ( - <div className="container__block -third"> - <h2 className="heading -delta">{this.props.header}</h2> + <div className="container__block -third"> + <h2 className="heading -delta">{this.props.header}</h2> - <div className="select"> - <select onChange={(event) => this.change(event)}> - {map(this.props.options.values, (option, key) => ( - <option value={key} key={key}>{option}</option> - ))} - </select> - </div> + <div className="select"> + <select onChange={event => this.change(event)}> + {map(this.props.options.values, (option, key) => ( + <option value={key} key={key}>{option}</option> + ))} + </select> </div> - ) + </div> + ); } } +DropdownFilter.propTypes = { + options: PropTypes.shape({ + default: PropTypes.string, + type: PropTypes.string, + values: PropTypes.object, + }).isRequired, + updateFilters: PropTypes.func, + header: PropTypes.string.isRequired, +}; + +DropdownFilter.defaultProps = { + updateFilters: null, +}; + export default DropdownFilter;
ffa4315f48f5c5eed70d215000afdf794c6014cd
lib/utils.js
lib/utils.js
"use strict"; function resolveHttpError(response, message) { if (response.statusCode < 400) { return; } message = message ? message + " " : ""; message += "Status code " + response.statusCode + " (" + response.statusMessage + ")."; if (response.body) { message += " " + response.body; } var error = new Error(message); error.response = response; return error; } function createCallback(action, cb) { return function (err, response) { err = err || resolveHttpError(response, "Error " + action + "."); if (err) { return cb(err); } cb(null, response); }; } function createBodyCallback(action, cb) { return createCallback(action, function (err, response) { if (err) { return cb(err); } cb(null, response.body, response); }); } function createJsonCallback(action, cb) { return createCallback(action, function (err, response) { if (err) { return cb(err); } try { var data = JSON.parse(response.body); } catch (e) { return cb(e); } cb(null, data, response); }); } module.exports = { resolveHttpError: resolveHttpError, createCallback: createCallback, createBodyCallback: createBodyCallback, createJsonCallback: createJsonCallback };
"use strict"; function resolveHttpError(response, message) { if (response.statusCode < 400) { return; } message = message ? message + " " : ""; message += "Status code " + response.statusCode + " (" + response.statusMessage + "). See the response property for details."; var error = new Error(message); error.response = response; return error; } function createCallback(action, cb) { return function (err, response) { err = err || resolveHttpError(response, "Error " + action + "."); if (err) { return cb(err); } cb(null, response); }; } function createBodyCallback(action, cb) { return createCallback(action, function (err, response) { if (err) { return cb(err); } cb(null, response.body, response); }); } function createJsonCallback(action, cb) { return createCallback(action, function (err, response) { if (err) { return cb(err); } try { var data = JSON.parse(response.body); } catch (e) { return cb(e); } cb(null, data, response); }); } module.exports = { createCallback: createCallback, createBodyCallback: createBodyCallback, createJsonCallback: createJsonCallback };
Remove response body from error message. Hide HTTP error resolver.
Remove response body from error message. Hide HTTP error resolver.
JavaScript
mit
itsananderson/kudu-api,itsananderson/kudu-api
--- +++ @@ -9,11 +9,7 @@ ? message + " " : ""; - message += "Status code " + response.statusCode + " (" + response.statusMessage + ")."; - - if (response.body) { - message += " " + response.body; - } + message += "Status code " + response.statusCode + " (" + response.statusMessage + "). See the response property for details."; var error = new Error(message); error.response = response; @@ -60,7 +56,6 @@ } module.exports = { - resolveHttpError: resolveHttpError, createCallback: createCallback, createBodyCallback: createBodyCallback, createJsonCallback: createJsonCallback
c918f8c8de92f663b3407aa7f70a902cc15419c6
tasks/browser_extension.js
tasks/browser_extension.js
/* * grunt-browser-extension * https://github.com/addmitriev/grunt-browser-extension * * Copyright (c) 2015 Aleksey Dmitriev * Licensed under the MIT license. */ 'use strict'; var util = require('util'); var path = require('path'); var fs = require('fs-extra'); module.exports = function (grunt) { var BrowserExtension = require('./lib/browser-extension')(grunt); grunt.registerMultiTask('browser_extension', 'Grunt plugin to create any browser website extension', function () { if(this.target){ var options = this.options(); var required_options = []; for(var required_options_id in required_options){ if(required_options_id){ var required_option = required_options[required_options_id]; if(!options[required_option]){ grunt.fail.fatal("Please set up all required options. All options must be string value! You have not setted " + required_option); } } } var pluginRoot = path.join(path.dirname(fs.realpathSync(__filename)), '../'); var bExt = new BrowserExtension(pluginRoot, options, this.target, grunt); bExt.copyUserFiles(); grunt.verbose.ok('User files copied'); bExt.copyBrowserFiles(); grunt.verbose.ok('Extension files copied'); bExt.buildNsisIE(); grunt.verbose.ok('NSIS installer for IE builded'); bExt.build(); grunt.verbose.ok('Extensions builded'); } }); };
/* * grunt-browser-extension * https://github.com/addmitriev/grunt-browser-extension * * Copyright (c) 2015 Aleksey Dmitriev * Licensed under the MIT license. */ 'use strict'; var util = require('util'); var path = require('path'); var fs = require('fs-extra'); module.exports = function (grunt) { var BrowserExtension = require('./lib/browser-extension')(grunt); grunt.registerMultiTask('browser_extension', 'Grunt plugin to create any browser website extension', function () { if(this.target){ var options = this.options(); var required_options = []; for(var required_options_id in required_options){ if(required_options_id){ var required_option = required_options[required_options_id]; if(!util.isString(options[required_option])){ grunt.fail.fatal("Please set up all required options. All options must be string value! You have not setted " + required_option); } } } var pluginRoot = path.join(path.dirname(fs.realpathSync(__filename)), '../'); var bExt = new BrowserExtension(pluginRoot, options, this.target, grunt); bExt.copyUserFiles(); grunt.verbose.ok('User files copied'); bExt.copyBrowserFiles(); grunt.verbose.ok('Extension files copied'); bExt.buildNsisIE(); grunt.verbose.ok('NSIS installer for IE builded'); bExt.build(); grunt.verbose.ok('Extensions builded'); } }); };
Check config and show what required options not exists
Check config and show what required options not exists
JavaScript
mit
Tuguusl/grunt-browser-extension,Tuguusl/grunt-browser-extension
--- +++ @@ -22,7 +22,7 @@ for(var required_options_id in required_options){ if(required_options_id){ var required_option = required_options[required_options_id]; - if(!options[required_option]){ + if(!util.isString(options[required_option])){ grunt.fail.fatal("Please set up all required options. All options must be string value! You have not setted " + required_option); } }
836c37f9975c3dc41db447d7a73e8c4c888574c4
app/routes/project/posts/post.js
app/routes/project/posts/post.js
import Ember from 'ember'; export default Ember.Route.extend({ session: Ember.inject.service(), model(params) { let projectId = this.modelFor('project').id; let queryParams = { projectId: projectId, number: params.number }; let userId = this.get('session.session.authenticated.user_id'); return Ember.RSVP.hash({ post: this.store.queryRecord('post', queryParams), user: Ember.isPresent(userId) ? this.store.find('user', userId) : null }).then((result) => { return Ember.RSVP.hash({ post: result.post, comment: this.store.createRecord('comment', { post: result.post, user: result.user }), comments: this.store.query('comment', { postId: result.post.id }) }); }); }, setupController(controller, models) { controller.set('post', models.post); controller.set('newComment', models.comment); controller.set('comments', models.comments); }, actions: { saveComment(comment) { let route = this; comment.save().then(() => { // TODO: Not sure if we want to reload all comments here, or just push the new one // reloading for now route.send('reloadComments', comment); }).catch((error) => { if (error.errors.length === 1) { this.controllerFor('project.posts.post').set('error', error); } }); }, reloadComments() { let controller = this.controllerFor('project.posts.post'); let postId = controller.get('post.id'); return this.store.query('comment', { postId: postId }).then((comments) => { controller.set('comments', comments); }); } } });
import Ember from 'ember'; export default Ember.Route.extend({ session: Ember.inject.service(), model(params) { let projectId = this.modelFor('project').id; let queryParams = { projectId: projectId, number: params.number }; let userId = this.get('session.session.authenticated.user_id'); return Ember.RSVP.hash({ post: this.store.queryRecord('post', queryParams), user: Ember.isPresent(userId) ? this.store.find('user', userId) : null }).then((result) => { return Ember.RSVP.hash({ post: result.post, comment: this.store.createRecord('comment', { post: result.post, user: result.user }), comments: this.store.query('comment', { postId: result.post.id }) }); }); }, setupController(controller, models) { controller.set('post', models.post); controller.set('newComment', models.comment); controller.set('comments', models.comments); }, actions: { saveComment(comment) { let route = this; comment.save().then(() => { route.refresh(); }).catch((error) => { if (error.errors.length === 1) { this.controllerFor('project.posts.post').set('error', error); } }); } } });
Simplify behavior for comment reload
Simplify behavior for comment reload
JavaScript
mit
eablack/code-corps-ember,jderr-mx/code-corps-ember,code-corps/code-corps-ember,jderr-mx/code-corps-ember,code-corps/code-corps-ember,eablack/code-corps-ember
--- +++ @@ -34,23 +34,12 @@ saveComment(comment) { let route = this; comment.save().then(() => { - // TODO: Not sure if we want to reload all comments here, or just push the new one - // reloading for now - route.send('reloadComments', comment); + route.refresh(); }).catch((error) => { if (error.errors.length === 1) { this.controllerFor('project.posts.post').set('error', error); } }); - - }, - - reloadComments() { - let controller = this.controllerFor('project.posts.post'); - let postId = controller.get('post.id'); - return this.store.query('comment', { postId: postId }).then((comments) => { - controller.set('comments', comments); - }); } } });
f57d452412b70a051f2c183b7aa4a6688fc683bc
Brocfile.js
Brocfile.js
/* global require, module */ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp({ dotEnv: { clientAllowedKeys: ['CDN_HOST'] }, fingerprint: { prepend: 'drwikejswixhx.cloudfront.net/' } }); // Use `app.import` to add additional libraries to the generated // output files. // // If you need to use different assets in different // environments, specify an object as the first parameter. That // object's keys should be the environment name and the values // should be the asset to use in that environment. // // If the library that you are including contains AMD or ES6 // modules that you would like to import into your application // please specify an object with the list of modules as keys // along with the exports of each module as its value. module.exports = app.toTree();
/* global require, module */ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp({ dotEnv: { clientAllowedKeys: ['CDN_HOST'] }, fingerprint: { prepend: 'http://drwikejswixhx.cloudfront.net/' } }); // Use `app.import` to add additional libraries to the generated // output files. // // If you need to use different assets in different // environments, specify an object as the first parameter. That // object's keys should be the environment name and the values // should be the asset to use in that environment. // // If the library that you are including contains AMD or ES6 // modules that you would like to import into your application // please specify an object with the list of modules as keys // along with the exports of each module as its value. module.exports = app.toTree();
Add full path for CDN
Add full path for CDN
JavaScript
mit
bus-detective/web-client,bus-detective/web-client
--- +++ @@ -7,7 +7,7 @@ clientAllowedKeys: ['CDN_HOST'] }, fingerprint: { - prepend: 'drwikejswixhx.cloudfront.net/' + prepend: 'http://drwikejswixhx.cloudfront.net/' } });
1d629a166c2005cc7a06708e123c652520bcd8ed
app/main.js
app/main.js
'use strict'; (() => { const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let win = null; app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } }); // Avoid the slow performance issue when renderer window is hidden app.commandLine.appendSwitch('disable-renderer-backgrounding'); app.on('ready', () => { win = new BrowserWindow({ width: 600, height: 600 }); win.loadURL(`file://${__dirname}/index.html`); win.on('closed', () => { win = null; }); }); })();
'use strict'; (() => { const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let win = null; app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } }); // Avoid the slow performance issue when renderer window is hidden app.commandLine.appendSwitch('disable-renderer-backgrounding'); app.on('ready', () => { win = new BrowserWindow({ width: 850, height: 600 }); win.loadURL(`file://${__dirname}/index.html`); win.on('closed', () => { win = null; }); }); })();
Change default window width 600px to 850px
Change default window width 600px to 850px
JavaScript
mit
emsk/redmine-now,emsk/redmine-now,emsk/redmine-now
--- +++ @@ -17,7 +17,7 @@ app.on('ready', () => { win = new BrowserWindow({ - width: 600, + width: 850, height: 600 });
951de450da79c33bc1134e851d7a422ce5a78d15
sashimi-webapp/test/unit/specs/logic/formatter/documentFormatter.spec.js
sashimi-webapp/test/unit/specs/logic/formatter/documentFormatter.spec.js
import documentFormatter from 'src/logic/documentPackager/documentFormatter'; import base64OfSimplePdf from './reference/base64OfSimplePdf'; describe('DocumentFormatter', () => { it('should returns the same data for \'html viewMode\'', () => { const viewMode = 'html'; const inputData = '<div>This is a HTML content</div>'; const outputData = documentFormatter.format(inputData, viewMode); expect(outputData).to.equal('<div>This is a HTML content</div>'); }); it('should returns a pdfBlob for \'pages viewMode\'', (done) => { const expectedOutput = base64OfSimplePdf; const inputData = '<div>This is a HTML content</div>'; const thatPromise = documentFormatter.getPdfBlob(inputData); thatPromise.then((outputData) => { // pdfJS does not give deterministic outputData // around 5 characters will always be different in the output // therefore, an approximation method to use content length for // testing is used. expect(outputData.length).to.equal(expectedOutput.length); done(); }).catch((error) => { done(error); }); }); });
import documentFormatter from 'src/logic/documentPackager/documentFormatter'; import base64OfSimplePdf from './reference/base64OfSimplePdf'; describe('DocumentFormatter', () => { it('should returns the same data for \'html viewMode\'', () => { const viewMode = 'html'; const inputData = '<div>This is a HTML content</div>'; const outputData = documentFormatter.format(inputData, viewMode); expect(outputData).to.equal('<div>This is a HTML content</div>'); }); it('should returns a pdfBlob for \'pages viewMode\'', (done) => { const expectedOutput = base64OfSimplePdf; const inputData = '<div>This is a HTML content</div>'; const thatPromise = documentFormatter.getPdfBlob(inputData); thatPromise.then((outputData) => { // jsPDF does not give deterministic outputData // around 5 characters will always be different in the output // therefore, an approximation method to use content length for // testing is used. expect(outputData.length).to.equal(expectedOutput.length); done(); }).catch((error) => { done(error); }); }); });
Fix documentFormatter comment about jsPDF
Fix documentFormatter comment about jsPDF
JavaScript
mit
nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note
--- +++ @@ -17,7 +17,7 @@ const thatPromise = documentFormatter.getPdfBlob(inputData); thatPromise.then((outputData) => { - // pdfJS does not give deterministic outputData + // jsPDF does not give deterministic outputData // around 5 characters will always be different in the output // therefore, an approximation method to use content length for // testing is used.
dac26ebe783468a1ce6e9d44cbab5a9ff1ae3262
app/assets/javascripts/theme/cbpAnimatedHeader.js
app/assets/javascripts/theme/cbpAnimatedHeader.js
/** * cbpAnimatedHeader.js v1.0.0 * http://www.codrops.com * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Copyright 2013, Codrops * http://www.codrops.com */ var cbpAnimatedHeader = (function() { var docElem = document.documentElement, header = document.querySelector( '.navbar-default' ), didScroll = false, changeHeaderOn = 300; function init() { window.addEventListener( 'scroll', function( event ) { if( !didScroll ) { didScroll = true; setTimeout( scrollPage, 250 ); } }, false ); } function scrollPage() { var sy = scrollY(); if ( sy >= changeHeaderOn ) { classie.add( header, 'navbar-shrink' ); } else { classie.remove( header, 'navbar-shrink' ); } didScroll = false; } function scrollY() { return window.pageYOffset || docElem.scrollTop; } init(); })();
/** * cbpAnimatedHeader.js v1.0.0 * http://www.codrops.com * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Copyright 2013, Codrops * http://www.codrops.com */ var cbpAnimatedHeader = (function() { var docElem = document.documentElement, header = document.querySelector( '.navbar-default' ), didScroll = false, changeHeaderOn = 200; function init() { window.addEventListener( 'scroll', function( event ) { if( !didScroll ) { didScroll = true; setTimeout( scrollPage, 250 ); } }, false ); } function scrollPage() { var sy = scrollY(); if ( sy >= changeHeaderOn ) { classie.add( header, 'navbar-shrink' ); } else { classie.remove( header, 'navbar-shrink' ); } didScroll = false; } function scrollY() { return window.pageYOffset || docElem.scrollTop; } init(); })();
Fix bug with animation on index page
Fix bug with animation on index page
JavaScript
mit
kossgreim/ysa-activity,kossgreim/ysa-activity
--- +++ @@ -13,7 +13,7 @@ var docElem = document.documentElement, header = document.querySelector( '.navbar-default' ), didScroll = false, - changeHeaderOn = 300; + changeHeaderOn = 200; function init() { window.addEventListener( 'scroll', function( event ) {
e33324c93f33d8060903bb04dc7c422a43278842
lib/componentHelper.js
lib/componentHelper.js
var fs = require('fs'), mkdirp = require('mkdirp'), Builder = require('component-builder'), config = require('../config'), installDir = config.componentInstallDir, utils = require('./utils'), options = { dest : installDir }, component; component = !config.useMocks ? require('component') : require('../mocks/component'); exports.install = function (data, callback) { var pkg = component.install(data.repo, '*', options); pkg.on('end', callback); pkg.install(); }; exports.build = function (data, callback) { var builder = new Builder(utils.getInstallDir(data.repo)); builder.build(function (err, res) { var dirPath = utils.getBuildDir(data.repo), scriptPath = utils.getBuildScriptPath(data.repo); if (err || (res && !res.js)) { return callback(err); } mkdirp(dirPath, function (err) { if (err) { return callback(err); } fs.writeFile(scriptPath, res.js, callback); }); }); };
var fs = require('fs'), mkdirp = require('mkdirp'), rimraf = require('rimraf'), Builder = require('component-builder'), config = require('../config'), installDir = config.componentInstallDir, utils = require('./utils'), options = { dest : installDir }, component; component = !config.useMocks ? require('component') : require('../mocks/component'); exports.install = function (data, callback) { var pkg = component.install(data.repo, '*', options); pkg.on('end', callback); // Clear out install directory to get latest rimraf(utils.getInstallDir(data.repo), function () { pkg.install(); }); }; exports.build = function (data, callback) { var builder = new Builder(utils.getInstallDir(data.repo)); builder.build(function (err, res) { var dirPath = utils.getBuildDir(data.repo), scriptPath = utils.getBuildScriptPath(data.repo); if (err || (res && !res.js)) { return callback(err); } mkdirp(dirPath, function (err) { if (err) { return callback(err); } fs.writeFile(scriptPath, res.js, callback); }); }); };
Remove component installation dir when getting new
Remove component installation dir when getting new
JavaScript
mit
web-audio-components/web-audio-components-service
--- +++ @@ -1,6 +1,7 @@ var fs = require('fs'), mkdirp = require('mkdirp'), + rimraf = require('rimraf'), Builder = require('component-builder'), config = require('../config'), installDir = config.componentInstallDir, @@ -17,7 +18,11 @@ exports.install = function (data, callback) { var pkg = component.install(data.repo, '*', options); pkg.on('end', callback); - pkg.install(); + + // Clear out install directory to get latest + rimraf(utils.getInstallDir(data.repo), function () { + pkg.install(); + }); }; exports.build = function (data, callback) {
5edb856e5b0d624d794cefee42a1e7d385610e14
lib/findProjectRoot.js
lib/findProjectRoot.js
import fs from 'fs'; import path from 'path'; function findRecursive(directory) { if (directory === '/') { throw new Error('No project root found, looking for a directory with a package.json file.'); } const pathToPackageJson = path.join(directory, 'package.json'); if (fs.existsSync(pathToPackageJson)) { return directory; } return findRecursive(path.dirname(directory)); } function makeAbsolute(pathToFile) { if (pathToFile.startsWith('/')) { return pathToFile; } return path.join(process.cwd(), pathToFile); } export default function findProjectRoot(pathToFile) { return findRecursive(path.dirname(makeAbsolute(pathToFile))); }
import fs from 'fs'; import path from 'path'; function findRecursive(directory) { if (directory === '/') { throw new Error('No project root found, looking for a directory with a package.json file.'); } const pathToPackageJson = path.join(directory, 'package.json'); if (fs.existsSync(pathToPackageJson)) { return directory; } return findRecursive(path.dirname(directory)); } function makeAbsolute(pathToFile) { if (path.isAbsolute(pathToFile)) { return pathToFile; } return path.join(process.cwd(), pathToFile); } export default function findProjectRoot(pathToFile) { return findRecursive(path.dirname(makeAbsolute(pathToFile))); }
Use path.isAbsolute for Windows compatibility
Use path.isAbsolute for Windows compatibility Replaced `pathToFile.startsWith('/')` with `path.isAbsolute` Closes #397
JavaScript
mit
trotzig/import-js,trotzig/import-js,trotzig/import-js,Galooshi/import-js
--- +++ @@ -16,7 +16,7 @@ } function makeAbsolute(pathToFile) { - if (pathToFile.startsWith('/')) { + if (path.isAbsolute(pathToFile)) { return pathToFile; }
cb53120e408cb76bd991a0c4c12f4e5228a05fdc
common/models/sec-membership.js
common/models/sec-membership.js
"use strict"; const timestampMixin = require('loopback-ds-timestamp-mixin/time-stamp'); const shortid = require('shortid'); module.exports = function (SecMembership) { timestampMixin(SecMembership); SecMembership.definition.rawProperties.id.default = SecMembership.definition.properties.id.default = function () { return shortid(); }; SecMembership.validatesUniquenessOf('userId', {scopedTo: ['roleId']}); SecMembership.validatesUniquenessOf('userId', {scopedTo: ['scope', 'scopeId']}); return SecMembership; };
"use strict"; const timestampMixin = require('loopback-ds-timestamp-mixin/time-stamp'); const shortid = require('shortid'); module.exports = function (SecMembership) { timestampMixin(SecMembership); SecMembership.definition.rawProperties.id.default = SecMembership.definition.properties.id.default = function () { return shortid(); }; SecMembership.validatesUniquenessOf('userId', {scopedTo: ['scope', 'scopeId']}); return SecMembership; };
Remove unnecessary uniqueness of userId scoped to roleId for membership model
Remove unnecessary uniqueness of userId scoped to roleId for membership model
JavaScript
mit
taoyuan/nsec
--- +++ @@ -11,7 +11,6 @@ return shortid(); }; - SecMembership.validatesUniquenessOf('userId', {scopedTo: ['roleId']}); SecMembership.validatesUniquenessOf('userId', {scopedTo: ['scope', 'scopeId']}); return SecMembership;
f33326c73dd0b938bd0ac2475f9245e24aec3411
package.js
package.js
Package.describe({ summary: "Google's Material Design based Bootstrap 3 theme.", version: "0.1.0", // git: "https://github.com/FezVrasta/bootstrap-material-design.git" }); Package.onUse(function(api) { api.versionsFrom('METEOR@0.9.3'); api.use(['mizzao:bootstrap-3@3.2.0', 'jquery'], 'client'); api.addFiles([ // 'bootstrap-material-design/css-compiled/material-wfont.css', 'bootstrap-material-design/css-compiled/material.css', 'bootstrap-material-design/css-compiled/ripples.css', 'bootstrap-material-design/scripts/ripples.js', 'bootstrap-material-design/scripts/material.js', 'bootstrap-material-design/icons/icons-material-design.css', 'bootstrap-material-design/icons/fonts/Material-Design.eot', 'bootstrap-material-design/icons/fonts/Material-Design.svg', 'bootstrap-material-design/icons/fonts/Material-Design.ttf', 'bootstrap-material-design/icons/fonts/Material-Design.woff' ], 'client', {bare: true}); }); Package.onTest(function(api) { api.use('tinytest'); api.use('html5cat:bootstrap-material-design'); // api.addFiles('html5cat:bootstrap-material-design-tests.js'); });
Package.describe({ summary: "Google's Material Design based Bootstrap 3 theme.", version: "0.1.2", name: 'html5cat:bootstrap-material-design', git: 'https://github.com/html5cat/bootstrap-material-design.git' // git: "https://github.com/FezVrasta/bootstrap-material-design.git" }); Package.onUse(function(api) { api.versionsFrom('METEOR@0.9.3'); api.use(['mizzao:bootstrap-3@3.2.0', 'jquery'], 'client'); api.addFiles([ // 'bootstrap-material-design/css-compiled/material-wfont.css', 'bootstrap-material-design/css-compiled/material.css', 'bootstrap-material-design/css-compiled/ripples.css', 'bootstrap-material-design/scripts/ripples.js', 'bootstrap-material-design/scripts/material.js', 'bootstrap-material-design/icons/icons-material-design.css', 'bootstrap-material-design/icons/fonts/Material-Design.eot', 'bootstrap-material-design/icons/fonts/Material-Design.svg', 'bootstrap-material-design/icons/fonts/Material-Design.ttf', 'bootstrap-material-design/icons/fonts/Material-Design.woff' ], 'client', {bare: true}); }); Package.onTest(function(api) { api.use('tinytest'); api.use('html5cat:bootstrap-material-design'); // api.addFiles('html5cat:bootstrap-material-design-tests.js'); });
Add name and git url
Add name and git url
JavaScript
mit
html5cat/bootstrap-material-design
--- +++ @@ -1,6 +1,8 @@ Package.describe({ summary: "Google's Material Design based Bootstrap 3 theme.", - version: "0.1.0", + version: "0.1.2", + name: 'html5cat:bootstrap-material-design', + git: 'https://github.com/html5cat/bootstrap-material-design.git' // git: "https://github.com/FezVrasta/bootstrap-material-design.git" });
6fc3bd8206268bf97a078c127d3dad053ea775ff
package.js
package.js
Package.describe({ name: 'klaussner:svelte', version: '0.0.1', summary: 'Use the magical disappearing UI framework in Meteor', git: 'https://github.com/klaussner/svelte' }); Package.registerBuildPlugin({ name: 'svelte-compiler', use: ['caching-compiler@1.1.9', 'babel-compiler@6.13.0'], sources: [ 'plugin.js' ], npmDependencies: { htmlparser2: '3.9.2', 'source-map': '0.5.6', 'svelte-es5-meteor': '0.0.3' } }); Package.onUse(function (api) { api.use('isobuild:compiler-plugin@1.0.0'); api.imply('modules@0.7.7'); api.imply('ecmascript-runtime@0.3.15'); api.imply('babel-runtime@1.0.1'); api.imply('promise@0.8.8'); });
Package.describe({ name: 'klaussner:svelte', version: '0.0.1', summary: 'Use the magical disappearing UI framework in Meteor', git: 'https://github.com/klaussner/meteor-svelte.git' }); Package.registerBuildPlugin({ name: 'svelte-compiler', use: ['caching-compiler@1.1.9', 'babel-compiler@6.13.0'], sources: [ 'plugin.js' ], npmDependencies: { htmlparser2: '3.9.2', 'source-map': '0.5.6', 'svelte-es5-meteor': '0.0.3' } }); Package.onUse(function (api) { api.use('isobuild:compiler-plugin@1.0.0'); api.imply('modules@0.7.7'); api.imply('ecmascript-runtime@0.3.15'); api.imply('babel-runtime@1.0.1'); api.imply('promise@0.8.8'); });
Fix link to Git repository
Fix link to Git repository
JavaScript
mit
meteor-svelte/meteor-svelte
--- +++ @@ -2,7 +2,7 @@ name: 'klaussner:svelte', version: '0.0.1', summary: 'Use the magical disappearing UI framework in Meteor', - git: 'https://github.com/klaussner/svelte' + git: 'https://github.com/klaussner/meteor-svelte.git' }); Package.registerBuildPlugin({
f0cdce0bf9bbb2e0b9f68cb521bd91de33ec8985
lib/tempFileHandler.js
lib/tempFileHandler.js
const fs = require('fs'); const path = require('path'); const crypto = require('crypto'); const { checkAndMakeDir, getTempFilename } = require('./utilities'); module.exports = function(options, fieldname, filename) { const dir = path.normalize(options.tempFileDir || process.cwd() + '/tmp/'); const tempFilePath = path.join(dir, getTempFilename()); checkAndMakeDir({createParentPath: true}, tempFilePath); let hash = crypto.createHash('md5'); let writeStream = fs.createWriteStream(tempFilePath); let fileSize = 0; // eslint-disable-line return { dataHandler: function(data) { writeStream.write(data); hash.update(data); fileSize += data.length; if (options.debug) { return console.log( // eslint-disable-line `Uploaded ${data.length} bytes for `, fieldname, filename ); } }, getFilePath: function(){ return tempFilePath; }, getFileSize: function(){ return fileSize; }, getHash: function(){ return hash.digest('hex'); }, complete: function(){ writeStream.end(); //return empty buffer since data has been uploaded to the temporary file. return Buffer.concat([]); }, cleanup: function(){ writeStream.end(); fs.unlink(tempFilePath, function(err) { if (err) throw err; }); } }; };
const fs = require('fs'); const path = require('path'); const crypto = require('crypto'); const { checkAndMakeDir, getTempFilename } = require('./utilities'); module.exports = function(options, fieldname, filename) { const dir = path.normalize(options.tempFileDir || process.cwd() + '/tmp/'); const tempFilePath = path.join(dir, getTempFilename()); checkAndMakeDir({createParentPath: true}, tempFilePath); let hash = crypto.createHash('md5'); let writeStream = fs.createWriteStream(tempFilePath); let fileSize = 0; // eslint-disable-line return { dataHandler: function(data) { writeStream.write(data); hash.update(data); fileSize += data.length; debugLog(options, `Uploading ${fieldname} -> ${filename}, bytes: ${fileSize}`); }, getFilePath: function(){ return tempFilePath; }, getFileSize: function(){ return fileSize; }, getHash: function(){ return hash.digest('hex'); }, complete: function(){ writeStream.end(); //return empty buffer since data has been uploaded to the temporary file. return Buffer.concat([]); }, cleanup: function(){ writeStream.end(); fs.unlink(tempFilePath, function(err) { if (err) throw err; }); } }; };
Use debug log for logging.
Use debug log for logging.
JavaScript
mit
richardgirges/express-fileupload,richardgirges/express-fileupload
--- +++ @@ -21,13 +21,7 @@ writeStream.write(data); hash.update(data); fileSize += data.length; - if (options.debug) { - return console.log( // eslint-disable-line - `Uploaded ${data.length} bytes for `, - fieldname, - filename - ); - } + debugLog(options, `Uploading ${fieldname} -> ${filename}, bytes: ${fileSize}`); }, getFilePath: function(){ return tempFilePath;
853be53e6c0524f5d2130ef2ec50f893894aa3ad
lib/text-decoration.js
lib/text-decoration.js
var _ = require('lodash') var fs = require('fs') var gzip = require('gzip-size') var filesize = require('filesize') var cssstats = require('cssstats') var module = require('tachyons-text-decoration/package.json') var moduleCss = fs.readFileSync('node_modules/tachyons-text-decoration/tachyons-text-decoration.min.css', 'utf8') var moduleObj = cssstats(moduleCss) var moduleSize = filesize(moduleObj.gzipSize) var srcCSS = fs.readFileSync('./src/_text-decoration.css', 'utf8') var template = fs.readFileSync('./templates/docs/text-decoration/index.html', 'utf8') var tpl = _.template(template) var html = tpl({ moduleVersion: module.version, moduleSize: moduleSize, moduleObj: moduleObj, srcCSS: srcCSS }) fs.writeFileSync('./docs/typography/text-decoration/index.html', html)
var _ = require('lodash') var fs = require('fs') var gzip = require('gzip-size') var filesize = require('filesize') var cssstats = require('cssstats') var module = require('tachyons-text-decoration/package.json') var moduleCss = fs.readFileSync('node_modules/tachyons-text-decoration/tachyons-text-decoration.min.css', 'utf8') var moduleObj = cssstats(moduleCss) var moduleSize = filesize(moduleObj.gzipSize) var srcCSS = fs.readFileSync('./src/_text-decoration.css', 'utf8') var navDocs = fs.readFileSync('./templates/nav_docs.html', 'utf8') var template = fs.readFileSync('./templates/docs/text-decoration/index.html', 'utf8') var tpl = _.template(template) var html = tpl({ moduleVersion: module.version, moduleSize: moduleSize, moduleObj: moduleObj, srcCSS: srcCSS, navDocs: navDocs }) fs.writeFileSync('./docs/typography/text-decoration/index.html', html)
Update with reference to global nav partial
Update with reference to global nav partial
JavaScript
mit
matyikriszta/moonlit-landing-page,topherauyeung/portfolio,topherauyeung/portfolio,pietgeursen/pietgeursen.github.io,topherauyeung/portfolio,cwonrails/tachyons,getfrank/tachyons,fenderdigital/css-utilities,fenderdigital/css-utilities,tachyons-css/tachyons
--- +++ @@ -10,6 +10,8 @@ var moduleSize = filesize(moduleObj.gzipSize) var srcCSS = fs.readFileSync('./src/_text-decoration.css', 'utf8') +var navDocs = fs.readFileSync('./templates/nav_docs.html', 'utf8') + var template = fs.readFileSync('./templates/docs/text-decoration/index.html', 'utf8') var tpl = _.template(template) @@ -17,7 +19,8 @@ moduleVersion: module.version, moduleSize: moduleSize, moduleObj: moduleObj, - srcCSS: srcCSS + srcCSS: srcCSS, + navDocs: navDocs }) fs.writeFileSync('./docs/typography/text-decoration/index.html', html)
034b008f8dfd297b6d5a7ccc64839647e0caa29e
addon/array-pauser.js
addon/array-pauser.js
import Em from 'ember'; import { ArrayController } from 'ember-legacy-controllers'; const get = Em.get; const copy = Em.copy; const ArrayPauser = ArrayController.extend({ isPaused: false, buffer: Em.computed(function () { return Em.A(); }), addToBuffer: function (idx, removedCount, added) { const buffer = get(this, 'buffer'); buffer.pushObject([idx, removedCount, added]); }, clearBuffer: Em.observer('isPaused', function () { const buffer = get(this, 'buffer'); const arrangedContent = get(this, 'arrangedContent'); buffer.forEach((args) => { arrangedContent.replace(...args); }); buffer.clear(); }), arrangedContent: Em.computed('content', function () { const content = get(this, 'content'); const clone = copy(content); return clone; }), contentArrayDidChange: function (arr, idx, removedCount, addedCount) { const added = arr.slice(idx, idx + addedCount); const isPaused = get(this, 'isPaused'); let arrangedContent; if (isPaused) { this.addToBuffer(idx, removedCount, added); } else { arrangedContent = get(this, 'arrangedContent'); arrangedContent.replace(idx, removedCount, added); } }, }); export default ArrayPauser;
import Em from 'ember'; import { ArrayController } from 'ember-legacy-controllers'; const ArrayPauser = ArrayController.extend({ isPaused: false, buffer: Em.computed(function () { return Em.A(); }), addToBuffer: function (idx, removedCount, added) { const buffer = this.get('buffer'); buffer.pushObject([idx, removedCount, added]); }, clearBuffer: Em.observer('isPaused', function () { const buffer = this.get('buffer'); const arrangedContent = this.get('arrangedContent'); buffer.forEach((args) => { arrangedContent.replace(...args); }); buffer.clear(); }), arrangedContent: Em.computed('content', function () { const content = this.get('content'); const clone = Em.copy(content); return clone; }), contentArrayDidChange: function (arr, idx, removedCount, addedCount) { const added = arr.slice(idx, idx + addedCount); const isPaused = this.get('isPaused'); let arrangedContent; if (isPaused) { this.addToBuffer(idx, removedCount, added); } else { arrangedContent = this.get('arrangedContent'); arrangedContent.replace(idx, removedCount, added); } }, }); export default ArrayPauser;
Remove unnecessary aliases for Ember utils
Remove unnecessary aliases for Ember utils
JavaScript
mit
j-/ember-cli-array-pauser,j-/ember-cli-array-pauser
--- +++ @@ -1,7 +1,5 @@ import Em from 'ember'; import { ArrayController } from 'ember-legacy-controllers'; -const get = Em.get; -const copy = Em.copy; const ArrayPauser = ArrayController.extend({ isPaused: false, @@ -11,13 +9,13 @@ }), addToBuffer: function (idx, removedCount, added) { - const buffer = get(this, 'buffer'); + const buffer = this.get('buffer'); buffer.pushObject([idx, removedCount, added]); }, clearBuffer: Em.observer('isPaused', function () { - const buffer = get(this, 'buffer'); - const arrangedContent = get(this, 'arrangedContent'); + const buffer = this.get('buffer'); + const arrangedContent = this.get('arrangedContent'); buffer.forEach((args) => { arrangedContent.replace(...args); }); @@ -25,20 +23,20 @@ }), arrangedContent: Em.computed('content', function () { - const content = get(this, 'content'); - const clone = copy(content); + const content = this.get('content'); + const clone = Em.copy(content); return clone; }), contentArrayDidChange: function (arr, idx, removedCount, addedCount) { const added = arr.slice(idx, idx + addedCount); - const isPaused = get(this, 'isPaused'); + const isPaused = this.get('isPaused'); let arrangedContent; if (isPaused) { this.addToBuffer(idx, removedCount, added); } else { - arrangedContent = get(this, 'arrangedContent'); + arrangedContent = this.get('arrangedContent'); arrangedContent.replace(idx, removedCount, added); } },
1479e514d857ca8dab0bccbe0ef52999e397a330
app/assets/javascripts/modules/moj.wordcount.js
app/assets/javascripts/modules/moj.wordcount.js
/* global jQuery */ jQuery(function ($){ 'use strict'; var $limitedTextAreas = $('textarea[data-limit]'); if( $limitedTextAreas.length > 0 ){ $limitedTextAreas.each(function (i, o){ var updateCounter = function (){ var charsLeft = limit - $textarea.val().length; if( charsLeft > 0 ){ $counterBox.removeClass('error'); $counter.html( '(' + charsLeft + ' remaining)'); }else { $counterBox.addClass('error'); $counter.html('(' + (charsLeft * -1) + ' extra)'); } }; var $textarea = $(o); var limit = $textarea.data('limit'); var $counterBox = $( '<p class="textarea-word-count form-hint">' + 'Maximum ' + limit + ' characters, including spaces. ' + '<span class="chars-remaining">(' + limit + ' remaining)</span>' + '<p/>' ); var $counter = $counterBox.find('.chars-remaining'); $textarea.after($counterBox); updateCounter(); $textarea.keyup(updateCounter); }); } });
/* global jQuery */ jQuery(function ($){ 'use strict'; var $limitedTextAreas = $('textarea[data-limit]'); if( $limitedTextAreas.length > 0 ){ $limitedTextAreas.each(function (i, o){ var updateCounter = function (){ var charsLeft = limit - $textarea.val().length; if( charsLeft > 0 ){ $counterBox.removeClass('error'); $counter.html( '(' + charsLeft + ' remaining)'); }else { $counterBox.addClass('error'); $counter.html('(' + (charsLeft * -1) + ' extra)'); } }; var $textarea = $(o); var limit = $textarea.data('limit'); var $counterBox = $( '<p class="textarea-word-count form-hint">' + 'Maximum ' + limit + ' characters, including spaces and new lines. ' + '<span class="chars-remaining">(' + limit + ' remaining)</span>' + '<p/>' ); var $counter = $counterBox.find('.chars-remaining'); $textarea.after($counterBox); updateCounter(); $textarea.keyup(updateCounter); }); } });
Add copy to word count that it includes new lines
Add copy to word count that it includes new lines
JavaScript
mit
ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder
--- +++ @@ -21,7 +21,7 @@ var limit = $textarea.data('limit'); var $counterBox = $( '<p class="textarea-word-count form-hint">' + - 'Maximum ' + limit + ' characters, including spaces. ' + + 'Maximum ' + limit + ' characters, including spaces and new lines. ' + '<span class="chars-remaining">(' + limit + ' remaining)</span>' + '<p/>' );
7de83d749393913835cc6b537bf44596771f3bb6
backend/app/assets/javascripts/spree/backend/components/sortable_table.js
backend/app/assets/javascripts/spree/backend/components/sortable_table.js
//= require solidus_admin/Sortable Spree.ready(function() { var sortable_tables = document.querySelectorAll('table.sortable'); _.each(sortable_tables, function(table) { var url = table.getAttribute('data-sortable-link'); var tbody = table.querySelector('tbody'); var sortable = Sortable.create(tbody,{ handle: ".handle", onEnd: function(e) { var positions = {}; _.each(e.to.querySelectorAll('tr'), function(el, index) { var idAttr = el.id; if (idAttr) { var objId = idAttr.split('_').slice(-1); positions['positions['+objId+']'] = index + 1; } }); Spree.ajax({ type: 'POST', dataType: 'script', url: url, data: positions, }); } }); }); });
//= require solidus_admin/Sortable Spree.ready(function() { var sortable_tables = document.querySelectorAll('table.sortable'); _.each(sortable_tables, function(table) { var url = table.getAttribute('data-sortable-link'); var tbody = table.querySelector('tbody'); var sortable = Sortable.create(tbody,{ handle: ".handle", onEnd: function(e) { var positions = {}; _.each(e.to.querySelectorAll('tr'), function(el, index) { var idAttr = el.id; if (idAttr) { var objId = idAttr.split('_').slice(-1); positions['positions['+objId+']'] = index + 1; } }); Spree.ajax({ type: 'POST', dataType: 'json', url: url, data: positions, }); } }); }); });
Use dataType: json for sortable tables
Use dataType: json for sortable tables
JavaScript
bsd-3-clause
pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus
--- +++ @@ -19,7 +19,7 @@ }); Spree.ajax({ type: 'POST', - dataType: 'script', + dataType: 'json', url: url, data: positions, });
e404e0799273c743bf671997bf525e67239abb7e
app/assets/javascripts/voluntary/application.js
app/assets/javascripts/voluntary/application.js
//= require jquery //= require jquery_ujs //= require twitter/bootstrap //= require jquery-ui-bootstrap //= require jquery.tokeninput //= require_tree .
//= require jquery //= require jquery_ujs //= require jquery-ui-bootstrap //= require twitter/bootstrap //= require jquery.tokeninput //= require_tree .
Load jquery before twitter bootstrap.
Load jquery before twitter bootstrap.
JavaScript
mit
volontariat/voluntary,jasnow/voluntary,jasnow/voluntary,jasnow/voluntary,volontariat/voluntary,volontariat/voluntary,jasnow/voluntary,volontariat/voluntary
--- +++ @@ -1,6 +1,6 @@ //= require jquery //= require jquery_ujs +//= require jquery-ui-bootstrap //= require twitter/bootstrap -//= require jquery-ui-bootstrap //= require jquery.tokeninput //= require_tree .
926adb00a1d7ec21a9cc2b798560d4cd4961b1f8
src/Parser/VengeanceDemonHunter/CONFIG.js
src/Parser/VengeanceDemonHunter/CONFIG.js
import SPECS from 'common/SPECS'; import CombatLogParser from './CombatLogParser'; import TALENT_DESCRIPTIONS from './TALENT_DESCRIPTIONS'; export default { spec: SPECS.VENGEANCE_DEMON_HUNTER, maintainer: '@mamtooth', parser: CombatLogParser, talentDescriptions: TALENT_DESCRIPTIONS, };
import SPECS from 'common/SPECS'; import CombatLogParser from './CombatLogParser'; import TALENT_DESCRIPTIONS from './TALENT_DESCRIPTIONS'; export default { spec: SPECS.VENGEANCE_DEMON_HUNTER, maintainer: '@Mamtooth', parser: CombatLogParser, talentDescriptions: TALENT_DESCRIPTIONS, };
Update contributor discord name (last time)
Update contributor discord name (last time)
JavaScript
agpl-3.0
Juko8/WoWAnalyzer,enragednuke/WoWAnalyzer,anom0ly/WoWAnalyzer,yajinni/WoWAnalyzer,hasseboulen/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,enragednuke/WoWAnalyzer,enragednuke/WoWAnalyzer,Yuyz0112/WoWAnalyzer,sMteX/WoWAnalyzer,yajinni/WoWAnalyzer,FaideWW/WoWAnalyzer,fyruna/WoWAnalyzer,FaideWW/WoWAnalyzer,fyruna/WoWAnalyzer,hasseboulen/WoWAnalyzer,Yuyz0112/WoWAnalyzer,ronaldpereira/WoWAnalyzer,ronaldpereira/WoWAnalyzer,anom0ly/WoWAnalyzer,mwwscott0/WoWAnalyzer,anom0ly/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,FaideWW/WoWAnalyzer,sMteX/WoWAnalyzer,yajinni/WoWAnalyzer,mwwscott0/WoWAnalyzer,Juko8/WoWAnalyzer,fyruna/WoWAnalyzer,hasseboulen/WoWAnalyzer,ronaldpereira/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,Juko8/WoWAnalyzer,yajinni/WoWAnalyzer,sMteX/WoWAnalyzer,anom0ly/WoWAnalyzer
--- +++ @@ -5,7 +5,7 @@ export default { spec: SPECS.VENGEANCE_DEMON_HUNTER, - maintainer: '@mamtooth', + maintainer: '@Mamtooth', parser: CombatLogParser, talentDescriptions: TALENT_DESCRIPTIONS, };
ddd91b0e388fc87f732a94a9bd7a5aa084f4c86d
tests/tests.js
tests/tests.js
/** PSPDFKit Copyright (c) 2015-2016 PSPDFKit GmbH. All rights reserved. THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT. UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. This notice may not be removed from this file. */ exports.defineAutoTests = function () { describe('PSPSDFKit (window.PSPDFKit)', function () { it("should exist", function () { expect(window.PSPDFKit).toBeDefined(); }); describe('showDocument', function() { it('should exist', function () { expect(window.PSPDFKit.showDocument).toBeDefined(); }); }); describe('showDocumentFromAssets', function() { it('should exist', function () { expect(window.PSPDFKit.showDocumentFromAssets).toBeDefined(); }); it('should open a document from assets', function(done) { window.PSPDFKit.showDocumentFromAssets("www/Guide.pdf", function() { done(); }, function(error) { done(error); }); }) }); }); };
/** PSPDFKit Copyright (c) 2015-2016 PSPDFKit GmbH. All rights reserved. THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT. UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. This notice may not be removed from this file. */ exports.defineAutoTests = function () { describe('PSPSDFKit (window.PSPDFKit)', function () { it("should exist", function () { expect(window.PSPDFKit).toBeDefined(); }); describe('showDocument', function() { it('should exist', function () { expect(window.PSPDFKit.showDocument).toBeDefined(); }); }); describe('showDocumentFromAssets', function() { it('should exist', function () { expect(window.PSPDFKit.showDocumentFromAssets).toBeDefined(); }); }); }); }; exports.defineManualTests = function(contentEl, createActionButton) { createActionButton('Open Document', function() { var asset = 'www/Guide.pdf'; console.log('Opening document ' + asset); window.PSPDFKit.showDocumentFromAssets(asset, {}, function() { console.log("Document was successfully loaded."); }, function(error) { console.log('Error while loading the document:' + error) }); }); };
Add manual document launch test
Test: Add manual document launch test
JavaScript
mit
PSPDFKit/Cordova-Android,PSPDFKit/Cordova-Android
--- +++ @@ -25,15 +25,20 @@ it('should exist', function () { expect(window.PSPDFKit.showDocumentFromAssets).toBeDefined(); }); - - it('should open a document from assets', function(done) { - window.PSPDFKit.showDocumentFromAssets("www/Guide.pdf", function() { - done(); - }, function(error) { - done(error); - }); - }) }); - }); }; + +exports.defineManualTests = function(contentEl, createActionButton) { + + createActionButton('Open Document', function() { + var asset = 'www/Guide.pdf'; + + console.log('Opening document ' + asset); + window.PSPDFKit.showDocumentFromAssets(asset, {}, function() { + console.log("Document was successfully loaded."); + }, function(error) { + console.log('Error while loading the document:' + error) + }); + }); +};
7842bc06a6a2199566cc43bc70c377e987ed77cc
packages/custom/icu/public/components/profile-page/profile-page.js
packages/custom/icu/public/components/profile-page/profile-page.js
'use strict'; angular.module('mean.icu.ui.profile', []) .controller('ProfileController', function($scope, $state, me, UsersService) { $scope.me = me; $scope.avatar = $scope.me.profile.avatar || 'http://placehold.it/250x250'; $scope.hash = new Date().getTime(); $scope.uploadAvatar = function(files) { if (files) { var file = files[0]; UsersService.updateAvatar(file).success(function(data) { $scope.me.profile.avatar = data.avatar; $state.reload(); }); } }; $scope.editProfile = function(form) { if ($scope.confirm !== $scope.me.password) { return; } UsersService.update($scope.me).then(function() { $state.reload(); }); }; });
'use strict'; angular.module('mean.icu.ui.profile', []) .controller('ProfileController', function($scope, $state, me, UsersService) { $scope.me = me; if (!$scope.me.profile) { $scope.me.profile = {}; } $scope.avatar = $scope.me.profile.avatar || 'http://placehold.it/250x250'; $scope.hash = new Date().getTime(); $scope.uploadAvatar = function(files) { if (files) { var file = files[0]; UsersService.updateAvatar(file).success(function(data) { $scope.me.profile.avatar = data.avatar; $state.reload(); }); } }; $scope.editProfile = function(form) { if ($scope.confirm !== $scope.me.password) { return; } UsersService.update($scope.me).then(function() { $state.reload(); }); }; });
Fix error when profile is not present
Fix error when profile is not present
JavaScript
mit
hamdiceylan/icu,linnovate/icu,linnovate/icu,linnovate/icu,hamdiceylan/icu
--- +++ @@ -3,6 +3,11 @@ angular.module('mean.icu.ui.profile', []) .controller('ProfileController', function($scope, $state, me, UsersService) { $scope.me = me; + + if (!$scope.me.profile) { + $scope.me.profile = {}; + } + $scope.avatar = $scope.me.profile.avatar || 'http://placehold.it/250x250'; $scope.hash = new Date().getTime();
9975e1d92da690ced12402cb51ed04f4cad2d54e
server.js
server.js
'use strict'; const express = require('express'), sassMiddleware = require('node-sass-middleware'), webpack = require('webpack'), webpackMiddleware = require('webpack-dev-middleware'), path = require('path'), app = express(), default_port = (process.env.PORT || 3000); app.use(sassMiddleware({ src: path.join(__dirname, 'sass'), dest: path.join(__dirname, 'dist'), debug: true, outputStyle: 'nested' })); app.use(webpackMiddleware(webpack(require('./webpack.config')), { noInfo: false, quiet: false, lazy: true, publicPath: "/", stats: { colors: true } })); app.use(express.static(path.join(__dirname, 'dist'))); app.use(require('connect-livereload')()); // runs livereload server and serves livereload.js require('express-livereload')(app, { watchDir: path.join(__dirname) }); // inserts <script> reference to livereload.js app.use('/', express.static(path.join(__dirname, 'views'))); let server = app.listen(default_port, function () { let port = server.address().port; console.log('Listening on port ' + port); });
'use strict'; const express = require('express'), sassMiddleware = require('node-sass-middleware'), webpack = require('webpack'), webpackMiddleware = require('webpack-dev-middleware'), path = require('path'), app = express(), default_port = (process.env.PORT || 3000); app.use(sassMiddleware({ src: path.join(__dirname, 'sass'), dest: path.join(__dirname, 'dist'), debug: true, outputStyle: 'nested', sourceMap: path.join(__dirname, 'dist', 'bundle.css.map') })); app.use(webpackMiddleware(webpack(require('./webpack.config')), { noInfo: false, quiet: false, lazy: true, publicPath: "/", stats: { colors: true } })); app.use(express.static(path.join(__dirname, 'dist'))); app.use(require('connect-livereload')()); // runs livereload server and serves livereload.js require('express-livereload')(app, { watchDir: path.join(__dirname) }); // inserts <script> reference to livereload.js app.use('/', express.static(path.join(__dirname, 'views'))); let server = app.listen(default_port, function () { let port = server.address().port; console.log('Listening on port ' + port); });
Add sourceMap in node-sass-middleware for dev
Add sourceMap in node-sass-middleware for dev
JavaScript
mit
AusDTO/citizenship-appointment-client,AusDTO/citizenship-appointment-client,AusDTO/citizenship-appointment-client
--- +++ @@ -12,7 +12,8 @@ src: path.join(__dirname, 'sass'), dest: path.join(__dirname, 'dist'), debug: true, - outputStyle: 'nested' + outputStyle: 'nested', + sourceMap: path.join(__dirname, 'dist', 'bundle.css.map') })); app.use(webpackMiddleware(webpack(require('./webpack.config')), {
e0c9aa962132838ef04566fa5ab3f61862e6cea0
server.js
server.js
var http = require('http'); var express = require('express'); var app = express(); app.set('view engine', 'ejs'); // Setup the index page view app.get('/', function(req, res) { res.render('pages/index'); }); app.listen(8080); /* * Returns a fomatted date as a String in brackets, for logging purposes */ function getFormattedDate() { return "[" + new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') + "] "; } /* * Overloads the logging function */ console.log = console.error = function(message) { log_file.write(util.format(message) + '\n'); log_stdout.write(util.format(message) + '\n'); };
var http = require('http'); var express = require('express'); var app = express(); app.set('view engine', 'ejs'); // Setup the index page view app.get('/', function(req, res) { res.render('pages/index'); // Defines error handling app.use(function(req, res, next) { res.status(404); // Respond with HTML page if (req.accepts('html')) { res.render('404', { url: req.url }); return; } // Respond with JSON if (req.accepts('json')) { res.send({ error: 'Not found' }); return; } // Default to plain-text res.type('txt').send('Not found'); }); // Bind the server process on the port var server = app.listen(port, function() { console.log("Server successfully started!"); }); }); /* * Returns a fomatted date as a String in brackets, for logging purposes */ function getFormattedDate() { return "[" + new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') + "] "; } /* * Overloads the logging function */ console.log = console.error = function(message) { log_file.write(util.format(message) + '\n'); log_stdout.write(util.format(message) + '\n'); };
Define 404 error handling functions
Define 404 error handling functions
JavaScript
mit
jamestaylr/portfolio-website,jamestaylr/portfolio-website
--- +++ @@ -7,9 +7,36 @@ // Setup the index page view app.get('/', function(req, res) { res.render('pages/index'); + // Defines error handling + app.use(function(req, res, next) { + res.status(404); + + // Respond with HTML page + if (req.accepts('html')) { + res.render('404', { + url: req.url + }); + return; + } + + // Respond with JSON + if (req.accepts('json')) { + res.send({ + error: 'Not found' + }); + return; + } + + // Default to plain-text + res.type('txt').send('Not found'); + }); + + // Bind the server process on the port + var server = app.listen(port, function() { + console.log("Server successfully started!"); + }); }); -app.listen(8080); /* * Returns a fomatted date as a String in brackets, for logging purposes */
5edecd0734bf8cebc0ca81ef7b0bd660edc40b27
server.js
server.js
var express = require('express'), OpenedCaptions = require('opened-captions'); // Make the server var app = express(); var server = require('http').Server(app); var io = require('socket.io')(server); // Serve static content from "public" directory app.use(express.static(__dirname + '/public')); server.listen(8080); var oc = new OpenedCaptions({ io: io }); oc.addStream('server', { host: 'https://openedcaptions.com', port: 443, description: "CSPAN" });
var express = require('express'), OpenedCaptions = require('opened-captions'); // Make the server var app = express(); var server = require('http').Server(app); var io = require('socket.io')(server); // Serve static content from "public" directory app.use(express.static(__dirname + '/public')); server.listen(8080); var oc = new OpenedCaptions({ io: io }); oc.addStream('server', { host: 'http://openedcaptions.media.mit.edu', port: 8080, description: "C-SPAN" });
Use HTTP stream rather than HTTPS
Use HTTP stream rather than HTTPS
JavaScript
mit
slifty/opened-captions-example,slifty/opened-captions-example
--- +++ @@ -16,7 +16,7 @@ }); oc.addStream('server', { - host: 'https://openedcaptions.com', - port: 443, - description: "CSPAN" + host: 'http://openedcaptions.media.mit.edu', + port: 8080, + description: "C-SPAN" });
a3e6a580d964a134d885e6ec5bbf298507ae489d
app/modules/login/index.js
app/modules/login/index.js
import angular from 'angular'; import uiRouter from 'angular-ui-router'; import view from './view'; //==================================================================== export default angular.module('xoWebApp.login', [ uiRouter, ]) .config(function ($stateProvider) { $stateProvider.state('login', { url: '/login', controller: 'LoginCtrl', template: view, }); }) .controller('LoginCtrl', function($scope, $state, $rootScope, xoApi) { var toState, toStateParams; { let state = $rootScope._login; if (state && (state = state.state)) { toState = state.name; toStateParams = state.stateParams; delete $rootScope._login; } else { toState = 'index'; } } $scope.$watch(() => xoApi.user, function (user) { // When the user is logged in, go the wanted view, fallbacks on // the index view if necessary. if (user) { $state.go(toState, toStateParams).catch(function () { $state.go('index'); }); } }); Object.defineProperties($scope, { user: { get() { return xoApi.user; }, }, status: { get() { return xoApi.status; } }, }); $scope.logIn = xoApi.logIn; }) // A module exports its name. .name ;
import angular from 'angular'; import uiRouter from 'angular-ui-router'; import view from './view'; //==================================================================== export default angular.module('xoWebApp.login', [ uiRouter, ]) .config(function ($stateProvider) { $stateProvider.state('login', { url: '/login', controller: 'LoginCtrl', template: view, }); }) .controller('LoginCtrl', function($scope, $state, $rootScope, xoApi) { var toState, toStateParams; { let tmp = $rootScope._login; if (tmp) { toState = tmp.state.name; toStateParams = tmp.stateParams; delete $rootScope._login; } else { toState = 'index'; } } $scope.$watch(() => xoApi.user, function (user) { // When the user is logged in, go the wanted view, fallbacks on // the index view if necessary. if (user) { $state.go(toState, toStateParams).catch(function () { $state.go('index'); }); } }); Object.defineProperties($scope, { user: { get() { return xoApi.user; }, }, status: { get() { return xoApi.status; } }, }); $scope.logIn = xoApi.logIn; }) // A module exports its name. .name ;
Fix incorrect redirection after log in.
Fix incorrect redirection after log in.
JavaScript
agpl-3.0
vatesfr/xo-web,LamaDelRay/xo-web,LamaDelRay/xo-web,vatesfr/xo-web,borestad/xo-web,lmcro/xo-web,fbeauchamp/xo-web,fbeauchamp/xo-web,lmcro/xo-web,lmcro/xo-web,borestad/xo-web
--- +++ @@ -18,10 +18,10 @@ .controller('LoginCtrl', function($scope, $state, $rootScope, xoApi) { var toState, toStateParams; { - let state = $rootScope._login; - if (state && (state = state.state)) { - toState = state.name; - toStateParams = state.stateParams; + let tmp = $rootScope._login; + if (tmp) { + toState = tmp.state.name; + toStateParams = tmp.stateParams; delete $rootScope._login; } else { toState = 'index';
4efe6aee4943ff785496e4fe2a8078b746d629e0
app/widgets/Rooms/rooms.js
app/widgets/Rooms/rooms.js
var Rooms = { anonymous_room: false, refresh: function() { var items = document.querySelectorAll('#rooms_widget ul li:not(.subheader)'); var i = 0; while(i < items.length) { if(items[i].dataset.jid != null) { items[i].onclick = function(e) { Chats.refresh(); Chat_ajaxGetRoom(this.dataset.jid); MovimUtils.removeClassInList('active', items); MovimUtils.addClass(this, 'active'); } } MovimUtils.removeClass(items[i], 'active'); i++; } }, /** * @brief Connect to an anonymous server * @param The jid to remember */ anonymousInit : function() { MovimWebsocket.register(function() { form = document.querySelector('form[name="loginanonymous"]'); form.onsubmit = function(e) { e.preventDefault(); // We login LoginAnonymous_ajaxLogin(this.querySelector('input#nick').value); } }); }, /** * @brief Join an anonymous room * @param The jid to remember */ anonymousJoin : function() { // We display the room Chat_ajaxGetRoom(Rooms.anonymous_room); // And finally we join Rooms_ajaxExit(Rooms.anonymous_room); Rooms_ajaxJoin(Rooms.anonymous_room); } } MovimWebsocket.attach(function() { Rooms.refresh(); Rooms.anonymousInit(); Rooms_ajaxDisplay(); });
var Rooms = { anonymous_room: false, refresh: function() { var items = document.querySelectorAll('#rooms_widget ul li:not(.subheader)'); var i = 0; while(i < items.length) { if(items[i].dataset.jid != null) { items[i].onclick = function(e) { Chats.refresh(); Chat_ajaxGetRoom(this.dataset.jid); MovimUtils.removeClassInList('active', items); MovimUtils.addClass(this, 'active'); } } MovimUtils.removeClass(items[i], 'active'); i++; } Notification_ajaxGet(); }, /** * @brief Connect to an anonymous server * @param The jid to remember */ anonymousInit : function() { MovimWebsocket.register(function() { form = document.querySelector('form[name="loginanonymous"]'); form.onsubmit = function(e) { e.preventDefault(); // We login LoginAnonymous_ajaxLogin(this.querySelector('input#nick').value); } }); }, /** * @brief Join an anonymous room * @param The jid to remember */ anonymousJoin : function() { // We display the room Chat_ajaxGetRoom(Rooms.anonymous_room); // And finally we join Rooms_ajaxExit(Rooms.anonymous_room); Rooms_ajaxJoin(Rooms.anonymous_room); } } MovimWebsocket.attach(function() { Rooms.anonymousInit(); Rooms_ajaxDisplay(); });
Fix missing notifications in Rooms
Fix missing notifications in Rooms
JavaScript
agpl-3.0
edhelas/movim,Ppjet6/movim,edhelas/movim,Ppjet6/movim,movim/movim,Ppjet6/movim,movim/movim,movim/movim,edhelas/movim,edhelas/movim
--- +++ @@ -20,6 +20,8 @@ i++; } + + Notification_ajaxGet(); }, /** @@ -52,7 +54,6 @@ } MovimWebsocket.attach(function() { - Rooms.refresh(); Rooms.anonymousInit(); Rooms_ajaxDisplay(); });
404c1d932e022b077da796c873764d8716a71e88
testem.js
testem.js
module.exports = { test_page: 'tests/index.html?hidepassed', disable_watching: true, launch_in_ci: [ 'Chrome' ], launch_in_dev: [ 'Chrome' ], browser_args: { Chrome: { ci: [ // --no-sandbox is needed when running Chrome inside a container process.env.CI ? '--no-sandbox' : null, '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--disable-software-rasterizer', '--mute-audio', '--remote-debugging-port=0', '--window-size=1440,900' ].filter(Boolean) } } };
module.exports = { test_page: 'tests/index.html?hidepassed', disable_watching: true, launch_in_ci: [ 'Chrome' ], launch_in_dev: [ 'Chrome' ], browser_args: { Chrome: { ci: [ // --no-sandbox is needed when running Chrome inside a container process.env.CI ? '--no-sandbox' : null, '--headless', '--disable-dev-shm-usage', '--disable-software-rasterizer', '--mute-audio', '--remote-debugging-port=0', '--window-size=1440,900' ].filter(Boolean) } } };
Remove --disable-gpu flag when starting headless chrome
Remove --disable-gpu flag when starting headless chrome The `--disable-gpu` flag is [no longer necessary](https://bugs.chromium.org/p/chromium/issues/detail?id=737678) and, at least in some cases, is [causing issues](https://bugs.chromium.org/p/chromium/issues/detail?id=982977). This flag has already been [removed from ember-cli's blueprints](https://github.com/ember-cli/ember-cli/pull/8774) As you may already know, this project's test suite is run as part of [Ember Data](https://github.com/emberjs/data)'s test suite to help catch regressions. The flag has already been [removed from Ember Data's own testem config](https://github.com/emberjs/data/pull/6298) but Ember Data's complete test suite cannot successfully run until all of our external integration partners have also removed this flag.
JavaScript
mit
lytics/ember-data-model-fragments,lytics/ember-data-model-fragments,lytics/ember-data.model-fragments
--- +++ @@ -13,7 +13,6 @@ // --no-sandbox is needed when running Chrome inside a container process.env.CI ? '--no-sandbox' : null, '--headless', - '--disable-gpu', '--disable-dev-shm-usage', '--disable-software-rasterizer', '--mute-audio',
78de692471579b9722f066d469ad87f910ab1da4
testem.js
testem.js
/* eslint-disable */ module.exports = { "framework": "qunit", "test_page": "tests/index.html?hidepassed", "disable_watching": true, "launch_in_ci": [ "Chrome" ], "launch_in_dev": [ "Chrome" ] };
/* eslint-disable */ module.exports = { "framework": "qunit", "test_page": "tests/index.html?hidepassed&nocontainer", "disable_watching": true, "launch_in_ci": [ "Chrome" ], "launch_in_dev": [ "Chrome" ] };
Hide container by default when running tests
Hide container by default when running tests
JavaScript
mit
ember-cli/ember-ajax,ember-cli/ember-ajax,ember-cli/ember-ajax
--- +++ @@ -2,7 +2,7 @@ module.exports = { "framework": "qunit", - "test_page": "tests/index.html?hidepassed", + "test_page": "tests/index.html?hidepassed&nocontainer", "disable_watching": true, "launch_in_ci": [ "Chrome"
f394e601e69aef805f95a3d55faa2d7755dcfb39
src/js/constants/TaskTableHeaderLabels.js
src/js/constants/TaskTableHeaderLabels.js
var TaskTableHeaderLabels = { cpus: 'CPU', disk: 'DISK', host: 'HOST', mem: 'MEM', id: 'TASK NAME', name: 'TASK NAME', status: 'STATUS', updated: 'UPDATED', version: 'VERSION' }; module.exports = TaskTableHeaderLabels;
var TaskTableHeaderLabels = { cpus: 'CPU', disk: 'DISK', host: 'HOST', mem: 'MEM', id: 'TASK ID', name: 'TASK NAME', status: 'STATUS', updated: 'UPDATED', version: 'VERSION' }; module.exports = TaskTableHeaderLabels;
Correct heading for task table ID column
Correct heading for task table ID column
JavaScript
apache-2.0
dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui
--- +++ @@ -3,7 +3,7 @@ disk: 'DISK', host: 'HOST', mem: 'MEM', - id: 'TASK NAME', + id: 'TASK ID', name: 'TASK NAME', status: 'STATUS', updated: 'UPDATED',
afeb6bed38bc1c31b1f95914056b972efb3ec56f
src/index.js
src/index.js
// We load the Safari fix before document-register-element because DRE // overrides attachShadow() and calls back the one it finds on HTMLElement. import './fix/safari'; import 'document-register-element'; import '@webcomponents/shadydom'; import '@webcomponents/shadycss';
// We load the Safari fix before document-register-element because DRE // overrides attachShadow() and calls back the one it finds on HTMLElement. import './fix/safari'; import 'document-register-element'; import '@webcomponents/shadycss'; import '@webcomponents/shadydom';
Revert "fix: You have to include shadydom before shadycss else shadycss will not work."
Revert "fix: You have to include shadydom before shadycss else shadycss will not work." This reverts commit 831a3a7ffbc6b53c5766ac1564dc3f95c5b74ef0.
JavaScript
mit
skatejs/web-components
--- +++ @@ -2,5 +2,5 @@ // overrides attachShadow() and calls back the one it finds on HTMLElement. import './fix/safari'; import 'document-register-element'; +import '@webcomponents/shadycss'; import '@webcomponents/shadydom'; -import '@webcomponents/shadycss';
2977c20bac8717b39a325436d7381ca9d5a37b00
src/index.js
src/index.js
import {inspect} from "util"; import {getProperties, isImmutable, isNumeric} from "./helpers"; // LENS ============================================================================================ function createGetter(key) { return function getter(data) { if (key) { if (isImmutable(data)) { throw new Error(`can't get key ${inspect(key)} from immutable data ${inspect(data)}`); } else { if (data.meta.kind == "dict") { return data.meta.codomain; } else if (data.meta.kind == "struct") { return data.meta.props[key]; } else if (data.meta.kind == "list") { return data.meta.type; } else { // TODO possible situation?! return data[key]; } } } else { return data; } }; } function createLens(getter) { return { get: getter, compose(nextLens) { return createLens( (data) => nextLens.get(getter(data)) ); } }; } export default function Lens(key) { if (typeof key != "string") { throw new Error(`key must be of string type, got ${typeof key}`); } let lens = key.split(".").map(k => createLens(createGetter(k))); return lens.reduce((lens, nextLens) => lens.compose(nextLens)); }
import {inspect} from "util"; import {getProperties, isImmutable, isNumeric} from "./helpers"; // LENS ============================================================================================ function createGetter(key) { return function getter(data) { if (key) { if (isImmutable(data)) { throw new Error(`can't get key ${inspect(key)} from immutable data ${inspect(data)}`); } else { if (data.meta && data.meta.kind == "dict") { return data.meta.codomain; } else if (data.meta && data.meta.kind == "struct") { return data.meta.props[key]; } else if (data.meta && data.meta.kind == "list") { return data.meta.type; } else { return data[key]; } } } else { return data; } }; } function createLens(getter) { return { get: getter, compose(nextLens) { return createLens( (data) => nextLens.get(getter(data)) ); } }; } export default function Lens(key) { if (typeof key != "string") { throw new Error(`key must be of string type, got ${typeof key}`); } let lens = key.split(".").map(k => createLens(createGetter(k))); return lens.reduce((lens, nextLens) => lens.compose(nextLens)); }
Support native objects in getter
Support native objects in getter
JavaScript
mit
Paqmind/tcomb-lens,Paqmind/tcomb-lens
--- +++ @@ -8,14 +8,13 @@ if (isImmutable(data)) { throw new Error(`can't get key ${inspect(key)} from immutable data ${inspect(data)}`); } else { - if (data.meta.kind == "dict") { + if (data.meta && data.meta.kind == "dict") { return data.meta.codomain; - } else if (data.meta.kind == "struct") { + } else if (data.meta && data.meta.kind == "struct") { return data.meta.props[key]; - } else if (data.meta.kind == "list") { + } else if (data.meta && data.meta.kind == "list") { return data.meta.type; } else { - // TODO possible situation?! return data[key]; } }
2b486327b43390946af416759a05213f19a4a912
src/index.js
src/index.js
import chain from './chain'; import {clone} from './utils'; function vq(el, props, opts = null) { if (!el || !props) throw new Error('Must have two or three args'); if (!opts) { if (!('p' in props && 'o' in props)) { throw new Error('2nd arg must have `p` and `o` property when only two args is given'); } opts = props.o; props = props.p; } // use `props` as progress callback if it is a function if (typeof props === 'function') { opts.progress = props; props = { tween: [1, 0] }; } // Avoid changing original props and opts // vq may mutate these values internally props = clone(props); opts = clone(opts); return chain(el, props, opts); } vq.sequence = function sequence(seq) { const head = seq[0]; const tail = seq.slice(1); if (typeof head !== 'function') return; if (head.length > 0) { // Ensure there is a callback function as 1st argument return head(function() { sequence(tail); }); } const res = head(); // Wait until the head function is terminated if the returned value is thenable if (res && typeof res.then === 'function') { return res.then(() => sequence(tail)); } return sequence(tail); }; module.exports = vq;
import chain from './chain'; import {clone} from './utils'; function vq(el, props, opts = null) { if (!el || !props) throw new Error('Must have two or three args'); if (!opts) { if (!('p' in props && 'o' in props)) { throw new Error('2nd arg must have `p` and `o` property when only two args is given'); } opts = props.o; props = props.p; } // use `props` as progress callback if it is a function if (typeof props === 'function') { opts.progress = props; props = { tween: [1, 0] }; } // Avoid changing original props and opts // vq may mutate these values internally props = clone(props); opts = clone(opts); return chain(el, props, opts); } vq.sequence = function sequence(seq) { if (seq.length === 0) return; const head = unify(seq[0]); const tail = seq.slice(1); return head(() => sequence(tail)); }; function unify(fn) { return function(done) { if (typeof fn !== 'function') return done(); if (fn.length > 0) { // Ensure there is a callback function as 1st argument return fn(done); } const res = fn(); // Wait until the function is terminated if the returned value is thenable if (res && typeof res.then === 'function') { return res.then(done); } return done(); }; } module.exports = vq;
Split the function for call and wait processes
[Refactoring] Split the function for call and wait processes
JavaScript
mit
ktsn/vq
--- +++ @@ -30,26 +30,32 @@ } vq.sequence = function sequence(seq) { - const head = seq[0]; + if (seq.length === 0) return; + + const head = unify(seq[0]); const tail = seq.slice(1); - if (typeof head !== 'function') return; - - if (head.length > 0) { - // Ensure there is a callback function as 1st argument - return head(function() { - sequence(tail); - }); - } - - const res = head(); - - // Wait until the head function is terminated if the returned value is thenable - if (res && typeof res.then === 'function') { - return res.then(() => sequence(tail)); - } - - return sequence(tail); + return head(() => sequence(tail)); }; +function unify(fn) { + return function(done) { + if (typeof fn !== 'function') return done(); + + if (fn.length > 0) { + // Ensure there is a callback function as 1st argument + return fn(done); + } + + const res = fn(); + + // Wait until the function is terminated if the returned value is thenable + if (res && typeof res.then === 'function') { + return res.then(done); + } + + return done(); + }; +} + module.exports = vq;
31e72bfcc30fa13863bc67640ee3b88a3abbb4a1
src/index.js
src/index.js
import React from 'react'; import ReactDOM from 'react-dom'; import thunk from 'redux-thunk'; import { Provider } from 'react-redux'; import { createStore, applyMiddleware, compose } from 'redux'; import Main from './components/Main'; import reducer from './reducers'; import { SHOW_DEVTOOLS } from './constants'; const middlewares = [ applyMiddleware(thunk), ]; if (SHOW_DEVTOOLS) { middlewares.push(window.devToolsExtension ? window.devToolsExtension() : f => f); } const composedCreateStore = compose.apply(this, middlewares)(createStore); const store = composedCreateStore(reducer); ReactDOM.render( <Provider store={ store }> <Main /> </Provider>, document.getElementById('main') );
import React from 'react'; import ReactDOM from 'react-dom'; import thunk from 'redux-thunk'; import { Provider } from 'react-redux'; import { createStore, applyMiddleware, compose } from 'redux'; import reducer from './reducers'; import { SHOW_DEVTOOLS } from './constants'; const middlewares = [ applyMiddleware(thunk), ]; if (SHOW_DEVTOOLS) { middlewares.push(window.devToolsExtension ? window.devToolsExtension() : f => f); } const composedCreateStore = compose.apply(this, middlewares)(createStore); const store = composedCreateStore(reducer); const rootEl = document.getElementById('main'); const render = () => { // See here for explanation of why this require() is needed: // https://github.com/reactjs/redux/pull/1455/files#r54380102 const Main = require('./components/Main').default; // eslint-disable-line global-require ReactDOM.render( <Provider store={ store }> <Main /> </Provider>, rootEl ); }; if (module.hot) { module.hot.accept('./components/Main', () => { render(); }); } render();
Fix HMR with some help from my good friend Dan
Fix HMR with some help from my good friend Dan
JavaScript
mit
bjacobel/rak,bjacobel/rak,bjacobel/react-redux-boilerplate,bjacobel/react-redux-boilerplate,bjacobel/rak
--- +++ @@ -4,7 +4,6 @@ import { Provider } from 'react-redux'; import { createStore, applyMiddleware, compose } from 'redux'; -import Main from './components/Main'; import reducer from './reducers'; import { SHOW_DEVTOOLS } from './constants'; @@ -18,10 +17,24 @@ const composedCreateStore = compose.apply(this, middlewares)(createStore); const store = composedCreateStore(reducer); +const rootEl = document.getElementById('main'); +const render = () => { + // See here for explanation of why this require() is needed: + // https://github.com/reactjs/redux/pull/1455/files#r54380102 + const Main = require('./components/Main').default; // eslint-disable-line global-require -ReactDOM.render( - <Provider store={ store }> - <Main /> - </Provider>, - document.getElementById('main') -); + ReactDOM.render( + <Provider store={ store }> + <Main /> + </Provider>, + rootEl + ); +}; + +if (module.hot) { + module.hot.accept('./components/Main', () => { + render(); + }); +} + +render();
9921ad5b87592655d4bca449924ff7cd2a2ecacb
src/popup.js
src/popup.js
import React, { PropTypes } from 'react'; import ProjectedLayer from './projected-layer'; import { anchors, OverlayPropTypes, } from './util/overlays'; const defaultClassName = ['mapboxgl-popup']; export default class Popup extends React.Component { static propTypes = { coordinates: PropTypes.arrayOf(PropTypes.number).isRequired, anchor: OverlayPropTypes.anchor, offset: OverlayPropTypes.offset, children: PropTypes.node, onClick: PropTypes.func, style: PropTypes.object, }; static defaultProps = { anchor: anchors[0] }; render() { const { coordinates, anchor, offset, onClick, children, style } = this.props; if (anchor) { defaultClassName.push(`mapboxgl-popup-anchor-${anchor}`); } return ( <ProjectedLayer style={style} onClick={onClick} offset={offset} anchor={anchor} coordinates={coordinates} className={defaultClassName.join(' ')}> <div className="mapboxgl-popup-tip"></div> <div className="mapboxgl-popup-content"> { children } </div> </ProjectedLayer> ); } }
import React, { PropTypes } from 'react'; import ProjectedLayer from './projected-layer'; import { anchors, OverlayPropTypes, } from './util/overlays'; export default class Popup extends React.Component { static propTypes = { coordinates: PropTypes.arrayOf(PropTypes.number).isRequired, anchor: OverlayPropTypes.anchor, offset: OverlayPropTypes.offset, children: PropTypes.node, onClick: PropTypes.func, style: PropTypes.object, }; static defaultProps = { anchor: anchors[0] }; render() { const { coordinates, anchor, offset, onClick, children, style } = this.props; return ( <ProjectedLayer style={style} onClick={onClick} offset={offset} anchor={anchor} coordinates={coordinates} className={`mapboxgl-popup mapboxgl-popup-anchor-${anchor}`}> <div className="mapboxgl-popup-tip"></div> <div className="mapboxgl-popup-content"> { children } </div> </ProjectedLayer> ); } }
Fix mutable className array in Popup
Fix mutable className array in Popup
JavaScript
mit
lamuertepeluda/react-mapbox-gl,alex3165/react-mapbox-gl,lamuertepeluda/react-mapbox-gl,alex3165/react-mapbox-gl,alex3165/react-mapbox-gl,alex3165/react-mapbox-gl,lamuertepeluda/react-mapbox-gl,lamuertepeluda/react-mapbox-gl
--- +++ @@ -4,8 +4,6 @@ anchors, OverlayPropTypes, } from './util/overlays'; - -const defaultClassName = ['mapboxgl-popup']; export default class Popup extends React.Component { static propTypes = { @@ -24,10 +22,6 @@ render() { const { coordinates, anchor, offset, onClick, children, style } = this.props; - if (anchor) { - defaultClassName.push(`mapboxgl-popup-anchor-${anchor}`); - } - return ( <ProjectedLayer style={style} @@ -35,7 +29,7 @@ offset={offset} anchor={anchor} coordinates={coordinates} - className={defaultClassName.join(' ')}> + className={`mapboxgl-popup mapboxgl-popup-anchor-${anchor}`}> <div className="mapboxgl-popup-tip"></div> <div className="mapboxgl-popup-content"> { children }
f7c78f2e63d3247479e91087ec31c5eb9033af34
src/store.js
src/store.js
import thunk from 'redux-thunk' import createLogger from 'redux-logger' import { browserHistory } from 'react-router' import { syncHistory } from 'react-router-redux' import { combineReducers, compose, createStore, applyMiddleware } from 'redux' import { autoRehydrate } from 'redux-persist' import { analytics, authentication, requester, uploader } from './middleware' import * as reducers from './reducers' const reducer = combineReducers(reducers) const reduxRouterMiddleware = browserHistory ? syncHistory(browserHistory) : null let store = null if (typeof window !== 'undefined') { const logger = createLogger({ collapsed: true, predicate: () => ENV.APP_DEBUG }) store = compose( autoRehydrate(), applyMiddleware( thunk, reduxRouterMiddleware, uploader, requester, authentication, analytics, logger ), )(createStore)(reducer, window.__INITIAL_STATE__ || {}) } else { store = compose( applyMiddleware(thunk, uploader, requester, analytics), )(createStore)(reducer, {}) } export default store
import thunk from 'redux-thunk' import createLogger from 'redux-logger' import { browserHistory } from 'react-router' import { syncHistory } from 'react-router-redux' import { combineReducers, compose, createStore, applyMiddleware } from 'redux' import { autoRehydrate } from 'redux-persist' import { analytics, authentication, requester, uploader } from './middleware' import * as reducers from './reducers' const reducer = combineReducers(reducers) const reduxRouterMiddleware = browserHistory ? syncHistory(browserHistory) : null let store = null if (typeof window !== 'undefined') { const logger = createLogger({ collapsed: true, predicate: () => ENV.APP_DEBUG }) store = compose( autoRehydrate(), applyMiddleware( thunk, authentication, reduxRouterMiddleware, uploader, requester, analytics, logger ), )(createStore)(reducer, window.__INITIAL_STATE__ || {}) } else { store = compose( applyMiddleware(thunk, uploader, requester, analytics), )(createStore)(reducer, {}) } export default store
Move authentication higher up the food chain
Move authentication higher up the food chain
JavaScript
mit
ello/webapp,ello/webapp,ello/webapp
--- +++ @@ -17,10 +17,10 @@ autoRehydrate(), applyMiddleware( thunk, + authentication, reduxRouterMiddleware, uploader, requester, - authentication, analytics, logger ),
d381deebcb82dcbc13000d0bc4819a003385b77f
test/main.js
test/main.js
var gulp = require('gulp'); var gulpB = require('../'); var expect = require('chai').expect; var es = require('event-stream'); var path = require('path'); var browserify = require('browserify'); describe('gulp-browserify', function() { var testFile = path.join(__dirname, './test.js'); var fileContents; beforeEach(function(done) { gulp.src(testFile) .pipe(gulpB()) .pipe(es.map(function(file){ fileContents = file.contents; done(); })) }) it('should return a buffer', function(done) { expect(fileContents).to.be.an.instanceof(Buffer); done(); }) it('should bundle modules', function(done) { var b = browserify(); var chunk = ''; b.add(testFile) b.bundle().on('data', function(data) { chunk += data; }).on('end', function() { expect(fileContents.toString()).to.equal(chunk); done(); }) }) })
var gulp = require('gulp'); var gulpB = require('../'); var expect = require('chai').expect; var es = require('event-stream'); var path = require('path'); var browserify = require('browserify'); describe('gulp-browserify', function() { var testFile = path.join(__dirname, './test.js'); var fileContents; beforeEach(function(done) { gulp.src(testFile) .pipe(gulpB()) .pipe(es.map(function(file){ fileContents = file.contents; done(); })) }) it('should return a buffer', function(done) { expect(fileContents).to.be.an.instanceof(Buffer); done(); }) it('should bundle modules', function(done) { var b = browserify(); var chunk = ''; b.add(testFile) b.bundle().on('data', function(data) { chunk += data; }).on('end', function() { expect(fileContents.toString()).to.equal(chunk); done(); }) }) it('should use the gulp version of the file', function(done) { gulp.src(testFile) .pipe(es.map(function(file, cb) { file.contents = new Buffer('var abc=123;'); cb(null, file); })) .pipe(gulpB()) .pipe(es.map(function(file) { expect(file.contents.toString()).to.not.equal(fileContents.toString()); expect(file.contents.toString()).to.match(/var abc=123;/); done(); })) }) })
Add test to verify usage of gulp version of file
Add test to verify usage of gulp version of file
JavaScript
mit
deepak1556/gulp-browserify
--- +++ @@ -34,4 +34,17 @@ done(); }) }) + it('should use the gulp version of the file', function(done) { + gulp.src(testFile) + .pipe(es.map(function(file, cb) { + file.contents = new Buffer('var abc=123;'); + cb(null, file); + })) + .pipe(gulpB()) + .pipe(es.map(function(file) { + expect(file.contents.toString()).to.not.equal(fileContents.toString()); + expect(file.contents.toString()).to.match(/var abc=123;/); + done(); + })) + }) })
a7c21fc87578062b393e897f3b3ca5ff4c8be542
test/main.js
test/main.js
/* eslint-disable no-console, no-duplicate-imports, import/no-duplicates */ import proxyquire from 'proxyquire'; import describe from '../src'; import { specStream } from '../src'; describe('RxT', (it) => { it('should run a simple passing and failing given/when/then test', test => test .given('givenWhenThen') .whenObserving((testFile) => { const spec = proxyquire(`./samples/${testFile}`, { '../../src': { default: specStream, }, }); return spec; }) .then( (result) => { const expected = [ ['should capitalize just hello'], [ 'should capitalize just hello', 'should fail to assert the proper hello', ], ]; result.results.should.have.keys(...expected[result.step]); }, ) ); });
/* eslint-disable no-console, no-duplicate-imports, import/no-duplicates */ import _ from 'lodash'; import proxyquire from 'proxyquire'; import describe from '../src'; import { specStream } from '../src'; describe('RxT', (it) => { it('should run a simple passing and failing given/when/then test', test => test .given('givenWhenThen') .whenObserving((testFile) => { const spec = proxyquire(`./samples/${testFile}`, { '../../src': { default: specStream, }, }); return spec; }) .then( (result) => { const expected = [ { 'should capitalize just hello': 'pass', }, { 'should capitalize just hello': 'pass', 'should fail to assert the proper hello': 'fail', }, ]; result.results.should.have.keys(..._.keys(expected[result.step])); _.forIn(expected[result.step], (val, key) => { result.results[key].result.should.equal(val); }); }, ) ); });
Test the actual test result.
Test the actual test result.
JavaScript
mit
RayBenefield/RxT
--- +++ @@ -1,4 +1,5 @@ /* eslint-disable no-console, no-duplicate-imports, import/no-duplicates */ +import _ from 'lodash'; import proxyquire from 'proxyquire'; import describe from '../src'; import { specStream } from '../src'; @@ -17,13 +18,18 @@ .then( (result) => { const expected = [ - ['should capitalize just hello'], - [ - 'should capitalize just hello', - 'should fail to assert the proper hello', - ], + { + 'should capitalize just hello': 'pass', + }, + { + 'should capitalize just hello': 'pass', + 'should fail to assert the proper hello': 'fail', + }, ]; - result.results.should.have.keys(...expected[result.step]); + result.results.should.have.keys(..._.keys(expected[result.step])); + _.forIn(expected[result.step], (val, key) => { + result.results[key].result.should.equal(val); + }); }, ) );
2f2435b59601f79388e664e918f54dc25cfe4177
app/js/arethusa_util.js
app/js/arethusa_util.js
"use strict"; // Provides the global arethusaUtil object which comes with several // utility functions window.arethusaUtil = { // Pads a number with zeros formatNumber: function(number, length) { // coerce a fixnum to a string var n = "" + number; while (n.length < length) { n = "0" + n; } return n; } };
"use strict"; // Provides the global arethusaUtil object which comes with several // utility functions var arethusaUtil = { // Pads a number with zeros formatNumber: function(number, length) { // coerce a fixnum to a string var n = "" + number; while (n.length < length) { n = "0" + n; } return n; }, /* global X2JS */ xmlParser: new X2JS(), xml2json: function(xml) { return arethusaUtil.xmlParser.xml2json(xml); } };
Add some xml functions to arethusaUtil
Add some xml functions to arethusaUtil
JavaScript
mit
latin-language-toolkit/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,PonteIneptique/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa
--- +++ @@ -3,12 +3,19 @@ // Provides the global arethusaUtil object which comes with several // utility functions -window.arethusaUtil = { +var arethusaUtil = { // Pads a number with zeros formatNumber: function(number, length) { // coerce a fixnum to a string var n = "" + number; while (n.length < length) { n = "0" + n; } return n; + }, + + /* global X2JS */ + xmlParser: new X2JS(), + + xml2json: function(xml) { + return arethusaUtil.xmlParser.xml2json(xml); } };
a8321824ba18e1655167b216d3c03748673cb1e9
app/routes/dashboard.js
app/routes/dashboard.js
import Ember from 'ember'; export default Ember.Route.extend({ renderTemplate() { this.render( 'admin', { controller: 'dashboard' }); } });
import Ember from 'ember'; export default Ember.Route.extend({ activate() { $( 'body' ).removeClass( 'login' ) }, renderTemplate() { this.render( 'admin', { controller: 'dashboard' }); } });
Remove "login" class after transition
Remove "login" class after transition
JavaScript
mit
kunni80/server,muffin/server
--- +++ @@ -1,6 +1,10 @@ import Ember from 'ember'; export default Ember.Route.extend({ + + activate() { + $( 'body' ).removeClass( 'login' ) + }, renderTemplate() { this.render( 'admin', {
7c533789deeadc740dd961caa60834231b26f26d
web.js
web.js
// web.js var express = require("express"); var logfmt = require("logfmt"); var app = express(); app.use(logfmt.requestLogger()); app.get('/', function(req, res) { res.send('Hello World!'); }); var port = Number(process.env.PORT || 8000); app.listen(port, function() { console.log("Listening on " + port); });
// web.js var express = require("express"); var logfmt = require("logfmt"); var app = express(); app.use(logfmt.requestLogger()); app.get('*', function(req, res) { res.sendfile('./app/index.html'); // load our app/index.html file }); var port = Number(process.env.PORT || 8000); app.listen(port, function() { console.log("Listening on " + port); });
Make index page appear on heroku
Make index page appear on heroku
JavaScript
mit
sharlwong/phuxuan
--- +++ @@ -5,8 +5,8 @@ app.use(logfmt.requestLogger()); -app.get('/', function(req, res) { - res.send('Hello World!'); +app.get('*', function(req, res) { + res.sendfile('./app/index.html'); // load our app/index.html file }); var port = Number(process.env.PORT || 8000);
1d86fb05c2a3b347cd93bd4b97e2eafeb8177c31
app/actions/verticalTreeActions.js
app/actions/verticalTreeActions.js
const updateStructure = newState => { return { type: 'UPDATE_VERT_STRUCTURE', newState }; }; const highlightNode = (delay, unHighlight, nodeId) => { setTimeout(() => unHighlight(nodeId), delay / 1.1); return { type: 'HIGHLIGHT_NODE', nodeId }; }; const unHighlightNode = nodeId => { return { type: 'UNHIGHLIGHT_NODE', nodeId }; }; export default { updateStructure, highlightNode, unHighlightNode };
const updateStructure = newState => ({ type: 'UPDATE_VERT_STRUCTURE', newState }); const highlightNode = nodeId => (dispatch, getState) => { setTimeout(() => dispatch(unHighlightNode(nodeId)), getState().async.delay / 1.1); dispatch({ type: 'HIGHLIGHT_NODE', nodeId }); }; const unHighlightNode = nodeId => ({ type: 'UNHIGHLIGHT_NODE', nodeId }); export default { updateStructure, highlightNode, unHighlightNode };
Use thunk to access delay state
Use thunk to access delay state
JavaScript
mit
ivtpz/brancher,ivtpz/brancher
--- +++ @@ -1,15 +1,11 @@ -const updateStructure = newState => { - return { type: 'UPDATE_VERT_STRUCTURE', newState }; +const updateStructure = newState => ({ type: 'UPDATE_VERT_STRUCTURE', newState }); + +const highlightNode = nodeId => (dispatch, getState) => { + setTimeout(() => dispatch(unHighlightNode(nodeId)), getState().async.delay / 1.1); + dispatch({ type: 'HIGHLIGHT_NODE', nodeId }); }; -const highlightNode = (delay, unHighlight, nodeId) => { - setTimeout(() => unHighlight(nodeId), delay / 1.1); - return { type: 'HIGHLIGHT_NODE', nodeId }; -}; - -const unHighlightNode = nodeId => { - return { type: 'UNHIGHLIGHT_NODE', nodeId }; -}; +const unHighlightNode = nodeId => ({ type: 'UNHIGHLIGHT_NODE', nodeId }); export default { updateStructure,
d2cc1cf05bda3e9e90520dfa9a53818d509852b5
addon/components/karbon-sortable-item.js
addon/components/karbon-sortable-item.js
import Ember from 'ember'; import layout from '../templates/components/karbon-sortable-item'; export default Ember.Component.extend({ tagName: 'li', classNames: ['spacer'], classNameBindings: ['handleClass', 'isSection:section', 'isNested:nested'], attributeBindings: ['draggable', 'pkid:data-pkid'], handleClass: 'droppable', draggable: 'true', isSection: Ember.computed.alias('data.isSection'), isNested: Ember.computed.alias('data.isChild'), pkid: Ember.computed.alias('data.id'), layout, didInsertElement() { // We don't need to pass any data (yet), but FF won't drag unless this is set this.$().attr('ondragstart', "event.dataTransfer.setData('text/plain', 'text')"); }, click() { const data = this.get('data'); if (data.get('isSection')) { this.get('toggleSection')(data); return false; } } });
import Ember from 'ember'; import layout from '../templates/components/karbon-sortable-item'; export default Ember.Component.extend({ tagName: 'li', classNames: ['spacer'], classNameBindings: ['handleClass', 'isSection:section', 'isNested:nested'], attributeBindings: ['draggable', 'pkid:data-pkid'], handleClass: 'droppable', // temporary draggable: Ember.computed.not('data.isSection'), isSection: Ember.computed.alias('data.isSection'), isNested: Ember.computed.alias('data.isChild'), pkid: Ember.computed.alias('data.id'), layout, didInsertElement() { // We don't need to pass any data (yet), but FF won't drag unless this is set this.$().attr('ondragstart', "event.dataTransfer.setData('text/plain', 'text')"); }, /* click() { const data = this.get('data'); if (data.get('isSection')) { this.get('toggleSection')(data); return false; } } */ });
Disable dragging sections for now.
Disable dragging sections for now.
JavaScript
mit
PracticeIQ/karbon-sortable,PracticeIQ/karbon-sortable
--- +++ @@ -7,7 +7,8 @@ classNameBindings: ['handleClass', 'isSection:section', 'isNested:nested'], attributeBindings: ['draggable', 'pkid:data-pkid'], handleClass: 'droppable', - draggable: 'true', + // temporary + draggable: Ember.computed.not('data.isSection'), isSection: Ember.computed.alias('data.isSection'), isNested: Ember.computed.alias('data.isChild'), pkid: Ember.computed.alias('data.id'), @@ -18,6 +19,7 @@ this.$().attr('ondragstart', "event.dataTransfer.setData('text/plain', 'text')"); }, +/* click() { const data = this.get('data'); @@ -26,4 +28,5 @@ return false; } } + */ });
11a04087e5f95d5fc88fb3a1a4a9724ab777e01d
routing.js
routing.js
var fs = require('fs'); var flatiron = require('flatiron'), app = flatiron.app; app.use(flatiron.plugins.http, { // HTTP options }); var text_index = fs.readFileSync('index.html'); var buff_index = new Buffer(text_index); app.router.get('/', function () { this.res.end(buff_index.toString()); }); app.router.get('/version', function () { this.res.writeHead(200, { 'Content-Type': 'text/plain' }); this.res.end( 'flatiron' + flatiron.version ); }); app.start(8080);
var fs = require('fs'); var flatiron = require('flatiron'), app = flatiron.app; app.use(flatiron.plugins.http, { // HTTP options }); var text_index = fs.readFileSync('index.html'); var buff_index = new Buffer(text_index); app.router.get('/', function () { this.res.end(buff_index.toString()); }); app.router.get('/version', function () { this.res.writeHead(200, { 'Content-Type': 'text/plain' }); this.res.end( 'flatiron' + flatiron.version ); }); app.start(5000);
Change port number t o 5000, per heroku instructions
Change port number t o 5000, per heroku instructions
JavaScript
mit
jmartenstein/bitcoinshirt
--- +++ @@ -19,4 +19,4 @@ this.res.end( 'flatiron' + flatiron.version ); }); -app.start(8080); +app.start(5000);
a6dec3496e752f76b76f1e572587a401d5f245a2
assets/js/hxp-import-functions.js
assets/js/hxp-import-functions.js
/** * * Created by PhpStorm. * User: Philipp Dippel Inf | DMS - M * For Project: headerXporter * Date: 29.08.17 * Copyright: Philipp Dippel */ jQuery(document).ready(() => { function crazyshit() { console.log("Hallo"); } });
/** * * Created by PhpStorm. * User: Philipp Dippel Inf | DMS - M * For Project: headerXporter * Date: 29.08.17 * Copyright: Philipp Dippel */ jQuery(document).ready(() => { let hxp_file_input = jQuery('#zip_file'); let hxp_submit_button = jQuery('#submitButton'); hxp_file_input.change(() => { if (hxp_file_input.val() !== '') { hxp_submit_button.prop('disabled', false); hxp_submit_button.addClass('hover'); } else { hxp_submit_button.prop('disabled', true); hxp_submit_button.removeClass('hover'); } }); });
Add Javascript check for selected file in importer
Add Javascript check for selected file in importer
JavaScript
mit
Pjirlip/X-Porter,Pjirlip/X-Porter
--- +++ @@ -8,9 +8,20 @@ jQuery(document).ready(() => { - function crazyshit() - { - console.log("Hallo"); - } + let hxp_file_input = jQuery('#zip_file'); + let hxp_submit_button = jQuery('#submitButton'); + + hxp_file_input.change(() => { + if (hxp_file_input.val() !== '') + { + hxp_submit_button.prop('disabled', false); + hxp_submit_button.addClass('hover'); + } + else + { + hxp_submit_button.prop('disabled', true); + hxp_submit_button.removeClass('hover'); + } + }); });
1b609f9fdf96ce497557cdda7a979587f360b8e0
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jasmine: { geojson_to_gmaps: { src: 'geojson-to-gmaps.js', options: { specs: 'spec/*Spec.js', helpers: 'spec/*Helper.js', vendor: 'vendor/*.js' } } }, jshint: { all: ['Gruntfile.js', 'src/**/*.js', 'spec/**/*.js'] }, uglify: { options: { banner: "/***\n\ngeojson-to-gmaps.js\n\n" + grunt.file.read('LICENSE') + "\n\n***/\n" }, my_target: { files: { 'geojson-to-gmaps.min.js': ['geojson-to-gmaps.js'] } } } }); // Load the plugin that provides the "uglify" task. grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-uglify'); // Default task(s). grunt.registerTask('default', ['jasmine']); grunt.registerTask('build', 'Build a release.', ['jasmine', 'uglify']); };
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jasmine: { geojson_to_gmaps: { src: 'geojson-to-gmaps.js', options: { specs: 'spec/*Spec.js', helpers: 'spec/*Helper.js', vendor: 'vendor/*.js' } } }, jshint: { all: ['Gruntfile.js', 'geojson-to-gmaps.js', 'spec/**/*.js'] }, uglify: { options: { banner: "/***\n\ngeojson-to-gmaps.js\n\n" + grunt.file.read('LICENSE') + "\n\n***/\n" }, my_target: { files: { 'geojson-to-gmaps.min.js': ['geojson-to-gmaps.js'] } } } }); // Load the plugin that provides the "uglify" task. grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-uglify'); // Default task(s). grunt.registerTask('default', ['jasmine']); grunt.registerTask('build', 'Build a release.', ['jasmine', 'uglify']); };
Update jshint to work with the correct files.
Update jshint to work with the correct files.
JavaScript
mit
MarkBennett/geojson_to_gmaps
--- +++ @@ -14,7 +14,7 @@ } }, jshint: { - all: ['Gruntfile.js', 'src/**/*.js', 'spec/**/*.js'] + all: ['Gruntfile.js', 'geojson-to-gmaps.js', 'spec/**/*.js'] }, uglify: { options: {
f08964092048b6d8f8b9643d1e6179e9cc2dcc6f
addon/input.js
addon/input.js
import Em from 'ember'; import FormGroupComponent from './group'; import ControlMixin from 'ember-idx-forms/mixins/control'; /* Form Input Syntax: {{em-input property="property name"}} */ export default FormGroupComponent.extend({ controlView: Em.TextField.extend(ControlMixin, { attributeBindings: ['placeholder', 'required', 'autofocus', 'disabled'], placeholder: Em.computed.alias('parentView.placeholder'), required: Em.computed.alias('parentView.required'), autofocus: Em.computed.alias('parentView.autofocus'), disabled: Em.computed.alias('parentView.disabled'), type: Em.computed.alias('parentView.type'), model: Em.computed.alias('parentView.model'), propertyName: Em.computed.alias('parentView.propertyName') }), addonIcon: false, property: void 0, label: void 0, placeholder: void 0, required: void 0, autofocus: void 0, disabled: void 0, controlWrapper: Em.computed('form.form_layout', function() { if (this.get('form.form_layout') === 'horizontal') { return 'col-sm-10'; } return null; }) });
import Em from 'ember'; import FormGroupComponent from './group'; import ControlMixin from 'ember-idx-forms/mixins/control'; /* Form Input Syntax: {{em-input property="property name"}} */ export default FormGroupComponent.extend({ controlView: Em.TextField.extend(ControlMixin, { attributeBindings: ['placeholder', 'required', 'autofocus', 'disabled'], placeholder: Em.computed.alias('parentView.placeholder'), required: Em.computed.alias('parentView.required'), autofocus: Em.computed.alias('parentView.autofocus'), disabled: Em.computed.alias('parentView.disabled'), type: Em.computed.alias('parentView.type'), model: Em.computed.alias('parentView.model'), propertyName: Em.computed.alias('parentView.propertyName') }), property: void 0, label: void 0, placeholder: void 0, required: void 0, autofocus: void 0, disabled: void 0, controlWrapper: Em.computed('form.form_layout', function() { if (this.get('form.form_layout') === 'horizontal') { return 'col-sm-10'; } return null; }) });
Revert "add support for addon icon (requires FontAwesome)"
Revert "add support for addon icon (requires FontAwesome)" This reverts commit 5db7b0a5550757c653de869516c308ff10452b74.
JavaScript
apache-2.0
Szeliga/ember-forms,Szeliga/ember-forms
--- +++ @@ -19,7 +19,6 @@ model: Em.computed.alias('parentView.model'), propertyName: Em.computed.alias('parentView.propertyName') }), - addonIcon: false, property: void 0, label: void 0, placeholder: void 0,
ebd26bd534f59588839f5e7a783cd9dde7eaf091
app/api/app.js
app/api/app.js
/** * Module dependencies. */ var express = require('express'), Check = require('../../models/check') CheckEvent = require('../../models/checkEvent'); var app = module.exports = express.createServer(); // middleware app.configure(function(){ app.use(app.router); app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); // up count var upCount; var refreshUpCount = function() { Check.count({}, function(err, total) { Check.count({ isUp: true}, function(err, nbUp) { upCount = { up: nbUp, down: total - nbUp, total: total }; }); }); } refreshUpCount(); CheckEvent.on('insert', refreshUpCount); app.get('/check/count', function(req, res) { res.json(upCount); }); // Routes require('./routes/check')(app); require('./routes/tag')(app); require('./routes/ping')(app); if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); }
/** * Module dependencies. */ var express = require('express'), Check = require('../../models/check') CheckEvent = require('../../models/checkEvent'); var app = module.exports = express.createServer(); // middleware app.configure(function(){ app.use(app.router); app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); // up count var upCount; var refreshUpCount = function(callback) { Check.count({}, function(err, total) { Check.count({ isUp: true}, function(err, nbUp) { upCount = { up: nbUp, down: total - nbUp, total: total }; callback(); }); }); } CheckEvent.on('insert', function() { upCount = undefined; }); app.get('/check/count', function(req, res) { if (upCount) { res.json(upCount); } else { refreshUpCount(function() { res.json(upCount); }); } }); // Routes require('./routes/check')(app); require('./routes/tag')(app); require('./routes/ping')(app); if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); }
Fix race condition in api causing bad counts in dashboard.
Fix race condition in api causing bad counts in dashboard. A CheckEvent triggers both a refresh of the count in the api and in the dashboard - the dashboard asking the api for a fresher value. When using websockets, the response from MongoDB could happen after the request from the dashboard. The fix forces the dashboard to wait if a refresh was just triggered.
JavaScript
mit
fzaninotto/uptime,rkmallik/uptime-openshift,SaravananPerumal23/uptime2,ptisp/uptime,RafeHatfield/nodeuptime,sinkingshriek/uptime,cloudfoundry-community/uptime-cfready,b-pedzik/uptime,GuptaVineet-IBM/upTime_ford,ptisp/uptime,phanan/uptime,nacyot/uptime,nerevu/uptime,SufianHassan/uptime,SpringerPE/uptime,blendlabs/uptime,SaravananPerumal23/uptime2,f33rx/docker-uptime,blackboard/uptime,aregpetrosyan/web,memezilla/uptime,bathree/uptime,askcs/uptime,brianjking/uptime,scalp42/uptime,heamon7/uptime,ifavo/uptime,prune998/uptime,nerevu/uptime,WillGuan105/uptime,0x8BADFOOD/uptime,jraigneau/watchdog,f33rx/docker-uptime,rkmallik/uptime-openshift,MichaelStephan/uptime,aregpetrosyan/web,Maluuba/uptime,gleicon/uptime,erpframework/uptime,arthurpro/uptime,traskat/uptime
--- +++ @@ -16,19 +16,25 @@ // up count var upCount; -var refreshUpCount = function() { +var refreshUpCount = function(callback) { Check.count({}, function(err, total) { Check.count({ isUp: true}, function(err, nbUp) { upCount = { up: nbUp, down: total - nbUp, total: total }; + callback(); }); }); } -refreshUpCount(); -CheckEvent.on('insert', refreshUpCount); +CheckEvent.on('insert', function() { upCount = undefined; }); app.get('/check/count', function(req, res) { - res.json(upCount); + if (upCount) { + res.json(upCount); + } else { + refreshUpCount(function() { + res.json(upCount); + }); + } }); // Routes
bdfa853c6e4657c8afdab906bf50461a8e26a43b
webpack.build.config.js
webpack.build.config.js
const commonConfig = require("./webpack.common.config"); const nodeExternals = require("webpack-node-externals"); const merge = (...objs) => require("deepmerge").all(objs, {arrayMerge: (arr1, arr2) => arr1.concat(arr2) }); const combinedConfig = merge({}, commonConfig, { output: { path: "./dist", libraryTarget: "commonjs2", filename: "bundle.js" }, devtool: "#source-map", externals: [ nodeExternals() ] }); module.exports = combinedConfig;
const path = require("path"); const commonConfig = require("./webpack.common.config"); const nodeExternals = require("webpack-node-externals"); const merge = (...objs) => require("deepmerge").all(objs, {arrayMerge: (arr1, arr2) => arr1.concat(arr2) }); const combinedConfig = merge({}, commonConfig, { output: { path: path.resolve(__dirname, "./dist"), libraryTarget: "commonjs2", filename: "bundle.js" }, devtool: "#source-map", externals: [ nodeExternals() ] }); module.exports = combinedConfig;
Fix absolute path requirement for output.path since webpack 2.3.0
Fix absolute path requirement for output.path since webpack 2.3.0
JavaScript
mit
aeinbu/webpack-npm-package-template,aeinbu/webpack-npm-package-template
--- +++ @@ -1,10 +1,11 @@ +const path = require("path"); const commonConfig = require("./webpack.common.config"); const nodeExternals = require("webpack-node-externals"); const merge = (...objs) => require("deepmerge").all(objs, {arrayMerge: (arr1, arr2) => arr1.concat(arr2) }); const combinedConfig = merge({}, commonConfig, { output: { - path: "./dist", + path: path.resolve(__dirname, "./dist"), libraryTarget: "commonjs2", filename: "bundle.js" },
717e09e2cdbcf1e9bb79925ed0964ac5bc5d5e7f
webapp/web/js/imageUpload/cropImage.js
webapp/web/js/imageUpload/cropImage.js
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ (function($) { $(window).load(function(){ var jcrop_api = $.Jcrop('#cropbox',{ onChange: showPreview, onSelect: showPreview, aspectRatio: 1 }); var bounds = jcrop_api.getBounds(); var boundx = bounds[0]; var boundy = bounds[1]; function showPreview(coords) { if (parseInt(coords.w) > 0) { var rx = 115 / coords.w; var ry = 115 / coords.h; $('#preview').css({ width: Math.round(rx * boundx) + 'px', height: Math.round(ry * boundy) + 'px', marginLeft: '-' + Math.round(rx * coords.x) + 'px', marginTop: '-' + Math.round(ry * coords.y) + 'px' }); $('input[name=x]').val(coords.x); $('input[name=y]').val(coords.y); $('input[name=w]').val(coords.w); $('input[name=h]').val(coords.h); } }; }); }(jQuery));
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ (function($) { $(window).load(function(){ var jcrop_api = $.Jcrop('#cropbox',{ onChange: showPreview, onSelect: showPreview, setSelect: [ 0, 0, 115, 115 ], minSize: [115,115], maxSize: [300,300], aspectRatio: 1 }); var bounds = jcrop_api.getBounds(); var boundx = bounds[0]; var boundy = bounds[1]; function showPreview(coords) { if (parseInt(coords.w) > 0) { var rx = 115 / coords.w; var ry = 115 / coords.h; $('#preview').css({ width: Math.round(rx * boundx) + 'px', height: Math.round(ry * boundy) + 'px', marginLeft: '-' + Math.round(rx * coords.x) + 'px', marginTop: '-' + Math.round(ry * coords.y) + 'px' }); $('input[name=x]').val(coords.x); $('input[name=y]').val(coords.y); $('input[name=w]').val(coords.w); $('input[name=h]').val(coords.h); } }; }); }(jQuery));
Set an initial selection area of 115 by 115 pixels. Added minimum (115 by 115 pixels) and maximum (300 by 300 pixels) sizes for cropping images
Set an initial selection area of 115 by 115 pixels. Added minimum (115 by 115 pixels) and maximum (300 by 300 pixels) sizes for cropping images
JavaScript
bsd-3-clause
vivo-project/Vitro,vivo-project/Vitro,vivo-project/Vitro,vivo-project/Vitro
--- +++ @@ -7,6 +7,9 @@ var jcrop_api = $.Jcrop('#cropbox',{ onChange: showPreview, onSelect: showPreview, + setSelect: [ 0, 0, 115, 115 ], + minSize: [115,115], + maxSize: [300,300], aspectRatio: 1 });
ad6ca0bde17ece30283aad0438a697f07e817054
app/view/lib/jquery-watchchanges/jquery-watchchanges.js
app/view/lib/jquery-watchchanges/jquery-watchchanges.js
/*! * Small jQuery plugin to detect whether or not a form's values have been changed. * @see: https://gist.github.com/DrPheltRight/4131266 * Written by Luke Morton, licensed under MIT. Adapted for Bolt by Bob. */ (function ($) { $.fn.watchChanges = function () { // First, make sure the underlying textareas are updated with the content in the CKEditor fields. for (var instanceName in CKEDITOR.instances) { CKEDITOR.instances[instanceName].updateElement(); } return this.each(function () { $.data(this, 'formHash', $(this).serialize()); }); }; $.fn.hasChanged = function () { var hasChanged = false; // First, make sure the underlying textareas are updated with the content in the CKEditor fields. for(var instanceName in CKEDITOR.instances) { CKEDITOR.instances[instanceName].updateElement(); } this.each(function () { var formHash = $.data(this, 'formHash'); if (formHash != null && formHash !== $(this).serialize()) { hasChanged = true; return false; } }); return hasChanged; }; }).call(this, jQuery);
/*! * Small jQuery plugin to detect whether or not a form's values have been changed. * @see: https://gist.github.com/DrPheltRight/4131266 * Written by Luke Morton, licensed under MIT. Adapted for Bolt by Bob. */ (function ($) { $.fn.watchChanges = function () { // First, make sure the underlying textareas are updated with the content in the CKEditor fields. if (typeof CKEDITOR !== 'undefined') { for (var instanceName in CKEDITOR.instances) { CKEDITOR.instances[instanceName].updateElement(); } } return this.each(function () { $.data(this, 'formHash', $(this).serialize()); }); }; $.fn.hasChanged = function () { var hasChanged = false; // First, make sure the underlying textareas are updated with the content in the CKEditor fields. if (typeof CKEDITOR !== 'undefined') { for (var instanceName in CKEDITOR.instances) { CKEDITOR.instances[instanceName].updateElement(); } } this.each(function () { var formHash = $.data(this, 'formHash'); if (formHash != null && formHash !== $(this).serialize()) { hasChanged = true; return false; } }); return hasChanged; }; }).call(this, jQuery);
Check for existance of CKEditor
Check for existance of CKEditor
JavaScript
mit
Intendit/bolt,nantunes/bolt,Raistlfiren/bolt,electrolinux/bolt,HonzaMikula/masivnipostele,GDmac/bolt,marcin-piela/bolt,Raistlfiren/bolt,cdowdy/bolt,joshuan/bolt,romulo1984/bolt,xeddmc/bolt,joshuan/bolt,Intendit/bolt,joshuan/bolt,electrolinux/bolt,HonzaMikula/masivnipostele,bywatersolutions/reports-site,CarsonF/bolt,romulo1984/bolt,rarila/bolt,bywatersolutions/reports-site,Eiskis/bolt-base,Raistlfiren/bolt,kendoctor/bolt,codesman/bolt,marcin-piela/bolt,pygillier/bolt,lenvanessen/bolt,pygillier/bolt,HonzaMikula/bolt,hannesl/bolt,xeddmc/bolt,hannesl/bolt,winiceo/bolt,pygillier/bolt,one988/cm,HonzaMikula/masivnipostele,skript-cc/bolt,xeddmc/bolt,bywatersolutions/reports-site,richardhinkamp/bolt,lenvanessen/bolt,hugin2005/bolt,tekjava/bolt,Calinou/bolt,hugin2005/bolt,HonzaMikula/masivnipostele,nantunes/bolt,one988/cm,hannesl/bolt,rarila/bolt,CarsonF/bolt,Calinou/bolt,bolt/bolt,hugin2005/bolt,codesman/bolt,Eiskis/bolt-base,kendoctor/bolt,richardhinkamp/bolt,cdowdy/bolt,tekjava/bolt,GDmac/bolt,skript-cc/bolt,bolt/bolt,tekjava/bolt,rossriley/bolt,nikgo/bolt,kendoctor/bolt,codesman/bolt,electrolinux/bolt,xeddmc/bolt,Calinou/bolt,marcin-piela/bolt,romulo1984/bolt,rossriley/bolt,winiceo/bolt,lenvanessen/bolt,GawainLynch/bolt,rarila/bolt,marcin-piela/bolt,electrolinux/bolt,hannesl/bolt,tekjava/bolt,HonzaMikula/bolt,hugin2005/bolt,Intendit/bolt,rarila/bolt,GawainLynch/bolt,GawainLynch/bolt,joshuan/bolt,pygillier/bolt,richardhinkamp/bolt,Intendit/bolt,one988/cm,skript-cc/bolt,nikgo/bolt,nikgo/bolt,one988/cm,nantunes/bolt,winiceo/bolt,romulo1984/bolt,nikgo/bolt,richardhinkamp/bolt,rossriley/bolt,winiceo/bolt,HonzaMikula/bolt,codesman/bolt,cdowdy/bolt,CarsonF/bolt,rossriley/bolt,cdowdy/bolt,Eiskis/bolt-base,HonzaMikula/bolt,bolt/bolt,skript-cc/bolt,GDmac/bolt,bolt/bolt,CarsonF/bolt,nantunes/bolt,GDmac/bolt,kendoctor/bolt,Calinou/bolt,Eiskis/bolt-base,lenvanessen/bolt,Raistlfiren/bolt,bywatersolutions/reports-site,GawainLynch/bolt
--- +++ @@ -8,8 +8,10 @@ $.fn.watchChanges = function () { // First, make sure the underlying textareas are updated with the content in the CKEditor fields. - for (var instanceName in CKEDITOR.instances) { - CKEDITOR.instances[instanceName].updateElement(); + if (typeof CKEDITOR !== 'undefined') { + for (var instanceName in CKEDITOR.instances) { + CKEDITOR.instances[instanceName].updateElement(); + } } return this.each(function () { @@ -21,8 +23,10 @@ var hasChanged = false; // First, make sure the underlying textareas are updated with the content in the CKEditor fields. - for(var instanceName in CKEDITOR.instances) { - CKEDITOR.instances[instanceName].updateElement(); + if (typeof CKEDITOR !== 'undefined') { + for (var instanceName in CKEDITOR.instances) { + CKEDITOR.instances[instanceName].updateElement(); + } } this.each(function () {
2daa402d06f45c7f75f4909b59b022542363be5c
workers/social/index.js
workers/social/index.js
var argv = require('minimist')(process.argv); require('coffee-script').register(); module.exports = require('./lib/social/main.coffee');
require('coffee-script').register(); module.exports = require('./lib/social/main.coffee');
Remove unused command line options parsing code
Remove unused command line options parsing code Signed-off-by: Sonmez Kartal <d2d15c3d37396a5f2a09f8b42cf5f27d43a3fbde@koding.com>
JavaScript
agpl-3.0
kwagdy/koding-1,drewsetski/koding,drewsetski/koding,andrewjcasal/koding,acbodine/koding,szkl/koding,cihangir/koding,usirin/koding,koding/koding,sinan/koding,alex-ionochkin/koding,sinan/koding,sinan/koding,rjeczalik/koding,alex-ionochkin/koding,cihangir/koding,sinan/koding,usirin/koding,acbodine/koding,szkl/koding,jack89129/koding,szkl/koding,cihangir/koding,alex-ionochkin/koding,kwagdy/koding-1,rjeczalik/koding,usirin/koding,acbodine/koding,alex-ionochkin/koding,usirin/koding,alex-ionochkin/koding,andrewjcasal/koding,sinan/koding,mertaytore/koding,drewsetski/koding,sinan/koding,acbodine/koding,andrewjcasal/koding,andrewjcasal/koding,cihangir/koding,cihangir/koding,rjeczalik/koding,gokmen/koding,cihangir/koding,sinan/koding,cihangir/koding,jack89129/koding,gokmen/koding,andrewjcasal/koding,kwagdy/koding-1,koding/koding,koding/koding,cihangir/koding,mertaytore/koding,acbodine/koding,gokmen/koding,rjeczalik/koding,drewsetski/koding,jack89129/koding,gokmen/koding,drewsetski/koding,drewsetski/koding,szkl/koding,usirin/koding,koding/koding,mertaytore/koding,koding/koding,jack89129/koding,koding/koding,koding/koding,rjeczalik/koding,szkl/koding,alex-ionochkin/koding,rjeczalik/koding,usirin/koding,mertaytore/koding,andrewjcasal/koding,mertaytore/koding,alex-ionochkin/koding,jack89129/koding,gokmen/koding,kwagdy/koding-1,rjeczalik/koding,kwagdy/koding-1,acbodine/koding,andrewjcasal/koding,szkl/koding,acbodine/koding,mertaytore/koding,mertaytore/koding,szkl/koding,alex-ionochkin/koding,gokmen/koding,rjeczalik/koding,usirin/koding,jack89129/koding,gokmen/koding,jack89129/koding,sinan/koding,koding/koding,jack89129/koding,drewsetski/koding,usirin/koding,mertaytore/koding,acbodine/koding,kwagdy/koding-1,kwagdy/koding-1,andrewjcasal/koding,drewsetski/koding,kwagdy/koding-1,szkl/koding,gokmen/koding
--- +++ @@ -1,4 +1,2 @@ -var argv = require('minimist')(process.argv); - require('coffee-script').register(); module.exports = require('./lib/social/main.coffee');
a13cba3494c5fa4ccb86df8ed8df3d80f646ce1b
app.js
app.js
'use strict'; var nouns = [ 'cat', 'dog', 'mouse', 'house' ]; var firstNoun = ''; var secondNoun = ''; var metaphor = ''; var numberOfNouns = nouns.length; var lastNounIndex = nouns.length - 1; var nounIndex1 = 0; var nounIndex2 = 0; console.log('The list of nouns is ' + nouns); console.log('The first noun is ' + nouns[0]); console.log('The last noun is ' + nouns[lastNounIndex]); console.log('Number of nouns is ' + numberOfNouns); console.log('Noun Index 1 is initialized as ' + nounIndex1); console.log('Noun Index 2 is initialized as ' + nounIndex2); // Returns a random integer between min (included) and max (excluded) // Using Math.round() will give you a non-uniform distribution! function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } function generateMetaphor(nouns) { nounIndex1 = getRandomInt(0, numberOfNouns); nounIndex2 = getRandomInt(0, numberOfNouns); console.log('Noun Index 1 is set to ' + nounIndex1); console.log('Noun Index 2 is set to ' + nounIndex2); firstNoun = nouns[nounIndex1]; secondNoun = nouns[nounIndex2]; console.log('First noun is ' + firstNoun); console.log('Second noun is ' + secondNoun); metaphor = firstNoun + ' is a ' + secondNoun + '.'; console.log(metaphor); } generateMetaphor(nouns);
'use strict'; var nouns = [ 'cat', 'dog', 'mouse', 'house' ]; var firstNoun = ''; var secondNoun = ''; var metaphor = ''; var numberOfNouns = nouns.length; var nounIndex1 = 0; var nounIndex2 = 0; // Returns a random integer between min (included) and max (excluded) // Using Math.round() will give you a non-uniform distribution! function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } function generateMetaphor(nouns) { nounIndex1 = getRandomInt(0, numberOfNouns); nounIndex2 = getRandomInt(0, numberOfNouns); firstNoun = nouns[nounIndex1]; secondNoun = nouns[nounIndex2]; metaphor = firstNoun + ' is a ' + secondNoun + '.'; console.log(metaphor); } generateMetaphor(nouns);
Remove logging to console from debugging
Remove logging to console from debugging
JavaScript
mit
epan/thisisathat
--- +++ @@ -11,16 +11,8 @@ var metaphor = ''; var numberOfNouns = nouns.length; -var lastNounIndex = nouns.length - 1; var nounIndex1 = 0; var nounIndex2 = 0; - -console.log('The list of nouns is ' + nouns); -console.log('The first noun is ' + nouns[0]); -console.log('The last noun is ' + nouns[lastNounIndex]); -console.log('Number of nouns is ' + numberOfNouns); -console.log('Noun Index 1 is initialized as ' + nounIndex1); -console.log('Noun Index 2 is initialized as ' + nounIndex2); // Returns a random integer between min (included) and max (excluded) // Using Math.round() will give you a non-uniform distribution! @@ -32,14 +24,8 @@ nounIndex1 = getRandomInt(0, numberOfNouns); nounIndex2 = getRandomInt(0, numberOfNouns); - console.log('Noun Index 1 is set to ' + nounIndex1); - console.log('Noun Index 2 is set to ' + nounIndex2); - firstNoun = nouns[nounIndex1]; secondNoun = nouns[nounIndex2]; - - console.log('First noun is ' + firstNoun); - console.log('Second noun is ' + secondNoun); metaphor = firstNoun + ' is a ' + secondNoun + '.'; console.log(metaphor);
79b151c4fe8bb5f04fd529eb8e36e330902aa960
i2mx.js
i2mx.js
/* # # i2mx.js - v0.1-Alpha # Apache v2 License # */ // Create img2musicXML (abbreviated as i2mx) namespace var i2mx = i2mx || { }; // Create JsCheckup class (@TODO: Move to inside namespace) var JsCheckup = function() { this.divId = "i2mx-checkup"; this.activate = function() { var div = document.getElementById(this.divId); div.innerHTML = "No checklist for now, but img2musicXML loaded successfully!"; // @TODO: Multi-line } } var jsCheckup = new JsCheckup(); // @TODO: Use event listener instead of onload window.onload = function() { jsCheckup.activate(); }
/* # # i2mx.js - v0.1-Alpha # Apache v2 License # */ // Create img2musicXML (abbreviated as i2mx) namespace var i2mx = i2mx || { }; // Create JsCheckup class (@TODO: Move to inside namespace) var JsCheckup = function() { this.divId = "i2mx-checkup"; this.activate = function() { // @TODO: Use HTML generator // Initial values var div = document.getElementById(this.divId); var EOL = "<br>" var checkupText = ""; // Start testing checkupText += "Starting tests... " + EOL; if(window.File && window.FileReader && window.FileList && window.Blob) { checkupText += "File and Blob APIs -> OK " + EOL; } // Update DOM div.innerHTML = checkupText; } } var jsCheckup = new JsCheckup(); // @TODO: Use event listener instead of onload window.onload = function() { jsCheckup.activate(); }
Add File and Blob APIs testing.
Add File and Blob APIs testing.
JavaScript
apache-2.0
feikname/img2musicXML,feikname/img2musicXML
--- +++ @@ -13,9 +13,22 @@ this.divId = "i2mx-checkup"; this.activate = function() { + // @TODO: Use HTML generator + + // Initial values var div = document.getElementById(this.divId); + var EOL = "<br>" + var checkupText = ""; - div.innerHTML = "No checklist for now, but img2musicXML loaded successfully!"; // @TODO: Multi-line + // Start testing + checkupText += "Starting tests... " + EOL; + + if(window.File && window.FileReader && window.FileList && window.Blob) { + checkupText += "File and Blob APIs -> OK " + EOL; + } + + // Update DOM + div.innerHTML = checkupText; } }
b55033b51cdfccdd72d32cd5922032f44b822998
notable/static/js/views/password.js
notable/static/js/views/password.js
/** * @fileoverview Describes a password modal */ define([ 'text!templates/password.html', 'backbone', 'underscore' ], function(passwordModalTemplate) { return Backbone.View.extend({ events: { 'click .modal-footer .btn:first': 'hide', 'click .modal-footer .btn-primary': 'submit', 'submit form': 'submit', 'shown': 'setFocus' }, getModal: function() { return this.$('div').first(); }, getPassword: function() { return this._modal.find('input'); }, hide: function() { return this._modal.modal('hide'); }, render: function(collection) { this.$el.html(_.template(passwordModalTemplate)); this._modal = this.getModal(); return this; }, renderError: function(msg) { return this.$('.error').html(msg).show(); }, setFocus: function() { this.$('input').focus(); }, show: function(callback) { this.callback = callback; this._modal.modal({ backdrop: 'static', keyboard: true }); }, submit: function() { this.callback(); this.$('input').val(''); return false; } }); });
/** * @fileoverview Describes a password modal */ define([ 'text!templates/password.html', 'backbone', 'underscore' ], function(passwordModalTemplate) { return Backbone.View.extend({ events: { 'click .modal-footer .btn:first': 'hide', 'click .modal-footer .btn-primary': 'submit', 'submit form': 'submit', 'shown': 'setFocus' }, getModal: function() { return this.$('div').first(); }, getPassword: function() { return this._modal.find('input'); }, hide: function() { return this._modal.modal('hide'); }, render: function(collection) { this.$el.html(_.template(passwordModalTemplate)); this._modal = this.getModal(); return this; }, renderError: function(msg) { return this.$('.error').html(msg).show(); }, reset: function() { this.$('.error').html('').hide() }, setFocus: function() { this.$('input').focus(); }, show: function(callback) { this.reset(); this.callback = callback; this._modal.modal({ backdrop: 'static', keyboard: true }); }, submit: function() { this.callback(); this.$('input').val(''); return false; } }); });
Reset bootstrap alert before showing modal
[modal] Reset bootstrap alert before showing modal
JavaScript
mit
jmcfarlane/Notable,jmcfarlane/Notable,jmcfarlane/Notable,jmcfarlane/Notable
--- +++ @@ -37,11 +37,16 @@ return this.$('.error').html(msg).show(); }, + reset: function() { + this.$('.error').html('').hide() + }, + setFocus: function() { this.$('input').focus(); }, show: function(callback) { + this.reset(); this.callback = callback; this._modal.modal({ backdrop: 'static',
31d246013ae1647130f7edb927b429ef1af472c0
lib/web-debug-toolbar/assets/web-debug-toolbar.js
lib/web-debug-toolbar/assets/web-debug-toolbar.js
$(document).ready(function() { $("#web-debug-toolbar .hidden-panel").hide(); $("#web-debug-toolbar .panel-toggle-button").hover(function() { if ($("#web-debug-toolbar #" + this.rel).is(":hidden")) $("#web-debug-toolbar .hidden-panel").hide() $("#web-debug-toolbar #" + this.rel).toggle(); }); $("#web-debug-toolbar #toolbar-toggle-button").click(function() { $(this).text($("#web-debug-toolbar #toolbar-panels").is(":hidden") ? '>' : '<'); $("#web-debug-toolbar .hidden-panel").hide(); $("#web-debug-toolbar #toolbar-panels").toggle(); }); });
$(document).ready(function() { $("#web-debug-toolbar .hidden-panel").hide(); $("#web-debug-toolbar .panel-toggle-button").click(function() { if ($("#web-debug-toolbar #" + this.rel).is(":hidden")) $("#web-debug-toolbar .hidden-panel").hide() $("#web-debug-toolbar #" + this.rel).toggle(); }); $("#web-debug-toolbar #toolbar-toggle-button").click(function() { $(this).text($("#web-debug-toolbar #toolbar-panels").is(":hidden") ? '>' : '<'); $("#web-debug-toolbar .hidden-panel").hide(); $("#web-debug-toolbar #toolbar-panels").toggle(); }); });
Change event from hover to click to show the hidden-panels
Change event from hover to click to show the hidden-panels
JavaScript
mit
ludovic-henry/web-debug-toolbar,ludovic-henry/web-debug-toolbar
--- +++ @@ -1,7 +1,7 @@ $(document).ready(function() { $("#web-debug-toolbar .hidden-panel").hide(); - $("#web-debug-toolbar .panel-toggle-button").hover(function() { + $("#web-debug-toolbar .panel-toggle-button").click(function() { if ($("#web-debug-toolbar #" + this.rel).is(":hidden")) $("#web-debug-toolbar .hidden-panel").hide()
b8e447746418ab5b38b76efb25cc25d2f1218db2
dev/app/services/TbTable/TableBuilder/table-builder.service.js
dev/app/services/TbTable/TableBuilder/table-builder.service.js
tableBuilder.$inject = [ 'tableContent' ]; function tableBuilder (tableContent) { const service = { newTable: newTable, append: append, indexOf: indexOf, remove: remove }; function newTable (model) { const table = { headers: model.headers, rows: [] }; const data = model.data; const schema = model.schema; for (const obj of data) append(table, schema, obj); return table; } function append (table, schema, data) { if (!table || !schema || !data) return; const row = { elements: [], data: data }; for (const sc of schema) { let elem = tableContent.createNewElement(sc.type, sc.props, data); row.elements.push(elem); } table.rows.push(row); } function indexOf (table, data) { if (!table || !table.rows || !data) return -1; return table.rows.indexOf(data); } function remove (table, index) { if (!table || !index) return; if (typeof index === 'object') index = indexOf(table, index); if (index >= 0) table.rows.splice(index, 1); } return service; } module.exports = { name: 'tableBuilder', srvc: tableBuilder };
tableBuilder.$inject = [ 'tableContent' ]; function tableBuilder (tableContent) { const service = { newTable: newTable, emptyTable: emptyTable }; function newTable (schema, model) { const table = { headers: schema.headers, rows: [] }; for (const obj of model) append(table, schema.rows, obj); return table; } function append (table, rowSchema, data) { const row = { elements: [], data: data }; for (const sc of rowSchema) { let elem = tableContent.createNewElement(sc.type, sc.props, data); row.elements.push(elem); } table.rows.push(row); } function emptyTable () { return { headers: [], rows: [] }; } return service; } module.exports = { name: 'tableBuilder', srvc: tableBuilder };
Remove unnecessary functions and add emptyTable
Remove unnecessary functions and add emptyTable
JavaScript
mit
Tribu-Anal/Vinculacion-Front-End,Tribu-Anal/Vinculacion-Front-End,Tribu-Anal/Manejo-Horas-de-Vinculacion-UNITEC,Tribu-Anal/Manejo-Horas-de-Vinculacion-UNITEC
--- +++ @@ -3,35 +3,28 @@ function tableBuilder (tableContent) { const service = { newTable: newTable, - append: append, - indexOf: indexOf, - remove: remove + emptyTable: emptyTable }; - function newTable (model) { + function newTable (schema, model) { const table = { - headers: model.headers, + headers: schema.headers, rows: [] }; - const data = model.data; - const schema = model.schema; - - for (const obj of data) - append(table, schema, obj); + for (const obj of model) + append(table, schema.rows, obj); return table; } - function append (table, schema, data) { - if (!table || !schema || !data) return; - + function append (table, rowSchema, data) { const row = { elements: [], data: data }; - for (const sc of schema) { + for (const sc of rowSchema) { let elem = tableContent.createNewElement(sc.type, sc.props, data); row.elements.push(elem); } @@ -39,19 +32,11 @@ table.rows.push(row); } - function indexOf (table, data) { - if (!table || !table.rows || !data) return -1; - return table.rows.indexOf(data); - } - - function remove (table, index) { - if (!table || !index) return; - - if (typeof index === 'object') - index = indexOf(table, index); - - if (index >= 0) - table.rows.splice(index, 1); + function emptyTable () { + return { + headers: [], + rows: [] + }; } return service;
4d324dd4ca907d6943d3e523db11bf5d0b12abeb
both/lib/constants.js
both/lib/constants.js
JOB_TYPES = ["Full Time", "Hourly Contract", "Term Contract", "Mentoring", "Bounty", "Open Source", "Volunteer", "Other"]; SUMMERNOTE_OPTIONS = { type: 'summernote', height: 300, minHeight: 300, toolbar: [ ['style', ['style']], ['font', ['bold', 'italic', 'underline', 'clear']], ['para', ['ul', 'ol']], ['insert', ['link','hr']], ['misc', ['codeview']] ], styleWithSpan: false }; STATUSES = ["pending","active","flagged","inactive","filled"];
JOB_TYPES = ["Full Time", "Part Time", "Hourly Contract", "Term Contract", "Mentoring", "Internship", "Bounty", "Open Source", "Volunteer", "Other"]; SUMMERNOTE_OPTIONS = { type: 'summernote', height: 300, minHeight: 300, toolbar: [ ['style', ['style']], ['font', ['bold', 'italic', 'underline', 'clear']], ['para', ['ul', 'ol']], ['insert', ['link','hr']], ['misc', ['codeview']] ], styleWithSpan: false }; STATUSES = ["pending","active","flagged","inactive","filled"];
Add part time and internship job types
Add part time and internship job types
JavaScript
mit
nate-strauser/wework,nate-strauser/wework
--- +++ @@ -1,4 +1,4 @@ -JOB_TYPES = ["Full Time", "Hourly Contract", "Term Contract", "Mentoring", "Bounty", "Open Source", "Volunteer", "Other"]; +JOB_TYPES = ["Full Time", "Part Time", "Hourly Contract", "Term Contract", "Mentoring", "Internship", "Bounty", "Open Source", "Volunteer", "Other"]; SUMMERNOTE_OPTIONS = { type: 'summernote',
8c8449405d1926240c6023e21c247598a0dafbe6
src/parser/druid/guardian/modules/features/MitigationCheck.js
src/parser/druid/guardian/modules/features/MitigationCheck.js
import CoreMitigationCheck from 'parser/shared/modules/MitigationCheck'; import SPELLS from 'common/SPELLS'; class MitigationCheck extends CoreMitigationCheck { constructor(...args){ super(...args); this.buffCheck = [SPELLS.IRONFUR.id, SPELLS.FRENZIED_REGENERATION.id, SPELLS.BARKSKIN.id, SPELLS.SURVIVAL_INSTINCTS.id]; } } export default MitigationCheck;
import CoreMitigationCheck from 'parser/shared/modules/MitigationCheck'; import SPELLS from 'common/SPELLS'; class MitigationCheck extends CoreMitigationCheck { constructor(...args){ super(...args); this.buffCheckPhysical = [ SPELLS.IRONFUR.id, ]; this.buffCheckPhysAndMag = [ SPELLS.FRENZIED_REGENERATION.id, SPELLS.BARKSKIN.id, SPELLS.SURVIVAL_INSTINCTS.id, ]; } } export default MitigationCheck;
Update guardian druid for soft mitigation check damage schools.
Update guardian druid for soft mitigation check damage schools.
JavaScript
agpl-3.0
sMteX/WoWAnalyzer,fyruna/WoWAnalyzer,fyruna/WoWAnalyzer,anom0ly/WoWAnalyzer,sMteX/WoWAnalyzer,yajinni/WoWAnalyzer,Juko8/WoWAnalyzer,sMteX/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,anom0ly/WoWAnalyzer,yajinni/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,Juko8/WoWAnalyzer,anom0ly/WoWAnalyzer,anom0ly/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,ronaldpereira/WoWAnalyzer,yajinni/WoWAnalyzer,fyruna/WoWAnalyzer,Juko8/WoWAnalyzer,yajinni/WoWAnalyzer,ronaldpereira/WoWAnalyzer,ronaldpereira/WoWAnalyzer
--- +++ @@ -5,10 +5,15 @@ class MitigationCheck extends CoreMitigationCheck { constructor(...args){ super(...args); - this.buffCheck = [SPELLS.IRONFUR.id, - SPELLS.FRENZIED_REGENERATION.id, - SPELLS.BARKSKIN.id, - SPELLS.SURVIVAL_INSTINCTS.id]; + this.buffCheckPhysical = [ + SPELLS.IRONFUR.id, + ]; + + this.buffCheckPhysAndMag = [ + SPELLS.FRENZIED_REGENERATION.id, + SPELLS.BARKSKIN.id, + SPELLS.SURVIVAL_INSTINCTS.id, + ]; } }
bba9d73913ecc2aac9b86368606617893f95132b
migro/filestack/dev_console.js
migro/filestack/dev_console.js
(function () { function b64EncodeUnicode(str) { return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) { return String.fromCharCode('0x' + p1); })); } var $btnLoadMore = jQuery('#console-loadmore'); var handles = []; var loadMoreCallback = function (event, jqXHR, options, data) { if (options.url.startsWith(window.location.pathname + '/')) { if (data) { $btnLoadMore.trigger('click', true); } else { $('a.js_download').each(function (index, item) { handles.push($(item).attr('href')); }); var content = (b64EncodeUnicode(handles.join('\n'))); jQuery('h4.subheading').html('<a id="download-files-list" href="data:application/octet-stream;charset=utf-8;base64,' + content + '">Download files list</a>') } } }; jQuery(document).ajaxSuccess(loadMoreCallback); $btnLoadMore.trigger('click', true); })();
(function () { function b64EncodeUnicode(str) { return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) { return String.fromCharCode('0x' + p1); })); } var $btnLoadMore = jQuery('#console-loadmore'); var handles = []; var loadMoreCallback = function (event, jqXHR, options, data) { if (options.url.startsWith(window.location.pathname + '/')) { if ($btnLoadMore.attr('disabled') !== 'disabled'){ console.log('Downloading more data for files list...'); $btnLoadMore.trigger('click', true); } else { console.log('Done collect your files links!'); console.log('Preparing file for download...'); $('a.js_download').each(function (index, item) { handles.push($(item).attr('href')); }); var content = (b64EncodeUnicode(handles.join('\n'))); jQuery('h4.subheading').html( '<a id="download_files-list" ' + 'download="filestack_files_list.txt" ' + 'href="data:application/octet-stream;charset=utf-8;base64,' + content + '">' + 'Download files list' + '</a>' ); console.log('Done preparing file for download!\n' + 'Now simply click on \'Download files list\' link in the header of the page!'); } } }; jQuery(document).ajaxSuccess(loadMoreCallback); console.log('Staring collect your files links...'); $btnLoadMore.trigger('click', true); })();
Refactor filestack dev console script:
Refactor filestack dev console script: - Add progress notifications - Add proper next page handling - Add filename and extension to the result file
JavaScript
mit
uploadcare/migro,uploadcare/migro
--- +++ @@ -12,19 +12,28 @@ var loadMoreCallback = function (event, jqXHR, options, data) { if (options.url.startsWith(window.location.pathname + '/')) { - if (data) { + if ($btnLoadMore.attr('disabled') !== 'disabled'){ + console.log('Downloading more data for files list...'); $btnLoadMore.trigger('click', true); } else { + console.log('Done collect your files links!'); + console.log('Preparing file for download...'); $('a.js_download').each(function (index, item) { handles.push($(item).attr('href')); }); var content = (b64EncodeUnicode(handles.join('\n'))); - jQuery('h4.subheading').html('<a id="download-files-list" href="data:application/octet-stream;charset=utf-8;base64,' + content + '">Download files list</a>') + jQuery('h4.subheading').html( + '<a id="download_files-list" ' + + 'download="filestack_files_list.txt" ' + + 'href="data:application/octet-stream;charset=utf-8;base64,' + content + + '">' + 'Download files list' + '</a>' + ); + console.log('Done preparing file for download!\n' + + 'Now simply click on \'Download files list\' link in the header of the page!'); } } }; - jQuery(document).ajaxSuccess(loadMoreCallback); + console.log('Staring collect your files links...'); $btnLoadMore.trigger('click', true); - })();
b2719123d67f75bc637bf282c53c1b71c56bbf92
lib/components/map/mapbox-gl.js
lib/components/map/mapbox-gl.js
import L from 'leaflet' import {} from 'mapbox-gl-leaflet' import {GridLayer, withLeaflet} from 'react-leaflet' const accessToken = process.env.MAPBOX_ACCESS_TOKEN const attribution = `© <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> <strong><a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a></strong>` const defaultStyle = 'mapbox/light-v10' const getStyle = (style = defaultStyle) => `mapbox://styles/${style}` class MapBoxGLLayer extends GridLayer { componentDidUpdate() { if (this.leafletElement && this.leafletElement._glMap) { this.leafletElement._glMap.resize() } } createLeafletElement(props) { return L.mapboxGL({ accessToken, attribution, pane: props.leaflet.map._panes.tilePane, style: getStyle(props.style) }) } } export default withLeaflet(MapBoxGLLayer)
import L from 'leaflet' import {} from 'mapbox-gl-leaflet' import {GridLayer, withLeaflet} from 'react-leaflet' const accessToken = process.env.MAPBOX_ACCESS_TOKEN const attribution = `© <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> <strong><a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a></strong>` const defaultStyle = 'mapbox/light-v10' const getStyle = (style = defaultStyle) => `mapbox://styles/${style}` class MapBoxGLLayer extends GridLayer { componentDidUpdate() { if (this.leafletElement && this.leafletElement._glMap) { this.leafletElement._glMap.resize() } } createLeafletElement(props) { return L.mapboxGL({ accessToken, attribution, interactive: false, pane: props.leaflet.map._panes.tilePane, style: getStyle(props.style) }) } } export default withLeaflet(MapBoxGLLayer)
Disable interactivity on the mapbox gl layer since it is handled by leaflet
perf(mapboxgl): Disable interactivity on the mapbox gl layer since it is handled by leaflet
JavaScript
mit
conveyal/analysis-ui,conveyal/analysis-ui,conveyal/analysis-ui
--- +++ @@ -18,6 +18,7 @@ return L.mapboxGL({ accessToken, attribution, + interactive: false, pane: props.leaflet.map._panes.tilePane, style: getStyle(props.style) })
dde56b09bc441f5628b541a76c7bc2486b980c4c
src/extensions/subjects/tag_subject_tool.js
src/extensions/subjects/tag_subject_tool.js
var Application = require("substance-application"); var Component = Application.Component; var $$ = React.createElement; var _ = require("underscore"); // TagSubjectTool // ---------------- var TagSubjectTool = React.createClass({ displayName: "TagSubjectTool", handleClick: function(e) { // this.props.switchContext("tagsubject"); console.error('not yet implemented'); // TODO: // - create new subject_reference at position x in text // - switch state.contextId to editSubjectReference with subjectReferenceId=x }, render: function() { return $$("a", { className: 'tag-subject-tool-component tool', href: "#", dangerouslySetInnerHTML: {__html: '<i class="fa fa-tag"></i>'}, title: 'Tag Subject', onClick: this.handleClick }); } }); module.exports = TagSubjectTool;
var $$ = React.createElement; var _ = require("underscore"); var util = require("substance-util"); // TagSubjectTool // ---------------- var TagSubjectTool = React.createClass({ displayName: "TagSubjectTool", handleClick: function(e) { var doc = this.props.doc; var writer = this.props.writer; // TODO: determine using current selection var path = ["text_3", "content"]; var range = [40, 80]; var subjectReference = { id: "subject_reference_" + util.uuid(), type: "subject_reference", path: path, range: range, target: [] // no subjects assigned for the time being }; // // Display reference in editor doc.create(subjectReference); // // Some fake action until editor is ready var textNode = doc.get("text_3"); var newContent = textNode.content += ' and <span data-id="'+subjectReference.id+'" class="annotation subject-reference">'+subjectReference.id+'</span>'; doc.set(["text_3", "content"], newContent); // Switch state to highlight newly created reference writer.replaceState({ contextId: "editSubjectReference", subjectReferenceId: subjectReference.id }); }, render: function() { return $$("a", { className: 'tag-subject-tool-component tool', href: "#", dangerouslySetInnerHTML: {__html: '<i class="fa fa-tag"></i>'}, title: 'Tag Subject', onClick: this.handleClick }); } }); module.exports = TagSubjectTool;
Create subject annotation when toggling subject tool.
Create subject annotation when toggling subject tool.
JavaScript
mit
substance/archivist-composer,substance/archivist-composer
--- +++ @@ -1,7 +1,6 @@ -var Application = require("substance-application"); -var Component = Application.Component; var $$ = React.createElement; var _ = require("underscore"); +var util = require("substance-util"); // TagSubjectTool // ---------------- @@ -10,11 +9,34 @@ displayName: "TagSubjectTool", handleClick: function(e) { - // this.props.switchContext("tagsubject"); - console.error('not yet implemented'); - // TODO: - // - create new subject_reference at position x in text - // - switch state.contextId to editSubjectReference with subjectReferenceId=x + var doc = this.props.doc; + var writer = this.props.writer; + + // TODO: determine using current selection + var path = ["text_3", "content"]; + var range = [40, 80]; + + var subjectReference = { + id: "subject_reference_" + util.uuid(), + type: "subject_reference", + path: path, + range: range, + target: [] // no subjects assigned for the time being + }; + + // // Display reference in editor + doc.create(subjectReference); + + // // Some fake action until editor is ready + var textNode = doc.get("text_3"); + var newContent = textNode.content += ' and <span data-id="'+subjectReference.id+'" class="annotation subject-reference">'+subjectReference.id+'</span>'; + doc.set(["text_3", "content"], newContent); + + // Switch state to highlight newly created reference + writer.replaceState({ + contextId: "editSubjectReference", + subjectReferenceId: subjectReference.id + }); }, render: function() {
f41f91915dd312173e2c84567cf5977397aa0b19
src/containers/Restricted.js
src/containers/Restricted.js
import React from 'react'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import { showModalWindow } from 'actions/ModalActions'; import CheckAuth from 'components/CheckAuth'; const RestrictedWrapper = (WrappedComponent) => { const Restricted = withRouter(React.createClass({ componentWillMount () { const { me, location, router } = this.props; if (__CLIENT__ && !me.id) { if (location.action === 'POP') { router.replace( `/auth/login?next=${encodeURIComponent(location.pathname)}` ); } else { router.goBack(); this.props.showModalWindow('auth', location); } } }, render () { return ( <CheckAuth me={this.props.me}> <WrappedComponent {...this.props} /> </CheckAuth> ); } })); const mapStateToProps = (state) => (state); const mapDispatchToProps = (dispatch) => { return { showModalWindow: (type, location) => dispatch(showModalWindow(type, location)) }; }; return connect( mapStateToProps, mapDispatchToProps )(Restricted); }; export default RestrictedWrapper;
import React from 'react'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import { showModalWindow } from 'actions/ModalActions'; import CheckAuth from 'components/CheckAuth'; const RestrictedWrapper = (WrappedComponent) => { const Restricted = withRouter(React.createClass({ componentWillMount () { const { me, location, router } = this.props; if (__CLIENT__ && !me.id) { if (location.action === 'POP') { router.replace( `/auth/login?next=${encodeURIComponent(location.pathname)}` ); } else { router.goBack(); this.props.showModalWindow({ type: 'auth' }, location); } } }, render () { return ( <CheckAuth me={this.props.me}> <WrappedComponent {...this.props} /> </CheckAuth> ); } })); const mapStateToProps = (state) => (state); const mapDispatchToProps = (dispatch) => { return { showModalWindow: (type, location) => dispatch(showModalWindow(type, location)) }; }; return connect( mapStateToProps, mapDispatchToProps )(Restricted); }; export default RestrictedWrapper;
Fix rtestricted route showing modal
Fix rtestricted route showing modal
JavaScript
apache-2.0
iris-dni/iris-frontend,iris-dni/iris-frontend,iris-dni/iris-frontend
--- +++ @@ -16,7 +16,7 @@ ); } else { router.goBack(); - this.props.showModalWindow('auth', location); + this.props.showModalWindow({ type: 'auth' }, location); } } },
67ba39eb790d8c7baaf51025dd101bcc9cf2190c
server/Queue/getQueue.js
server/Queue/getQueue.js
const db = require('sqlite') const squel = require('squel') async function getQueue (roomId) { const result = [] const entities = {} try { const q = squel.select() .field('queueId, mediaId, userId') .field('media.title, media.duration, media.provider, users.name AS username, artists.name AS artist') .from('queue') .join('users USING(userId)') .join('media USING(mediaId)') .join('artists USING (artistId)') .where('roomId = ?', roomId) .order('queueId') const { text, values } = q.toParam() const rows = await db.all(text, values) for (const row of rows) { result.push(row.queueId) entities[row.queueId] = row } } catch (err) { return Promise.reject(err) } return { result, entities } } module.exports = getQueue
const db = require('sqlite') const squel = require('squel') async function getQueue (roomId) { const result = [] const entities = {} try { const q = squel.select() .field('queueId, mediaId, userId') .field('media.title, media.duration, media.provider, media.providerData') .field('users.name AS username, artists.name AS artist') .from('queue') .join('users USING(userId)') .join('media USING(mediaId)') .join('artists USING (artistId)') .where('roomId = ?', roomId) .order('queueId') const { text, values } = q.toParam() const rows = await db.all(text, values) for (const row of rows) { result.push(row.queueId) row.providerData = JSON.parse(row.providerData) entities[row.queueId] = row } } catch (err) { return Promise.reject(err) } return { result, entities } } module.exports = getQueue
Include providerData for queue items
Include providerData for queue items
JavaScript
isc
bhj/karaoke-forever,bhj/karaoke-forever
--- +++ @@ -8,7 +8,8 @@ try { const q = squel.select() .field('queueId, mediaId, userId') - .field('media.title, media.duration, media.provider, users.name AS username, artists.name AS artist') + .field('media.title, media.duration, media.provider, media.providerData') + .field('users.name AS username, artists.name AS artist') .from('queue') .join('users USING(userId)') .join('media USING(mediaId)') @@ -21,6 +22,7 @@ for (const row of rows) { result.push(row.queueId) + row.providerData = JSON.parse(row.providerData) entities[row.queueId] = row } } catch (err) {
a65add662ca18941d6e38ca80f0d268cd8098f13
public/js/jsondates.js
public/js/jsondates.js
/** * convert json dates to date objects * for all requests using the $http service * * @return callback for app.config() */ define([], function () { 'use strict'; var regexIso8601 = /^(\d{4}|\+\d{6})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})\.(\d{1,})(Z|([\-+])(\d{2}):(\d{2}))?)?)?)?$/; function convertDateStringsToDates(input) { // Ignore things that aren't objects. if (typeof input !== "object") { return input; } for (var key in input) { if (!input.hasOwnProperty(key)) { continue; } var value = input[key]; var match; // Check for string properties which look like dates. if (typeof value === "string" && (match = value.match(regexIso8601))) { var milliseconds = Date.parse(match[0]); if (!isNaN(milliseconds)) { input[key] = new Date(milliseconds); } } else if (typeof value === "object") { // Recurse into object convertDateStringsToDates(value); } } } return function($httpProvider) { $httpProvider.defaults.transformResponse.push(function(responseData) { convertDateStringsToDates(responseData); return responseData; }); }; });
/** * convert json dates to date objects * for all requests using the $http service * * @return callback for app.config() */ define([], function () { 'use strict'; var regexIso8601 = /^(\d{4}|\+\d{6})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})\.(\d{1,})(Z|([\-+])(\d{2}):(\d{2}))?)?)?)?$/; function convertDateStringsToDates(input) { // Ignore things that aren't objects. if (typeof input !== "object") { return input; } for (var key in input) { if (!input.hasOwnProperty(key)) { continue; } var value = input[key]; var match; // Check for string properties which look like dates. if (typeof value === "string" && (match = value.match(regexIso8601))) { if (!match[1] || !match[2] || !match[3] || !match[4] || !match[5] || !match[6]) { // Require at least year mont day hour minute second continue; } var milliseconds = Date.parse(match[0]); if (!isNaN(milliseconds)) { input[key] = new Date(milliseconds); } } else if (typeof value === "object") { // Recurse into object convertDateStringsToDates(value); } } } return function($httpProvider) { $httpProvider.defaults.transformResponse.push(function(responseData) { convertDateStringsToDates(responseData); return responseData; }); }; });
Fix bug with automatic date transformations
Fix bug with automatic date transformations
JavaScript
mit
gadael/gadael,gadael/gadael
--- +++ @@ -25,6 +25,10 @@ var match; // Check for string properties which look like dates. if (typeof value === "string" && (match = value.match(regexIso8601))) { + if (!match[1] || !match[2] || !match[3] || !match[4] || !match[5] || !match[6]) { + // Require at least year mont day hour minute second + continue; + } var milliseconds = Date.parse(match[0]); if (!isNaN(milliseconds)) { input[key] = new Date(milliseconds);
5c07f22de61a6e96699819b45d4682297c66f0b2
index.js
index.js
/* * decaffeinate suggestions: * DS101: Remove unnecessary use of Array.from * DS102: Remove unnecessary code created because of implicit returns * DS205: Consider reworking code to avoid use of IIFEs * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const fs = require('fs'); // eslint-disable-line id-length const path = require('path'); module.exports = function (robot, scripts) { const scriptsPath = path.resolve(__dirname, 'src'); return fs.exists(scriptsPath, (exists) => { // eslint-disable-line consistent-return if (exists) { return (() => { const result = []; for (const script of Array.from(fs.readdirSync(scriptsPath))) { // eslint-disable-line no-sync if ((scripts !== null) && !Array.from(scripts).includes('*')) { if (Array.from(scripts).includes(script)) { result.push(robot.loadFile(scriptsPath, script)); } } else { result.push(robot.loadFile(scriptsPath, script)); } } return result; })(); } }); };
/* * decaffeinate suggestions: * DS101: Remove unnecessary use of Array.from * DS102: Remove unnecessary code created because of implicit returns * DS205: Consider reworking code to avoid use of IIFEs * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const fs = require('fs'); // eslint-disable-line id-length const path = require('path'); module.exports = function (robot, scripts) { const scriptsPath = path.resolve(__dirname, 'src'); return fs.exists(scriptsPath, (exists) => { // eslint-disable-line consistent-return if (exists) { return (() => { const result = []; for (const script of Array.from(fs.readdirSync(scriptsPath))) { // eslint-disable-line no-sync if (scripts && !Array.from(scripts).includes('*')) { if (Array.from(scripts).includes(script)) { result.push(robot.loadFile(scriptsPath, script)); } } else { result.push(robot.loadFile(scriptsPath, script)); } } return result; })(); } }); };
Fix undefined error in scripts
Fix undefined error in scripts
JavaScript
mit
patsissons/hubot-giphy
--- +++ @@ -18,7 +18,7 @@ const result = []; for (const script of Array.from(fs.readdirSync(scriptsPath))) { // eslint-disable-line no-sync - if ((scripts !== null) && !Array.from(scripts).includes('*')) { + if (scripts && !Array.from(scripts).includes('*')) { if (Array.from(scripts).includes(script)) { result.push(robot.loadFile(scriptsPath, script)); }
5309b9ab76d9b6d244c44582de5ed6d8ba170fa8
index.js
index.js
"use strict"; hex.Transform = require('./hex_transform'); hex.ChunkedTransform = require('./chunked_hex_transform'); module.exports = hex; function hex(buffer, options) { if (!options.offsetWidth) { options.offsetWidth = 2 * Math.ceil(buffer.length.toString(16).length / 2); } var stream = hex.Transform(options); stream.write(buffer); stream.end(); return stream.read(); }
"use strict"; hex.Transform = require('./hex_transform'); hex.ChunkedTransform = require('./chunked_hex_transform'); module.exports = hex; function hex(buffer, options) { options = options || {}; if (!options.offsetWidth) { options.offsetWidth = 2 * Math.ceil(buffer.length.toString(16).length / 2); } var stream = hex.Transform(options); stream.write(buffer); stream.end(); return stream.read(); }
Fix derp in primary interface
Fix derp in primary interface
JavaScript
mit
kriskowal/hexer,jcorbin/hexer
--- +++ @@ -6,6 +6,7 @@ module.exports = hex; function hex(buffer, options) { + options = options || {}; if (!options.offsetWidth) { options.offsetWidth = 2 * Math.ceil(buffer.length.toString(16).length / 2); }
8a1db8513c44695f52ac3ed2cd105c389f8f8518
index.js
index.js
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-cli-nouislider', included: function(app) { this._super.included(app); if(!process.env.EMBER_CLI_FASTBOOT) { // Fix for loading it in addons/engines if (typeof app.import !== 'function' && app.app) { app = app.app; } app.import({ development: app.bowerDirectory + '/nouislider/distribute/nouislider.js', production: app.bowerDirectory + '/nouislider/distribute/nouislider.min.js' }); app.import(app.bowerDirectory + '/nouislider/distribute/nouislider.min.css'); app.import('vendor/nouislider/shim.js', { exports: { 'noUiSlider': ['default'] } }); } } };
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-cli-nouislider', included: function(app) { this._super.included(app); if(!process.env.EMBER_CLI_FASTBOOT) { // Fix for loading it in addons/engines app = recursivelyFindApp(app); app.import({ development: app.bowerDirectory + '/nouislider/distribute/nouislider.js', production: app.bowerDirectory + '/nouislider/distribute/nouislider.min.js' }); app.import(app.bowerDirectory + '/nouislider/distribute/nouislider.min.css'); app.import('vendor/nouislider/shim.js', { exports: { 'noUiSlider': ['default'] } }); } } }; function recursivelyFindApp(app) { if (app.import) { return app; } return recursivelyFindApp(app.app); }
Improve handling of nested usage
Improve handling of nested usage
JavaScript
mit
kennethkalmer/ember-cli-nouislider,kennethkalmer/ember-cli-nouislider,kennethkalmer/ember-cli-nouislider
--- +++ @@ -9,9 +9,7 @@ if(!process.env.EMBER_CLI_FASTBOOT) { // Fix for loading it in addons/engines - if (typeof app.import !== 'function' && app.app) { - app = app.app; - } + app = recursivelyFindApp(app); app.import({ development: app.bowerDirectory + '/nouislider/distribute/nouislider.js', @@ -25,3 +23,10 @@ } } }; + +function recursivelyFindApp(app) { + if (app.import) { + return app; + } + return recursivelyFindApp(app.app); +}
4278b190dc8088ab38672b5674fa5066fe427ba8
index.js
index.js
var fs = require("fs"); var path = require("path"); var acme = require("acme/acme.json"); if (typeof(acme) !== 'undefined' && (!acme.hasOwnProperty("DomainsCertificate") || !acme.DomainsCertificate.hasOwnProperty("Certs"))) { console.log("Nothing to do"); } else { if(typeof(acme) !== 'undefined'){ for (var cert of acme.DomainsCertificate.Certs) { let domain = cert.Certificate.Domain; var certDump = new Buffer(cert.Certificate.Certificate, 'base64'); var keyDump = new Buffer(cert.Certificate.PrivateKey, 'base64'); fs.writeFileSync(path.join(__dirname, "certs/" + domain + ".crt"), certDump); fs.writeFileSync(path.join(__dirname, "certs/" + domain + ".key"), keyDump); } console.log("Successfully write all your acme certs & keys"); } }
var fs = require("fs"); var path = require("path"); var acme = require(__dirname + "/acme/acme.json"); if (typeof(acme) !== 'undefined' && (!acme.hasOwnProperty("DomainsCertificate") || !acme.DomainsCertificate.hasOwnProperty("Certs"))) { console.log("Nothing to do"); } else { if(typeof(acme) !== 'undefined'){ for (var cert of acme.DomainsCertificate.Certs) { let domain = cert.Certificate.Domain; var certDump = new Buffer(cert.Certificate.Certificate, 'base64'); var keyDump = new Buffer(cert.Certificate.PrivateKey, 'base64'); fs.writeFileSync(path.join(__dirname, "certs/" + domain + ".crt"), certDump); fs.writeFileSync(path.join(__dirname, "certs/" + domain + ".key"), keyDump); } console.log("Successfully write all your acme certs & keys"); } }
Fix : Correcting path for acme.json
Fix : Correcting path for acme.json
JavaScript
mit
dalim-it/docker-images,dalim-it/docker-images,dalim-it/docker-images
--- +++ @@ -1,6 +1,6 @@ var fs = require("fs"); var path = require("path"); -var acme = require("acme/acme.json"); +var acme = require(__dirname + "/acme/acme.json"); if (typeof(acme) !== 'undefined' && (!acme.hasOwnProperty("DomainsCertificate") || !acme.DomainsCertificate.hasOwnProperty("Certs"))) {
258906b161ddc783c21b918a34d264363c461daf
index.js
index.js
var _ = require('lodash'); exports.register = function (plugin, options, next) { var environment = process.env.NODE_ENV || 'development'; // Hook onto the 'onPostHandler' plugin.ext('onPostHandler', function (request, next) { // Get the response object var response = request.response; // Check to see if the response is a view if (response.variety === 'view') { if(_.isEmpty(response.source.context.assets)){ response.source.context.assets = {}; } response.source.context.assets = options[environment]; } return next(); }); return next(); }; exports.register.attributes = { pkg: require("./package.json") };
var _ = require('lodash'); exports.register = function (plugin, options, next) { var environment = process.env.NODE_ENV || 'development'; // Hook onto the 'onPostHandler' plugin.ext('onPostHandler', function (request, next) { // Get the response object var response = request.response; // Check to see if the response is a view if (response.variety === 'view') { if(_.isEmpty(response.source.context)){ response.source.context = {}; } if(_.isEmpty(response.source.context.assets)){ response.source.context.assets = {}; } response.source.context.assets = options[environment]; } return next(); }); return next(); }; exports.register.attributes = { pkg: require("./package.json") };
Fix issue with error when the context object is not set
Fix issue with error when the context object is not set
JavaScript
mit
poeticninja/hapi-assets
--- +++ @@ -11,10 +11,15 @@ // Check to see if the response is a view if (response.variety === 'view') { - if(_.isEmpty(response.source.context.assets)){ - response.source.context.assets = {}; - } - response.source.context.assets = options[environment]; + + if(_.isEmpty(response.source.context)){ + response.source.context = {}; + } + + if(_.isEmpty(response.source.context.assets)){ + response.source.context.assets = {}; + } + response.source.context.assets = options[environment]; } return next(); });
2b924c9b780e3266b1eba47b8e657ac82ad59996
index.js
index.js
var sweet = require('sweet.js'); var gutil = require('gulp-util'); var applySourceMap = require('vinyl-sourcemaps-apply'); var es = require('event-stream'); var merge = require('merge'); module.exports = function(opts) { var moduleCache = {}; return es.through(function(file) { if(file.isNull()) { return this.emit('data', file); } if(file.isStream()) { return this.emit( 'error', new Error('gulp-sweetjs: Streaming not supported') ); } var dest = gutil.replaceExtension(file.path, '.js'); opts = merge({ sourceMap: !!file.sourceMap, filename: file.path, modules: [], readtables: [] }, opts); opts.modules = opts.modules.map(function(mod) { if(moduleCache[mod]) { return moduleCache[mod]; } moduleCache[mod] = sweet.loadNodeModule(process.cwd(), mod); return moduleCache[mod]; }); opts.readtables.forEach(function(mod) { sweet.setReadtable(mod); }); try { var res = sweet.compile(file.contents.toString('utf8'), opts); } catch(err) { console.log('error'); return this.emit('error', err); } if(res.sourceMap) { applySourceMap(file, res.sourceMap); } file.contents = new Buffer(res.code); file.path = dest; this.emit('data', file); }); };
var sweet = require('sweet.js'); var gutil = require('gulp-util'); var applySourceMap = require('vinyl-sourcemaps-apply'); var es = require('event-stream'); var merge = require('merge'); module.exports = function(opts) { if(opts.modules){ opts.modules = opts.modules.map(function(mod) { return sweet.loadNodeModule(process.cwd(), mod); }); } if(opts.readtables){ opts.readtables.forEach(function(mod) { sweet.setReadtable(mod); }); } return es.through(function(file) { if(file.isNull()) { return this.emit('data', file); } if(file.isStream()) { return this.emit( 'error', new Error('gulp-sweetjs: Streaming not supported') ); } var dest = gutil.replaceExtension(file.path, '.js'); opts = merge({ sourceMap: !!file.sourceMap, filename: file.path, }, opts); try { var res = sweet.compile(file.contents.toString('utf8'), opts); } catch(err) { console.log('error'); return this.emit('error', err); } if(res.sourceMap) { applySourceMap(file, res.sourceMap); } file.contents = new Buffer(res.code); file.path = dest; this.emit('data', file); }); };
Load modules and set readtables only once
Load modules and set readtables only once Don't re-setup modules and readtables for each file to prevent the module cache from breaking the plugin when processing multiple files.
JavaScript
bsd-2-clause
jlongster/gulp-sweetjs
--- +++ @@ -5,7 +5,18 @@ var merge = require('merge'); module.exports = function(opts) { - var moduleCache = {}; + + if(opts.modules){ + opts.modules = opts.modules.map(function(mod) { + return sweet.loadNodeModule(process.cwd(), mod); + }); + } + + if(opts.readtables){ + opts.readtables.forEach(function(mod) { + sweet.setReadtable(mod); + }); + } return es.through(function(file) { if(file.isNull()) { @@ -22,21 +33,7 @@ opts = merge({ sourceMap: !!file.sourceMap, filename: file.path, - modules: [], - readtables: [] }, opts); - - opts.modules = opts.modules.map(function(mod) { - if(moduleCache[mod]) { - return moduleCache[mod]; - } - moduleCache[mod] = sweet.loadNodeModule(process.cwd(), mod); - return moduleCache[mod]; - }); - - opts.readtables.forEach(function(mod) { - sweet.setReadtable(mod); - }); try { var res = sweet.compile(file.contents.toString('utf8'), opts);
aef23e6966ba96a53d3d46a92f2c5ec0c0876347
index.js
index.js
'use strict'; var jest = require('jest-cli'), gutil = require('gulp-util'), through = require('through2'); module.exports = function (options) { options = options || {}; return through.obj(function (file, enc, cb) { options.rootDir = options.rootDir || file.path; jest.runCLI({ config: options }, options.rootDir, function (success) { if(!success) { cb(new gutil.PluginError('gulp-jest', { message: "Tests Failed" })); } else { cb(); } }.bind(this)); }); };
'use strict'; var jest = require('jest-cli'), gutil = require('gulp-util'), through = require('through2'); module.exports = function (options) { options = options || {}; return through.obj(function (file, enc, cb) { options.rootDir = options.rootDir || file.path; var cliOptions = {config: options}; for(var i = 0, j = process.argv.length; i < j; i++) { if(process.argv[i].indexOf('--name=') === 0) { var value = process.argv[i].substring('--name='.length); cliOptions.testPathPattern = new RegExp(value); } } jest.runCLI(cliOptions, options.rootDir, function (success) { if(!success) { cb(new gutil.PluginError('gulp-jest', { message: "Tests Failed" })); } else { cb(); } }.bind(this)); }); };
Support --name options to filter spec files
Support --name options to filter spec files
JavaScript
mit
M6Web/gulp-jest
--- +++ @@ -8,9 +8,16 @@ options = options || {}; return through.obj(function (file, enc, cb) { options.rootDir = options.rootDir || file.path; - jest.runCLI({ - config: options - }, options.rootDir, function (success) { + + var cliOptions = {config: options}; + for(var i = 0, j = process.argv.length; i < j; i++) { + if(process.argv[i].indexOf('--name=') === 0) { + var value = process.argv[i].substring('--name='.length); + cliOptions.testPathPattern = new RegExp(value); + } + } + + jest.runCLI(cliOptions, options.rootDir, function (success) { if(!success) { cb(new gutil.PluginError('gulp-jest', { message: "Tests Failed" })); } else {
2fae8caff4eb5f7dac7aafe16596337f9e99eb3d
index.js
index.js
'use strict'; var net = require('net'); module.exports = { get: get }; function get(opts, text, callback) { var socket = new net.Socket(); socket.connect(opts.port, opts.host, function () { socket.setNoDelay(true); socket.write(text + '\n'); }); socket.on('data', function (data) { var re = /<([A-Z]+?)>(.+?)<\/\1>/g; var str = data.toString(); var res = {}; res.raw = str; var m; var entities = { LOCATION: [], ORGANIZATION: [], DATE: [], MONEY: [], PERSON: [], PERCENT: [], TIME: [] }; var _parsed = []; while ((m = re.exec(str)) !== null) { if (m.index === re.lastIndex) { re.lastIndex++; } _parsed.push(m); entities[m[1]].push(m[2]); } res._parsed = _parsed; res.entities = entities; socket.destroy(); callback(undefined, res); }); socket.on('error', function (err) { callback(err, undefined); }); }
'use strict'; var net = require('net'); module.exports = { get: get }; function get(opts, text, callback) { var socket = new net.Socket(); socket.connect(opts.port, opts.host, function () { socket.setNoDelay(true); socket.write(text.replace(/\r?\n|\r|\t/g, ' ') + '\n'); }); socket.on('data', function (data) { var re = /<([A-Z]+?)>(.+?)<\/\1>/g; var str = data.toString(); var res = {}; res.raw = str; var m; var entities = { LOCATION: [], ORGANIZATION: [], DATE: [], MONEY: [], PERSON: [], PERCENT: [], TIME: [] }; var _parsed = []; while ((m = re.exec(str)) !== null) { if (m.index === re.lastIndex) { re.lastIndex++; } _parsed.push(m); entities[m[1]].push(m[2]); } res._parsed = _parsed; res.entities = entities; socket.destroy(); callback(undefined, res); }); socket.on('error', function (err) { callback(err, undefined); }); }
Fix no response due to newlines
Fix no response due to newlines
JavaScript
mit
niksrc/ner,niksrc/ner
--- +++ @@ -10,7 +10,7 @@ socket.connect(opts.port, opts.host, function () { socket.setNoDelay(true); - socket.write(text + '\n'); + socket.write(text.replace(/\r?\n|\r|\t/g, ' ') + '\n'); }); socket.on('data', function (data) {
d27bcc3e5cfa824dabbb4f16bf9dcee17764ff77
index.js
index.js
var config = require('./config'), _ = require('underscore'); module.exports = require('./lib/api').Api.buildFromFile(config); module.exports.configure = function(options) { options = options || {}; _.defaults(options, config); return require('./lib/api').Api.buildFromFile(options); }; module.exports.oauth = require('./lib/oauth-helper');
var config = require('./config'), underscore = require('underscore'); module.exports = require('./lib/api').Api.buildFromFile(config); module.exports.configure = function (options) { options = options || {}; underscore.defaults(options, config); return require('./lib/api').Api.buildFromFile(options); }; module.exports.oauth = require('./lib/oauth-helper');
Rename underscore variable to fix jslint warning
Rename underscore variable to fix jslint warning
JavaScript
isc
raoulmillais/7digital-api,raoulmillais/node-7digital-api,7digital/7digital-api
--- +++ @@ -1,12 +1,12 @@ var config = require('./config'), - _ = require('underscore'); + underscore = require('underscore'); module.exports = require('./lib/api').Api.buildFromFile(config); -module.exports.configure = function(options) { +module.exports.configure = function (options) { options = options || {}; - _.defaults(options, config); + underscore.defaults(options, config); return require('./lib/api').Api.buildFromFile(options); };
f1fce55cf4a1ba1205b040a51d5f7fb5dfc5615c
index.js
index.js
'use strict'; var assign = require('object-assign'); var hasOwn = require('hasown'); module.exports = function(object, keys){ var result = {} if (keys){ keys = keys.filter(hasOwn(object)) } keys.forEach(function(key){ var value = object[key] try { value = JSON.parse(value) } catch (ex){ } result[key] = value }) return result }
'use strict'; var assign = require('object-assign'); var hasOwn = require('hasown'); module.exports = function(object, keys){ var result = {} if (Array.isArray(keys)){ keys = keys.filter(hasOwn(object)) } keys.forEach(function(key){ var value = object[key] try { value = JSON.parse(value) } catch (ex){ } result[key] = value }) return result }
Add Array.isArray check for keys
Add Array.isArray check for keys
JavaScript
mit
radubrehar/parse-keys
--- +++ @@ -7,7 +7,7 @@ var result = {} - if (keys){ + if (Array.isArray(keys)){ keys = keys.filter(hasOwn(object)) }
bb90814b60040ef1ebb5ceba46ab9d3086384c07
packages/rotonde-core/src/server.js
packages/rotonde-core/src/server.js
import path from 'path'; import express from 'express'; import morgan from 'morgan'; require('dotenv').config(); export default callback => { const server = express(); server.set('env', process.env.NODE_ENV || 'development'); server.set('host', process.env.HOST || '0.0.0.0'); server.set('port', process.env.PORT || 3000); server.use(morgan(process.env.NODE_ENV === 'production' ? 'combined' : 'dev')); return server.listen( server.get('port'), server.get('host'), () => callback(server) ); };
import path from 'path'; import express from 'express'; import morgan from 'morgan'; require('dotenv').config(); export default callback => { const server = express(); server.set('env', process.env.NODE_ENV || 'development'); server.set('host', process.env.HOST || '0.0.0.0'); server.set('port', process.env.PORT || 3000); server.use(morgan(process.env.NODE_ENV === 'production' ? 'combined' : 'dev')); server.use('/', (req, res, next) => { return res.send(` <script src="/socket.io/socket.io.js"></script> <script> var socket = io(window.location.origin); socket.on('connect', () => { console.log('Connected') }); socket.on('rotonde.acknowledge', payload => { console.log('ack', payload) }); </script> `) }); return server.listen( server.get('port'), server.get('host'), () => callback(server) ); };
Add some websocket debugging code
Add some websocket debugging code
JavaScript
mit
merveilles/Rotonde,merveilles/Rotonde
--- +++ @@ -10,6 +10,20 @@ server.set('host', process.env.HOST || '0.0.0.0'); server.set('port', process.env.PORT || 3000); server.use(morgan(process.env.NODE_ENV === 'production' ? 'combined' : 'dev')); + server.use('/', (req, res, next) => { + return res.send(` + <script src="/socket.io/socket.io.js"></script> + <script> + var socket = io(window.location.origin); + socket.on('connect', () => { + console.log('Connected') + }); + socket.on('rotonde.acknowledge', payload => { + console.log('ack', payload) + }); + </script> + `) + }); return server.listen( server.get('port'), server.get('host'),
810a957b56dee0d032535c3cfa403079ac32aa71
gevents.js
gevents.js
'use strict'; var request = require('request'); var opts = { uri: 'https://api.github.com' + '/users/' + parseParams(process.argv[2]) + '/events', json: true, method: 'GET', headers: { 'User-Agent': 'nodejs script' } } request(opts, function (err, res, body) { if (err) throw new Error(err); var format = '[%s]: %s %s %s %s'; for (var i = 0; i < body.length; i++) { /* * TODO return something like this as JSON * for caller consumption (useful for servers). */ console.log(format , body[i].created_at , body[i].type , body[i].actor.login , body[i].repo.name); } }); /* * Verify param is present, and just return it. * TODO * Check for multiple params, and check validity * as well as presence. */ function parseParams(params) { if (! params) { console.log('Usage: nodejs gevents.js <user-name>'); process.exit(0); } return params; }
'use strict'; var request = require('request'); var opts = parseOptions(process.argv[2]); request(opts, function (err, res, body) { if (err) throw new Error(err); var format = '[%s]: %s %s %s %s'; for (var i = 0; i < body.length; i++) { /* * TODO return something like this as JSON * for caller consumption (useful for servers). */ console.log(format , body[i].created_at , body[i].type , body[i].actor.login , body[i].repo.name); } }); /* * Verify param is present, and just return it. * TODO * Check for multiple params, and check validity * as well as presence. */ function parseParams(params) { if (! params) { console.log('Usage: nodejs gevents.js <user-name>'); process.exit(0); } return params; } function parseOptions(opts) { // org or users, resource, query topic var who = '/users' , where = '/' + opts , what = '/events' var options = { uri: 'https://api.github.com' + who + where + what, json: true, method: 'GET', headers: { 'User-Agent': 'nodejs script' } } return options; }
Move options building to dedicated function
Move options building to dedicated function * No validation (yet), just returns request-friendly object. * Add newline before return in parseParams fn. * Add newline to EOF * TODO ** Validate parameters ** Accept and parse multiple parameters
JavaScript
mit
jm-janzen/scripts,jm-janzen/scripts,jm-janzen/scripts
--- +++ @@ -2,14 +2,7 @@ var request = require('request'); -var opts = { - uri: 'https://api.github.com' + '/users/' + parseParams(process.argv[2]) + '/events', - json: true, - method: 'GET', - headers: { - 'User-Agent': 'nodejs script' - } -} +var opts = parseOptions(process.argv[2]); request(opts, function (err, res, body) { if (err) throw new Error(err); @@ -40,5 +33,29 @@ console.log('Usage: nodejs gevents.js <user-name>'); process.exit(0); } + return params; } + +function parseOptions(opts) { + + // org or users, resource, query topic + var who = '/users' + , where = '/' + opts + , what = '/events' + + var options = { + uri: 'https://api.github.com' + + who + + where + + what, + json: true, + method: 'GET', + headers: { + 'User-Agent': 'nodejs script' + } + } + + return options; +} +
7ac7843a019996837ad56e781178612f1de706d3
pinpoint-items-from-dom-extractor.js
pinpoint-items-from-dom-extractor.js
PinPoint.ItemsfromDomExtractor = function(targetName) { this.targetName = targetName; } PinPoint.ItemsfromDomExtractor.prototype = { getElements : function(element) { var timeDivArray = document.getElementsbyClassName("ytp-time-current") var time = timeDivArray[0].innerHTML } }
PinPoint.ItemsfromDomExtractor = function(targetName) { this.targetName = targetName; } // We'll need logic stating what className to use depending on sit: // YouTube: "ytp-time-current" // Vimeo: "box" PinPoint.ItemsfromDomExtractor.prototype = { getTime : function(className) { var timeDivArray = document.getElementsbyClassName("ytp-time-current") var time = timeDivArray[0].innerHTML } }
Change function name from getElements to getTime.
Change function name from getElements to getTime.
JavaScript
mit
jbouzi12/PinPoint,ospreys-2014/PinPoint,jbouzi12/PinPoint
--- +++ @@ -2,8 +2,11 @@ this.targetName = targetName; } +// We'll need logic stating what className to use depending on sit: +// YouTube: "ytp-time-current" +// Vimeo: "box" PinPoint.ItemsfromDomExtractor.prototype = { - getElements : function(element) { + getTime : function(className) { var timeDivArray = document.getElementsbyClassName("ytp-time-current") var time = timeDivArray[0].innerHTML
f8717ac3301639f0cbb7103f686af2a27eb96c87
examples/dump-burp-xml.js
examples/dump-burp-xml.js
var BurpImporter = require(__dirname + '/../index'), util = require('util'); var importer = new BurpImporter(__dirname + '/example1.xml'); importer.on('start', function (info) { console.log('Dump: start'); console.log(' burpVersion: ' + info.burpVersion); console.log(' exportTime: ' + info.exportTime); console.log('********'); }); importer.on('item', function (item) { console.log(' url: ' + item.url); console.log(' port: ' + item.port); console.log(' path: ' + item.path); console.log(' method: ' + item.method); console.log(' host: ' + item.host); console.log(' protocol: ' + item.protocol); console.log(' status: ' + item.status); console.log(' time: ' + item.time); console.log(' responselength: ' + item.responselength); console.log(' mimetype: ' + item.mimetype); console.log(' extension: ' + item.extension); console.log(' request: ' + item.request.toString().substring(0, 10) + '...'); console.log(' response: ' + item.response.toString().substring(0, 10) + '...'); console.log('********'); }); importer.on('end', function () { console.log('Dump: end'); }); importer.import();
var BurpImporter = require(__dirname + '/../index'), util = require('util'); // source below may be stream or filename. var importer = new BurpImporter(__dirname + '/example1.xml'); importer.on('start', function (info) { console.log('Dump: start'); console.log(' burpVersion: ' + info.burpVersion); console.log(' exportTime: ' + info.exportTime); console.log('********'); }); importer.on('item', function (item) { console.log(' url: ' + item.url); console.log(' port: ' + item.port); console.log(' path: ' + item.path); console.log(' method: ' + item.method); console.log(' host: ' + item.host); console.log(' protocol: ' + item.protocol); console.log(' status: ' + item.status); console.log(' time: ' + item.time); console.log(' responselength: ' + item.responselength); console.log(' mimetype: ' + item.mimetype); console.log(' extension: ' + item.extension); console.log(' request: ' + item.request.toString().substring(0, 10) + '...'); console.log(' response: ' + item.response.toString().substring(0, 10) + '...'); console.log('********'); }); importer.on('end', function () { console.log('Dump: end'); }); importer.import();
Add comment to example regarding source.
Add comment to example regarding source.
JavaScript
mit
bls/node-burp-importer
--- +++ @@ -2,6 +2,7 @@ var BurpImporter = require(__dirname + '/../index'), util = require('util'); +// source below may be stream or filename. var importer = new BurpImporter(__dirname + '/example1.xml'); importer.on('start', function (info) { console.log('Dump: start');
020c793fed4c1b11197c6ee311a10940709d2c22
lib/assets/javascripts/jasmine-console-shims.js
lib/assets/javascripts/jasmine-console-shims.js
(function() { /** * Function.bind for ECMAScript 5 Support * * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind */ if (!Function.prototype.bind) { Function.prototype.bind = function (oThis) { if (typeof this !== "function") { // closest thing possible to the ECMAScript 5 internal IsCallable function throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); } var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function () {}, fBound = function () { return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); }; fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); return fBound; }; } })();
// using react's Function.prototype.bind polyfill for phantomjs // https://github.com/facebook/react/blob/master/src/test/phantomjs-shims.js (function() { var Ap = Array.prototype; var slice = Ap.slice; var Fp = Function.prototype; if (!Fp.bind) { // PhantomJS doesn't support Function.prototype.bind natively, so // polyfill it whenever this module is required. Fp.bind = function(context) { var func = this; var args = slice.call(arguments, 1); function bound() { var invokedAsConstructor = func.prototype && (this instanceof func); return func.apply( // Ignore the context parameter when invoking the bound function // as a constructor. Note that this includes not only constructor // invocations using the new keyword but also calls to base class // constructors such as BaseClass.call(this, ...) or super(...). !invokedAsConstructor && context || this, args.concat(slice.call(arguments)) ); } // The bound function must share the .prototype of the unbound // function so that any object created by one constructor will count // as an instance of both constructors. bound.prototype = func.prototype; return bound; }; } })();
Replace Function.prototype.bind polyfill with one that works for the latest version of Phantomjs
Replace Function.prototype.bind polyfill with one that works for the latest version of Phantomjs
JavaScript
mit
mallikarjunayaddala/jasmine-rails,ennova/jasmine-rails,carwow/jasmine-rails,henrik/jasmine-rails,alphagov/jasmine-rails,carwow/jasmine-rails,carwow/jasmine-rails,sharethrough/jasmine-rails,searls/jasmine-rails,spadin/jasmine-rails,PericlesTheo/jasmine-rails,PericlesTheo/jasmine-rails,mallikarjunayaddala/jasmine-rails,searls/jasmine-rails,getaroom/jasmine-rails,danieltdt/jasmine-rails,searls/jasmine-rails,danieltdt/jasmine-rails,sharethrough/jasmine-rails,spadin/jasmine-rails,getaroom/jasmine-rails,PericlesTheo/jasmine-rails,carwow/jasmine-rails,spadin/jasmine-rails,sharethrough/jasmine-rails,PericlesTheo/jasmine-rails,ennova/jasmine-rails,alphagov/jasmine-rails,mallikarjunayaddala/jasmine-rails,rcode5/jasmine-rails,danieltdt/jasmine-rails,sharethrough/jasmine-rails,mallikarjunayaddala/jasmine-rails,danieltdt/jasmine-rails,henrik/jasmine-rails,getaroom/jasmine-rails,alphagov/jasmine-rails,ennova/jasmine-rails,spadin/jasmine-rails,getaroom/jasmine-rails,henrik/jasmine-rails,rcode5/jasmine-rails,henrik/jasmine-rails,rcode5/jasmine-rails,rcode5/jasmine-rails,ennova/jasmine-rails
--- +++ @@ -1,31 +1,38 @@ +// using react's Function.prototype.bind polyfill for phantomjs +// https://github.com/facebook/react/blob/master/src/test/phantomjs-shims.js + (function() { - /** - * Function.bind for ECMAScript 5 Support - * - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind - */ - if (!Function.prototype.bind) { - Function.prototype.bind = function (oThis) { - if (typeof this !== "function") { - // closest thing possible to the ECMAScript 5 internal IsCallable function - throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); - } +var Ap = Array.prototype; +var slice = Ap.slice; +var Fp = Function.prototype; - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, - fNOP = function () {}, - fBound = function () { - return fToBind.apply(this instanceof fNOP && oThis - ? this - : oThis, - aArgs.concat(Array.prototype.slice.call(arguments))); - }; +if (!Fp.bind) { + // PhantomJS doesn't support Function.prototype.bind natively, so + // polyfill it whenever this module is required. + Fp.bind = function(context) { + var func = this; + var args = slice.call(arguments, 1); - fNOP.prototype = this.prototype; - fBound.prototype = new fNOP(); + function bound() { + var invokedAsConstructor = func.prototype && (this instanceof func); + return func.apply( + // Ignore the context parameter when invoking the bound function + // as a constructor. Note that this includes not only constructor + // invocations using the new keyword but also calls to base class + // constructors such as BaseClass.call(this, ...) or super(...). + !invokedAsConstructor && context || this, + args.concat(slice.call(arguments)) + ); + } - return fBound; - }; - } + // The bound function must share the .prototype of the unbound + // function so that any object created by one constructor will count + // as an instance of both constructors. + bound.prototype = func.prototype; + + return bound; + }; +} + })();
c7216b228e14aa30ec83d7415d11aa3c6c7ff198
app/server.js
app/server.js
var express = require('express'), Memcached = require('memcached'); // Constants var port = 3000; var env = process.env.NODE_ENV || 'production'; var mc = new Memcached(process.env.MC_PORT.replace('tcp://', '')); // App var app = express(); app.use(express.urlencoded()); app.get('/', function (req, res) { res.send('Hello World!!\n'); }); app.post('/test', function (req, res) { mc.set('foo', req.body.value, 3600, function (err) { if(err) { res.send('Could not set value\n', 500); } else { res.send('Value set!\n') } }); }); app.get('/test', function (req, res) { mc.get('foo', function (err, data) { if(err) { res.send('Could not get value\n', 500); } else { res.send('Value = ' + data + '\n'); } }); }); app.listen(port) console.log('Running in ' + env + ' on http://localhost:' + port);
var express = require('express'), Memcached = require('memcached'), fs = require('fs'); // Constants var port = 3000; var env = process.env.NODE_ENV || 'production'; var mc = new Memcached(process.env.MC_PORT.replace('tcp://', '')); // App var app = express(); app.use(express.urlencoded()); app.get('/', function (req, res) { res.send('Hello World!!\n'); }); app.post('/test', function (req, res) { fs.appendFile('/var/log/app/values.log', req.body.value + '\n', function (err) {}); mc.set('foo', req.body.value, 3600, function (err) { if(err) { res.send('Could not set value\n', 500); } else { res.send('Value set!\n') } }); }); app.get('/test', function (req, res) { mc.get('foo', function (err, data) { if(err) { res.send('Could not get value\n', 500); } else { res.send('Value = ' + data + '\n'); } }); }); app.listen(port) console.log('Running in ' + env + ' on http://localhost:' + port);
Write set values to log file
Write set values to log file
JavaScript
mit
ndemoor/dockerbel,ndemoor/dockerbel,ndemoor/dockerbel
--- +++ @@ -1,5 +1,6 @@ var express = require('express'), - Memcached = require('memcached'); + Memcached = require('memcached'), + fs = require('fs'); // Constants var port = 3000; @@ -15,6 +16,8 @@ }); app.post('/test', function (req, res) { + fs.appendFile('/var/log/app/values.log', req.body.value + '\n', function (err) {}); + mc.set('foo', req.body.value, 3600, function (err) { if(err) { res.send('Could not set value\n', 500);
da2ed8f22a4aeb6b71b0ee028891cff0d2904753
js/Landing.js
js/Landing.js
import React from 'react' import { Link } from 'react-router' import { setSearchTerm } from './actionCreators' import { connect } from 'react-redux' const { string, func, object } = React.PropTypes const Landing = React.createClass({ contextTypes: { router: object }, propTypes: { searchTerm: string, dispatch: func }, handleSearchTermChange (event) { this.props.dispatch(setSearchTerm(event.target.value)) }, handleSearchSubmit (event) { event.preventDefault() this.context.router.transitionTo('/search') }, render () { return ( <div className='landing'> <h1>svideo</h1> <form onSubmit={this.handleSearchSubmit}> <input onChange={this.handleSearchTermChange} type='text' placeholder='Search' /> </form> <Link to='/search'>or Browse All</Link> </div> ) } }) const mapStateToProps = (state) => { return { searchTerm: state.searchTerm } } export default connect(mapStateToProps)(Landing)
import React from 'react' import { connect } from 'react-redux' import { Link } from 'react-router' import { setSearchTerm } from './actionCreators' const { string, func, object } = React.PropTypes const Landing = React.createClass({ contextTypes: { router: object }, propTypes: { searchTerm: string, dispatchSetSearchTerm: func }, handleSearchTermChange (event) { this.props.dispatchSetSearchTerm(event.target.value) }, handleSearchSubmit (event) { event.preventDefault() this.context.router.transitionTo('/search') }, render () { return ( <div className='landing'> <h1>svideo</h1> <form onSubmit={this.handleSearchSubmit}> <input onChange={this.handleSearchTermChange} value={this.props.searchTerm} type='text' placeholder='Search' /> </form> <Link to='/search'>or Browse All</Link> </div> ) } }) const mapStateToProps = (state) => { return { searchTerm: state.searchTerm } } const mapDispatchToProps = (dispatch) => { return { dispatchSetSearchTerm (searchTerm) { dispatch(setSearchTerm(searchTerm)) } } } export default connect(mapStateToProps, mapDispatchToProps)(Landing)
Refactor landing page to use mapDispatchToProps which is another method of doing what we were already doing
Refactor landing page to use mapDispatchToProps which is another method of doing what we were already doing
JavaScript
mit
galaxode/ubiquitous-eureka,galaxode/ubiquitous-eureka
--- +++ @@ -1,7 +1,7 @@ import React from 'react' +import { connect } from 'react-redux' import { Link } from 'react-router' import { setSearchTerm } from './actionCreators' -import { connect } from 'react-redux' const { string, func, object } = React.PropTypes const Landing = React.createClass({ @@ -10,10 +10,10 @@ }, propTypes: { searchTerm: string, - dispatch: func + dispatchSetSearchTerm: func }, handleSearchTermChange (event) { - this.props.dispatch(setSearchTerm(event.target.value)) + this.props.dispatchSetSearchTerm(event.target.value) }, handleSearchSubmit (event) { event.preventDefault() @@ -24,7 +24,7 @@ <div className='landing'> <h1>svideo</h1> <form onSubmit={this.handleSearchSubmit}> - <input onChange={this.handleSearchTermChange} type='text' placeholder='Search' /> + <input onChange={this.handleSearchTermChange} value={this.props.searchTerm} type='text' placeholder='Search' /> </form> <Link to='/search'>or Browse All</Link> </div> @@ -38,4 +38,11 @@ } } -export default connect(mapStateToProps)(Landing) +const mapDispatchToProps = (dispatch) => { + return { + dispatchSetSearchTerm (searchTerm) { + dispatch(setSearchTerm(searchTerm)) + } + } +} +export default connect(mapStateToProps, mapDispatchToProps)(Landing)
e7485014cf2f3e591360b3215871c2b8d2f9382e
src/components/DiagonalDivider/DiagonalDivider.js
src/components/DiagonalDivider/DiagonalDivider.js
// DiagonalDivider import React, { PropTypes } from 'react/addons'; // eslint-disable-line no-unused-vars import styles from './DiagonalDivider.less'; import withStyles from '../../decorators/withStyles'; @withStyles(styles) export default class DiagonalDivider extends React.Component { static propTypes = { id: React.PropTypes.string, color: React.PropTypes.string }; componentDidMount() { let canvas = document.getElementById(this.props.id); if (canvas && canvas.getContext) { let context = canvas.getContext('2d'); context.strokeStyle = this.props.color; context.lineWidth = 2; context.moveTo(1, 61); context.lineTo(13, 1); context.stroke(); } } render() { return ( <canvas id={this.props.id} className='DiagonalDivider' width='14' height='62'> </canvas> ); } }
// DiagonalDivider import React, { PropTypes } from 'react/addons'; // eslint-disable-line no-unused-vars import styles from './DiagonalDivider.less'; import withStyles from '../../decorators/withStyles'; @withStyles(styles) export default class DiagonalDivider extends React.Component { static propTypes = { id: React.PropTypes.string, color: React.PropTypes.string }; componentDidMount() { let canvas = document.getElementById(this.props.id); // Check if the <canvas> element exists and the browser supports <canvas> if (canvas && canvas.getContext) { let context = canvas.getContext('2d'); // Make canvas drawings look sharp on high-density ("Retina") screens if ('devicePixelRatio' in window) { if (window.devicePixelRatio > 1) { const devicePixelRatio = window.devicePixelRatio; canvas.width = canvas.width * devicePixelRatio; canvas.height = canvas.height * devicePixelRatio; // Update context for the new device pixel ratio context = canvas.getContext('2d'); } } context.strokeStyle = this.props.color; context.lineWidth = 2; context.moveTo(1, 61); context.lineTo(13, 1); context.stroke(); } } render() { return ( <canvas id={this.props.id} className='DiagonalDivider' width='14' height='62'> </canvas> ); } }
Make <canvas> drawings look sharp on high-density ("Retina") screens
Make <canvas> drawings look sharp on high-density ("Retina") screens
JavaScript
mit
tonikarttunen/tonikarttunen-com,tonikarttunen/tonikarttunen-com
--- +++ @@ -14,8 +14,22 @@ componentDidMount() { let canvas = document.getElementById(this.props.id); + // Check if the <canvas> element exists and the browser supports <canvas> if (canvas && canvas.getContext) { let context = canvas.getContext('2d'); + + // Make canvas drawings look sharp on high-density ("Retina") screens + if ('devicePixelRatio' in window) { + if (window.devicePixelRatio > 1) { + const devicePixelRatio = window.devicePixelRatio; + canvas.width = canvas.width * devicePixelRatio; + canvas.height = canvas.height * devicePixelRatio; + + // Update context for the new device pixel ratio + context = canvas.getContext('2d'); + } + } + context.strokeStyle = this.props.color; context.lineWidth = 2; context.moveTo(1, 61);
57fefba0eb45a21e7fb57bc2400a1cff22c7b72b
addon/utils/has-block.js
addon/utils/has-block.js
import Ember from 'ember'; import emberVersionInfo from './ember-version-info'; const { major, minor, isGlimmer } = emberVersionInfo(); let hasBlockSymbol; if (major > 3 || (major == 3 && minor >= 1)) { // Ember-glimmer moved to TypeScript since v3.1 // Do nothing since the symbol is not exported } else if (isGlimmer) { hasBlockSymbol = Ember.__loader.require('ember-glimmer/component')[ 'HAS_BLOCK' ]; } else { hasBlockSymbol = Ember.__loader.require('ember-htmlbars/component')[ 'HAS_BLOCK' ]; } // NOTE: I really don't know how to test this export default function hasBlock(emberComponent) { // Since Glimmer moved to TypeScript, we can't get the symbol. // This is a terrible but working way to get the value. if (!hasBlockSymbol) { const regex = /HAS_BLOCK/; hasBlockSymbol = Object.getOwnPropertyNames(emberComponent).find(key => regex.test(key) ); } return Ember.get(emberComponent, hasBlockSymbol); }
import Ember from 'ember'; import emberVersionInfo from './ember-version-info'; const { major, minor, isGlimmer } = emberVersionInfo(); let hasBlockSymbol; try { if (major > 3 || (major == 3 && minor >= 1)) { // Ember-glimmer moved to TypeScript since v3.1 // Do nothing since the symbol is not exported } else if (isGlimmer) { hasBlockSymbol = Ember.__loader.require('ember-glimmer/component')[ 'HAS_BLOCK' ]; } else { hasBlockSymbol = Ember.__loader.require('ember-htmlbars/component')[ 'HAS_BLOCK' ]; } } catch (e) { // Fallback to use runtime check } // NOTE: I really don't know how to test this export default function hasBlock(emberComponent) { // Since Glimmer moved to TypeScript, we can't get the symbol. // This is a terrible but working way to get the value. if (!hasBlockSymbol) { const regex = /HAS_BLOCK/; hasBlockSymbol = Object.getOwnPropertyNames(emberComponent).find(key => regex.test(key) ); } return Ember.get(emberComponent, hasBlockSymbol); }
Add try block to allow fallback to runtime check for HAS_BLOCK symbol
Add try block to allow fallback to runtime check for HAS_BLOCK symbol
JavaScript
mit
pswai/ember-cli-react,pswai/ember-cli-react
--- +++ @@ -5,17 +5,21 @@ let hasBlockSymbol; -if (major > 3 || (major == 3 && minor >= 1)) { - // Ember-glimmer moved to TypeScript since v3.1 - // Do nothing since the symbol is not exported -} else if (isGlimmer) { - hasBlockSymbol = Ember.__loader.require('ember-glimmer/component')[ - 'HAS_BLOCK' - ]; -} else { - hasBlockSymbol = Ember.__loader.require('ember-htmlbars/component')[ - 'HAS_BLOCK' - ]; +try { + if (major > 3 || (major == 3 && minor >= 1)) { + // Ember-glimmer moved to TypeScript since v3.1 + // Do nothing since the symbol is not exported + } else if (isGlimmer) { + hasBlockSymbol = Ember.__loader.require('ember-glimmer/component')[ + 'HAS_BLOCK' + ]; + } else { + hasBlockSymbol = Ember.__loader.require('ember-htmlbars/component')[ + 'HAS_BLOCK' + ]; + } +} catch (e) { + // Fallback to use runtime check } // NOTE: I really don't know how to test this
ef5db3df7c7e4dd76f920fc44a20a75b1511cf95
karma.conf.js
karma.conf.js
module.exports = function(config) { config.set({ frameworks: [ 'jasmine', 'karma-typescript', ], plugins: [ 'karma-typescript', 'karma-jasmine', 'karma-firefox-launcher', 'karma-chrome-launcher', 'karma-edge-launcher' ], files: [ "./src/**/*.ts", "./test/**/*.ts" ], exclude: [ "./**/*.d.ts", "./**/IAsyncGrouping.ts", "./node_modules" ], preprocessors: { "./**/*.ts": "karma-typescript", }, karmaTypescriptConfig: { tsconfig: "./test/tsconfig.json" }, reporters: [ 'progress', 'karma-typescript' ], browsers: [ // 'Edge', 'Firefox', 'Chrome', ], port: 9876, singleRun: true, logLevel: config.LOG_INFO, }) }
module.exports = function(config) { config.set({ frameworks: [ 'jasmine', 'karma-typescript', ], plugins: [ 'karma-typescript', 'karma-jasmine', 'karma-firefox-launcher', 'karma-chrome-launcher', ], files: [ "./src/**/*.ts", "./test/**/*.ts" ], exclude: [ "./**/*.d.ts", "./**/IAsyncGrouping.ts", "./node_modules" ], preprocessors: { "./**/*.ts": "karma-typescript", }, karmaTypescriptConfig: { tsconfig: "./test/tsconfig.json" }, reporters: [ 'progress', 'karma-typescript' ], browsers: [ 'Firefox', 'Chrome', ], port: 9876, singleRun: true, logLevel: config.LOG_INFO, }) }
Remove Edge launcher from Karma Conf
Remove Edge launcher from Karma Conf
JavaScript
mit
arogozine/LinqToTypeScript,arogozine/LinqToTypeScript
--- +++ @@ -9,7 +9,6 @@ 'karma-jasmine', 'karma-firefox-launcher', 'karma-chrome-launcher', - 'karma-edge-launcher' ], files: [ "./src/**/*.ts", @@ -27,8 +26,7 @@ tsconfig: "./test/tsconfig.json" }, reporters: [ 'progress', 'karma-typescript' ], - browsers: [ -// 'Edge', + browsers: [ 'Firefox', 'Chrome', ], port: 9876,
33c025904ffccf45e3ef43747a60730241ef53b6
karma.conf.js
karma.conf.js
// @AngularClass // Look in config for karma.conf.js module.exports = require('./config/karma.conf.js');
// @AngularClass // Look in config for karma.conf.js module.exports = require('./config/karma.conf.js');
Debug Error: No such file
Debug Error: No such file
JavaScript
mit
ZombieHippie/fantastic-repository,ZombieHippie/fantastic-repository,ZombieHippie/fantastic-repository,ZombieHippie/fantastic-repository
--- +++ @@ -1,3 +1,3 @@ // @AngularClass -// Look in config for karma.conf.js +// Look in config for karma.conf.js module.exports = require('./config/karma.conf.js');
e371cdfc4f43935caae843310bb3a7fb1468de17
test/support/assert-paranoid-equal.js
test/support/assert-paranoid-equal.js
'use strict'; var assert = require('assert'); var inspectors = require('./assert-paranoid-equal/inspectors'); var Context = require('./assert-paranoid-equal/context'); function paranoidEqual(value1, value2) { inspectors.ensureEqual(new Context(value1, value2), value1, value2); } function notParanoidEqual(value1, value2) { assert.throws( function () { paranoidEqual(value1, value2); }, assert.AssertionError, 'Given objects are equal, witch is not expected.'); } module.exports.paranoidEqual = paranoidEqual; module.exports.notParanoidEqual = notParanoidEqual;
'use strict'; var assert = require('assert'); var inspectors = require('./assert-paranoid-equal/inspectors'); var Context = require('./assert-paranoid-equal/context'); /* * This function provides a "paranoid" variant of Node's assert.deepEqual * See assert-paranoid-equal's README for details. * * https://npmjs.org/package/assert-paranoid-equal * */ function paranoidEqual(value1, value2) { inspectors.ensureEqual(new Context(value1, value2), value1, value2); } function notParanoidEqual(value1, value2) { assert.throws( function () { paranoidEqual(value1, value2); }, assert.AssertionError, 'Given objects are equal, witch is not expected.'); } module.exports.paranoidEqual = paranoidEqual; module.exports.notParanoidEqual = notParanoidEqual;
Add description for `paranoidEqual` function
Add description for `paranoidEqual` function
JavaScript
mit
nodeca/js-yaml,SmartBear/js-yaml,SmartBear/js-yaml,deltreey/js-yaml,crissdev/js-yaml,djchie/js-yaml,crissdev/js-yaml,rjmunro/js-yaml,crissdev/js-yaml,doowb/js-yaml,nodeca/js-yaml,cesarmarinhorj/js-yaml,SmartBear/js-yaml,joshball/js-yaml,pombredanne/js-yaml,joshball/js-yaml,minj/js-yaml,rjmunro/js-yaml,vogelsgesang/js-yaml,pombredanne/js-yaml,cesarmarinhorj/js-yaml,djchie/js-yaml,nodeca/js-yaml,bjlxj2008/js-yaml,rjmunro/js-yaml,vogelsgesang/js-yaml,joshball/js-yaml,deltreey/js-yaml,djchie/js-yaml,bjlxj2008/js-yaml,denji/js-yaml,deltreey/js-yaml,minj/js-yaml,cesarmarinhorj/js-yaml,bjlxj2008/js-yaml,minj/js-yaml,isaacs/js-yaml,jonnor/js-yaml,jonnor/js-yaml,vogelsgesang/js-yaml,isaacs/js-yaml,isaacs/js-yaml,pombredanne/js-yaml,doowb/js-yaml,doowb/js-yaml,prose/js-yaml,denji/js-yaml,denji/js-yaml,jonnor/js-yaml
--- +++ @@ -6,6 +6,13 @@ var Context = require('./assert-paranoid-equal/context'); +/* + * This function provides a "paranoid" variant of Node's assert.deepEqual + * See assert-paranoid-equal's README for details. + * + * https://npmjs.org/package/assert-paranoid-equal + * + */ function paranoidEqual(value1, value2) { inspectors.ensureEqual(new Context(value1, value2), value1, value2); }
881cda193c44a1bea0bd02f0cf5ca263a5e3730f
packages/react-scripts/template/src/App.test.js
packages/react-scripts/template/src/App.test.js
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; it('renders without crashing', () => { const div = document.createElement('div'); ReactDOM.render(<App />, div); });
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; it('renders without crashing', () => { window.matchMedia = jest.genMockFunction().mockImplementation(function () { return { matches: true }; }); const div = document.createElement('div'); ReactDOM.render(<App />, div); });
Add a mock for window.matchMedia.
Add a mock for window.matchMedia. The window.matchMedia function is used in the Spectacle Slide component (and other parts of Radium).
JavaScript
bsd-3-clause
igetgames/spectacle-create-react-app,igetgames/spectacle-create-react-app,igetgames/spectacle-create-react-app
--- +++ @@ -3,6 +3,11 @@ import App from './App'; it('renders without crashing', () => { + window.matchMedia = jest.genMockFunction().mockImplementation(function () { + return { + matches: true + }; + }); const div = document.createElement('div'); ReactDOM.render(<App />, div); });
fbe99b3addf8e6da1f9e004b01f37ddddce035db
app/services/fastboot.js
app/services/fastboot.js
import Ember from "ember"; let alias = Ember.computed.alias; let computed = Ember.computed; export default Ember.Service.extend({ cookies: alias('_fastbootInfo.cookies'), headers: alias('_fastbootInfo.headers'), host: computed(function() { return this._fastbootInfo.host(); }), isFastboot: computed(function() { return typeof window.document === 'undefined'; }) });
/* global FastBoot */ import Ember from "ember"; let alias = Ember.computed.alias; let computed = Ember.computed; export default Ember.Service.extend({ cookies: alias('_fastbootInfo.cookies'), headers: alias('_fastbootInfo.headers'), host: computed(function() { return this._fastbootInfo.host(); }), isFastBoot: computed(function() { return typeof FastBoot !== 'undefined'; }) });
Add isFastBoot property to service
Add isFastBoot property to service
JavaScript
mit
tildeio/ember-cli-fastboot,ember-fastboot/ember-cli-fastboot,josemarluedke/ember-cli-fastboot,josemarluedke/ember-cli-fastboot,rwjblue/ember-cli-fastboot,habdelra/ember-cli-fastboot,ember-fastboot/ember-cli-fastboot,habdelra/ember-cli-fastboot,kratiahuja/ember-cli-fastboot,tildeio/ember-cli-fastboot,kratiahuja/ember-cli-fastboot,rwjblue/ember-cli-fastboot
--- +++ @@ -1,3 +1,4 @@ +/* global FastBoot */ import Ember from "ember"; let alias = Ember.computed.alias; @@ -9,7 +10,7 @@ host: computed(function() { return this._fastbootInfo.host(); }), - isFastboot: computed(function() { - return typeof window.document === 'undefined'; + isFastBoot: computed(function() { + return typeof FastBoot !== 'undefined'; }) });
94c6656d834febbe16b2c732912dbbab109a6d39
test-projects/electron-log-test-nwjs/main.spec.js
test-projects/electron-log-test-nwjs/main.spec.js
'use strict'; const expect = require('chai').expect; const helper = require('../spec-helper'); const APP_NAME = 'electron-log-test-nwjs'; describe('nwjs test project', function() { this.timeout(5000); it('should write one line to a log file', () => { return helper.run(APP_NAME).then((logs) => { expect(logs.length).to.equal(2); expect(logs[0]).to.match(/\[[\d-]{10} [\d:]{13}] \[warn] Log from nw.js/); }); }) });
'use strict'; const expect = require('chai').expect; const helper = require('../spec-helper'); const APP_NAME = 'electron-log-test-nwjs'; describe('nwjs test project', function() { this.timeout(5000); it('should write one line to a log file', () => { return helper.run(APP_NAME).then((logs) => { expect(logs[0]).to.match(/\[[\d-]{10} [\d:]{13}] \[warn] Log from nw.js/); }); }) });
Remove line number check for nwjs.
Remove line number check for nwjs.
JavaScript
mit
megahertz/electron-log,megahertz/electron-log,megahertz/electron-log
--- +++ @@ -10,7 +10,6 @@ it('should write one line to a log file', () => { return helper.run(APP_NAME).then((logs) => { - expect(logs.length).to.equal(2); expect(logs[0]).to.match(/\[[\d-]{10} [\d:]{13}] \[warn] Log from nw.js/); }); })
de10bbbd46e148fe38e82256eb5d92a13550e1c3
protocol-spec/.vuepress/plugin-matomo/inject.js
protocol-spec/.vuepress/plugin-matomo/inject.js
/* global MATOMO_SITE_ID, MATOMO_TRACKER_URL, MATOMO_ENABLE_LINK_TRACKING */ export default ({ router }) => { // Google analytics integration if (MATOMO_SITE_ID && MATOMO_TRACKER_URL) { var _paq = _paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); if (MATOMO_ENABLE_LINK_TRACKING) { _paq.push(['enableLinkTracking']); } (function() { var u=MATOMO_TRACKER_URL; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', MATOMO_SITE_ID]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); router.afterEach(function (to) { _paq.push(['trackPageView', to.fullPath]); }); } }
/* global MATOMO_SITE_ID, MATOMO_TRACKER_URL, MATOMO_ENABLE_LINK_TRACKING */ export default ({ router }) => { // Google analytics integration if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined' && MATOMO_SITE_ID && MATOMO_TRACKER_URL) { var _paq = _paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); if (MATOMO_ENABLE_LINK_TRACKING) { _paq.push(['enableLinkTracking']); } (function() { var u=MATOMO_TRACKER_URL; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', MATOMO_SITE_ID]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); router.afterEach(function (to) { _paq.push(['trackPageView', to.fullPath]); }); } }
Fix matomo generation to only happen in production
Fix matomo generation to only happen in production
JavaScript
bsd-3-clause
metafetish/buttplug
--- +++ @@ -2,7 +2,7 @@ export default ({ router }) => { // Google analytics integration - if (MATOMO_SITE_ID && MATOMO_TRACKER_URL) { + if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined' && MATOMO_SITE_ID && MATOMO_TRACKER_URL) { var _paq = _paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']);
674452e37dc30389046b1d3f99a0c20062bf7100
assets/scripts/script.js
assets/scripts/script.js
(function(document, saveAs, smoothScroll, downloadName) { 'use strict'; if(window.location.protocol.indexOf('http') !== -1) { // Created before download in order to be JS-modifications-free. var blob = new Blob(['<!doctype html>' + document.documentElement.outerHTML], {type: 'text/html;charset=utf-8'}); document.getElementsByClassName('js-download-trigger')[0].style.display = 'block'; } document.getElementById('js-download').addEventListener('click', function () { saveAs(blob, downloadName); }); smoothScroll.init({ speed: 300 }); })(document, window.saveAs, window.smoothScroll, window.downloadName);
(function(document, saveAs, smoothScroll, downloadName) { 'use strict'; if (window.location.protocol.indexOf('http') !== -1) { // Created before download in order to be JS-modifications-free. var blob = new Blob(['<!doctype html>' + document.documentElement.outerHTML], {type: 'text/html;charset=utf-8'}); document.getElementsByClassName('js-download-trigger')[0].style.display = 'block'; document.getElementById('js-download').addEventListener('click', function () { saveAs(blob, downloadName); }); } smoothScroll.init({ speed: 300 }); })(document, window.saveAs, window.smoothScroll, window.downloadName);
Move click handler inside the right block
Move click handler inside the right block
JavaScript
isc
ThibWeb/jsonresume-theme-eloquent,ThibWeb/jsonresume-theme-eloquent,ThibWeb/jsonresume-theme-eloquent
--- +++ @@ -1,15 +1,15 @@ (function(document, saveAs, smoothScroll, downloadName) { 'use strict'; - if(window.location.protocol.indexOf('http') !== -1) { + if (window.location.protocol.indexOf('http') !== -1) { // Created before download in order to be JS-modifications-free. var blob = new Blob(['<!doctype html>' + document.documentElement.outerHTML], {type: 'text/html;charset=utf-8'}); document.getElementsByClassName('js-download-trigger')[0].style.display = 'block'; + + document.getElementById('js-download').addEventListener('click', function () { + saveAs(blob, downloadName); + }); } - - document.getElementById('js-download').addEventListener('click', function () { - saveAs(blob, downloadName); - }); smoothScroll.init({ speed: 300
6b4498d48865bd7fde55cc03ee3a682543c4d96d
.mocharc.js
.mocharc.js
module.exports = { recursive: true, reporter: 'spec', slow: 0, timeout: 40000, ui: 'bdd', extension: 'js', };
module.exports = { recursive: true, reporter: 'spec', slow: 0, timeout: 50000, ui: 'bdd', extension: 'js', };
Increase mocha timeout to 50000ms
Increase mocha timeout to 50000ms Fix #13090
JavaScript
apache-2.0
ctamisier/generator-jhipster,pascalgrimaud/generator-jhipster,dynamicguy/generator-jhipster,atomfrede/generator-jhipster,liseri/generator-jhipster,dynamicguy/generator-jhipster,ruddell/generator-jhipster,gmarziou/generator-jhipster,atomfrede/generator-jhipster,vivekmore/generator-jhipster,mraible/generator-jhipster,ctamisier/generator-jhipster,atomfrede/generator-jhipster,atomfrede/generator-jhipster,jhipster/generator-jhipster,jhipster/generator-jhipster,dynamicguy/generator-jhipster,mraible/generator-jhipster,ruddell/generator-jhipster,gmarziou/generator-jhipster,pascalgrimaud/generator-jhipster,liseri/generator-jhipster,vivekmore/generator-jhipster,jhipster/generator-jhipster,pascalgrimaud/generator-jhipster,gmarziou/generator-jhipster,mraible/generator-jhipster,ruddell/generator-jhipster,vivekmore/generator-jhipster,liseri/generator-jhipster,gmarziou/generator-jhipster,mraible/generator-jhipster,dynamicguy/generator-jhipster,ctamisier/generator-jhipster,jhipster/generator-jhipster,ruddell/generator-jhipster,ruddell/generator-jhipster,atomfrede/generator-jhipster,liseri/generator-jhipster,ctamisier/generator-jhipster,vivekmore/generator-jhipster,ctamisier/generator-jhipster,mraible/generator-jhipster,pascalgrimaud/generator-jhipster,jhipster/generator-jhipster,vivekmore/generator-jhipster,liseri/generator-jhipster,gmarziou/generator-jhipster,pascalgrimaud/generator-jhipster
--- +++ @@ -2,7 +2,7 @@ recursive: true, reporter: 'spec', slow: 0, - timeout: 40000, + timeout: 50000, ui: 'bdd', extension: 'js', };
74081cd1ba00c1efcba11eae021b474adc26c126
config/webpack.config.devserver.js
config/webpack.config.devserver.js
const path = require('path'); const webpack = require('webpack'); // Listen port const PORT = process.env.PORT || 8080; // Load base config const baseConfig = require('./webpack.config.base'); // Create the config const config = Object.create(baseConfig); config.devtool = 'cheap-source-map'; config.devServer = { hot: true, host: "0.0.0.0", disableHostCheck: true, port: PORT, contentBase: path.resolve(__dirname, '../src'), watchContentBase: true }; module.exports = config;
const path = require('path'); const webpack = require('webpack'); // Listen port const PORT = process.env.PORT || 8080; // Load base config const baseConfig = require('./webpack.config.base'); // Create the config const config = Object.create(baseConfig); config.devtool = 'cheap-source-map'; config.devServer = { host: "0.0.0.0", disableHostCheck: true, port: PORT, contentBase: path.resolve(__dirname, '../src'), watchContentBase: true }; module.exports = config;
Fix this crashing spewage: Uncaught Error: [HMR] Hot Module Replacement is disabled.
Fix this crashing spewage: Uncaught Error: [HMR] Hot Module Replacement is disabled.
JavaScript
mit
gaudeon/interstice,gaudeon/interstice,gaudeon/interstice
--- +++ @@ -14,7 +14,6 @@ config.devtool = 'cheap-source-map'; config.devServer = { - hot: true, host: "0.0.0.0", disableHostCheck: true, port: PORT,
a8875ecedd19d33baf1832b5ed1b710cf8de0019
public/js/app/mixins/Pagination.js
public/js/app/mixins/Pagination.js
define(["app/app", "ember"], function(App, Ember) { "use strict"; App.Pagination = Ember.Mixin.create({ queryParams: ['offset'], limit: 30, offset: 0, actions: { nextPage: function() { this.incrementProperty('offset', this.get('limit')) }, prevPage: function() { this.decrementProperty('offset', this.get('limit')) } }, prevPageDisabled: function() { return this.get('offset') === 0 ? 'disabled' : '' }.property('offset'), prevPageVisible: function() { return this.get('prevPageDisabled') !== 'disabled' }.property('prevPageDisabled'), nextPageVisible: function() { return this.get('nextPageDisabled') !== 'disabled' }.property('nextPageDisabled'), nextPageDisabled: function() { var len = this.get('content.posts.length') || this.get('content.content.length') return len === 0 || len === undefined || len < this.get('limit') ? 'disabled' : '' }.property('content.posts.length', 'content.content.length', 'limit'), resetPage: function() { this.set('offset', 0) }, pageDidChange: function() { this.didRequestRange({ offset: this.get('offset') || 0, limit: this.get('limit')}) }.observes('offset'), firstPage: function() { return this.get('offset') == null || this.get('offset') == 0 }.property('offset') }) })
define(["app/app", "ember"], function(App, Ember) { "use strict"; App.Pagination = Ember.Mixin.create({ queryParams: ['offset'], limit: 30, offset: 0, actions: { nextPage: function() { this.incrementProperty('offset', this.get('limit')) }, prevPage: function() { this.decrementProperty('offset', this.get('limit')) } }, prevPageDisabled: function() { return this.get('offset') === 0 ? 'disabled' : '' }.property('offset'), prevPageVisible: function() { return this.get('prevPageDisabled') !== 'disabled' }.property('prevPageDisabled'), nextPageVisible: function() { return this.get('nextPageDisabled') !== 'disabled' }.property('nextPageDisabled'), nextPageDisabled: function() { var len = this.get('content.posts.length') || this.get('content.content.length') return len === 0 || len === undefined /*|| -- disable this check until timelines return pagination meta -- len < this.get('limit')*/ ? 'disabled' : '' }.property('content.posts.length', 'content.content.length', 'limit'), resetPage: function() { this.set('offset', 0) }, pageDidChange: function() { this.didRequestRange({ offset: this.get('offset') || 0, limit: this.get('limit')}) }.observes('offset'), firstPage: function() { return this.get('offset') == null || this.get('offset') == 0 }.property('offset') }) })
Disable pagination check for prev page.
Disable pagination check for prev page. Due to bans timelines can return less than limit posts now. To work, it requires proper pagination metadata from timelines.
JavaScript
mit
FreeFeed/freefeed-html,epicmonkey/pepyatka-html,SiTLar/pepyatka-html,dsumin/freefeed-html,SiTLar/pepyatka-html,dsumin/freefeed-html,pepyatka/pepyatka-html,FreeFeed/freefeed-html,epicmonkey/pepyatka-html,pepyatka/pepyatka-html
--- +++ @@ -33,8 +33,9 @@ nextPageDisabled: function() { var len = this.get('content.posts.length') || this.get('content.content.length') - return len === 0 || len === undefined || - len < this.get('limit') ? 'disabled' : '' + return len === 0 || len === undefined /*|| + -- disable this check until timelines return pagination meta -- + len < this.get('limit')*/ ? 'disabled' : '' }.property('content.posts.length', 'content.content.length', 'limit'), resetPage: function() {
2baa9b0490355c15a317205fa6cfd94e0ce89f6b
static/js/append-contents.js
static/js/append-contents.js
/** * Load all h2, h3, h4, h5 and h6 tags as contents. */ $('.append-contents').each(function() { let html = '<ul class="list-unstyled contents">', level = 2; for(let h of $('h2, h3, h4, h5, h6').not('.append-contents')) { let newLevel = parseInt(h.tagName.charAt(1)); if (newLevel > level) { html += `<ul>`; } else if (newLevel < level) { html += `</li></ul>`; } else { html += `</li>`; } level = newLevel; html = `${html}<li><a href="${h.getAttribute('id')}" id="${h.innerHTML.trim()}">${h.innerHTML}</a>`; h.setAttribute('id', this.innerHTML.trim()); } while (level > 2) { html += `</ul>`; level -= 1; } $(this).after(html) });
/** * Load all h2, h3, h4, h5 and h6 tags as contents. */ $('.append-contents').each(function() { let html = '<ul class="list-unstyled contents">', level = 2; for(let h of $('h2, h3, h4, h5, h6').not('.append-contents')) { let newLevel = parseInt(h.tagName.charAt(1)); if (newLevel > level) { html += `<ul>`; } else if (newLevel < level) { html += `</li></ul>`; } else { html += `</li>`; } level = newLevel; html = `${html}<li><a href="#${h.innerHTML.replace(/ /g,'')}">${h.innerHTML}</a>`; h.setAttribute('id', h.innerHTML.replace(/ /g,'')); } while (level > 2) { html += `</ul>`; level -= 1; } $(this).after(html) });
Fix append contents js again
Fix append contents js again
JavaScript
bsd-3-clause
LibCrowds/libcrowds-bs4-pybossa-theme,LibCrowds/libcrowds-bs4-pybossa-theme
--- +++ @@ -15,8 +15,8 @@ html += `</li>`; } level = newLevel; - html = `${html}<li><a href="${h.getAttribute('id')}" id="${h.innerHTML.trim()}">${h.innerHTML}</a>`; - h.setAttribute('id', this.innerHTML.trim()); + html = `${html}<li><a href="#${h.innerHTML.replace(/ /g,'')}">${h.innerHTML}</a>`; + h.setAttribute('id', h.innerHTML.replace(/ /g,'')); } while (level > 2) {
849af48a8ca902ecc8414d200c691f51f99a399c
mmir-plugin-tts-speakjs/www/speakWorkerExt.js
mmir-plugin-tts-speakjs/www/speakWorkerExt.js
/* * based on speakWorker.js from: * * speak.js * https://github.com/logue/speak.js * License: GPL-3.0 */ importScripts('speakGenerator.js'); onmessage = function(event) { var msg = event.data; var id = msg.id; var audioData = generateSpeech(msg.text, msg.options) postMessage({id: id, data: audioData}); };
/* * based on speakWorker.js from: * * speak.js * https://github.com/logue/speak.js * License: GPL-3.0 */ importScripts('speakGenerator.js'); onmessage = function(event) { var msg = event.data; var id = msg.id; try { var audioData = generateSpeech(msg.text, msg.options) postMessage({id: id, data: audioData}); } catch(ex){ postMessage({id: id, error: true, message: ex.stack? ex.stack : ex.toString()}); } };
FIX catch and notify about errors
FIX catch and notify about errors
JavaScript
mit
mmig/mmir-plugins-media
--- +++ @@ -13,9 +13,12 @@ var msg = event.data; var id = msg.id; - var audioData = generateSpeech(msg.text, msg.options) - - postMessage({id: id, data: audioData}); + try { + var audioData = generateSpeech(msg.text, msg.options) + postMessage({id: id, data: audioData}); + } catch(ex){ + postMessage({id: id, error: true, message: ex.stack? ex.stack : ex.toString()}); + } };
68fe5843ccf28c9fed9870ce7de54f103648425e
src/util/brush/getCircle.js
src/util/brush/getCircle.js
/** * Gets the pixels within the circle. * @export @public @method * @name getCircle * * @param {number} radius The radius of the circle. * @param {number} rows The number of rows. * @param {number} columns The number of columns. * @param {number} [xCoord = 0] The x-location of the center of the circle. * @param {number} [yCoord = 0] The y-location of the center of the circle. * @returns {Array.number[]} Array of pixels contained within the circle. */ export default function getCircle( radius, rows, columns, xCoord = 0, yCoord = 0 ) { const x0 = Math.round(xCoord); const y0 = Math.round(yCoord); if (radius === 1) { return [[x0, y0]]; } const circleArray = []; let index = 0; for (let y = -radius; y <= radius; y++) { const yCoord = y0 + y; if (yCoord > rows || yCoord < 0) { continue; } for (let x = -radius; x <= radius; x++) { const xCoord = x0 + x; if (xCoord >= columns || xCoord < 0) { continue; } if (x * x + y * y < radius * radius) { circleArray[index++] = [x0 + x, y0 + y]; } } } return circleArray; }
/** * Gets the pixels within the circle. * @export @public @method * @name getCircle * * @param {number} radius The radius of the circle. * @param {number} rows The number of rows. * @param {number} columns The number of columns. * @param {number} [xCoord = 0] The x-location of the center of the circle. * @param {number} [yCoord = 0] The y-location of the center of the circle. * @returns {Array.number[]} Array of pixels contained within the circle. */ export default function getCircle( radius, rows, columns, xCoord = 0, yCoord = 0 ) { const x0 = Math.floor(xCoord); const y0 = Math.floor(yCoord); if (radius === 1) { return [[x0, y0]]; } const circleArray = []; let index = 0; for (let y = -radius; y <= radius; y++) { const yCoord = y0 + y; if (yCoord > rows || yCoord < 0) { continue; } for (let x = -radius; x <= radius; x++) { const xCoord = x0 + x; if (xCoord >= columns || xCoord < 0) { continue; } if (x * x + y * y < radius * radius) { circleArray[index++] = [x0 + x, y0 + y]; } } } return circleArray; }
Use floor instead of round for determining brush's selected pixels
fix(Brush): Use floor instead of round for determining brush's selected pixels
JavaScript
mit
cornerstonejs/cornerstoneTools,cornerstonejs/cornerstoneTools,chafey/cornerstoneTools,cornerstonejs/cornerstoneTools
--- +++ @@ -17,8 +17,8 @@ xCoord = 0, yCoord = 0 ) { - const x0 = Math.round(xCoord); - const y0 = Math.round(yCoord); + const x0 = Math.floor(xCoord); + const y0 = Math.floor(yCoord); if (radius === 1) { return [[x0, y0]];