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
aee68fef5987d4a5451876a0289947ce6ac6e5ff
lib/instrumentation/modules/http.js
lib/instrumentation/modules/http.js
'use strict' var shimmer = require('shimmer') var asyncState = require('../../async-state') var SERVER_FNS = ['on', 'addListener'] module.exports = function (http, client) { client.logger.trace('shimming http.Server.prototype functions:', SERVER_FNS) shimmer.massWrap(http.Server.prototype, SERVER_FNS, function (orig, name) { return function (event, listener) { if (event === 'request' && typeof listener === 'function') return orig.call(this, event, onRequest) else return orig.apply(this, arguments) function onRequest (req, res) { client.logger.trace('intercepted call to http.Server.prototype.%s', name) var trans = client.startTransaction(req.method + ' ' + req.url) trans.type = 'web.http' asyncState.req = req asyncState.trans = req.__opbeat_trans = trans res.once('finish', function () { trans.result = res.statusCode client.logger.trace('[%s] ending transaction', trans._uuid) trans.end() }) listener.apply(this, arguments) } } }) return http }
'use strict' var shimmer = require('shimmer') var asyncState = require('../../async-state') var SERVER_FNS = ['on', 'addListener'] module.exports = function (http, client) { client.logger.trace('shimming http.Server.prototype functions:', SERVER_FNS) shimmer.massWrap(http.Server.prototype, SERVER_FNS, function (orig, name) { return function (event, listener) { if (event === 'request' && typeof listener === 'function') return orig.call(this, event, onRequest) else return orig.apply(this, arguments) function onRequest (req, res) { client.logger.trace('intercepted call to http.Server.prototype.%s', name) var trans = client.startTransaction(req.method + ' ' + req.url, 'web.http') asyncState.req = req asyncState.trans = req.__opbeat_trans = trans res.once('finish', function () { trans.result = res.statusCode client.logger.trace('[%s] ending transaction', trans._uuid) trans.end() }) listener.apply(this, arguments) } } }) return http }
Set HTTP transaction type during construction
Set HTTP transaction type during construction
JavaScript
bsd-2-clause
opbeat/opbeat-node,opbeat/opbeat-node
--- +++ @@ -16,8 +16,7 @@ function onRequest (req, res) { client.logger.trace('intercepted call to http.Server.prototype.%s', name) - var trans = client.startTransaction(req.method + ' ' + req.url) - trans.type = 'web.http' + var trans = client.startTransaction(req.method + ' ' + req.url, 'web.http') asyncState.req = req asyncState.trans = req.__opbeat_trans = trans
cba85310e545fb0c6b3c052893cadbffb45c4788
PromiseAllSync.js
PromiseAllSync.js
PromiseAllSync = { extend: function(PromiseClass) { var emptyPromise = PromiseClass.resolve || PromiseClass.when; PromiseClass.allSync = function(collection, fn, unfn) { var stack = []; return collection.reduce(function(promise, item) { return promise.then(function() { var nextPromise = fn ? fn(item) : item; return nextPromise.then(function() { if(unfn) stack.push(item); }); }); }, emptyPromise.apply(PromiseClass)) .catch(function(e) { if(unfn) while(stack.length) unfn(stack.pop()); return PromiseClass.reject(e); }); } } };
PromiseAllSync = { extend: function(PromiseClass) { var emptyPromise = PromiseClass.resolve || PromiseClass.when; PromiseClass.allSync = function(collection, fn, unfn) { var stack = []; return collection.reduce(function(promise, item) { return promise.then(function() { var nextPromise = fn ? fn(item) : item; return nextPromise.then(function() { if(unfn) stack.push(item); }); }); }, emptyPromise.apply(PromiseClass)) .catch(function(e) { if(unfn) { stack.reduceRight(function(promise, item) { return promise.then(function() { return unfn(item); }); }, emptyPromise.apply(PromiseClass)); } return PromiseClass.reject(e); }); } } };
Support undo functions that return a promise
Support undo functions that return a promise
JavaScript
mit
deckar01/PromiseAllSync
--- +++ @@ -12,7 +12,13 @@ }); }, emptyPromise.apply(PromiseClass)) .catch(function(e) { - if(unfn) while(stack.length) unfn(stack.pop()); + if(unfn) { + stack.reduceRight(function(promise, item) { + return promise.then(function() { + return unfn(item); + }); + }, emptyPromise.apply(PromiseClass)); + } return PromiseClass.reject(e); }); }
7c10b216fab5b1000464ee481873d48dad59ffb4
server/frontend/store/configureStore.js
server/frontend/store/configureStore.js
import { createStore, applyMiddleware, compose } from 'redux'; import { reduxReactRouter } from 'redux-router'; import thunk from 'redux-thunk'; import createHistory from 'history/lib/createBrowserHistory'; import routes from '../routes'; import createLogger from 'redux-logger'; import rootReducer from '../reducers'; const finalCreateStore = compose( applyMiddleware(thunk), applyMiddleware(createLogger()), reduxReactRouter({ routes, createHistory }) )(createStore); export default function configureStore(initialState) { const store = finalCreateStore(rootReducer, initialState); if (module.hot) { // Enable Webpack hot module replacement for reducers module.hot.accept('../reducers', () => { const nextRootReducer = require('../reducers'); store.replaceReducer(nextRootReducer); }); } return store; }
import { createStore, applyMiddleware, compose } from 'redux'; import { reduxReactRouter } from 'redux-router'; import thunk from 'redux-thunk'; import createHistory from 'history/lib/createBrowserHistory'; import routes from '../routes'; import createLogger from 'redux-logger'; import rootReducer from '../reducers'; const finalCreateStore = compose( applyMiddleware(thunk), applyMiddleware(createLogger()), reduxReactRouter({ routes, createHistory }) )(createStore); export default function configureStore(initialState) { const store = finalCreateStore(rootReducer, initialState); if (module.hot) { // Enable Webpack hot module replacement for reducers module.hot.accept('../reducers', () => { const nextRootReducer = require('../reducers'); store.replaceReducer(nextRootReducer); }); } return store; } const finalCreateServerStore = compose( applyMiddleware(thunk), reduxReactRouter({ routes, createHistory }) )(createStore); export default function configureServerStore(initialState) { return finalCreateServerStore(rootReducer, initialState); }
Add function to configure store for server-side rendering
Add function to configure store for server-side rendering
JavaScript
mit
benjaminhoffman/Encompass,benjaminhoffman/Encompass,benjaminhoffman/Encompass
--- +++ @@ -25,3 +25,12 @@ return store; } + +const finalCreateServerStore = compose( + applyMiddleware(thunk), + reduxReactRouter({ routes, createHistory }) +)(createStore); + +export default function configureServerStore(initialState) { + return finalCreateServerStore(rootReducer, initialState); +}
4fce75775ca238eeab9d2b726a090579f4196f3a
src/layout/points.js
src/layout/points.js
define(function (require) { return function (seriesType, ecModel) { ecModel.eachSeriesByType(seriesType, function (seriesModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; if (coordSys) { var dims = coordSys.dimensions; if (coordSys.type === 'singleAxis') { data.each(dims[0], function (x, idx) { // Also {Array.<number>}, not undefined to avoid if...else... statement data.setItemLayout(idx, isNaN(x) ? [NaN, NaN] : coordSys.dataToPoint(x)); }); } else { data.each(dims, function (x, y, idx) { // Also {Array.<number>}, not undefined to avoid if...else... statement data.setItemLayout( idx, (isNaN(x) || isNaN(y)) ? [NaN, NaN] : coordSys.dataToPoint([x, y]) ); }, true); } } }); }; });
define(function (require) { return function (seriesType, ecModel) { ecModel.eachSeriesByType(seriesType, function (seriesModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; if (coordSys) { var dims = coordSys.dimensions; if (dims.length === 1) { data.each(dims[0], function (x, idx) { // Also {Array.<number>}, not undefined to avoid if...else... statement data.setItemLayout(idx, isNaN(x) ? [NaN, NaN] : coordSys.dataToPoint(x)); }); } else if (dims.length === 2) { data.each(dims, function (x, y, idx) { // Also {Array.<number>}, not undefined to avoid if...else... statement data.setItemLayout( idx, (isNaN(x) || isNaN(y)) ? [NaN, NaN] : coordSys.dataToPoint([x, y]) ); }, true); } } }); }; });
Use dimension shape instead of coordinate system type
Use dimension shape instead of coordinate system type
JavaScript
apache-2.0
apache/incubator-echarts,chenfwind/echarts,ecomfe/echarts,100star/echarts,100star/echarts,ecomfe/echarts,chenfwind/echarts,apache/incubator-echarts
--- +++ @@ -8,13 +8,13 @@ if (coordSys) { var dims = coordSys.dimensions; - if (coordSys.type === 'singleAxis') { + if (dims.length === 1) { data.each(dims[0], function (x, idx) { // Also {Array.<number>}, not undefined to avoid if...else... statement data.setItemLayout(idx, isNaN(x) ? [NaN, NaN] : coordSys.dataToPoint(x)); }); } - else { + else if (dims.length === 2) { data.each(dims, function (x, y, idx) { // Also {Array.<number>}, not undefined to avoid if...else... statement data.setItemLayout(
83a23a7183bdb68a71468965508be5bd64877c23
src/app/controllers/HomeController.js
src/app/controllers/HomeController.js
'use strict'; angular.module('app.controllers') .controller('HomeController', ['$scope', '$state', 'fileModel', 'imageModel', function HomeController($scope, $state, fileModel, imageModel) { // private var _this = { onCreate: function() { if(imageModel.getImages().length === 0) { $scope.loading(true); imageModel.loadImages() .then(function() { $scope.loading(false); }); } } }; // public $scope.model = imageModel; /** * Triggered when the user presses the upload button in the navigation bar. */ $scope.upload = function(file) { if(file && file.length) { // Set the file fileModel.setFile(file[0]); // Navigate to the upload state $state.go('upload'); } }; $scope.loadMore = function() { if(!$scope._data.loading) { $scope.loading(true); imageModel.loadMore() .then(function() { $scope.loading(false); }); } }; // Initialize the controller _this.onCreate(); }]);
'use strict'; angular.module('app.controllers') .controller('HomeController', ['$scope', '$state', 'fileModel', 'imageModel', function HomeController($scope, $state, fileModel, imageModel) { // private var _this = { onCreate: function() { if(imageModel.getImages().length === 0) { $scope.loading(true); imageModel.loadImages() .finally(function() { $scope.loading(false); }); } } }; // public $scope.model = imageModel; /** * Triggered when the user presses the upload button in the navigation bar. */ $scope.upload = function(file) { if(file && file.length) { // Set the file fileModel.setFile(file[0]); // Navigate to the upload state $state.go('upload'); } }; $scope.loadMore = function() { if(!$scope._data.loading) { $scope.loading(true); imageModel.loadMore() .finally(function() { $scope.loading(false); }); } }; // Initialize the controller _this.onCreate(); }]);
Stop the loader in the finally to make sure it allways stops
Stop the loader in the finally to make sure it allways stops
JavaScript
mit
SamVerschueren/imagery,SamVerschueren/selfie-wall,SamVerschueren/selfie-wall,SamVerschueren/imagery
--- +++ @@ -10,7 +10,7 @@ $scope.loading(true); imageModel.loadImages() - .then(function() { + .finally(function() { $scope.loading(false); }); } @@ -38,7 +38,7 @@ $scope.loading(true); imageModel.loadMore() - .then(function() { + .finally(function() { $scope.loading(false); }); }
e1fe5a876ab104f5396f9ba3533943cbe8f53e52
lib/helpers/message-parsers.js
lib/helpers/message-parsers.js
module.exports.in = function(_msg) { if (_msg.properties.contentType === 'application/json') { try { return JSON.parse(_msg.content.toString()); } catch(e) {} } return _msg.content.toString(); }; module.exports.out = function(content, options) { if (content) { content = JSON.stringify(content); options.contentType = 'application/json'; } return new Buffer(content); };
module.exports.in = function(_msg) { if (_msg.properties.contentType === 'application/json') { try { return JSON.parse(_msg.content.toString()); } catch(e) {} } return _msg.content.toString(); }; module.exports.out = function(content, options) { if (content !== undefined) { content = JSON.stringify(content); options.contentType = 'application/json'; } return new Buffer(content); };
Check if content is different from undefined
Check if content is different from undefined
JavaScript
mit
dial-once/node-bunnymq
--- +++ @@ -9,7 +9,7 @@ }; module.exports.out = function(content, options) { - if (content) { + if (content !== undefined) { content = JSON.stringify(content); options.contentType = 'application/json'; }
14585d45e2d732cb5b20da0fc60dec615772feee
src/components/SocialLink/SocialLink.js
src/components/SocialLink/SocialLink.js
import React, { Component, PropTypes } from 'react'; import './SocialLink.css'; class SocialLink extends Component { static propTypes = { name: PropTypes.string.isRequired, url: PropTypes.string.isRequired, icon: PropTypes.string.isRequired, iconHover: PropTypes.string.isRequired, }; state = { isHovering: false, }; handleMouseOver() { this.setState({ isHovering: true }); } handleMouseOut() { this.setState({ isHovering: false }); } render() { const { isHovering } = this.state; const { name, url, icon, iconHover } = this.props; return ( <li className="social-link"> <a className="social-link" href={url}> <img className="social-icon" src={isHovering ? iconHover : icon} alt={name} onMouseOver={() => this.handleMouseOver()} onMouseOut={() => this.handleMouseOut()} /> </a> </li> ); } } export default SocialLink;
import React, { Component, PropTypes } from 'react'; import './SocialLink.css'; class SocialLink extends Component { static propTypes = { name: PropTypes.string.isRequired, url: PropTypes.string.isRequired, icon: PropTypes.string.isRequired, iconHover: PropTypes.string.isRequired, }; state = { isHovering: false, }; handleMouseOver() { this.setState({ isHovering: true }); } handleMouseOut() { this.setState({ isHovering: false }); } render() { const { isHovering } = this.state; const { name, url, icon, iconHover } = this.props; return ( <li className="social-link"> <a className="social-link" href={url} onMouseOver={() => this.handleMouseOver()} onMouseOut={() => this.handleMouseOut()} > <img className="social-icon" src={isHovering ? iconHover : icon} alt={name} /> </a> </li> ); } } export default SocialLink;
Apply colored image when you hover the link
:art: Apply colored image when you hover the link Not just the image itself (there's padding on the link).
JavaScript
mit
cooperka/personal-website,cooperka/personal-website
--- +++ @@ -29,13 +29,16 @@ return ( <li className="social-link"> - <a className="social-link" href={url}> + <a + className="social-link" + href={url} + onMouseOver={() => this.handleMouseOver()} + onMouseOut={() => this.handleMouseOut()} + > <img className="social-icon" src={isHovering ? iconHover : icon} alt={name} - onMouseOver={() => this.handleMouseOver()} - onMouseOut={() => this.handleMouseOut()} /> </a> </li>
b530a17c0d730f586dd44708d04d6c825fcb475b
src/js-context/functions/plot/bars.js
src/js-context/functions/plot/bars.js
export default function bars (data, x, y) { x = x || 'x' y = y || 'y' return { type: 'vegalite', data: { values: data }, mark: 'bar', encoding: { x: { field: x, type: 'qualitative' }, y: { field: y, type: 'quantitative' } } } }
import convertTableToArray from '../types/convertTableToArray' export default function bars (data, x, y) { x = x || 'x' y = y || 'y' return { type: 'vegalite', data: { values: convertTableToArray(data) }, mark: 'bar', encoding: { x: { field: x, type: 'qualitative' }, y: { field: y, type: 'quantitative' } } } }
Add conversion to bar plot
Add conversion to bar plot
JavaScript
apache-2.0
stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila
--- +++ @@ -1,3 +1,5 @@ +import convertTableToArray from '../types/convertTableToArray' + export default function bars (data, x, y) { x = x || 'x' y = y || 'y' @@ -5,7 +7,7 @@ return { type: 'vegalite', data: { - values: data + values: convertTableToArray(data) }, mark: 'bar', encoding: {
2baf7a841755723c8e922b34c03b7ea8d0a98a4f
src/view/reducers.js
src/view/reducers.js
import { combineReducers } from "redux"; import { JOB_START, JOB_CREATED } from "./actions"; function views(state = {}, action) { switch (action.type) { case JOB_START: let views = {}; // XXX need to change outrigger to return view_id instead of sink_id action.views.forEach(view => { views[view.sink_id] = view; }); return views; default: return state; } } function job_id(state = null, action) { switch (action.type) { case JOB_CREATED: return action.job_id; default: return state; } } export default combineReducers({ views, job_id });
import { combineReducers } from "redux"; import { JOB_START, JOB_CREATED } from "./actions"; function views(state = {}, action) { switch (action.type) { // reset views on new job case JOB_CREATED: return {}; case JOB_START: let views = {}; // XXX need to change outrigger to return view_id instead of sink_id action.views.forEach(view => { views[view.sink_id] = view; }); return views; default: return state; } } function job_id(state = null, action) { switch (action.type) { case JOB_CREATED: return action.job_id; default: return state; } } export default combineReducers({ views, job_id });
Clear views array on job_create event
Clear views array on job_create event Fixes juttle/outrigger#83 When running a different program from our original program, there was an issue with the old views getting reinstantiated because they still existed in redux store. This change resets the views in the store to an empty object so new views are only instantiated when we have info about them.
JavaScript
apache-2.0
juttle/juttle-client-library,juttle/juttle-client-library
--- +++ @@ -4,6 +4,9 @@ function views(state = {}, action) { switch (action.type) { + // reset views on new job + case JOB_CREATED: + return {}; case JOB_START: let views = {}; @@ -14,6 +17,7 @@ }); return views; + default: return state;
061c9744af7b6664ab12a2793e3ecc740c257c81
erpnext/stock/doctype/serial_no/serial_no.js
erpnext/stock/doctype/serial_no/serial_no.js
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt cur_frm.add_fetch("customer", "customer_name", "customer_name") cur_frm.add_fetch("supplier", "supplier_name", "supplier_name") cur_frm.add_fetch("item_code", "item_name", "item_name") cur_frm.add_fetch("item_code", "description", "description") cur_frm.add_fetch("item_code", "item_group", "item_group") cur_frm.add_fetch("item_code", "brand", "brand") cur_frm.cscript.onload = function() { cur_frm.set_query("item_code", function() { return erpnext.queries.item({"is_stock_item": "Yes", "has_serial_no": "Yes"}) }); }; frappe.ui.form.on("Serial No", "refresh", function(frm) { frm.toggle_enable("item_code", frm.doc.__islocal); if(frm.doc.status == "Sales Returned" && frm.doc.warehouse) cur_frm.add_custom_button(__('Set Status as Available'), cur_frm.cscript.set_status_as_available); }); cur_frm.cscript.set_status_as_available = function() { cur_frm.set_value("status", "Available"); cur_frm.save() }
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt cur_frm.add_fetch("customer", "customer_name", "customer_name") cur_frm.add_fetch("supplier", "supplier_name", "supplier_name") cur_frm.add_fetch("item_code", "item_name", "item_name") cur_frm.add_fetch("item_code", "description", "description") cur_frm.add_fetch("item_code", "item_group", "item_group") cur_frm.add_fetch("item_code", "brand", "brand") cur_frm.cscript.onload = function() { cur_frm.set_query("item_code", function() { return erpnext.queries.item({"is_stock_item": "Yes", "has_serial_no": "Yes"}) }); }; frappe.ui.form.on("Serial No", "refresh", function(frm) { frm.toggle_enable("item_code", frm.doc.__islocal); if(frm.doc.status == "Sales Returned" && frm.doc.warehouse) cur_frm.add_custom_button(__('Set Status as Available'), function() { cur_frm.set_value("status", "Available"); cur_frm.save(); }); });
Set status button in serial no
Set status button in serial no
JavaScript
agpl-3.0
mbauskar/helpdesk-erpnext,Drooids/erpnext,gangadharkadam/sterp,suyashphadtare/test,rohitwaghchaure/erpnext-receipher,suyashphadtare/vestasi-erp-final,shitolepriya/test-erp,mbauskar/Das_Erpnext,indictranstech/reciphergroup-erpnext,rohitwaghchaure/GenieManager-erpnext,MartinEnder/erpnext-de,mbauskar/phrerp,indictranstech/reciphergroup-erpnext,BhupeshGupta/erpnext,ThiagoGarciaAlves/erpnext,indictranstech/internal-erpnext,mbauskar/Das_Erpnext,gangadhar-kadam/latestchurcherp,mbauskar/omnitech-erpnext,MartinEnder/erpnext-de,dieface/erpnext,gmarke/erpnext,gangadharkadam/tailorerp,Tejal011089/osmosis_erpnext,gangadhar-kadam/verve_erp,aruizramon/alec_erpnext,Tejal011089/paypal_erpnext,rohitwaghchaure/erpnext_smart,4commerce-technologies-AG/erpnext,gangadharkadam/v4_erp,Tejal011089/paypal_erpnext,indictranstech/biggift-erpnext,BhupeshGupta/erpnext,Tejal011089/fbd_erpnext,indictranstech/buyback-erp,rohitwaghchaure/digitales_erpnext,suyashphadtare/gd-erp,mbauskar/omnitech-erpnext,rohitwaghchaure/New_Theme_Erp,hanselke/erpnext-1,gangadhar-kadam/latestchurcherp,mahabuber/erpnext,rohitwaghchaure/erpnext-receipher,mbauskar/omnitech-erpnext,indictranstech/phrerp,rohitwaghchaure/GenieManager-erpnext,indictranstech/vestasi-erpnext,saurabh6790/test-erp,indictranstech/tele-erpnext,gangadhar-kadam/helpdesk-erpnext,indictranstech/reciphergroup-erpnext,indictranstech/tele-erpnext,indictranstech/buyback-erp,suyashphadtare/gd-erp,netfirms/erpnext,saurabh6790/test-erp,indictranstech/Das_Erpnext,indictranstech/erpnext,indictranstech/Das_Erpnext,mbauskar/alec_frappe5_erpnext,aruizramon/alec_erpnext,pombredanne/erpnext,gangadharkadam/sher,gangadhar-kadam/verve_live_erp,gangadharkadam/saloon_erp_install,gangadhar-kadam/verve_test_erp,sagar30051991/ozsmart-erp,pawaranand/phrerp,meisterkleister/erpnext,shitolepriya/test-erp,gangadharkadam/office_erp,mbauskar/helpdesk-erpnext,mbauskar/sapphire-erpnext,anandpdoshi/erpnext,mahabuber/erpnext,mbauskar/omnitech-demo-erpnext,hatwar/focal-erpnext,gangadharkadam/saloon_erp,meisterkleister/erpnext,gangadhar-kadam/laganerp,indictranstech/erpnext,gangadharkadam/v6_erp,hernad/erpnext,fuhongliang/erpnext,4commerce-technologies-AG/erpnext,suyashphadtare/vestasi-erp-final,indictranstech/vestasi-erpnext,gangadharkadam/tailorerp,indictranstech/trufil-erpnext,indictranstech/Das_Erpnext,indictranstech/trufil-erpnext,indictranstech/erpnext,gangadharkadam/saloon_erp,indictranstech/Das_Erpnext,SPKian/Testing2,mbauskar/helpdesk-erpnext,ThiagoGarciaAlves/erpnext,hatwar/focal-erpnext,hatwar/Das_erpnext,gangadhar-kadam/smrterp,gangadharkadam/v5_erp,gangadhar-kadam/latestchurcherp,gangadharkadam/v4_erp,hernad/erpnext,indictranstech/osmosis-erpnext,indictranstech/fbd_erpnext,netfirms/erpnext,dieface/erpnext,hernad/erpnext,Tejal011089/digitales_erpnext,hanselke/erpnext-1,mbauskar/sapphire-erpnext,SPKian/Testing2,indictranstech/vestasi-erpnext,gangadhar-kadam/laganerp,geekroot/erpnext,shitolepriya/test-erp,indictranstech/osmosis-erpnext,Tejal011089/digitales_erpnext,indictranstech/buyback-erp,gangadharkadam/contributionerp,gangadharkadam/sher,tmimori/erpnext,tmimori/erpnext,gangadhar-kadam/verve_erp,MartinEnder/erpnext-de,gangadhar-kadam/verve_test_erp,suyashphadtare/test,njmube/erpnext,mbauskar/omnitech-erpnext,rohitwaghchaure/New_Theme_Erp,gangadharkadam/v4_erp,Suninus/erpnext,suyashphadtare/test,Suninus/erpnext,gangadhar-kadam/helpdesk-erpnext,rohitwaghchaure/New_Theme_Erp,suyashphadtare/vestasi-erp-1,indictranstech/biggift-erpnext,gangadharkadam/sterp,dieface/erpnext,indictranstech/osmosis-erpnext,Tejal011089/osmosis_erpnext,gangadhar-kadam/verve_erp,Drooids/erpnext,sheafferusa/erpnext,suyashphadtare/vestasi-erp-final,rohitwaghchaure/GenieManager-erpnext,mbauskar/alec_frappe5_erpnext,suyashphadtare/sajil-erp,meisterkleister/erpnext,dieface/erpnext,gangadharkadam/office_erp,suyashphadtare/gd-erp,suyashphadtare/vestasi-update-erp,4commerce-technologies-AG/erpnext,pawaranand/phrerp,sagar30051991/ozsmart-erp,suyashphadtare/vestasi-erp-jan-end,Tejal011089/trufil-erpnext,Tejal011089/fbd_erpnext,mbauskar/Das_Erpnext,gangadhar-kadam/verve-erp,rohitwaghchaure/digitales_erpnext,gangadharkadam/smrterp,mbauskar/alec_frappe5_erpnext,rohitwaghchaure/erpnext-receipher,hatwar/buyback-erpnext,rohitwaghchaure/GenieManager-erpnext,ThiagoGarciaAlves/erpnext,suyashphadtare/sajil-final-erp,hatwar/Das_erpnext,indictranstech/erpnext,Tejal011089/trufil-erpnext,Tejal011089/digitales_erpnext,anandpdoshi/erpnext,hatwar/Das_erpnext,shft117/SteckerApp,anandpdoshi/erpnext,gangadhar-kadam/laganerp,gmarke/erpnext,Tejal011089/huntercamp_erpnext,Tejal011089/fbd_erpnext,gangadhar-kadam/verve_live_erp,sagar30051991/ozsmart-erp,indictranstech/focal-erpnext,suyashphadtare/vestasi-update-erp,susuchina/ERPNEXT,hatwar/buyback-erpnext,fuhongliang/erpnext,mbauskar/omnitech-demo-erpnext,gangadharkadam/contributionerp,njmube/erpnext,geekroot/erpnext,sagar30051991/ozsmart-erp,SPKian/Testing2,gangadhar-kadam/latestchurcherp,indictranstech/phrerp,indictranstech/biggift-erpnext,gsnbng/erpnext,fuhongliang/erpnext,gsnbng/erpnext,SPKian/Testing,gangadhar-kadam/verve-erp,indictranstech/focal-erpnext,Suninus/erpnext,gangadharkadam/verveerp,geekroot/erpnext,gangadharkadam/johnerp,gangadharkadam/v6_erp,gangadhar-kadam/verve_erp,indictranstech/fbd_erpnext,Tejal011089/huntercamp_erpnext,hatwar/focal-erpnext,hatwar/focal-erpnext,mahabuber/erpnext,gangadharkadam/vlinkerp,Aptitudetech/ERPNext,saurabh6790/test-erp,saurabh6790/test-erp,hanselke/erpnext-1,Tejal011089/huntercamp_erpnext,geekroot/erpnext,hatwar/Das_erpnext,indictranstech/internal-erpnext,gangadharkadam/smrterp,treejames/erpnext,mbauskar/phrerp,gangadharkadam/v6_erp,aruizramon/alec_erpnext,gangadharkadam/verveerp,BhupeshGupta/erpnext,gsnbng/erpnext,susuchina/ERPNEXT,pawaranand/phrerp,njmube/erpnext,meisterkleister/erpnext,shitolepriya/test-erp,anandpdoshi/erpnext,gangadharkadam/v5_erp,mahabuber/erpnext,gangadharkadam/contributionerp,mbauskar/omnitech-demo-erpnext,gangadharkadam/v4_erp,suyashphadtare/sajil-erp,SPKian/Testing,indictranstech/phrerp,Suninus/erpnext,mbauskar/alec_frappe5_erpnext,susuchina/ERPNEXT,SPKian/Testing,mbauskar/helpdesk-erpnext,mbauskar/phrerp,gangadhar-kadam/verve_live_erp,indictranstech/internal-erpnext,gangadhar-kadam/smrterp,pombredanne/erpnext,Tejal011089/paypal_erpnext,ShashaQin/erpnext,gangadharkadam/letzerp,gangadharkadam/office_erp,pawaranand/phrerp,indictranstech/reciphergroup-erpnext,indictranstech/trufil-erpnext,Tejal011089/trufil-erpnext,fuhongliang/erpnext,indictranstech/buyback-erp,rohitwaghchaure/digitales_erpnext,suyashphadtare/sajil-erp,gangadhar-kadam/verve_test_erp,ShashaQin/erpnext,treejames/erpnext,gangadharkadam/letzerp,gangadharkadam/v5_erp,gmarke/erpnext,shft117/SteckerApp,mbauskar/omnitech-demo-erpnext,gangadharkadam/v6_erp,gangadharkadam/verveerp,indictranstech/biggift-erpnext,gangadhar-kadam/helpdesk-erpnext,ShashaQin/erpnext,Drooids/erpnext,indictranstech/fbd_erpnext,sheafferusa/erpnext,hatwar/buyback-erpnext,gangadharkadam/saloon_erp,indictranstech/fbd_erpnext,mbauskar/sapphire-erpnext,gangadharkadam/v5_erp,suyashphadtare/gd-erp,Tejal011089/osmosis_erpnext,treejames/erpnext,indictranstech/internal-erpnext,mbauskar/phrerp,gangadhar-kadam/helpdesk-erpnext,pombredanne/erpnext,gangadharkadam/saloon_erp,sheafferusa/erpnext,hatwar/buyback-erpnext,shft117/SteckerApp,suyashphadtare/vestasi-erp-jan-end,indictranstech/tele-erpnext,suyashphadtare/vestasi-erp-1,gangadharkadam/saloon_erp_install,aruizramon/alec_erpnext,pombredanne/erpnext,rohitwaghchaure/New_Theme_Erp,Tejal011089/huntercamp_erpnext,suyashphadtare/vestasi-erp-jan-end,suyashphadtare/vestasi-erp-1,gangadharkadam/contributionerp,indictranstech/phrerp,Tejal011089/osmosis_erpnext,SPKian/Testing2,gangadhar-kadam/verve_test_erp,gangadharkadam/vlinkerp,gangadharkadam/vlinkerp,tmimori/erpnext,Tejal011089/trufil-erpnext,indictranstech/trufil-erpnext,netfirms/erpnext,suyashphadtare/vestasi-update-erp,rohitwaghchaure/erpnext_smart,rohitwaghchaure/erpnext_smart,treejames/erpnext,BhupeshGupta/erpnext,netfirms/erpnext,indictranstech/focal-erpnext,indictranstech/vestasi-erpnext,rohitwaghchaure/erpnext-receipher,Tejal011089/fbd_erpnext,gangadharkadam/letzerp,mbauskar/Das_Erpnext,gangadhar-kadam/verve-erp,hanselke/erpnext-1,Drooids/erpnext,gangadharkadam/verveerp,indictranstech/osmosis-erpnext,ThiagoGarciaAlves/erpnext,rohitwaghchaure/digitales_erpnext,ShashaQin/erpnext,gsnbng/erpnext,gangadhar-kadam/verve_live_erp,shft117/SteckerApp,mbauskar/sapphire-erpnext,Tejal011089/paypal_erpnext,sheafferusa/erpnext,suyashphadtare/sajil-final-erp,gangadharkadam/saloon_erp_install,gmarke/erpnext,njmube/erpnext,indictranstech/focal-erpnext,susuchina/ERPNEXT,suyashphadtare/sajil-final-erp,indictranstech/tele-erpnext,tmimori/erpnext,Tejal011089/digitales_erpnext,gangadharkadam/saloon_erp_install,gangadharkadam/johnerp,SPKian/Testing,hernad/erpnext,gangadharkadam/letzerp,gangadharkadam/vlinkerp,MartinEnder/erpnext-de,suyashphadtare/vestasi-erp-jan-end
--- +++ @@ -19,10 +19,8 @@ frm.toggle_enable("item_code", frm.doc.__islocal); if(frm.doc.status == "Sales Returned" && frm.doc.warehouse) - cur_frm.add_custom_button(__('Set Status as Available'), cur_frm.cscript.set_status_as_available); + cur_frm.add_custom_button(__('Set Status as Available'), function() { + cur_frm.set_value("status", "Available"); + cur_frm.save(); + }); }); - -cur_frm.cscript.set_status_as_available = function() { - cur_frm.set_value("status", "Available"); - cur_frm.save() -}
f73ef8d6468960012c4971cdf91c2c8fee6cc51b
app/components/select-picker.js
app/components/select-picker.js
import Ember from 'ember'; import SelectPickerMixin from 'ember-cli-select-picker/mixins/select-picker'; var I18nProps = (Ember.I18n && Ember.I18n.TranslateableProperties) || {}; var SelectPickerComponent = Ember.Component.extend( SelectPickerMixin, I18nProps, { selectAllLabel: 'All', selectNoneLabel: 'None', nativeMobile: true, classNames: ['select-picker'], didInsertElement: function() { var eventName = 'click.' + this.get('elementId'); var _this = this; $(document).on(eventName, function (e) { if (_this.get('keepDropdownOpen')) { _this.set('keepDropdownOpen', false); return; } if (_this.element && !$.contains(_this.element, e.target)) { _this.set('showDropdown', false); } }); }, willDestroyElement: function() { $(document).off('.' + this.get('elementId')); }, actions: { showHide: function () { this.toggleProperty('showDropdown'); } } }); export default SelectPickerComponent;
import Ember from 'ember'; import SelectPickerMixin from 'ember-cli-select-picker/mixins/select-picker'; var I18nProps = (Ember.I18n && Ember.I18n.TranslateableProperties) || {}; var SelectPickerComponent = Ember.Component.extend( SelectPickerMixin, I18nProps, { selectAllLabel: 'All', selectNoneLabel: 'None', nativeMobile: true, classNames: ['select-picker'], setupDom: Ember.observer( 'didInsertElement', function() { var eventName = 'click.' + this.get('elementId'); var _this = this; $(document).on(eventName, function (e) { if (_this.get('keepDropdownOpen')) { _this.set('keepDropdownOpen', false); return; } if (_this.element && !$.contains(_this.element, e.target)) { _this.set('showDropdown', false); } }); } ), teardownDom: Ember.observer( 'willDestroyElement', function() { $(document).off('.' + this.get('elementId')); } ), actions: { showHide: function () { this.toggleProperty('showDropdown'); } } }); export default SelectPickerComponent;
Use Ember.observer over named properties
Use Ember.observer over named properties The named properties are a convenience but makes it harder to overload later on. It is better to use observers and in the case of an addon the Ember.observer() pattern
JavaScript
mit
sukima/ember-cli-select-picker,sukima/ember-cli-select-picker
--- +++ @@ -13,23 +13,29 @@ classNames: ['select-picker'], - didInsertElement: function() { - var eventName = 'click.' + this.get('elementId'); - var _this = this; - $(document).on(eventName, function (e) { - if (_this.get('keepDropdownOpen')) { - _this.set('keepDropdownOpen', false); - return; - } - if (_this.element && !$.contains(_this.element, e.target)) { - _this.set('showDropdown', false); - } - }); - }, + setupDom: Ember.observer( + 'didInsertElement', + function() { + var eventName = 'click.' + this.get('elementId'); + var _this = this; + $(document).on(eventName, function (e) { + if (_this.get('keepDropdownOpen')) { + _this.set('keepDropdownOpen', false); + return; + } + if (_this.element && !$.contains(_this.element, e.target)) { + _this.set('showDropdown', false); + } + }); + } + ), - willDestroyElement: function() { - $(document).off('.' + this.get('elementId')); - }, + teardownDom: Ember.observer( + 'willDestroyElement', + function() { + $(document).off('.' + this.get('elementId')); + } + ), actions: { showHide: function () {
2cf94c1093147559e581c3c7e161261018c63521
app/js/models/business-model.js
app/js/models/business-model.js
'use strict'; var Backbone = require('backbone'); var BusinessModel = Backbone.Model.extend({ idAttribute: 'id', parse: function(data) { var hash = {}; hash.name = data.name; hash.id = data.id; hash.address = data.location.display_address.join(' '); hash.rating = data.rating; if (data.location.coordinate && data.location.coordinate !== 'undefined') { hash.coordinates = { lat: data.location.coordinate.latitude, lng: data.location.coordinate.longitude }; } if (data.categories && data.categories !== 'undefined') { hash.specificCategory = data.categories[0][0]; } else { hash.specificCategory = ''; } return hash; } }); module.exports = BusinessModel;
'use strict'; var Backbone = require('backbone'); var BusinessModel = Backbone.Model.extend({ idAttribute: 'id', parse: function(data) { var hash = {}; hash.name = data.name; hash.id = data.id; hash.address = data.location.display_address.join(' '); hash.rating = data.rating; hash.url = data.url; if (data.location.coordinate && data.location.coordinate !== 'undefined') { hash.coordinates = { lat: data.location.coordinate.latitude, lng: data.location.coordinate.longitude }; } if (data.categories && data.categories !== 'undefined') { hash.specificCategory = data.categories[0][0]; } else { hash.specificCategory = ''; } return hash; } }); module.exports = BusinessModel;
Update parse() to grab the business URL
Update parse() to grab the business URL
JavaScript
mit
Localhost3000/along-the-way
--- +++ @@ -9,6 +9,7 @@ hash.id = data.id; hash.address = data.location.display_address.join(' '); hash.rating = data.rating; + hash.url = data.url; if (data.location.coordinate && data.location.coordinate !== 'undefined') { hash.coordinates = {
29905f1312d3ea4cc498f9718ed253f02d1e1c00
js/CanvasScreen.js
js/CanvasScreen.js
/** * Class for drawing elements in canvas * @param {object} canvasElem handler of canvas */ var CanvasScreen = function ( canvasElem ) { const SIZE = 40; //size of square let ctx = canvasElem.getContext( "2d" ), currentX = 0, currentY = 0; let = drawSingleSquare = ( obj ) => { ctx.beginPath(); ctx.moveTo( currentX, currentY ); ctx.rect( currentX,currentY,SIZE,SIZE ); setBgSquare( obj ); ctx.fill(); ctx.stroke();//TODO delete } let setBgSquare = ( obj ) => { let bg; if ( obj.isFilled ) { bg = obj.bgColor; } else { bg = "white"; } ctx.fillStyle = bg; } /** Public function, draw elements in canvas @param {array} array array of objects */ this.draw = function ( array ) { currentX = 0, currentY = 0; array.forEach( (v) => { v.forEach( (sq) => { drawSingleSquare(sq); currentX += SIZE; }); currentX = 0; currentY += SIZE; }); } }
/** * Class for drawing elements in canvas * @param {object} canvasElem handler of canvas */ var CanvasScreen = function ( canvasElem ) { const SIZE = 40; //size of square let ctx = canvasElem.getContext( "2d" ), currentX = 0, currentY = 0; let = drawSingleSquare = ( obj ) => { ctx.beginPath(); ctx.moveTo( currentX, currentY ); ctx.rect( currentX,currentY,SIZE,SIZE ); setBgSquare( obj ); ctx.fill(); ctx.stroke();//TODO delete } let setBgSquare = ( obj ) => { let bg; if ( obj.isActived ) { bg = obj.bgColor; } else { bg = "white"; } ctx.fillStyle = bg; } /** Public function, draw elements in canvas @param {array} array array of objects */ this.draw = function ( array ) { currentX = 0, currentY = 0; array.forEach( (v) => { v.forEach( (sq) => { //console.log(sq); drawSingleSquare(sq); currentX += SIZE; }); currentX = 0; currentY += SIZE; }); } }
Change property for painting element
Change property for painting element
JavaScript
mit
Ziken/Tetris,Ziken/Tetris
--- +++ @@ -19,7 +19,7 @@ } let setBgSquare = ( obj ) => { let bg; - if ( obj.isFilled ) { + if ( obj.isActived ) { bg = obj.bgColor; } else { bg = "white"; @@ -36,6 +36,7 @@ array.forEach( (v) => { v.forEach( (sq) => { + //console.log(sq); drawSingleSquare(sq); currentX += SIZE; });
2e673c353c93832c3ac61fd7c9f370386f29159e
lib/knock-knock.js
lib/knock-knock.js
const Assert = require('assert'); const Child = require('child_process'); const Fs = require('fs'); const Path = require('path'); var packagePath = Path.join(process.cwd(), 'package.json'); var out = Object.prototype, keys = []; function execute(options, done) { var key = keys.shift(); if (!key) return done(null, out); Child.exec(options[key], function (err, stdout) { out[key] = err ? err.toString() : stdout; return execute(options, done); }); } module.exports = function (options, done) { if (typeof options === 'function') { done = options; options = {}; } Assert.equal(typeof options, 'object', 'Options must be an object'); Assert.equal(typeof done, 'function', 'Must pass in a callback function'); options = Object.assign({ node: 'node -v', npm: 'npm -v' }, options); keys = Object.keys(options); Fs.readFile(packagePath, 'utf8', function (err, packageJson) { if (err) return done(err); packageJson = JSON.parse(packageJson); out = { name: packageJson.name, version: packageJson.version, env: process.env.NODE_ENV // eslint-disable-line no-process-env }; return execute(options, done); }); };
const Assert = require('assert'); const Child = require('child_process'); const Fs = require('fs'); const Path = require('path'); var packagePath = Path.join(process.cwd(), 'package.json'); var out = Object.prototype, keys = []; function execute(options, done) { var key = keys.shift(); if (!key) return done(null, out); Child.exec(options[key], function (err, stdout) { out[key] = err ? err.toString() : stdout.replace(/\n/g, ''); return execute(options, done); }); } module.exports = function (options, done) { if (typeof options === 'function') { done = options; options = {}; } Assert.equal(typeof options, 'object', 'Options must be an object'); Assert.equal(typeof done, 'function', 'Must pass in a callback function'); options = Object.assign({ node: 'node -v', npm: 'npm -v' }, options); keys = Object.keys(options); Fs.readFile(packagePath, 'utf8', function (err, packageJson) { if (err) return done(err); packageJson = JSON.parse(packageJson); out = { name: packageJson.name, version: packageJson.version, env: process.env.NODE_ENV // eslint-disable-line no-process-env }; return execute(options, done); }); };
Remove newline characters at the end of each string
Remove newline characters at the end of each string
JavaScript
mit
jackboberg/knock-knock,onmodulus/knock-knock
--- +++ @@ -12,7 +12,7 @@ if (!key) return done(null, out); Child.exec(options[key], function (err, stdout) { - out[key] = err ? err.toString() : stdout; + out[key] = err ? err.toString() : stdout.replace(/\n/g, ''); return execute(options, done); }); }
b42288d77f8908a4ded960548e1b8f54311882d3
src/apps/interactions/controllers/edit.js
src/apps/interactions/controllers/edit.js
/* eslint camelcase: 0 */ const { get, merge, pickBy } = require('lodash') const { transformInteractionResponseToForm } = require('../transformers') const { transformDateStringToDateObject } = require('../../transformers') const { interactionEditFormConfig } = require('../macros') const { buildFormWithStateAndErrors } = require('../../builders') function renderEditPage (req, res) { const interactionData = transformInteractionResponseToForm(res.locals.interaction) const interactionDefaults = { dit_adviser: req.session.user, date: transformDateStringToDateObject(new Date()), } const mergedInteractionData = pickBy(merge({}, interactionDefaults, interactionData, res.locals.requestBody)) const interactionForm = buildFormWithStateAndErrors( interactionEditFormConfig( { returnLink: res.locals.returnLink, advisers: get(res.locals, 'advisers.results'), contacts: res.locals.contacts, services: res.locals.services, }), mergedInteractionData, get(res.locals, 'form.errors.messages'), ) res .breadcrumb(`${interactionData ? 'Edit' : 'Add'} interaction`) .title(`${interactionData ? 'Edit' : 'Add'} interaction for ${res.locals.entityName}`) .render('interactions/views/edit', { interactionForm, }) } module.exports = { renderEditPage, }
/* eslint camelcase: 0 */ const { get, merge, pickBy } = require('lodash') const { transformInteractionResponseToForm } = require('../transformers') const { transformDateStringToDateObject } = require('../../transformers') const { interactionEditFormConfig } = require('../macros') const { buildFormWithStateAndErrors } = require('../../builders') function renderEditPage (req, res) { const interactionData = transformInteractionResponseToForm(res.locals.interaction) const interactionDefaults = { dit_adviser: req.session.user, date: transformDateStringToDateObject(new Date()), contact: get(res.locals, 'contact.id'), } const mergedInteractionData = pickBy(merge({}, interactionDefaults, interactionData, res.locals.requestBody)) const interactionForm = buildFormWithStateAndErrors( interactionEditFormConfig( { returnLink: res.locals.returnLink, advisers: get(res.locals, 'advisers.results'), contacts: res.locals.contacts, services: res.locals.services, }), mergedInteractionData, get(res.locals, 'form.errors.messages'), ) res .breadcrumb(`${interactionData ? 'Edit' : 'Add'} interaction`) .title(`${interactionData ? 'Edit' : 'Add'} interaction for ${res.locals.entityName}`) .render('interactions/views/edit', { interactionForm, }) } module.exports = { renderEditPage, }
Set default contact if present
Set default contact if present
JavaScript
mit
uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-fe-beta2
--- +++ @@ -11,6 +11,7 @@ const interactionDefaults = { dit_adviser: req.session.user, date: transformDateStringToDateObject(new Date()), + contact: get(res.locals, 'contact.id'), } const mergedInteractionData = pickBy(merge({}, interactionDefaults, interactionData, res.locals.requestBody)) const interactionForm =
f2e8cf8a4c9eac21222a1a66225399e90af61f78
lib/load-config.js
lib/load-config.js
var path = require('path'); require('js-yaml'); module.exports = function(grunt, options) { var cwd = process.cwd(); var defaults = { configPath: path.join(cwd, 'grunt'), init: true }; options = grunt.util._.extend({}, defaults, options); var glob = require('glob'); var object = {}; var key; var aliases; glob.sync('*.{js,yml,yaml,coffee}', {cwd: options.configPath}).forEach(function(option) { key = option.replace(/\.(js|yml|yaml|coffee)$/,''); var fullPath = path.join(options.configPath, option); var settings = require(fullPath); if (key == 'aliases') { aliases = settings; } else { object[key] = grunt.util._.isFunction(settings) ? settings(grunt) : settings; } }); object.package = grunt.file.readJSON(path.join(cwd, 'package.json')); if (options.config) { grunt.util._.merge(object, options.config); } if (options.loadGruntTasks !== false) { var loadTasksOptions = options.loadGruntTasks || {}; require('load-grunt-tasks')(grunt, loadTasksOptions); } if (options.init) { grunt.initConfig(object); } if (aliases) { for (var taskName in aliases) { grunt.registerTask(taskName, aliases[taskName]); } } return object; };
var path = require('path'); var _ = require('lodash-node/modern/objects'); require('js-yaml'); module.exports = function(grunt, options) { var cwd = process.cwd(); var defaults = { configPath: path.join(cwd, 'grunt'), init: true }; options = _.extend({}, defaults, options); var glob = require('glob'); var object = {}; var key; var aliases; glob.sync('*.{js,yml,yaml,coffee}', {cwd: options.configPath}).forEach(function(option) { key = option.replace(/\.(js|yml|yaml|coffee)$/,''); var fullPath = path.join(options.configPath, option); var settings = require(fullPath); if (key == 'aliases') { aliases = settings; } else { object[key] = _.isFunction(settings) ? settings(grunt) : settings; } }); object.package = grunt.file.readJSON(path.join(cwd, 'package.json')); if (options.config) { _.merge(object, options.config); } if (options.loadGruntTasks !== false) { var loadTasksOptions = options.loadGruntTasks || {}; require('load-grunt-tasks')(grunt, loadTasksOptions); } if (options.init) { grunt.initConfig(object); } if (aliases) { for (var taskName in aliases) { grunt.registerTask(taskName, aliases[taskName]); } } return object; };
Use lodash-node instead of grunt.util._
Use lodash-node instead of grunt.util._ Because grunt.util._ is deprecated. (cf. http://gruntjs.com/api/grunt.util#grunt.util._)
JavaScript
mit
schmod/load-grunt-config,SolomoN-ua/load-grunt-config,firstandthird/load-grunt-config,SolomoN-ua/load-grunt-config,firstandthird/load-grunt-config
--- +++ @@ -1,5 +1,7 @@ var path = require('path'); +var _ = require('lodash-node/modern/objects'); require('js-yaml'); + module.exports = function(grunt, options) { var cwd = process.cwd(); @@ -8,7 +10,7 @@ init: true }; - options = grunt.util._.extend({}, defaults, options); + options = _.extend({}, defaults, options); var glob = require('glob'); var object = {}; @@ -22,7 +24,7 @@ if (key == 'aliases') { aliases = settings; } else { - object[key] = grunt.util._.isFunction(settings) ? + object[key] = _.isFunction(settings) ? settings(grunt) : settings; } }); @@ -30,7 +32,7 @@ object.package = grunt.file.readJSON(path.join(cwd, 'package.json')); if (options.config) { - grunt.util._.merge(object, options.config); + _.merge(object, options.config); } if (options.loadGruntTasks !== false) {
085c2840110381f83bbc9792c1cd10252e7dc04e
lib/components/src/preview/iframe.stories.js
lib/components/src/preview/iframe.stories.js
import React from 'react'; import { IFrame } from './iframe'; export default { Component: IFrame, title: 'Components|Preview/Iframe', }; const style = { width: '100%', height: '500px' }; export const workingStory = () => ( <IFrame id="iframe" title="Missing" src="/iframe.html?id=ui-panel--default" allowFullScreen style={style} /> ); export const missingStory = () => ( <IFrame id="iframe" title="Missing" src="/iframe.html?id=missing" allowFullScreen style={style} /> ); export const errorStory = () => ( <IFrame id="iframe" title="Missing" src="/iframe.html?id=core-errors--story-throws-exception" allowFullScreen style={style} /> );
import React from 'react'; import { IFrame } from './iframe'; export default { Component: IFrame, title: 'Components|Preview/Iframe', }; const style = { width: '100%', height: '500px' }; export const workingStory = () => ( <IFrame id="iframe" title="Missing" src="/iframe.html?id=ui-panel--default" allowFullScreen style={style} /> ); export const missingStory = () => ( <IFrame id="iframe" title="Missing" src="/iframe.html?id=missing" allowFullScreen style={style} /> ); export const errorStory = () => ( <IFrame id="iframe" title="Missing" src="/iframe.html?id=core-errors--story-throws-exception" allowFullScreen style={style} /> ); // We need to disable this one in Chromatic because the screenshot includes the uploaded URL sadly: // eg. https://www.chromaticqa.com/snapshot?appId=5a375b97f4b14f0020b0cda3&id=5c52edb4323f9000249aae72 errorStory.parameters = { chromatic: { disable: true }, };
Disable iframe error story in Chromatic :/
Disable iframe error story in Chromatic :/
JavaScript
mit
kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook
--- +++ @@ -32,3 +32,8 @@ style={style} /> ); +// We need to disable this one in Chromatic because the screenshot includes the uploaded URL sadly: +// eg. https://www.chromaticqa.com/snapshot?appId=5a375b97f4b14f0020b0cda3&id=5c52edb4323f9000249aae72 +errorStory.parameters = { + chromatic: { disable: true }, +};
13cc35a9c5c4dad333e1f8b8d6dfc5be02510899
tests/specs/module/path-resolve/main.js
tests/specs/module/path-resolve/main.js
define(function(require) { var test = require('../../../test') test.assert(require('./missing/missing').bogus === null, 'return null when module file is 404') test.assert(require('./nested/b/c/d').foo() === 1, 'nested module identifier is allowed') test.assert(require('./relative/a').foo == require('./relative/b').foo, 'a and b share foo through a relative require') var a1 = require('./a.js?v=1.0') var a2 = require('./a.js?v=2.0') test.assert(a1.name === 'a', a1.name) test.assert(a2.name === 'a', a2.name) test.assert(a1.foo() === 'foo', a1.foo()) test.assert(a2.foo() === 'foo', a2.foo()) test.assert(a1.foo !== a2.foo, 'a1.foo !== a2.foo') test.next() });
define(function(require) { var test = require('../../../test') test.assert(require('./missing/missing').bogus === null, 'return null when module file is 404') test.assert(require('./nested/b/c/d').name === 'd', 'nested module identifier is allowed') test.assert(require('./relative/a').foo == require('./relative/b').foo, 'a and b share foo through a relative require') var a1 = require('./version/a.js?v=1.0') var a2 = require('./version/a.js?v=2.0') test.assert(a1.name === 'a', a1.name) test.assert(a2.name === 'a', a2.name) test.assert(a1.foo() === 'foo', a1.foo()) test.assert(a2.foo() === 'foo', a2.foo()) test.assert(a1.foo !== a2.foo, 'a1.foo !== a2.foo') test.next() });
Fix a bug for spec
Fix a bug for spec
JavaScript
mit
judastree/seajs,lovelykobe/seajs,ysxlinux/seajs,jishichang/seajs,coolyhx/seajs,angelLYK/seajs,zwh6611/seajs,uestcNaldo/seajs,twoubt/seajs,zaoli/seajs,LzhElite/seajs,FrankElean/SeaJS,Lyfme/seajs,wenber/seajs,lee-my/seajs,kuier/seajs,moccen/seajs,PUSEN/seajs,yern/seajs,treejames/seajs,twoubt/seajs,eleanors/SeaJS,zwh6611/seajs,eleanors/SeaJS,Lyfme/seajs,baiduoduo/seajs,ysxlinux/seajs,twoubt/seajs,jishichang/seajs,tonny-zhang/seajs,kaijiemo/seajs,seajs/seajs,moccen/seajs,seajs/seajs,kuier/seajs,hbdrawn/seajs,imcys/seajs,yern/seajs,121595113/seajs,chinakids/seajs,lovelykobe/seajs,mosoft521/seajs,evilemon/seajs,lianggaolin/seajs,longze/seajs,longze/seajs,13693100472/seajs,liupeng110112/seajs,Gatsbyy/seajs,AlvinWei1024/seajs,Gatsbyy/seajs,wenber/seajs,wenber/seajs,jishichang/seajs,imcys/seajs,mosoft521/seajs,seajs/seajs,MrZhengliang/seajs,Gatsbyy/seajs,liupeng110112/seajs,imcys/seajs,judastree/seajs,longze/seajs,baiduoduo/seajs,AlvinWei1024/seajs,sheldonzf/seajs,sheldonzf/seajs,sheldonzf/seajs,FrankElean/SeaJS,moccen/seajs,treejames/seajs,lianggaolin/seajs,eleanors/SeaJS,JeffLi1993/seajs,lovelykobe/seajs,chinakids/seajs,yuhualingfeng/seajs,PUSEN/seajs,uestcNaldo/seajs,coolyhx/seajs,liupeng110112/seajs,ysxlinux/seajs,evilemon/seajs,LzhElite/seajs,treejames/seajs,MrZhengliang/seajs,kaijiemo/seajs,judastree/seajs,angelLYK/seajs,yuhualingfeng/seajs,13693100472/seajs,PUSEN/seajs,baiduoduo/seajs,miusuncle/seajs,tonny-zhang/seajs,Lyfme/seajs,MrZhengliang/seajs,JeffLi1993/seajs,zaoli/seajs,zwh6611/seajs,yern/seajs,FrankElean/SeaJS,AlvinWei1024/seajs,LzhElite/seajs,yuhualingfeng/seajs,miusuncle/seajs,lianggaolin/seajs,kaijiemo/seajs,uestcNaldo/seajs,evilemon/seajs,tonny-zhang/seajs,mosoft521/seajs,JeffLi1993/seajs,lee-my/seajs,121595113/seajs,hbdrawn/seajs,miusuncle/seajs,lee-my/seajs,angelLYK/seajs,kuier/seajs,zaoli/seajs,coolyhx/seajs
--- +++ @@ -3,11 +3,11 @@ var test = require('../../../test') test.assert(require('./missing/missing').bogus === null, 'return null when module file is 404') - test.assert(require('./nested/b/c/d').foo() === 1, 'nested module identifier is allowed') + test.assert(require('./nested/b/c/d').name === 'd', 'nested module identifier is allowed') test.assert(require('./relative/a').foo == require('./relative/b').foo, 'a and b share foo through a relative require') - var a1 = require('./a.js?v=1.0') - var a2 = require('./a.js?v=2.0') + var a1 = require('./version/a.js?v=1.0') + var a2 = require('./version/a.js?v=2.0') test.assert(a1.name === 'a', a1.name) test.assert(a2.name === 'a', a2.name) test.assert(a1.foo() === 'foo', a1.foo())
03fc387d87c3313e4e4cf027bace3d16598d9ee4
app/scripts/advertise-local-api.js
app/scripts/advertise-local-api.js
// simple script to advertise a MDNS service for local API // TODO(mc, 2017-10-31): remove this file once API can advertise for itself const bonjour = require('bonjour')() console.log('Publishing local MDNS service for API') const service = bonjour.publish({ name: 'ot-local-api', host: 'localhost', port: 31950, // TODO(mc, 2017-10-26): we're relying right now on the fact that resin // advertises an SSH service. Instead, we should be registering an HTTP // service on port 31950 and listening for that instead type: 'ssh' }) service.on('error', (error) => { console.error('Error advertising MDNS service for local API', error) })
// simple script to advertise a MDNS service for local API // TODO(mc, 2017-10-31): remove this file once API can advertise for itself const bonjour = require('bonjour')() console.log('Publishing local MDNS service for API') const service = bonjour.publish({ name: 'opentrons-local-api', host: 'localhost', port: 31950, // TODO(mc, 2017-10-26): we're relying right now on the fact that resin // advertises an SSH service. Instead, we should be registering an HTTP // service on port 31950 and listening for that instead type: 'ssh' }) service.on('error', (error) => { console.error('Error advertising MDNS service for local API', error) })
Fix dev advertise script for mdns name change (b271a68)
Fix dev advertise script for mdns name change (b271a68)
JavaScript
apache-2.0
OpenTrons/opentrons-api,OpenTrons/opentrons-api,Opentrons/labware,OpenTrons/opentrons-api,OpenTrons/opentrons-api,OpenTrons/opentrons_sdk,OpenTrons/opentrons-api
--- +++ @@ -5,7 +5,7 @@ console.log('Publishing local MDNS service for API') const service = bonjour.publish({ - name: 'ot-local-api', + name: 'opentrons-local-api', host: 'localhost', port: 31950, // TODO(mc, 2017-10-26): we're relying right now on the fact that resin
540eedcc66307842341a5fe963b500882e8ecbec
js/components/developer/choose-job-type-screen/jobTypeCard.js
js/components/developer/choose-job-type-screen/jobTypeCard.js
import React, { Component } from 'react'; import { Card } from 'native-base'; import CardImageHeader from '../../common/card-image-header/cardImageHeader'; import SimpleCardBody from '../../common/simple-card-body/simpleCardBody'; export default class JobTypeCard extends Component { static propTypes = { title: React.PropTypes.string.isRequired, cover: React.PropTypes.string.isRequired, icon: React.PropTypes.string.isRequired, subtitle: React.PropTypes.string.isRequired, toNextScreen: React.PropTypes.func.isRequired, }; render() { return ( <Card> <CardImageHeader cover={this.props.cover} icon={this.props.icon} toNextScreen={this.props.toNextScreen} /> <SimpleCardBody title={this.props.title} subtitle={this.props.subtitle} icon="arrow-forward" toNextScreen={this.props.toNextScreen} /> </Card> ); } }
import React, { Component, PropTypes } from 'react'; import { Card } from 'native-base'; import CardImageHeader from '../../common/card-image-header/cardImageHeader'; import SimpleCardBody from '../../common/simple-card-body/simpleCardBody'; import { imageProp } from '../../common/propTypes'; export default class JobTypeCard extends Component { static propTypes = { title: PropTypes.string.isRequired, cover: imageProp.isRequired, icon: imageProp.isRequired, subtitle: PropTypes.string.isRequired, toNextScreen: PropTypes.func.isRequired, }; render() { return ( <Card> <CardImageHeader cover={this.props.cover} icon={this.props.icon} toNextScreen={this.props.toNextScreen} /> <SimpleCardBody title={this.props.title} subtitle={this.props.subtitle} icon="arrow-forward" toNextScreen={this.props.toNextScreen} /> </Card> ); } }
Make JobTypeCard use imageProp from propTypes
Make JobTypeCard use imageProp from propTypes
JavaScript
mit
justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client
--- +++ @@ -1,15 +1,16 @@ -import React, { Component } from 'react'; +import React, { Component, PropTypes } from 'react'; import { Card } from 'native-base'; import CardImageHeader from '../../common/card-image-header/cardImageHeader'; import SimpleCardBody from '../../common/simple-card-body/simpleCardBody'; +import { imageProp } from '../../common/propTypes'; export default class JobTypeCard extends Component { static propTypes = { - title: React.PropTypes.string.isRequired, - cover: React.PropTypes.string.isRequired, - icon: React.PropTypes.string.isRequired, - subtitle: React.PropTypes.string.isRequired, - toNextScreen: React.PropTypes.func.isRequired, + title: PropTypes.string.isRequired, + cover: imageProp.isRequired, + icon: imageProp.isRequired, + subtitle: PropTypes.string.isRequired, + toNextScreen: PropTypes.func.isRequired, }; render() {
0f598fbea8060615a8ff07e1e130cb1c8777a2d1
packages/lingui-cli/src/lingui-add-locale.js
packages/lingui-cli/src/lingui-add-locale.js
const fs = require('fs') const path = require('path') const chalk = require('chalk') const emojify = require('node-emoji').emojify const program = require('commander') const getConfig = require('lingui-conf').default const plurals = require('make-plural') const config = getConfig() program.parse(process.argv) function validateLocales (locales) { const unknown = locales.filter(locale => !(locale in plurals)) if (unknown.length) { console.log(chalk.red(`Unknown locale(s): ${unknown.join(', ')}.`)) process.exit(1) } } function addLocale (locales) { locales.forEach(locale => { const localeDir = path.join(config.localeDir, locale) if (fs.existsSync(localeDir)) { console.log(chalk.yellow(`Locale ${chalk.underline(locale)} already exists.`)) } else { fs.mkdirSync(localeDir) console.log(chalk.green(`Added locale ${chalk.underline(locale)}.`)) } }) } validateLocales(program.args) console.log(emojify(':white_check_mark: Adding locales:')) addLocale(program.args) console.log() console.log(`(use "${chalk.yellow('lingui extract')}" to extract messages)`) console.log(emojify(':sparkles: Done!'))
const fs = require('fs') const path = require('path') const chalk = require('chalk') const emojify = require('node-emoji').emojify const program = require('commander') const getConfig = require('lingui-conf').default const plurals = require('make-plural') const config = getConfig() program.parse(process.argv) function validateLocales (locales) { const unknown = locales.filter(locale => !(locale in plurals)) if (unknown.length) { console.log(chalk.red(`Unknown locale(s): ${unknown.join(', ')}.`)) process.exit(1) } } function addLocale (locales) { if (fs.existsSync(config.localeDir)) { fs.mkdirSync(config.localeDir) } locales.forEach(locale => { const localeDir = path.join(config.localeDir, locale) if (fs.existsSync(localeDir)) { console.log(chalk.yellow(`Locale ${chalk.underline(locale)} already exists.`)) } else { fs.mkdirSync(localeDir) console.log(chalk.green(`Added locale ${chalk.underline(locale)}.`)) } }) } validateLocales(program.args) console.log(emojify(':white_check_mark: Adding locales:')) addLocale(program.args) console.log() console.log(`(use "${chalk.yellow('lingui extract')}" to extract messages)`) console.log(emojify(':sparkles: Done!'))
Create locale dir if doesn\' exist
fix: Create locale dir if doesn\' exist
JavaScript
mit
lingui/js-lingui,lingui/js-lingui
--- +++ @@ -19,6 +19,10 @@ } function addLocale (locales) { + if (fs.existsSync(config.localeDir)) { + fs.mkdirSync(config.localeDir) + } + locales.forEach(locale => { const localeDir = path.join(config.localeDir, locale)
103ae46c7fb9251fccfca39e0ae345e9c1fce9f6
client/views/lotto/lotto_add.js
client/views/lotto/lotto_add.js
Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { this.find('input[name=date]').valueAsDate = new Date(); }; Template.lottoAdd.helpers({ errorMessage: function(field) { return Session.get('lottoAddErrors')[field]; }, errorClass: function (field) { return !!Session.get('lottoAddErrors')[field] ? 'has-error' : ''; } }); Template.lottoAdd.events({ 'submit form': function(e) { e.preventDefault(); var lotto = { date: moment(e.target.date.value).toDate() }; if (!lotto.date) { var errors = {}; errors.date = "Please select a date"; return Session.set('lottoAddErrors', errors); } Meteor.call('lottoInsert', lotto, function(error, result) { if(error) { return throwError(error.reason); } if(result.lottoExists) { throwError('Lotto for this date already exists'); } Router.go('lottoPage', {_id: result._id}); }); } });
Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { this.find('#date').valueAsDate = moment().day(5).toDate(); }; Template.lottoAdd.helpers({ errorMessage: function(field) { return Session.get('lottoAddErrors')[field]; }, errorClass: function (field) { return !!Session.get('lottoAddErrors')[field] ? 'has-error' : ''; } }); Template.lottoAdd.events({ 'submit form': function(e) { e.preventDefault(); var lotto = { date: moment(e.target.date.value).toDate() }; if (!lotto.date) { var errors = {}; errors.date = "Please select a date"; return Session.set('lottoAddErrors', errors); } Meteor.call('lottoInsert', lotto, function(error, result) { if(error) { return throwError(error.reason); } if(result.lottoExists) { throwError('Lotto for this date already exists'); } Router.go('lottoPage', {_id: result._id}); }); } });
Set the date on the input box for new lotto to the next Saturday
Set the date on the input box for new lotto to the next Saturday
JavaScript
mit
jujaga/ice-lotto-meteor,charlieman/ice-lotto-meteor,charlieman/ice-lotto-meteor,jujaga/ice-lotto-meteor
--- +++ @@ -2,7 +2,7 @@ Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { - this.find('input[name=date]').valueAsDate = new Date(); + this.find('#date').valueAsDate = moment().day(5).toDate(); }; Template.lottoAdd.helpers({
b467204d7433eeb982de659a5222b93f9115e964
pyfarm/master/static/js/bootstrap-tree.js
pyfarm/master/static/js/bootstrap-tree.js
$(function () { $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch'); $('.tree li.parent_li > span').on('click', function (e) { var children = $(this).parent('li.parent_li').find(' > ul > li'); if (children.is(":visible")) { children.hide('fast'); $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign'); } else { children.show('fast'); $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign'); } e.stopPropagation(); }); });
$(function () { $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch'); $('.tree li.parent_li > span').on('click', function (e) { var children = $(this).parent('li.parent_li').find(' > ul > li'); if (children.is(":visible")) { children.hide('fast'); $(this).attr('title', 'Expand this branch').find(' > i').addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign'); } else { children.show('fast'); $(this).attr('title', 'Collapse this branch').find(' > i').addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign'); } e.stopPropagation(); }); });
Fix class names for icons in trees for Bootstrap 3
Fix class names for icons in trees for Bootstrap 3
JavaScript
apache-2.0
pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master
--- +++ @@ -4,10 +4,10 @@ var children = $(this).parent('li.parent_li').find(' > ul > li'); if (children.is(":visible")) { children.hide('fast'); - $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign'); + $(this).attr('title', 'Expand this branch').find(' > i').addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign'); } else { children.show('fast'); - $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign'); + $(this).attr('title', 'Collapse this branch').find(' > i').addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign'); } e.stopPropagation(); });
6a5207d0c5765a1d958e93db79545b494a142729
tests/helpers/test-module-dependencies.js
tests/helpers/test-module-dependencies.js
/* jshint es3: false, esnext: true */ /* global jasmine, beforeEach, describe, it, expect, module, inject */ (function () { var helpers = window._helpers = window._helpers || {}; helpers.testModuleDependencies = function (moduleName) { 'use strict'; describe(moduleName + ' dependencies', function () { beforeEach(function () { module('user_management.' + moduleName); this.runModule = function () { inject(function ($rootScope, $route) { this.$rootScope = $rootScope; this.$route = $route; }); }; }); it('should load the module without error', function () { expect(function () { this.runModule(); }.bind(this)).not.toThrow(); }); it('should have routes', function () { this.runModule(); expect(Object.keys(this.$route.routes)).not.toEqual([]); }); }); }; }());
/* jshint es3: false, esnext: true */ /* global jasmine, beforeEach, describe, it, expect, module, inject */ (function () { var helpers = window._helpers = window._helpers || {}; helpers.testModuleDependencies = function (moduleName) { 'use strict'; describe(moduleName + ' dependencies', function () { beforeEach(function () { module('user_management.' + moduleName); this.runModule = function () { inject(function ($rootScope, $route) { this.$rootScope = $rootScope; this.$route = $route; }); }; }); it('should load the module without error', function () { expect(function () { this.runModule(); }.bind(this)).not.toThrow(); }); }); }; }());
Remove "should have routes" common spec
Remove "should have routes" common spec Each module should test its own routes, not just if they have some.
JavaScript
mit
incuna/angular-user-management,incuna/angular-user-management
--- +++ @@ -30,11 +30,6 @@ }.bind(this)).not.toThrow(); }); - it('should have routes', function () { - this.runModule(); - expect(Object.keys(this.$route.routes)).not.toEqual([]); - }); - }); };
2fa8ee8bbc29caf13e454868a620f2c2dc35f0f6
src/modules/client/client.native.js
src/modules/client/client.native.js
/* @flow */ /* eslint-disable import/no-commonjs */ import 'core-js/es6/symbol'; import 'core-js/es6/array'; global.navigator.userAgent = 'react-native'; require('./client-base');
/* @flow */ /* eslint-disable import/no-commonjs */ import 'core-js/es6/symbol'; import 'core-js/es6/object'; import 'core-js/es6/array'; import 'core-js/es6/function'; global.navigator.userAgent = 'react-native'; require('./client-base');
Add more polyfills from core-js
Add more polyfills from core-js
JavaScript
agpl-3.0
scrollback/pure,scrollback/pure,belng/pure,scrollback/pure,Anup-Allamsetty/pure,belng/pure,Anup-Allamsetty/pure,scrollback/pure,Anup-Allamsetty/pure,Anup-Allamsetty/pure,belng/pure,belng/pure
--- +++ @@ -2,7 +2,9 @@ /* eslint-disable import/no-commonjs */ import 'core-js/es6/symbol'; +import 'core-js/es6/object'; import 'core-js/es6/array'; +import 'core-js/es6/function'; global.navigator.userAgent = 'react-native';
058de9719a38b6392952aadb13272c4efd54293b
server/controllers/cityinfo.js
server/controllers/cityinfo.js
'use strict'; const express = require('express'); const router = express.Router(); const bodyParser = require('body-parser'); const request = require('request'); const models = require('../../db/models'); module.exports.getAll = (req, res) => { models.User.where({ email: req.user.email}).fetch() .then((result) => { models.Stats.where({city: result.attributes.destination}).fetchAll() .then(data => { if (data.length === 0) { request .get(`https://api.teleport.org/api/urban_areas/slug:${result.attributes.destination}/scores/`, (error, response, stats) => { if (error) { console.error(err); } models.Stats.forge({ city: result.attributes.destination, city_stats: stats }) .save() .then(data => { res.status(201).send(data.attributes.city_stats); }) .catch(err => { res.status(500).send(err); }); }) .on('error', (err) => { console.log(err); res.status(500).send(err); }); } else { res.status(200).send(data.models[0].attributes.city_stats); } }) .catch(err => { res.status(503).send(err); }); }) .catch(err => { res.status(503).send(err); }); };
'use strict'; const express = require('express'); const router = express.Router(); const bodyParser = require('body-parser'); const request = require('request'); const models = require('../../db/models'); module.exports.getAll = (req, res) => { models.User.where({ email: req.user.email}).fetch() .then((result) => { models.Stats.where({city: result.attributes.destination}).fetchAll() .then(data => { if (data.length === 0) { request .get(`https://api.teleport.org/api/urban_areas/slug:${result.attributes.destination}/scores/`, (error, response, stats) => { if (error) { console.error(err); } models.Stats.forge({ city: result.attributes.destination, city_stats: stats }) .save() .then(data => { res.status(201).send(data.attributes.city_stats); }) .catch(err => { res.status(500).send(err); }); }) .on('error', (err) => { console.log(err); res.status(500).send(err); }); } else { res.status(200).send(data.attributes.city_stats); } }) .catch(err => { res.status(503).send(err); }); }) .catch(err => { res.status(503).send(err); }); };
Fix cityInfo tab not loading data after user completes form
Fix cityInfo tab not loading data after user completes form
JavaScript
mit
FuriousFridges/FuriousFridges,FuriousFridges/FuriousFridges
--- +++ @@ -32,7 +32,7 @@ res.status(500).send(err); }); } else { - res.status(200).send(data.models[0].attributes.city_stats); + res.status(200).send(data.attributes.city_stats); } })
486b3f995e3ca9b8583809d86eec919a12bcbd13
src/client/products/product-tile.react.js
src/client/products/product-tile.react.js
import React from 'react'; import PureComponent from '../components/purecomponent.react'; import ProductImage from './product-image.react'; export default class ProductTile extends PureComponent { render() { const title = this.props.product.get('title'); const productNumber = this.props.product.get('productNumber'); const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> <div>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> ); } } ProductTile.propTypes = { product: React.PropTypes.shape({get: React.PropTypes.func.isRequired}).isRequired };
import React from 'react'; import PureComponent from '../components/purecomponent.react'; import ProductImage from './product-image.react'; export default class ProductTile extends PureComponent { render() { const title = this.props.product.get('title'); const productNumber = this.props.product.get('productNumber'); const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> <div style={{height: '60px'}}>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> ); } } ProductTile.propTypes = { product: React.PropTypes.shape({get: React.PropTypes.func.isRequired}).isRequired };
Fix height of product title to avoid weird tile positioning
Fix height of product title to avoid weird tile positioning
JavaScript
mit
lassecapel/este-isomorphic-app
--- +++ @@ -10,7 +10,7 @@ const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> - <div>{title}</div> + <div style={{height: '60px'}}>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> );
9dcda4391d5be5d6a4a4b81373ec257c3944f456
src/foam/u2/view/StrategizerChoiceView.js
src/foam/u2/view/StrategizerChoiceView.js
/** * @license * Copyright 2019 The FOAM Authors. All Rights Reserved. * http://www.apache.org/licenses/LICENSE-2.0 */ foam.CLASS({ package: 'foam.u2.view', name: 'StrategizerChoiceView', extends: 'foam.u2.view.ChoiceView', documentation: 'A choice view that gets its choices array from Strategizer.', imports: [ 'strategizer' ], properties: [ { class: 'String', name: 'desiredModelId', required: true }, { class: 'String', name: 'target' } ], methods: [ function init() { this.onDetach(this.desiredModelId$.sub(this.updateChoices)); this.onDetach(this.target$.sub(this.updateChoices)); this.updateChoices(); } ], listeners: [ { name: 'updateChoices', code: function() { var self = this; self.strategizer.query(null, self.desiredModelId, self.target).then((strategyReferences) => { self.choices = strategyReferences .reduce((arr, sr) => { if ( ! sr.strategy ) { console.warn('Invalid strategy reference: ' + sr.id); return arr; } return arr.concat([[sr.strategy.id, sr.strategy.name]]); }, [[null, 'Select...']]) .filter(x => x); }); } } ] });
/** * @license * Copyright 2019 The FOAM Authors. All Rights Reserved. * http://www.apache.org/licenses/LICENSE-2.0 */ foam.CLASS({ package: 'foam.u2.view', name: 'StrategizerChoiceView', extends: 'foam.u2.view.ChoiceView', documentation: 'A choice view that gets its choices array from Strategizer.', imports: [ 'strategizer' ], properties: [ { class: 'String', name: 'desiredModelId', required: true }, { class: 'String', name: 'target' } ], methods: [ function init() { this.SUPER(); this.onDetach(this.desiredModelId$.sub(this.updateChoices)); this.onDetach(this.target$.sub(this.updateChoices)); this.updateChoices(); } ], listeners: [ { name: 'updateChoices', code: function() { var self = this; self.strategizer.query(null, self.desiredModelId, self.target).then((strategyReferences) => { self.choices = strategyReferences .reduce((arr, sr) => { if ( ! sr.strategy ) { console.warn('Invalid strategy reference: ' + sr.id); return arr; } return arr.concat([[sr.strategy, sr.strategy.name]]); }, [[null, 'Select...']]) .filter(x => x); }); } } ] });
Fix strategizer choice view choice selection in update view
Fix strategizer choice view choice selection in update view
JavaScript
apache-2.0
foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm
--- +++ @@ -29,6 +29,7 @@ methods: [ function init() { + this.SUPER(); this.onDetach(this.desiredModelId$.sub(this.updateChoices)); this.onDetach(this.target$.sub(this.updateChoices)); this.updateChoices(); @@ -48,7 +49,7 @@ return arr; } - return arr.concat([[sr.strategy.id, sr.strategy.name]]); + return arr.concat([[sr.strategy, sr.strategy.name]]); }, [[null, 'Select...']]) .filter(x => x); });
9811554e696601d38943f01bd0cf681ba3bfedc1
src/components/dialog/dialog.stories.spec.js
src/components/dialog/dialog.stories.spec.js
import React from 'react'; import { IconWarningBadgedMediumOutline } from '@teamleader/ui-icons'; import { Dialog, Box, TextBody } from '../..'; export default { component: Dialog, title: 'Dialog', }; export const Main = () => ( <Dialog headerIcon={<IconWarningBadgedMediumOutline />} active onCloseClick={() => {}} onEscKeyDown={() => {}} onOverlayClick={() => {}} primaryAction={{ label: 'Confirm', }} secondaryAction={{ label: 'Cancel', }} tertiaryAction={{ children: 'Read more', }} title="Dialog title" > <Box padding={4}> <TextBody>Here you can add arbitrary content.</TextBody> </Box> </Dialog> );
import React from 'react'; import { IconWarningBadgedMediumOutline } from '@teamleader/ui-icons'; import { Dialog, Box, TextBody } from '../..'; export default { component: Dialog, title: 'Dialog', }; export const Main = () => ( <Dialog headerIcon={<IconWarningBadgedMediumOutline />} active onCloseClick={() => {}} onEscKeyDown={() => {}} onOverlayClick={() => {}} primaryAction={{ label: 'Confirm', }} secondaryAction={{ label: 'Cancel', }} tertiaryAction={{ children: 'Read more', }} title="Dialog title" > <Box padding={4}> <TextBody>Here you can add arbitrary content.</TextBody> </Box> </Dialog> ); Main.parameters = { // add a delay to make sure the dialog animation is finished chromatic: { delay: 300 }, };
Add delay to the dialog story to make sure the open animation has finished
Add delay to the dialog story to make sure the open animation has finished
JavaScript
mit
teamleadercrm/teamleader-ui
--- +++ @@ -31,3 +31,8 @@ </Box> </Dialog> ); + +Main.parameters = { + // add a delay to make sure the dialog animation is finished + chromatic: { delay: 300 }, +};
c00042ddf46c4c2ef2b24bc28861445961c3be98
src/locale/en-AU/_lib/formatLong/index.js
src/locale/en-AU/_lib/formatLong/index.js
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js' var dateFormats = { full: 'EEEE, d MMMM yyyy', long: 'd MMMM yyyy', medium: 'd MMM yyyy', short: 'dd/MM/yyyy' } var timeFormats = { full: 'HH:mm:ss zzzz', long: 'HH:mm:ss z', medium: 'HH:mm:ss', short: 'HH:mm' } var dateTimeFormats = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: '{{date}}, {{time}}', short: '{{date}}, {{time}}' } var formatLong = { date: buildFormatLongFn({ formats: dateFormats, defaultWidth: 'full' }), time: buildFormatLongFn({ formats: timeFormats, defaultWidth: 'full' }), dateTime: buildFormatLongFn({ formats: dateTimeFormats, defaultWidth: 'full' }) } export default formatLong
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js' var dateFormats = { full: 'EEEE, d MMMM yyyy', long: 'd MMMM yyyy', medium: 'd MMM yyyy', short: 'dd/MM/yyyy' } var timeFormats = { full: 'h:mm:ss a zzzz', long: 'h:mm:ss a z', medium: 'h:mm:ss a', short: 'h:mm a' } var dateTimeFormats = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: '{{date}}, {{time}}', short: '{{date}}, {{time}}' } var formatLong = { date: buildFormatLongFn({ formats: dateFormats, defaultWidth: 'full' }), time: buildFormatLongFn({ formats: timeFormats, defaultWidth: 'full' }), dateTime: buildFormatLongFn({ formats: dateTimeFormats, defaultWidth: 'full' }) } export default formatLong
Set 12-hour-clock format in the en-AU locale
Set 12-hour-clock format in the en-AU locale
JavaScript
mit
date-fns/date-fns,date-fns/date-fns,date-fns/date-fns
--- +++ @@ -8,10 +8,10 @@ } var timeFormats = { - full: 'HH:mm:ss zzzz', - long: 'HH:mm:ss z', - medium: 'HH:mm:ss', - short: 'HH:mm' + full: 'h:mm:ss a zzzz', + long: 'h:mm:ss a z', + medium: 'h:mm:ss a', + short: 'h:mm a' } var dateTimeFormats = {
3369358f466ba1edcf270c7c9808c73c660e7445
src/modules/user/services/presence-svc.js
src/modules/user/services/presence-svc.js
(function (angular) { 'use strict'; angular.module('birdyard.users') .factory('presenceService', ['$q', 'firebaseService', function ($q, firebaseService) { // Private var $userCountRef = firebaseService.getRef('presence/count'); function init() { var $ref = firebaseService.getRef('.info/connected'); $ref.on("value", function(snap) { if (snap.val() === true) { $userCountRef.push(true); } }); $userCountRef.onDisconnect().remove(); } init(); // Public var _presenceService = {}; function _getUserCount () { return $q(function (resolve, reject) { $userCountRef.on('value', function ($snap) { var foo = $snap.numChildren(); resolve(foo); }, reject); }); } _presenceService.getUserCount = _getUserCount; return _presenceService; }]); })(angular);
(function (angular) { 'use strict'; angular.module('birdyard.users') .factory('presenceService', ['$q', 'firebaseService', function ($q, firebaseService) { // Private var $userCountRef = firebaseService.getRef('presence/count'); function init() { var $ref = firebaseService.getRef('.info/connected'); $ref.on("value", function(snap) { if (snap.val() === true) { $userCountRef.push(true); } }); $userCountRef.on('value', function () { $userCountRef.onDisconnect().remove(); }); } init(); // Public var _presenceService = {}; function _getUserCount () { return $q(function (resolve, reject) { $userCountRef.on('value', function ($snap) { var foo = $snap.numChildren(); resolve(foo); }, reject); }); } _presenceService.getUserCount = _getUserCount; return _presenceService; }]); })(angular);
Fix broken unit test caused by presence service .onDisconnect() bug
Fix broken unit test caused by presence service .onDisconnect() bug
JavaScript
mit
birdyard/birdyard,bebopchat/bebop,robotnoises/bebop,bebopchat/bebop,birdyard/birdyard,robotnoises/bebop
--- +++ @@ -22,7 +22,9 @@ } }); - $userCountRef.onDisconnect().remove(); + $userCountRef.on('value', function () { + $userCountRef.onDisconnect().remove(); + }); } init();
5555b40cb3979223489376e01b742aeb36685244
tests/helpers/resolver.js
tests/helpers/resolver.js
import Resolver from 'ember/resolver'; import config from '../../config/environment'; const resolver = Resolver.create(); resolver.namespace = { modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix }; export default resolver;
import Resolver from 'ember/resolver'; import config from '../../config/environment'; const resolver = Resolver.create(); resolver.namespace = { modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix }; export default resolver;
Adjust indentation spacing to pass linting
Adjust indentation spacing to pass linting
JavaScript
mit
softlayer/sl-ember-behavior,softlayer/sl-ember-behavior,SpikedKira/sl-ember-behavior,SpikedKira/sl-ember-behavior,notmessenger/sl-ember-behavior,notmessenger/sl-ember-behavior
--- +++ @@ -4,8 +4,8 @@ const resolver = Resolver.create(); resolver.namespace = { - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix }; export default resolver;
ff6a1d88d17e1db4754ab4c4c5f0ba13f89fffd8
lib/control/v1/kms.js
lib/control/v1/kms.js
'use strict'; const KMSProvider = require('../../providers/kms'); /** * AWS-SDK gives out weirdly formatted keys, so make them * consistent with formatting across the rest of Tokend * * @param {Object} obj * @returns {Object} */ const normalizeKeys = (obj) => Object.keys(obj).reduce((acc, key) => { acc[key.toLowerCase()] = obj[key]; return acc; }, {}); /** * Route handler for KMS secrets * @returns {function} */ function KMS() { return (req, res, next) => { (new KMSProvider(req.body)).initialize().then((result) => { // I don't know how we'd get a falsy `result` but we need a method for handling it if (!result) { return; } let data = {}; // Handle a case where there's no if (result.hasOwnProperty('data')) { data = normalizeKeys(result.data); } // Check for both undefined and null. `!= null` handles both cases. if (data.hasOwnProperty('plaintext')) { // eslint-disable-line eqeqeq data.plaintext = Buffer.from(data.plaintext, 'base64').toString(); } res.json(data); }).catch(next); }; } module.exports = KMS;
'use strict'; const KMSProvider = require('../../providers/kms'); /** * AWS-SDK gives out weirdly formatted keys, so make them * consistent with formatting across the rest of Tokend * * @param {Object} obj * @returns {Object} */ const normalizeKeys = (obj) => Object.keys(obj).reduce((acc, key) => { acc[key.toLowerCase()] = obj[key]; return acc; }, {}); /** * Route handler for KMS secrets * @returns {function} */ function KMS() { return (req, res, next) => { (new KMSProvider(req.body)).initialize().then((result) => { // I don't know how we'd get a falsy `result` but we need a method for handling it if (!result) { return res.json(result); } let data = {}; // Handle a case where there's no if (result.hasOwnProperty('data')) { data = normalizeKeys(result.data); } // Check for both undefined and null. `!= null` handles both cases. if (data.hasOwnProperty('plaintext')) { // eslint-disable-line eqeqeq data.plaintext = Buffer.from(data.plaintext, 'base64').toString(); } res.json(data); }).catch(next); }; } module.exports = KMS;
Maintain the previous behavior where if there was no result set we'd attempt to pass it to res.json and have express handle the exception and bubble it up.
Maintain the previous behavior where if there was no result set we'd attempt to pass it to res.json and have express handle the exception and bubble it up.
JavaScript
mit
rapid7/tokend,rapid7/tokend,rapid7/tokend
--- +++ @@ -24,7 +24,7 @@ (new KMSProvider(req.body)).initialize().then((result) => { // I don't know how we'd get a falsy `result` but we need a method for handling it if (!result) { - return; + return res.json(result); } let data = {};
ea8286318fa319bb6b5b4f01a9b134e5ad22bd2c
app/scripts/services/invoices-service.js
app/scripts/services/invoices-service.js
'use strict'; (function() { angular.module('ncsaas') .service('invoicesService', ['baseServiceClass', '$http', 'ENV', '$state', invoicesService]); function invoicesService(baseServiceClass, $http, ENV, $state) { /*jshint validthis: true */ var ServiceClass = baseServiceClass.extend({ init:function() { this._super(); this.endpoint = '/invoices/'; }, sendNotification: function(invoice_uuid) { var url = ENV.apiEndpoint + 'api' + this.endpoint + invoice_uuid + '/send_notification/'; return $http.post(url, {link_template: this.getTemplateUrl()}); }, getTemplateUrl: function() { var path = $state.href('organization.invoiceDetails', {uuid: 'TEMPLATE'}); return location.origin + path.replace('TEMPLATE', '{uuid}'); } }); return new ServiceClass(); } })();
'use strict'; (function() { angular.module('ncsaas') .service('invoicesService', ['baseServiceClass', '$http', 'ENV', '$state', invoicesService]); function invoicesService(baseServiceClass, $http, ENV, $state) { /*jshint validthis: true */ var ServiceClass = baseServiceClass.extend({ init:function() { this._super(); this.endpoint = '/invoices/'; }, sendNotification: function(invoice_uuid) { var url = ENV.apiEndpoint + 'api' + this.endpoint + invoice_uuid + '/send_notification/'; return $http.post(url, {link_template: this.getTemplateUrl()}); }, getTemplateUrl: function() { var path = $state.href('organization.invoiceDetails', {invoiceUUID: 'TEMPLATE'}); return location.origin + path.replace('TEMPLATE', '{uuid}'); } }); return new ServiceClass(); } })();
Fix template URL generation (WAL-141)
Fix template URL generation (WAL-141)
JavaScript
mit
opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport
--- +++ @@ -16,7 +16,7 @@ return $http.post(url, {link_template: this.getTemplateUrl()}); }, getTemplateUrl: function() { - var path = $state.href('organization.invoiceDetails', {uuid: 'TEMPLATE'}); + var path = $state.href('organization.invoiceDetails', {invoiceUUID: 'TEMPLATE'}); return location.origin + path.replace('TEMPLATE', '{uuid}'); } });
d9414d4f976e54e4385860430d2205576684cbb2
app/scripts/services/payments-service.js
app/scripts/services/payments-service.js
'use strict'; (function() { angular.module('ncsaas') .service('paymentsService', ['baseServiceClass', paymentsService]); function paymentsService(baseServiceClass) { /*jshint validthis: true */ var ServiceClass = baseServiceClass.extend({ init:function() { this._super(); this.endpoint = '/payments/'; this.filterByCustomer = false; } }); return new ServiceClass(); } })();
'use strict'; (function() { angular.module('ncsaas') .service('paymentsService', ['baseServiceClass', paymentsService]); function paymentsService(baseServiceClass) { /*jshint validthis: true */ var ServiceClass = baseServiceClass.extend({ init:function() { this._super(); this.endpoint = '/paypal-payments/'; this.filterByCustomer = false; } }); return new ServiceClass(); } })();
Fix PayPal payments API path (SAAS-1070)
Fix PayPal payments API path (SAAS-1070)
JavaScript
mit
opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport
--- +++ @@ -9,7 +9,7 @@ var ServiceClass = baseServiceClass.extend({ init:function() { this._super(); - this.endpoint = '/payments/'; + this.endpoint = '/paypal-payments/'; this.filterByCustomer = false; } });
8f6b5b8247af23fc3190e0a71d5507ceeac7fe4a
models/visit-model.js
models/visit-model.js
'use strict'; var mongoose = require('mongoose'); /** * Define a visit model: * - */ var VisitSchema = mongoose.Schema({ visitor_id: String, session_id: String, domain_id: String, host: String, referer: String, ip_address: String, user_agent: String, events: [ { timestamp: Date, event_type: String, attributes: [{name: String}], inner_html: String, classes: [{name:String}] } ] }); module.exports = mongoose.model('Visit', VisitSchema);
'use strict'; var mongoose = require('mongoose'); /** * Define a visit model: * - */ var VisitSchema = mongoose.Schema({ visitor_id: String, session_id: String, domain_id: String, host: String, referer: String, ip_address: String, user_agent: String, events: [ { nodeName: String, page: String, timeStamp: Date, type: String, innerHTML: String, classes: [{name:String}] } ] }); module.exports = mongoose.model('Visit', VisitSchema);
Update the schema to match what we're passing in from the DOM
Update the schema to match what we're passing in from the DOM
JavaScript
mit
Sextant-WDB/sextant-ng
--- +++ @@ -17,10 +17,11 @@ user_agent: String, events: [ { - timestamp: Date, - event_type: String, - attributes: [{name: String}], - inner_html: String, + nodeName: String, + page: String, + timeStamp: Date, + type: String, + innerHTML: String, classes: [{name:String}] } ]
770878186419573c2287d957a1fa8510cdf1fe92
blueprints/ember-datetimepicker/index.js
blueprints/ember-datetimepicker/index.js
/* eslint-env node */ 'use strict'; module.exports = { normalizeEntityName() {}, afterInstall() { let pkg = require('../../package.json'); return this.addPackageToProject('jquery-datetimepicker', pkg.devDependencies['jquery-datetimepicker']).then(() => { return this.addAddonToProject({ name: 'ember-cli-moment-shim', target: pkg.devDependencies['ember-cli-moment-shim'] }); }); } };
/* eslint-env node */ 'use strict'; const fs = require('fs'); const path = require('path'); module.exports = { normalizeEntityName() {}, afterInstall() { let pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8')); return this.addPackageToProject('jquery-datetimepicker', pkg.devDependencies['jquery-datetimepicker']).then(() => { return this.addAddonToProject({ name: 'ember-cli-moment-shim', target: pkg.devDependencies['ember-cli-moment-shim'] }); }); } };
Revert "use require to read package.json"
Revert "use require to read package.json" This reverts commit 284623a4f42e6a23ee96a7505951191f80545d7d.
JavaScript
mit
kellyselden/ember-datetimepicker,kellyselden/ember-datetimepicker
--- +++ @@ -1,11 +1,14 @@ /* eslint-env node */ 'use strict'; + +const fs = require('fs'); +const path = require('path'); module.exports = { normalizeEntityName() {}, afterInstall() { - let pkg = require('../../package.json'); + let pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8')); return this.addPackageToProject('jquery-datetimepicker', pkg.devDependencies['jquery-datetimepicker']).then(() => { return this.addAddonToProject({ name: 'ember-cli-moment-shim', target: pkg.devDependencies['ember-cli-moment-shim'] });
66b978b2ea8476aebec071ee9c2c56465a86bf8d
imports/startup/client/index.js
imports/startup/client/index.js
import { Meteor } from 'meteor/meteor' import { render } from 'react-dom' import { createStore } from 'redux' import { renderRoutes } from './routes.jsx' import withProvider from '../both/withProvider' import mainReducer from '../../api/redux/reducers' Meteor.startup(() => { const store = createStore(mainReducer, window.__PRELOADED_STATE__) delete window.window.__PRELOADED_STATE__ render(withProvider(store, renderRoutes()), document.getElementById('app')) })
import { Meteor } from 'meteor/meteor' import { render } from 'react-dom' import { createStore } from 'redux' import { renderRoutes } from './routes.jsx' import withProvider from '../both/withProvider' import mainReducer from '../../api/redux/reducers' Meteor.startup(() => { const store = createStore(mainReducer, window.__PRELOADED_STATE__) delete window.__PRELOADED_STATE__ render(withProvider(store, renderRoutes()), document.getElementById('app')) })
Fix delete statement: remove duplicated word.
Fix delete statement: remove duplicated word.
JavaScript
mit
LuisLoureiro/placard-wrapper
--- +++ @@ -9,7 +9,7 @@ Meteor.startup(() => { const store = createStore(mainReducer, window.__PRELOADED_STATE__) - delete window.window.__PRELOADED_STATE__ + delete window.__PRELOADED_STATE__ render(withProvider(store, renderRoutes()), document.getElementById('app')) })
3cee68679bb3fa8aa31e452aad766ac3e7c89967
src/mw-form/directives/validators/mw_custom_error_validator.js
src/mw-form/directives/validators/mw_custom_error_validator.js
angular.module('mwUI.Form') .config(function(mwValidationMessagesProvider){ mwValidationMessagesProvider.registerValidator( 'customValidation', 'mwErrorMessages.invalidInput' ); }) .directive('mwCustomErrorValidator', function (mwValidationMessages, i18n) { return { require: 'ngModel', scope: { isValid: '=mwIsValid', errorMsg: '@mwCustomErrorValidator' }, link: function (scope, elm, attr, ngModel) { ngModel.$validators.customValidation = function () { var isValid = false; if(_.isUndefined(scope.isValid)){ isValid = true; } else { isValid = scope.isValid; } return isValid; }; scope.$watch('isValid', function(){ mwValidationMessages.updateMessage( 'customValidation', function(){ if(scope.errorMsg && angular.isString(scope.errorMsg)){ return scope.errorMsg; } else { return i18n.get('mwErrorMessages.invalidInput'); } } ); ngModel.$validate(); }); } }; });
angular.module('mwUI.Form') .config(function (mwValidationMessagesProvider) { mwValidationMessagesProvider.registerValidator( 'customValidation', 'mwErrorMessages.invalidInput' ); }) .directive('mwCustomErrorValidator', function (mwValidationMessages, i18n) { return { require: 'ngModel', scope: { isValid: '=mwIsValid', errorMsg: '@mwCustomErrorValidator' }, link: function (scope, elm, attr, ngModel) { ngModel.$validators.customValidation = function () { var isValid = false; if (_.isUndefined(scope.isValid)) { isValid = true; } else { isValid = scope.isValid; } return isValid; }; scope.$watch('isValid', function () { mwValidationMessages.updateMessage( 'customValidation', function () { if (scope.errorMsg && angular.isString(scope.errorMsg) && scope.errorMsg !== 'false') { return scope.errorMsg; } else if (angular.isUndefined(scope.errorMsg)) { return i18n.get('mwErrorMessages.invalidInput'); } else { return ''; } } ); ngModel.$validate(); }); } }; });
Make it possible to display no error message by setting attr errorMsg to false
Make it possible to display no error message by setting attr errorMsg to false
JavaScript
apache-2.0
mwaylabs/uikit,mwaylabs/uikit,mwaylabs/uikit
--- +++ @@ -1,5 +1,5 @@ angular.module('mwUI.Form') - .config(function(mwValidationMessagesProvider){ + .config(function (mwValidationMessagesProvider) { mwValidationMessagesProvider.registerValidator( 'customValidation', 'mwErrorMessages.invalidInput' @@ -16,7 +16,7 @@ link: function (scope, elm, attr, ngModel) { ngModel.$validators.customValidation = function () { var isValid = false; - if(_.isUndefined(scope.isValid)){ + if (_.isUndefined(scope.isValid)) { isValid = true; } else { isValid = scope.isValid; @@ -24,14 +24,16 @@ return isValid; }; - scope.$watch('isValid', function(){ + scope.$watch('isValid', function () { mwValidationMessages.updateMessage( 'customValidation', - function(){ - if(scope.errorMsg && angular.isString(scope.errorMsg)){ + function () { + if (scope.errorMsg && angular.isString(scope.errorMsg) && scope.errorMsg !== 'false') { return scope.errorMsg; + } else if (angular.isUndefined(scope.errorMsg)) { + return i18n.get('mwErrorMessages.invalidInput'); } else { - return i18n.get('mwErrorMessages.invalidInput'); + return ''; } } );
21bc56622f1d9eb7845592defe9777e6ae7d6ffa
discord-client/src/channelProcessor.js
discord-client/src/channelProcessor.js
const { isHaiku } = require('./validateHaiku'); class ChannelProcessor { constructor(channelID) { this.channelID = channelID; this.messages = []; this.onHaiku = () => {}; } processMessage(newMessage) { this.messages.push(newMessage); while (this.messages.length > 3) { // remove old messages this.messages.shift(); } if (this.messages.length === 3) { const lines = this.messages.map(message => message.content); if (isHaiku(lines)) { this.onHaiku(this.messages); } } } } exports.ChannelProcessor = ChannelProcessor;
const { isHaiku } = require('./validateHaiku'); class ChannelProcessor { constructor(channelID) { this.channelID = channelID; this.messages = []; this.onHaiku = () => {}; } processMessage(newMessage) { this.messages.push(newMessage); while (this.messages.length > 3) { // remove old messages this.messages.shift(); } if (this.messages.length === 3) { const lines = this.messages.map(message => message.content); if (isHaiku(lines)) { this.onHaiku(this.messages); } } } setOnHaikuFunction(func) { this.onHaiku = func; } } exports.ChannelProcessor = ChannelProcessor;
Add explicit function for changing in haiku functionality
Add explicit function for changing in haiku functionality
JavaScript
mit
bumblepie/haikubot
--- +++ @@ -21,6 +21,10 @@ } } } + + setOnHaikuFunction(func) { + this.onHaiku = func; + } } exports.ChannelProcessor = ChannelProcessor;
28cd2e42ed7461c4713148b4f32b96f62d31abab
addon/utils/shadow/types/svg-attribute-map.js
addon/utils/shadow/types/svg-attribute-map.js
export default { 'circle': { 'radius': 'r', 'x': 'cx', 'y': 'cy' } };
/* This acts as both a way to normalize attribute names, but also acts as a white list for the supported properties. */ export default { 'circle': { 'radius': 'r', 'x': 'cx', 'y': 'cy' }, 'group': { 'transform': 'transform' }, 'rect': { 'x': 'x', 'y': 'y', 'height': 'height', 'width': 'width', 'fill': 'fill', 'stroke': 'stroke', 'stroke-width': 'stroke-width' }, 'line': { 'x1': 'x1', 'x2': 'x2', 'y1': 'y1', 'y2': 'y2', 'stroke': 'stroke', 'stroke-width': 'stroke-width' }, 'path': { 'd': 'd', 'stroke': 'stroke', 'stroke-width': 'stroke-width', 'fill': 'fill' }, 'text': { 'x': 'x', 'y': 'y' } };
Make Attribute Map a white-list
Make Attribute Map a white-list
JavaScript
mit
taras/e3,RavelLaw/e3,MattMSumner/e3,taras/e3,elwayman02/e3,asennikov/e3,sly7-7/e3,asennikov/e3,elwayman02/e3,RavelLaw/e3,sly7-7/e3,MattMSumner/e3
--- +++ @@ -1,7 +1,41 @@ +/* + This acts as both a way to normalize attribute names, but also acts + as a white list for the supported properties. + */ export default { 'circle': { 'radius': 'r', 'x': 'cx', 'y': 'cy' + }, + 'group': { + 'transform': 'transform' + }, + 'rect': { + 'x': 'x', + 'y': 'y', + 'height': 'height', + 'width': 'width', + 'fill': 'fill', + 'stroke': 'stroke', + 'stroke-width': 'stroke-width' + }, + 'line': { + 'x1': 'x1', + 'x2': 'x2', + 'y1': 'y1', + 'y2': 'y2', + 'stroke': 'stroke', + 'stroke-width': 'stroke-width' + }, + 'path': { + 'd': 'd', + 'stroke': 'stroke', + 'stroke-width': 'stroke-width', + 'fill': 'fill' + }, + 'text': { + 'x': 'x', + 'y': 'y' } };
e2b573dc2c6251eb131cecfe92f1fe81b2a4574b
lib/mixins/Dialogs.js
lib/mixins/Dialogs.js
module.exports = { showAlertDialog: function(options, callback) { setTimeout(function() { if (navigator.notification && navigator.notification.alert) { navigator.notification.alert( options.message, callback, options.title || 'Alert', options.buttonLabel || 'OK' ); } else { var msg = options.title ? options.title + '\n\n' : ''; msg += options.message; alert(msg); setTimeout(callback, 0); } }, 1); } }
module.exports = { // ALERT // Options: (message, [title], [buttonName]) showAlertDialog: function(options, alertCallback) { setTimeout(function() { if (navigator.notification && navigator.notification.alert) { navigator.notification.alert( options.message, alertCallback, options.title || 'Alert', options.buttonLabel || 'OK' ); } else { var msg = options.title ? options.title + '\n\n' : ''; msg += options.message; alert(msg); setTimeout(alertCallback, 0); } }, 1); }, // CONFIRM // Options: (message, [title], [buttonLabels]) // Callback: invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0) showConfirmDialog: function(options, confirmCallback) { setTimeout(function() { if (navigator.notification && navigator.notification.confirm) { navigator.notification.confirm( options.message, confirmCallback, options.title || 'Confirm', options.buttonLabels || ['OK', 'Cancel'] ); } else { var msg = options.title ? options.title + '\n\n' : ''; msg += options.message; confirm(msg); setTimeout(confirmCallback, 0); } }, 1); } }
Add confirm to dialogs mixin
Add confirm to dialogs mixin
JavaScript
mit
aitnasser/touchstonejs,electronspin/touchstonejs,noikiy/touchstonejs,aitnasser/touchstonejs,wmyers/touchstonejs,sebmck/touchstonejs,KeKs0r/touchstonejs,frederickfogerty/touchstonejs,KeKs0r/touchstonejs,kittens/touchstonejs,electronspin/touchstonejs,touchstonejs/touchstonejs,lzhengms/touchstonejs,noikiy/touchstonejs,frederickfogerty/touchstonejs,lzhengms/touchstonejs,oToUC/touchstonejs,wmyers/touchstonejs,oToUC/touchstonejs,touchstonejs/touchstonejs,unidevel/touchstonejs,unidevel/touchstonejs
--- +++ @@ -1,11 +1,13 @@ module.exports = { - showAlertDialog: function(options, callback) { + // ALERT + // Options: (message, [title], [buttonName]) + showAlertDialog: function(options, alertCallback) { setTimeout(function() { if (navigator.notification && navigator.notification.alert) { navigator.notification.alert( options.message, - callback, + alertCallback, options.title || 'Alert', options.buttonLabel || 'OK' ); @@ -13,7 +15,28 @@ var msg = options.title ? options.title + '\n\n' : ''; msg += options.message; alert(msg); - setTimeout(callback, 0); + setTimeout(alertCallback, 0); + } + }, 1); + }, + + // CONFIRM + // Options: (message, [title], [buttonLabels]) + // Callback: invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0) + showConfirmDialog: function(options, confirmCallback) { + setTimeout(function() { + if (navigator.notification && navigator.notification.confirm) { + navigator.notification.confirm( + options.message, + confirmCallback, + options.title || 'Confirm', + options.buttonLabels || ['OK', 'Cancel'] + ); + } else { + var msg = options.title ? options.title + '\n\n' : ''; + msg += options.message; + confirm(msg); + setTimeout(confirmCallback, 0); } }, 1); }
f342efe16718bfc2bf253e3433506c60850c6087
addon/components/ef-nav.js
addon/components/ef-nav.js
import Component from 'ember-forge-ui/components/ef-nav'; /** * @module * @augments ember-forge-ui/components/ef-nav */ export default Component.extend({ // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- // Attributes /** @type {String[]} */ classNameBindings: [ 'inline:nav-inline', 'inverse:bg-inverse' ], // ------------------------------------------------------------------------- // Actions // ------------------------------------------------------------------------- // Events // ------------------------------------------------------------------------- // Properties // ------------------------------------------------------------------------- // Observers // ------------------------------------------------------------------------- // Methods });
import Component from 'ember-forge-ui/components/ef-nav'; /** * @module * @augments ember-forge-ui/components/ef-nav */ export default Component.extend({ // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- // Attributes /** @type {String[]} */ classNameBindings: [ 'inline:nav-inline', 'inverse:bg-inverse' ], // ------------------------------------------------------------------------- // Actions /** * didInsertElement event hook * * Contextualize the list component * * @returns {undefined} */ didInsertElement() { this._super(...arguments); this.setListContext(); }, // ------------------------------------------------------------------------- // Events // ------------------------------------------------------------------------- // Properties // ------------------------------------------------------------------------- // Observers // ------------------------------------------------------------------------- // Methods /** * Set context-specific classes on these rendered components: * - ef-list * - ef-list-item * * @private * @returns {undefined} */ setListContext() { this._super(...arguments); // ef-list this.$('.list-group') .removeClass('list-group') .addClass('nav'); // ef-list-item this.$('.list-group-item') .removeClass('list-group-item') .addClass('nav-item'); } });
Set classes on ef-list based on context
Set classes on ef-list based on context
JavaScript
mit
ember-forge/ember-forge-ui-bootstrap4,ember-forge/ember-forge-ui-bootstrap4
--- +++ @@ -21,6 +21,19 @@ // ------------------------------------------------------------------------- // Actions + /** + * didInsertElement event hook + * + * Contextualize the list component + * + * @returns {undefined} + */ + didInsertElement() { + this._super(...arguments); + + this.setListContext(); + }, + // ------------------------------------------------------------------------- // Events @@ -33,4 +46,26 @@ // ------------------------------------------------------------------------- // Methods + /** + * Set context-specific classes on these rendered components: + * - ef-list + * - ef-list-item + * + * @private + * @returns {undefined} + */ + setListContext() { + this._super(...arguments); + + // ef-list + this.$('.list-group') + .removeClass('list-group') + .addClass('nav'); + + // ef-list-item + this.$('.list-group-item') + .removeClass('list-group-item') + .addClass('nav-item'); + } + });
7f84f3ddebe8728537f3e6be4765222970842172
lib/install/whitelist-choice.js
lib/install/whitelist-choice.js
'use strict'; const BaseStep = require('./base-step'); module.exports = class WhitelistChoice extends BaseStep { start(state, install) { return new Promise((resolve, reject) => { this.subscriptions.add(install.on('did-whitelist', () => { resolve({whitelist: state.path}); })); this.subscriptions.add(install.on('did-skip-whitelist', () => resolve({whitelist: 'skipped'}))); }); } };
'use strict'; const BaseStep = require('./base-step'); module.exports = class WhitelistChoice extends BaseStep { start(state, install) { return new Promise((resolve, reject) => { this.subscriptions.add(install.on('did-whitelist', () => { install.updateState({whitelist: state.path}); resolve(); })); this.subscriptions.add(install.on('did-skip-whitelist', () => { install.updateState({whitelist: 'skipped'}); resolve(); })); }); } };
Make sure whitelist choice is taken in account in state asap
Make sure whitelist choice is taken in account in state asap
JavaScript
bsd-3-clause
kiteco/kite-installer
--- +++ @@ -6,10 +6,13 @@ start(state, install) { return new Promise((resolve, reject) => { this.subscriptions.add(install.on('did-whitelist', () => { - resolve({whitelist: state.path}); + install.updateState({whitelist: state.path}); + resolve(); })); - this.subscriptions.add(install.on('did-skip-whitelist', () => - resolve({whitelist: 'skipped'}))); + this.subscriptions.add(install.on('did-skip-whitelist', () => { + install.updateState({whitelist: 'skipped'}); + resolve(); + })); }); } };
b8d1c9521b702485582de515cd796f8fc0fe904f
client/src/apps/places/views/map_config.js
client/src/apps/places/views/map_config.js
Places.MapConfig = { APIKEY: process.env.MAP_API_KEY }
Places.MapConfig = { APIKEY: process.env.REACT_APP_MAP_API_KEY }
Make env variable compatible with create-react-app.
Make env variable compatible with create-react-app.
JavaScript
agpl-3.0
teikei/teikei,teikei/teikei,teikei/teikei
--- +++ @@ -1,3 +1,3 @@ Places.MapConfig = { - APIKEY: process.env.MAP_API_KEY + APIKEY: process.env.REACT_APP_MAP_API_KEY }
44d59f05d01232b9bbddd57848d38225b1354289
models/MailingList.js
models/MailingList.js
var keystone = require('keystone'), Types = keystone.Field.Types; // Create model. Additional options allow menu name to be used what auto-generating URLs var MailingList = new keystone.List('Mailing List', { autokey: { path: 'key', from: 'mailingList', unique: true }, map: { name: 'mailingList' } }); // Create fields MailingList.add({ mailingList: { type: Types.Text, label: 'mailing list', required: true, index: true, initial: true } }); MailingList.relationship({ path: 'mailing-lists', ref: 'Prospective Parent or Family', refPath: 'prospectiveParentOrFamily' }); // Define default columns in the admin interface and register the model MailingList.defaultColumns = 'mailingList'; MailingList.register();
var keystone = require('keystone'), Types = keystone.Field.Types; // Create model. Additional options allow menu name to be used what auto-generating URLs var MailingList = new keystone.List('Mailing List', { autokey: { path: 'key', from: 'mailingList', unique: true }, map: { name: 'mailingList' } }); // Create fields MailingList.add({ mailingList: { type: Types.Text, label: 'mailing list', required: true, index: true, initial: true }, siteUserAttendees: { type: Types.Relationship, label: 'site users', ref: 'Site User', many: true, initial: true }, socialWorkerAttendees: { type: Types.Relationship, label: 'social workers', ref: 'Social Worker', many: true, initial: true }, prospectiveParentOrFamilyAttendees: { type: Types.Relationship, label: 'prospective parents or families', ref: 'Prospective Parent or Family', many: true, initial: true } }); // Define default columns in the admin interface and register the model MailingList.defaultColumns = 'mailingList'; MailingList.register();
Update the Mailing List model with relationship fields to select users that have signed up.
Update the Mailing List model with relationship fields to select users that have signed up.
JavaScript
mit
autoboxer/MARE,autoboxer/MARE
--- +++ @@ -9,10 +9,11 @@ // Create fields MailingList.add({ - mailingList: { type: Types.Text, label: 'mailing list', required: true, index: true, initial: true } + mailingList: { type: Types.Text, label: 'mailing list', required: true, index: true, initial: true }, + siteUserAttendees: { type: Types.Relationship, label: 'site users', ref: 'Site User', many: true, initial: true }, + socialWorkerAttendees: { type: Types.Relationship, label: 'social workers', ref: 'Social Worker', many: true, initial: true }, + prospectiveParentOrFamilyAttendees: { type: Types.Relationship, label: 'prospective parents or families', ref: 'Prospective Parent or Family', many: true, initial: true } }); - -MailingList.relationship({ path: 'mailing-lists', ref: 'Prospective Parent or Family', refPath: 'prospectiveParentOrFamily' }); // Define default columns in the admin interface and register the model MailingList.defaultColumns = 'mailingList';
2561c2891eb476ca1d2e9e5b96504eb08866776a
lib/unit/database/FakeSuccessDatabase.js
lib/unit/database/FakeSuccessDatabase.js
'use strict'; var util = require('util'); var openVeoAPI = require('@openveo/api'); var Database = openVeoAPI.Database; function FakeSuccessDatabase() { } module.exports = FakeSuccessDatabase; util.inherits(FakeSuccessDatabase, Database); FakeSuccessDatabase.prototype.get = function(collection, criteria, projection, limit, callback) { callback(null, [{ state: 7, files: [] }]); }; FakeSuccessDatabase.prototype.insert = function(collection, data, callback) { callback(null, (Array.isArray(data) ? data.length : 1), (Array.isArray(data) ? data : [data])); }; FakeSuccessDatabase.prototype.update = function(collection, criteria, data, callback) { callback(null); }; FakeSuccessDatabase.prototype.remove = function(collection, filter, callback) { callback(null, 1); };
'use strict'; var util = require('util'); var openVeoAPI = require('@openveo/api'); var Database = openVeoAPI.Database; function FakeSuccessDatabase() { } module.exports = FakeSuccessDatabase; util.inherits(FakeSuccessDatabase, Database); FakeSuccessDatabase.prototype.get = function(collection, criteria, projection, limit, callback) { var id = 1; if (criteria && criteria.id) { if (criteria.id.$in) id = criteria.id.$in; else id = criteria.id; } callback(null, [{ id: id }]); }; FakeSuccessDatabase.prototype.insert = function(collection, data, callback) { callback(null, (Array.isArray(data) ? data.length : 1), (Array.isArray(data) ? data : [data])); }; FakeSuccessDatabase.prototype.update = function(collection, criteria, data, callback) { callback(null); }; FakeSuccessDatabase.prototype.remove = function(collection, filter, callback) { callback(null, 1); };
Change get fonction to retreive criteria
Change get fonction to retreive criteria
JavaScript
agpl-3.0
veo-labs/openveo-test
--- +++ @@ -11,9 +11,13 @@ util.inherits(FakeSuccessDatabase, Database); FakeSuccessDatabase.prototype.get = function(collection, criteria, projection, limit, callback) { + var id = 1; + if (criteria && criteria.id) { + if (criteria.id.$in) id = criteria.id.$in; + else id = criteria.id; + } callback(null, [{ - state: 7, - files: [] + id: id }]); };
ec7ae3a9bbccc4a3ed247ea56e6c333af3fa8031
tests/unit/components/checkbox/base.spec.js
tests/unit/components/checkbox/base.spec.js
import React from 'react'; import ReactDOM from 'react-dom'; import { Simulate } from 'react-addons-test-utils'; import Checkbox from '../../../../src/components/checkbox.jsx'; import toggleableTests from '../toggleable/base.spec.js'; import { render } from '../../../helpers/rendering.js'; import $ from 'jquery'; describe('Checkbox', function() { toggleableTests( props => render(<Checkbox {...props} />), $component => Simulate.change($component.find(':checkbox')[0]) ); let $checkbox; const onToggle = () => { }; describe('checked', function() { beforeEach(function() { const component = render(<Checkbox onToggle={onToggle} checked />); $checkbox = $(':checkbox', ReactDOM.findDOMNode(component)); }); it('should be checked', function() { expect($checkbox.is(':checked')).to.be.true; }); }); describe('unchecked', function() { beforeEach(function() { const component = render(<Checkbox onToggle={onToggle} />); $checkbox = $(':checkbox', ReactDOM.findDOMNode(component)); }); it('should be unchecked', function() { expect($checkbox.is(':checked')).to.be.false; }); }); });
import React from 'react'; import ReactDOM from 'react-dom'; import { Simulate } from 'react-addons-test-utils'; import Checkbox from '../../../../src/components/checkbox.jsx'; import toggleableTests from '../toggleable/base.spec.js'; import { render } from '../../../helpers/rendering.js'; import $ from 'jquery'; describe('Checkbox', function() { toggleableTests( props => render(<Checkbox {...props} />), $component => Simulate.change($component.find(':checkbox')[0]) ); function renderCheckbox(props) { const component = render(<Checkbox onToggle={() => { }} {...props} />); return $(':checkbox', ReactDOM.findDOMNode(component)); } it('should mark the checkbox when checked', function() { const $checkbox = renderCheckbox({ checked: true }); expect($checkbox.is(':checked')).to.be.true; }); it('should not mark the checkbox when unchecked', function() { const $checkbox = renderCheckbox({ checked: false }); expect($checkbox.is(':checked')).to.be.false; }); });
Refactor <Checkbox> tests to reduce duplication
Refactor <Checkbox> tests to reduce duplication
JavaScript
mit
NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet
--- +++ @@ -13,30 +13,21 @@ $component => Simulate.change($component.find(':checkbox')[0]) ); - let $checkbox; - const onToggle = () => { }; + function renderCheckbox(props) { + const component = render(<Checkbox onToggle={() => { }} {...props} />); - describe('checked', function() { - beforeEach(function() { - const component = render(<Checkbox onToggle={onToggle} checked />); + return $(':checkbox', ReactDOM.findDOMNode(component)); + } - $checkbox = $(':checkbox', ReactDOM.findDOMNode(component)); - }); + it('should mark the checkbox when checked', function() { + const $checkbox = renderCheckbox({ checked: true }); - it('should be checked', function() { - expect($checkbox.is(':checked')).to.be.true; - }); + expect($checkbox.is(':checked')).to.be.true; }); - describe('unchecked', function() { - beforeEach(function() { - const component = render(<Checkbox onToggle={onToggle} />); + it('should not mark the checkbox when unchecked', function() { + const $checkbox = renderCheckbox({ checked: false }); - $checkbox = $(':checkbox', ReactDOM.findDOMNode(component)); - }); - - it('should be unchecked', function() { - expect($checkbox.is(':checked')).to.be.false; - }); + expect($checkbox.is(':checked')).to.be.false; }); });
1ae73ee2a3d5388db5c0b45f5f95db3ce246048e
pagelets/toc/index.js
pagelets/toc/index.js
'use strict'; var sidebar = require('npm-documentation-pagelet').sidebar; // // Add some different styling to the sidebar to make it a table of contents. // module.exports = sidebar.extend({ css: [ sidebar.prototype.css, __dirname + '/toc.styl' ] });
'use strict'; var sidebar = require('npm-documentation-pagelet').sidebar; // // Add some different styling to the sidebar to make it a table of contents. // module.exports = sidebar.extend({ css: sidebar.prototype.css.concat([ __dirname + '/toc.styl' ]) });
Revert "[fix] create new array by referencing sidebar styling"
Revert "[fix] create new array by referencing sidebar styling" This reverts commit 0b88a57e8613c76f7f2976b6966cbbe2a175bbc5.
JavaScript
mit
nodejitsu/browsenpm.org,warehouseai/browsenpm.org
--- +++ @@ -6,8 +6,7 @@ // Add some different styling to the sidebar to make it a table of contents. // module.exports = sidebar.extend({ - css: [ - sidebar.prototype.css, + css: sidebar.prototype.css.concat([ __dirname + '/toc.styl' - ] + ]) });
84dc49850c6a1f26f7ea9446dce309b734c0e036
karma-e2e.conf.js
karma-e2e.conf.js
// Karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html module.exports = function(config) { config.set({ // base path, that will be used to resolve files and exclude basePath: '', // testing framework to use (jasmine/mocha/qunit/...) frameworks: ['ng-scenario'], // list of files / patterns to load in the browser files: [ 'test/e2e/**/*.js' ], // list of files / patterns to exclude exclude: [], // web server port port: 8081, // level of logging // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: false, // Start these browsers, currently available: // - Chrome // - ChromeCanary // - Firefox // - Opera // - Safari (only Mac) // - PhantomJS // - IE (only Windows) browsers: ['Chrome'], // Continuous Integration mode // if true, it capture browsers, run tests and exit singleRun: true, // Uncomment the following lines if you are using grunt's server to run the tests proxies: { '/': 'http://localhost:9001/' }, // URL root prevent conflicts with the site root urlRoot: '_karma_' }); };
// Karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html module.exports = function(config) { config.set({ // base path, that will be used to resolve files and exclude basePath: '', // testing framework to use (jasmine/mocha/qunit/...) frameworks: ['ng-scenario'], // list of files / patterns to load in the browser files: [ 'test/e2e/**/*.js' ], // list of files / patterns to exclude exclude: [], // web server port port: 8081, // level of logging // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: false, // Start these browsers, currently available: // - Chrome // - ChromeCanary // - Firefox // - Opera // - Safari (only Mac) // - PhantomJS // - IE (only Windows) browsers: ['PhantomJS'], // Continuous Integration mode // if true, it capture browsers, run tests and exit singleRun: true, // Uncomment the following lines if you are using grunt's server to run the tests proxies: { '/': 'http://localhost:9001/' }, // URL root prevent conflicts with the site root urlRoot: '_karma_' }); };
Use headless phantomjs for grunt started e2e tests
Use headless phantomjs for grunt started e2e tests
JavaScript
apache-2.0
despairblue/scegratoo3,despairblue/scegratoo3,despairblue/scegratoo3
--- +++ @@ -37,7 +37,7 @@ // - Safari (only Mac) // - PhantomJS // - IE (only Windows) - browsers: ['Chrome'], + browsers: ['PhantomJS'], // Continuous Integration mode
11ae6e95b3215ec2e2c2a7dc4557f73704b3d29e
client/javascripts/main.js
client/javascripts/main.js
$(function() { initHeartAnimation(); initSubscribeForm(); }); function scrollToAnchor(element) { $('html,body').animate({scrollTop: $(element).offset().top}, 'slow'); } function toggleMobileMenu(element) { $('#mobile-nav').toggle(800); $('#menu-toggle').toggleClass("ischecked"); }
$(function() { initHeartAnimation(); initSubscribeForm(); }); function scrollToAnchor(element) { $('html,body').animate({scrollTop: $(element).offset().top}, 'slow'); } function toggleMobileMenu(element) { $('#mobile-nav').slideToggle(400); $('#menu-toggle').toggleClass("ischecked"); }
Switch mobile navigation menu to slide down.
Switch mobile navigation menu to slide down.
JavaScript
mit
borwahs/natalieandrob.com,borwahs/natalieandrob.com
--- +++ @@ -8,6 +8,6 @@ } function toggleMobileMenu(element) { - $('#mobile-nav').toggle(800); + $('#mobile-nav').slideToggle(400); $('#menu-toggle').toggleClass("ischecked"); }
e8f3e3b88a0c3925e088f2079176392786ad036f
packages/bower-config/lib/util/defaults.js
packages/bower-config/lib/util/defaults.js
var os = require('os'); var path = require('path'); var paths = require('./paths'); // Guess proxy defined in the env /*jshint camelcase: false*/ var proxy = process.env.HTTP_PROXY || process.env.http_proxy || null; var httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null; /*jshint camelcase: true*/ var defaults = { 'cwd': process.cwd(), 'directory': 'bower_components', 'registry': 'https://bower.herokuapp.com', 'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git', 'tmp': os.tmpdir ? os.tmpdir() : os.tmpDir(), 'proxy': proxy, 'https-proxy': httpsProxy, 'timeout': 60000, 'ca': { search: [] }, 'strict-ssl': true, 'user-agent': 'node/' + process.version + ' ' + process.platform + ' ' + process.arch, 'color': true, 'interactive': false, 'storage': { packages: path.join(paths.cache, 'packages'), links: path.join(paths.data, 'links'), completion: path.join(paths.data, 'completion'), registry: path.join(paths.cache, 'registry'), git: path.join(paths.data, 'git') } }; module.exports = defaults;
var os = require('os'); var path = require('path'); var paths = require('./paths'); // Guess proxy defined in the env /*jshint camelcase: false*/ var proxy = process.env.HTTP_PROXY || process.env.http_proxy || null; var httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null; /*jshint camelcase: true*/ var defaults = { 'cwd': process.cwd(), 'directory': 'bower_components', 'registry': 'https://bower.herokuapp.com', 'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git', 'tmp': os.tmpdir ? os.tmpdir() : os.tmpDir(), 'proxy': proxy, 'https-proxy': httpsProxy, 'timeout': 30000, 'ca': { search: [] }, 'strict-ssl': true, 'user-agent': 'node/' + process.version + ' ' + process.platform + ' ' + process.arch, 'color': true, 'interactive': false, 'storage': { packages: path.join(paths.cache, 'packages'), links: path.join(paths.data, 'links'), completion: path.join(paths.data, 'completion'), registry: path.join(paths.cache, 'registry'), git: path.join(paths.data, 'git') } }; module.exports = defaults;
Set timeout default value to 30sec.
Set timeout default value to 30sec.
JavaScript
mit
thinkxl/bower,rlugojr/bower,bower/bower
--- +++ @@ -23,7 +23,7 @@ 'tmp': os.tmpdir ? os.tmpdir() : os.tmpDir(), 'proxy': proxy, 'https-proxy': httpsProxy, - 'timeout': 60000, + 'timeout': 30000, 'ca': { search: [] }, 'strict-ssl': true, 'user-agent': 'node/' + process.version + ' ' + process.platform + ' ' + process.arch,
035222ba06f4da0b66a2f8d824a148a57fba2177
packages/react-atlas-core/src/card/Card.js
packages/react-atlas-core/src/card/Card.js
import React, { PropTypes } from "react"; import cx from 'classNames'; /** * Simple Card component that wraps a div around content with card styling. */ const Card = ({ children, ...props }) => { return <div styleName={cx('card')}>{children}</div>; }; Card.propTypes = { /** * Any HTML element or React Component. * @examples <p>Some Text.</p> */ "children": PropTypes.node.isRequired }; Card.defaultProps = { "children": <p>Some card text.</p> }; Card.styleguide = { "category": "Layout", "index": "4.1" }; export default Card;
import React, { PropTypes } from "react"; import cx from 'classNames'; /** * Simple Card component that wraps a div around content with card styling. */ const Card = ({ children, className, ...props }) => { return <div {...props} styleName={cx('card')} className={cx(className)}>{children}</div>; }; Card.propTypes = { /** * Any HTML element or React Component. * @examples <p>Some Text.</p> */ "children": PropTypes.node.isRequired, /** * Custom classnames prop */ "className": PropTypes.string }; Card.defaultProps = { "children": <p>Some card text.</p> }; Card.styleguide = { "category": "Layout", "index": "4.1" }; export default Card;
Set classNames and props on card component and add classNames to proptypes.
Set classNames and props on card component and add classNames to proptypes.
JavaScript
mit
Magneticmagnum/react-atlas,DigitalRiver/react-atlas
--- +++ @@ -4,8 +4,8 @@ /** * Simple Card component that wraps a div around content with card styling. */ -const Card = ({ children, ...props }) => { - return <div styleName={cx('card')}>{children}</div>; +const Card = ({ children, className, ...props }) => { + return <div {...props} styleName={cx('card')} className={cx(className)}>{children}</div>; }; Card.propTypes = { @@ -13,7 +13,12 @@ * Any HTML element or React Component. * @examples <p>Some Text.</p> */ - "children": PropTypes.node.isRequired + "children": PropTypes.node.isRequired, + + /** + * Custom classnames prop + */ + "className": PropTypes.string }; Card.defaultProps = { "children": <p>Some card text.</p> };
4e08d4a9c7f4fec6cd40bd184af49dce3e65829a
lib/node/nodes/georeference-country.js
lib/node/nodes/georeference-country.js
'use strict'; var Node = require('../node'); var debug = require('../../util/debug')('analysis:georeference-country'); var TYPE = 'georeference-country'; var PARAMS = { source: Node.PARAM.NODE(Node.GEOMETRY.ANY), country_column: Node.PARAM.STRING() }; var GeoreferenceCountry = Node.create(TYPE, PARAMS, { cache: true }); module.exports = GeoreferenceCountry; module.exports.TYPE = TYPE; module.exports.PARAMS = PARAMS; GeoreferenceCountry.prototype.sql = function() { var sql = queryTemplate({ source: this.source.getQuery(), columns: this.source.getColumns(true).join(', '), country: this.country_column }); debug(sql); return sql; }; var queryTemplate = Node.template([ 'SELECT', ' {{=it.columns}},', ' cdb_dataservices_client.cdb_geocode_admin0_polygon({{=it.country}}) AS the_geom', 'FROM ({{=it.source}}) AS _camshaft_georeference_admin_region_analysis' ].join('\n'));
'use strict'; var Node = require('../node'); var debug = require('../../util/debug')('analysis:georeference-country'); var TYPE = 'georeference-country'; var PARAMS = { source: Node.PARAM.NODE(Node.GEOMETRY.ANY), country_column: Node.PARAM.STRING() }; var GeoreferenceCountry = Node.create(TYPE, PARAMS, { cache: true }); module.exports = GeoreferenceCountry; module.exports.TYPE = TYPE; module.exports.PARAMS = PARAMS; GeoreferenceCountry.prototype.sql = function() { var sql = queryTemplate({ source: this.source.getQuery(), columns: this.source.getColumns(true).join(', '), country: this.country_column }); debug(sql); return sql; }; var queryTemplate = Node.template([ 'SELECT', ' {{=it.columns}},', ' cdb_dataservices_client.cdb_geocode_admin0_polygon({{=it.country}}) AS the_geom', 'FROM ({{=it.source}}) AS _camshaft_georeference_city_analysis' ].join('\n'));
Fix alias in query template of georeference-city analysis
Fix alias in query template of georeference-city analysis
JavaScript
bsd-3-clause
CartoDB/camshaft
--- +++ @@ -33,5 +33,5 @@ 'SELECT', ' {{=it.columns}},', ' cdb_dataservices_client.cdb_geocode_admin0_polygon({{=it.country}}) AS the_geom', - 'FROM ({{=it.source}}) AS _camshaft_georeference_admin_region_analysis' + 'FROM ({{=it.source}}) AS _camshaft_georeference_city_analysis' ].join('\n'));
aee581308ac27fcd8360e6f2d935afcea75abe9f
redef/patron-client/src/frontend/main.js
redef/patron-client/src/frontend/main.js
import '../../public/dist/styles/main.css' import React from 'react' import ReactDOM from 'react-dom' import { Provider } from 'react-redux' import store from './store' import Root from './containers/Root' import { addLocaleData } from 'react-intl' import en from 'react-intl/locale-data/en' import no from 'react-intl/locale-data/no' const areIntlLocalesSupported = require('intl-locales-supported') const localesMyAppSupports = [ 'en', 'nb' ] function applyPolyfill () { const IntlPollyfill = require('intl') Intl.NumberFormat = IntlPollyfill.NumberFormat Intl.DateTimeFormat = IntlPollyfill.DateTimeFormat require('intl/locale-data/jsonp/en.js') require('intl/locale-data/jsonp/nb.js') return IntlPollyfill } if (global.Intl) { if (!areIntlLocalesSupported(localesMyAppSupports)) { applyPolyfill() } } else { global.Intl = applyPolyfill() } addLocaleData(en) addLocaleData(no) ReactDOM.render(<Provider store={store}><Root /></Provider>, document.getElementById('app'))
import '../../public/dist/styles/main.css' import React from 'react' import ReactDOM from 'react-dom' import { Provider } from 'react-redux' import store from './store' import Root from './containers/Root' import { addLocaleData } from 'react-intl' import en from 'react-intl/locale-data/en' import no from 'react-intl/locale-data/no' const areIntlLocalesSupported = require('intl-locales-supported') const localesMyAppSupports = [ 'en', 'nb' ] function applyPolyfill () { const IntlPolyfill = require('intl') Intl.NumberFormat = IntlPolyfill.NumberFormat Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat require('intl/locale-data/jsonp/en.js') require('intl/locale-data/jsonp/nb.js') return IntlPolyfill } if (global.Intl) { if (!areIntlLocalesSupported(localesMyAppSupports)) { applyPolyfill() } } else { global.Intl = applyPolyfill() } addLocaleData(en) addLocaleData(no) ReactDOM.render(<Provider store={store}><Root /></Provider>, document.getElementById('app'))
Fix typo in variable name
patron-client: Fix typo in variable name
JavaScript
mit
digibib/ls.ext,digibib/ls.ext,digibib/ls.ext,digibib/ls.ext
--- +++ @@ -15,12 +15,12 @@ ] function applyPolyfill () { - const IntlPollyfill = require('intl') - Intl.NumberFormat = IntlPollyfill.NumberFormat - Intl.DateTimeFormat = IntlPollyfill.DateTimeFormat + const IntlPolyfill = require('intl') + Intl.NumberFormat = IntlPolyfill.NumberFormat + Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat require('intl/locale-data/jsonp/en.js') require('intl/locale-data/jsonp/nb.js') - return IntlPollyfill + return IntlPolyfill } if (global.Intl) {
6bd86735696307bbe1130f1b6ec8a30ae4d245a7
perf/N3Parser-perf.js
perf/N3Parser-perf.js
#!/usr/bin/env node var N3 = require('../N3'); var fs = require('fs'), assert = require('assert'); if (process.argv.length !== 3) return console.error('Usage: N3Parser-perf.js filename'); var filename = process.argv[2]; var TEST = '- Parsing file ' + filename; console.time(TEST); var count = 0; new N3.Parser().parse(fs.createReadStream(filename), function (error, triple) { assert(!error, error); if (triple) { count++; } else { console.timeEnd(TEST); console.log('* Triples parsed: ' + count); console.log('* Memory usage: ' + Math.round(process.memoryUsage().rss / 1024 / 1024) + 'MB'); } });
#!/usr/bin/env node var N3 = require('../N3'); var fs = require('fs'), path = require('path'), assert = require('assert'); if (process.argv.length !== 3) return console.error('Usage: N3Parser-perf.js filename'); var filename = path.resolve(process.cwd(), process.argv[2]), base = 'file://' + filename; var TEST = '- Parsing file ' + filename; console.time(TEST); var count = 0; new N3.Parser({ documentIRI: base }).parse(fs.createReadStream(filename), function (error, triple) { assert(!error, error); if (triple) count++; else { console.timeEnd(TEST); console.log('* Triples parsed: ' + count); console.log('* Memory usage: ' + Math.round(process.memoryUsage().rss / 1024 / 1024) + 'MB'); } });
Use base in perf tests.
Use base in perf tests.
JavaScript
mit
warpr/n3,ahmadassaf/N3.js
--- +++ @@ -1,22 +1,23 @@ #!/usr/bin/env node var N3 = require('../N3'); var fs = require('fs'), + path = require('path'), assert = require('assert'); if (process.argv.length !== 3) return console.error('Usage: N3Parser-perf.js filename'); -var filename = process.argv[2]; +var filename = path.resolve(process.cwd(), process.argv[2]), + base = 'file://' + filename; var TEST = '- Parsing file ' + filename; console.time(TEST); var count = 0; -new N3.Parser().parse(fs.createReadStream(filename), function (error, triple) { +new N3.Parser({ documentIRI: base }).parse(fs.createReadStream(filename), function (error, triple) { assert(!error, error); - if (triple) { + if (triple) count++; - } else { console.timeEnd(TEST); console.log('* Triples parsed: ' + count);
ba5001e23855bae3a9c67f5f06a35adda52cdaee
lib/defaultApp.js
lib/defaultApp.js
/*jshint esversion:6, node:true*/ 'use strict'; const extend = require('gextend'); var DEFAULTS = { middleware: require('./middleware') }; module.exports = function(options){ return { init: function(context, config){ config = extend({}, options, config); const express = require('express'); var app = express(); /* * Enable middleware to use context, * i.e. to publish an event system wide. * context.emit('web.request.createUser', user); */ config.context = context; /* * Create a logger for our express app. * This can be trickled down to middleware * as well. */ config.logger = context.getLogger(config.moduleid); //TODO: This should be pulled out of here and implmented by //configurator. setup(app, config); return app; } }; }; function setup(app, config){ config = extend({}, DEFAULTS, config); //TODO: Should we have policies & middleware? var middleware = config.middleware; var use = config.middleware.use; use.map((id)=>{ if(!middleware.hasOwnProperty(id)){ missingMiddleware(config, id); } middleware[id](app, config); }); } function missingMiddleware(config, middleware){ let message = 'Sub app "' + config.moduleid + '" has no middleware "' + middleware + '"'; throw new Error(message); }
/*jshint esversion:6, node:true*/ 'use strict'; const extend = require('gextend'); var DEFAULTS = { middleware: require('./middleware') }; module.exports = function(options) { return { init: function(context, config) { config = extend({}, options, config); const express = require('express'); var app = express(); /* * Enable middleware to use context, * i.e. to publish an event system wide. * context.emit('web.request.createUser', user); */ config.context = context; /* * Create a logger for our express app. * This can be trickled down to middleware * as well. */ config.logger = context.getLogger(config.moduleid); //TODO: This should be pulled out of here and implmented by //configurator. setup(app, config); return app; } }; }; function setup(app, config) { config = extend({}, DEFAULTS, config); //TODO: Should we have policies & middleware? var middleware = config.middleware; var use = config.middleware.use; use.map((id) => { if (!middleware.hasOwnProperty(id)) { missingMiddleware(config, id); } middleware[id](app, config); }); /* * Make sub app aware of it's own * module id. */ app.appId = config.moduleid; } function missingMiddleware(config, middleware) { let message = 'Sub app "' + config.moduleid + '" has no middleware "' + middleware + '"'; throw new Error(message); }
Add appId asap, however we should figure out a better flow
Add appId asap, however we should figure out a better flow
JavaScript
mit
goliatone/core.io-express-server,goliatone/core.io-express-server,goliatone/core.io-express-server
--- +++ @@ -7,10 +7,10 @@ middleware: require('./middleware') }; -module.exports = function(options){ +module.exports = function(options) { return { - init: function(context, config){ + init: function(context, config) { config = extend({}, options, config); const express = require('express'); @@ -39,7 +39,7 @@ }; }; -function setup(app, config){ +function setup(app, config) { config = extend({}, DEFAULTS, config); @@ -49,15 +49,21 @@ var use = config.middleware.use; - use.map((id)=>{ - if(!middleware.hasOwnProperty(id)){ + use.map((id) => { + if (!middleware.hasOwnProperty(id)) { missingMiddleware(config, id); } middleware[id](app, config); }); + + /* + * Make sub app aware of it's own + * module id. + */ + app.appId = config.moduleid; } -function missingMiddleware(config, middleware){ +function missingMiddleware(config, middleware) { let message = 'Sub app "' + config.moduleid + '" has no middleware "' + middleware + '"'; throw new Error(message); }
fa75089a8ffe311d11413f7767788ee5af286693
lib/utils/exec.js
lib/utils/exec.js
var log = require("../utils/log") module.exports = function exec (cmd, args, env, pipe, cb) { if (!cb) cb = pipe, pipe = false if (!cb) cb = env, env = process.env log(cmd+" "+args.map(JSON.stringify).join(" "), "exec") var stdio = process.binding("stdio") , fds = [ stdio.stdinFD || 0 , stdio.stdoutFD || 1 , stdio.stderrFD || 2 ] , cp = require("child_process").spawn( cmd , args , env , pipe ? null : fds ) , stdout = "" , stderr = "" cp.stdout && cp.stdout.on("data", function (chunk) { if (chunk) stdout += chunk }) cp.stderr && cp.stderr.on("data", function (chunk) { if (chunk) stderr += chunk }) cp.on("exit", function (code) { if (code) cb(new Error("`"+cmd+"` failed with "+code)) else cb(null, code, stdout, stderr) }) return cp }
var log = require("../utils/log") module.exports = function exec (cmd, args, env, pipe, cb) { if (!cb) cb = pipe, pipe = false if (!cb) cb = env, env = process.env log(cmd+" "+args.map(JSON.stringify).join(" "), "exec") var stdio = process.binding("stdio") , fds = [ stdio.stdinFD || 0 , stdio.stdoutFD || 1 , stdio.stderrFD || 2 ] , cp = require("child_process").spawn( cmd , args , { env : env , customFDs : pipe ? null : fds } ) , stdout = "" , stderr = "" cp.stdout && cp.stdout.on("data", function (chunk) { if (chunk) stdout += chunk }) cp.stderr && cp.stderr.on("data", function (chunk) { if (chunk) stderr += chunk }) cp.on("exit", function (code) { if (code) cb(new Error("`"+cmd+"` failed with "+code)) else cb(null, code, stdout, stderr) }) return cp }
Use the new child_process.spawn API
Use the new child_process.spawn API
JavaScript
artistic-2.0
TimeToogo/npm,segrey/npm,cchamberlain/npm-msys2,evocateur/npm,chadnickbok/npm,segment-boneyard/npm,chadnickbok/npm,xalopp/npm,yibn2008/npm,segmentio/npm,yodeyer/npm,kemitchell/npm,kimshinelove/naver-npm,lxe/npm,rsp/npm,misterbyrne/npm,haggholm/npm,segrey/npm,yibn2008/npm,evanlucas/npm,DIREKTSPEED-LTD/npm,yodeyer/npm,thomblake/npm,cchamberlain/npm,yyx990803/npm,segmentio/npm,midniteio/npm,xalopp/npm,princeofdarkness76/npm,rsp/npm,yyx990803/npm,cchamberlain/npm,yyx990803/npm,evanlucas/npm,cchamberlain/npm-msys2,midniteio/npm,evanlucas/npm,haggholm/npm,Volune/npm,princeofdarkness76/npm,Volune/npm,kimshinelove/naver-npm,segmentio/npm,kimshinelove/naver-npm,rsp/npm,DIREKTSPEED-LTD/npm,chadnickbok/npm,kriskowal/npm,ekmartin/npm,kriskowal/npm,segrey/npm,haggholm/npm,lxe/npm,cchamberlain/npm,TimeToogo/npm,DaveEmmerson/npm,yibn2008/npm,DaveEmmerson/npm,midniteio/npm,cchamberlain/npm-msys2,segment-boneyard/npm,misterbyrne/npm,kemitchell/npm,segment-boneyard/npm,ekmartin/npm,thomblake/npm,DaveEmmerson/npm,evocateur/npm,ekmartin/npm,misterbyrne/npm,lxe/npm,kemitchell/npm,Volune/npm,evocateur/npm,princeofdarkness76/npm,yodeyer/npm,thomblake/npm,DIREKTSPEED-LTD/npm,TimeToogo/npm,kriskowal/npm,xalopp/npm
--- +++ @@ -12,8 +12,9 @@ ] , cp = require("child_process").spawn( cmd , args - , env - , pipe ? null : fds + , { env : env + , customFDs : pipe ? null : fds + } ) , stdout = "" , stderr = ""
3e6f916ed3021326d37568d0aff48fd17144cda5
scripts/urlbuilder.js
scripts/urlbuilder.js
goog.provide('urlbuilder'); goog.require('urlbuilder.Controller'); urlbuilder.init = function() { var controller = new urlbuilder.Controller(); controller.init(); };
goog.provide('urlbuilder'); goog.require('urlbuilder.Controller'); urlbuilder.init = function() { var controller = new urlbuilder.Controller(); controller.init(); }; goog.exportSymbol("boot", urlbuilder.init);
Add entry point for any build mode
Add entry point for any build mode
JavaScript
mit
4lbertoC/uribuilder,4lbertoC/uribuilder
--- +++ @@ -8,3 +8,4 @@ var controller = new urlbuilder.Controller(); controller.init(); }; +goog.exportSymbol("boot", urlbuilder.init);
dcad43185911ba3d17f818ef533186a34fbd12c5
src/components/MotionTypography.js
src/components/MotionTypography.js
import React from 'react'; import PropTypes from 'prop-types'; import shortid from 'shortid'; import styled, { keyframes } from 'styled-components'; const stagger = keyframes` to { opacity: 1; transform: translateY(0%); } `; const Segments = styled.div` font-family: 'Playfair Display', serif; font-size: 38px; overflow-y: hidden; line-height: 1.25; `; const Segment = styled.span` animation-duration: ${props => `${props.animationDuration}ms`}; animation-name: ${stagger}; animation-fill-mode: forwards; display: inline-block; opacity: 0; transform: translateY(100%); white-space: pre-wrap; `; const MotionTypography = props => ( <Segments> {[...props.title].map((segment, index) => ( <Segment key={shortid.generate()} animationDuration={props.animationDuration} style={{ animationDelay: `${props.animationDelay * index}s`, }} > {segment} </Segment> ))} </Segments> ); MotionTypography.propTypes = { animationDelay: PropTypes.number, animationDuration: PropTypes.number, title: PropTypes.string, }; MotionTypography.defaultProps = { animationDelay: 0.025, animationDuration: 100, title: '', }; export default MotionTypography;
import React from 'react'; import PropTypes from 'prop-types'; import shortid from 'shortid'; import styled, { keyframes } from 'styled-components'; const stagger = keyframes` to { opacity: 1; transform: translateY(0%); } `; const Segments = styled.div` font-family: 'Playfair Display', serif; font-size: 38px; line-height: 1.25; `; const Segment = styled.span` display: inline-block; overflow-y: hidden; span { animation-name: ${stagger}; animation-fill-mode: forwards; display: inline-block; opacity: 0; transform: translateY(100%); white-space: pre-wrap; } `; const MotionTypography = props => { const styles = index => ({ animationDuration: `${props.animationDuration}ms`, animationDelay: `${props.animationDelay * index}s`, }); return ( <Segments> {[...props.title].map((segment, index) => ( <Segment key={shortid.generate()} style={styles(index)}> <span style={styles(index)}>{segment}</span> </Segment> ))} </Segments> ); }; MotionTypography.propTypes = { animationDelay: PropTypes.number, animationDuration: PropTypes.number, title: PropTypes.string, }; MotionTypography.defaultProps = { animationDelay: 0.025, animationDuration: 100, title: '', }; export default MotionTypography;
Update css and markup styles to suit new animation
Update css and markup styles to suit new animation
JavaScript
mit
theshaune/react-animated-typography-experiments,theshaune/react-animated-typography-experiments
--- +++ @@ -13,35 +13,39 @@ const Segments = styled.div` font-family: 'Playfair Display', serif; font-size: 38px; - overflow-y: hidden; line-height: 1.25; `; const Segment = styled.span` - animation-duration: ${props => `${props.animationDuration}ms`}; - animation-name: ${stagger}; - animation-fill-mode: forwards; display: inline-block; - opacity: 0; - transform: translateY(100%); - white-space: pre-wrap; + overflow-y: hidden; + + span { + animation-name: ${stagger}; + animation-fill-mode: forwards; + display: inline-block; + opacity: 0; + transform: translateY(100%); + white-space: pre-wrap; + } `; -const MotionTypography = props => ( - <Segments> - {[...props.title].map((segment, index) => ( - <Segment - key={shortid.generate()} - animationDuration={props.animationDuration} - style={{ - animationDelay: `${props.animationDelay * index}s`, - }} - > - {segment} - </Segment> - ))} - </Segments> -); +const MotionTypography = props => { + const styles = index => ({ + animationDuration: `${props.animationDuration}ms`, + animationDelay: `${props.animationDelay * index}s`, + }); + + return ( + <Segments> + {[...props.title].map((segment, index) => ( + <Segment key={shortid.generate()} style={styles(index)}> + <span style={styles(index)}>{segment}</span> + </Segment> + ))} + </Segments> + ); +}; MotionTypography.propTypes = { animationDelay: PropTypes.number,
32989c866fd815e6a132ccc202f56e117efed028
plugins/search/providers/tpb.js
plugins/search/providers/tpb.js
'use strict'; var bytes = require('bytes'); var tpb = require('thepiratebay'); tpb.setUrl('http://thepiratebay.la'); module.exports = function (program, query, done) { program.log.debug('tpb: searching for %s', query); tpb.search(query, { category: 205, orderBy: 7 }).then(function (results) { var torrents = results || []; program.log.debug('tpb: found %s torrents for %s', torrents.length, query); done(null, torrents.map(function (torrent) { return { title: torrent.name, size: Number(bytes(torrent.size.replace(/[i\s]/g, ''))), torrentLink: torrent.magnetLink, seeders: Number(torrent.seeders), leechers: Number(torrent.leechers), source: 'tpb' }; })); }, function (e) { program.log.error('tpb', e); done(null, []); }); };
'use strict'; var bytes = require('bytes'); var tpb = require('thepiratebay'); tpb.setUrl('http://thepiratebay.se'); module.exports = function (program, query, done) { program.log.debug('tpb: searching for %s', query); tpb.search(query, { category: 205, orderBy: 7 }).then(function (results) { var torrents = results || []; program.log.debug('tpb: found %s torrents for %s', torrents.length, query); done(null, torrents.map(function (torrent) { return { title: torrent.name, size: Number(bytes(torrent.size.replace(/[i\s]/g, ''))), torrentLink: torrent.magnetLink, seeders: Number(torrent.seeders), leechers: Number(torrent.leechers), source: 'tpb' }; })); }, function (e) { program.log.error('tpb', e); done(null, []); }); };
Use currently responding TPB domain
Use currently responding TPB domain
JavaScript
mit
Gobie/tor
--- +++ @@ -2,7 +2,7 @@ var bytes = require('bytes'); var tpb = require('thepiratebay'); -tpb.setUrl('http://thepiratebay.la'); +tpb.setUrl('http://thepiratebay.se'); module.exports = function (program, query, done) { program.log.debug('tpb: searching for %s', query);
b785c69f19178344d2c707ae1f87c3a0f2d0b540
dockerfiles/debian-base.js
dockerfiles/debian-base.js
var funcs = require('./funcs.js') module.exports = function (dist, release) { var contents = funcs.replace(header, {dist: dist, release: release}) + '\n\n' + funcs.replace(pkgs, {pkgs: funcs.generatePkgStr(commonPkgs)}) return contents } var header = 'FROM {{DIST}}:{{RELEASE}}\n' + 'MAINTAINER William Blankenship <wblankenship@nodesource.com>' var pkgs = 'RUN apt-get update \\\n' + ' && apt-get install -y --force-yes --no-install-recommends\\\n' + '{{PKGS}}' + ' && rm -rf /var/lib/apt/lists/*;' var commonPkgs = [ 'apt-transport-https', 'ssh-client', 'build-essential', 'curl', 'ca-certificates', 'git', 'libicu-dev', '\'libicu5-*\'', 'lsb-release', 'python-all', 'rlwrap']
var funcs = require('./funcs.js') module.exports = function (dist, release) { var contents = funcs.replace(header, {dist: dist, release: release}) + '\n\n' + funcs.replace(pkgs, {pkgs: funcs.generatePkgStr(commonPkgs)}) return contents } var header = 'FROM {{DIST}}:{{RELEASE}}\n' + 'MAINTAINER William Blankenship <wblankenship@nodesource.com>' var pkgs = 'RUN apt-get update \\\n' + ' && apt-get install -y --force-yes --no-install-recommends\\\n' + '{{PKGS}}' + ' && rm -rf /var/lib/apt/lists/*;' var commonPkgs = [ 'apt-transport-https', 'ssh-client', 'build-essential', 'curl', 'ca-certificates', 'git', 'libicu-dev', '\'libicu[0-9][0-9].*\'', 'lsb-release', 'python-all', 'rlwrap']
Support 4X releases of libicu
Support 4X releases of libicu
JavaScript
mit
nodesource/docker-node
--- +++ @@ -22,7 +22,7 @@ 'ca-certificates', 'git', 'libicu-dev', - '\'libicu5-*\'', + '\'libicu[0-9][0-9].*\'', 'lsb-release', 'python-all', 'rlwrap']
158469b33337468deb4de93e0c91099c0b0a88ec
config/webpack.dev.js
config/webpack.dev.js
import webpack from 'webpack'; import path from 'path'; import CopyWebpackPlugin from 'copy-webpack-plugin'; import autoprefixer from 'autoprefixer'; import loaders from './webpack.loaders'; import config from './config'; const HOST = config.server.host const PORT = config.server.port export default { entry: [ 'webpack-hot-middleware/client', 'webpack/hot/dev-server', `./src/client/index.jsx` ], devtool: process.env.WEBPACK_DEVTOOL || 'source-map', output: { path: "/", publicPath: "http://" +HOST+ ":" +PORT+ "/", filename: 'app.bundle.js' }, resolve: { extensions: ['', '.js', '.jsx', '.css', '.scss', '.sass'] }, module: { loaders }, devServer: { contentBase: "./dist", noInfo: false, // --no-info option hot: true, inline: true, port: PORT, host: HOST }, plugins: [ new webpack.NoErrorsPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "window.jQuery": "jquery" }) ], postcss: function () { return [autoprefixer]; } };
import webpack from 'webpack'; import path from 'path'; import CopyWebpackPlugin from 'copy-webpack-plugin'; import autoprefixer from 'autoprefixer'; import loaders from './webpack.loaders'; import config from './config'; const HOST = config.server.host const PORT = config.server.port export default { entry: [ 'webpack-hot-middleware/client', 'webpack/hot/dev-server', `./src/client/index.jsx` ], devtool: process.env.WEBPACK_DEVTOOL || '#eval-source-map', output: { path: "/", publicPath: "http://" +HOST+ ":" +PORT+ "/", filename: 'app.bundle.js' }, resolve: { extensions: ['', '.js', '.jsx', '.css', '.scss', '.sass'] }, module: { loaders }, devServer: { contentBase: "./dist", noInfo: false, // --no-info option hot: true, inline: true, port: PORT, host: HOST }, plugins: [ new webpack.NoErrorsPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "window.jQuery": "jquery" }) ], postcss: function () { return [autoprefixer]; } };
Add eval sourcemap for increased recompile speed
Add eval sourcemap for increased recompile speed
JavaScript
mit
AdamSalma/Lurka,AdamSalma/Lurka
--- +++ @@ -15,7 +15,7 @@ 'webpack/hot/dev-server', `./src/client/index.jsx` ], - devtool: process.env.WEBPACK_DEVTOOL || 'source-map', + devtool: process.env.WEBPACK_DEVTOOL || '#eval-source-map', output: { path: "/", publicPath: "http://" +HOST+ ":" +PORT+ "/",
3b93b2391455dd1dcf36f891256a0a37f4ecb6c2
chrome/browser/ui/webui/options2/browser_options2_browsertest.js
chrome/browser/ui/webui/options2/browser_options2_browsertest.js
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * TestFixture for browser options WebUI testing. * @extends {testing.Test} * @constructor **/ function BrowserOptionsWebUITest() {} BrowserOptionsWebUITest.prototype = { __proto__: testing.Test.prototype, /** * Browse to browser options. **/ browsePreload: 'chrome://chrome/settings/', }; // Test opening the browser options has correct location. TEST_F('BrowserOptionsWebUITest', 'testOpenBrowserOptions', function() { assertEquals(this.browsePreload, document.location.href); });
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * TestFixture for browser options WebUI testing. * @extends {testing.Test} * @constructor **/ function BrowserOptionsWebUITest() {} BrowserOptionsWebUITest.prototype = { __proto__: testing.Test.prototype, /** * Browse to browser options. **/ browsePreload: 'chrome://chrome/settings/', }; // Test opening the browser options has correct location. // Times out on Mac debug only. See http://crbug.com/121030 GEN('#if defined(OS_MACOSX) && !defined(NDEBUG)'); GEN('#define MAYBE_testOpenBrowserOptions ' + 'DISABLED_testOpenBrowserOptions'); GEN('#else'); GEN('#define MAYBE_testOpenBrowserOptions testOpenBrowserOptions'); GEN('#endif // defined(OS_MACOSX)'); TEST_F('BrowserOptionsWebUITest', 'MAYBE_testOpenBrowserOptions', function() { assertEquals(this.browsePreload, document.location.href); });
Disable BrowserOptionsWebUITest.testOpenBrowserOptions on Mac debug bots.
Disable BrowserOptionsWebUITest.testOpenBrowserOptions on Mac debug bots. It times out, since it's at the 45 second completion threshold. BUG=121030 TBR=estade@chromium.org Review URL: https://chromiumcodereview.appspot.com/9933007 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@129764 0039d316-1c4b-4281-b951-d872f2087c98
JavaScript
bsd-3-clause
TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,ondra-novak/chromium.src,nacl-webkit/chrome_deps,ondra-novak/chromium.src,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,M4sse/chromium.src,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,ondra-novak/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,hujiajie/pa-chromium,dednal/chromium.src,ltilve/chromium,axinging/chromium-crosswalk,jaruba/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,littlstar/chromium.src,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,littlstar/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,keishi/chromium,dednal/chromium.src,hujiajie/pa-chromium,dushu1203/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,ltilve/chromium,robclark/chromium,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,Jonekee/chromium.src,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,littlstar/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,zcbenz/cefode-chromium,markYoungH/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,timopulkkinen/BubbleFish,markYoungH/chromium.src,patrickm/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,ChromiumWebApps/chromium,markYoungH/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,dushu1203/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,zcbenz/cefode-chromium,patrickm/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,robclark/chromium,Fireblend/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,dednal/chromium.src,junmin-zhu/chromium-rivertrail,keishi/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,Jonekee/chromium.src,anirudhSK/chromium,jaruba/chromium.src,dednal/chromium.src,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,ondra-novak/chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,ltilve/chromium,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,ltilve/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Chilledheart/chromium,jaruba/chromium.src,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,keishi/chromium,robclark/chromium,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,keishi/chromium,ltilve/chromium,robclark/chromium,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,ltilve/chromium,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,patrickm/chromium.src,Just-D/chromium-1,mogoweb/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,ondra-novak/chromium.src,littlstar/chromium.src,keishi/chromium,ondra-novak/chromium.src,robclark/chromium,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,Jonekee/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,Fireblend/chromium-crosswalk,keishi/chromium,krieger-od/nwjs_chromium.src,keishi/chromium,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,dednal/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,robclark/chromium,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,keishi/chromium,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,ltilve/chromium,robclark/chromium,axinging/chromium-crosswalk,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,robclark/chromium,keishi/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,keishi/chromium,chuan9/chromium-crosswalk,anirudhSK/chromium,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,littlstar/chromium.src,Just-D/chromium-1,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,robclark/chromium,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,patrickm/chromium.src,robclark/chromium
--- +++ @@ -19,6 +19,13 @@ }; // Test opening the browser options has correct location. -TEST_F('BrowserOptionsWebUITest', 'testOpenBrowserOptions', function() { +// Times out on Mac debug only. See http://crbug.com/121030 +GEN('#if defined(OS_MACOSX) && !defined(NDEBUG)'); +GEN('#define MAYBE_testOpenBrowserOptions ' + + 'DISABLED_testOpenBrowserOptions'); +GEN('#else'); +GEN('#define MAYBE_testOpenBrowserOptions testOpenBrowserOptions'); +GEN('#endif // defined(OS_MACOSX)'); +TEST_F('BrowserOptionsWebUITest', 'MAYBE_testOpenBrowserOptions', function() { assertEquals(this.browsePreload, document.location.href); });
3ab4de2e75a51aa99e8175812e723bb5b04e859b
public/indivisible/selectors.js
public/indivisible/selectors.js
$('#can_embed_form').load(function(){ console.log('Form loaded.'); var phoneField = $('#phone'); var zipField = $('#form-zip_code'); });
$(document).on('can_embed_loaded', function() { console.log('Form loaded.'); phoneField = $('#phone'); zipField = $('#form-zip_code'); });
Fix field var declarations & onload functionality
Fix field var declarations & onload functionality
JavaScript
agpl-3.0
agustinrhcp/advocacycommons,agustinrhcp/advocacycommons,matinieves/advocacycommons,advocacycommons/advocacycommons,advocacycommons/advocacycommons,agustinrhcp/advocacycommons,matinieves/advocacycommons,advocacycommons/advocacycommons,matinieves/advocacycommons
--- +++ @@ -1,5 +1,5 @@ -$('#can_embed_form').load(function(){ +$(document).on('can_embed_loaded', function() { console.log('Form loaded.'); - var phoneField = $('#phone'); - var zipField = $('#form-zip_code'); + phoneField = $('#phone'); + zipField = $('#form-zip_code'); });
6cd213a6d70af30e166181879edd04eb8aab0da8
src/app/app.routes.js
src/app/app.routes.js
export default function(appModule) { appModule.config(function($stateProvider, $locationProvider) { 'ngInject'; $stateProvider .state({ name: 'stopwatch', url: '/stopwatch', component: 'atStopwatch' }) .state({ name: 'timer', url: '/timer', component: 'atTimer' }) .state({ name: 'about', url: '/about', component: 'atAbout' }); $locationProvider.html5Mode(true); }); }
export default function(appModule) { appModule.config(function( $stateProvider, $locationProvider, $urlRouterProvider ) { 'ngInject'; $stateProvider .state({ name: 'stopwatch', url: '/stopwatch', component: 'atStopwatch' }) .state({ name: 'timer', url: '/timer', component: 'atTimer' }) .state({ name: 'about', url: '/about', component: 'atAbout' }); $urlRouterProvider.otherwise('/stopwatch'); $locationProvider.html5Mode(true); }); }
Make stopwatch the default route
Make stopwatch the default route
JavaScript
mit
JavierPDev/AudioTime,JavierPDev/AudioTime
--- +++ @@ -1,5 +1,7 @@ export default function(appModule) { - appModule.config(function($stateProvider, $locationProvider) { + appModule.config(function( + $stateProvider, $locationProvider, $urlRouterProvider + ) { 'ngInject'; $stateProvider @@ -19,6 +21,7 @@ component: 'atAbout' }); + $urlRouterProvider.otherwise('/stopwatch'); $locationProvider.html5Mode(true); }); }
2f996c0074f7df969f94ffde92bb1eb83191b709
UWPWebBrowser/js/components/navigation.js
UWPWebBrowser/js/components/navigation.js
browser.on("init", function () { "use strict"; // Show the refresh button this.showRefresh = () => { this.stopButton.classList.remove("stopButton"); this.stopButton.classList.add("refreshButton"); this.stopButton.title = "Refresh the page"; }; // Show the stop button this.showStop = () => { this.stopButton.classList.add("stopButton"); this.stopButton.classList.remove("refreshButton"); this.stopButton.title = "Stop loading"; }; // Listen for the stop/refresh button to stop navigation/refresh the page this.stopButton.addEventListener("click", () => { if (this.loading) { this.webview.stop(); this.showProgressRing(false); this.showRefresh(); } else { this.webview.refresh(); } }); // Update the navigation state this.updateNavState = () => { this.backButton.disabled = !this.webview.canGoBack; this.forwardButton.disabled = !this.webview.canGoForward; }; // Listen for the back button to navigate backwards this.backButton.addEventListener("click", () => { if (this.webview.canGoBack) { this.webview.goBack(); } }); // Listen for the forward button to navigate forwards this.forwardButton.addEventListener("click", () => { if (this.webview.canGoForward) { this.webview.goForward(); } }); });
browser.on("init", function () { "use strict"; // Show the refresh button this.showRefresh = () => { this.stopButton.classList.remove("stopButton"); this.stopButton.classList.add("refreshButton"); this.stopButton.title = "Refresh the page"; }; // Show the stop button this.showStop = () => { this.stopButton.classList.add("stopButton"); this.stopButton.classList.remove("refreshButton"); this.stopButton.title = "Stop loading"; }; // Listen for the stop/refresh button to stop navigation/refresh the page this.stopButton.addEventListener("click", () => { if (this.loading) { this.webview.stop(); this.showProgressRing(false); this.showRefresh(); } else { this.webview.refresh(); } }); // Update the navigation state this.updateNavState = () => { this.backButton.disabled = !this.webview.canGoBack; this.forwardButton.disabled = !this.webview.canGoForward; }; // Listen for the back button to navigate backwards this.backButton.addEventListener("click", () => this.webview.goBack()); // Listen for the forward button to navigate forwards this.forwardButton.addEventListener("click", () => this.webview.goForward()); });
Remove unneeded nav checks for forward/back buttons.
Remove unneeded nav checks for forward/back buttons.
JavaScript
mit
shaunstanislaus/JSBrowser,haj/JSBrowser,WebAppsAndFrameworks/JSBrowser,lastout5/lastout5,goofwear/JSBrowser,gnanam336/JSBrowser,amitla/JSBrowser,Wagnerp/JSBrowser,LagunaJS/JSBrowser,shaunstanislaus/JSBrowser,Jericho25/JSBrowser,cpsloal/JSBrowser,jackalchen/JSBrowser,SpotLabsNET/JSBrowser,Mosoc/JSBrowser,WebAppsAndFrameworks/JSBrowser,skmezanul/JSBrowser,MicrosoftEdge/JSBrowser,edper/JSBrowser,Xephi/JSBrowser,githubpama/JSBrowser,lastout5/lastout5,manashmndl/JSBrowser,edper/JSBrowser,javascriptit/JSBrowser,manashmndl/JSBrowser,jackalchen/JSBrowser,edper/JSBrowser,joncampbell123/JSBrowser,daam/JSBrowser,floatas/JSBrowser,skmezanul/JSBrowser,YOTOV-LIMITED/JSBrowser,RobertoMalatesta/JSBrowser,JhonLP/JSBrowser,manashmndl/JSBrowser,cpsloal/JSBrowser,Wagnerp/JSBrowser,LagunaJS/JSBrowser,studio666/JSBrowser,javascriptit/JSBrowser,SpotLabsNET/JSBrowser,znatz/JSBrowser,mariotristan/JSBrowser,joncampbell123/JSBrowser,joncampbell123/JSBrowser,gnanam336/JSBrowser,gnanam336/JSBrowser,Neron-X5/JSBrowser,Xephi/JSBrowser,amitla/JSBrowser,floatas/JSBrowser,znatz/JSBrowser,Wagnerp/JSBrowser,haj/JSBrowser,dj31416/JSBrowser,dublebuble/JSBrowser,shaunstanislaus/JSBrowser,dj31416/JSBrowser,githubpama/JSBrowser,goofwear/JSBrowser,amitla/JSBrowser,JhonLP/JSBrowser,RobertoMalatesta/JSBrowser,MavenRain/JSBrowser,datachand/JSBrowser,locallotus/JSBrowser,MetaStackers/JSBrowser,WebAppsAndFrameworks/JSBrowser,JhonLP/JSBrowser,JeckoHeroOrg/JSBrowser,daam/JSBrowser,haj/JSBrowser,datachand/JSBrowser,Jericho25/JSBrowser,MavenRain/JSBrowser,daam/JSBrowser,locallotus/JSBrowser,lastout5/lastout5,SpotLabsNET/JSBrowser,jackalchen/JSBrowser,Jericho25/JSBrowser,Xephi/JSBrowser,CedarLogic/JSBrowser,YOTOV-LIMITED/JSBrowser,dj31416/JSBrowser,githubpama/JSBrowser,cpsloal/JSBrowser,lzientek/JSBrowser,znatz/JSBrowser,lzientek/JSBrowser,goofwear/JSBrowser,MicrosoftEdge/JSBrowser,evdokimovm/JSBrowser,MavenRain/JSBrowser,MicrosoftEdge/JSBrowser,MetaStackers/JSBrowser,gleborgne/JSBrowser,CedarLogic/JSBrowser,datachand/JSBrowser,lzientek/JSBrowser,mariotristan/JSBrowser,Neron-X5/JSBrowser,JeckoHeroOrg/JSBrowser,LagunaJS/JSBrowser,evdokimovm/JSBrowser,gleborgne/JSBrowser,floatas/JSBrowser,studio666/JSBrowser,mariotristan/JSBrowser,JeckoHeroOrg/JSBrowser,Neron-X5/JSBrowser,gleborgne/JSBrowser,dublebuble/JSBrowser,CedarLogic/JSBrowser,YOTOV-LIMITED/JSBrowser,Mosoc/JSBrowser,evdokimovm/JSBrowser,Mosoc/JSBrowser,MetaStackers/JSBrowser,studio666/JSBrowser,locallotus/JSBrowser,RobertoMalatesta/JSBrowser,javascriptit/JSBrowser,dublebuble/JSBrowser,skmezanul/JSBrowser
--- +++ @@ -34,16 +34,8 @@ }; // Listen for the back button to navigate backwards - this.backButton.addEventListener("click", () => { - if (this.webview.canGoBack) { - this.webview.goBack(); - } - }); + this.backButton.addEventListener("click", () => this.webview.goBack()); // Listen for the forward button to navigate forwards - this.forwardButton.addEventListener("click", () => { - if (this.webview.canGoForward) { - this.webview.goForward(); - } - }); + this.forwardButton.addEventListener("click", () => this.webview.goForward()); });
98729196c61cddeb0634ac30216665d54d3a5b03
src/components/app.js
src/components/app.js
import React from 'react' import PropTypes from 'prop-types' import styled from 'styled-components' import Search from './search' import Results from './results' const Container = styled.div` line-height: 120%; margin: 10px 20px 0 20px; padding: 20px; @media (max-width: 330px) { margin: 10px 10px 0 10px; padding: 10px; } ` const App = props => { return ( <Container> <Search langs={props.allLangs} onLangSelectionChange={props.onLangSelectionChange} onSearch={props.onSearch} /> <Results langLinks={props.langLinks} loading={props.loading} /> </Container> ) } App.propTypes = { allLangs: PropTypes.array.isRequired, langLinks: PropTypes.array.isRequired, loading: PropTypes.bool.isRequired, onLangSelectionChange: PropTypes.func.isRequired, onSearch: PropTypes.func.isRequired } export default App
import React from 'react' import PropTypes from 'prop-types' import styled from 'styled-components' import Search from './search' import Results from './results' const Container = styled.div` line-height: 150%; margin: 10px 20px 0 20px; padding: 20px; @media (max-width: 330px) { margin: 10px 10px 0 10px; padding: 10px; } ` const App = props => { return ( <Container> <Search langs={props.allLangs} onLangSelectionChange={props.onLangSelectionChange} onSearch={props.onSearch} /> <Results langLinks={props.langLinks} loading={props.loading} /> </Container> ) } App.propTypes = { allLangs: PropTypes.array.isRequired, langLinks: PropTypes.array.isRequired, loading: PropTypes.bool.isRequired, onLangSelectionChange: PropTypes.func.isRequired, onSearch: PropTypes.func.isRequired } export default App
Update base line-height to 150%
Update base line-height to 150%
JavaScript
mit
iredchuk/wiki-langlinks-web,iredchuk/wiki-langlinks-web
--- +++ @@ -5,7 +5,7 @@ import Results from './results' const Container = styled.div` - line-height: 120%; + line-height: 150%; margin: 10px 20px 0 20px; padding: 20px;
12a915699f2f9a85486b0b7bd1923b6ff2860503
src/reducers/backgroundsReducer.js
src/reducers/backgroundsReducer.js
import initialState from './initialState'; import * as types from '../constants/actionTypes'; import { setDotsFromStartingDots } from '../utils/categoryStarter'; export default (state = initialState.character.backgrounds, action) => { switch (action.type) { case types.SET_STARTING_DOTS: const { category, trait, startingDots } = action.payload; if (category !== 'backgrounds') { return state; } return setDotsFromStartingDots(state, trait, startingDots); default: return state; } };
import initialState from './initialState'; import * as types from '../constants/actionTypes'; import { setDotsFromStartingDots } from '../utils/categoryStarter'; import { addPurchasedDot } from '../utils/categoryPurchaser'; export default (state = initialState.character.backgrounds, action) => { let category, trait, startingDots; switch (action.type) { case types.SET_STARTING_DOTS: ({ category, trait, startingDots } = action.payload); if (category !== 'backgrounds') { return state; } return setDotsFromStartingDots(state, trait, startingDots); case types.PURCHASE_DOT: ({ category, trait } = action.payload); if (category !== 'backgrounds') { return state; } return addPurchasedDot(state, trait); default: return state; } };
Update backgrounds reducer to purchase dots
Update backgrounds reducer to purchase dots
JavaScript
mit
TrueWill/embracer,TrueWill/embracer
--- +++ @@ -1,17 +1,29 @@ import initialState from './initialState'; import * as types from '../constants/actionTypes'; import { setDotsFromStartingDots } from '../utils/categoryStarter'; +import { addPurchasedDot } from '../utils/categoryPurchaser'; export default (state = initialState.character.backgrounds, action) => { + let category, trait, startingDots; + switch (action.type) { case types.SET_STARTING_DOTS: - const { category, trait, startingDots } = action.payload; + ({ category, trait, startingDots } = action.payload); if (category !== 'backgrounds') { return state; } return setDotsFromStartingDots(state, trait, startingDots); + + case types.PURCHASE_DOT: + ({ category, trait } = action.payload); + + if (category !== 'backgrounds') { + return state; + } + + return addPurchasedDot(state, trait); default: return state; }
a402876e519f1b83b662897dec2a24811634c6de
express-web-app-example.js
express-web-app-example.js
var compression = require("compression"); var express = require("express"); // Initialize Express var app = express(); // Treat "/foo" and "/Foo" as different URLs app.set("case sensitive routing", true); // Treat "/foo" and "/foo/" as different URLs app.set("strict routing", true); // Default to port 3000 app.set("port", process.env.PORT || 3000); // Compress all requests app.use(compression()); // Handle 404 errors app.use(function(req, res) { res.type("text/plain"); res.status(404); res.send("404 - Not Found"); }); // Handle 500 errors app.use(function(err, req, res, next) { console.error(err.stack); res.type("text/plain"); res.status(500); res.send("500 - Server Error"); }); app.listen(app.get("port"), function() { console.log("Express started on http://localhost:" + app.get("port") + "; press Ctrl-C to terminate."); });
var compression = require("compression"); var express = require("express"); var handlebars = require("express-handlebars"); // Initialize Express var app = express(); // Treat "/foo" and "/Foo" as different URLs app.set("case sensitive routing", true); // Treat "/foo" and "/foo/" as different URLs app.set("strict routing", true); // Default to port 3000 app.set("port", process.env.PORT || 3000); // Compress all requests app.use(compression()); // Set Handlebars as the default template language app.engine("handlebars", handlebars({defaultLayout: "main"})); app.set("view engine", "handlebars"); // Handle 404 errors app.use(function(req, res) { res.type("text/plain"); res.status(404); res.send("404 - Not Found"); }); // Handle 500 errors app.use(function(err, req, res, next) { console.error(err.stack); res.type("text/plain"); res.status(500); res.send("500 - Server Error"); }); app.listen(app.get("port"), function() { console.log("Express started on http://localhost:" + app.get("port") + "; press Ctrl-C to terminate."); });
Set Handlebars as the default template language in the main app file.
Set Handlebars as the default template language in the main app file.
JavaScript
mit
stevecochrane/express-web-app-example,stevecochrane/express-web-app-example
--- +++ @@ -1,7 +1,8 @@ var compression = require("compression"); var express = require("express"); +var handlebars = require("express-handlebars"); -// Initialize Express +// Initialize Express var app = express(); // Treat "/foo" and "/Foo" as different URLs @@ -15,6 +16,10 @@ // Compress all requests app.use(compression()); + +// Set Handlebars as the default template language +app.engine("handlebars", handlebars({defaultLayout: "main"})); +app.set("view engine", "handlebars"); // Handle 404 errors app.use(function(req, res) {
7b939afa5e575fc3d190671179e9796c1666801a
streetvoice/src/start-puppeteer.js
streetvoice/src/start-puppeteer.js
const puppeteer = require("puppeteer-core"); async function main () { const browser = await puppeteer.launch({ headless: false, executablePath: "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome", args: [ '--proxy-server=http://127.0.0.1:8080' ], }); const page = await browser.newPage(); await page.goto('https://streetvoice.com/megafeihong'); page.once("close", async () => { await browser.close(); console.log("\nDone!"); }); } main();
const puppeteer = require("puppeteer-core"); function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function main () { // Wait a second to give mitmproxy time to start up await sleep(1000); const browser = await puppeteer.launch({ headless: false, executablePath: "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome", args: [ '--proxy-server=http://127.0.0.1:8080' ], }); const page = await browser.newPage(); await page.goto('https://streetvoice.com/megafeihong'); page.once("close", async () => { await browser.close(); console.log("\nDone!"); }); } main();
Add a small delay to startup of puppeteer
Add a small delay to startup of puppeteer
JavaScript
apache-2.0
feihong/chinese-music-processors,feihong/chinese-music-processors
--- +++ @@ -1,6 +1,13 @@ const puppeteer = require("puppeteer-core"); +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + async function main () { + // Wait a second to give mitmproxy time to start up + await sleep(1000); + const browser = await puppeteer.launch({ headless: false, executablePath: "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome",
afb6c033f6a12033e0ccc9aad15c10050319102f
cypress/integration/locations-hub.spec.js
cypress/integration/locations-hub.spec.js
// / <reference types="Cypress" /> describe('The Locations Hub', () => { before(() => { cy.visit('/#/locations'); }); it('successfully loads', () => { cy.get('header'); cy.get('main'); cy.get('footer'); cy.get('h1'); }); it('has a header with title and description', () => { cy.get('h1').should('contain', 'Locations'); cy.get('.inpage__introduction').should( 'contain', 'Lorem ipsum dolor sit amet' ); }); it('has a results section with a list of location cards', () => { cy.get('.results-summary') .invoke('text') .should('match', /A total of \d+ locations were found/); cy.get('.card').should('have.length', 15); cy.get('.pagination').should('exist'); }); it('has some filters with dropdown menus', () => { cy.get('.filters').should('exist'); cy.get('[title="type__filter"]').click(); cy.get('.drop__menu-item').first().click(); cy.get('.button--filter-pill').should('exist'); cy.get('button').contains('Clear Filters').should('exist'); }); });
// / <reference types="Cypress" /> describe('The Locations Hub', () => { before(() => { cy.visit('/#/locations'); }); it('successfully loads', () => { cy.get('header'); cy.get('main'); cy.get('footer'); cy.get('h1'); }); it('has a header with title and description', () => { cy.get('h1').should('contain', 'Locations'); cy.get('.inpage__introduction').should( 'contain', 'Lorem ipsum dolor sit amet' ); }); it('has a results section with a list of location cards', () => { cy.get('.results-summary') .invoke('text') .should('match', /A total of \d+ locations were found/); cy.get('.card').should('have.length', 15); cy.get('.pagination').should('exist'); }); it('has some filters with dropdown menus', () => { cy.get('.filters').should('exist'); cy.get('[title="type__filter"]').click(); cy.get('.drop__menu-item').first().click(); cy.get('.button--filter-pill').should('exist'); cy.get('button').contains('Clear Filters').should('exist'); cy.get('.button--filter-pill').click(); cy.get('.button--filter-pill').should('not.exist'); }); });
Add test for filter removal
Add test for filter removal
JavaScript
bsd-3-clause
openaq/openaq.org,openaq/openaq.org,openaq/openaq.org
--- +++ @@ -36,7 +36,9 @@ cy.get('.drop__menu-item').first().click(); cy.get('.button--filter-pill').should('exist'); + cy.get('button').contains('Clear Filters').should('exist'); - cy.get('button').contains('Clear Filters').should('exist'); + cy.get('.button--filter-pill').click(); + cy.get('.button--filter-pill').should('not.exist'); }); });
3e7dd0d886b2ee2d44f3869b0d319dcb21ed9117
script/build-supported-words.js
script/build-supported-words.js
var fs = require('fs'), words = require('../data/spache.json'); fs.writeFileSync('Supported-words.md', 'Supported Words\n' + '=================\n' + '\n' + words.map(function (word) { return '* “' + word + '”'; }).join(';\n') + '.\n' );
'use strict'; var fs = require('fs'), words = require('../data/spache.json'); fs.writeFileSync('Supported-words.md', 'Supported Words\n' + '=================\n' + '\n' + words.map(function (word) { return '* “' + word + '”'; }).join(';\n') + '.\n' );
Add strict mode to support generation
Add strict mode to support generation
JavaScript
mit
wooorm/spache
--- +++ @@ -1,3 +1,5 @@ +'use strict'; + var fs = require('fs'), words = require('../data/spache.json');
3d43defabfa6d2797a48c08409970d796ce71737
db/migrations/20150509035633-create-users.js
db/migrations/20150509035633-create-users.js
'use strict' module.exports = { up: function (queryInterface, Sequelize) { return queryInterface.createTable('users', { // it will add the id column automatically name: Sequelize.STRING, createdAt: Sequelize.DATE, updatedAt: Sequelize.DATE }) }, down: function (queryInterface, Sequelize) { return queryInterface.dropTable('users') } }
'use strict' module.exports = { up: function (queryInterface, Sequelize) { return queryInterface.createTable('users', { id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true }, name: Sequelize.STRING, createdAt: Sequelize.DATE, updatedAt: Sequelize.DATE }) }, down: function (queryInterface, Sequelize) { return queryInterface.dropTable('users') } }
Add id column with auto increment
Add id column with auto increment
JavaScript
mit
Olson3R/rest-hapi-bootstrap
--- +++ @@ -3,7 +3,11 @@ module.exports = { up: function (queryInterface, Sequelize) { return queryInterface.createTable('users', { - // it will add the id column automatically + id: { + type: Sequelize.INTEGER, + primaryKey: true, + autoIncrement: true + }, name: Sequelize.STRING, createdAt: Sequelize.DATE, updatedAt: Sequelize.DATE
8b2f43e86f70ba2dd30660cd412eff2a512aa7c9
extension/js/agent/patches/patchWindow.js
extension/js/agent/patches/patchWindow.js
;(function(Agent){ var waitForMarionetteLoad = function(object, callback) { Agent.onObjectAndPropertiesSetted( object, 'Marionette', ['Application', 'Module'], callback ); } var waitForBackboneLoad = function(callback) { Agent.onObjectAndPropertiesSetted( window, 'Backbone', ['View', 'Model', 'Router', 'Collection', '$'], callback ); } Agent.patchWindow = function(patchBackbone, patchMarionette) { var loadedBackbone; var onBackboneLoaded = function() { debug.log('Backbone loaded'); loadedBackbone = window.Backbone; Agent.patchBackbone(loadedBackbone); waitForMarionetteLoad(loadedBackbone, onMarionetteLoaded); }; var onMarionetteLoaded = function() { debug.log('marionette loaded'); var Marionette = window.Marionette || loadedBackbone.Marionette; if (loadedBackbone) { Agent.patchMarionette(loadedBackbone, Marionette); } }; waitForBackboneLoad(onBackboneLoaded); waitForMarionetteLoad(window, onMarionetteLoaded); }; }(Agent));
;(function(Agent){ var waitForMarionetteLoad = function(object, callback) { Agent.onObjectAndPropertiesSetted( object, 'Marionette', ['VERSION'], function (Marionette) { var mnVersion = Marionette.VERSION && Marionette.VERSION[0]; if (mnVersion === '2') { Agent.onceSetted(Marionette, 'Module', callback); } else { callback(); } } ); } var waitForBackboneLoad = function(callback) { Agent.onObjectAndPropertiesSetted( window, 'Backbone', ['View', 'Model', 'Router', 'Collection', '$'], callback ); } Agent.patchWindow = function(patchBackbone, patchMarionette) { var loadedBackbone; var onBackboneLoaded = function() { debug.log('Backbone loaded'); loadedBackbone = window.Backbone; Agent.patchBackbone(loadedBackbone); waitForMarionetteLoad(loadedBackbone, onMarionetteLoaded); }; var onMarionetteLoaded = function() { debug.log('marionette loaded'); var Marionette = window.Marionette || loadedBackbone.Marionette; if (loadedBackbone) { Agent.patchMarionette(loadedBackbone, Marionette); } }; waitForBackboneLoad(onBackboneLoaded); waitForMarionetteLoad(window, onMarionetteLoaded); }; }(Agent));
Rework how Marionette is detected when using script tag
Rework how Marionette is detected when using script tag
JavaScript
mit
marionettejs/marionette.inspector,marionettejs/marionette.inspector,marionettejs/marionette.inspector
--- +++ @@ -3,8 +3,15 @@ var waitForMarionetteLoad = function(object, callback) { Agent.onObjectAndPropertiesSetted( object, - 'Marionette', ['Application', 'Module'], - callback + 'Marionette', ['VERSION'], + function (Marionette) { + var mnVersion = Marionette.VERSION && Marionette.VERSION[0]; + if (mnVersion === '2') { + Agent.onceSetted(Marionette, 'Module', callback); + } else { + callback(); + } + } ); }
61258f1b05683dfbc6807b632018687bb626b1fc
src/server/twitter.js
src/server/twitter.js
const puppeteer = require('puppeteer') const path = require('path') const main = async () => { const browser = await puppeteer.launch() const page = await browser.newPage() await page.setViewport({ width: 1500, height: 500 }) try { await page.goto('http://localhost:8080/twitter.html', { waitUntil: 'networkidle' }) await page.screenshot({ path: 'public/twitterHeader.png' }) } catch (e) { console.error(e) } await browser.close() } main()
const puppeteer = require('puppeteer') const path = require('path') const URL = process.env.TRAVIS == true ? 'http://localhost:8080/twitter.html' : 'https://jsonnull.com/twitter.html' const main = async () => { const browser = await puppeteer.launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] }) const page = await browser.newPage() await page.setViewport({ width: 1500, height: 500 }) try { await page.goto(URL, { waitUntil: 'networkidle' }) await page.screenshot({ path: 'public/twitterHeader.png' }) } catch (e) { console.error(e) } await browser.close() } main()
Update server script to work on CI and production environments.
Update server script to work on CI and production environments.
JavaScript
mit
jsonnull/jsonnull.com,jsonnull/jsonnull.com,jsonnull/jsonnull.com
--- +++ @@ -1,12 +1,19 @@ const puppeteer = require('puppeteer') const path = require('path') +const URL = + process.env.TRAVIS == true + ? 'http://localhost:8080/twitter.html' + : 'https://jsonnull.com/twitter.html' + const main = async () => { - const browser = await puppeteer.launch() + const browser = await puppeteer.launch({ + args: ['--no-sandbox', '--disable-setuid-sandbox'] + }) const page = await browser.newPage() await page.setViewport({ width: 1500, height: 500 }) try { - await page.goto('http://localhost:8080/twitter.html', { + await page.goto(URL, { waitUntil: 'networkidle' }) await page.screenshot({ path: 'public/twitterHeader.png' })
c88579932c761eec9af46cf30b71c4b11a7a420a
scripts/Controller.js
scripts/Controller.js
class Controller { constructor () { this.listeners = [] this.key = null window.addEventListener('keydown', e => { if (e.keyCode === this.key) return this.key = e.keyCode this.listeners.forEach(listener => { listener && listener(Controller.KEYS[this.key]) }) }) window.addEventListener('keyup', e => { this.key = null }) } onKey (listener) { var listenerIndex = this.listeners.length this.listeners.push(listener) return function () { this.listeners[listenerIndex] = null } } } Controller.KEYS = { 37: {move: 'left'}, 38: {move: 'up'}, 39: {move: 'right'}, 40: {move: 'down'}, 65: {rotate: 'left'}, 83: {rotate: 'right'}, 32: {pause: true} }
class Controller { constructor () { this.listeners = [] this.key = null window.addEventListener('keydown', e => { if (e.keyCode === this.key) return this.key = e.keyCode this.listeners.forEach(listener => { listener && Controller.KEYS[this.key] && listener(Controller.KEYS[this.key]) }) }) window.addEventListener('keyup', e => { this.key = null }) } onKey (listener) { var listenerIndex = this.listeners.length this.listeners.push(listener) return function () { this.listeners[listenerIndex] = null } } } Controller.KEYS = { 37: {move: 'left'}, 38: {move: 'up'}, 39: {move: 'right'}, 40: {move: 'down'}, 65: {rotate: 'left'}, 83: {rotate: 'right'}, 32: {pause: true} }
Fix controller on invalid key press
Fix controller on invalid key press
JavaScript
mit
maxwellito/tetrispad,maxwellito/tetrispad
--- +++ @@ -8,7 +8,7 @@ return this.key = e.keyCode this.listeners.forEach(listener => { - listener && listener(Controller.KEYS[this.key]) + listener && Controller.KEYS[this.key] && listener(Controller.KEYS[this.key]) }) }) window.addEventListener('keyup', e => {
2c22a3b240680866b12249a015136502db32d782
src/components/Header/Header.js
src/components/Header/Header.js
import React from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router'; import Loader from '../Loader'; import './Header.scss'; export const Header = ({ isFetching }) => ( <div> <nav className='navbar navbar-inverse container-fluid'> <Link to='/' className='brand-title navbar-brand'>Tiedonohjausjärjestelmä Alpha v0.1.4</Link> </nav> {isFetching && <Loader /> } </div> ); Header.propTypes = { isFetching: React.PropTypes.bool.isRequired }; const mapStateToProps = (state) => { return { isFetching: state.home.isFetching || state.navigation.isFetching || state.selectedTOS.isFetching }; }; export default connect(mapStateToProps)(Header);
import React from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router'; import Loader from '../Loader'; import './Header.scss'; export const Header = ({ isFetching }) => ( <div> <nav className='navbar navbar-inverse container-fluid'> <Link to='/' className='brand-title navbar-brand'>Tiedonohjausjärjestelmä Alpha v0.1.4</Link> </nav> {isFetching && <Loader /> } </div> ); Header.propTypes = { isFetching: React.PropTypes.bool }; const mapStateToProps = (state) => { return { isFetching: state.home.isFetching || state.navigation.isFetching || state.selectedTOS.isFetching }; }; export default connect(mapStateToProps)(Header);
Remove isRequired from header propTypes
Remove isRequired from header propTypes
JavaScript
mit
City-of-Helsinki/helerm-ui,City-of-Helsinki/helerm-ui,City-of-Helsinki/helerm-ui
--- +++ @@ -16,7 +16,7 @@ ); Header.propTypes = { - isFetching: React.PropTypes.bool.isRequired + isFetching: React.PropTypes.bool }; const mapStateToProps = (state) => {
6b72e6c5eb5839acc16ddf6159663c932b2c7f4b
src/components/bnb-analytics.js
src/components/bnb-analytics.js
import { PolymerElement } from '@polymer/polymer/polymer-element'; class BnbAnalytics extends PolymerElement { static get is() { return 'bnb-analytics'; } static get properties() { return { key: { type: String, observer: '_keyChanged', }, }; } sendPath(pathname) { ga('send', 'pageview', pathname); } _keyChanged(key) { if (key) { ga('create', key, 'auto', { appName: 'Botnbot', }); } } } window.customElements.define(BnbAnalytics.is, BnbAnalytics); /* eslint-disable */ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
import { PolymerElement } from '@polymer/polymer/polymer-element'; class BnbAnalytics extends PolymerElement { static get properties() { return { key: { type: String, observer: '_keyChanged', }, }; } sendPath(pathname) { ga('send', 'pageview', pathname); } _keyChanged(key) { if (key) { ga('create', key, 'auto', { appName: 'Botnbot', }); } } } window.customElements.define('bnb-analytics', BnbAnalytics); /* eslint-disable */ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
Refactor : remove get is function
Refactor : remove get is function
JavaScript
apache-2.0
frocher/bnb_app,frocher/bnb_app
--- +++ @@ -1,8 +1,6 @@ import { PolymerElement } from '@polymer/polymer/polymer-element'; class BnbAnalytics extends PolymerElement { - static get is() { return 'bnb-analytics'; } - static get properties() { return { key: { @@ -24,7 +22,7 @@ } } } -window.customElements.define(BnbAnalytics.is, BnbAnalytics); +window.customElements.define('bnb-analytics', BnbAnalytics); /* eslint-disable */ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
6df284bdbc676b0eab0c0c7cb1cb8434d9bd8deb
lib/adapters/storage/memory/placesRepo.js
lib/adapters/storage/memory/placesRepo.js
"use strict"; import placeToEat from "application/domain/placeToEat"; export default function inMemoryPlacesRepo() { let places = [ placeToEat({ id: 100, name: "Thai House", cuisine: "Thai" }), placeToEat({ id: 101, name: "Pizza Plus", cuisine: "American" }), placeToEat({ id: 102, name: "Mura Sushi", cuisine: "Japanese" }) ]; let fetchAll = () => places; let findById = (id) => { let _place; places.some((place) => { if (place.id === id) { _place = place; return true; } }); return _place; }; let fetchRandom = () => { let min = 0; let max = places.length; let idx = Math.floor(Math.random() * (max - min) + min); return places[idx]; }; return { fetchAll, findById, fetchRandom }; }
"use strict"; import placeToEat from "application/domain/placeToEat"; export default function inMemoryPlacesRepo() { let places = [ placeToEat({ id: 100, name: "Thai House", cuisine: "Thai" }), placeToEat({ id: 101, name: "Pizza Plus", cuisine: "American" }), placeToEat({ id: 102, name: "Mura Sushi", cuisine: "Japanese" }) ]; let fetchAll = () => places; let findById = (id) => { let _place; places.some((place) => { if (place.id === id) { _place = place; return true; } }); return _place; }; let fetchRandom = () => { let min = 0; let max = places.length; let idx = Math.floor(Math.random() * (max - min) + min); return places[idx]; }; let add = (placeToEat) => { places.push(placeToEat); }; return { add, fetchAll, findById, fetchRandom }; }
Add an `add` method to places repo.
Add an `add` method to places repo.
JavaScript
mit
pbouzakis/hexy-ex
--- +++ @@ -31,5 +31,9 @@ return places[idx]; }; - return { fetchAll, findById, fetchRandom }; + let add = (placeToEat) => { + places.push(placeToEat); + }; + + return { add, fetchAll, findById, fetchRandom }; }
9dc3d56f0d3fa9fa17f35ab1b2a5015381b91fd4
tests/anvil/configSet/Resources/suites/jss.js
tests/anvil/configSet/Resources/suites/jss.js
/* * Appcelerator Titanium Mobile * Copyright (c) 2011-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ module.exports = new function() { var finish; var valueOf; this.init = function(testUtils) { finish = testUtils.finish; valueOf = testUtils.valueOf; } this.name = "jss"; this.tests = [ {name: "platform_jss_dirs"} ] this.platform_jss_dirs = function(testRun) { var test = Ti.UI.createView({ id: "test" }); valueOf(testRun, test).shouldNotBeNull(); if (Ti.Platform.name == "android") { valueOf(testRun, test.backgroundColor).shouldBe("red"); } else if (Ti.Platform.name == "tizen") { // In Tizen, test.backgroundColor is undefined by default. valueOf(testRun, test.backgroundColor).shouldBeUndefined(); } else { valueOf(testRun, test.backgroundColor).shouldBe("blue"); } finish(testRun); } }
/* * Appcelerator Titanium Mobile * Copyright (c) 2011-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ module.exports = new function() { var finish; var valueOf; this.init = function(testUtils) { finish = testUtils.finish; valueOf = testUtils.valueOf; } this.name = "jss"; this.tests = [ {name: "platform_jss_dirs"} ] this.platform_jss_dirs = function(testRun) { var test = Ti.UI.createView({ id: "test" }); valueOf(testRun, test).shouldNotBeNull(); if (Ti.Platform.name == "android") { valueOf(testRun, test.backgroundColor).shouldBe("red"); } else if (Ti.Platform.osname == "tizen") { // In Tizen, test.backgroundColor is undefined by default. valueOf(testRun, test.backgroundColor).shouldBeUndefined(); } else { valueOf(testRun, test.backgroundColor).shouldBe("blue"); } finish(testRun); } }
Change Ti.Platform.name to Ti.Platform.osname in Anvil for Tizen calls
Change Ti.Platform.name to Ti.Platform.osname in Anvil for Tizen calls
JavaScript
apache-2.0
appcelerator/titanium_mobile_tizen,appcelerator/titanium_mobile_tizen,appcelerator/titanium_mobile_tizen,appcelerator/titanium_mobile_tizen,appcelerator/titanium_mobile_tizen,appcelerator/titanium_mobile_tizen
--- +++ @@ -24,7 +24,7 @@ if (Ti.Platform.name == "android") { valueOf(testRun, test.backgroundColor).shouldBe("red"); - } else if (Ti.Platform.name == "tizen") { + } else if (Ti.Platform.osname == "tizen") { // In Tizen, test.backgroundColor is undefined by default. valueOf(testRun, test.backgroundColor).shouldBeUndefined(); } else {
e92059feecb7271d6c22f80dda1fd1e76a155ce3
ui/js/stores/chartBuilder/chartDefinitions.js
ui/js/stores/chartBuilder/chartDefinitions.js
module.exports = [{name:"LineChart",groupBy:true,chooseAxis:false,timeRadios:["allTime","pastYear","3Months"]}, {name:"PieChart",groupBy:false,chooseAxis:false,timeRadios:["current"]}, {name:"ChoroplethMap",groupBy:false,chooseAxis:false,timeRadios:["current"]}, {name:"ColumnChart",groupBy:true,chooseAxis:false,timeRadios:["pastYear","3Months","current"]}, {name:"ColumnChart",groupBy:true,chooseAxis:false,timeRadios:["allTime","pastYear","3Months","current"]}, {name:"ScatterChart",groupBy:false,chooseAxis:true,timeRadios:["current"]}, {name:"BarChart",groupBy:true,chooseAxis:false,timeRadios:["current"]}];
module.exports = [ {name:"LineChart",groupBy:true,chooseAxis:false,timeRadios:["allTime","pastYear","3Months"]}, {name:"PieChart",groupBy:false,chooseAxis:false,timeRadios:["current"]}, {name:"ChoroplethMap",groupBy:false,chooseAxis:false,timeRadios:["current"]}, {name:"ColumnChart",groupBy:true,chooseAxis:false,timeRadios:["pastYear","3Months","current"]}, {name:"ScatterChart",groupBy:false,chooseAxis:true,timeRadios:["current"]}, {name:"BarChart",groupBy:true,chooseAxis:false,timeRadios:["current"]} ];
Clean up the chart definitions
Clean up the chart definitions * Remove duplicate ColumnChart definition * Add line breaks to make reading easier (and detecting things like duplicate entries)
JavaScript
agpl-3.0
SeedScientific/polio,SeedScientific/polio,unicef/rhizome,SeedScientific/polio,unicef/polio,SeedScientific/polio,unicef/rhizome,unicef/rhizome,SeedScientific/polio,unicef/rhizome,unicef/polio,unicef/polio,unicef/polio
--- +++ @@ -1,7 +1,8 @@ -module.exports = [{name:"LineChart",groupBy:true,chooseAxis:false,timeRadios:["allTime","pastYear","3Months"]}, - {name:"PieChart",groupBy:false,chooseAxis:false,timeRadios:["current"]}, - {name:"ChoroplethMap",groupBy:false,chooseAxis:false,timeRadios:["current"]}, - {name:"ColumnChart",groupBy:true,chooseAxis:false,timeRadios:["pastYear","3Months","current"]}, - {name:"ColumnChart",groupBy:true,chooseAxis:false,timeRadios:["allTime","pastYear","3Months","current"]}, - {name:"ScatterChart",groupBy:false,chooseAxis:true,timeRadios:["current"]}, - {name:"BarChart",groupBy:true,chooseAxis:false,timeRadios:["current"]}]; +module.exports = [ + {name:"LineChart",groupBy:true,chooseAxis:false,timeRadios:["allTime","pastYear","3Months"]}, + {name:"PieChart",groupBy:false,chooseAxis:false,timeRadios:["current"]}, + {name:"ChoroplethMap",groupBy:false,chooseAxis:false,timeRadios:["current"]}, + {name:"ColumnChart",groupBy:true,chooseAxis:false,timeRadios:["pastYear","3Months","current"]}, + {name:"ScatterChart",groupBy:false,chooseAxis:true,timeRadios:["current"]}, + {name:"BarChart",groupBy:true,chooseAxis:false,timeRadios:["current"]} +];
5f9d912e263851497970691bafb5441b32a5a859
src/main/webapp/scripts/load.js
src/main/webapp/scripts/load.js
/** * Loads an array of urls using the loadFunction given by the user. * Returns a promise.all of all the urls. */ function loadUrls(urls, loadFunction) { let promises = []; for (url of urls) { let promise = loadFunction(url); promises.push(promise); } return Promise.all(promises); } /** * Loads the template from the url. * Returns a promise of the template. */ function loadTemplate(url) { const templatePromise = fetch(url).then(promiseResponse => promiseResponse.text()); return templatePromise; } /** * Loads the object from the url. * Returns a promise of the object. */ function loadObject(url) { const objPromise = fetch(url).then(promiseResponse => promiseResponse.json()); return objPromise; }
/** * Loads an array of urls using the loadFunction given by the user. * Returns a promise.all of all the urls. */ function loadUrls(urls, loadFunction) { let promises = []; for (url of urls) { let promise = loadFunction(url); promises.push(promise); } return Promise.all(promises); } /** * Loads the template from the url. * Returns a promise of the template. */ function loadTemplate(url) { const templatePromise = fetch(url).then(promiseResponse => promiseResponse.text()).catch(error => console.log(error)); return templatePromise; } /** * Loads the object from the url. * Returns a promise of the object. */ function loadObject(url) { const objPromise = fetch(url).then(promiseResponse => promiseResponse.json()).catch(error => console.log(error)); return objPromise; }
Add catch to fetch statements
Add catch to fetch statements
JavaScript
apache-2.0
googleinterns/step36-2020,googleinterns/step36-2020,googleinterns/step36-2020
--- +++ @@ -16,7 +16,7 @@ * Returns a promise of the template. */ function loadTemplate(url) { - const templatePromise = fetch(url).then(promiseResponse => promiseResponse.text()); + const templatePromise = fetch(url).then(promiseResponse => promiseResponse.text()).catch(error => console.log(error)); return templatePromise; } @@ -25,6 +25,6 @@ * Returns a promise of the object. */ function loadObject(url) { - const objPromise = fetch(url).then(promiseResponse => promiseResponse.json()); + const objPromise = fetch(url).then(promiseResponse => promiseResponse.json()).catch(error => console.log(error)); return objPromise; }
954ebb462b540f0888ed21bdd2d0a3e3cb4589ea
src/mmw/js/src/core/settings.js
src/mmw/js/src/core/settings.js
"use strict"; var _ = require('lodash'); var defaultSettings = { title: 'Model My Watershed', itsi_embed: false, itsi_enabled: true, data_catalog_enabled: false, base_layers: {}, stream_layers: {}, coverage_layers: {}, boundary_layers: {}, conus_perimeter: {}, draw_tools: [], map_controls: [], vizer_urls: {}, vizer_ignore: [], vizer_names: {}, model_packages: [], max_area: 75000, enabled_features: [], branch: null, gitDescribe: null, }; var settings = (function() { return window.clientSettings ? window.clientSettings : defaultSettings; })(); function isLayerSelectorEnabled() { return _.contains(settings['map_controls'], 'LayerSelector'); } function featureEnabled(feature) { return _.contains(settings['enabled_features'], feature); } function set(key, value) { settings[key] = value; return value; } function get(key) { try { return settings[key]; } catch (exc) { return undefined; } } module.exports = { isLayerSelectorEnabled: isLayerSelectorEnabled, featureEnabled: featureEnabled, get: get, set: set };
"use strict"; var _ = require('lodash'); var defaultSettings = { title: 'Model My Watershed', itsi_embed: false, itsi_enabled: true, data_catalog_enabled: false, base_layers: {}, stream_layers: {}, coverage_layers: {}, boundary_layers: {}, conus_perimeter: {}, draw_tools: [], map_controls: [], vizer_urls: {}, vizer_ignore: [], vizer_names: {}, model_packages: [], max_area: 75000, // Default. Populated at runtime by MAX_AREA in base.py enabled_features: [], branch: null, gitDescribe: null, }; var settings = (function() { return window.clientSettings ? window.clientSettings : defaultSettings; })(); function isLayerSelectorEnabled() { return _.contains(settings['map_controls'], 'LayerSelector'); } function featureEnabled(feature) { return _.contains(settings['enabled_features'], feature); } function set(key, value) { settings[key] = value; return value; } function get(key) { try { return settings[key]; } catch (exc) { return undefined; } } module.exports = { isLayerSelectorEnabled: isLayerSelectorEnabled, featureEnabled: featureEnabled, get: get, set: set };
Add comment explaining where runtime value comes from
Add comment explaining where runtime value comes from
JavaScript
apache-2.0
WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed
--- +++ @@ -18,7 +18,7 @@ vizer_ignore: [], vizer_names: {}, model_packages: [], - max_area: 75000, + max_area: 75000, // Default. Populated at runtime by MAX_AREA in base.py enabled_features: [], branch: null, gitDescribe: null,
a20bed35406a0c2232f7d68c5078beecc7255d97
Specs/Scene/ResourceCacheKeySpec.js
Specs/Scene/ResourceCacheKeySpec.js
describe("ResourceCacheKey", function () { it("getSchemaCacheKey works for external schemas", function () {}); it("getSchemaCacheKey works for external schemas", function () {}); it("getSchemaCacheKey works for internal schemas", function () {}); });
import { Resource, ResourceCacheKey } from "../../Source/Cesium.js"; describe("ResourceCacheKey", function () { var schemaUri = "https://example.com/schema.json"; var schemaResource = new Resource({ url: schemaUri }); it("getSchemaCacheKey works for external schemas", function () { var cacheKey = ResourceCacheKey.getSchemaCacheKey({ resource: schemaResource, }); expect(cacheKey).toBe(schemaUri); }); it("getSchemaCacheKey works for internal schemas", function () { var schema = { classes: {}, enums: {}, }; var cacheKey = ResourceCacheKey.getSchemaCacheKey({ schema: schema, }); expect(cacheKey).toEqual(JSON.stringify(schema)); }); });
Add unit tests for getSchemaCacheKey
Add unit tests for getSchemaCacheKey
JavaScript
apache-2.0
likangning93/cesium,AnalyticalGraphicsInc/cesium,CesiumGS/cesium,likangning93/cesium,CesiumGS/cesium,AnalyticalGraphicsInc/cesium,CesiumGS/cesium,likangning93/cesium,likangning93/cesium,likangning93/cesium,CesiumGS/cesium,CesiumGS/cesium
--- +++ @@ -1,7 +1,26 @@ +import { Resource, ResourceCacheKey } from "../../Source/Cesium.js"; + describe("ResourceCacheKey", function () { - it("getSchemaCacheKey works for external schemas", function () {}); + var schemaUri = "https://example.com/schema.json"; + var schemaResource = new Resource({ url: schemaUri }); - it("getSchemaCacheKey works for external schemas", function () {}); + it("getSchemaCacheKey works for external schemas", function () { + var cacheKey = ResourceCacheKey.getSchemaCacheKey({ + resource: schemaResource, + }); - it("getSchemaCacheKey works for internal schemas", function () {}); + expect(cacheKey).toBe(schemaUri); + }); + + it("getSchemaCacheKey works for internal schemas", function () { + var schema = { + classes: {}, + enums: {}, + }; + var cacheKey = ResourceCacheKey.getSchemaCacheKey({ + schema: schema, + }); + + expect(cacheKey).toEqual(JSON.stringify(schema)); + }); });
3bd1e688f16dad63e75b274bc582aca16196047e
src/updater/twitter/NewStageTweet.js
src/updater/twitter/NewStageTweet.js
const TwitterPostBase = require('./TwitterPostBase'); const { readJson } = require('../utilities'); const path = require('path'); const fs = require('fs'); const stagesPath = path.resolve('storage/stages.json'); const splatnetAssetPath = path.resolve('public/assets/splatnet'); class NewStageTweet extends TwitterPostBase { getKey() { return 'newstage'; } getName() { return 'New Stage'; } getStages() { return readJson(stagesPath); } getData() { return this.getStages().find(s => s.first_seen == this.getDataTime()); } getImage(data) { return fs.readFileSync(splatnetAssetPath + data.image); } getText(data) { let hours = (data.first_available - this.getDataTime()) / 60 / 60; let duration = (hours == 1) ? '1 hour' : `${hours} hours`; return `The first schedules for ${data.name} have been posted! Start playing the new stage in ${duration}. #splatoon2`; } } module.exports = NewStageTweet;
const TwitterPostBase = require('./TwitterPostBase'); const { readJson } = require('../utilities'); const path = require('path'); const fs = require('fs'); const stagesPath = path.resolve('storage/stages.json'); const splatnetAssetPath = path.resolve('public/assets/splatnet'); class NewStageTweet extends TwitterPostBase { getKey() { return 'newstage'; } getName() { return 'New Stage'; } getStages() { return readJson(stagesPath); } getData() { return this.getStages().find(s => s.first_seen == this.getDataTime()); } getImage(data) { return fs.readFileSync(splatnetAssetPath + data.image); } getText(data) { let hours = (data.first_available - this.getDataTime()) / 60 / 60; let duration = (hours == 1) ? '1 hour' : `${hours} hours`; return `The first schedules for ${data.name} have been posted! Start playing the new stage when this tweet is ${duration} old. #splatoon2`; } } module.exports = NewStageTweet;
Tweak wording on the "new stage" tweet
Tweak wording on the "new stage" tweet
JavaScript
mit
misenhower/splatoon2.ink,misenhower/splatoon2.ink,misenhower/splatoon2.ink
--- +++ @@ -25,7 +25,7 @@ getText(data) { let hours = (data.first_available - this.getDataTime()) / 60 / 60; let duration = (hours == 1) ? '1 hour' : `${hours} hours`; - return `The first schedules for ${data.name} have been posted! Start playing the new stage in ${duration}. #splatoon2`; + return `The first schedules for ${data.name} have been posted! Start playing the new stage when this tweet is ${duration} old. #splatoon2`; } }
8e7d4746040098b2bbb97a69bbf559a0f2fe50d6
www/js/services/JqueryRestClientService.js
www/js/services/JqueryRestClientService.js
'use strict'; var $ = require('jquery'); //https://pgp-logs-app.herokuapp.com/api //http://localhost:8085/api var client = new $.RestClient('https://pgp-logs-app.herokuapp.com/api', { verbs: { 'post': 'POST', 'read': 'GET', 'put': 'PUT', 'del': 'DELETE' } }); client.add('authentication', { isSingle: true }); client.authentication.add('authenticate', { isSingle: true }); client.add('logmessages'); client.logmessages.add('fields', { isSingle: true }); client.add('applications'); module.exports = { client: client, authentication: client.authentication, applications: client.applications, logMessages: client.logmessages };
'use strict'; var $ = require('jquery'); //https://pgp-logs-app.herokuapp.com/api //http://localhost:8085/api var client = new $.RestClient('https://pgp-logs-app.herokuapp.com/api/', { verbs: { 'post': 'POST', 'read': 'GET', 'put': 'PUT', 'del': 'DELETE' } }); client.add('authentication', { isSingle: true }); client.authentication.add('authenticate', { isSingle: true }); client.add('logmessages'); client.logmessages.add('fields', { isSingle: true }); client.add('applications'); module.exports = { client: client, authentication: client.authentication, applications: client.applications, logMessages: client.logmessages };
Add extra bar in url
Add extra bar in url
JavaScript
mit
pmajoras/pgp-logs,pmajoras/pgp-logs
--- +++ @@ -3,7 +3,7 @@ //https://pgp-logs-app.herokuapp.com/api //http://localhost:8085/api -var client = new $.RestClient('https://pgp-logs-app.herokuapp.com/api', { +var client = new $.RestClient('https://pgp-logs-app.herokuapp.com/api/', { verbs: { 'post': 'POST', 'read': 'GET',
eeac7d70a7a8021f530a8203666598432b888293
src/routes/NotFound/NotFound.js
src/routes/NotFound/NotFound.js
import React from 'react'; import { Link } from 'react-router'; import './NotFound.scss'; export const NotFound = () => ( <div className='not-found-container'> <img className='helsinki-logo' src={require('../../static/assets/helsinki-vaakuna-helfisininen.svg')} alt='Helsinki City Logo' /> <h1>Tätä sivua ei löytynyt :(</h1> <p>Takaisin kotisivulle <Link to='/'>tästä.</Link></p> </div> ); export default NotFound;
import React from 'react'; import { Link } from 'react-router'; import './NotFound.scss'; import hkiLogo from '../../static/assets/helsinki-vaakuna-helfisininen.svg'; export const NotFound = () => ( <div className='not-found-container'> <img className='helsinki-logo' src={hkiLogo} alt='Helsinki City Logo'/> <h1>Tätä sivua ei löytynyt :(</h1> <p>Takaisin etusivulle <Link to='/'>tästä.</Link></p> </div> ); export default NotFound;
Change text, import svg the "right" way
Change text, import svg the "right" way
JavaScript
mit
City-of-Helsinki/helerm-ui,City-of-Helsinki/helerm-ui,City-of-Helsinki/helerm-ui
--- +++ @@ -1,12 +1,13 @@ import React from 'react'; import { Link } from 'react-router'; import './NotFound.scss'; +import hkiLogo from '../../static/assets/helsinki-vaakuna-helfisininen.svg'; export const NotFound = () => ( <div className='not-found-container'> - <img className='helsinki-logo' src={require('../../static/assets/helsinki-vaakuna-helfisininen.svg')} alt='Helsinki City Logo' /> + <img className='helsinki-logo' src={hkiLogo} alt='Helsinki City Logo'/> <h1>Tätä sivua ei löytynyt :(</h1> - <p>Takaisin kotisivulle <Link to='/'>tästä.</Link></p> + <p>Takaisin etusivulle <Link to='/'>tästä.</Link></p> </div> );
0a9dcc82bb5ac82159d92f6ff6f7b512c16dc542
stories/modal-dialog.stories.js
stories/modal-dialog.stories.js
/** * Modal Dialog Component Stories. * * Site Kit by Google, Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import Dialog from '../assets/js/components/Dialog'; storiesOf( 'Global', module ) .add( 'Modal Dialog', () => { const { provides } = global._googlesitekitLegacyData.modules.analytics; return ( <Dialog dialogActive title={ __( 'Modal Dialog Title', 'google-site-kit' ) } subtitle={ __( 'Modal Dialog Subtitle', 'google-site-kit' ) } provides={ provides } danger /> ); }, { options: { delay: 1000, // Wait for button to animate. }, } );
/** * Modal Dialog Component Stories. * * Site Kit by Google, Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import Dialog from '../assets/js/components/Dialog'; storiesOf( 'Global', module ) .add( 'Modal Dialog', () => { const { provides } = global._googlesitekitLegacyData.modules.analytics; return ( <Dialog dialogActive title={ __( 'Modal Dialog Title', 'google-site-kit' ) } subtitle={ __( 'Modal Dialog Subtitle', 'google-site-kit' ) } provides={ provides } handleConfirm={ global.console.log.bind( null, 'Dialog::handleConfirm' ) } danger /> ); }, { options: { delay: 1000, // Wait for button to animate. }, } );
Update Dialog story to provide required prop.
Update Dialog story to provide required prop.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
--- +++ @@ -40,6 +40,7 @@ title={ __( 'Modal Dialog Title', 'google-site-kit' ) } subtitle={ __( 'Modal Dialog Subtitle', 'google-site-kit' ) } provides={ provides } + handleConfirm={ global.console.log.bind( null, 'Dialog::handleConfirm' ) } danger /> );
d135f4474ca3813ca61b13af65f9720e150abd56
src/graphics/index.js
src/graphics/index.js
import * as EventMap from 'eventmap'; // `Graphics` is an instance of an `EventMap` let Graphics = new EventMap(); // Special property `renderer` can be modified, but not deleted Object.defineProperty(Graphics, 'renderer', { value: null, writable: true, enumerable: true }); export default Graphics;
import EventMap from 'eventmap'; // `Graphics` is an instance of an `EventMap` let Graphics = new EventMap(); // Special property `renderer` can be modified, but not deleted Object.defineProperty(Graphics, 'renderer', { value: null, writable: true, enumerable: true }); export default Graphics;
Update import statement in graphics
Update import statement in graphics
JavaScript
mit
freezedev/flockn,freezedev/flockn
--- +++ @@ -1,4 +1,4 @@ -import * as EventMap from 'eventmap'; +import EventMap from 'eventmap'; // `Graphics` is an instance of an `EventMap` let Graphics = new EventMap();
f3889654ee91cac880e15583e3e885348a1c0e6d
generators/app/templates/test/skill.spec.js
generators/app/templates/test/skill.spec.js
'use strict'; const skill = require('../skill/MainStateMachine'); const expect = require('chai').expect; describe('Skill', () => { it('should reply with Intent.Launch', () => { const event = { session: { application: { applicationId: '', }, }, request: { type: 'LaunchRequest', }, }; return skill.execute(event) .then((reply) => { expect(reply.toJSON().response.outputSpeech.ssml).to.equal('<speak>Welcome!</speak>'); }); }); });
'use strict'; const skill = require('../skill/MainStateMachine'); const expect = require('chai').expect; describe('Skill', () => { it('should reply with Intent.Launch', () => { const event = { session: { application: { applicationId: '', }, user: { userId: '', }, }, request: { type: 'LaunchRequest', }, }; return skill.execute(event) .then((reply) => { expect(reply.toJSON().response.outputSpeech.ssml).to.equal('<speak>Welcome!</speak>'); }); }); });
Add userId to event in default test
Add userId to event in default test
JavaScript
mit
mediarain/generator-voxa-skill
--- +++ @@ -9,6 +9,9 @@ session: { application: { applicationId: '', + }, + user: { + userId: '', }, }, request: {
31207136cc0d7628848c114eb5fdb458bc6061fe
src/client/react/user/views/Help/index.js
src/client/react/user/views/Help/index.js
import React from 'react'; import { connect } from 'react-redux'; import '../../scss/views/_main.scss'; import '../../scss/views/_help.scss'; const mapStateToProps = (state, ownProps) => { return { members: state.userInfo.teamMembers }; } @connect(mapStateToProps) class Help extends React.Component { render() { let memberContacts = null; if (this.props.members) { memberContacts = this.props.members.map((member) => { return ( <tr key={member.username}> <td>{`${member.firstname} ${member.lastname}`}</td> <td><a href={`tel:${member.mobileNumber}`}>{member.mobileNumber}</a></td> </tr> ); }); } return ( <main id='help' className='dashboard'> <div className='content'> <h2> Help </h2> <div className='pt-callout pt-icon-info-sign'> This page contains important contacts for you on the day. Please note that pressing a phone number will CALL that number if you are viewing on mobile. </div> <h5>Emergency contacts</h5> <table className='pt-table pt-striped contacts'> <tbody> {/* TODO: Add contact numbers of important people here */} <tr> <td>Emergency</td> <td><a href={`tel:000`}>000</a></td> </tr> <tr> <td>Event coordinator</td> <td><a href={`tel:`}></a></td> </tr> </tbody> </table> <br/> <h5>Team contacts</h5> <table className='pt-table pt-striped contacts'> <tbody> { memberContacts } </tbody> </table> </div> </main> ); } } export default Help;
import React from 'react'; class Help extends React.Component { render() { return ( <main id='help' className='dashboard'> <div className='content'> </div> </main> ); } } export default Help;
Clear help page (contacts moved to contact page)
[ADD] Clear help page (contacts moved to contact page)
JavaScript
mit
bwyap/ptc-amazing-g-race,bwyap/ptc-amazing-g-race
--- +++ @@ -1,64 +1,12 @@ import React from 'react'; -import { connect } from 'react-redux'; - -import '../../scss/views/_main.scss'; -import '../../scss/views/_help.scss'; -const mapStateToProps = (state, ownProps) => { - return { members: state.userInfo.teamMembers }; -} - -@connect(mapStateToProps) class Help extends React.Component { render() { - let memberContacts = null; - if (this.props.members) { - memberContacts = this.props.members.map((member) => { - return ( - <tr key={member.username}> - <td>{`${member.firstname} ${member.lastname}`}</td> - <td><a href={`tel:${member.mobileNumber}`}>{member.mobileNumber}</a></td> - </tr> - ); - }); - } - return ( <main id='help' className='dashboard'> <div className='content'> - <h2> - Help - </h2> - <div className='pt-callout pt-icon-info-sign'> - This page contains important contacts for you on the day. - Please note that pressing a phone number will CALL that number if you are viewing on mobile. - </div> - - <h5>Emergency contacts</h5> - <table className='pt-table pt-striped contacts'> - <tbody> - {/* - TODO: Add contact numbers of important people here - */} - <tr> - <td>Emergency</td> - <td><a href={`tel:000`}>000</a></td> - </tr> - <tr> - <td>Event coordinator</td> - <td><a href={`tel:`}></a></td> - </tr> - </tbody> - </table> - <br/> - - <h5>Team contacts</h5> - <table className='pt-table pt-striped contacts'> - <tbody> - { memberContacts } - </tbody> - </table> + </div> </main> );
80e9afad8a8cd621d42d4eb6399a015c0c7a4c9b
src/reducers/index.js
src/reducers/index.js
import { combineReducers } from 'redux' import { merge } from 'ramda' import { routerStateReducer } from 'redux-router' import { SETTINGS_CHANGE, DISPLAY_FILTERS_CHANGE } from '../constants/actionTypes' import data from './dataReducer' import ui from './uiReducer' import search from './searchReducer' import semester from './semesterReducer' import client from './clientReducer' import user from './userReducer' const initialSettings = { locale: 'cs', layout: 'horizontal', eventsColors: false, fullWeek: false, facultyGrid: false, } const initialDisplayFilters = { /*eslint-disable */ laboratory: true, tutorial: true, lecture: true, exam: true, assessment: true, course_event: true, other: true, /*eslint-enable */ } function settings (state = initialSettings, action) { switch (action.type) { case SETTINGS_CHANGE: return merge(state, action.settings) default: return state } } function displayFilters (state = initialDisplayFilters, action) { switch (action.type) { case DISPLAY_FILTERS_CHANGE: return merge(state, action.displayFilters) default: return state } } const rootReducer = combineReducers({ router: routerStateReducer, settings, displayFilters, data, ui, search, semester, client, user, }) export default rootReducer
import { combineReducers } from 'redux' import { merge } from 'ramda' import { routerStateReducer } from 'redux-router' import { SETTINGS_CHANGE, DISPLAY_FILTERS_CHANGE } from '../constants/actionTypes' import data from './dataReducer' import ui from './uiReducer' import search from './searchReducer' import semester from './semesterReducer' import client from './clientReducer' import user from './userReducer' const initialSettings = { locale: 'cs', layout: 'vertical', eventsColors: false, fullWeek: false, facultyGrid: false, } const initialDisplayFilters = { /*eslint-disable */ laboratory: true, tutorial: true, lecture: true, exam: true, assessment: true, course_event: true, other: true, /*eslint-enable */ } function settings (state = initialSettings, action) { switch (action.type) { case SETTINGS_CHANGE: return merge(state, action.settings) default: return state } } function displayFilters (state = initialDisplayFilters, action) { switch (action.type) { case DISPLAY_FILTERS_CHANGE: return merge(state, action.displayFilters) default: return state } } const rootReducer = combineReducers({ router: routerStateReducer, settings, displayFilters, data, ui, search, semester, client, user, }) export default rootReducer
Change default layout to vertical
Change default layout to vertical Resolves #54
JavaScript
mit
cvut/fittable,cvut/fittable-widget,cvut/fittable,cvut/fittable-widget,cvut/fittable-widget,cvut/fittable
--- +++ @@ -14,7 +14,7 @@ const initialSettings = { locale: 'cs', - layout: 'horizontal', + layout: 'vertical', eventsColors: false, fullWeek: false, facultyGrid: false,
02c68d8763b1ada6abd3e2bb943f8f1f63f6f71a
src/server/mainCss.js
src/server/mainCss.js
import cssHook from 'css-modules-require-hook'; cssHook({ generateScopedName: '[local]__[path][name]__[hash:base64:5]', });
import cssHook from 'css-modules-require-hook'; cssHook({ generateScopedName: '_[hash:base64:22]', });
Fix server side CSS classname scope
Fix server side CSS classname scope
JavaScript
mit
just-paja/improtresk-web,just-paja/improtresk-web
--- +++ @@ -1,5 +1,5 @@ import cssHook from 'css-modules-require-hook'; cssHook({ - generateScopedName: '[local]__[path][name]__[hash:base64:5]', + generateScopedName: '_[hash:base64:22]', });
3c414d17c0e74165d2bef3e43d389773caa3080c
test/bedecked-test.js
test/bedecked-test.js
/*global describe, it, before, beforeEach */ /*jshint -W030 */ 'use strict'; var join = require('path').join , fs = require('fs') , expect = require('chai').expect , cheerio = require('cheerio') , bd = require('../lib/bedecked'); // Fixtures dir var fxd = join(__dirname, 'fixtures'); describe('bedecked', function() { describe('api basics', function() { var err, $; before(function(done) { bd(join(fxd, '001.md'), function(e, html) { err = e; $ = cheerio.load(html); done(); }); }); it('should not generate an error', function() { expect(err).to.not.be.ok; }); it('should split into slides', function() { expect($('.slides > section').length).to.equal(4); }); it('should add styles and scripts to the page', function() { /** * @todo */ expect(false).to.be.true; }); }); describe('api custom opts', function() { /** * @todo */ }); });
/*global describe, it, before, beforeEach */ /*jshint -W030 */ 'use strict'; var join = require('path').join , fs = require('fs') , expect = require('chai').expect , cheerio = require('cheerio') , bd = require('../lib/bedecked'); // Fixtures dir var fxd = join(__dirname, 'fixtures'); describe('bedecked', function() { describe('api basics', function() { var err, $; before(function(done) { bd(join(fxd, '001.md'), function(e, html) { err = e; $ = cheerio.load(html); done(); }); }); it('should not generate an error', function() { expect(err).to.not.be.ok; }); it('should split into slides', function() { expect($('.slides > section').length).to.equal(4); }); it('should add styles and scripts to the page', function() { expect($('link#reveal-core').length).to.equal(1); expect($('link#reveal-theme').length).to.equal(1); expect($('script#reveal-core').length).to.equal(1); expect($('script#reveal-init').length).to.equal(1); }); }); describe('api custom opts', function() { /** * @todo */ }); });
Check for styles and scripts
test: Check for styles and scripts
JavaScript
mit
lily-pytel/bedecked,lily-pytel/bedecked,jtrussell/bedecked,jtrussell/bedecked
--- +++ @@ -32,10 +32,10 @@ }); it('should add styles and scripts to the page', function() { - /** - * @todo - */ - expect(false).to.be.true; + expect($('link#reveal-core').length).to.equal(1); + expect($('link#reveal-theme').length).to.equal(1); + expect($('script#reveal-core').length).to.equal(1); + expect($('script#reveal-init').length).to.equal(1); }); });
ab9de946dd312e18ff232e7def39890ba2be436e
test/contents_test.js
test/contents_test.js
'use strict'; var fs = require('fs'); function read(filename) { return fs.readFileSync(filename, {'encoding': 'utf8'}); } exports.contents = { 'filter': function(test) { var actual = read('tmp/helpers/filter.html'); var expected = read('test/expected/helpers/filter.html'); test.equal(actual, expected, 'should filter all entries'); test.done(); }, 'list': function(test) { var actual = read('tmp/helpers/list.html'); var expected = read('test/expected/helpers/list.html'); test.equal(actual, expected, 'should list all entries'); test.done(); }, };
'use strict'; const fs = require('fs'); function read(filename) { return fs.readFileSync(filename, {'encoding': 'utf8'}); } exports.contents = { 'filter': (test) => { const actual = read('tmp/helpers/filter.html'); const expected = read('test/expected/helpers/filter.html'); test.equal(actual, expected, 'should filter all entries'); test.done(); }, 'list': (test) => { const actual = read('tmp/helpers/list.html'); const expected = read('test/expected/helpers/list.html'); test.equal(actual, expected, 'should list all entries'); test.done(); }, };
Use ES6 features in test
Use ES6 features in test
JavaScript
mit
xavierdutreilh/wintersmith-contents,xavierdutreilh/wintersmith-contents
--- +++ @@ -1,23 +1,23 @@ 'use strict'; -var fs = require('fs'); +const fs = require('fs'); function read(filename) { return fs.readFileSync(filename, {'encoding': 'utf8'}); } exports.contents = { - 'filter': function(test) { - var actual = read('tmp/helpers/filter.html'); - var expected = read('test/expected/helpers/filter.html'); + 'filter': (test) => { + const actual = read('tmp/helpers/filter.html'); + const expected = read('test/expected/helpers/filter.html'); test.equal(actual, expected, 'should filter all entries'); test.done(); }, - 'list': function(test) { - var actual = read('tmp/helpers/list.html'); - var expected = read('test/expected/helpers/list.html'); + 'list': (test) => { + const actual = read('tmp/helpers/list.html'); + const expected = read('test/expected/helpers/list.html'); test.equal(actual, expected, 'should list all entries');
b418e6cbdf8200a5831baf4c6a1425766967a690
test/e2e/scenarios.js
test/e2e/scenarios.js
'use strict'; /* http://docs.angularjs.org/guide/dev_guide.e2e-testing */ describe("PhoneCat App", function(){ describe("Phone list view", function(){ beforeEach(function(){ browser.get("app/index.html"); // repeater test it("should filter the phone list as a user types into the search box", function(){ var phoneList = element.all(by.repeater("phone in phones")); var query = element(by.model("query")); expect(phoneList.count()).toBe(3); query.clear(); query.sendKeys("motorola"); expect(phoneList.count()).toBe(2); }); // filter test it('should display the current filter value in the title bar', function() { query.clear(); expect(browser.getTitle()).toMatch(/Google Phone Gallery:\s*$/); query.sendKeys('nexus'); expect(browser.getTitle()).toMatch(/Google Phone Gallery: nexus$/); }); }); }); });
'use strict'; /* http://docs.angularjs.org/guide/dev_guide.e2e-testing */ describe("PhoneCat App", function(){ describe("Phone list view", function(){ beforeEach(function(){ browser.get("app/index.html"); // repeater test it("should filter the phone list as a user types into the search box", function(){ var phoneList = element.all(by.repeater("phone in phones")); var query = element(by.model("query")); expect(phoneList.count()).toBe(3); query.clear(); query.sendKeys("motorola"); expect(phoneList.count()).toBe(2); }); // filter test it('should display the current filter value in the title bar', function() { query.clear(); expect(browser.getTitle()).toMatch(/Google Phone Gallery:\s*$/); query.sendKeys('nexus'); expect(browser.getTitle()).toMatch(/Google Phone Gallery: nexus$/); }); // two way data binding it('should be possible to control phone order via the drop down select box', function() { var phoneNameColumn = element.all(by.repeater('phone in phones').column('phone.name')); var query = element(by.model('query')); function getNames() { return phoneNameColumn.map(function(elm) { return elm.getText(); }); } query.sendKeys('tablet'); //let's narrow the dataset to make the test assertions shorter expect(getNames()).toEqual([ "Motorola XOOM\u2122 with Wi-Fi", "MOTOROLA XOOM\u2122" ]); element(by.model('orderProp')).element(by.css('option[value="name"]')).click(); expect(getNames()).toEqual([ "MOTOROLA XOOM\u2122", "Motorola XOOM\u2122 with Wi-Fi" ]); }); }); }); });
Add end-2-end test for default ordering
Add end-2-end test for default ordering Verify that the ordering mechanism of the select box is working perfectly
JavaScript
mit
yoda-yoda/AngularJS-12,denisKaranja/AngularJS-12,denisKaranja/AngularJS-12,denisKaranja/AngularJS-12,yoda-yoda/AngularJS-12,yoda-yoda/AngularJS-12
--- +++ @@ -28,6 +28,33 @@ expect(browser.getTitle()).toMatch(/Google Phone Gallery: nexus$/); }); + // two way data binding + it('should be possible to control phone order via the drop down select box', function() { + + var phoneNameColumn = element.all(by.repeater('phone in phones').column('phone.name')); + var query = element(by.model('query')); + + function getNames() { + return phoneNameColumn.map(function(elm) { + return elm.getText(); + }); + } + + query.sendKeys('tablet'); //let's narrow the dataset to make the test assertions shorter + + expect(getNames()).toEqual([ + "Motorola XOOM\u2122 with Wi-Fi", + "MOTOROLA XOOM\u2122" + ]); + + element(by.model('orderProp')).element(by.css('option[value="name"]')).click(); + + expect(getNames()).toEqual([ + "MOTOROLA XOOM\u2122", + "Motorola XOOM\u2122 with Wi-Fi" + ]); + }); + }); }); });
fa4c6ce28d3ea9e2ff84d5ceff01848c2f93deb0
test/browser/index.js
test/browser/index.js
'use strict'; describe('browser build', function() { require('./plain'); require('./worker'); });
'use strict'; describe('browser build', function() { before(function() { this.text = 'var say = "Hello";class Car {}'; this.html = `<pre><code>${this.text}</code></pre>`; this.expect = '<span class="hljs-variable"><span class="hljs-keyword">' + 'var</span> say</span> = <span class="hljs-string">' + '"Hello"</span>;<span class="hljs-class">' + '<span class="hljs-keyword">class</span> ' + '<span class="hljs-title">Car</span> </span>{}'; }); require('./plain'); require('./worker'); });
Move all repeat values into a before statement
Move all repeat values into a before statement
JavaScript
bsd-3-clause
highlightjs/highlight.js,MakeNowJust/highlight.js,palmin/highlight.js,tenbits/highlight.js,palmin/highlight.js,Sannis/highlight.js,highlightjs/highlight.js,dbkaplun/highlight.js,tenbits/highlight.js,isagalaev/highlight.js,teambition/highlight.js,Sannis/highlight.js,bluepichu/highlight.js,MakeNowJust/highlight.js,Sannis/highlight.js,isagalaev/highlight.js,carlokok/highlight.js,sourrust/highlight.js,StanislawSwierc/highlight.js,carlokok/highlight.js,MakeNowJust/highlight.js,sourrust/highlight.js,StanislawSwierc/highlight.js,teambition/highlight.js,teambition/highlight.js,aurusov/highlight.js,lead-auth/highlight.js,tenbits/highlight.js,highlightjs/highlight.js,dbkaplun/highlight.js,dbkaplun/highlight.js,carlokok/highlight.js,bluepichu/highlight.js,aurusov/highlight.js,aurusov/highlight.js,bluepichu/highlight.js,carlokok/highlight.js,sourrust/highlight.js,palmin/highlight.js,highlightjs/highlight.js
--- +++ @@ -1,6 +1,16 @@ 'use strict'; describe('browser build', function() { + before(function() { + this.text = 'var say = "Hello";class Car {}'; + this.html = `<pre><code>${this.text}</code></pre>`; + this.expect = '<span class="hljs-variable"><span class="hljs-keyword">' + + 'var</span> say</span> = <span class="hljs-string">' + + '"Hello"</span>;<span class="hljs-class">' + + '<span class="hljs-keyword">class</span> ' + + '<span class="hljs-title">Car</span> </span>{}'; + }); + require('./plain'); require('./worker'); });
8652ac887b0d97e402cec11f41c8421dd39fc229
client/scripts/array.reduce-polyfill.min.js
client/scripts/array.reduce-polyfill.min.js
Array.prototype.reduce||(Array.prototype.reduce=function(r){"use strict";if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");var e,t=Object(this),n=t.length>>>0,o=0;if(2==arguments.length)e=arguments[1];else{for(;n>o&&!(o in t);)o++;if(o>=n)throw new TypeError("Reduce of empty array with no initial value");e=t[o++]}for(;n>o;o++)o in t&&(e=r(e,t[o],o,t));return e});
Uint32Array.prototype.reduce||(Uint32Array.prototype.reduce=Array.prototype.reduce);
Change Array reduce polyfill to TypedArray reduce polyfill
Change Array reduce polyfill to TypedArray reduce polyfill
JavaScript
mit
multiparty/web-mpc,multiparty/web-mpc,multiparty/web-mpc
--- +++ @@ -1 +1 @@ -Array.prototype.reduce||(Array.prototype.reduce=function(r){"use strict";if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");var e,t=Object(this),n=t.length>>>0,o=0;if(2==arguments.length)e=arguments[1];else{for(;n>o&&!(o in t);)o++;if(o>=n)throw new TypeError("Reduce of empty array with no initial value");e=t[o++]}for(;n>o;o++)o in t&&(e=r(e,t[o],o,t));return e}); +Uint32Array.prototype.reduce||(Uint32Array.prototype.reduce=Array.prototype.reduce);
26d58ac57887253a5b00f00df640a332919589ba
model/registration.js
model/registration.js
'use strict'; var memoize = require('memoizee/plain') , validDb = require('dbjs/valid-dbjs') , defineStringLine = require('dbjs-ext/string/string-line') , defineDocument = require('./document'); module.exports = memoize(function (db) { var StringLine, Document; validDb(db); StringLine = defineStringLine(db); Document = defineDocument(db); db.Object.extend('Registration', { requirements: { type: StringLine, multiple: true }, costs: { type: StringLine, multiple: true }, isMandatory: { type: db.Boolean, value: true }, isApplicable: { type: db.Boolean, value: true }, isRequested: { type: db.Boolean, value: true } }, { label: { type: StringLine }, abbr: { type: StringLine }, certificates: { type: Document, multiple: true } }); return db.Registration; }, { normalizer: require('memoizee/normalizers/get-1')() });
'use strict'; var memoize = require('memoizee/plain') , validDb = require('dbjs/valid-dbjs') , defineStringLine = require('dbjs-ext/string/string-line'); module.exports = memoize(function (db) { var StringLine; validDb(db); StringLine = defineStringLine(db); db.Object.extend('Registration', { certificates: { type: StringLine, multiple: true, value: function () { return [this.key]; } }, requirements: { type: StringLine, multiple: true }, costs: { type: StringLine, multiple: true }, isMandatory: { type: db.Boolean, value: true }, isApplicable: { type: db.Boolean, value: true }, isRequested: { type: db.Boolean, value: true } }, { label: { type: StringLine }, abbr: { type: StringLine } }); return db.Registration; }, { normalizer: require('memoizee/normalizers/get-1')() });
Allow certificites to be conditional
Allow certificites to be conditional
JavaScript
mit
egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations
--- +++ @@ -2,16 +2,19 @@ var memoize = require('memoizee/plain') , validDb = require('dbjs/valid-dbjs') - , defineStringLine = require('dbjs-ext/string/string-line') - , defineDocument = require('./document'); + , defineStringLine = require('dbjs-ext/string/string-line'); module.exports = memoize(function (db) { - var StringLine, Document; + var StringLine; validDb(db); StringLine = defineStringLine(db); - Document = defineDocument(db); db.Object.extend('Registration', { + certificates: { + type: StringLine, + multiple: true, + value: function () { return [this.key]; } + }, requirements: { type: StringLine, multiple: true @@ -39,10 +42,6 @@ }, abbr: { type: StringLine - }, - certificates: { - type: Document, - multiple: true } });