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
9ed345347d76ee4cf46658d583e9cb4713d14077
js/energy-systems/view/EFACBaseNode.js
js/energy-systems/view/EFACBaseNode.js
// Copyright 2014-2015, University of Colorado Boulder /** * Base module for model elements whose position and opacity can change. * * @author John Blanco * @author Andrew Adare */ define( function( require ) { 'use strict'; var inherit = require( 'PHET_CORE/inherit' ); var Node = require( 'SCENERY/nodes/Node' ); /** * @param {PositionableFadableModelElement} modelElement * @param {ModelViewTransform} modelViewTransform * @constructor */ function EFACBaseNode( modelElement, modelViewTransform ) { Node.call( this ); /** * Update the overall offset based on the model position. * * @param {Vector2} offset */ modelElement.positionProperty.link( function( offset ) { this.setTranslation( modelViewTransform.ModelToViewPosition( offset ) ); } ); /** * Update the overall opacity base on model element opacity. * * @param {Number} opacity */ modelElement.opacityProperty.link( function( opacity ) { this.setOpacity( opacity ); } ); } return inherit( Node, EFACBaseNode ); } );
// Copyright 2014-2015, University of Colorado Boulder /** * Base module for model elements whose position and opacity can change. * * @author John Blanco * @author Andrew Adare */ define( function( require ) { 'use strict'; var inherit = require( 'PHET_CORE/inherit' ); var Node = require( 'SCENERY/nodes/Node' ); /** * @param {PositionableFadableModelElement} modelElement * @param {ModelViewTransform} modelViewTransform * @constructor */ function EFACBaseNode( modelElement, modelViewTransform ) { Node.call( this ); var thisNode = this; /** * Update the overall offset based on the model position. * * @param {Vector2} offset */ modelElement.positionProperty.link( function( offset ) { thisNode.setTranslation( modelViewTransform.modelToViewPosition( offset ) ); } ); /** * Update the overall opacity base on model element opacity. * * @param {Number} opacity */ modelElement.opacityProperty.link( function( opacity ) { thisNode.setOpacity( opacity ); } ); } return inherit( Node, EFACBaseNode ); } );
Fix typo and use thisNode
Fix typo and use thisNode
JavaScript
mit
phetsims/energy-forms-and-changes,phetsims/energy-forms-and-changes,phetsims/energy-forms-and-changes
--- +++ @@ -20,13 +20,15 @@ function EFACBaseNode( modelElement, modelViewTransform ) { Node.call( this ); + var thisNode = this; + /** * Update the overall offset based on the model position. * * @param {Vector2} offset */ modelElement.positionProperty.link( function( offset ) { - this.setTranslation( modelViewTransform.ModelToViewPosition( offset ) ); + thisNode.setTranslation( modelViewTransform.modelToViewPosition( offset ) ); } ); /** @@ -35,7 +37,7 @@ * @param {Number} opacity */ modelElement.opacityProperty.link( function( opacity ) { - this.setOpacity( opacity ); + thisNode.setOpacity( opacity ); } ); }
c61ebc077aaad3a53f7a3289aa6f0df2a025749b
backend/app.js
backend/app.js
var app = require('http').createServer(); var request = require('request'); var io = require('socket.io')(app); var fs = require('fs'); app.listen(13374); io.on('connection', function (socket) { setInterval(function() { request('http://status.hasi.it', function (error, response, body) { if (!error && response.statusCode == 200) { socket.emit('status', JSON.parse(body)); } }); }, 500) });
var app = require('http').createServer(); var request = require('request'); var io = require('socket.io')(app); var fs = require('fs'); app.listen(13374); function pullData(socket) { request('http://status.hasi.it', function (error, response, body) { if (!error && response.statusCode == 200) { socket.emit('status', JSON.parse(body)); } }); } io.on('connection', function (socket) { pullData(socket); setInterval(pullData, 5000, socket) });
Add initial load and larger update interval
Add initial load and larger update interval
JavaScript
mit
EddyShure/wazzup,EddyShure/wazzup
--- +++ @@ -5,15 +5,16 @@ app.listen(13374); +function pullData(socket) { + request('http://status.hasi.it', function (error, response, body) { + if (!error && response.statusCode == 200) { + socket.emit('status', JSON.parse(body)); + } + }); +} + io.on('connection', function (socket) { - - setInterval(function() { - request('http://status.hasi.it', function (error, response, body) { - if (!error && response.statusCode == 200) { - socket.emit('status', JSON.parse(body)); - } - }); - }, 500) - + pullData(socket); + setInterval(pullData, 5000, socket) });
315f0ba79a0312cecc3e2b864329cf8845735ea9
scripts/app.js
scripts/app.js
'use strict'; /** * @ngdoc overview * @name angularBootstrapCalendarApp * @description * # angularBootstrapCalendarApp * * Main module of the application. */ angular .module('mwl.calendar', [ 'ui.bootstrap.tooltip' ]);
'use strict'; /** * @ngdoc overview * @name angularBootstrapCalendarApp * @description * # angularBootstrapCalendarApp * * Main module of the application. */ angular .module('mwl.calendar', [ 'ui.bootstrap' ]);
Revert "Lower ui bootstraps dependency to only the tooltip"
Revert "Lower ui bootstraps dependency to only the tooltip" This reverts commit a699e4304a2f75a49d7d8d6769646b1fabdbadcf.
JavaScript
mit
nameandlogo/angular-bootstrap-calendar,danibram/angular-bootstrap-calendar-modded,danibram/angular-bootstrap-calendar-modded,polarbird/angular-bootstrap-calendar,alexjohnson505/angular-bootstrap-calendar,rasulnz/angular-bootstrap-calendar,rasulnz/angular-bootstrap-calendar,CapeSepias/angular-bootstrap-calendar,LandoB/angular-bootstrap-calendar,yukisan/angular-bootstrap-calendar,dungeoncraw/angular-bootstrap-calendar,dungeoncraw/angular-bootstrap-calendar,AladdinSonni/angular-bootstrap-calendar,jmsherry/angular-bootstrap-calendar,seawenzhu/angular-bootstrap-calendar,farmersweb/angular-bootstrap-calendar,abrahampeh/angular-bootstrap-calendar,LandoB/angular-bootstrap-calendar,lekhmanrus/angular-bootstrap-calendar,CapeSepias/angular-bootstrap-calendar,mattlewis92/angular-bootstrap-calendar,seawenzhu/angular-bootstrap-calendar,nameandlogo/angular-bootstrap-calendar,alexjohnson505/angular-bootstrap-calendar,AladdinSonni/angular-bootstrap-calendar,plantwebdesign/angular-bootstrap-calendar,plantwebdesign/angular-bootstrap-calendar,lekhmanrus/angular-bootstrap-calendar,farmersweb/angular-bootstrap-calendar,KevinEverywhere/ts-angular-bootstrap-calendar,Jupitar/angular-material-calendar,KevinEverywhere/ts-angular-bootstrap-calendar,polarbird/angular-bootstrap-calendar,jmsherry/angular-bootstrap-calendar,abrahampeh/angular-bootstrap-calendar,asurinov/angular-bootstrap-calendar,mattlewis92/angular-bootstrap-calendar,asurinov/angular-bootstrap-calendar,yukisan/angular-bootstrap-calendar,Jupitar/angular-material-calendar
--- +++ @@ -10,5 +10,5 @@ */ angular .module('mwl.calendar', [ - 'ui.bootstrap.tooltip' + 'ui.bootstrap' ]);
75299752fcbdf5a4f7c99c13ae1c6827fe9a3d8a
app/assets/javascripts/map/services/GeostoreService.js
app/assets/javascripts/map/services/GeostoreService.js
define([ 'Class', 'uri', 'bluebird', 'map/services/DataService' ], function(Class, UriTemplate, Promise, ds) { 'use strict'; var GET_REQUEST_ID = 'GeostoreService:get', SAVE_REQUEST_ID = 'GeostoreService:save'; var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}'; var GeostoreService = Class.extend({ get: function(id) { return new Promise(function(resolve, reject) { var url = new UriTemplate(URL).fillFromObject({id: id}); ds.define(GET_REQUEST_ID, { cache: {type: 'persist', duration: 1, unit: 'days'}, url: url, type: 'GET' }); var requestConfig = { resourceId: GET_REQUEST_ID, success: resolve }; ds.request(requestConfig); }); }, save: function(geojson) { return new Promise(function(resolve, reject) { var url = new UriTemplate(URL).fillFromObject({}); ds.define(SAVE_REQUEST_ID, { url: url, type: 'POST' }); var params = { geojson: geojson }; var requestConfig = { resourceId: SAVE_REQUEST_ID, data: JSON.stringify(params), success: function(response) { resolve(response.id); }, error: reject }; ds.request(requestConfig); }); } }); return new GeostoreService(); });
define([ 'Class', 'uri', 'bluebird', 'map/services/DataService' ], function(Class, UriTemplate, Promise, ds) { 'use strict'; var GET_REQUEST_ID = 'GeostoreService:get', SAVE_REQUEST_ID = 'GeostoreService:save'; var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}'; var GeostoreService = Class.extend({ get: function(id) { return new Promise(function(resolve, reject) { var url = new UriTemplate(URL).fillFromObject({id: id}); ds.define(GET_REQUEST_ID, { cache: {type: 'persist', duration: 1, unit: 'days'}, url: url, type: 'GET' }); var requestConfig = { resourceId: GET_REQUEST_ID, success: resolve }; ds.request(requestConfig); }); }, save: function(geojson) { return new Promise(function(resolve, reject) { var url = new UriTemplate(URL).fillFromObject({}); ds.define(SAVE_REQUEST_ID, { url: url, type: 'POST' }); var requestConfig = { resourceId: SAVE_REQUEST_ID, data: JSON.stringify(geojson), success: function(response) { resolve(response.id); }, error: reject }; ds.request(requestConfig); }); } }); return new GeostoreService(); });
Update to work with new Geostore API
Update to work with new Geostore API
JavaScript
mit
Vizzuality/gfw,Vizzuality/gfw
--- +++ @@ -43,10 +43,9 @@ type: 'POST' }); - var params = { geojson: geojson }; var requestConfig = { resourceId: SAVE_REQUEST_ID, - data: JSON.stringify(params), + data: JSON.stringify(geojson), success: function(response) { resolve(response.id); },
2d8abed76cd7795771f5e89e752e800b8ae1350c
app/components/calendar/calendar-illustration/index.js
app/components/calendar/calendar-illustration/index.js
/* global document, customElements, BaseElement, Moment */ class CalendarIllustration extends BaseElement { constructor() { super().fetchTemplate(); } /** * Draws the illustration. * * @return {CalendarIllustration} */ draw() { const moment = Moment(); this.dataset.time = moment.format('ha'); this.dataset.quarter = moment.format('Q'); return this; } } // Remember document from import scope. Needed for accessing elements inside // the imported html… CalendarIllustration.ownerDocument = document.currentScript.ownerDocument; // @see https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define customElements.define('calendar-illustration', CalendarIllustration);
/* global document, customElements, BaseElement, Moment */ class CalendarIllustration extends BaseElement { constructor() { super().fetchTemplate(); } /** * Draws the illustration. * * @return {CalendarIllustration} */ draw() { const moment = Moment(); this.dataset.time = moment.format('ha'); this.dataset.month = moment.format('M'); return this; } } // Remember document from import scope. Needed for accessing elements inside // the imported html… CalendarIllustration.ownerDocument = document.currentScript.ownerDocument; // @see https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define customElements.define('calendar-illustration', CalendarIllustration);
Drop quarter in favor of month
Drop quarter in favor of month
JavaScript
mit
mzdr/timestamp,mzdr/timestamp
--- +++ @@ -14,7 +14,7 @@ const moment = Moment(); this.dataset.time = moment.format('ha'); - this.dataset.quarter = moment.format('Q'); + this.dataset.month = moment.format('M'); return this; }
7d6689f17d296a6d1b914e39d1d04e7f5cb7dd7e
blueprints/assertion/index.js
blueprints/assertion/index.js
var stringUtil = require('ember-cli/lib/utilities/string'); module.exports = { description: 'Generates a new custom assertion into tests/assertions/', locals: function(options) { var entity = options.entity; var rawName = entity.name; var name = stringUtil.dasherize(rawName); var camelName = stringUtil.camelize(rawName); return { name: name, camelName: camelName }; } }
var stringUtil = require('ember-cli-string-utils'); module.exports = { description: 'Generates a new custom assertion into tests/assertions/', locals: function(options) { var entity = options.entity; var rawName = entity.name; var name = stringUtil.dasherize(rawName); var camelName = stringUtil.camelize(rawName); return { name: name, camelName: camelName }; } }
Update require statement for string utils
Update require statement for string utils
JavaScript
mit
dockyard/ember-cli-custom-assertions,dockyard/ember-cli-custom-assertions
--- +++ @@ -1,4 +1,4 @@ -var stringUtil = require('ember-cli/lib/utilities/string'); +var stringUtil = require('ember-cli-string-utils'); module.exports = { description: 'Generates a new custom assertion into tests/assertions/',
1b2e12784594fda9454242825befaf673492c40f
buffer-frame-container.js
buffer-frame-container.js
var iframe; function initFrame() { iframe = document.createElement('iframe'); document.body.appendChild(iframe); } // Listen to the parent window send src info to be set on the nested frame function receiveNestedFrameData() { var handler = function(e) { if (e.source !== window.parent && !e.data.src) return; iframe.src = e.data.src; iframe.style.cssText = e.data.css; window.removeEventListener('message', handler); }; window.addEventListener('message', handler); } // Listen to messages from nested frame and pass them up the window stack function setupMessageRelay() { window.addEventListener('message', function(e) { var origin = e.origin || e.originalEvent.origin; if (origin !== 'https://buffer.com' || e.source !== iframe.contentWindow) { return; } window.parent.postMessage(e.data, '*'); }); } initFrame(); receiveNestedFrameData(); setupMessageRelay();
var iframe; function initFrame() { iframe = document.createElement('iframe'); document.body.appendChild(iframe); } // Listen to the parent window send src info to be set on the nested frame function receiveNestedFrameData() { var handler = function(e) { if (e.source !== window.parent && !e.data.src) return; iframe.src = e.data.src; iframe.style.cssText = e.data.css; window.removeEventListener('message', handler); }; window.addEventListener('message', handler); } // Listen to messages from nested frame and pass them up the window stack function setupMessageRelay() { window.addEventListener('message', function(e) { var origin = e.origin || e.originalEvent.origin; if ((origin !== 'https://buffer.com' && origin !== 'https://local.buffer.com') || e.source !== iframe.contentWindow) { return; } window.parent.postMessage(e.data, '*'); }); } initFrame(); receiveNestedFrameData(); setupMessageRelay();
Make extension work in dev env too
Make extension work in dev env too
JavaScript
mit
bufferapp/buffer-extension-shared,bufferapp/buffer-extension-shared
--- +++ @@ -22,7 +22,7 @@ function setupMessageRelay() { window.addEventListener('message', function(e) { var origin = e.origin || e.originalEvent.origin; - if (origin !== 'https://buffer.com' || e.source !== iframe.contentWindow) { + if ((origin !== 'https://buffer.com' && origin !== 'https://local.buffer.com') || e.source !== iframe.contentWindow) { return; }
390d09f5f35246ab1d7ab95a475457205f92eb68
js/components/developer/worker-profile-screen/index.js
js/components/developer/worker-profile-screen/index.js
import React, { Component } from 'react'; import { Container, Tab, Tabs, Text } from 'native-base'; import WorkerInfoScreen from '../worker-info-screen'; import I18n from '../../../i18n'; // @TODO Replace temporary data with data from Redux/API const NAME = 'John Doe'; export default class WorkerProfileScreen extends Component { static navigationOptions = { title: I18n.t('screen_titles.worker_profile', { name: NAME }), }; // TODO Replace reference placeholder text with reference screen. render() { return ( <Container> <Tabs> <Tab heading={I18n.t('account.profile_info')} > <WorkerInfoScreen /> </Tab> <Tab heading={I18n.t('account.references')}> <Text>References screen goes here</Text> </Tab> </Tabs> </Container> ); } }
import React, { Component } from 'react'; import { Container, Tab, Tabs } from 'native-base'; import WorkerInfoScreen from '../worker-info-screen'; import ReferenceScreen from '../reference-screen'; import I18n from '../../../i18n'; // @TODO Replace temporary data with data from Redux/API const NAME = 'John Doe'; export default class WorkerProfileScreen extends Component { static navigationOptions = { title: I18n.t('screen_titles.worker_profile', { name: NAME }), }; // TODO Replace placeholder data in WorkerInfoScreen and ReferenceScreen render() { return ( <Container> <Tabs> <Tab heading={I18n.t('account.profile_info')} > <WorkerInfoScreen /> </Tab> <Tab heading={I18n.t('account.references')}> <ReferenceScreen /> </Tab> </Tabs> </Container> ); } }
Add ReferenceScreen to references tab in WorkerProfileScreen
Add ReferenceScreen to references tab in WorkerProfileScreen
JavaScript
mit
justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client
--- +++ @@ -1,6 +1,7 @@ import React, { Component } from 'react'; -import { Container, Tab, Tabs, Text } from 'native-base'; +import { Container, Tab, Tabs } from 'native-base'; import WorkerInfoScreen from '../worker-info-screen'; +import ReferenceScreen from '../reference-screen'; import I18n from '../../../i18n'; // @TODO Replace temporary data with data from Redux/API @@ -11,7 +12,7 @@ title: I18n.t('screen_titles.worker_profile', { name: NAME }), }; - // TODO Replace reference placeholder text with reference screen. + // TODO Replace placeholder data in WorkerInfoScreen and ReferenceScreen render() { return ( <Container> @@ -20,7 +21,7 @@ <WorkerInfoScreen /> </Tab> <Tab heading={I18n.t('account.references')}> - <Text>References screen goes here</Text> + <ReferenceScreen /> </Tab> </Tabs> </Container>
b49c5f252d8eb3dd8e2803b3b1ebf3b3a107d740
source/demyo-vue-frontend/src/services/publisher-service.js
source/demyo-vue-frontend/src/services/publisher-service.js
import AbstractModelService from './abstract-model-service' import { axiosGet } from '@/helpers/axios' /** * API service for Publishers. */ class PublisherService extends AbstractModelService { constructor() { super('publishers/', { fillMissingObjects: ['logo'], sanitizeHtml: ['history'] }) } /** * Finds how many Albums use the given Publisher. * @param {Number} id The Publisher ID */ countAlbums(id) { return axiosGet(`publishers/${id}/albums/count`, 0) } } export default new PublisherService()
import AbstractModelService from './abstract-model-service' import { axiosGet } from '@/helpers/axios' /** * API service for Publishers. */ class PublisherService extends AbstractModelService { constructor() { super('publishers/', { fillMissingObjects: ['logo'], sanitizeHtml: ['history'] }) } /** * Finds the Collections belonging to a Publisher. * @param {Number} publisherId The Publisher ID */ findCollectionsForList(publisherId) { return axiosGet(`${this.basePath}${publisherId}/collections`, []) } /** * Finds how many Albums use the given Publisher. * @param {Number} id The Publisher ID */ countAlbums(id) { return axiosGet(`publishers/${id}/albums/count`, 0) } } export default new PublisherService()
Create a method to search for a Publisher's Collections.
Create a method to search for a Publisher's Collections. To be used in AlbumEdit. Refs #78.
JavaScript
agpl-3.0
The4thLaw/demyo,The4thLaw/demyo,The4thLaw/demyo,The4thLaw/demyo
--- +++ @@ -13,6 +13,14 @@ } /** + * Finds the Collections belonging to a Publisher. + * @param {Number} publisherId The Publisher ID + */ + findCollectionsForList(publisherId) { + return axiosGet(`${this.basePath}${publisherId}/collections`, []) + } + + /** * Finds how many Albums use the given Publisher. * @param {Number} id The Publisher ID */
fa1209db9af0166901f278452dc9b8c1d1d1fa5c
lib/autoload/hooks/responder/etag_304_revalidate.js
lib/autoload/hooks/responder/etag_304_revalidate.js
// Add Etag header to each http and rpc response // 'use strict'; const crypto = require('crypto'); module.exports = function (N) { N.wire.after([ 'responder:http', 'responder:rpc' ], { priority: 95 }, function etag_304_revalidate(env) { if (env.status !== 200) return; if (!env.body || typeof env.body !== 'string') return; if (env.headers['ETag'] || env.headers['Cache-Control']) return; let etag = '"' + crypto.createHash('sha1').update(env.body).digest('base64').substring(0, 27) + '"'; env.headers['ETag'] = etag; env.headers['Cache-Control'] = 'must-revalidate'; if (etag === env.origin.req.headers['if-none-match']) { env.status = N.io.NOT_MODIFIED; env.body = null; } }); };
// Add Etags, 304 responses, and force revalidate for each request // // - Should help with nasty cases, when quick page open use old // assets and show errors until Ctrl+F5 // - Still good enougth for user, because 304 responses supported // 'use strict'; const crypto = require('crypto'); module.exports = function (N) { N.wire.after([ 'responder:http', 'responder:rpc' ], { priority: 95 }, function etag_304_revalidate(env) { // Quick check if we can intrude if (env.status !== 200) return; if (!env.body) return; if (typeof env.body !== 'string' && !Buffer.isBuffer(env.body)) return; if (env.headers['ETag'] || env.headers['Cache-Control']) return; // Fill Etag/Cache-Control headers let etag = '"' + crypto.createHash('sha1').update(env.body).digest('base64').substring(0, 27) + '"'; env.headers['ETag'] = etag; env.headers['Cache-Control'] = 'max-age=0, must-revalidate'; // Replace responce status if possible if (etag === env.origin.req.headers['if-none-match']) { env.status = N.io.NOT_MODIFIED; env.body = null; } }); };
Improve cache headers and add comments
Improve cache headers and add comments
JavaScript
mit
nodeca/nodeca.core,nodeca/nodeca.core
--- +++ @@ -1,6 +1,9 @@ -// Add Etag header to each http and rpc response +// Add Etags, 304 responses, and force revalidate for each request // - +// - Should help with nasty cases, when quick page open use old +// assets and show errors until Ctrl+F5 +// - Still good enougth for user, because 304 responses supported +// 'use strict'; const crypto = require('crypto'); @@ -8,15 +11,20 @@ module.exports = function (N) { N.wire.after([ 'responder:http', 'responder:rpc' ], { priority: 95 }, function etag_304_revalidate(env) { + + // Quick check if we can intrude if (env.status !== 200) return; - if (!env.body || typeof env.body !== 'string') return; + if (!env.body) return; + if (typeof env.body !== 'string' && !Buffer.isBuffer(env.body)) return; if (env.headers['ETag'] || env.headers['Cache-Control']) return; + // Fill Etag/Cache-Control headers let etag = '"' + crypto.createHash('sha1').update(env.body).digest('base64').substring(0, 27) + '"'; env.headers['ETag'] = etag; - env.headers['Cache-Control'] = 'must-revalidate'; + env.headers['Cache-Control'] = 'max-age=0, must-revalidate'; + // Replace responce status if possible if (etag === env.origin.req.headers['if-none-match']) { env.status = N.io.NOT_MODIFIED; env.body = null;
ee58f2e977c884202d357a8ee5acfd567214da4f
src/app/containers/menu/Menu.js
src/app/containers/menu/Menu.js
import './Menu.css'; import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import { closeMenu } from 'shared/state/app/actions'; import shallowCompare from 'react-addons-shallow-compare'; class Menu extends Component { constructor(props) { super(props); this._handleOutsideClick = this._handleOutsideClick.bind(this); } componentDidMount() { document.body.addEventListener('click', this._handleOutsideClick); } shouldComponentUpdate(nextProps, nextState) { return shallowCompare(this, nextProps, nextState); } componentWillUnmount() { document.body.removeEventListener('click', this._handleOutsideClick); } render() { return ( <div className={ `menu-component ${this.props.isOpen ? 'is-open' : ''}` } ref={ (ref) => { this._el = ref; } }> </div> ); } _handleOutsideClick(e) { !this._el.contains(e.target) && this.props.dispatch(closeMenu()); } } Menu.propTypes = { isOpen: PropTypes.bool.isRequired, dispatch: PropTypes.func.isRequired, }; export default connect((state) => ({ isOpen: state.app.isMenuOpen, }))(Menu);
import './Menu.css'; import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import { closeMenu } from 'shared/state/app/actions'; import shallowCompare from 'react-addons-shallow-compare'; class Menu extends Component { constructor(props) { super(props); this._handleOutsideClickOrTap = this._handleOutsideClickOrTap.bind(this); } componentDidMount() { document.body.addEventListener('click', this._handleOutsideClickOrTap); document.body.addEventListener('touchend', this._handleOutsideClickOrTap); } shouldComponentUpdate(nextProps, nextState) { return shallowCompare(this, nextProps, nextState); } componentWillUnmount() { document.body.removeEventListener('click', this._handleOutsideClickOrTap); document.body.removeEventListener('touchend', this._handleOutsideClickOrTap); } render() { return ( <div className={ `menu-component ${this.props.isOpen ? 'is-open' : ''}` } ref={ (ref) => { this._el = ref; } }> </div> ); } _handleOutsideClickOrTap(e) { if (this.props.isOpen && !this._el.contains(e.target)) { this.props.dispatch(closeMenu()); } } } Menu.propTypes = { isOpen: PropTypes.bool.isRequired, dispatch: PropTypes.func.isRequired, }; export default connect((state) => ({ isOpen: state.app.isMenuOpen, }))(Menu);
Handle taps to close the menu.
Handle taps to close the menu.
JavaScript
mit
npms-io/npms-www,npms-io/npms-www
--- +++ @@ -7,11 +7,12 @@ class Menu extends Component { constructor(props) { super(props); - this._handleOutsideClick = this._handleOutsideClick.bind(this); + this._handleOutsideClickOrTap = this._handleOutsideClickOrTap.bind(this); } componentDidMount() { - document.body.addEventListener('click', this._handleOutsideClick); + document.body.addEventListener('click', this._handleOutsideClickOrTap); + document.body.addEventListener('touchend', this._handleOutsideClickOrTap); } shouldComponentUpdate(nextProps, nextState) { @@ -19,7 +20,8 @@ } componentWillUnmount() { - document.body.removeEventListener('click', this._handleOutsideClick); + document.body.removeEventListener('click', this._handleOutsideClickOrTap); + document.body.removeEventListener('touchend', this._handleOutsideClickOrTap); } render() { @@ -31,8 +33,10 @@ ); } - _handleOutsideClick(e) { - !this._el.contains(e.target) && this.props.dispatch(closeMenu()); + _handleOutsideClickOrTap(e) { + if (this.props.isOpen && !this._el.contains(e.target)) { + this.props.dispatch(closeMenu()); + } } }
80e16145089eccd6841a8ad05888d28360ad3833
build/serve.js
build/serve.js
import browserSync from 'browser-sync'; import paths from '../mconfig.json'; export const server = browserSync.create(); function serve(done) { server.init({ notify: false, proxy: paths.url, host: paths.url, open: 'external' }); done(); } export default serve;
import browserSync from 'browser-sync'; import paths from '../mconfig.json'; export const server = browserSync.create(); function serve(done) { server.init({ notify: false, proxy: paths.url, host: paths.url, open: false, ghostMode: false }); done(); } export default serve;
Remove browser-sync new window & ghostMode
Remove browser-sync new window & ghostMode
JavaScript
mit
locomotivemtl/locomotive-boilerplate,locomotivemtl/locomotive-boilerplate,stephenbe/locomotive-boilerplate,stephenbe/locomotive-boilerplate,stephenbe/locomotive-boilerplate
--- +++ @@ -8,7 +8,8 @@ notify: false, proxy: paths.url, host: paths.url, - open: 'external' + open: false, + ghostMode: false }); done(); }
cd09645cc7d1abd1f4b5993b89cc3048ad65447c
src/createAppTemplate.js
src/createAppTemplate.js
const createAppTemplate = (app, template) => { const hadClassName = !!app.className; const quenchedClassName = `${app.className} quenched`.replace(/\bpre-quench\b/g, ''); let html = app.outerHTML .replace(/<!--\s*<q>\s*-->[\s\S]*?<!--\s*<\/q>\s*-->/g, '') .replace(/<!--\s*q-binding:.*?-->/g, '') .replace(/\sq-binding=".*?\s+as\s+/g, ' q-binding="') .replace(/q-binding="/g, 'v-text="') .replace(/(\sv-(text|html).*?>)[\s\S]*?<\//g, '$1</') .replace(/(?:<!--\s*)?<q-template><\/q-template>(\s*-->)?/, template || ''); if (hadClassName) { html = html.replace(/(class=")[\s\S]*?"/, `$1${quenchedClassName}"`); } else { html = html.replace(/(<.*?\s)/, `$1class="${quenchedClassName}"`); } return html; }; export default createAppTemplate;
const createAppTemplate = (app, template) => { const quenchedClassName = `${app.className} quenched`.replace(/\bpre-quench\b/g, ''); const html = app.outerHTML .replace(/<!--\s*<q>\s*-->[\s\S]*?<!--\s*<\/q>\s*-->/g, '') .replace(/<!--\s*q-binding:.*?-->/g, '') .replace(/\sq-binding=".*?\s+as\s+/g, ' q-binding="') .replace(/q-binding="/g, 'v-text="') .replace(/(\sv-(text|html).*?>)[\s\S]*?<\//g, '$1</') .replace(/(?:<!--\s*)?<q-template><\/q-template>(\s*-->)?/, template || ''); if (app.hasAttribute('class')) { return html.replace(/(class=")[\s\S]*?"/, `$1${quenchedClassName}"`); } return html.replace(/(<.*?\s)/, `$1class="${quenchedClassName}"`); }; export default createAppTemplate;
Fix apps with empty class attributes
Fix apps with empty class attributes
JavaScript
mit
stowball/quench-vue
--- +++ @@ -1,8 +1,6 @@ const createAppTemplate = (app, template) => { - const hadClassName = !!app.className; const quenchedClassName = `${app.className} quenched`.replace(/\bpre-quench\b/g, ''); - - let html = app.outerHTML + const html = app.outerHTML .replace(/<!--\s*<q>\s*-->[\s\S]*?<!--\s*<\/q>\s*-->/g, '') .replace(/<!--\s*q-binding:.*?-->/g, '') .replace(/\sq-binding=".*?\s+as\s+/g, ' q-binding="') @@ -10,14 +8,11 @@ .replace(/(\sv-(text|html).*?>)[\s\S]*?<\//g, '$1</') .replace(/(?:<!--\s*)?<q-template><\/q-template>(\s*-->)?/, template || ''); - if (hadClassName) { - html = html.replace(/(class=")[\s\S]*?"/, `$1${quenchedClassName}"`); - } - else { - html = html.replace(/(<.*?\s)/, `$1class="${quenchedClassName}"`); + if (app.hasAttribute('class')) { + return html.replace(/(class=")[\s\S]*?"/, `$1${quenchedClassName}"`); } - return html; + return html.replace(/(<.*?\s)/, `$1class="${quenchedClassName}"`); }; export default createAppTemplate;
a64bee572690ce186fda28a0cd98f16d5dcf9aa5
src/lib/number_to_human.js
src/lib/number_to_human.js
const billion = 1000000000.0 const million = 1000000.0 const thousand = 1000.0 export function numberToHuman(number, showZero = true) { if (number === 0 && !showZero) { return '' } let num let suffix if (number >= billion) { num = Math.round((number / billion) * 100.0) / 100.0 suffix = 'B' } else if (number >= million) { num = Math.round((number / million) * 100.0) / 100.0 suffix = 'M' } else if (number >= thousand) { num = Math.round((number / thousand) * 100.0) / 100.0 suffix = 'K' } else { num = Math.round(number * 100.0) / 100.0 suffix = '' } let strNum = `${num}` const strArr = strNum.split('.') if (strArr[strArr.length - 1] === '0') { strNum = strArr[0] } return `${strNum}${suffix}` } export default numberToHuman
const billion = 1000000000.0 const million = 1000000.0 const thousand = 1000.0 export function numberToHuman(number, showZero = true, precision = 1) { if (number === 0 && !showZero) { return '' } const roundingFactor = 10 ** precision let num let suffix if (number >= billion) { num = Math.round((number / billion) * roundingFactor) / roundingFactor suffix = 'B' } else if (number >= million) { num = Math.round((number / million) * roundingFactor) / roundingFactor suffix = 'M' } else if (number >= thousand) { num = Math.round((number / thousand) * roundingFactor) / roundingFactor suffix = 'K' } else { num = Math.round(number * roundingFactor) / roundingFactor suffix = '' } let strNum = `${num}` const strArr = strNum.split('.') if (strArr[strArr.length - 1] === '0') { strNum = strArr[0] } return `${strNum}${suffix}` } export default numberToHuman
Change the rounding precision to one decimal point
Change the rounding precision to one decimal point
JavaScript
mit
ello/webapp,ello/webapp,ello/webapp
--- +++ @@ -2,21 +2,22 @@ const million = 1000000.0 const thousand = 1000.0 -export function numberToHuman(number, showZero = true) { +export function numberToHuman(number, showZero = true, precision = 1) { if (number === 0 && !showZero) { return '' } + const roundingFactor = 10 ** precision let num let suffix if (number >= billion) { - num = Math.round((number / billion) * 100.0) / 100.0 + num = Math.round((number / billion) * roundingFactor) / roundingFactor suffix = 'B' } else if (number >= million) { - num = Math.round((number / million) * 100.0) / 100.0 + num = Math.round((number / million) * roundingFactor) / roundingFactor suffix = 'M' } else if (number >= thousand) { - num = Math.round((number / thousand) * 100.0) / 100.0 + num = Math.round((number / thousand) * roundingFactor) / roundingFactor suffix = 'K' } else { - num = Math.round(number * 100.0) / 100.0 + num = Math.round(number * roundingFactor) / roundingFactor suffix = '' } let strNum = `${num}`
c57b1eab1ed849c7d197396e64ef04dcd897af2d
index.js
index.js
module.exports = { "env": { "browser": true }, "extends": [ "airbnb", // These prettier configs are used to disable inherited rules that conflict // with the way prettier will format code. Full info here: // https://github.com/prettier/eslint-config-prettier "prettier", "prettier/flowtype", "prettier/react" ], "parser": "babel-eslint", "plugins": [ "flowtype", "import", "react", "prettier" ], "rules": { "flowtype/define-flow-type": "error", "flowtype/require-valid-file-annotation": [ 2, "always" ], "flowtype/type-id-match": [ "error", "^([A-Z][a-z0-9]+)+$" ], "flowtype/use-flow-type": "error", "import/no-duplicates": "error", "no-duplicate-imports": "off", "no-nested-ternary": "off", "no-warning-comments": [ "error", { "terms": [ "fixme" ] } ], "react/no-unused-prop-types": "off", "prettier/prettier": [ "error", { // Options to pass to prettier: https://github.com/prettier/prettier#api "singleQuote": true, "trailingComma": "all" }, "@prettier" ] } };
module.exports = { "env": { "browser": true }, "extends": [ "airbnb", // These prettier configs are used to disable inherited rules that conflict // with the way prettier will format code. Full info here: // https://github.com/prettier/eslint-config-prettier "prettier", "prettier/flowtype", "prettier/react" ], "parser": "babel-eslint", "plugins": [ "flowtype", "import", "react", "prettier" ], "rules": { "flowtype/define-flow-type": "error", "flowtype/require-valid-file-annotation": [ 2, "always" ], "flowtype/type-id-match": [ "error", "^([A-Z][a-z0-9]+)+$" ], "flowtype/use-flow-type": "error", "import/no-duplicates": "error", "import/no-extraneous-dependencies": [ "error", { "devDependencies": ["**/test.jsx", "**/demo.jsx", "**/*.demo.jsx", "**/demo/*.jsx"] } ], "no-duplicate-imports": "off", "no-nested-ternary": "off", "no-warning-comments": [ "error", { "terms": [ "fixme" ] } ], "react/no-unused-prop-types": "off", "prettier/prettier": [ "error", { // Options to pass to prettier: https://github.com/prettier/prettier#api "singleQuote": true, "trailingComma": "all" }, "@prettier" ] } };
Allow devDependencies in demos and tests
Allow devDependencies in demos and tests
JavaScript
mit
mathspace/eslint-config-mathspace
--- +++ @@ -30,6 +30,10 @@ ], "flowtype/use-flow-type": "error", "import/no-duplicates": "error", + "import/no-extraneous-dependencies": [ + "error", + { "devDependencies": ["**/test.jsx", "**/demo.jsx", "**/*.demo.jsx", "**/demo/*.jsx"] } + ], "no-duplicate-imports": "off", "no-nested-ternary": "off", "no-warning-comments": [
bd36bfa8bb390a873ecfebbb7fe380a342f54de7
index.js
index.js
function handleVueDestruction(vue) { document.addEventListener('turbolinks:before-render', function teardown() { vue.$destroy(); document.removeEventListener('turbolinks:before-render', teardown); }); } var TurbolinksAdapter = { beforeMount: function() { if (this.$el.parentNode) { handleVueDestruction(this); this.$originalEl = this.$el.outerHTML; } }, destroyed: function() { this.$el.outerHTML = this.$originalEl; } }; export default TurbolinksAdapter;
function handleVueDestruction(vue) { document.addEventListener('turbolinks:visit', function teardown() { vue.$destroy(); document.removeEventListener('turbolinks:visit', teardown); }); } var TurbolinksAdapter = { beforeMount: function() { if (this.$el.parentNode) { handleVueDestruction(this); this.$originalEl = this.$el.outerHTML; } }, destroyed: function() { this.$el.outerHTML = this.$originalEl; } }; export default TurbolinksAdapter;
Use turbolinks:visit event to handle teardowns, works whether caching is enabled or not
Use turbolinks:visit event to handle teardowns, works whether caching is enabled or not
JavaScript
mit
jeffreyguenther/vue-turbolinks
--- +++ @@ -1,7 +1,7 @@ function handleVueDestruction(vue) { - document.addEventListener('turbolinks:before-render', function teardown() { + document.addEventListener('turbolinks:visit', function teardown() { vue.$destroy(); - document.removeEventListener('turbolinks:before-render', teardown); + document.removeEventListener('turbolinks:visit', teardown); }); }
270252a65be4e6377ff3a8f1515c2432b101e60f
app/scripts/helpers.js
app/scripts/helpers.js
define(function() { 'use strict'; /** * @param {string} str * @return {string} */ var capitalize = function(str) { return str.substr(0, 1).toUpperCase() + str.substr(1); }; return { capitalize }; });
define(function() { 'use strict'; /** * @param {string} str * @return {string} */ let capitalize = function(str) { return str.substr(0, 1).toUpperCase() + str.substr(1); }; return { capitalize }; });
Use `let` instead of `var`
Use `let` instead of `var`
JavaScript
mit
loonkwil/reversi,loonkwil/reversi
--- +++ @@ -5,7 +5,7 @@ * @param {string} str * @return {string} */ - var capitalize = function(str) { + let capitalize = function(str) { return str.substr(0, 1).toUpperCase() + str.substr(1); };
766e9a47d10710ed5649a21f0891919bb96399b2
src/components/Message/Embed.js
src/components/Message/Embed.js
// @flow import type { MessageThemeContext } from './types' import React, { PureComponent } from 'react' import styled from '../styled' import Chat from './Chat' import classNames from '../../utilities/classNames' import css from './styles/Embed.css.js' type Props = { className?: string, html: string, } type Context = MessageThemeContext class Embed extends PureComponent<Props, Context> { static displayName = 'Message.Embed' render() { const { className, html, ...rest } = this.props const { theme } = this.context const componentClassName = classNames( 'c-MessageEmbed', theme && `is-theme-${theme}`, className ) return ( <Chat {...rest} bubbleClassName="c-MessageEmbed__bubble" className={componentClassName} > <div dangerouslySetInnerHTML={{ __html: html }} className="c-MessageEmbed__html" /> </Chat> ) } } export default styled(Embed)(css)
// @flow import type { MessageThemeContext } from './types' import React, { PureComponent } from 'react' import styled from '../styled' import Chat from './Chat' import classNames from '../../utilities/classNames' import css from './styles/Embed.css.js' type Props = { className?: string, html: string, } type Context = MessageThemeContext class Embed extends PureComponent<Props, Context> { static displayName = 'Message.Embed' render() { const { className, html, ...rest } = this.props const { theme } = this.context const componentClassName = classNames( 'c-MessageEmbed', /* istanbul ignore next */ // Tested, but Istanbul isn't picking it up. theme && `is-theme-${theme}`, className ) return ( <Chat {...rest} bubbleClassName="c-MessageEmbed__bubble" className={componentClassName} > <div dangerouslySetInnerHTML={{ __html: html }} className="c-MessageEmbed__html" /> </Chat> ) } } export default styled(Embed)(css)
Add istanbul ignore. Line is tested.
Add istanbul ignore. Line is tested. Istanbul isn't picking it up.
JavaScript
mit
helpscout/blue,helpscout/blue,helpscout/blue
--- +++ @@ -22,6 +22,8 @@ const componentClassName = classNames( 'c-MessageEmbed', + /* istanbul ignore next */ + // Tested, but Istanbul isn't picking it up. theme && `is-theme-${theme}`, className )
df76de82feaa17e92979ccd28f3a74d8e59a4f1d
src/scripts/lib/server/utils/server-config/index.js
src/scripts/lib/server/utils/server-config/index.js
const Configstore = require('configstore') const inq = require('inquirer') const prompts = require('./setup-prompts') module.exports = class ServerConfig { constructor(defaults) { this.db = new Configstore('wowser', defaults) } initSetup() { return new Promise((resolve, reject) => { console.log('> Preparing initial setup\n'); this.db.set('isFirstRun', false); inq.prompt(prompts, answers => { Object.keys(answers).map(key => { return this.db.set(key, answers[key]); }); resolve('\n> Setup finished!\n'); }); }) } }
const Configstore = require('configstore') const inq = require('inquirer') const pkg = require('../../../../package.json') const prompts = require('./setup-prompts') module.exports = class ServerConfig { constructor(defaults) { this.db = new Configstore(pkg.name, defaults) } initSetup() { return new Promise((resolve, reject) => { console.log('> Preparing initial setup\n'); this.db.set('isFirstRun', false); inq.prompt(prompts, answers => { Object.keys(answers).map(key => { return this.db.set(key, answers[key]); }); resolve('\n> Setup finished!\n'); }); }) } }
Use package name from package.json as a configstore id
Use package name from package.json as a configstore id
JavaScript
mit
wowserhq/wowser,timkurvers/wowser,eoy/wowser,wowserhq/wowser,eoy/wowser,timkurvers/wowser
--- +++ @@ -1,11 +1,12 @@ const Configstore = require('configstore') const inq = require('inquirer') +const pkg = require('../../../../package.json') const prompts = require('./setup-prompts') module.exports = class ServerConfig { constructor(defaults) { - this.db = new Configstore('wowser', defaults) + this.db = new Configstore(pkg.name, defaults) } initSetup() {
b7803e394d2bd4047e5d8fd7990a196bb06e5643
src/content.js
src/content.js
var content = (function() { return { normalizeTags: function(element) { var i, j, node, sibling; var fragment = document.createDocumentFragment(); for (i = 0; i < element.childNodes.length; i++) { node = element.childNodes[i]; if(!node) continue; // skip empty tags, so they'll get removed if(node.nodeName !== 'BR' && !node.textContent) continue; if(node.nodeType === 1 && node.nodeName !== 'BR') { sibling = node; while((sibling = sibling.nextSibling) !== null) { if(!parser.isSameNode(sibling, node)) break; for(j = 0; j < sibling.childNodes.length; j++) { node.appendChild(sibling.childNodes[j].cloneNode(true)); } sibling.parentNode.removeChild(sibling); } this.normalizeTags(node); } fragment.appendChild(node.cloneNode(true)); } while (element.firstChild) { element.removeChild(element.firstChild); } element.appendChild(fragment); }, cleanInternals: function(element) { element.innerHTML = element.innerHTML.replace(/\u200B/g, '<br />'); }, normalizeSpaces: function(element) { var firstChild = element.firstChild; if(!firstChild) return; if(firstChild.nodeType === 3) { firstChild.nodeValue = firstChild.nodeValue.replace(/^(\s)/, '\u00A0'); } else { this.normalizeSpaces(firstChild); } } }; })();
var content = (function() { return { normalizeTags: function(element) { var i, j, node, sibling; var fragment = document.createDocumentFragment(); for (i = 0; i < element.childNodes.length; i++) { node = element.childNodes[i]; if(!node) continue; // skip empty tags, so they'll get removed if(node.nodeName !== 'BR' && !node.textContent) continue; if(node.nodeType === 1 && node.nodeName !== 'BR') { sibling = node; while((sibling = sibling.nextSibling) !== null) { if(!parser.isSameNode(sibling, node)) break; for(j = 0; j < sibling.childNodes.length; j++) { node.appendChild(sibling.childNodes[j].cloneNode(true)); } sibling.parentNode.removeChild(sibling); } this.normalizeTags(node); } fragment.appendChild(node.cloneNode(true)); } while (element.firstChild) { element.removeChild(element.firstChild); } element.appendChild(fragment); }, cleanInternals: function(element) { element.innerHTML = element.innerHTML.replace(/\u200B/g, '<br />'); }, normalizeSpaces: function(element) { if(!element) return; if(element.nodeType === 3) { element.nodeValue = element.nodeValue.replace(/^(\s)/, '\u00A0').replace(/(\s)$/, '\u00A0'); } else { this.normalizeSpaces(element.firstChild); this.normalizeSpaces(element.lastChild); } } }; })();
Normalize trailing spaces as well
Normalize trailing spaces as well This doesn't remove spaces at the end, it just converts the last one to make it visible. I think the strategy of not having spaces at all in the end should go in a config option and shouldn't be a task of normalizeSpaces. Conflicts: src/content.js
JavaScript
mit
nickbalestra/editable.js,upfrontIO/editable.js
--- +++ @@ -42,15 +42,14 @@ }, normalizeSpaces: function(element) { - var firstChild = element.firstChild; + if(!element) return; - if(!firstChild) return; - - if(firstChild.nodeType === 3) { - firstChild.nodeValue = firstChild.nodeValue.replace(/^(\s)/, '\u00A0'); + if(element.nodeType === 3) { + element.nodeValue = element.nodeValue.replace(/^(\s)/, '\u00A0').replace(/(\s)$/, '\u00A0'); } else { - this.normalizeSpaces(firstChild); + this.normalizeSpaces(element.firstChild); + this.normalizeSpaces(element.lastChild); } } };
56c9ee0611428ec8db267d293d93d63f11b8021a
src/helpers/find-root.js
src/helpers/find-root.js
'use babel' import Path from 'path' import {getDir, findFile} from './common' import {CONFIG_FILE_NAME} from '../defaults' export function findRoot(path, options) { if (options.root !== null) { return options.root } const searchPath = getDir(path.indexOf('*') === -1 ? path : options.cwd) const configFile = findFile(searchPath, CONFIG_FILE_NAME) if (configFile === null) { return searchPath } else { return Path.dirname(configFile) } }
'use babel' import Path from 'path' import {getDir, findFile} from './common' import {CONFIG_FILE_NAME} from '../defaults' import isGlob from 'is-glob' export function findRoot(path, options) { if (options.root !== null) { return options.root } const searchPath = getDir(isGlob(path) ? options.cwd : path) const configFile = findFile(searchPath, CONFIG_FILE_NAME) if (configFile === null) { return searchPath } else { return Path.dirname(configFile) } }
Use is-glob when finding root
:new: Use is-glob when finding root
JavaScript
mit
steelbrain/UCompiler
--- +++ @@ -3,13 +3,14 @@ import Path from 'path' import {getDir, findFile} from './common' import {CONFIG_FILE_NAME} from '../defaults' +import isGlob from 'is-glob' export function findRoot(path, options) { if (options.root !== null) { return options.root } - const searchPath = getDir(path.indexOf('*') === -1 ? path : options.cwd) + const searchPath = getDir(isGlob(path) ? options.cwd : path) const configFile = findFile(searchPath, CONFIG_FILE_NAME) if (configFile === null) {
3ceb8ea7eede62614d665f986d7954cedab71352
src/helpers.js
src/helpers.js
const moment = require('moment-timezone'); const chalk = require('chalk'); exports.printMessage = function (message) { console.log(message); }; exports.printError = function (message) { const errorOutput = chalk`{bgRed Error} ${message}`; console.log(errorOutput); }; exports.convertTimezone = function (time, timezone, callback) { if (moment.tz.zone(timezone)) { const newTime = moment.tz(new Date(time), timezone).format('MMMM D, YYYY HH:mm:ss z'); return callback(null, newTime); } return callback('Unrecognised time zone.'); };
const moment = require('moment-timezone'); const chalk = require('chalk'); exports.printMessage = function (message) { console.log(message); }; exports.printError = function (message) { const errorOutput = chalk`{bgRed Error} ${message}`; console.log(errorOutput); }; exports.isValidTimezone = function (timezone) { return moment.tz.zone(timezone); }; exports.convertTimezone = function (time, timezone, callback) { if (moment.tz.zone(timezone)) { const newTime = moment.tz(new Date(time), timezone).format('MMMM D, YYYY HH:mm:ss z'); return callback(null, newTime); } return callback('Unrecognised time zone.'); };
Add helper with timezone validity info
Add helper with timezone validity info
JavaScript
mit
Belar/space-cli
--- +++ @@ -11,6 +11,10 @@ console.log(errorOutput); }; +exports.isValidTimezone = function (timezone) { + return moment.tz.zone(timezone); +}; + exports.convertTimezone = function (time, timezone, callback) { if (moment.tz.zone(timezone)) { const newTime = moment.tz(new Date(time), timezone).format('MMMM D, YYYY HH:mm:ss z');
3ed922da5e3c2e404f40d7896061553128a3c73b
index.js
index.js
require('./dist/dialogs.js'); require('./dist/dialogs-default-translations.js'); require('./dist/dialogs.css'); module.exports = 'dialogs.main';
require('./dist/dialogs.js'); require('./dist/dialogs-default-translations.js'); module.exports = 'dialogs.main';
Fix problems with importing file
Fix problems with importing file require css file was giving unexpected error
JavaScript
mit
m-e-conroy/angular-dialog-service,m-e-conroy/angular-dialog-service
--- +++ @@ -1,4 +1,3 @@ require('./dist/dialogs.js'); require('./dist/dialogs-default-translations.js'); -require('./dist/dialogs.css'); module.exports = 'dialogs.main';
fa6f27dabf3c50895e9f7a0703e40962b0e1056c
index.js
index.js
module.exports = function (opts={}) { var isJsonFile = opts.filter || /\.json$/; return function (override, transform, control) { transform("readSource", function (source) { const asset = this.args[0]; if (isJsonFile.test(asset.path)) { source = `module.exports = ${source};`; } return source; }); }; };
module.exports = function (opts={}) { var isJsonFile = opts.filter || /\.json$/; return function (override, transform, control) { transform("readSource", function (source, args) { const asset = args[0]; if (isJsonFile.test(asset.path)) { source = `module.exports = ${source};`; } return source; }); }; };
Update transform to accomodate more explicit transform API changes.
Update transform to accomodate more explicit transform API changes.
JavaScript
mit
interlockjs/plugins,interlockjs/plugins
--- +++ @@ -2,8 +2,8 @@ var isJsonFile = opts.filter || /\.json$/; return function (override, transform, control) { - transform("readSource", function (source) { - const asset = this.args[0]; + transform("readSource", function (source, args) { + const asset = args[0]; if (isJsonFile.test(asset.path)) { source = `module.exports = ${source};`; }
0ef56b936013ea773b69581954c64f7eef2b2419
index.js
index.js
var originalDataModule = require('data-module'); var gutil = require('gulp-util'); var through2 = require('through2'); var DataModuleError = gutil.PluginError.bind(null, 'gulp-data-module'); var dataModule = function dataModule (options) { 'use strict'; if (!options) options = {}; var parsing = options.parsing || JSON.parse; var dataModuleOptions = {}; if (typeof options.formatting == 'function') { dataModuleOptions.formatting = options.formatting; } return through2.obj(function dataModuleStream (file, encoding, done) { var source; if (file.isBuffer()) { source = parsing(file.contents.toString()); file.contents = originalDataModule ( source , dataModuleOptions ).toBuffer(); file.path = file.path.replace(/(?:\.[^\/\\\.]$|$)/, '.js'); } else if (file.isStream()) return done(new DataModuleError ( 'Streams not supported' )); this.push(file); return done(); }); }; dataModule.formatting = { diffy: dataModule.diffy }; module.exports = dataModule;
var _dataModule = require('data-module'); var gutil = require('gulp-util'); var stream = require('through2').obj; var DataModuleError = gutil.PluginError.bind(null, 'gulp-data-module'); var dataModule = function dataModule (options) { 'use strict'; if (!options) options = {}; var parsing = options.parsing || JSON.parse; var dataModuleOptions = {}; if (typeof options.formatting == 'function') { dataModuleOptions.formatting = options.formatting; } return stream(function dataModuleStream (file, encoding, done) { var source; if (file.isBuffer()) { source = parsing(file.contents.toString()); file.contents = _dataModule ( source , dataModuleOptions ).toBuffer(); file.path = gutil.replaceExtension('.js'); } else if (file.isStream()) return done(new DataModuleError ( 'Streams not supported' )); this.push(file); return done(); }); }; dataModule.formatting = _dataModule.formatting; module.exports = dataModule;
Update from wherever 0.0.3 came from
Update from wherever 0.0.3 came from
JavaScript
mit
tomekwi/gulp-data-module
--- +++ @@ -1,6 +1,6 @@ -var originalDataModule = require('data-module'); +var _dataModule = require('data-module'); var gutil = require('gulp-util'); -var through2 = require('through2'); +var stream = require('through2').obj; var DataModuleError = gutil.PluginError.bind(null, 'gulp-data-module'); @@ -14,17 +14,17 @@ dataModuleOptions.formatting = options.formatting; } - return through2.obj(function dataModuleStream (file, encoding, done) { + return stream(function dataModuleStream (file, encoding, done) { var source; if (file.isBuffer()) { source = parsing(file.contents.toString()); - file.contents = originalDataModule + file.contents = _dataModule ( source , dataModuleOptions ).toBuffer(); - file.path = file.path.replace(/(?:\.[^\/\\\.]$|$)/, '.js'); + file.path = gutil.replaceExtension('.js'); } else if (file.isStream()) return done(new DataModuleError @@ -37,8 +37,7 @@ }; -dataModule.formatting = - { diffy: dataModule.diffy - }; +dataModule.formatting = _dataModule.formatting; + module.exports = dataModule;
5445265dda092ef114c92a414e7d3692cf062bc2
index.js
index.js
/* jshint node: true */ 'use strict'; const REFLECT_JS_VERSION = '0.1.59', REFLECT_JAVASCRIPT = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION +'/reflect.js', REFLECT_CSS = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION + '/reflect.css'; const HEAD = '<script src="' + REFLECT_JAVASCRIPT + '" type="text/javascript"></script> \ <link rel="stylesheet" href="' + REFLECT_CSS + '">'; module.exports = { name: 'ember-cli-reflect', contentFor: function(type) { if (type === 'head') { return HEAD }; } };
/* jshint node: true */ 'use strict'; const REFLECT_JS_VERSION = '0.1.59', REFLECT_JAVASCRIPT = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION +'/reflect.js'; const getHead = function(config) { let cssSource; if (config.reflect && config.reflect.css) { cssSource = config.reflect.css; } else { cssSource = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION + '/reflect.css'; } return '<script src="' + REFLECT_JAVASCRIPT + '" type="text/javascript"></script> \ <link rel="stylesheet" href="' + cssSource + '">'; }; module.exports = { name: 'ember-cli-reflect', contentFor: function(type) { if (type === 'head') { let config = this.config(); return getHead(config); }; } };
Allow user to define their own css source
Allow user to define their own css source
JavaScript
mit
reflect/ember-cli-reflect,reflect/ember-cli-reflect
--- +++ @@ -2,15 +2,28 @@ 'use strict'; const REFLECT_JS_VERSION = '0.1.59', - REFLECT_JAVASCRIPT = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION +'/reflect.js', - REFLECT_CSS = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION + '/reflect.css'; + REFLECT_JAVASCRIPT = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION +'/reflect.js'; -const HEAD = '<script src="' + REFLECT_JAVASCRIPT + '" type="text/javascript"></script> \ -<link rel="stylesheet" href="' + REFLECT_CSS + '">'; +const getHead = function(config) { + let cssSource; + + if (config.reflect && config.reflect.css) { + cssSource = config.reflect.css; + } else { + cssSource = 'https://cdn.reflect.io/' + REFLECT_JS_VERSION + '/reflect.css'; + } + + return '<script src="' + REFLECT_JAVASCRIPT + '" type="text/javascript"></script> \ +<link rel="stylesheet" href="' + cssSource + '">'; +}; module.exports = { name: 'ember-cli-reflect', contentFor: function(type) { - if (type === 'head') { return HEAD }; + if (type === 'head') { + let config = this.config(); + + return getHead(config); + }; } };
81e0be8d31feb28a7d13ab64542f7537fea93c76
index.js
index.js
'use strict' const app = require('app') const BrowserWindow = require('browser-window') const Menu = require('menu') const menuTemplate = require('./menu-template.js') require('electron-debug')() let mainWindow = null function onClosed () { mainWindow = null } function createMainWindow () { const win = new BrowserWindow({ width: 920, height: 620, center: true, 'standard-window': false, frame: false, title: 'Blox Party' }) win.loadUrl('file://' + __dirname + '/index.html') win.on('closed', onClosed) return win } app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit() }) app.on('activate-with-no-open-windows', () => { if (!mainWindow) mainWindow = createMainWindow() }) app.on('ready', () => { // Build menu only for OSX if (Menu.sendActionToFirstResponder) { Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate)) } mainWindow = createMainWindow() })
'use strict' const app = require('app') const BrowserWindow = require('browser-window') const ipc = require('ipc') const Menu = require('menu') const menuTemplate = require('./menu-template.js') require('electron-debug')() let mainWindow = null function onClosed () { mainWindow = null } function createMainWindow () { const win = new BrowserWindow({ width: 920, height: 620, center: true, 'standard-window': false, frame: false, title: 'Blox Party' }) win.loadUrl('file://' + __dirname + '/index.html') win.on('closed', onClosed) return win } ipc.on('quit', function () { app.quit() }) app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit() }) app.on('activate-with-no-open-windows', () => { if (!mainWindow) mainWindow = createMainWindow() }) app.on('ready', () => { // Build menu only for OSX if (Menu.sendActionToFirstResponder) { Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate)) } mainWindow = createMainWindow() })
Use ipc module. Check for existence of Electron.
Use ipc module. Check for existence of Electron.
JavaScript
mit
bloxparty/bloxparty,kvnneff/bloxparty,bloxparty/bloxparty,kvnneff/bloxparty
--- +++ @@ -1,6 +1,7 @@ 'use strict' const app = require('app') const BrowserWindow = require('browser-window') +const ipc = require('ipc') const Menu = require('menu') const menuTemplate = require('./menu-template.js') @@ -26,6 +27,10 @@ return win } +ipc.on('quit', function () { + app.quit() +}) + app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit() })
91a10fccd6bcf455723fe0c4722a97dd17e19ddc
index.js
index.js
'use strict'; var platform = require('enyo/platform'), dispatcher = require('enyo/dispatcher'), gesture = require('enyo/gesture'); exports = module.exports = require('./lib/options'); exports.version = '2.6.0-pre'; // Override the default holdpulse config to account for greater delays between keydown and keyup // events in Moonstone with certain input devices. gesture.drag.configureHoldPulse({ frequency: 200, events: [{name: 'hold', time: 400}], resume: false, moveTolerance: 16, endHold: 'onMove' }); /** * Registers key mappings for webOS-specific device keys related to media control. * * @private */ if (platform.webos >= 4) { // Table of default keyCode mappings for webOS device dispatcher.registerKeyMap({ 415 : 'play', 413 : 'stop', 19 : 'pause', 412 : 'rewind', 417 : 'fastforward', 461 : 'back' }); } // ensure that these are registered require('./lib/resolution'); require('./lib/fonts');
'use strict'; var platform = require('enyo/platform'), dispatcher = require('enyo/dispatcher'), gesture = require('enyo/gesture'); exports = module.exports = require('./lib/options'); exports.version = '2.6.0-pre'; // Override the default holdpulse config to account for greater delays between keydown and keyup // events in Moonstone with certain input devices. gesture.drag.configureHoldPulse({ frequency: 200, events: [{name: 'hold', time: 400}], resume: false, moveTolerance: 1500, endHold: 'onMove' }); /** * Registers key mappings for webOS-specific device keys related to media control. * * @private */ if (platform.webos >= 4) { // Table of default keyCode mappings for webOS device dispatcher.registerKeyMap({ 415 : 'play', 413 : 'stop', 19 : 'pause', 412 : 'rewind', 417 : 'fastforward', 461 : 'back' }); } // ensure that these are registered require('./lib/resolution'); require('./lib/fonts');
Increase moveTolerance value from 16 to 1500 on configureHoldPulse
ENYO-1648: Increase moveTolerance value from 16 to 1500 on configureHoldPulse Issue: - The onHoldPulse event is canceled too early when user move mouse abound. Fix: - We need higher moveTolerance value to make it stay pulse more on TV. - Increase moveTolerance value from 16 to 1500 on configureHoldPulse by testing. DCO-1.1-Signed-Off-By: Kunmyon Choi kunmyon.choi@lge.com
JavaScript
apache-2.0
enyojs/moonstone
--- +++ @@ -14,7 +14,7 @@ frequency: 200, events: [{name: 'hold', time: 400}], resume: false, - moveTolerance: 16, + moveTolerance: 1500, endHold: 'onMove' });
81ae02b295ea2dabdc94c81c0aa5afcc8aa9b9b0
public/app/project-list/project-featured-controller.js
public/app/project-list/project-featured-controller.js
define(function() { var ProjectsFeaturedController = function(ProjectResource) { this.projects = ProjectResource.list({ // Add feature tags here 'tags[]': [] }) } ProjectsFeaturedController.$inject = ['ProjectResource'] return ProjectsFeaturedController })
define(function() { var ProjectsFeaturedController = function(ProjectResource) { this.projects = ProjectResource.list({ // Add feature tags here 'tags[]': ['noit', 'explore'] }) } ProjectsFeaturedController.$inject = ['ProjectResource'] return ProjectsFeaturedController })
Edit tags in featured projects controller
Edit tags in featured projects controller
JavaScript
mit
tenevdev/idiot,tenevdev/idiot
--- +++ @@ -2,7 +2,7 @@ var ProjectsFeaturedController = function(ProjectResource) { this.projects = ProjectResource.list({ // Add feature tags here - 'tags[]': [] + 'tags[]': ['noit', 'explore'] }) }
8ea9755b10f7ee7a6e4b06c757c8105a4237e0aa
src/swap-case.js
src/swap-case.js
import R from 'ramda'; import compose from './util/compose.js'; import join from './util/join.js'; import upperCase from './util/upper-case.js'; import lowerCase from './util/lower-case.js'; import isUpperCase from '../src/is-upper-case.js'; // a -> a const swapCase = compose( join(''), R.map( R.either( R.both(isUpperCase, lowerCase), R.both(compose(R.not, isUpperCase), upperCase) ) ) ); export default swapCase;
import R from 'ramda'; import compose from './util/compose.js'; import join from './util/join.js'; import not from './util/not.js'; import upperCase from './util/upper-case.js'; import lowerCase from './util/lower-case.js'; import isUpperCase from '../src/is-upper-case.js'; // a -> a const swapCase = compose( join(''), R.map( R.either( R.both(isUpperCase, lowerCase), R.both(compose(not, isUpperCase), upperCase) ) ) ); export default swapCase;
Refactor swapCase function to use custom not function
Refactor swapCase function to use custom not function
JavaScript
mit
restrung/restrung-js
--- +++ @@ -1,6 +1,7 @@ import R from 'ramda'; import compose from './util/compose.js'; import join from './util/join.js'; +import not from './util/not.js'; import upperCase from './util/upper-case.js'; import lowerCase from './util/lower-case.js'; import isUpperCase from '../src/is-upper-case.js'; @@ -11,7 +12,7 @@ R.map( R.either( R.both(isUpperCase, lowerCase), - R.both(compose(R.not, isUpperCase), upperCase) + R.both(compose(not, isUpperCase), upperCase) ) ) );
02d15a7a06435db9769cac4ae4dccbc756b0b8e4
spec/async-spec-helpers.js
spec/async-spec-helpers.js
// Lifted from Atom exports.beforeEach = function (fn) { global.beforeEach(function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result }) } }) } exports.afterEach = function (fn) { global.afterEach(function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result }) } }) } var matchers = ['it', 'fit', 'ffit', 'fffit'] // inlining this makes things fail wtf. matchers.forEach(function (name) { exports[name] = function (description, fn) { global[name](description, function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result }) } }) } }) function waitsForPromise (fn) { var promise = fn() waitsFor('spec promise to resolve', 30000, function (done) { promise.then(done, function (error) { jasmine.getEnv().currentSpec.fail(error) return done() }) }) } exports.waitsForPromise = waitsForPromise
// Lifted from Atom exports.beforeEach = function (fn) { global.beforeEach(function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result }) } }) } exports.afterEach = function (fn) { global.afterEach(function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result }) } }) } exports.runs = function (fn) { global.runs(function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result }) } }) } var matchers = ['it', 'fit', 'ffit', 'fffit'] // inlining this makes things fail wtf. matchers.forEach(function (name) { exports[name] = function (description, fn) { global[name](description, function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result }) } }) } }) function waitsForPromise (fn) { var promise = fn() waitsFor('spec promise to resolve', 30000, function (done) { promise.then(done, function (error) { jasmine.getEnv().currentSpec.fail(error) return done() }) }) } exports.waitsForPromise = waitsForPromise
Make async `runs` a bit better.
Make async `runs` a bit better.
JavaScript
mit
atom/github,atom/github,atom/github
--- +++ @@ -11,6 +11,15 @@ exports.afterEach = function (fn) { global.afterEach(function () { + var result = fn() + if (result instanceof Promise) { + waitsForPromise(function () { return result }) + } + }) +} + +exports.runs = function (fn) { + global.runs(function () { var result = fn() if (result instanceof Promise) { waitsForPromise(function () { return result })
853a002aed8dfaf42e42918cc6d291d4744ffcee
tests/date-format.spec.js
tests/date-format.spec.js
'use strict'; var expect = require('chai').expect; var validator = require('../'); describe('Date validator', function () { var simpleRules = { birthday: ['date-format:YYYY-MM-DD'] }; var getTestObject = function () { return { birthday: '1993-09-02', }; }; it('should success', function () { var result = validator.validate(simpleRules, getTestObject()); var err = result.messages; expect(result.success).to.equal(true); expect(err).to.not.have.property('birthday'); }); it('should fail', function () { var testObj = getTestObject(); testObj.birthday = '02-09-1993'; var result = validator.validate(simpleRules, testObj); var err = result.messages; expect(result.success).to.equal(false); expect(err).to.have.property('birthday'); expect(err.birthday.date).to.equal('Date format must conform YYYY-MM-DD.'); }); });
'use strict'; var expect = require('chai').expect; var validator = require('../'); describe('Date validator', function () { var simpleRules = { birthday: ['date-format:YYYY-MM-DD'] }; var getTestObject = function () { return { birthday: '1993-09-02', }; }; it('should success', function () { var result = validator.validate(simpleRules, getTestObject()); var err = result.messages; expect(result.success).to.equal(true); expect(err).to.not.have.property('birthday'); }); it('should fail', function () { var testObj = getTestObject(); testObj.birthday = '02-09-1993'; var result = validator.validate(simpleRules, testObj); var err = result.messages; expect(result.success).to.equal(false); expect(err).to.have.property('birthday'); expect(err.birthday['date-format:$1']).to.equal('Birthday must be in format YYYY-MM-DD.'); }); });
Update test assertion on validation message
Update test assertion on validation message
JavaScript
mit
cermati/satpam,sendyhalim/satpam
--- +++ @@ -30,7 +30,7 @@ expect(result.success).to.equal(false); expect(err).to.have.property('birthday'); - expect(err.birthday.date).to.equal('Date format must conform YYYY-MM-DD.'); + expect(err.birthday['date-format:$1']).to.equal('Birthday must be in format YYYY-MM-DD.'); }); });
fedf316d123fe5d6037cdbbcf24e512ea72acf38
tuskar_ui/infrastructure/static/infrastructure/js/angular/horizon.number_picker.js
tuskar_ui/infrastructure/static/infrastructure/js/angular/horizon.number_picker.js
angular.module('horizonApp').directive('hrNumberPicker', function() { return { restrict: 'A', replace: true, scope: { initial_value: '=value' }, templateUrl: '../../static/infrastructure/angular_templates/numberpicker.html', link: function(scope, element, attrs) { input = element.find('input').first(); angular.forEach(element[0].attributes, function(attribute) { input_attr = input.attr(attribute.nodeName); if (typeof input_attr === 'undefined' || input_attr === false) { input.attr(attribute.nodeName, attribute.nodeValue); } }); scope.value = scope.initial_value; scope.disabledInput = (angular.isDefined(attrs.readonly)) ? true : false; scope.disableArrow = function() { return (scope.value === 0) ? true : false; } scope.incrementValue = function() { if(!scope.disabledInput) { scope.value++; } } scope.decrementValue = function() { if(!scope.disabledInput && scope.value !== 0) { scope.value--; } } } }; })
angular.module('horizonApp').directive('hrNumberPicker', function() { return { restrict: 'A', replace: true, scope: { initial_value: '=value' }, templateUrl: '../../static/infrastructure/angular_templates/numberpicker.html', link: function(scope, element, attrs) { input = element.find('input').first(); angular.forEach(element[0].attributes, function(attribute) { input_attr = input.attr(attribute.nodeName); if (typeof input_attr === 'undefined' || input_attr === false) { input.attr(attribute.nodeName, attribute.nodeValue); } }); scope.value = scope.initial_value; scope.disabledInput = (angular.isDefined(attrs.readonly)) ? true : false; scope.disableArrow = function() { return (scope.value === 0) ? true : false; }; scope.incrementValue = function() { if(!scope.disabledInput) { scope.value++; } }; scope.decrementValue = function() { if(!scope.disabledInput && scope.value !== 0) { scope.value--; } }; } }; });
Add missing semicolons in js
Add missing semicolons in js Change-Id: I1cb8d044766924e554411ce45c3c056139f19078
JavaScript
apache-2.0
rdo-management/tuskar-ui,rdo-management/tuskar-ui,rdo-management/tuskar-ui,rdo-management/tuskar-ui
--- +++ @@ -18,19 +18,19 @@ scope.disableArrow = function() { return (scope.value === 0) ? true : false; - } + }; scope.incrementValue = function() { if(!scope.disabledInput) { scope.value++; } - } + }; scope.decrementValue = function() { if(!scope.disabledInput && scope.value !== 0) { scope.value--; } - } + }; } }; -}) +});
61909991a69685cc68625f98223337b1cdfd2770
server/game/playattachmentaction.js
server/game/playattachmentaction.js
const BaseAbility = require('./baseability.js'); const Costs = require('./costs.js'); class PlayAttachmentAction extends BaseAbility { constructor() { super({ cost: [ Costs.payReduceableFateCost('play'), Costs.playLimited() ], target: { cardCondition: (card, context) => context.source.owner.canAttach(context.source, card) } }); this.title = 'PlayAttachmentAction'; } meetsRequirements(context) { return ( context.game.currentPhase !== 'dynasty' && context.source.getType() === 'attachment' && context.source.location === 'hand' && context.source.canPlay() ); } executeHandler(context) { context.player.attach(context.source, context.target); } isCardPlayed() { return true; } isCardAbility() { return false; } } module.exports = PlayAttachmentAction;
const BaseAbility = require('./baseability.js'); const Costs = require('./costs.js'); class PlayAttachmentAction extends BaseAbility { constructor() { super({ cost: [ Costs.payReduceableFateCost('play'), Costs.playLimited() ], target: { cardCondition: (card, context) => context.source.owner.canAttach(context.source, card) } }); this.title = 'PlayAttachmentAction'; } meetsRequirements(context) { return ( context.game.currentPhase !== 'dynasty' && context.source.getType() === 'attachment' && context.source.location === 'hand' && context.source.canPlay() ); } executeHandler(context) { context.player.attach(context.source, context.target); context.game.addMessage('0} plays {1}, attaching it to {2}', context.player, context.source, context.target); } isCardPlayed() { return true; } isCardAbility() { return false; } } module.exports = PlayAttachmentAction;
Add game message to play attachment
Add game message to play attachment
JavaScript
mit
gryffon/ringteki,jeremylarner/ringteki,jeremylarner/ringteki,jeremylarner/ringteki,gryffon/ringteki,gryffon/ringteki
--- +++ @@ -26,6 +26,7 @@ executeHandler(context) { context.player.attach(context.source, context.target); + context.game.addMessage('0} plays {1}, attaching it to {2}', context.player, context.source, context.target); } isCardPlayed() {
e97915274bcbf7c202656257645884a5c3b1adcb
app/scripts/models/item.js
app/scripts/models/item.js
define([ 'underscore', 'jquery', 'models/resource', 'collections/bullet', 'collections/paragraph' ], function (_, $, Resource, BulletCollection, ParagraphCollection) { 'use strict'; var ItemModel = Resource.extend({ defaults: { name: '', title: '', heading: '' }, resource: 'item', hasMany: ['bullets', 'paragraphs'], initialize: function(attributes, options) { this.set('bullets', new BulletCollection( attributes.bullets )); this.set('paragraphs', new ParagraphCollection( attributes.paragraphs )); }, bulletIds: function() { return this.get('bullets').map(function(bullet) { return bullet.id; }); }, parse: function(response) { if (response.item) { return response.item; } else { return response; } } }); return ItemModel; });
define([ 'underscore', 'jquery', 'models/resource', 'collections/bullet', 'collections/paragraph' ], function (_, $, Resource, BulletCollection, ParagraphCollection) { 'use strict'; var ItemModel = Resource.extend({ defaults: { name: '', title: '', heading: '' }, resource: 'item', hasMany: ['bullets', 'paragraphs'], initialize: function(attributes, options) { this.set('bullets', new BulletCollection( attributes.bullets )); this.set('paragraphs', new ParagraphCollection( attributes.paragraphs )); }, bulletIds: function() { return this.get('bullets').map(function(bullet) { return bullet.id; }); }, paragraphIds: function() { return this.get('paragraphs').map(function(paragraph) { return paragraph.id; }); }, parse: function(response) { if (response.item) { return response.item; } else { return response; } } }); return ItemModel; });
Add paragraphIds method to Item model.
Add paragraphIds method to Item model.
JavaScript
mit
jmflannery/jackflannery.me,jmflannery/jackflannery.me,jmflannery/rez-backbone,jmflannery/rez-backbone
--- +++ @@ -32,6 +32,12 @@ }); }, + paragraphIds: function() { + return this.get('paragraphs').map(function(paragraph) { + return paragraph.id; + }); + }, + parse: function(response) { if (response.item) { return response.item;
abd5c2ec804e65cc621b4f82f67992b3cf1b24f8
src/sal.js
src/sal.js
import './sal.scss'; let options = { rootMargin: '0px', threshold: 0, animateClassName: 'sal-animate', selector: '[data-sal]', disableFor: null, }; let elements = []; let intersectionObserver = null; const animate = element => ( element.classList.add(options.animateClassName) ); const isAnimated = element => ( element.classList.contains(options.animateClassName) ); const onIntersection = (entries, observer) => { entries.forEach((entry) => { if (entry.intersectionRatio > 0) { observer.unobserve(entry.target); animate(entry.target); } }); }; const disable = () => { intersectionObserver.disconnect(); intersectionObserver = null; }; const enable = () => { intersectionObserver = new IntersectionObserver(onIntersection, { rootMargin: options.rootMargin, threshold: options.threshold, }); elements = [].filter.call( document.querySelectorAll(options.selector), element => !isAnimated(element, options.animateClassName), ); elements.forEach(element => intersectionObserver.observe(element)); }; const init = (settings = options) => { if (settings !== options) { options = { ...options, ...settings, }; } if (!options.disableFor) { enable(); } return { elements, disable, enable, }; }; export default init;
import './sal.scss'; let options = { rootMargin: '0px', threshold: 0.5, animateClassName: 'sal-animate', selector: '[data-sal]', once: true, disableFor: null, }; let elements = []; let intersectionObserver = null; const animate = element => ( element.classList.add(options.animateClassName) ); const reverse = element => ( element.classList.remove(options.animateClassName) ); const isAnimated = element => ( element.classList.contains(options.animateClassName) ); const onIntersection = (entries, observer) => { entries.forEach((entry) => { if (entry.intersectionRatio > 0) { animate(entry.target); if (!options.once) { observer.unobserve(entry.target); } } else if (!options.once) { reverse(entry.target); } }); }; const disable = () => { intersectionObserver.disconnect(); intersectionObserver = null; }; const enable = () => { intersectionObserver = new IntersectionObserver(onIntersection, { rootMargin: options.rootMargin, threshold: options.threshold, }); elements = [].filter.call( document.querySelectorAll(options.selector), element => !isAnimated(element, options.animateClassName), ); elements.forEach(element => intersectionObserver.observe(element)); }; const init = (settings = options) => { if (settings !== options) { options = { ...options, ...settings, }; } if (!options.disableFor) { enable(); } return { elements, disable, enable, }; }; export default init;
Add once option to manage working mode. Fix threshold value.
Add once option to manage working mode. Fix threshold value.
JavaScript
mit
mciastek/sal,mciastek/sal
--- +++ @@ -2,9 +2,10 @@ let options = { rootMargin: '0px', - threshold: 0, + threshold: 0.5, animateClassName: 'sal-animate', selector: '[data-sal]', + once: true, disableFor: null, }; @@ -15,6 +16,10 @@ element.classList.add(options.animateClassName) ); +const reverse = element => ( + element.classList.remove(options.animateClassName) +); + const isAnimated = element => ( element.classList.contains(options.animateClassName) ); @@ -22,8 +27,13 @@ const onIntersection = (entries, observer) => { entries.forEach((entry) => { if (entry.intersectionRatio > 0) { - observer.unobserve(entry.target); animate(entry.target); + + if (!options.once) { + observer.unobserve(entry.target); + } + } else if (!options.once) { + reverse(entry.target); } }); };
a46ff61e935bd029ddde1a6610fea27479e47777
src/services/fetchStats.js
src/services/fetchStats.js
import fetch from 'node-fetch'; import { hashToHypen } from './formatText'; import { API_URL, HTTP_HEADERS } from '../constants'; const headers = HTTP_HEADERS; const fetchStats = (battletag) => { const url = `${API_URL}/${hashToHypen(battletag)}/blob`; return fetch(encodeURI(url), { headers }) .then((response) => response.json()) .catch((error) => console.log(error)); }; export default fetchStats;
import fetch from 'node-fetch'; import { hashToHypen } from './formatText'; import { API_URL, HTTP_HEADERS } from '../constants'; const headers = HTTP_HEADERS; const fetchStats = (battletag,platform) => { const url = `${API_URL}/${hashToHypen(battletag)}/blob?platform=${platform}`; return fetch(encodeURI(url), { headers }) .then((response) => response.json()) .catch((error) => console.log(error)); }; export default fetchStats;
Add console support, p. 2
Add console support, p. 2
JavaScript
mit
chesterhow/overwatch-telegram-bot
--- +++ @@ -4,8 +4,8 @@ const headers = HTTP_HEADERS; -const fetchStats = (battletag) => { - const url = `${API_URL}/${hashToHypen(battletag)}/blob`; +const fetchStats = (battletag,platform) => { + const url = `${API_URL}/${hashToHypen(battletag)}/blob?platform=${platform}`; return fetch(encodeURI(url), { headers }) .then((response) => response.json())
a266f3dd6007a87ae96e31f847c6768dc7e2e807
corehq/apps/style/static/style/js/daterangepicker.config.js
corehq/apps/style/static/style/js/daterangepicker.config.js
$(function () { 'use strict'; $.fn.getDateRangeSeparator = function () { return ' to '; }; $.fn.createBootstrap3DateRangePicker = function( range_labels, separator, startdate, enddate ) { var now = moment(); var ranges = {}; ranges[range_labels.last_7_days] = [ moment().subtract('7', 'days').startOf('days') ]; ranges[range_labels.last_month] = [ moment().subtract('1', 'months').startOf('month'), moment().subtract('1', 'months').endOf('month') ]; ranges[range_labels.last_30_days] = [ moment().subtract('30', 'days').startOf('days') ]; var config = { showDropdowns: true, ranges: ranges, locale: { format: 'YYYY-MM-DD', separator: separator } }; if (!_.isEmpty(startdate) && !_.isEmpty(enddate)) { config.startDate = new Date(startdate); config.endDate = new Date(enddate); } $(this).daterangepicker(config); }; $.fn.createBootstrap3DefaultDateRangePicker = function () { this.createBootstrap3DateRangePicker( { last_7_days: 'Last 7 Days', last_month: 'Last Month', last_30_days: 'Last 30 Days' }, this.getDateRangeSeparator() ); }; });
$(function () { 'use strict'; $.fn.getDateRangeSeparator = function () { return ' to '; }; $.fn.createBootstrap3DateRangePicker = function( range_labels, separator, startdate, enddate ) { var now = moment(); var ranges = {}; ranges[range_labels.last_7_days] = [ moment().subtract('7', 'days').startOf('days') ]; ranges[range_labels.last_month] = [ moment().subtract('1', 'months').startOf('month'), moment().subtract('1', 'months').endOf('month') ]; ranges[range_labels.last_30_days] = [ moment().subtract('30', 'days').startOf('days') ]; var config = { showDropdowns: true, ranges: ranges, locale: { format: 'YYYY-MM-DD', separator: separator } }; var hasStartAndEndDate = !_.isEmpty(startdate) && !_.isEmpty(enddate); if (hasStartAndEndDate) { config.startDate = new Date(startdate); config.endDate = new Date(enddate); } $(this).daterangepicker(config); if (! hasStartAndEndDate){ $(this).val(""); } }; $.fn.createBootstrap3DefaultDateRangePicker = function () { this.createBootstrap3DateRangePicker( { last_7_days: 'Last 7 Days', last_month: 'Last Month', last_30_days: 'Last 30 Days' }, this.getDateRangeSeparator() ); }; });
Clear date range picker if no start and end date given
Clear date range picker if no start and end date given
JavaScript
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
--- +++ @@ -28,11 +28,17 @@ separator: separator } }; - if (!_.isEmpty(startdate) && !_.isEmpty(enddate)) { + var hasStartAndEndDate = !_.isEmpty(startdate) && !_.isEmpty(enddate); + if (hasStartAndEndDate) { config.startDate = new Date(startdate); config.endDate = new Date(enddate); } + $(this).daterangepicker(config); + + if (! hasStartAndEndDate){ + $(this).val(""); + } }; $.fn.createBootstrap3DefaultDateRangePicker = function () { this.createBootstrap3DateRangePicker(
dfaacd1183f244f94b190084a882dc6038bfcd9e
src/lib/libraries/sound-tags.js
src/lib/libraries/sound-tags.js
export default [ {title: 'Animal'}, {title: 'Effects'}, {title: 'Loops'}, {title: 'Notes'}, {title: 'Percussion'}, {title: 'Space'}, {title: 'Sports'}, {title: 'Voice'}, {title: 'Wacky'} ];
export default [ {title: 'Animals'}, {title: 'Effects'}, {title: 'Loops'}, {title: 'Notes'}, {title: 'Percussion'}, {title: 'Space'}, {title: 'Sports'}, {title: 'Voice'}, {title: 'Wacky'} ];
Fix category label for sound library
Fix category label for sound library
JavaScript
bsd-3-clause
LLK/scratch-gui,cwillisf/scratch-gui,LLK/scratch-gui,cwillisf/scratch-gui,cwillisf/scratch-gui
--- +++ @@ -1,5 +1,5 @@ export default [ - {title: 'Animal'}, + {title: 'Animals'}, {title: 'Effects'}, {title: 'Loops'}, {title: 'Notes'},
b4d669c8bc71f7938475130ade97e041d847f077
src/config.js
src/config.js
/** * Configuration module */ var path = require('path'); var fs = require('fs'); var lodash = require('lodash'); var jsonlint = require('json-lint'); var print = require('./print.js'); module.exports = { read: read }; var defaultConfig = { 'source': './', 'destination': './situs', 'ignore': [ 'node_modules/**/*' ], 'port': 4000, 'noConfig': false, 'global': {} }; function read(filePath, callback) { fs.exists(filePath, function (exists) { if (!exists) { // Add compiled dir in ignore list defaultConfig.ignore.push('situs/**/*'); defaultConfig.noConfig = true; return callback(null, defaultConfig); } fs.readFile(filePath, 'utf8', function (error, data) { if (error) { return callback(error); } var lint = jsonlint(data, {comments:false}); if (lint.error) { error = 'Syntax error on situs.json:'+lint.line+'.\n'+lint.error; return callback(error); } var obj = lodash.extend(defaultConfig, JSON.parse(data)); // Add compiled dir in ignore list obj.ignore.push('!'+path.normalize(obj.destination)+'/**/*'); return callback(null, obj); }); }); }
/** * Configuration module */ var path = require('path'); var fs = require('fs'); var lodash = require('lodash'); var jsonlint = require('json-lint'); var print = require('./print.js'); module.exports = { read: read }; var defaultConfig = { 'source': './', 'destination': './situs', 'ignore': [ 'node_modules/**/*' ], 'port': 4000, 'noConfig': false, 'global': {} }; function read(filePath, callback) { fs.exists(filePath, function (exists) { if (!exists) { // Add compiled dir in ignore list defaultConfig.ignore.push('situs/**/*'); defaultConfig.noConfig = true; return callback(null, defaultConfig); } fs.readFile(filePath, 'utf8', function (error, data) { if (error) { return callback(error); } var lint = jsonlint(data, {comments:false}); if (lint.error) { error = 'Syntax error on situs.json:'+lint.line+'.\n'+lint.error; return callback(error); } var obj = lodash.extend(defaultConfig, JSON.parse(data)); // Add compiled dir in ignore list obj.ignore.push(path.normalize(obj.destination)+'/**/*'); return callback(null, obj); }); }); }
Fix additional "!" when push ignore list
Fix additional "!" when push ignore list
JavaScript
mit
fians/situs
--- +++ @@ -53,7 +53,7 @@ var obj = lodash.extend(defaultConfig, JSON.parse(data)); // Add compiled dir in ignore list - obj.ignore.push('!'+path.normalize(obj.destination)+'/**/*'); + obj.ignore.push(path.normalize(obj.destination)+'/**/*'); return callback(null, obj); });
14689228a91934327620537a8930a005d020ef79
src/models/message_comparator.js
src/models/message_comparator.js
var logger = require('../utils/logger')('MessageComparator'), Response = require('./response'); /** * Represents a MessageComparator capable of determining whether an * incoming message must be relayed to a module or not. * @param {RegExp} regex Regex to which every incoming * message will be tested against * @param {Function} callback Callback function that will be called * when a given message is matched by the * provided regex * @constructor */ var MessageComparator = function(regex, callback) { this.regex = regex; this.callback = callback; logger.verbose('Registered message: ' + regex); }; MessageComparator.prototype = { /** * Checks and executes the callback on a given message in an Envelope * @param {Envelope} envelope Envelope containing a message * to be checked * @return {Bool} Whether the callback was called or not */ call: function(envelope) { var match = this.regex.exec(envelope.text); if(!!match) { logger.verbose('Message ' + envelope.text + ' matched regex ' + this.regex); envelope.stopPropagation = true; this.callback(new Response(envelope, match)); return true; } return false; } }; module.exports = MessageComparator;
var logger = require('../utils/logger')('MessageComparator'), Response = require('./response'); /** * Represents a MessageComparator capable of determining whether an * incoming message must be relayed to a module or not. * @param {RegExp} regex Regex to which every incoming * message will be tested against * @param {Function} callback Callback function that will be called * when a given message is matched by the * provided regex * @constructor */ var MessageComparator = function(moduleName, regex, callback) { this.regex = regex; this.callback = callback; this.moduleName = moduleName; this.suspended = false; logger.verbose('Registered message: ' + regex); }; MessageComparator.prototype = { /** * Checks and executes the callback on a given message in an Envelope * @param {Envelope} envelope Envelope containing a message * to be checked * @return {Bool} Whether the callback was called or not */ call: function(envelope) { if(this.suspended) { return false; } var match = this.regex.exec(envelope.text); if(!!match) { logger.verbose('Message ' + envelope.text + ' matched regex ' + this.regex); envelope.stopPropagation = true; this.callback(new Response(envelope, match)); return true; } return false; }, /** * Sets the suspension state of this MessageComparator. Setting it to true, prevents it * from matching messages and calling its module. * @param {Boolean} newState New suspension state of this MessageComparator * @since 2.0 */ setSuspensionState: function(newState) { this.suspended = newState; } }; module.exports = MessageComparator;
Add suspension capabilities to MessageComparator
Add suspension capabilities to MessageComparator
JavaScript
mit
victorgama/Giskard,victorgama/Giskard,victorgama/Giskard
--- +++ @@ -11,9 +11,11 @@ * provided regex * @constructor */ -var MessageComparator = function(regex, callback) { +var MessageComparator = function(moduleName, regex, callback) { this.regex = regex; this.callback = callback; + this.moduleName = moduleName; + this.suspended = false; logger.verbose('Registered message: ' + regex); }; @@ -25,6 +27,9 @@ * @return {Bool} Whether the callback was called or not */ call: function(envelope) { + if(this.suspended) { + return false; + } var match = this.regex.exec(envelope.text); if(!!match) { logger.verbose('Message ' + envelope.text + ' matched regex ' + this.regex); @@ -33,6 +38,16 @@ return true; } return false; + }, + + /** + * Sets the suspension state of this MessageComparator. Setting it to true, prevents it + * from matching messages and calling its module. + * @param {Boolean} newState New suspension state of this MessageComparator + * @since 2.0 + */ + setSuspensionState: function(newState) { + this.suspended = newState; } };
d53ad4bf24b431086605670c73b78f743d2bb9cc
tests/Bamboo/Fixtures/episodes_recommendations.js
tests/Bamboo/Fixtures/episodes_recommendations.js
module.exports = function (creator, fixtureName) { return creator.createFixture('/episodes/p00y1h7j/recommendations').then(function (fixture) { fixture.save(fixtureName); }); };
module.exports = function (creator, fixtureName) { return creator.createFixture('/episodes/p00y1h7j/recommendations').then(function (fixture) { fixture.addEpisode(); fixture.save(fixtureName); }); };
Fix recommendations fixture for when no recomendations are returned by iBL
Fix recommendations fixture for when no recomendations are returned by iBL
JavaScript
mit
DaMouse404/bamboo,DaMouse404/bamboo,DaMouse404/bamboo
--- +++ @@ -1,5 +1,7 @@ module.exports = function (creator, fixtureName) { return creator.createFixture('/episodes/p00y1h7j/recommendations').then(function (fixture) { + fixture.addEpisode(); + fixture.save(fixtureName); }); };
6a3d5e602529c7991a94ae5c9df79083bca6829c
04-responsive/Gruntfile.js
04-responsive/Gruntfile.js
/*global module:false*/ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ // Task configuration. watch: { lib_test: { files: [ 'styles/**/*.css', '*.html' ], tasks: [], options: { livereload: true } } } }); // These plugins provide necessary tasks. grunt.loadNpmTasks('grunt-contrib-watch'); // Default task. grunt.registerTask('default', ['watch']); };
/*global module:false*/ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ // Task configuration. watch: { lib_test: { files: [ '*.css', '*.html' ], tasks: [], options: { livereload: true } } } }); // These plugins provide necessary tasks. grunt.loadNpmTasks('grunt-contrib-watch'); // Default task. grunt.registerTask('default', ['watch']); };
Watch styles in main folder
Watch styles in main folder
JavaScript
mit
hkdobrev/softuni-html-exam
--- +++ @@ -6,7 +6,7 @@ // Task configuration. watch: { lib_test: { - files: [ 'styles/**/*.css', '*.html' ], + files: [ '*.css', '*.html' ], tasks: [], options: { livereload: true
1f1d8af3e6e8a98113daeec8f3e554b47c876ce0
assets/js/components/settings-notice.js
assets/js/components/settings-notice.js
/** * Settings notice component. * * Site Kit by Google, Copyright 2020 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 PropTypes from 'prop-types'; export default function SettingsNotice( { message } ) { if ( ! message ) { return null; } return ( <div className="googlesitekit-settings-notice"> <div className="googlesitekit-settings-notice__text"> { message } </div> </div> ); } SettingsNotice.propTypes = { message: PropTypes.string.isRequired, };
/** * Settings notice component. * * Site Kit by Google, Copyright 2020 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 PropTypes from 'prop-types'; import classnames from 'classnames'; export default function SettingsNotice( { message, isSuggestion } ) { if ( ! message ) { return null; } return ( <div className={ classnames( 'googlesitekit-settings-notice', { 'googlesitekit-settings-notice--suggestion': isSuggestion } ) } > <div className="googlesitekit-settings-notice__text"> { message } </div> </div> ); } SettingsNotice.propTypes = { message: PropTypes.string.isRequired, isSuggestion: PropTypes.bool, };
Add support for suggestion style to SettingsNotice component.
Add support for suggestion style to SettingsNotice component.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
--- +++ @@ -20,14 +20,20 @@ * External dependencies */ import PropTypes from 'prop-types'; +import classnames from 'classnames'; -export default function SettingsNotice( { message } ) { +export default function SettingsNotice( { message, isSuggestion } ) { if ( ! message ) { return null; } return ( - <div className="googlesitekit-settings-notice"> + <div + className={ classnames( + 'googlesitekit-settings-notice', + { 'googlesitekit-settings-notice--suggestion': isSuggestion } + ) } + > <div className="googlesitekit-settings-notice__text"> { message } </div> @@ -37,4 +43,5 @@ SettingsNotice.propTypes = { message: PropTypes.string.isRequired, + isSuggestion: PropTypes.bool, };
a5463c4c1021009be6958c3821605e8b803edc45
local-cli/run-packager.js
local-cli/run-packager.js
'use strict'; var path = require('path'); var child_process = require('child_process'); module.exports = function(newWindow) { if (newWindow) { var launchPackagerScript = path.resolve(__dirname, '..', 'packager', 'launchPackager.command'); if (process.platform === 'darwin') { child_process.spawnSync('open', [launchPackagerScript]); } else if (process.platform === 'linux') { child_process.spawn( 'xterm', ['-e', 'sh', launchPackagerScript], {detached: true}); } } else { child_process.spawn('sh', [ path.resolve(__dirname, '..', 'packager', 'packager.sh'), '--projectRoots', process.cwd(), ], {stdio: 'inherit'}); } };
'use strict'; var path = require('path'); var child_process = require('child_process'); module.exports = function(newWindow) { if (newWindow) { var launchPackagerScript = path.resolve(__dirname, '..', 'packager', 'launchPackager.command'); if (process.platform === 'darwin') { child_process.spawnSync('open', [launchPackagerScript]); } else if (process.platform === 'linux') { child_process.spawn( 'xterm', ['-e', 'sh', launchPackagerScript], {detached: true}); } } else { if (/^win/.test(process.platform)) { child_process.spawn('node', [ path.resolve(__dirname, '..', 'packager', 'packager.js'), '--projectRoots', process.cwd(), ], {stdio: 'inherit'}); } else { child_process.spawn('sh', [ path.resolve(__dirname, '..', 'packager', 'packager.sh'), '--projectRoots', process.cwd(), ], {stdio: 'inherit'}); } } };
Fix 'react-native start' on Windows
[cli] Fix 'react-native start' on Windows Based on https://github.com/facebook/react-native/pull/2989 Thanks @BerndWessels!
JavaScript
bsd-3-clause
machard/react-native,Tredsite/react-native,cdlewis/react-native,myntra/react-native,ankitsinghania94/react-native,mrngoitall/react-native,hzgnpu/react-native,negativetwelve/react-native,CntChen/react-native,Maxwell2022/react-native,lprhodes/react-native,makadaw/react-native,philonpang/react-native,wesley1001/react-native,naoufal/react-native,csatf/react-native,a2/react-native,rebeccahughes/react-native,darkrishabh/react-native,shinate/react-native,ptmt/react-native-macos,myntra/react-native,esauter5/react-native,ptomasroos/react-native,wenpkpk/react-native,Emilios1995/react-native,xiayz/react-native,luqin/react-native,jasonnoahchoi/react-native,tsjing/react-native,glovebx/react-native,lelandrichardson/react-native,orenklein/react-native,Tredsite/react-native,puf/react-native,jadbox/react-native,foghina/react-native,thotegowda/react-native,tadeuzagallo/react-native,Swaagie/react-native,shinate/react-native,aaron-goshine/react-native,kassens/react-native,vjeux/react-native,chirag04/react-native,pvinis/react-native-desktop,almost/react-native,glovebx/react-native,chetstone/react-native,foghina/react-native,patoroco/react-native,dubert/react-native,kushal/react-native,Intellicode/react-native,lprhodes/react-native,satya164/react-native,catalinmiron/react-native,jaggs6/react-native,mrspeaker/react-native,mironiasty/react-native,eduvon0220/react-native,alin23/react-native,myntra/react-native,mchinyakov/react-native,skatpgusskat/react-native,doochik/react-native,jevakallio/react-native,DannyvanderJagt/react-native,iodine/react-native,shrutic123/react-native,happypancake/react-native,aaron-goshine/react-native,a2/react-native,christopherdro/react-native,miracle2k/react-native,makadaw/react-native,lelandrichardson/react-native,eduardinni/react-native,Andreyco/react-native,NZAOM/react-native,Bhullnatik/react-native,gitim/react-native,aljs/react-native,dvcrn/react-native,imjerrybao/react-native,cdlewis/react-native,ehd/react-native,lprhodes/react-native,sghiassy/react-native,mchinyakov/react-native,mchinyakov/react-native,BretJohnson/react-native,clozr/react-native,imDangerous/react-native,puf/react-native,ehd/react-native,forcedotcom/react-native,shrutic/react-native,foghina/react-native,hammerandchisel/react-native,NZAOM/react-native,Intellicode/react-native,jeanblanchard/react-native,pglotov/react-native,ProjectSeptemberInc/react-native,ankitsinghania94/react-native,ptomasroos/react-native,ptomasroos/react-native,glovebx/react-native,peterp/react-native,orenklein/react-native,wesley1001/react-native,nickhudkins/react-native,mironiasty/react-native,zenlambda/react-native,quyixia/react-native,myntra/react-native,lelandrichardson/react-native,udnisap/react-native,adamjmcgrath/react-native,facebook/react-native,gre/react-native,peterp/react-native,gre/react-native,Andreyco/react-native,shrutic123/react-native,kassens/react-native,htc2u/react-native,makadaw/react-native,Purii/react-native,philikon/react-native,cdlewis/react-native,vjeux/react-native,facebook/react-native,mihaigiurgeanu/react-native,dikaiosune/react-native,miracle2k/react-native,yamill/react-native,exponent/react-native,chirag04/react-native,DanielMSchmidt/react-native,chetstone/react-native,bradbumbalough/react-native,ehd/react-native,ehd/react-native,dubert/react-native,clozr/react-native,MattFoley/react-native,tsjing/react-native,makadaw/react-native,dubert/react-native,pglotov/react-native,iodine/react-native,sospartan/react-native,adamkrell/react-native,kesha-antonov/react-native,YComputer/react-native,hzgnpu/react-native,wesley1001/react-native,gre/react-native,mironiasty/react-native,frantic/react-native,Livyli/react-native,andrewljohnson/react-native,cpunion/react-native,clozr/react-native,farazs/react-native,ptmt/react-native-macos,BretJohnson/react-native,machard/react-native,catalinmiron/react-native,jhen0409/react-native,pandiaraj44/react-native,yamill/react-native,gilesvangruisen/react-native,yzarubin/react-native,jasonnoahchoi/react-native,bsansouci/react-native,Bhullnatik/react-native,dikaiosune/react-native,catalinmiron/react-native,a2/react-native,NZAOM/react-native,ndejesus1227/react-native,forcedotcom/react-native,Swaagie/react-native,rickbeerendonk/react-native,sospartan/react-native,dvcrn/react-native,dabit3/react-native,javache/react-native,catalinmiron/react-native,formatlos/react-native,pglotov/react-native,Swaagie/react-native,almost/react-native,gitim/react-native,ehd/react-native,mrngoitall/react-native,glovebx/react-native,Maxwell2022/react-native,gilesvangruisen/react-native,lloydho/react-native,lprhodes/react-native,janicduplessis/react-native,andrewljohnson/react-native,aaron-goshine/react-native,philikon/react-native,kesha-antonov/react-native,philonpang/react-native,shrutic123/react-native,hammerandchisel/react-native,kesha-antonov/react-native,vjeux/react-native,csatf/react-native,janicduplessis/react-native,kushal/react-native,Guardiannw/react-native,sospartan/react-native,kassens/react-native,DannyvanderJagt/react-native,bsansouci/react-native,imjerrybao/react-native,gre/react-native,CodeLinkIO/react-native,gitim/react-native,Purii/react-native,marlonandrade/react-native,happypancake/react-native,ultralame/react-native,puf/react-native,CntChen/react-native,kassens/react-native,happypancake/react-native,tgoldenberg/react-native,apprennet/react-native,programming086/react-native,aljs/react-native,mrngoitall/react-native,glovebx/react-native,Emilios1995/react-native,nsimmons/react-native,Maxwell2022/react-native,bradbumbalough/react-native,patoroco/react-native,jasonnoahchoi/react-native,Tredsite/react-native,dabit3/react-native,mihaigiurgeanu/react-native,Guardiannw/react-native,orenklein/react-native,darkrishabh/react-native,esauter5/react-native,dabit3/react-native,hzgnpu/react-native,dikaiosune/react-native,naoufal/react-native,ProjectSeptemberInc/react-native,jeanblanchard/react-native,exponent/react-native,DerayGa/react-native,pandiaraj44/react-native,dralletje/react-native,andrewljohnson/react-native,ankitsinghania94/react-native,esauter5/react-native,programming086/react-native,ptmt/react-native-macos,jevakallio/react-native,quyixia/react-native,chetstone/react-native,lloydho/react-native,exponent/react-native,jhen0409/react-native,Emilios1995/react-native,YComputer/react-native,peterp/react-native,wenpkpk/react-native,CodeLinkIO/react-native,Purii/react-native,Bhullnatik/react-native,zenlambda/react-native,tsjing/react-native,doochik/react-native,happypancake/react-native,mironiasty/react-native,yamill/react-native,callstack-io/react-native,chnfeeeeeef/react-native,dubert/react-native,udnisap/react-native,thotegowda/react-native,martinbigio/react-native,sospartan/react-native,timfpark/react-native,adamkrell/react-native,mrngoitall/react-native,sospartan/react-native,hoastoolshop/react-native,Livyli/react-native,DannyvanderJagt/react-native,pglotov/react-native,aaron-goshine/react-native,adamjmcgrath/react-native,a2/react-native,chirag04/react-native,eduardinni/react-native,Ehesp/react-native,javache/react-native,kesha-antonov/react-native,doochik/react-native,Emilios1995/react-native,exponentjs/rex,imDangerous/react-native,bradbumbalough/react-native,dabit3/react-native,hayeah/react-native,jadbox/react-native,Guardiannw/react-native,exponent/react-native,pjcabrera/react-native,naoufal/react-native,htc2u/react-native,brentvatne/react-native,Emilios1995/react-native,jaggs6/react-native,salanki/react-native,martinbigio/react-native,machard/react-native,catalinmiron/react-native,mchinyakov/react-native,jevakallio/react-native,peterp/react-native,pglotov/react-native,peterp/react-native,thotegowda/react-native,jasonnoahchoi/react-native,kassens/react-native,kushal/react-native,Bhullnatik/react-native,cdlewis/react-native,ultralame/react-native,lelandrichardson/react-native,shrutic/react-native,xiayz/react-native,javache/react-native,adamkrell/react-native,miracle2k/react-native,negativetwelve/react-native,christopherdro/react-native,mchinyakov/react-native,ultralame/react-native,aljs/react-native,ndejesus1227/react-native,alin23/react-native,lelandrichardson/react-native,CodeLinkIO/react-native,jaggs6/react-native,ultralame/react-native,callstack-io/react-native,browniefed/react-native,jaggs6/react-native,HealthyWealthy/react-native,adamkrell/react-native,nathanajah/react-native,nsimmons/react-native,shrutic/react-native,tadeuzagallo/react-native,Swaagie/react-native,adamkrell/react-native,tszajna0/react-native,Ehesp/react-native,rickbeerendonk/react-native,cpunion/react-native,eduardinni/react-native,hzgnpu/react-native,tarkus/react-native-appletv,shinate/react-native,janicduplessis/react-native,hayeah/react-native,farazs/react-native,wenpkpk/react-native,shrutic123/react-native,elliottsj/react-native,satya164/react-native,Ehesp/react-native,hzgnpu/react-native,sospartan/react-native,almost/react-native,PlexChat/react-native,DannyvanderJagt/react-native,apprennet/react-native,negativetwelve/react-native,foghina/react-native,dralletje/react-native,kushal/react-native,doochik/react-native,almost/react-native,ankitsinghania94/react-native,javache/react-native,ptmt/react-native-macos,hoangpham95/react-native,dikaiosune/react-native,brentvatne/react-native,ankitsinghania94/react-native,gre/react-native,gitim/react-native,exponent/react-native,CodeLinkIO/react-native,exponent/react-native,chetstone/react-native,iodine/react-native,corbt/react-native,formatlos/react-native,dikaiosune/react-native,chnfeeeeeef/react-native,exponentjs/react-native,imjerrybao/react-native,chnfeeeeeef/react-native,philonpang/react-native,ptomasroos/react-native,orenklein/react-native,shrutic123/react-native,peterp/react-native,christopherdro/react-native,sghiassy/react-native,YComputer/react-native,udnisap/react-native,CntChen/react-native,mihaigiurgeanu/react-native,salanki/react-native,Intellicode/react-native,luqin/react-native,salanki/react-native,salanki/react-native,NZAOM/react-native,cdlewis/react-native,spicyj/react-native,exponent/react-native,tadeuzagallo/react-native,marlonandrade/react-native,almost/react-native,programming086/react-native,HealthyWealthy/react-native,ultralame/react-native,PlexChat/react-native,a2/react-native,nickhudkins/react-native,rickbeerendonk/react-native,alin23/react-native,aaron-goshine/react-native,yzarubin/react-native,chirag04/react-native,eduardinni/react-native,makadaw/react-native,dralletje/react-native,Swaagie/react-native,adamkrell/react-native,udnisap/react-native,naoufal/react-native,wesley1001/react-native,ankitsinghania94/react-native,mihaigiurgeanu/react-native,makadaw/react-native,hoangpham95/react-native,CntChen/react-native,gilesvangruisen/react-native,jevakallio/react-native,exponentjs/rex,rickbeerendonk/react-native,marlonandrade/react-native,orenklein/react-native,chnfeeeeeef/react-native,mihaigiurgeanu/react-native,arbesfeld/react-native,yamill/react-native,dvcrn/react-native,clozr/react-native,esauter5/react-native,pjcabrera/react-native,sghiassy/react-native,Andreyco/react-native,mrngoitall/react-native,MattFoley/react-native,lloydho/react-native,YComputer/react-native,udnisap/react-native,tadeuzagallo/react-native,dubert/react-native,wesley1001/react-native,pjcabrera/react-native,sghiassy/react-native,bradbumbalough/react-native,nathanajah/react-native,callstack-io/react-native,ndejesus1227/react-native,BretJohnson/react-native,DanielMSchmidt/react-native,darkrishabh/react-native,Livyli/react-native,formatlos/react-native,chnfeeeeeef/react-native,arbesfeld/react-native,alin23/react-native,foghina/react-native,aljs/react-native,skatpgusskat/react-native,nsimmons/react-native,arthuralee/react-native,jhen0409/react-native,luqin/react-native,MattFoley/react-native,tsjing/react-native,bsansouci/react-native,jaggs6/react-native,shrutic/react-native,mironiasty/react-native,Bhullnatik/react-native,yzarubin/react-native,cpunion/react-native,nathanajah/react-native,Guardiannw/react-native,patoroco/react-native,jadbox/react-native,almost/react-native,formatlos/react-native,charlesvinette/react-native,apprennet/react-native,Livyli/react-native,apprennet/react-native,HealthyWealthy/react-native,a2/react-native,jadbox/react-native,foghina/react-native,a2/react-native,skevy/react-native,wesley1001/react-native,DanielMSchmidt/react-native,kesha-antonov/react-native,corbt/react-native,patoroco/react-native,cosmith/react-native,ProjectSeptemberInc/react-native,sghiassy/react-native,marlonandrade/react-native,Ehesp/react-native,programming086/react-native,PlexChat/react-native,shrimpy/react-native,pjcabrera/react-native,jeffchienzabinet/react-native,Andreyco/react-native,xiayz/react-native,makadaw/react-native,facebook/react-native,gitim/react-native,jhen0409/react-native,apprennet/react-native,dabit3/react-native,dikaiosune/react-native,Maxwell2022/react-native,cdlewis/react-native,marlonandrade/react-native,browniefed/react-native,facebook/react-native,shrimpy/react-native,puf/react-native,facebook/react-native,miracle2k/react-native,yzarubin/react-native,programming086/react-native,arthuralee/react-native,quyixia/react-native,naoufal/react-native,ProjectSeptemberInc/react-native,happypancake/react-native,Livyli/react-native,satya164/react-native,jaredly/react-native,nsimmons/react-native,nickhudkins/react-native,lprhodes/react-native,puf/react-native,machard/react-native,tszajna0/react-native,Emilios1995/react-native,almost/react-native,rickbeerendonk/react-native,Purii/react-native,farazs/react-native,NZAOM/react-native,CodeLinkIO/react-native,nickhudkins/react-native,satya164/react-native,hoastoolshop/react-native,chnfeeeeeef/react-native,tarkus/react-native-appletv,CodeLinkIO/react-native,shinate/react-native,tsjing/react-native,xiayz/react-native,InterfaceInc/react-native,lloydho/react-native,adamjmcgrath/react-native,kushal/react-native,charlesvinette/react-native,martinbigio/react-native,corbt/react-native,timfpark/react-native,cpunion/react-native,andrewljohnson/react-native,gre/react-native,BretJohnson/react-native,arthuralee/react-native,forcedotcom/react-native,arbesfeld/react-native,alin23/react-native,ehd/react-native,chirag04/react-native,gilesvangruisen/react-native,shrutic/react-native,gilesvangruisen/react-native,tadeuzagallo/react-native,bsansouci/react-native,chetstone/react-native,iodine/react-native,mironiasty/react-native,aljs/react-native,Guardiannw/react-native,arbesfeld/react-native,aaron-goshine/react-native,ProjectSeptemberInc/react-native,negativetwelve/react-native,facebook/react-native,HealthyWealthy/react-native,adamjmcgrath/react-native,salanki/react-native,browniefed/react-native,csatf/react-native,rebeccahughes/react-native,zenlambda/react-native,Maxwell2022/react-native,adamjmcgrath/react-native,skevy/react-native,bradbumbalough/react-native,darkrishabh/react-native,shrimpy/react-native,dabit3/react-native,javache/react-native,gitim/react-native,DerayGa/react-native,DanielMSchmidt/react-native,DerayGa/react-native,pandiaraj44/react-native,brentvatne/react-native,jeffchienzabinet/react-native,DannyvanderJagt/react-native,Emilios1995/react-native,dralletje/react-native,cpunion/react-native,BretJohnson/react-native,foghina/react-native,yamill/react-native,eduvon0220/react-native,catalinmiron/react-native,elliottsj/react-native,philikon/react-native,philonpang/react-native,gre/react-native,janicduplessis/react-native,chirag04/react-native,mrspeaker/react-native,PlexChat/react-native,shrutic/react-native,Bhullnatik/react-native,miracle2k/react-native,exponentjs/react-native,thotegowda/react-native,farazs/react-native,Guardiannw/react-native,apprennet/react-native,Guardiannw/react-native,timfpark/react-native,arthuralee/react-native,jaredly/react-native,skevy/react-native,bsansouci/react-native,hayeah/react-native,jeanblanchard/react-native,MattFoley/react-native,salanki/react-native,quyixia/react-native,forcedotcom/react-native,dubert/react-native,adamkrell/react-native,imjerrybao/react-native,DerayGa/react-native,hzgnpu/react-native,charlesvinette/react-native,kesha-antonov/react-native,imDangerous/react-native,myntra/react-native,ankitsinghania94/react-native,HealthyWealthy/react-native,dvcrn/react-native,dvcrn/react-native,jhen0409/react-native,NZAOM/react-native,martinbigio/react-native,exponentjs/react-native,iodine/react-native,browniefed/react-native,frantic/react-native,hzgnpu/react-native,ehd/react-native,hammerandchisel/react-native,machard/react-native,DanielMSchmidt/react-native,Bhullnatik/react-native,janicduplessis/react-native,satya164/react-native,jeffchienzabinet/react-native,jeffchienzabinet/react-native,bradbumbalough/react-native,mrspeaker/react-native,eduvon0220/react-native,alin23/react-native,dabit3/react-native,kushal/react-native,machard/react-native,dralletje/react-native,dabit3/react-native,cosmith/react-native,xiayz/react-native,iodine/react-native,christopherdro/react-native,jeanblanchard/react-native,chetstone/react-native,hayeah/react-native,shrutic123/react-native,andrewljohnson/react-native,cdlewis/react-native,tarkus/react-native-appletv,chirag04/react-native,timfpark/react-native,gitim/react-native,jasonnoahchoi/react-native,darkrishabh/react-native,naoufal/react-native,satya164/react-native,elliottsj/react-native,urvashi01/react-native,javache/react-native,patoroco/react-native,pjcabrera/react-native,jeffchienzabinet/react-native,cpunion/react-native,patoroco/react-native,browniefed/react-native,pjcabrera/react-native,pjcabrera/react-native,yzarubin/react-native,yamill/react-native,satya164/react-native,spicyj/react-native,jeanblanchard/react-native,zenlambda/react-native,jadbox/react-native,kassens/react-native,philikon/react-native,elliottsj/react-native,lelandrichardson/react-native,patoroco/react-native,dralletje/react-native,Guardiannw/react-native,jevakallio/react-native,imjerrybao/react-native,Purii/react-native,Purii/react-native,tgoldenberg/react-native,Livyli/react-native,lloydho/react-native,CntChen/react-native,ptmt/react-native-macos,gilesvangruisen/react-native,DanielMSchmidt/react-native,timfpark/react-native,lprhodes/react-native,nickhudkins/react-native,imDangerous/react-native,Purii/react-native,callstack-io/react-native,jevakallio/react-native,programming086/react-native,Livyli/react-native,farazs/react-native,Andreyco/react-native,mrspeaker/react-native,formatlos/react-native,jaggs6/react-native,yzarubin/react-native,charlesvinette/react-native,nickhudkins/react-native,xiayz/react-native,tszajna0/react-native,hoangpham95/react-native,corbt/react-native,doochik/react-native,exponentjs/react-native,urvashi01/react-native,pvinis/react-native-desktop,Tredsite/react-native,skevy/react-native,xiayz/react-native,tszajna0/react-native,formatlos/react-native,miracle2k/react-native,hoangpham95/react-native,darkrishabh/react-native,MattFoley/react-native,formatlos/react-native,cdlewis/react-native,wesley1001/react-native,mironiasty/react-native,myntra/react-native,forcedotcom/react-native,elliottsj/react-native,catalinmiron/react-native,jeffchienzabinet/react-native,InterfaceInc/react-native,arbesfeld/react-native,shrimpy/react-native,jaredly/react-native,facebook/react-native,tszajna0/react-native,gre/react-native,csatf/react-native,esauter5/react-native,corbt/react-native,quyixia/react-native,pvinis/react-native-desktop,brentvatne/react-native,jeanblanchard/react-native,esauter5/react-native,farazs/react-native,skatpgusskat/react-native,happypancake/react-native,shrimpy/react-native,zenlambda/react-native,jadbox/react-native,machard/react-native,DerayGa/react-native,browniefed/react-native,cpunion/react-native,cpunion/react-native,philonpang/react-native,eduvon0220/react-native,tarkus/react-native-appletv,tadeuzagallo/react-native,mrngoitall/react-native,skatpgusskat/react-native,bsansouci/react-native,InterfaceInc/react-native,mchinyakov/react-native,CntChen/react-native,chetstone/react-native,yamill/react-native,urvashi01/react-native,NZAOM/react-native,spicyj/react-native,bsansouci/react-native,HealthyWealthy/react-native,marlonandrade/react-native,tszajna0/react-native,pandiaraj44/react-native,DerayGa/react-native,DanielMSchmidt/react-native,imjerrybao/react-native,csatf/react-native,brentvatne/react-native,cosmith/react-native,quyixia/react-native,kassens/react-native,jhen0409/react-native,hoangpham95/react-native,philonpang/react-native,InterfaceInc/react-native,CodeLinkIO/react-native,mrspeaker/react-native,facebook/react-native,mrspeaker/react-native,InterfaceInc/react-native,makadaw/react-native,hammerandchisel/react-native,philikon/react-native,myntra/react-native,wenpkpk/react-native,luqin/react-native,dubert/react-native,gilesvangruisen/react-native,rebeccahughes/react-native,cosmith/react-native,DannyvanderJagt/react-native,jaredly/react-native,skevy/react-native,Intellicode/react-native,hoangpham95/react-native,exponentjs/react-native,martinbigio/react-native,jhen0409/react-native,jaredly/react-native,eduardinni/react-native,shrimpy/react-native,PlexChat/react-native,htc2u/react-native,InterfaceInc/react-native,cosmith/react-native,pandiaraj44/react-native,HealthyWealthy/react-native,skevy/react-native,adamjmcgrath/react-native,csatf/react-native,Tredsite/react-native,frantic/react-native,adamjmcgrath/react-native,tgoldenberg/react-native,charlesvinette/react-native,doochik/react-native,rickbeerendonk/react-native,rickbeerendonk/react-native,brentvatne/react-native,csatf/react-native,happypancake/react-native,PlexChat/react-native,myntra/react-native,DannyvanderJagt/react-native,urvashi01/react-native,skatpgusskat/react-native,philikon/react-native,rebeccahughes/react-native,wesley1001/react-native,DanielMSchmidt/react-native,philonpang/react-native,dikaiosune/react-native,zenlambda/react-native,javache/react-native,mironiasty/react-native,patoroco/react-native,negativetwelve/react-native,skevy/react-native,esauter5/react-native,arbesfeld/react-native,csatf/react-native,machard/react-native,urvashi01/react-native,arbesfeld/react-native,mrngoitall/react-native,jaredly/react-native,andrewljohnson/react-native,jasonnoahchoi/react-native,jeffchienzabinet/react-native,miracle2k/react-native,pandiaraj44/react-native,eduardinni/react-native,esauter5/react-native,makadaw/react-native,glovebx/react-native,eduvon0220/react-native,tgoldenberg/react-native,nsimmons/react-native,martinbigio/react-native,kassens/react-native,forcedotcom/react-native,Ehesp/react-native,bradbumbalough/react-native,htc2u/react-native,Swaagie/react-native,ProjectSeptemberInc/react-native,Ehesp/react-native,hoastoolshop/react-native,YComputer/react-native,andrewljohnson/react-native,udnisap/react-native,programming086/react-native,corbt/react-native,frantic/react-native,mrspeaker/react-native,pglotov/react-native,lelandrichardson/react-native,programming086/react-native,CntChen/react-native,jaredly/react-native,htc2u/react-native,negativetwelve/react-native,rickbeerendonk/react-native,nickhudkins/react-native,NZAOM/react-native,lloydho/react-native,dralletje/react-native,lloydho/react-native,orenklein/react-native,Maxwell2022/react-native,apprennet/react-native,farazs/react-native,callstack-io/react-native,kesha-antonov/react-native,yzarubin/react-native,doochik/react-native,ptmt/react-native-macos,tadeuzagallo/react-native,tgoldenberg/react-native,MattFoley/react-native,janicduplessis/react-native,yamill/react-native,cosmith/react-native,hammerandchisel/react-native,shinate/react-native,shrimpy/react-native,ankitsinghania94/react-native,jeanblanchard/react-native,corbt/react-native,hoastoolshop/react-native,timfpark/react-native,cosmith/react-native,Intellicode/react-native,mihaigiurgeanu/react-native,udnisap/react-native,compulim/react-native,Bhullnatik/react-native,yzarubin/react-native,pvinis/react-native-desktop,dralletje/react-native,pglotov/react-native,christopherdro/react-native,tarkus/react-native-appletv,callstack-io/react-native,chnfeeeeeef/react-native,darkrishabh/react-native,Tredsite/react-native,philikon/react-native,cosmith/react-native,CntChen/react-native,jeffchienzabinet/react-native,bradbumbalough/react-native,eduvon0220/react-native,MattFoley/react-native,Intellicode/react-native,brentvatne/react-native,elliottsj/react-native,tsjing/react-native,kushal/react-native,lprhodes/react-native,zenlambda/react-native,ehd/react-native,rebeccahughes/react-native,jadbox/react-native,charlesvinette/react-native,hoastoolshop/react-native,compulim/react-native,htc2u/react-native,elliottsj/react-native,christopherdro/react-native,tgoldenberg/react-native,negativetwelve/react-native,aljs/react-native,sghiassy/react-native,urvashi01/react-native,ndejesus1227/react-native,alin23/react-native,luqin/react-native,hzgnpu/react-native,ndejesus1227/react-native,luqin/react-native,myntra/react-native,spicyj/react-native,jhen0409/react-native,DannyvanderJagt/react-native,charlesvinette/react-native,htc2u/react-native,ptomasroos/react-native,tarkus/react-native-appletv,peterp/react-native,aaron-goshine/react-native,wenpkpk/react-native,InterfaceInc/react-native,doochik/react-native,ptmt/react-native-macos,imjerrybao/react-native,pjcabrera/react-native,dvcrn/react-native,skatpgusskat/react-native,zenlambda/react-native,tarkus/react-native-appletv,mihaigiurgeanu/react-native,foghina/react-native,chnfeeeeeef/react-native,kesha-antonov/react-native,orenklein/react-native,negativetwelve/react-native,thotegowda/react-native,exponentjs/react-native,tadeuzagallo/react-native,Tredsite/react-native,frantic/react-native,sospartan/react-native,YComputer/react-native,pvinis/react-native-desktop,BretJohnson/react-native,ndejesus1227/react-native,jeanblanchard/react-native,christopherdro/react-native,lloydho/react-native,mrspeaker/react-native,martinbigio/react-native,callstack-io/react-native,Ehesp/react-native,skatpgusskat/react-native,salanki/react-native,nathanajah/react-native,udnisap/react-native,darkrishabh/react-native,farazs/react-native,urvashi01/react-native,ptomasroos/react-native,happypancake/react-native,marlonandrade/react-native,hammerandchisel/react-native,skevy/react-native,javache/react-native,iodine/react-native,jaredly/react-native,gilesvangruisen/react-native,Swaagie/react-native,jevakallio/react-native,InterfaceInc/react-native,imDangerous/react-native,orenklein/react-native,imjerrybao/react-native,alin23/react-native,eduardinni/react-native,Maxwell2022/react-native,timfpark/react-native,nathanajah/react-native,BretJohnson/react-native,peterp/react-native,miracle2k/react-native,negativetwelve/react-native,BretJohnson/react-native,gitim/react-native,forcedotcom/react-native,luqin/react-native,thotegowda/react-native,philonpang/react-native,tsjing/react-native,ptmt/react-native-macos,sghiassy/react-native,adamkrell/react-native,luqin/react-native,Intellicode/react-native,glovebx/react-native,janicduplessis/react-native,hayeah/react-native,nathanajah/react-native,hoangpham95/react-native,exponentjs/rex,nsimmons/react-native,exponent/react-native,compulim/react-native,arthuralee/react-native,ndejesus1227/react-native,DerayGa/react-native,shrutic/react-native,forcedotcom/react-native,jaggs6/react-native,nsimmons/react-native,timfpark/react-native,tarkus/react-native-appletv,imDangerous/react-native,kushal/react-native,janicduplessis/react-native,salanki/react-native,vjeux/react-native,jevakallio/react-native,wenpkpk/react-native,Tredsite/react-native,charlesvinette/react-native,mrngoitall/react-native,naoufal/react-native,kesha-antonov/react-native,clozr/react-native,jaggs6/react-native,PlexChat/react-native,shinate/react-native,andrewljohnson/react-native,elliottsj/react-native,MattFoley/react-native,spicyj/react-native,aljs/react-native,eduvon0220/react-native,aljs/react-native,formatlos/react-native,hoastoolshop/react-native,quyixia/react-native,eduardinni/react-native,aaron-goshine/react-native,browniefed/react-native,ptomasroos/react-native,Purii/react-native,wenpkpk/react-native,bsansouci/react-native,shrimpy/react-native,clozr/react-native,mironiasty/react-native,shrutic123/react-native,callstack-io/react-native,urvashi01/react-native,nathanajah/react-native,dvcrn/react-native,corbt/react-native,puf/react-native,lelandrichardson/react-native,pglotov/react-native,shinate/react-native,puf/react-native,Intellicode/react-native,catalinmiron/react-native,xiayz/react-native,rickbeerendonk/react-native,dvcrn/react-native,jasonnoahchoi/react-native,hoangpham95/react-native,javache/react-native,naoufal/react-native,Livyli/react-native,hoastoolshop/react-native,compulim/react-native,jasonnoahchoi/react-native,HealthyWealthy/react-native,jadbox/react-native,browniefed/react-native,shinate/react-native,sospartan/react-native,formatlos/react-native,tgoldenberg/react-native,YComputer/react-native,Andreyco/react-native,christopherdro/react-native,hammerandchisel/react-native,hammerandchisel/react-native,DerayGa/react-native,ndejesus1227/react-native,tsjing/react-native,nsimmons/react-native,tszajna0/react-native,nickhudkins/react-native,wenpkpk/react-native,iodine/react-native,glovebx/react-native,hoastoolshop/react-native,facebook/react-native,YComputer/react-native,clozr/react-native,shrutic/react-native,lprhodes/react-native,pandiaraj44/react-native,pandiaraj44/react-native,thotegowda/react-native,clozr/react-native,Ehesp/react-native,Maxwell2022/react-native,philikon/react-native,apprennet/react-native,pvinis/react-native-desktop,imDangerous/react-native,imDangerous/react-native,ProjectSeptemberInc/react-native,mchinyakov/react-native,CodeLinkIO/react-native,Swaagie/react-native,doochik/react-native,sghiassy/react-native,htc2u/react-native,spicyj/react-native,Andreyco/react-native,shrutic123/react-native,compulim/react-native,thotegowda/react-native,skatpgusskat/react-native,a2/react-native,nathanajah/react-native,spicyj/react-native,vjeux/react-native,mchinyakov/react-native,quyixia/react-native,almost/react-native,exponentjs/react-native,exponentjs/react-native,spicyj/react-native,tgoldenberg/react-native,farazs/react-native,PlexChat/react-native,tszajna0/react-native,pvinis/react-native-desktop,marlonandrade/react-native,Andreyco/react-native,chirag04/react-native,adamjmcgrath/react-native,mihaigiurgeanu/react-native,dubert/react-native,brentvatne/react-native,cdlewis/react-native,ProjectSeptemberInc/react-native,puf/react-native,brentvatne/react-native,arbesfeld/react-native,martinbigio/react-native,dikaiosune/react-native,ptomasroos/react-native,satya164/react-native,eduvon0220/react-native,jevakallio/react-native,chetstone/react-native,Emilios1995/react-native
--- +++ @@ -16,10 +16,18 @@ {detached: true}); } } else { - child_process.spawn('sh', [ - path.resolve(__dirname, '..', 'packager', 'packager.sh'), + if (/^win/.test(process.platform)) { + child_process.spawn('node', [ + path.resolve(__dirname, '..', 'packager', 'packager.js'), '--projectRoots', process.cwd(), - ], {stdio: 'inherit'}); + ], {stdio: 'inherit'}); + } else { + child_process.spawn('sh', [ + path.resolve(__dirname, '..', 'packager', 'packager.sh'), + '--projectRoots', + process.cwd(), + ], {stdio: 'inherit'}); + } } };
c2bb3dff75eb411d13f34831259d24f5955cc04e
packages/@sanity/cli/src/commands/version/versionCommand.js
packages/@sanity/cli/src/commands/version/versionCommand.js
import promiseProps from 'promise-props-recursive' import getLocalVersion from '../../npm-bridge/getLocalVersion' import getGlobalSanityCliVersion from '../../util/getGlobalSanityCliVersion' import pkg from '../../../package.json' export default { name: 'version', signature: 'version', description: 'Shows the installed versions of core Sanity components', action: ({print}) => { promiseProps({ local: getLocalVersion(pkg.name), global: getGlobalSanityCliVersion() }).then(versions => { if (versions.global) { print(`${pkg.name} (global): ${versions.global}`) } if (versions.local) { print(`${pkg.name} (local): ${versions.local}`) } }) } }
import promiseProps from 'promise-props-recursive' import getLocalVersion from '../../npm-bridge/getLocalVersion' import getGlobalSanityCliVersion from '../../util/getGlobalSanityCliVersion' import pkg from '../../../package.json' export default { name: 'version', signature: 'version', description: 'Shows the installed versions of core Sanity components', action: ({print}) => promiseProps({ local: getLocalVersion(pkg.name), global: getGlobalSanityCliVersion() }).then(versions => { if (versions.global) { print(`${pkg.name} (global): ${versions.global}`) } if (versions.local) { print(`${pkg.name} (local): ${versions.local}`) } }) }
Return promise from version command
Return promise from version command
JavaScript
mit
sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity
--- +++ @@ -7,7 +7,7 @@ name: 'version', signature: 'version', description: 'Shows the installed versions of core Sanity components', - action: ({print}) => { + action: ({print}) => promiseProps({ local: getLocalVersion(pkg.name), global: getGlobalSanityCliVersion() @@ -20,5 +20,4 @@ print(`${pkg.name} (local): ${versions.local}`) } }) - } }
ceb5988e1c62a500f3bd70def008e350ff066bb6
src/mixins/reactiveProp.js
src/mixins/reactiveProp.js
module.exports = { props: { chartData: { required: true } }, watch: { 'chartData': { handler (newData, oldData) { if (oldData) { let chart = this._chart // Get new and old DataSet Labels let newDatasetLabels = newData.datasets.map((dataset) => { return dataset.label }) let oldDatasetLabels = oldData.datasets.map((dataset) => { return dataset.label }) // Stringify 'em for easier compare const oldLabels = JSON.stringify(oldDatasetLabels) const newLabels = JSON.stringify(newDatasetLabels) // Check if Labels are equal and if dataset length is equal if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) { newData.datasets.forEach((dataset, i) => { chart.data.datasets[i] = dataset }) chart.data.labels = newData.labels chart.update() } else { chart.destroy() this.renderChart(this.chartData, this.options) } } } } } }
module.exports = { props: { chartData: { required: true } }, watch: { 'chartData': { handler (newData, oldData) { if (oldData) { let chart = this._chart // Get new and old DataSet Labels let newDatasetLabels = newData.datasets.map((dataset) => { return dataset.label }) let oldDatasetLabels = oldData.datasets.map((dataset) => { return dataset.label }) // Stringify 'em for easier compare const oldLabels = JSON.stringify(oldDatasetLabels) const newLabels = JSON.stringify(newDatasetLabels) // Check if Labels are equal and if dataset length is equal if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) { newData.datasets.forEach((dataset, i) => { // Get new and old dataset keys const oldDatasetKeys = Object.keys(oldData.datasets[i]) const newDatasetKeys = Object.keys(dataset) // Get keys that aren't present in the new data const deletionKeys = oldDatasetKeys.filter((key) => { return key !== '_meta' && newDatasetKeys.indexOf(key) === -1 }) // Remove outdated key-value pairs deletionKeys.forEach((deletionKey) => { delete chart.data.datasets[i][deletionKey] }) // Update attributes individually to avoid re-rendering the entire chart for (const attribute in dataset) { if (dataset.hasOwnProperty(attribute)) { chart.data.datasets[i][attribute] = dataset[attribute] } } }) chart.data.labels = newData.labels chart.update() } else { chart.destroy() this.renderChart(this.chartData, this.options) } } } } } }
Resolve reactive props animation issue.
Resolve reactive props animation issue. A small consequence of replacing the entire dataset in the mixins files is that it causes certain charts to completely re-render even if only the 'data' attribute of a dataset is changing. In my case, I set up a reactive doughnut chart with two data points but whenever the data values change, instead of shifting the fill coloring, it completely re-renders the entire chart. You can see the issue in this fiddle (note the constant re-rendering): https://jsfiddle.net/sg0c82ev/11/ To solve the issue, I instead run a diff between the new and old dataset keys, remove keys that aren't present in the new data, and update the rest of the attributes individually. After making these changes my doughnut chart is animating as expected (even when adding and removing new dataset attributes). A fiddle with my changes: https://jsfiddle.net/sg0c82ev/12/ Perhaps this is too specific of a scenario to warrant a complexity increase like this (and better suited for a custom watcher) but I figured it would be better to dump it here and make it available for review. Let me know what you think.
JavaScript
mit
apertureless/vue-chartjs,apertureless/vue-chartjs,apertureless/vue-chartjs
--- +++ @@ -27,7 +27,26 @@ // Check if Labels are equal and if dataset length is equal if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) { newData.datasets.forEach((dataset, i) => { - chart.data.datasets[i] = dataset + // Get new and old dataset keys + const oldDatasetKeys = Object.keys(oldData.datasets[i]) + const newDatasetKeys = Object.keys(dataset) + + // Get keys that aren't present in the new data + const deletionKeys = oldDatasetKeys.filter((key) => { + return key !== '_meta' && newDatasetKeys.indexOf(key) === -1 + }) + + // Remove outdated key-value pairs + deletionKeys.forEach((deletionKey) => { + delete chart.data.datasets[i][deletionKey] + }) + + // Update attributes individually to avoid re-rendering the entire chart + for (const attribute in dataset) { + if (dataset.hasOwnProperty(attribute)) { + chart.data.datasets[i][attribute] = dataset[attribute] + } + } }) chart.data.labels = newData.labels
07312012c0b682c6dc8a13ca6afabbabd9e9957e
src/js/services/new-form.js
src/js/services/new-form.js
'use strict'; angular.module('Teem') .factory('NewForm', [ '$location', '$window', '$rootScope', function($location, $window, $rootScope) { var scope, objectName, scopeFn = { isNew () { return $location.search().form === 'new'; }, cancelNew () { scope[objectName].delete(); $location.search('form', undefined); $window.history.back(); }, confirmNew () { $location.search('form', undefined); scope.invite.selected.forEach(function(i){ scope.project.addContributor(i); }); $rootScope.$broadcast('teem.project.join'); } }; function initialize(s, o) { scope = s; objectName = o; Object.assign(scope, scopeFn); } return { initialize }; }]);
'use strict'; angular.module('Teem') .factory('NewForm', [ '$location', '$window', '$rootScope', function($location, $window, $rootScope) { var scope, objectName, scopeFn = { isNew () { return $location.search().form === 'new'; }, cancelNew () { scope[objectName].delete(); $location.search('form', undefined); $window.history.back(); }, confirmNew () { $location.search('form', undefined); // TODO fix with community invite if (objectName === 'project') { scope.invite.selected.forEach(function(i){ scope.project.addContributor(i); }); } $rootScope.$broadcast('teem.' + objectName + '.join'); } }; function initialize(s, o) { scope = s; objectName = o; Object.assign(scope, scopeFn); } return { initialize }; }]);
Fix new form confirm code
Fix new form confirm code @atfornes please note that this code is common for the + buttons of project and community Fixes #249
JavaScript
agpl-3.0
P2Pvalue/pear2pear,P2Pvalue/teem,Grasia/teem,Grasia/teem,P2Pvalue/pear2pear,Grasia/teem,P2Pvalue/teem,P2Pvalue/teem
--- +++ @@ -20,11 +20,14 @@ confirmNew () { $location.search('form', undefined); - scope.invite.selected.forEach(function(i){ - scope.project.addContributor(i); - }); + // TODO fix with community invite + if (objectName === 'project') { + scope.invite.selected.forEach(function(i){ + scope.project.addContributor(i); + }); + } - $rootScope.$broadcast('teem.project.join'); + $rootScope.$broadcast('teem.' + objectName + '.join'); } };
216e7e7026f515d95a4c2a1f3dc4f1858d4bf4a3
src/scripts/StationList.js
src/scripts/StationList.js
/** ngInject **/ function StationListCtrl($scope, $interval, EventBus, PvlService) { let vm = this; vm.imgUrls = {}; vm.nowPlaying = {}; vm.currentIndex = null; vm.setSelected = setSelected; var refreshDataBindings = $interval(null, 1000); function setSelected(index) { vm.currentIndex = index; EventBus.emit('pvl:stationSelect', vm.stations[index]); } PvlService.getStations('audio') .then(stations => vm.stations = stations); let nowPlayingListener = (event, data) => { vm.nowPlaying = data; }; let unsubNowPlaying = EventBus.on('pvl:nowPlaying', nowPlayingListener); $scope.$on('$destroy', () => { $interval.cancel(refreshDataBindings); unsubNowPlaying(); }); } function StationListDirective() { return { restrict: 'E', templateUrl: '/stationList.html', scope: true, controller: StationListCtrl, controllerAs: 'stationList', bindToController: true }; } angular .module('PVL') .directive('pvlStationList', StationListDirective);
/** ngInject **/ function StationListCtrl($scope, EventBus, PvlService) { let vm = this; vm.imgUrls = {}; vm.nowPlaying = {}; vm.currentIndex = null; vm.setSelected = setSelected; function setSelected(index) { vm.currentIndex = index; EventBus.emit('pvl:stationSelect', vm.stations[index]); } PvlService.getStations('audio') .then(stations => vm.stations = stations); let nowPlayingListener = (event, data) => { vm.nowPlaying = data; }; let unsubNowPlaying = EventBus.on('pvl:nowPlaying', nowPlayingListener); $scope.$on('$destroy', () => { unsubNowPlaying(); }); } function StationListDirective() { return { restrict: 'E', templateUrl: '/stationList.html', scope: true, controller: StationListCtrl, controllerAs: 'stationList', bindToController: true }; } angular .module('PVL') .directive('pvlStationList', StationListDirective);
Revert "Quick patch to constantly update currently playing song without requiring user interaction"
Revert "Quick patch to constantly update currently playing song without requiring user interaction"
JavaScript
mit
berwyn/Ponyville-Live--Desktop-App,Poniverse/PVLive-Chrome-Desktop-App,berwyn/Ponyville-Live--Desktop-App,BravelyBlue/PVLive-Chrome-Desktop-App,berwyn/Ponyville-Live--Desktop-App,Poniverse/PVLive-Chrome-Desktop-App,BravelyBlue/PVLive-Chrome-Desktop-App
--- +++ @@ -1,5 +1,5 @@ /** ngInject **/ -function StationListCtrl($scope, $interval, EventBus, PvlService) { +function StationListCtrl($scope, EventBus, PvlService) { let vm = this; vm.imgUrls = {}; @@ -7,8 +7,6 @@ vm.currentIndex = null; vm.setSelected = setSelected; - var refreshDataBindings = $interval(null, 1000); - function setSelected(index) { vm.currentIndex = index; EventBus.emit('pvl:stationSelect', vm.stations[index]); @@ -23,7 +21,6 @@ let unsubNowPlaying = EventBus.on('pvl:nowPlaying', nowPlayingListener); $scope.$on('$destroy', () => { - $interval.cancel(refreshDataBindings); unsubNowPlaying(); }); }
4c758e6856af13f199660bcfc74874fe06928bff
media/js/google-search.js
media/js/google-search.js
google.load('search', '1', {style : google.loader.themes.V2_DEFAULT}); google.setOnLoadCallback(function() { var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl( '003721718359151553648:qipcq6hq6uy', customSearchOptions); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); customSearchControl.setSearchStartingCallback( this, function(control, searcher) { searcher.setRestriction( google.search.Search.RESTRICT_EXTENDED_ARGS, { "filter" : "0"}); } ); var options = new google.search.DrawOptions(); options.enableSearchResultsOnly(); customSearchControl.draw('cse', options); function parseParamsFromUrl() { var params = {}; var parts = window.location.search.substr(1).split('\x26'); for (var i = 0; i < parts.length; i++) { var keyValuePair = parts[i].split('='); var key = decodeURIComponent(keyValuePair[0]); params[key] = keyValuePair[1] ? decodeURIComponent(keyValuePair[1].replace(/\+/g, ' ')) : keyValuePair[1]; } return params; } var urlParams = parseParamsFromUrl(); var queryParamName = "q"; if (urlParams[queryParamName]) { customSearchControl.execute(urlParams[queryParamName]); $('#searchbox').val(urlParams[queryParamName]); } }, true);
google.load('search', '1', {style : google.loader.themes.V2_DEFAULT}); google.setOnLoadCallback(function() { var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl( '003721718359151553648:qipcq6hq6uy', customSearchOptions); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.enableSearchResultsOnly(); customSearchControl.draw('cse', options); function parseParamsFromUrl() { var params = {}; var parts = window.location.search.substr(1).split('\x26'); for (var i = 0; i < parts.length; i++) { var keyValuePair = parts[i].split('='); var key = decodeURIComponent(keyValuePair[0]); params[key] = keyValuePair[1] ? decodeURIComponent(keyValuePair[1].replace(/\+/g, ' ')) : keyValuePair[1]; } return params; } var urlParams = parseParamsFromUrl(); var queryParamName = "q"; if (urlParams[queryParamName]) { customSearchControl.execute(urlParams[queryParamName]); $('#searchbox').val(urlParams[queryParamName]); } }, true);
Remove code that did not fix google search pagination issue.
Remove code that did not fix google search pagination issue.
JavaScript
bsd-3-clause
mozilla/betafarm,mozilla/betafarm,mozilla/betafarm,mozilla/betafarm
--- +++ @@ -4,14 +4,6 @@ var customSearchControl = new google.search.CustomSearchControl( '003721718359151553648:qipcq6hq6uy', customSearchOptions); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); - customSearchControl.setSearchStartingCallback( - this, - function(control, searcher) { - searcher.setRestriction( - google.search.Search.RESTRICT_EXTENDED_ARGS, - { "filter" : "0"}); - } - ); var options = new google.search.DrawOptions(); options.enableSearchResultsOnly(); customSearchControl.draw('cse', options);
3bdb76d839b7f9424136e791f581cf1c473615c7
scripts/download-win-lib.js
scripts/download-win-lib.js
var download = require('./download').download; var path = require('path'); var fs = require('fs'); var TAR_URL = 'https://github.com/nteract/zmq-prebuilt/releases/download/win-libzmq-4.1.5-v140/libzmq-' + process.arch + '.lib'; var DIR_NAME = path.join(__dirname, '..', 'windows', 'lib'); var FILE_NAME = path.join(DIR_NAME, 'libzmq.lib'); if (!fs.existsSync(DIR_NAME)) { fs.mkdirSync(DIR_NAME); } download(TAR_URL, FILE_NAME);
var download = require('./download').download; var path = require('path'); var fs = require('fs'); var TAR_URL = 'https://github.com/nteract/libzmq-win/releases/download/v1.0.0/libzmq-' + process.arch + '.lib'; var DIR_NAME = path.join(__dirname, '..', 'windows', 'lib'); var FILE_NAME = path.join(DIR_NAME, 'libzmq.lib'); if (!fs.existsSync(DIR_NAME)) { fs.mkdirSync(DIR_NAME); } download(TAR_URL, FILE_NAME);
Store windows lib in different repo
Store windows lib in different repo
JavaScript
mit
lgeiger/zmq-prebuilt,lgeiger/zmq-prebuilt,interpretor/zeromq.js,lgeiger/zmq-prebuilt,interpretor/zeromq.js,interpretor/zeromq.js,interpretor/zeromq.js,lgeiger/zmq-prebuilt,lgeiger/zmq-prebuilt,interpretor/zeromq.js
--- +++ @@ -2,7 +2,7 @@ var path = require('path'); var fs = require('fs'); -var TAR_URL = 'https://github.com/nteract/zmq-prebuilt/releases/download/win-libzmq-4.1.5-v140/libzmq-' + process.arch + '.lib'; +var TAR_URL = 'https://github.com/nteract/libzmq-win/releases/download/v1.0.0/libzmq-' + process.arch + '.lib'; var DIR_NAME = path.join(__dirname, '..', 'windows', 'lib'); var FILE_NAME = path.join(DIR_NAME, 'libzmq.lib');
89fc255726bb2073f095bfd82ba05f00b217e3e2
src/components/OutsideClickable/OutsideClickable.js
src/components/OutsideClickable/OutsideClickable.js
/* OutsideClickable only accepts one top-level child */ import React, { Component, Children, cloneElement } from "react"; import ReactDOM from "react-dom"; import PropTypes from "prop-types"; export default class OutsideClickable extends Component { static propTypes = { children: PropTypes.node, onOutsideClick: PropTypes.func.isRequired, className: PropTypes.string, toggle: PropTypes.func }; constructor(props) { super(props); } componentDidMount() { window.addEventListener("click", this.contains); } componentWillUnmount() { window.removeEventListener("click", this.contains); } contains = e => { const node = this.outsideClickable; if (node && node.contains(e.target) === false) { this.props.onOutsideClick.call(); } }; onlyOneChild = () => { if (this.props.children.length > 1) { throw new Error("Multiple children are not allowed in OutsideClickable"); return; } return true; }; render() { return ( this.onlyOneChild() && Children.map(this.props.children, child => cloneElement(child, { ref: node => { // Keep your own reference this.outsideClickable = node; // Call the original ref, if any const { ref } = child; if (typeof ref === "function") { ref(node); } } }) ) ); } }
/* OutsideClickable only accepts one top-level child */ import React, { Component, Children, cloneElement } from "react"; import ReactDOM from "react-dom"; import PropTypes from "prop-types"; export default class OutsideClickable extends Component { static propTypes = { children: PropTypes.node, onOutsideClick: PropTypes.func.isRequired, className: PropTypes.string, toggle: PropTypes.func }; constructor(props) { super(props); } componentDidMount() { const event = "ontouchstart" in window ? "touchstart" : "click"; console.log(event); document.body.addEventListener(event, this.contains); } componentWillUnmount() { const event = "ontouchstart" in window ? "touchstart" : "click"; document.body.removeEventListener(event, this.contains); } contains = e => { const node = this.outsideClickable; if (node && node.contains(e.target) === false) { this.props.onOutsideClick.call(); } }; onlyOneChild = () => { if (this.props.children.length > 1) { throw new Error("Multiple children are not allowed in OutsideClickable"); } return true; }; render() { return ( this.onlyOneChild() && Children.map(this.props.children, child => cloneElement(child, { ref: node => { // Keep your own reference this.outsideClickable = node; // Call the original ref, if any const { ref } = child; if (typeof ref === "function") { ref(node); } } }) ) ); } }
Fix iOS and Android touch events
Fix iOS and Android touch events
JavaScript
mit
tutti-ch/react-styleguide,tutti-ch/react-styleguide
--- +++ @@ -16,15 +16,19 @@ } componentDidMount() { - window.addEventListener("click", this.contains); + const event = "ontouchstart" in window ? "touchstart" : "click"; + console.log(event); + document.body.addEventListener(event, this.contains); } componentWillUnmount() { - window.removeEventListener("click", this.contains); + const event = "ontouchstart" in window ? "touchstart" : "click"; + document.body.removeEventListener(event, this.contains); } contains = e => { const node = this.outsideClickable; + if (node && node.contains(e.target) === false) { this.props.onOutsideClick.call(); } @@ -33,8 +37,8 @@ onlyOneChild = () => { if (this.props.children.length > 1) { throw new Error("Multiple children are not allowed in OutsideClickable"); - return; } + return true; };
dd22023e3c6aa064b1e5881cfd7f48a2e79e894e
defaults/preferences/spamness.js
defaults/preferences/spamness.js
pref("extensions.rspamd-spamness.header", "x-spamd-result"); pref("extensions.rspamd-spamness.display.column", 0); pref("extensions.rspamd-spamness.display.messageScore", true); pref("extensions.rspamd-spamness.display.messageRules", true); pref("extensions.rspamd-spamness.display.messageGreylist", true); pref("extensions.rspamd-spamness.headers.show_n_lines_before_more", 2); pref("extensions.rspamd-spamness.headers.symbols_order", "score"); pref("extensions.rspamd-spamness.isDefaultColumn", true); pref("extensions.rspamd-spamness.installationGreeting", true); pref("extensions.rspamd-spamness.trainingButtons.defaultAction", "move");
/* global pref:false */ /* eslint strict: ["error", "never"] */ pref("extensions.rspamd-spamness.header", "x-spamd-result"); pref("extensions.rspamd-spamness.display.column", 0); pref("extensions.rspamd-spamness.display.messageScore", true); pref("extensions.rspamd-spamness.display.messageRules", true); pref("extensions.rspamd-spamness.display.messageGreylist", true); pref("extensions.rspamd-spamness.headers.show_n_lines_before_more", 2); pref("extensions.rspamd-spamness.headers.symbols_order", "score"); pref("extensions.rspamd-spamness.isDefaultColumn", true); pref("extensions.rspamd-spamness.installationGreeting", true); pref("extensions.rspamd-spamness.trainingButtons.defaultAction", "move");
Add ESLint config to preferences
[Chore] Add ESLint config to preferences
JavaScript
bsd-3-clause
moisseev/spamness,moisseev/rspamd-spamness,moisseev/rspamd-spamness
--- +++ @@ -1,3 +1,6 @@ +/* global pref:false */ +/* eslint strict: ["error", "never"] */ + pref("extensions.rspamd-spamness.header", "x-spamd-result"); pref("extensions.rspamd-spamness.display.column", 0); pref("extensions.rspamd-spamness.display.messageScore", true);
2fffa35bd7aef3a2117b1804914c9fdb13749a44
course/object_mutations.js
course/object_mutations.js
/* * Avoiding Object Mutations. * * @author: Francisco Maria Calisto * */ const toggleTodo = (todo) => { return { id: todo.id, text: todo.text, completed: !todo.completed }; }; const testToggleTodo = () => { const todoBefore = { id: 0, text: 'Learn Redux', completed: false }; const todoAfter = { id: 0, text: 'Learn Redux', completed: true }; deepFreeze(todoBefore); expect( toggleTodo(todoBefore) ).toEqual(todoAfter); }; testToggleTodo(); console.log('All tests passed.');
/* * Avoiding Object Mutations. * * @author: Francisco Maria Calisto * */ const toggleTodo = (todo) => { return Object.assign({}, todo, { completed: !todo.completed }); }; const testToggleTodo = () => { const todoBefore = { id: 0, text: 'Learn Redux', completed: false }; const todoAfter = { id: 0, text: 'Learn Redux', completed: true }; deepFreeze(todoBefore); expect( toggleTodo(todoBefore) ).toEqual(todoAfter); }; testToggleTodo(); console.log('All tests passed.');
Return Toggle Todo Object Assign
[UPDATE] Return Toggle Todo Object Assign
JavaScript
mit
FMCalisto/redux-get-started,FMCalisto/redux-get-started
--- +++ @@ -7,13 +7,11 @@ const toggleTodo = (todo) => { - return { + return Object.assign({}, todo, { - id: todo.id, - text: todo.text, completed: !todo.completed - }; + }); };
ac20f325b34bc952d89d0073e036aa2f87e79388
src/delir-core/tests/delir/plugin-registory-spec.js
src/delir-core/tests/delir/plugin-registory-spec.js
// @flow import path from 'path'; import PluginRegistory from '../../src/services/plugin-registory' describe('PluginRegistory', () => { it('exporting: PluginFeatures', () => { expect(PluginRegistory.PluginFeatures).to.not.eql(null) expect(PluginRegistory.PluginFeatures).to.be.an('object') }) it('loading plugins', async () => { const r = new PluginRegistory() const result = await r.loadPackageDir(path.join(__dirname, '../../src/plugins')) expect(result).to.not.empty() expect(result).to.have.key('packages') expect(result).to.have.key('failed') expect(result.packages).to.be.an('object') expect(result.failed).to.be.an(Array) }) })
// @flow import path from 'path'; import PluginRegistory from '../../src/services/plugin-registory' describe('PluginRegistory', () => { it('exporting: PluginFeatures', () => { expect(PluginRegistory.PluginFeatures).to.not.eql(null) expect(PluginRegistory.PluginFeatures).to.be.an('object') }) it('loading plugins', async () => { // mock missing method in mocha global.require = require const r = new PluginRegistory() const result = await r.loadPackageDir(path.join(__dirname, '../../src/plugins')) expect(result).to.not.empty() expect(result).to.have.key('packages') expect(result).to.have.key('failed') expect(result.packages).to.be.an('object') expect(result.failed).to.be.an(Array) delete global.require }) })
Fix PluginRegistry error (missing global.require)
Fix PluginRegistry error (missing global.require)
JavaScript
mit
Ragg-/Delir,Ragg-/Delir,Ragg-/Delir,Ragg-/Delir
--- +++ @@ -9,6 +9,9 @@ }) it('loading plugins', async () => { + // mock missing method in mocha + global.require = require + const r = new PluginRegistory() const result = await r.loadPackageDir(path.join(__dirname, '../../src/plugins')) @@ -18,5 +21,7 @@ expect(result.packages).to.be.an('object') expect(result.failed).to.be.an(Array) + + delete global.require }) })
f1fb384cd62dc13d0b4647c9f988f6f46cbf4b6f
src/test/run-make/wasm-export-all-symbols/verify.js
src/test/run-make/wasm-export-all-symbols/verify.js
const fs = require('fs'); const process = require('process'); const assert = require('assert'); const buffer = fs.readFileSync(process.argv[2]); let m = new WebAssembly.Module(buffer); let list = WebAssembly.Module.exports(m); console.log('exports', list); const my_exports = {}; let nexports = 0; for (const entry of list) { if (entry.kind == 'function'){ nexports += 1; } my_exports[entry.name] = true; } if (my_exports.foo === undefined) throw new Error("`foo` wasn't defined"); if (my_exports.FOO === undefined) throw new Error("`FOO` wasn't defined"); if (my_exports.main === undefined) { if (nexports != 1) throw new Error("should only have one function export"); } else { if (nexports != 2) throw new Error("should only have two function exports"); }
const fs = require('fs'); const process = require('process'); const assert = require('assert'); const buffer = fs.readFileSync(process.argv[2]); let m = new WebAssembly.Module(buffer); let list = WebAssembly.Module.exports(m); console.log('exports', list); const my_exports = {}; let nexports = 0; for (const entry of list) { if (entry.kind == 'function'){ nexports += 1; } my_exports[entry.name] = entry.kind; } if (my_exports.foo != "function") throw new Error("`foo` wasn't defined"); if (my_exports.FOO != "global") throw new Error("`FOO` wasn't defined"); if (my_exports.main === undefined) { if (nexports != 1) throw new Error("should only have one function export"); } else { if (nexports != 2) throw new Error("should only have two function exports"); }
Check for the entry kind
Check for the entry kind
JavaScript
apache-2.0
aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust
--- +++ @@ -14,13 +14,13 @@ if (entry.kind == 'function'){ nexports += 1; } - my_exports[entry.name] = true; + my_exports[entry.name] = entry.kind; } -if (my_exports.foo === undefined) +if (my_exports.foo != "function") throw new Error("`foo` wasn't defined"); -if (my_exports.FOO === undefined) +if (my_exports.FOO != "global") throw new Error("`FOO` wasn't defined"); if (my_exports.main === undefined) {
beeeec389b04ae44852b3388afa760bbc7f1a3df
components/link/Link.js
components/link/Link.js
import React, { Fragment, PureComponent } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import theme from './theme.css'; class Link extends PureComponent { render() { const { children, className, icon, iconPlacement, element, inherit, ...others } = this.props; const classNames = cx( theme['link'], { [theme['inherit']]: inherit, }, className, ); const ChildrenWrapper = icon ? 'span' : Fragment; const Element = element || 'a'; return ( <Element className={classNames} data-teamleader-ui="link" {...others}> {icon && iconPlacement === 'left' && icon} <ChildrenWrapper>{children}</ChildrenWrapper> {icon && iconPlacement === 'right' && icon} </Element> ); } } Link.propTypes = { children: PropTypes.node.isRequired, className: PropTypes.string, /** The icon displayed inside the button. */ icon: PropTypes.element, /** The position of the icon inside the button. */ iconPlacement: PropTypes.oneOf(['left', 'right']), inherit: PropTypes.bool, element: PropTypes.element, }; Link.defaultProps = { className: '', inherit: true, }; export default Link;
import React, { Fragment, PureComponent } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import theme from './theme.css'; class Link extends PureComponent { render() { const { children, className, icon, iconPlacement, element, inherit, ...others } = this.props; const classNames = cx( theme['link'], { [theme['inherit']]: inherit, }, className, ); const ChildrenWrapper = icon ? 'span' : Fragment; const Element = element; return ( <Element className={classNames} data-teamleader-ui="link" {...others}> {icon && iconPlacement === 'left' && icon} <ChildrenWrapper>{children}</ChildrenWrapper> {icon && iconPlacement === 'right' && icon} </Element> ); } } Link.propTypes = { children: PropTypes.node.isRequired, className: PropTypes.string, /** The icon displayed inside the button. */ icon: PropTypes.element, /** The position of the icon inside the button. */ iconPlacement: PropTypes.oneOf(['left', 'right']), inherit: PropTypes.bool, element: PropTypes.element, }; Link.defaultProps = { className: '', element: 'a', inherit: true, }; export default Link;
Add element to defaultProps and assign 'a' to it
Add element to defaultProps and assign 'a' to it
JavaScript
mit
teamleadercrm/teamleader-ui
--- +++ @@ -16,7 +16,7 @@ ); const ChildrenWrapper = icon ? 'span' : Fragment; - const Element = element || 'a'; + const Element = element; return ( <Element className={classNames} data-teamleader-ui="link" {...others}> @@ -41,6 +41,7 @@ Link.defaultProps = { className: '', + element: 'a', inherit: true, };
4efc08fcf1bc7ed6b0c74b29d6c1fc7373d3c2ad
core/package.js
core/package.js
Package.describe({ name: 'svelte:core', version: '1.40.1_1', summary: 'Svelte compiler core', git: 'https://github.com/meteor-svelte/meteor-svelte.git' }); Npm.depends({ htmlparser2: '3.9.2', 'source-map': '0.5.6', svelte: '1.40.1' }); Package.onUse(function (api) { api.versionsFrom('1.4.2.3'); // Dependencies for `SvelteCompiler` api.use([ 'caching-compiler@1.1.9', 'babel-compiler@6.13.0', 'ecmascript@0.6.1' ]); // Dependencies for compiled Svelte components api.imply([ 'modules', 'ecmascript-runtime', 'babel-runtime', 'promise' ]); // Make `SvelteCompiler` available to build plugins. api.mainModule('svelte-compiler.js'); api.export('SvelteCompiler', 'server'); });
Package.describe({ name: 'svelte:core', version: '1.40.1_1', summary: 'Svelte compiler core', git: 'https://github.com/meteor-svelte/meteor-svelte.git' }); Npm.depends({ htmlparser2: '3.9.2', 'source-map': '0.5.6', svelte: '1.40.1' }); Package.onUse(function (api) { api.versionsFrom('1.4.2.3'); // Dependencies for `SvelteCompiler` api.use([ 'caching-compiler@1.1.9', 'babel-compiler@6.13.0||7.0.0', 'ecmascript@0.6.1' ]); // Dependencies for compiled Svelte components api.imply([ 'modules', 'ecmascript-runtime', 'babel-runtime', 'promise' ]); // Make `SvelteCompiler` available to build plugins. api.mainModule('svelte-compiler.js'); api.export('SvelteCompiler', 'server'); });
Use `babel-compiler` 7.x for compatibility with Meteor 1.6.1
Use `babel-compiler` 7.x for compatibility with Meteor 1.6.1
JavaScript
mit
meteor-svelte/meteor-svelte
--- +++ @@ -17,7 +17,7 @@ // Dependencies for `SvelteCompiler` api.use([ 'caching-compiler@1.1.9', - 'babel-compiler@6.13.0', + 'babel-compiler@6.13.0||7.0.0', 'ecmascript@0.6.1' ]);
31c98ed24c50375890e579efaac52e53762c6b89
commands/copy-assets.js
commands/copy-assets.js
'use strict'; const path = require('path'); module.exports = (() => { // const akasha = require('../index'); const Command = require('cmnd').Command; class CopyAssetsCommand extends Command { constructor() { super('copy-assets'); } help() { return { description: 'Copy assets into output directory', args: [ 'config_file' ], }; } run(args, flags, vflags, callback) { const config = require(path.join(__dirname, args[0])); config.copyAssets() .then(() => { callback(null); }) .catch(err => { callback(err); }); } } return CopyAssetsCommand; })();
'use strict'; const path = require('path'); module.exports = (() => { // const akasha = require('../index'); const Command = require('cmnd').Command; class CopyAssetsCommand extends Command { constructor() { super('copy-assets'); } help() { return { description: 'Copy assets into output directory', args: [ 'config_file' ], }; } run(args, flags, vflags, callback) { if (!args[0]) callback(new Error("copy-assets: no config file name given")); const config = require(path.join(__dirname, args[0])); config.copyAssets() .then(() => { callback(null); }) .catch(err => { callback(err); }); } } return CopyAssetsCommand; })();
Check for missing config file name
Check for missing config file name
JavaScript
apache-2.0
akashacms/akasharender,akashacms/akasharender,akashacms/akasharender
--- +++ @@ -21,6 +21,8 @@ } run(args, flags, vflags, callback) { + + if (!args[0]) callback(new Error("copy-assets: no config file name given")); const config = require(path.join(__dirname, args[0]));
8d379ebcb0ac8087fe1f4ead76722db46efc913f
test/parser.js
test/parser.js
var testCase = require('nodeunit').testCase, parser = require('../language/parser'), tokenizer = require('../language/tokenizer') test('TextLiteral', '"hello world"', static("hello world")) test('NumberLiteral', '1', static(1)) test('Declaration', 'let greeting = "hello"', { type:'DECLARATION', name:'greeting', value: static("hello") }) /* UTIL */ function test(name, code, expectedAST) { module.exports['test '+name] = function(assert) { var ast = parse(code) assert.deepEqual(ast, expectedAST) assert.done() } } function static(value) { var ast = { type:'STATIC', value:value } ast.valueType = typeof value return ast } function parse(code) { tokens = tokenizer.tokenize(code) return pruneInfo(parser.parse(tokens)) } function pruneInfo(ast) { for (var key in ast) { if (key == 'info') { delete ast[key] } else if (typeof ast[key] == 'object') { pruneInfo(ast[key]) } } return ast }
var testCase = require('nodeunit').testCase, parser = require('../language/parser'), tokenizer = require('../language/tokenizer') /* TESTS */ test('text literal', '"hello world"', static("hello world")) test('number literal', '1', static(1)) test('declaration', 'let greeting = "hello"', { type:'DECLARATION', name:'greeting', value: static("hello") }) /* UTIL */ function test(name, code, expectedAST) { module.exports['test '+name] = function(assert) { var ast = parse(code) assert.deepEqual(ast, expectedAST) assert.done() } } function static(value) { var ast = { type:'STATIC', value:value } ast.valueType = typeof value return ast } function parse(code) { tokens = tokenizer.tokenize(code) return pruneInfo(parser.parse(tokens)) } function pruneInfo(ast) { for (var key in ast) { if (key == 'info') { delete ast[key] } else if (typeof ast[key] == 'object') { pruneInfo(ast[key]) } } return ast }
Make the tests more reader friendly
Make the tests more reader friendly
JavaScript
mit
marcuswestin/fun
--- +++ @@ -2,13 +2,10 @@ parser = require('../language/parser'), tokenizer = require('../language/tokenizer') -test('TextLiteral', '"hello world"', static("hello world")) -test('NumberLiteral', '1', static(1)) -test('Declaration', 'let greeting = "hello"', { - type:'DECLARATION', - name:'greeting', - value: static("hello") -}) +/* TESTS */ +test('text literal', '"hello world"', static("hello world")) +test('number literal', '1', static(1)) +test('declaration', 'let greeting = "hello"', { type:'DECLARATION', name:'greeting', value: static("hello") }) /* UTIL */
f27ace3130340b9b3ca2c452d9973a5b685c207a
less-engine.js
less-engine.js
module.exports = require("less/dist/less");
// Without these options Less will inject a `body { display: none !important; }` var less = window.less || (window.less = {}); less.async = true; module.exports = require("less/dist/less");
Make less use async mode in the browser
Make less use async mode in the browser This makes less use async mode in the browser. We were already doing this for our less requests, but now we also set it before less executes, otherwise it tries to do some weird display: none stuff. Fixes https://github.com/donejs/donejs/issues/1113
JavaScript
mit
stealjs/steal-less,stealjs/steal-less
--- +++ @@ -1 +1,5 @@ +// Without these options Less will inject a `body { display: none !important; }` +var less = window.less || (window.less = {}); +less.async = true; + module.exports = require("less/dist/less");
cc417b88c26628c4c68033d40d1bbc600b19aac8
tests/forms.js
tests/forms.js
import test from 'ava'; import plugin from '../lib/forms'; const formResponse = { body: { 'service-name': 'Foo Service One', 'service-desciption': 'Foo service lorem ipsum description', 'service-url': 'foo@bar.com', 'id': '07b45c32-001d-4c46-a785-0025b04f7f37', 'created': '2016-05-03 20:25:14', }, }; test('Parse data from a form', t => { t.pass(); }); test('Retrieve data from a form', t => { const data = plugin.getFormData(formResponse); t.is(data['service-name'], 'Foo Service One', 'should return name from response'); t.is(data['service-desciption'], 'Foo service lorem ipsum description', 'should return desc from response'); t.is(data['service-url'], 'foo@bar.com', 'should return url from response'); t.is(data.id, '07b45c32-001d-4c46-a785-0025b04f7f37', 'should return id from response'); t.ok(data.created !== formResponse.body.created, '`created` datetime should be re-created by function'); t.ok(data.created > formResponse.body.created, 'new `created` datetime variable will be more recent'); });
import test from 'ava'; import plugin from '../lib/forms'; const formResponse = { body: { 'service-name': 'Foo Service One', 'service-desciption': 'Foo service lorem ipsum description', 'service-url': 'foo@bar.com', 'id': '07b45c32-001d-4c46-a785-0025b04f7f37', 'created': '2016-05-03 20:25:14', }, }; test('Parse data from a form', t => { t.pass(); }); test('Retrieve data from a form', t => { const data = plugin.getFormData(formResponse); t.is(data['service-name'], 'Foo Service One', 'should return name from response'); t.is(data['service-desciption'], 'Foo service lorem ipsum description', 'should return desc from response'); t.is(data['service-url'], 'foo@bar.com', 'should return url from response'); t.is(data.id, '07b45c32-001d-4c46-a785-0025b04f7f37', 'should return id from response'); t.true(data.created !== formResponse.body.created, '`created` datetime should be re-created by function'); t.true(data.created > formResponse.body.created, 'new `created` datetime variable will be more recent'); });
Clean up old test assertions
:unamused: Clean up old test assertions
JavaScript
apache-2.0
scottnath/punchcard,poofichu/punchcard,scottnath/punchcard,punchcard-cms/punchcard,Snugug/punchcard,Snugug/punchcard,punchcard-cms/punchcard,poofichu/punchcard
--- +++ @@ -22,6 +22,6 @@ t.is(data['service-desciption'], 'Foo service lorem ipsum description', 'should return desc from response'); t.is(data['service-url'], 'foo@bar.com', 'should return url from response'); t.is(data.id, '07b45c32-001d-4c46-a785-0025b04f7f37', 'should return id from response'); - t.ok(data.created !== formResponse.body.created, '`created` datetime should be re-created by function'); - t.ok(data.created > formResponse.body.created, 'new `created` datetime variable will be more recent'); + t.true(data.created !== formResponse.body.created, '`created` datetime should be re-created by function'); + t.true(data.created > formResponse.body.created, 'new `created` datetime variable will be more recent'); });
11e3f029e325582d106637959240f7a55e22a8e4
lib/carcass.js
lib/carcass.js
var path = require('path'); var fs = require('fs'); var _ = require('underscore'); var debug = require('debug')('carcass:Index'); module.exports = function(obj) { // Register every file in a dir plus a namespace. obj.register = function(dir, namespace) { namespace || (namespace = 'plugins'); // TODO: validate namespace. obj[namespace] || (obj[namespace] = {}); // . dir = path.join(dir, namespace); fs.readdirSync(dir).forEach(function(filename) { if (!/\.js$/.test(filename)) return; var name = path.basename(filename, '.js'); function load() { var component = require(path.join(dir, name)); component.title || (component.title = name); return component; } obj[namespace].__defineGetter__(name, load); }); }; // A method that can make something ... // TODO: rename to plugin, and build a real mixin. obj.mixable = function(target) { target.plugin = function(namespace, title, options) { var factory = obj[namespace][title]; if (factory) { factory(options)(this); } return this; }; _.bindAll(target, 'plugin'); }; };
var path = require('path'); var fs = require('fs'); var _ = require('underscore'); var debug = require('debug')('carcass:Index'); var descriptor = Object.getOwnPropertyDescriptor; var properties = Object.getOwnPropertyNames; var defineProp = Object.defineProperty; module.exports = function(obj) { // Register every file in a dir plus a namespace. obj.register = function(dir, namespace) { namespace || (namespace = 'plugins'); // TODO: validate namespace. obj[namespace] || (obj[namespace] = {}); // . dir = path.join(dir, namespace); fs.readdirSync(dir).forEach(function(filename) { if (!/\.js$/.test(filename)) return; var name = path.basename(filename, '.js'); function load() { var component = require(path.join(dir, name)); component.title || (component.title = name); return component; } obj[namespace].__defineGetter__(name, load); }); }; // Add some helpers to a target object. obj.mixable = function(target) { if (!_.isObject(target)) return; // I organize my mixins into plugins. Each a plugin is a factory // function. Once invoked, the factory will return the mixin function, // and the mixin function can be used to modify an object directly. target.plugin = function(namespace, title, options) { var factory = obj[namespace][title]; if (factory) { factory(options)(this); } return this; }; // The common mixin, simply merge properties. target.mixin = function(source) { var self = this; properties(source).forEach(function(key) { defineProp(self, key, descriptor(source, key)); }); return this; }; _.bindAll(target, 'plugin', 'mixin'); }; };
Build a common mixin method.
Build a common mixin method.
JavaScript
mit
Wiredcraft/carcass
--- +++ @@ -2,6 +2,10 @@ var fs = require('fs'); var _ = require('underscore'); var debug = require('debug')('carcass:Index'); + +var descriptor = Object.getOwnPropertyDescriptor; +var properties = Object.getOwnPropertyNames; +var defineProp = Object.defineProperty; module.exports = function(obj) { @@ -25,9 +29,12 @@ }); }; - // A method that can make something ... - // TODO: rename to plugin, and build a real mixin. + // Add some helpers to a target object. obj.mixable = function(target) { + if (!_.isObject(target)) return; + // I organize my mixins into plugins. Each a plugin is a factory + // function. Once invoked, the factory will return the mixin function, + // and the mixin function can be used to modify an object directly. target.plugin = function(namespace, title, options) { var factory = obj[namespace][title]; if (factory) { @@ -35,7 +42,15 @@ } return this; }; - _.bindAll(target, 'plugin'); + // The common mixin, simply merge properties. + target.mixin = function(source) { + var self = this; + properties(source).forEach(function(key) { + defineProp(self, key, descriptor(source, key)); + }); + return this; + }; + _.bindAll(target, 'plugin', 'mixin'); }; };
90b029782ef2e7d0ba10c005931b79b9b06f7723
test/stores/literal-test.js
test/stores/literal-test.js
/* * literal-test.js: Tests for the nconf literal store. * * (C) 2011, Charlie Robbins * */ var vows = require('vows'), assert = require('assert'), helpers = require('../helpers'), nconf = require('../../lib/nconf'); vows.describe('nconf/stores/literal').addBatch({ "An instance of nconf.Literal": { topic: new nconf.Literal({ store: { foo: 'bar', one: 2 } }), "should have the correct methods defined": function (literal) { assert.equal(literal.type, 'literal'); assert.isFunction(literal.get); assert.isFunction(literal.set); assert.isFunction(literal.merge); assert.isFunction(literal.loadSync); }, "should have the correct values in the store": function (literal) { assert.equal(literal.store.foo, 'bar'); assert.equal(literal.store.one, 2); } } }).export(module);
/* * literal-test.js: Tests for the nconf literal store. * * (C) 2011, Charlie Robbins * */ var vows = require('vows'), assert = require('assert'), helpers = require('../helpers'), nconf = require('../../lib/nconf'); vows.describe('nconf/stores/literal').addBatch({ "An instance of nconf.Literal": { topic: new nconf.Literal({ foo: 'bar', one: 2 }), "should have the correct methods defined": function (literal) { assert.equal(literal.type, 'literal'); assert.isFunction(literal.get); assert.isFunction(literal.set); assert.isFunction(literal.merge); assert.isFunction(literal.loadSync); }, "should have the correct values in the store": function (literal) { assert.equal(literal.store.foo, 'bar'); assert.equal(literal.store.one, 2); } } }).export(module);
Update tests to use optional options API
[test] Update tests to use optional options API
JavaScript
mit
olalonde/nconf,philip1986/nconf,ChristianMurphy/nconf,HansHammel/nconf,remy/nconf,bryce-gibson/nconf,imjerrybao/nconf,indexzero/nconf,NickHeiner/nconf,Dependencies/nconf
--- +++ @@ -13,10 +13,8 @@ vows.describe('nconf/stores/literal').addBatch({ "An instance of nconf.Literal": { topic: new nconf.Literal({ - store: { - foo: 'bar', - one: 2 - } + foo: 'bar', + one: 2 }), "should have the correct methods defined": function (literal) { assert.equal(literal.type, 'literal');
8a677340e99b15271f6db7404f56295a2b1f6bd6
src/socket.js
src/socket.js
import SocketIO from 'socket.io'; import { createClient } from 'redis'; import { redisUrl } from './config'; const io = SocketIO(); io.use((socket, next) => { return next(); }); io.of('/live-chatroom') .use((socket, next) => { return next(); }) .on('connection', (socket) => { const redis = createClient(redisUrl); let currentRoom = ''; socket.on('subscribe', (id) => { currentRoom = `live:${id}:comments`; socket.join(currentRoom); io.of('/live-chatroom').in(currentRoom).clients((err, clients) => { if (clients.length === 1) { redis.subscribe(`${currentRoom}:latest`); } }); socket.emit('subscribed'); }); redis.on('message', (channel, message) => { io.of('/live-chatroom').in(channel.replace(':latest', '')).emit('comment', message); }); socket.on('unsubscribe', (id) => { socket.leave(id); socket.emit('unsubscribed'); }); socket.on('disconnect', () => { io.of('/live-chatroom').in(currentRoom).clients((err, clients) => { if (clients.length === 0) { const redis = createClient(redisUrl); redis.unsubscribe(`${currentRoom}:latest`); redis.quit(); } }); redis.quit(); }) }); export default io;
import SocketIO from 'socket.io'; import { createClient } from 'redis'; import { redisUrl } from './config'; const io = SocketIO(); io.use((socket, next) => { return next(); }); io.of('/live-chatroom') .use((socket, next) => { return next(); }) .on('connection', (socket) => { const redis = createClient(redisUrl); let currentRoom = ''; socket.on('subscribe', (id) => { currentRoom = `live:${id}:comments`; socket.join(currentRoom); redis.subscribe(`${currentRoom}:latest`); socket.emit('subscribed'); }); redis.on('message', (channel, message) => { socket.emit('comment', message); }); socket.on('unsubscribe', (id) => { socket.leave(id); socket.emit('unsubscribed'); }); socket.on('disconnect', () => { redis.unsubscribe(`${currentRoom}:latest`); redis.quit(); }) }); export default io;
Fix bug: if the reds subscriber quit, members who still in the room cannot receive the messages.
Fix bug: if the reds subscriber quit, members who still in the room cannot receive the messages.
JavaScript
mit
Calvin-Huang/LiveAPIExplore-Server,Calvin-Huang/LiveAPIExplore-Server
--- +++ @@ -21,34 +21,22 @@ currentRoom = `live:${id}:comments`; socket.join(currentRoom); - io.of('/live-chatroom').in(currentRoom).clients((err, clients) => { - if (clients.length === 1) { - redis.subscribe(`${currentRoom}:latest`); - } - }); + redis.subscribe(`${currentRoom}:latest`); socket.emit('subscribed'); }); redis.on('message', (channel, message) => { - io.of('/live-chatroom').in(channel.replace(':latest', '')).emit('comment', message); + socket.emit('comment', message); }); socket.on('unsubscribe', (id) => { socket.leave(id); - socket.emit('unsubscribed'); }); socket.on('disconnect', () => { - io.of('/live-chatroom').in(currentRoom).clients((err, clients) => { - if (clients.length === 0) { - const redis = createClient(redisUrl); - redis.unsubscribe(`${currentRoom}:latest`); - redis.quit(); - } - }); - + redis.unsubscribe(`${currentRoom}:latest`); redis.quit(); }) });
07493a4b131cf0185f1b653f12d6d9f1129626e4
database/emulator-suite.js
database/emulator-suite.js
export async function onDocumentReady() { //[START rtdb_emulator_connect] let firebaseConfig = { // Point to the RTDB emulator running on localhost. // Here we supply database namespace 'foo'. databaseURL: "http://localhost:9000?ns=foo" } var myApp = firebase.initializeApp(firebaseConfig); const db = myApp.database(); // [END rtdb_emulator_connect] }
export async function onDocumentReady() { //[START rtdb_emulator_connect] let firebaseConfig = { // Point to the RTDB emulator running on localhost. // Here we supply database namespace 'foo'. databaseURL: "http://localhost:9000?ns=foo" } var myApp = firebase.initializeApp(firebaseConfig); const db = myApp.database(); // [END rtdb_emulator_connect] } export async function flushRealtimeDatabase(anRTDBReference) { //[START rtdb_emulator_flush] anRTDBReference.child("/").set(null); // [END rtdb_emulator_connect] }
Add RTDB flush method using platform SDK methods.
Add RTDB flush method using platform SDK methods.
JavaScript
apache-2.0
firebase/snippets-web,firebase/snippets-web,firebase/snippets-web,firebase/snippets-web
--- +++ @@ -13,3 +13,10 @@ const db = myApp.database(); // [END rtdb_emulator_connect] } + +export async function flushRealtimeDatabase(anRTDBReference) { + + //[START rtdb_emulator_flush] + anRTDBReference.child("/").set(null); + // [END rtdb_emulator_connect] +}
19647ac3394e4c5e266d99cb6c476d1ee505b974
lib/options.js
lib/options.js
var fs = require('fs'); var path = require('path'); var cjson = require('cjson'); var _ = require('lodash'); var data = null; var OPTS_FILE = 'supersamples.opts'; var DEFAULTS = { output: './tmp', renderer: { name: 'html', options: { title: 'API Documentation', baseUrl: 'http://localhost', intro: null, styles: [] } } }; exports.read = function() { if (fs.exists(OPTS_FILE) === false) { return DEFAULTS; } try { var opts = cjson.load(OPTS_FILE); return _.defaults(opts, DEFAULTS); } catch (ex) { console.error('Invalid config file: ' + path.resolve('supersamples.opts')); console.error(ex); process.exit(1); } }; exports.get = function() { if (!data) data = exports.read(); return data; };
var fs = require('fs'); var path = require('path'); var cjson = require('cjson'); var _ = require('lodash'); var data = null; var OPTS_FILE = 'supersamples.opts'; var DEFAULTS = { output: './tmp', renderer: { name: 'html', options: { title: 'API Documentation', baseUrl: 'http://localhost', intro: null, styles: [] } } }; exports.read = function() { if (fs.existsSync(OPTS_FILE) === false) { return DEFAULTS; } try { var opts = cjson.load(OPTS_FILE); return _.defaults(opts, DEFAULTS); } catch (ex) { console.error('Invalid config file: ' + path.resolve('supersamples.opts')); console.error(ex); process.exit(1); } }; exports.get = function() { if (!data) data = exports.read(); return data; };
Fix bug where supersamples would not run without a supersamples.opt file
Fix bug where supersamples would not run without a supersamples.opt file
JavaScript
mit
GranitB/supersamples,mehdivk/supersamples,vickvu/supersamples,vickvu/supersamples,rprieto/supersamples,rprieto/supersamples,mehdivk/supersamples,GranitB/supersamples
--- +++ @@ -21,7 +21,7 @@ }; exports.read = function() { - if (fs.exists(OPTS_FILE) === false) { + if (fs.existsSync(OPTS_FILE) === false) { return DEFAULTS; } try { @@ -38,4 +38,3 @@ if (!data) data = exports.read(); return data; }; -
712e512cfb33c897a9a7dd8cea0e1001f39b1bea
src/dom-utils/instanceOf.js
src/dom-utils/instanceOf.js
// @flow import getWindow from './getWindow'; /*:: declare function isElement(node: mixed): boolean %checks(node instanceof Element); */ function isElement(node) { const OwnElement = getWindow(node).Element; return node instanceof OwnElement; } /*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof HTMLElement); */ function isHTMLElement(node) { const OwnElement = getWindow(node).HTMLElement; return node instanceof OwnElement; } export { isElement, isHTMLElement };
// @flow import getWindow from './getWindow'; /*:: declare function isElement(node: mixed): boolean %checks(node instanceof Element); */ function isElement(node) { const OwnElement = getWindow(node).Element; return node instanceof OwnElement || node instanceof Element; } /*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof HTMLElement); */ function isHTMLElement(node) { const OwnElement = getWindow(node).HTMLElement; return node instanceof OwnElement || node instanceof HTMLElement; } export { isElement, isHTMLElement };
Fix error in some situations with iframes
Fix error in some situations with iframes When using popper in an iframe, if the elements are created in the code's global context and added to the iframe, exceptions are thrown because prototypeOf does not accurately assess which nodes are Elements or HTMLElements. This fixes https://github.com/popperjs/popper-core/issues/1018.
JavaScript
mit
floating-ui/floating-ui,FezVrasta/popper.js,FezVrasta/popper.js,floating-ui/floating-ui,FezVrasta/popper.js,floating-ui/floating-ui,FezVrasta/popper.js
--- +++ @@ -6,7 +6,7 @@ function isElement(node) { const OwnElement = getWindow(node).Element; - return node instanceof OwnElement; + return node instanceof OwnElement || node instanceof Element; } /*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof @@ -14,7 +14,7 @@ function isHTMLElement(node) { const OwnElement = getWindow(node).HTMLElement; - return node instanceof OwnElement; + return node instanceof OwnElement || node instanceof HTMLElement; } export { isElement, isHTMLElement };
ae1e8915d76d4bd983d5a743bbb32dcb7369b985
SPAWithAngularJS/module3/httpService/js/app.menuCategoriesController.js
SPAWithAngularJS/module3/httpService/js/app.menuCategoriesController.js
// app.menuCategoriesController.js (function() { "use strict"; angular.module("MenuCategoriesApp") .controller("MenuCategoriesController", MenuCategoriesController); MenuCategoriesController.$inject = ["MenuCategoriesService"]; function MenuCategoriesController(MenuCategoriesService) { let vm = this; let promise = MenuCategoriesService.getMenuCategories(); } })();
// app.menuCategoriesController.js (function() { "use strict"; angular.module("MenuCategoriesApp") .controller("MenuCategoriesController", MenuCategoriesController); MenuCategoriesController.$inject = ["GitHubDataService"]; function MenuCategoriesController(GitHubDataService) { let vm = this; vm.getRepos = getRepos; function getRepos(userName) { vm.userName = GitHubDataService.getUserName(userName); if (!vm.userName) { return; } let promise = GitHubDataService.getRepos(vm.userName); promise .then((response) => { vm.categories = response.data; console.log("response.data: ", response.data); }) .catch((error) => { console.error("Somethig went terrible wrong", error); }); } } })();
Use new service. Implement getRepos
Use new service. Implement getRepos
JavaScript
mit
var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training
--- +++ @@ -6,11 +6,31 @@ angular.module("MenuCategoriesApp") .controller("MenuCategoriesController", MenuCategoriesController); - MenuCategoriesController.$inject = ["MenuCategoriesService"]; + MenuCategoriesController.$inject = ["GitHubDataService"]; - function MenuCategoriesController(MenuCategoriesService) { + function MenuCategoriesController(GitHubDataService) { let vm = this; - let promise = MenuCategoriesService.getMenuCategories(); + vm.getRepos = getRepos; + + function getRepos(userName) { + vm.userName = GitHubDataService.getUserName(userName); + + if (!vm.userName) { + return; + } + + let promise = GitHubDataService.getRepos(vm.userName); + + promise + .then((response) => { + vm.categories = response.data; + + console.log("response.data: ", response.data); + }) + .catch((error) => { + console.error("Somethig went terrible wrong", error); + }); + } } })();
737f1e96233bdd477a4dc932f82118c9f746ea13
src/migrations/20171114034422-create-discord-interaction.js
src/migrations/20171114034422-create-discord-interaction.js
'use strict'; module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.createTable('DiscordInteractions', { id: { primaryKey: true, type: Sequelize.INTEGER, autoIncrement: true, allowNull: false, }, command: { type: Sequelize.STRING, }, alias: { type: Sequelize.STRING, }, properties: { type: Sequelize.JSONB, }, createdAt: { type: Sequelize.DATE, allowNull: false, }, updatedAt: { type: Sequelize.DATE, allowNull: false, }, UserId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'DiscordUsers', key: 'id', }, onUpdate: 'no action', onDelete: 'no action', }, ChannelId: { type: Sequelize.INTEGER, allowNull: true, references: { model: 'DiscordChannels', key: 'id', }, onUpdate: 'no action', onDelete: 'no action', }, GuildId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'DiscordGuilds', key: 'id', }, onUpdate: 'no action', onDelete: 'no action', }, }); }, down: (queryInterface, Sequelize) => { return queryInterface.dropTable('DiscordInteractions'); }, };
'use strict'; module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.createTable('DiscordInteractions', { id: { primaryKey: true, type: Sequelize.INTEGER, autoIncrement: true, allowNull: false, }, command: { type: Sequelize.STRING, }, alias: { type: Sequelize.STRING, }, properties: { type: Sequelize.JSONB, }, createdAt: { type: Sequelize.DATE, allowNull: false, }, updatedAt: { type: Sequelize.DATE, allowNull: false, }, UserId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'DiscordUsers', key: 'id', }, onUpdate: 'no action', onDelete: 'no action', }, ChannelId: { type: Sequelize.INTEGER, allowNull: false, references: { model: 'DiscordChannels', key: 'id', }, onUpdate: 'no action', onDelete: 'no action', }, GuildId: { type: Sequelize.INTEGER, allowNull: true, references: { model: 'DiscordGuilds', key: 'id', }, onUpdate: 'no action', onDelete: 'no action', }, }); }, down: (queryInterface, Sequelize) => { return queryInterface.dropTable('DiscordInteractions'); }, };
Fix FK nullability on interaction table
Fix FK nullability on interaction table
JavaScript
mit
steers/lanodized,steers/lanodized
--- +++ @@ -37,7 +37,7 @@ }, ChannelId: { type: Sequelize.INTEGER, - allowNull: true, + allowNull: false, references: { model: 'DiscordChannels', key: 'id', @@ -47,7 +47,7 @@ }, GuildId: { type: Sequelize.INTEGER, - allowNull: false, + allowNull: true, references: { model: 'DiscordGuilds', key: 'id',
b49edd06baa6d7326f58cf319bfd41cd61147f71
dwinelle/web/js/spaces.js
dwinelle/web/js/spaces.js
function hallwayType1(length) { var space = new THREE.Group(); space.add(makeArrowHelper(0,0,0,0,1,0)); // Lighting for (var i = -length/2; i <= length/2; i+=10) { space.add(makePointLight(i,0,2.5, space)); } // Floor space.add(makePlane(5 , length, 0, 0 , 0, null, null, Math.PI/2, floorMat)); // Left Wall space.add(makePlane(2.5, length, 0, 2.5, 1.25, Math.PI/2, null, Math.PI/2, paintMat)); // Right Wall space.add(makePlane(2.5, length, 0, -2.5, 1.25, -Math.PI/2, null, Math.PI/2, paintMat)); return space; }
function hallwayType1(length) { var space = new THREE.Group(); space.add(makeArrowHelper(0,0,0,0,1,0)); // Lighting for (var i = -length/2; i <= length/2; i+=10) { space.add(makePointLight(i,0,2.5, space)); } // Floor space.add(makePlane(5 , length, 0, 0 , 0, null, null, Math.PI/2, plainLightGray)); // Left Wall space.add(makePlane(2.5, length, 0, 2.5, 1.25, Math.PI/2, null, Math.PI/2, plainDarkGray)); // Right Wall space.add(makePlane(2.5, length, 0, -2.5, 1.25, -Math.PI/2, null, Math.PI/2, plainDarkGray)); return space; }
Make things gray and black so it doesn't kill my browser
Make things gray and black so it doesn't kill my browser
JavaScript
mit
oliverodaa/cs184-final-proj,oliverodaa/cs184-final-proj,oliverodaa/cs184-final-proj
--- +++ @@ -6,10 +6,10 @@ space.add(makePointLight(i,0,2.5, space)); } // Floor - space.add(makePlane(5 , length, 0, 0 , 0, null, null, Math.PI/2, floorMat)); + space.add(makePlane(5 , length, 0, 0 , 0, null, null, Math.PI/2, plainLightGray)); // Left Wall - space.add(makePlane(2.5, length, 0, 2.5, 1.25, Math.PI/2, null, Math.PI/2, paintMat)); + space.add(makePlane(2.5, length, 0, 2.5, 1.25, Math.PI/2, null, Math.PI/2, plainDarkGray)); // Right Wall - space.add(makePlane(2.5, length, 0, -2.5, 1.25, -Math.PI/2, null, Math.PI/2, paintMat)); + space.add(makePlane(2.5, length, 0, -2.5, 1.25, -Math.PI/2, null, Math.PI/2, plainDarkGray)); return space; }
d813789dd4a515e6f3db9f7303ffdaf1c2c0083d
lib/resources/Customers.js
lib/resources/Customers.js
'use strict'; var FusebillResource = require('../FusebillResource'); var utils = require('../utils'); var fusebillMethod = FusebillResource.method; module.exports = FusebillResource.extend({ path: 'customers', includeBasic: [ 'create', 'list', 'retrieve', 'update', 'del', ], /** * Customer: Subscription methods */ listSubscriptions: fusebillMethod({ method: 'GET', path: '/{customerId}/subscriptions', urlParams: ['customerId'], }), /** * Customer: Email Preference methods */ listEmailPreferences: fusebillMethod({ method: 'GET', path: '/{customerId}/CustomerEmailPreferences', urlParams: ['customerId'], }), /** * Customer: Invoice methods */ listInvoices: fusebillMethod({ method: 'GET', path: '/{customerId}/invoices', urlParams: ['customerId'], }), listDraftInvoices: fusebillMethod({ method: 'GET', path: '/{customerId}/DraftInvoices', urlParams: ['customerId'], }), });
'use strict'; var FusebillResource = require('../FusebillResource'); var utils = require('../utils'); var fusebillMethod = FusebillResource.method; module.exports = FusebillResource.extend({ path: 'customers', includeBasic: [ 'create', 'list', 'retrieve', 'update', 'del', ], /** * Customer: Subscription methods */ listSubscriptions: fusebillMethod({ method: 'GET', path: '/{customerId}/subscriptions', urlParams: ['customerId'], }), retrieveSubscription: fusebillMethod({ method: 'GET', path: '/{customerId}/subscriptions/{subscriptionId}', urlParams: ['customerId', 'subscriptionId'], }), /** * Customer: Email Preference methods */ listEmailPreferences: fusebillMethod({ method: 'GET', path: '/{customerId}/CustomerEmailPreferences', urlParams: ['customerId'], }), /** * Customer: Invoice methods */ listInvoices: fusebillMethod({ method: 'GET', path: '/{customerId}/invoices', urlParams: ['customerId'], }), listDraftInvoices: fusebillMethod({ method: 'GET', path: '/{customerId}/DraftInvoices', urlParams: ['customerId'], }), listPaymentMethods: fusebillMethod({ method: 'GET', path: '/{customerId}/paymentmethods', urlParams: ['customerId'], }), });
Add back customer list payment methods
Add back customer list payment methods
JavaScript
mit
DanielAudino/fusebill-node,fingerfoodstudios/fusebill-node,bradcavanagh-ffs/fusebill-node
--- +++ @@ -21,6 +21,12 @@ urlParams: ['customerId'], }), + retrieveSubscription: fusebillMethod({ + method: 'GET', + path: '/{customerId}/subscriptions/{subscriptionId}', + urlParams: ['customerId', 'subscriptionId'], + }), + /** * Customer: Email Preference methods */ @@ -40,10 +46,17 @@ path: '/{customerId}/invoices', urlParams: ['customerId'], }), + listDraftInvoices: fusebillMethod({ method: 'GET', path: '/{customerId}/DraftInvoices', urlParams: ['customerId'], }), + listPaymentMethods: fusebillMethod({ + method: 'GET', + path: '/{customerId}/paymentmethods', + urlParams: ['customerId'], + }), + });
0d17ee888f562ba70d678d9ad9b412704bc2d3af
src/heading/heading_view.js
src/heading/heading_view.js
"use strict"; var TextView = require('../text/text_view'); // Substance.Heading.View // ========================================================================== var HeadingView = function(node) { TextView.call(this, node); this.$el.addClass('heading'); }; HeadingView.Prototype = function() {}; HeadingView.Prototype.prototype = TextView.prototype; HeadingView.prototype = new HeadingView.Prototype(); module.exports = HeadingView;
"use strict"; var TextView = require('../text/text_view'); // Substance.Heading.View // ========================================================================== var HeadingView = function(node) { TextView.call(this, node); this.$el.addClass('heading'); this.$el.addClass('level-'+this.node.level); }; HeadingView.Prototype = function() {}; HeadingView.Prototype.prototype = TextView.prototype; HeadingView.prototype = new HeadingView.Prototype(); module.exports = HeadingView;
Add css classes for heading levels.
Add css classes for heading levels.
JavaScript
mit
substance/nodes
--- +++ @@ -9,6 +9,8 @@ TextView.call(this, node); this.$el.addClass('heading'); + this.$el.addClass('level-'+this.node.level); + }; HeadingView.Prototype = function() {};
23a39bf923f64fbcf590f9fd7f1998c1bd55dad0
web/js/main.js
web/js/main.js
"use strict"; require.config({ shim: { backbone: { deps: ['underscore', 'jquery'], exports: 'Backbone' }, underscore: { exports: '_' }, handlebars: { exports: 'Handlebars' } }, paths: { bootstrap: 'lib/bootstrap', jquery: 'lib/jquery-1.7.2', underscore: 'lib/underscore', handlebars: 'lib/handlebars-1.0.0.beta.6', backbone: 'lib/backbone', text: 'lib/text', async: 'lib/async', templates: '../templates' } }); require(['jquery', 'underscore', 'backbone', 'router', 'bootstrap'], function ($, _, Backbone, Router) { window.Reitti = {}; Reitti.Event = _.extend({}, Backbone.Events); $(function () { window.Router = new Router(); Backbone.history.start(); if (navigator.geolocation) { navigator.geolocation.watchPosition(function (position) { Reitti.Event.trigger('position:updated', position); }, function () { }, {enableHighAccuracy: true}); } }); });
"use strict"; require.config({ shim: { backbone: { deps: ['underscore', 'jquery'], exports: 'Backbone' }, underscore: { exports: '_' }, handlebars: { exports: 'Handlebars' } }, paths: { bootstrap: 'lib/bootstrap', jquery: 'lib/jquery-1.7.2', underscore: 'lib/underscore', handlebars: 'lib/handlebars-1.0.0.beta.6', backbone: 'lib/backbone', text: 'lib/text', async: 'lib/async', templates: '../templates' } }); require(['jquery', 'underscore', 'backbone', 'router', 'bootstrap'], function ($, _, Backbone, Router) { window.Reitti = {}; Reitti.Event = _.extend({}, Backbone.Events); $(function () { Reitti.Router = new Router(); Backbone.history.start(); if (navigator.geolocation) { navigator.geolocation.watchPosition(function (position) { Reitti.Event.trigger('position:updated', position); }, function () { }, {enableHighAccuracy: true}); } }); });
Move our router object to the Reitti namespace.
Move our router object to the Reitti namespace.
JavaScript
mit
reitti/reittiopas,reitti/reittiopas
--- +++ @@ -28,11 +28,10 @@ require(['jquery', 'underscore', 'backbone', 'router', 'bootstrap'], function ($, _, Backbone, Router) { window.Reitti = {}; - Reitti.Event = _.extend({}, Backbone.Events); $(function () { - window.Router = new Router(); + Reitti.Router = new Router(); Backbone.history.start(); if (navigator.geolocation) {
0cb49fd90bf58848859a1e8626cf88ee3158b132
brunch-config.js
brunch-config.js
exports.files = { javascripts: { joinTo: { 'fateOfAllFools.js': /^(?!test)/ } }, stylesheets: { joinTo: 'fateOfAllFools.css' } }; // Tests are handled by Karma exports.conventions = { ignored: /^test/ };
exports.files = { javascripts: { joinTo: { 'fateOfAllFools.js': /^(?!test)/ } }, stylesheets: { joinTo: 'fateOfAllFools.css' } }; /* 1. Tests are handled by Karma. This is to silence a warning that Brunch reports (which is helpful actually in most cases!) because it sees JS files outside the scope of its purview. 2. We exclude them because we don't want them bundled so that the Karma watcher only re-runs the tests we've changed during active development. */ exports.conventions = { ignored: /^test/ };
Add detail to exclusion reasoning
Add detail to exclusion reasoning
JavaScript
mit
rslifka/fate_of_all_fools,rslifka/fate_of_all_fools
--- +++ @@ -9,7 +9,13 @@ } }; -// Tests are handled by Karma +/* + 1. Tests are handled by Karma. This is to silence a warning that Brunch + reports (which is helpful actually in most cases!) because it sees JS files + outside the scope of its purview. + 2. We exclude them because we don't want them bundled so that the Karma + watcher only re-runs the tests we've changed during active development. +*/ exports.conventions = { ignored: /^test/ };
7e7d86162597794f3452ab69d177300df1cadefd
src/model/fancy/location.js
src/model/fancy/location.js
/** * model/fancy/location.js */ function changePathGen (method) { return function changePath(path) { root.history[method + 'State'](EMPTY_OBJECT, '', path); $(root).trigger(method + 'state'); }; } models.location = baseModel.extend({ /** * Example: * var loc = tbone.models.location.make(); * T(function () { * console.log('the hash is ' + loc('hash')); * }); * loc('hash', '#this-is-the-new-hash'); */ initialize: function initialize() { var self = this; var recentlyChanged; function update (ev) { var changed = self('hash') !== location.hash || self('search') !== location.search || self('pathname') !== location.pathname; if (changed) { self('hash', location.hash); self('pathname', location.pathname); self('search', location.search); recentlyChanged = true; } } $(root).bind('hashchange popstate pushstate replacestate', update); update(); autorun(function initializeAutorun() { var pathname = self('pathname'); var search = self('search'); var hash = self('hash'); if (!recentlyChanged) { self.pushPath(pathname + (search || '') + (hash ? '#' + hash : '')); } recentlyChanged = false; }); }, pushPath: changePathGen('push'), replacePath: changePathGen('replace') });
/** * model/fancy/location.js */ function changePathGen (method) { return function changePath(path) { root.history[method + 'State'](EMPTY_OBJECT, '', path); window.dispatchEvent(new root.Event(method + 'state')); }; } models.location = baseModel.extend({ /** * Example: * var loc = tbone.models.location.make(); * T(function () { * console.log('the hash is ' + loc('hash')); * }); * loc('hash', '#this-is-the-new-hash'); */ initialize: function initialize() { var self = this; var recentlyChanged; function update (ev) { var changed = self('hash') !== location.hash || self('search') !== location.search || self('pathname') !== location.pathname; if (changed) { self('hash', location.hash); self('pathname', location.pathname); self('search', location.search); recentlyChanged = true; } } window.addEventListener('hashchange', update); window.addEventListener('popstate', update); window.addEventListener('pushstate', update); window.addEventListener('replacestate', update); update(); autorun(function initializeAutorun() { var pathname = self('pathname'); var search = self('search'); var hash = self('hash'); if (!recentlyChanged) { self.pushPath(pathname + (search || '') + (hash ? '#' + hash : '')); } recentlyChanged = false; }); }, pushPath: changePathGen('push'), replacePath: changePathGen('replace') });
Remove dependency on JQuery for binding/triggering hashchange/pushstate events
Remove dependency on JQuery for binding/triggering hashchange/pushstate events
JavaScript
mit
appneta/tbone,appneta/tbone,rachellaserzhao/tbone,tillberg/tbone,tillberg/tbone,rachellaserzhao/tbone
--- +++ @@ -5,7 +5,7 @@ function changePathGen (method) { return function changePath(path) { root.history[method + 'State'](EMPTY_OBJECT, '', path); - $(root).trigger(method + 'state'); + window.dispatchEvent(new root.Event(method + 'state')); }; } @@ -32,7 +32,10 @@ recentlyChanged = true; } } - $(root).bind('hashchange popstate pushstate replacestate', update); + window.addEventListener('hashchange', update); + window.addEventListener('popstate', update); + window.addEventListener('pushstate', update); + window.addEventListener('replacestate', update); update(); autorun(function initializeAutorun() {
ee3fb6243a6a49c1cc0d5d3f78aec555089885d5
public/services/gitlab.js
public/services/gitlab.js
app .factory("gitlab", ["$http", "$q", "Config", function($http, $q, Config) { function gitlab() {} gitlab.prototype.imageUrl = function(path) { return Config.gitlabUrl + path; }; gitlab.prototype.callapi = function(method, path) { var deferred = $q.defer(); var url = Config.gitlabUrl.replace(/\/*$/, "") + '/api/v3' + path; $http({ url: url, method: method, headers: { 'SUDO': 'root', 'PRIVATE-TOKEN': Config.gitlabToken } }) .success(function(data, status, headers, config) { deferred.resolve({ data: data, status: status, headers: headers, config: config }); }) .error(function(data, status, headers, config) { deferred.reject({ data: data, status: status, headers: headers, config: config }); }); return deferred.promise; }; return new gitlab(); }]) ;
app .factory("gitlab", ["$http", "$q", "Config", function($http, $q, Config) { function gitlab() {} gitlab.prototype.imageUrl = function(path) { return Config.gitlabUrl.replace(/\/*$/, "") + path; }; gitlab.prototype.callapi = function(method, path) { var deferred = $q.defer(); var url = Config.gitlabUrl.replace(/\/*$/, "") + '/api/v3' + path; $http({ url: url, method: method, headers: { 'SUDO': 'root', 'PRIVATE-TOKEN': Config.gitlabToken } }) .success(function(data, status, headers, config) { deferred.resolve({ data: data, status: status, headers: headers, config: config }); }) .error(function(data, status, headers, config) { deferred.reject({ data: data, status: status, headers: headers, config: config }); }); return deferred.promise; }; return new gitlab(); }]) ;
Remove trailing slash in GitLab url
Remove trailing slash in GitLab url Signed-off-by: kfei <1da1ad03e627cea4baf20871022464fcc6a4b2c4@kfei.net>
JavaScript
mit
kfei/gitlab-auditor,kfei/gitlab-auditor,kfei/gitlab-auditor
--- +++ @@ -7,7 +7,7 @@ function gitlab() {} gitlab.prototype.imageUrl = function(path) { - return Config.gitlabUrl + path; + return Config.gitlabUrl.replace(/\/*$/, "") + path; }; gitlab.prototype.callapi = function(method, path) {
a28ca526a35216f276eb7529d0cf1b1b78f2d994
app/routes/edit-form.js
app/routes/edit-form.js
import IdProxy from '../utils/idproxy'; import ProjectedModelRoute from '../routes/base/projected-model-route'; export default ProjectedModelRoute.extend({ model: function(params, transition) { this._super.apply(this, arguments); // :id param defined in router.js var id = IdProxy.mutate(params.id, this.get('modelProjection')); // TODO: optionally: fetch or find. return this.store.fetchById(this.get('modelName'), id); }, resetController: function(controller, isExisting, transition) { this._super.apply(this, arguments); controller.send('dismissErrorMessages'); var model = controller.get('model'); if (model && model.get('isDirty')) { model.rollback(); } } });
import IdProxy from '../utils/idproxy'; import ProjectedModelRoute from '../routes/base/projected-model-route'; export default ProjectedModelRoute.extend({ model: function(params, transition) { this._super.apply(this, arguments); // :id param defined in router.js var id = IdProxy.mutate(params.id, this.get('modelProjection')); // TODO: optionally: fetch or find. return this.store.findRecord(this.get('modelName'), id, { reload: true }); }, resetController: function(controller, isExisting, transition) { this._super.apply(this, arguments); controller.send('dismissErrorMessages'); var model = controller.get('model'); if (model && model.get('isDirty')) { model.rollback(); } } });
Fix ember data "fetchById" deprecation
Fix ember data "fetchById" deprecation
JavaScript
mit
Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry
--- +++ @@ -9,7 +9,7 @@ var id = IdProxy.mutate(params.id, this.get('modelProjection')); // TODO: optionally: fetch or find. - return this.store.fetchById(this.get('modelName'), id); + return this.store.findRecord(this.get('modelName'), id, { reload: true }); }, resetController: function(controller, isExisting, transition) {
adcc739f86f2bb24dc0f2ebe0d7d6bba1501b81c
test/index.js
test/index.js
var vCard = require( '..' ) var fs = require( 'fs' ) var assert = require( 'assert' ) suite( 'vCard', function() { suite( 'Character Sets', function() { test( 'charset should not be part of value', function() { var data = fs.readFileSync( __dirname + '/data/xing.vcf' ) var card = new vCard( data ) assert.strictEqual( card.fn.indexOf( 'CHARSET' ), -1 ) }) }) suite( 'Photo URL', function() { test( 'URL parameters should not become object properties', function() { var data = fs.readFileSync( __dirname + '/data/xing.vcf' ) var card = new vCard( data ) assert.equal( card.photo.txtsize, null ) }) }) })
var vCard = require( '..' ) var fs = require( 'fs' ) var assert = require( 'assert' ) suite( 'vCard', function() { suite( 'Character Sets', function() { test( 'charset should not be part of value', function() { var data = fs.readFileSync( __dirname + '/data/xing.vcf' ) var card = new vCard( data ) assert.strictEqual( typeof card.fn, 'object' ) assert.strictEqual( card.fn.data.indexOf( 'CHARSET' ), -1 ) }) }) suite( 'Photo URL', function() { test( 'URL parameters should not become object properties', function() { var data = fs.readFileSync( __dirname + '/data/xing.vcf' ) var card = new vCard( data ) assert.equal( card.photo.txtsize, null ) }) }) })
Update test: Adjust assertions to removal of cardinality checks
Update test: Adjust assertions to removal of cardinality checks
JavaScript
mit
jhermsmeier/node-vcf
--- +++ @@ -9,7 +9,8 @@ test( 'charset should not be part of value', function() { var data = fs.readFileSync( __dirname + '/data/xing.vcf' ) var card = new vCard( data ) - assert.strictEqual( card.fn.indexOf( 'CHARSET' ), -1 ) + assert.strictEqual( typeof card.fn, 'object' ) + assert.strictEqual( card.fn.data.indexOf( 'CHARSET' ), -1 ) }) })
88da1a072569a503afb157e83e6759779c700da8
test/index.js
test/index.js
const minecraftItems = require('../') const tap = require('tap') const testItem = (test, item, name) => { test.type(item, 'object') test.equal(item.name, name) test.end() } tap.test('should be able to get an item by numeric type', t => { testItem(t, minecraftItems.get(1), 'Stone') }) tap.test('should be able to get an item by string type', t => { testItem(t, minecraftItems.get('1'), 'Stone') }) tap.test('should be able to get an item by string type & subType', t => { testItem(t, minecraftItems.get('1:0'), 'Stone') }) tap.test('should be able to get an item by name', t => { testItem(t, minecraftItems.get('Stone'), 'Stone') }) tap.test('should be able to get an item by name with case insensitivity', t => { testItem(t, minecraftItems.get('stoNe'), 'Stone') })
const minecraftItems = require('../') const tap = require('tap') const testItem = (test, item, name) => { test.type(item, 'object') test.equal(item.name, name) test.notEqual(typeof item.id, 'undefined', 'items should have an id property') test.notEqual(typeof item.type, 'undefined', 'items should have a type property') test.notEqual(typeof item.meta, 'undefined', 'items should have a meta property') test.notEqual(typeof item.icon, 'undefined', 'items should have a icon property') test.end() } tap.test('should be able to get an item by numeric type', t => { testItem(t, minecraftItems.get(1), 'Stone') }) tap.test('should be able to get an item by string type', t => { testItem(t, minecraftItems.get('1'), 'Stone') }) tap.test('should be able to get an item by string type & subType', t => { testItem(t, minecraftItems.get('1:0'), 'Stone') }) tap.test('should be able to get an item by name', t => { testItem(t, minecraftItems.get('Stone'), 'Stone') }) tap.test('should be able to get an item by name with case insensitivity', t => { testItem(t, minecraftItems.get('stoNe'), 'Stone') })
Test for inclusion of icon data.
:white_check_mark: Test for inclusion of icon data.
JavaScript
mit
pandapaul/minecraft-items
--- +++ @@ -4,6 +4,10 @@ const testItem = (test, item, name) => { test.type(item, 'object') test.equal(item.name, name) + test.notEqual(typeof item.id, 'undefined', 'items should have an id property') + test.notEqual(typeof item.type, 'undefined', 'items should have a type property') + test.notEqual(typeof item.meta, 'undefined', 'items should have a meta property') + test.notEqual(typeof item.icon, 'undefined', 'items should have a icon property') test.end() }
cd3b76de38f6d050c8c3c927c06f4575ab456cd2
src/bot/postback.js
src/bot/postback.js
// import { getDocument } from './lib/couchdb'; // getDocument('3cfc9a96341c0e24') // .then(d => console.log(d)) // .catch(d => console.log(d)) export default (bot) => { return async (payload, reply) => { let text = payload.postback.payload; try { const profile = await bot.getProfile(payload.sender.id); await reply({ attachment: { type: 'template', payload: { template_type: 'button', text: 'EBudgie needs to log you', buttons: [{ type: 'account_link', url: process.env.LOGIN_URL }] } } }); console.log(`Postback to ${profile.first_name} ${profile.last_name}: ${text}`); } catch (e) { console.log('ERROR in bot.on(\'postback\')', e); } }; };
// import { getDocument } from './lib/couchdb'; // getDocument('3cfc9a96341c0e24') // .then(d => console.log(d)) // .catch(d => console.log(d)) export default (bot) => { return async (payload, reply) => { let text = payload.postback.payload; try { const profile = await bot.getProfile(payload.sender.id); await reply({ attachment: { type: 'template', payload: { template_type: 'generic', elements: [{ title: 'EBudgie needs to log you', image_url: 'https://petersfancybrownhats.com/company_image.png', subtitle: 'To see what is going on with your account you need to login first.', buttons: [{ type: 'account_link', url: process.env.LOGIN_URL }] }] } } }); console.log(`Postback to ${profile.first_name} ${profile.last_name}: ${text}`); } catch (e) { console.log('ERROR in bot.on(\'postback\')', e); } }; };
Change the template for account linking
Change the template for account linking
JavaScript
mit
nikolay-radkov/ebudgie-server,nikolay-radkov/ebudgie-server
--- +++ @@ -13,11 +13,15 @@ attachment: { type: 'template', payload: { - template_type: 'button', - text: 'EBudgie needs to log you', - buttons: [{ - type: 'account_link', - url: process.env.LOGIN_URL + template_type: 'generic', + elements: [{ + title: 'EBudgie needs to log you', + image_url: 'https://petersfancybrownhats.com/company_image.png', + subtitle: 'To see what is going on with your account you need to login first.', + buttons: [{ + type: 'account_link', + url: process.env.LOGIN_URL + }] }] } }
dbdc7968923e320677f3e61f0f381f15d0ddb757
app/assets/javascripts/connect/views/SubscriptionListView.js
app/assets/javascripts/connect/views/SubscriptionListView.js
define([ 'backbone', 'handlebars', 'moment', 'connect/collections/Subscriptions', 'connect/views/SubscriptionListItemView', 'text!connect/templates/subscriptionList.handlebars' ], function(Backbone, Handlebars, moment, Subscriptions, SubscriptionListItemView, tpl) { 'use strict'; var SubscriptionListView = Backbone.View.extend({ template: Handlebars.compile(tpl), initialize: function() { this.subscriptions = new Subscriptions(); this.listenTo(this.subscriptions, 'sync', this.render); this.subscriptions.fetch(); this.render(); }, render: function() { this.$el.html(this.template()); var $tableBody = this.$('#user-subscriptions-table-body'); this.subscriptions.each(function(subscription) { var view = new SubscriptionListItemView({ subscription: subscription}); $tableBody.append(view.el); }); } }); return SubscriptionListView; });
define([ 'backbone', 'handlebars', 'moment', 'connect/collections/Subscriptions', 'connect/views/SubscriptionListItemView', 'text!connect/templates/subscriptionList.handlebars' ], function(Backbone, Handlebars, moment, Subscriptions, SubscriptionListItemView, tpl) { 'use strict'; var SubscriptionListView = Backbone.View.extend({ template: Handlebars.compile(tpl), initialize: function() { this.subscriptions = new Subscriptions(); this.listenTo(this.subscriptions, 'sync', this.render); this.subscriptions.fetch(); this.render(); }, render: function() { this.$el.html(this.template()); var sortedSubscriptions = new Subscriptions( this.subscriptions.sortBy(function(subscription) { return -moment(subscription.get('created')).unix(); }) ); var $tableBody = this.$('#user-subscriptions-table-body'); sortedSubscriptions.each(function(subscription) { var view = new SubscriptionListItemView({ subscription: subscription}); $tableBody.append(view.el); }); } }); return SubscriptionListView; });
Sort subscription list by date
Sort subscription list by date
JavaScript
mit
Vizzuality/gfw,Vizzuality/gfw
--- +++ @@ -21,8 +21,14 @@ render: function() { this.$el.html(this.template()); + var sortedSubscriptions = new Subscriptions( + this.subscriptions.sortBy(function(subscription) { + return -moment(subscription.get('created')).unix(); + }) + ); + var $tableBody = this.$('#user-subscriptions-table-body'); - this.subscriptions.each(function(subscription) { + sortedSubscriptions.each(function(subscription) { var view = new SubscriptionListItemView({ subscription: subscription}); $tableBody.append(view.el);
346cd3bd917ef642ed8d132d559e4b16342b29b7
src/transforms/__tests__/textShadow.js
src/transforms/__tests__/textShadow.js
import transformCss from '../..' it('textShadow with all values', () => { expect(transformCss([['text-shadow', '10px 20px 30px red']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 30, textShadowColor: 'red', }) }) it('textShadow omitting blur', () => { expect(transformCss([['text-shadow', '10px 20px red']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 0, textShadowColor: 'red', }) }) it('textShadow omitting color', () => { expect(transformCss([['text-shadow', '10px 20px black']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 0, textShadowColor: 'black', }) }) it('textShadow omitting blur, offset-y', () => { expect(transformCss([['text-shadow', '10px 20px red']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 0, textShadowColor: 'red', }) }) it('textShadow enforces offset-x and offset-y', () => { expect(() => transformCss([['text-shadow', 'red']])).toThrow() expect(() => transformCss([['text-shadow', '10px red']])).toThrow() })
import transformCss from '../..' it('textShadow with all values', () => { expect(transformCss([['text-shadow', '10px 20px 30px red']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 30, textShadowColor: 'red', }) }) it('textShadow omitting blur', () => { expect(transformCss([['text-shadow', '10px 20px red']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 0, textShadowColor: 'red', }) }) it('textShadow omitting color', () => { expect(transformCss([['text-shadow', '10px 20px']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 0, textShadowColor: 'black', }) }) it('textShadow enforces offset-x and offset-y', () => { expect(() => transformCss([['text-shadow', 'red']])).toThrow() expect(() => transformCss([['text-shadow', '10px red']])).toThrow() })
Remove duplicate test, fix duplicate test
Remove duplicate test, fix duplicate test
JavaScript
mit
styled-components/css-to-react-native
--- +++ @@ -17,18 +17,10 @@ }) it('textShadow omitting color', () => { - expect(transformCss([['text-shadow', '10px 20px black']])).toEqual({ + expect(transformCss([['text-shadow', '10px 20px']])).toEqual({ textShadowOffset: { width: 10, height: 20 }, textShadowRadius: 0, textShadowColor: 'black', - }) -}) - -it('textShadow omitting blur, offset-y', () => { - expect(transformCss([['text-shadow', '10px 20px red']])).toEqual({ - textShadowOffset: { width: 10, height: 20 }, - textShadowRadius: 0, - textShadowColor: 'red', }) })
8d4d2eb1b16bb5e527aeb051931d6f834da8b21b
test/scenario/game-start.js
test/scenario/game-start.js
// @flow import { expect } from "chai"; import { Game, GameDescriptor, DefaultDeck } from "stormtide-core"; import type { PlayerDescriptor } from "stormtide-core"; describe("Scenario: Game Start", () => { const settings = new GameDescriptor(); const player1: PlayerDescriptor = { deck: DefaultDeck }; const player2: PlayerDescriptor = { deck: DefaultDeck }; settings.players = [player1, player2]; const game = new Game(settings); game.start(); const playerState1 = game.state.playerTurnOrder .map(v => game.state.players[v]) .filter(v => v != null) .find(player => player && player.descriptor === player1); it("should have the right players", () => { expect(Object.keys(game.state.players)).to.have.lengthOf(2); }); it("should give turn and priority to player 1", () => { expect(playerState1).to.be.ok; if (!playerState1) { return; } expect(game.state.turn).to.equal(playerState1.id); expect(game.state.priority).to.equal(playerState1.id); }); });
// @flow import { expect } from "chai"; import { Game, GameDescriptor, DefaultDeck } from "stormtide-core"; import type { PlayerDescriptor } from "stormtide-core"; describe("Scenario: Game Start", () => { const settings = new GameDescriptor(); const player1: PlayerDescriptor = { deck: DefaultDeck }; const player2: PlayerDescriptor = { deck: DefaultDeck }; settings.players = [player1, player2]; const game = new Game(settings); game.start(); const playerState1 = game.state.playerTurnOrder .map(v => game.state.players[v]) .filter(v => v != null) .find(player => player && player.descriptor === player1); it("should have the right players", () => { expect(Object.keys(game.state.players)).to.have.lengthOf(2); }); // This will change with the addition of pre-game actions it("should give turn and priority to player 1", () => { expect(playerState1).to.be.ok; if (!playerState1) { return; } expect(game.state.turn).to.equal(playerState1.id); expect(game.state.priority).to.equal(playerState1.id); }); });
Add minor note about future changes
Add minor note about future changes
JavaScript
mit
StormtideGame/stormtide-core
--- +++ @@ -36,6 +36,7 @@ expect(Object.keys(game.state.players)).to.have.lengthOf(2); }); + // This will change with the addition of pre-game actions it("should give turn and priority to player 1", () => { expect(playerState1).to.be.ok;
ea02da4f1d26c736d04b83dfdabde3297bba8dc7
packages/ember-runtime/lib/controllers/object_controller.js
packages/ember-runtime/lib/controllers/object_controller.js
require('ember-runtime/system/object_proxy'); require('ember-runtime/controllers/controller'); /** @module ember @submodule ember-runtime */ /** `Ember.ObjectController` is part of Ember's Controller layer. A single shared instance of each `Ember.ObjectController` subclass in your application's namespace will be created at application initialization and be stored on your application's `Ember.Router` instance. `Ember.ObjectController` derives its functionality from its superclass `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin. @class ObjectController @namespace Ember @extends Ember.ObjectProxy @uses Ember.ControllerMixin **/ Ember.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);
require('ember-runtime/system/object_proxy'); require('ember-runtime/controllers/controller'); /** @module ember @submodule ember-runtime */ /** `Ember.ObjectController` is part of Ember's Controller layer. `Ember.ObjectController` derives its functionality from its superclass `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin. @class ObjectController @namespace Ember @extends Ember.ObjectProxy @uses Ember.ControllerMixin **/ Ember.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);
Remove obsolete paragraph from ObjectController comments
Remove obsolete paragraph from ObjectController comments
JavaScript
mit
trentmwillis/ember.js,mitchlloyd/ember.js,kidaa/ember.js,seanpdoyle/ember.js,cyberkoi/ember.js,csantero/ember.js,kellyselden/ember.js,michaelBenin/ember.js,cesarizu/ember.js,JesseQin/ember.js,xcambar/ember.js,jmurphyau/ember.js,nruth/ember.js,Trendy/ember.js,seanjohnson08/ember.js,knownasilya/ember.js,rwjblue/ember.js,yonjah/ember.js,asakusuma/ember.js,vitch/ember.js,furkanayhan/ember.js,kanongil/ember.js,sly7-7/ember.js,sharma1nitish/ember.js,jackiewung/ember.js,mixonic/ember.js,bekzod/ember.js,Patsy-issa/ember.js,xcskier56/ember.js,SaladFork/ember.js,jerel/ember.js,nicklv/ember.js,paddyobrien/ember.js,jayphelps/ember.js,njagadeesh/ember.js,cbou/ember.js,greyhwndz/ember.js,EricSchank/ember.js,visualjeff/ember.js,claimsmall/ember.js,njagadeesh/ember.js,seanjohnson08/ember.js,kublaj/ember.js,claimsmall/ember.js,raytiley/ember.js,max-konin/ember.js,rlugojr/ember.js,fxkr/ember.js,toddjordan/ember.js,kellyselden/ember.js,jackiewung/ember.js,anilmaurya/ember.js,HeroicEric/ember.js,abulrim/ember.js,cibernox/ember.js,dgeb/ember.js,wagenet/ember.js,opichals/ember.js,howtolearntocode/ember.js,miguelcobain/ember.js,mdehoog/ember.js,yaymukund/ember.js,nicklv/ember.js,HipsterBrown/ember.js,eliotsykes/ember.js,twokul/ember.js,howmuchcomputer/ember.js,lsthornt/ember.js,bantic/ember.js,jerel/ember.js,Vassi/ember.js,code0100fun/ember.js,cowboyd/ember.js,boztek/ember.js,VictorChaun/ember.js,patricksrobertson/ember.js,jplwood/ember.js,simudream/ember.js,kidaa/ember.js,gfvcastro/ember.js,wagenet/ember.js,szines/ember.js,vitch/ember.js,skeate/ember.js,eliotsykes/ember.js,jaswilli/ember.js,sly7-7/ember.js,qaiken/ember.js,green-arrow/ember.js,BrianSipple/ember.js,rodrigo-morais/ember.js,swarmbox/ember.js,mmun/ember.js,practicefusion/ember.js,Gaurav0/ember.js,szines/ember.js,karthiick/ember.js,jayphelps/ember.js,code0100fun/ember.js,williamsbdev/ember.js,Vassi/ember.js,JKGisMe/ember.js,davidpett/ember.js,michaelBenin/ember.js,EricSchank/ember.js,okuryu/ember.js,mallikarjunayaddala/ember.js,cyberkoi/ember.js,tiegz/ember.js,mike-north/ember.js,ridixcr/ember.js,JKGisMe/ember.js,Zagorakiss/ember.js,nvoron23/ember.js,adatapost/ember.js,adamesque/ember.js,Trendy/ember.js,raycohen/ember.js,femi-saliu/ember.js,VictorChaun/ember.js,pangratz/ember.js,gdi2290/ember.js,mdehoog/ember.js,emberjs/ember.js,mrjavascript/ember.js,wycats/ember.js,JKGisMe/ember.js,jamesarosen/ember.js,swarmbox/ember.js,danielgynn/ember.js,aihua/ember.js,rubenrp81/ember.js,kmiyashiro/ember.js,ubuntuvim/ember.js,quaertym/ember.js,wecc/ember.js,HeroicEric/ember.js,wecc/ember.js,jerel/ember.js,howmuchcomputer/ember.js,miguelcobain/ember.js,seanpdoyle/ember.js,artfuldodger/ember.js,soulcutter/ember.js,chadhietala/mixonic-ember,ianstarz/ember.js,stefanpenner/ember.js,HeroicEric/ember.js,sharma1nitish/ember.js,boztek/ember.js,martndemus/ember.js,elwayman02/ember.js,twokul/ember.js,rot26/ember.js,lsthornt/ember.js,trek/ember.js,rot26/ember.js,KevinTCoughlin/ember.js,mfeckie/ember.js,quaertym/ember.js,cjc343/ember.js,JacobNinja/es6,johanneswuerbach/ember.js,karthiick/ember.js,omurbilgili/ember.js,ebryn/ember.js,ryanlabouve/ember.js,williamsbdev/ember.js,loadimpact/ember.js,benstoltz/ember.js,yaymukund/ember.js,cesarizu/ember.js,benstoltz/ember.js,cyjia/ember.js,wagenet/ember.js,tildeio/ember.js,cdl/ember.js,kennethdavidbuck/ember.js,tomdale/ember.js,mmpestorich/ember.js,okuryu/ember.js,danielgynn/ember.js,tsing80/ember.js,xtian/ember.js,Eric-Guo/ember.js,visualjeff/ember.js,wycats/ember.js,sly7-7/ember.js,tofanelli/ember.js,chadhietala/ember.js,greyhwndz/ember.js,slindberg/ember.js,ryanlabouve/ember.js,fivetanley/ember.js,joeruello/ember.js,selvagsz/ember.js,nathanhammond/ember.js,zenefits/ember.js,dschmidt/ember.js,lan0/ember.js,GavinJoyce/ember.js,Krasnyanskiy/ember.js,sandstrom/ember.js,toddjordan/ember.js,yuhualingfeng/ember.js,lan0/ember.js,yaymukund/ember.js,rondale-sc/ember.js,kublaj/ember.js,cdl/ember.js,ianstarz/ember.js,jonathanKingston/ember.js,miguelcobain/ember.js,cibernox/ember.js,cgvarela/ember.js,udhayam/ember.js,XrXr/ember.js,greyhwndz/ember.js,tomdale/ember.js,eliotsykes/ember.js,rot26/ember.js,KevinTCoughlin/ember.js,nightire/ember.js,Turbo87/ember.js,greyhwndz/ember.js,vikram7/ember.js,ianstarz/ember.js,XrXr/ember.js,xiujunma/ember.js,max-konin/ember.js,cyjia/ember.js,kwight/ember.js,Robdel12/ember.js,mitchlloyd/ember.js,kigsmtua/ember.js,jcope2013/ember.js,Zagorakiss/ember.js,rwjblue/ember.js,jamesarosen/ember.js,mitchlloyd/ember.js,thejameskyle/ember.js,slindberg/ember.js,cyberkoi/ember.js,anilmaurya/ember.js,miguelcobain/ember.js,anilmaurya/ember.js,topaxi/ember.js,toddjordan/ember.js,ThiagoGarciaAlves/ember.js,kidaa/ember.js,Gaurav0/ember.js,vikram7/ember.js,Kuzirashi/ember.js,sandstrom/ember.js,KevinTCoughlin/ember.js,udhayam/ember.js,yaymukund/ember.js,howmuchcomputer/ember.js,xcambar/ember.js,bcardarella/ember.js,olivierchatry/ember.js,johanneswuerbach/ember.js,tofanelli/ember.js,karthiick/ember.js,Leooo/ember.js,Patsy-issa/ember.js,jackiewung/ember.js,rlugojr/ember.js,xiujunma/ember.js,kwight/ember.js,jish/ember.js,fxkr/ember.js,sivakumar-kailasam/ember.js,HeroicEric/ember.js,BrianSipple/ember.js,Eric-Guo/ember.js,benstoltz/ember.js,VictorChaun/ember.js,paddyobrien/ember.js,mrjavascript/ember.js,tianxiangbing/ember.js,selvagsz/ember.js,gnarf/ember.js,Trendy/ember.js,nvoron23/ember.js,johanneswuerbach/ember.js,practicefusion/ember.js,aihua/ember.js,nightire/ember.js,lan0/ember.js,nruth/ember.js,Patsy-issa/ember.js,Leooo/ember.js,tomdale/ember.js,JesseQin/ember.js,vikram7/ember.js,cowboyd/ember.js,NLincoln/ember.js,nvoron23/ember.js,marijaselakovic/ember.js,olivierchatry/ember.js,zenefits/ember.js,xtian/ember.js,zenefits/ember.js,opichals/ember.js,fouzelddin/ember.js,tofanelli/ember.js,jasonmit/ember.js,swarmbox/ember.js,trek/ember.js,elwayman02/ember.js,rot26/ember.js,Vassi/ember.js,ubuntuvim/ember.js,VictorChaun/ember.js,yonjah/ember.js,tianxiangbing/ember.js,rondale-sc/ember.js,Zagorakiss/ember.js,raycohen/ember.js,joeruello/ember.js,elwayman02/ember.js,ubuntuvim/ember.js,danielgynn/ember.js,nickiaconis/ember.js,delftswa2016/ember.js,qaiken/ember.js,kanongil/ember.js,mixonic/ember.js,soulcutter/ember.js,duggiefresh/ember.js,bantic/ember.js,abulrim/ember.js,howtolearntocode/ember.js,nightire/ember.js,szines/ember.js,rubenrp81/ember.js,faizaanshamsi/ember.js,selvagsz/ember.js,qaiken/ember.js,green-arrow/ember.js,joeruello/ember.js,latlontude/ember.js,intercom/ember.js,Leooo/ember.js,tricknotes/ember.js,jherdman/ember.js,wecc/ember.js,ssured/ember.js,nipunas/ember.js,MatrixZ/ember.js,lazybensch/ember.js,loadimpact/ember.js,cowboyd/ember.js,develoser/ember.js,jcope2013/ember.js,jackiewung/ember.js,workmanw/ember.js,udhayam/ember.js,topaxi/ember.js,artfuldodger/ember.js,XrXr/ember.js,bekzod/ember.js,loadimpact/ember.js,8thcolor/ember.js,knownasilya/ember.js,csantero/ember.js,thoov/ember.js,runspired/ember.js,kmiyashiro/ember.js,duggiefresh/ember.js,jmurphyau/ember.js,kaeufl/ember.js,nvoron23/ember.js,rodrigo-morais/ember.js,balinterdi/ember.js,cjc343/ember.js,femi-saliu/ember.js,stefanpenner/ember.js,nathanhammond/ember.js,8thcolor/ember.js,cgvarela/ember.js,omurbilgili/ember.js,trentmwillis/ember.js,thoov/ember.js,lan0/ember.js,topaxi/ember.js,8thcolor/ember.js,yuhualingfeng/ember.js,bekzod/ember.js,intercom/ember.js,Robdel12/ember.js,ThiagoGarciaAlves/ember.js,EricSchank/ember.js,jherdman/ember.js,kiwiupover/ember.js,tricknotes/ember.js,sivakumar-kailasam/ember.js,dgeb/ember.js,JacobNinja/es6,faizaanshamsi/ember.js,jaswilli/ember.js,ef4/ember.js,Patsy-issa/ember.js,aihua/ember.js,kmiyashiro/ember.js,jherdman/ember.js,martndemus/ember.js,tricknotes/ember.js,mike-north/ember.js,amk221/ember.js,jonathanKingston/ember.js,bantic/ember.js,kellyselden/ember.js,acburdine/ember.js,mallikarjunayaddala/ember.js,acburdine/ember.js,kwight/ember.js,gdi2290/ember.js,fxkr/ember.js,8thcolor/ember.js,Turbo87/ember.js,patricksrobertson/ember.js,joeruello/ember.js,lazybensch/ember.js,jcope2013/ember.js,mmpestorich/ember.js,raycohen/ember.js,rodrigo-morais/ember.js,practicefusion/ember.js,stefanpenner/ember.js,davidpett/ember.js,mitchlloyd/ember.js,jaswilli/ember.js,swarmbox/ember.js,rwjblue/ember.js,JKGisMe/ember.js,rfsv/ember.js,selvagsz/ember.js,yonjah/ember.js,jplwood/ember.js,xcambar/ember.js,Krasnyanskiy/ember.js,green-arrow/ember.js,xtian/ember.js,cdl/ember.js,MatrixZ/ember.js,pixelhandler/ember.js,givanse/ember.js,bekzod/ember.js,opichals/ember.js,amk221/ember.js,jcope2013/ember.js,jaswilli/ember.js,max-konin/ember.js,bcardarella/ember.js,tiegz/ember.js,tianxiangbing/ember.js,nicklv/ember.js,Trendy/ember.js,rubenrp81/ember.js,eliotsykes/ember.js,rfsv/ember.js,ming-codes/ember.js,latlontude/ember.js,rubenrp81/ember.js,mrjavascript/ember.js,GavinJoyce/ember.js,mixonic/ember.js,jasonmit/ember.js,Serabe/ember.js,Eric-Guo/ember.js,fpauser/ember.js,ming-codes/ember.js,NLincoln/ember.js,brzpegasus/ember.js,brzpegasus/ember.js,Krasnyanskiy/ember.js,simudream/ember.js,aihua/ember.js,MatrixZ/ember.js,alexdiliberto/ember.js,jasonmit/ember.js,jbrown/ember.js,jplwood/ember.js,emberjs/ember.js,thejameskyle/ember.js,cgvarela/ember.js,tiegz/ember.js,kublaj/ember.js,furkanayhan/ember.js,knownasilya/ember.js,rfsv/ember.js,davidpett/ember.js,Kuzirashi/ember.js,kigsmtua/ember.js,koriroys/ember.js,alexspeller/ember.js,martndemus/ember.js,brzpegasus/ember.js,gfvcastro/ember.js,amk221/ember.js,g13013/ember.js,BrianSipple/ember.js,dschmidt/ember.js,kigsmtua/ember.js,blimmer/ember.js,kwight/ember.js,johnnyshields/ember.js,gfvcastro/ember.js,elwayman02/ember.js,chadhietala/ember.js,antigremlin/ember.js,nathanhammond/ember.js,skeate/ember.js,abulrim/ember.js,givanse/ember.js,nicklv/ember.js,thoov/ember.js,alexdiliberto/ember.js,alexdiliberto/ember.js,adamesque/ember.js,g13013/ember.js,cowboyd/ember.js,TriumphantAkash/ember.js,howtolearntocode/ember.js,asakusuma/ember.js,schreiaj/ember.js,jonathanKingston/ember.js,cdl/ember.js,alexdiliberto/ember.js,jbrown/ember.js,raytiley/ember.js,asakusuma/ember.js,workmanw/ember.js,intercom/ember.js,Gaurav0/ember.js,rondale-sc/ember.js,tsing80/ember.js,kaeufl/ember.js,duggiefresh/ember.js,ThiagoGarciaAlves/ember.js,olivierchatry/ember.js,sivakumar-kailasam/ember.js,NLincoln/ember.js,yonjah/ember.js,SaladFork/ember.js,HipsterBrown/ember.js,jasonmit/ember.js,TriumphantAkash/ember.js,ThiagoGarciaAlves/ember.js,artfuldodger/ember.js,ridixcr/ember.js,cesarizu/ember.js,Krasnyanskiy/ember.js,nickiaconis/ember.js,zenefits/ember.js,slindberg/ember.js,okuryu/ember.js,patricksrobertson/ember.js,g13013/ember.js,acburdine/ember.js,blimmer/ember.js,rodrigo-morais/ember.js,nathanhammond/ember.js,fivetanley/ember.js,marijaselakovic/ember.js,williamsbdev/ember.js,marijaselakovic/ember.js,GavinJoyce/ember.js,mike-north/ember.js,KevinTCoughlin/ember.js,mfeckie/ember.js,fpauser/ember.js,xcskier56/ember.js,wycats/ember.js,blimmer/ember.js,tofanelli/ember.js,tiegz/ember.js,fouzelddin/ember.js,GavinJoyce/ember.js,yuhualingfeng/ember.js,tildeio/ember.js,claimsmall/ember.js,mallikarjunayaddala/ember.js,seanjohnson08/ember.js,Zagorakiss/ember.js,cesarizu/ember.js,sandstrom/ember.js,koriroys/ember.js,bantic/ember.js,kennethdavidbuck/ember.js,balinterdi/ember.js,karthiick/ember.js,Turbo87/ember.js,jish/ember.js,marcioj/ember.js,kublaj/ember.js,adatapost/ember.js,pangratz/ember.js,jayphelps/ember.js,thejameskyle/ember.js,latlontude/ember.js,skeate/ember.js,mfeckie/ember.js,johnnyshields/ember.js,jamesarosen/ember.js,bmac/ember.js,sivakumar-kailasam/ember.js,ebryn/ember.js,runspired/ember.js,cbou/ember.js,kigsmtua/ember.js,kennethdavidbuck/ember.js,JesseQin/ember.js,tildeio/ember.js,develoser/ember.js,topaxi/ember.js,marcioj/ember.js,dgeb/ember.js,code0100fun/ember.js,code0100fun/ember.js,alexspeller/ember.js,jayphelps/ember.js,boztek/ember.js,skeate/ember.js,trek/ember.js,xcskier56/ember.js,chadhietala/ember.js,bmac/ember.js,rfsv/ember.js,xcambar/ember.js,olivierchatry/ember.js,acburdine/ember.js,seanjohnson08/ember.js,amk221/ember.js,toddjordan/ember.js,Gaurav0/ember.js,Kuzirashi/ember.js,delftswa2016/ember.js,Serabe/ember.js,green-arrow/ember.js,gfvcastro/ember.js,fpauser/ember.js,seanpdoyle/ember.js,mallikarjunayaddala/ember.js,ssured/ember.js,quaertym/ember.js,csantero/ember.js,fouzelddin/ember.js,vitch/ember.js,JacobNinja/es6,ming-codes/ember.js,lsthornt/ember.js,ryanlabouve/ember.js,williamsbdev/ember.js,tsing80/ember.js,cibernox/ember.js,SaladFork/ember.js,udhayam/ember.js,paddyobrien/ember.js,wycats/ember.js,twokul/ember.js,simudream/ember.js,kaeufl/ember.js,adatapost/ember.js,pixelhandler/ember.js,NLincoln/ember.js,Robdel12/ember.js,kiwiupover/ember.js,fouzelddin/ember.js,kiwiupover/ember.js,tsing80/ember.js,mdehoog/ember.js,omurbilgili/ember.js,johanneswuerbach/ember.js,furkanayhan/ember.js,jish/ember.js,nightire/ember.js,howtolearntocode/ember.js,duggiefresh/ember.js,jmurphyau/ember.js,davidpett/ember.js,practicefusion/ember.js,artfuldodger/ember.js,mmun/ember.js,pixelhandler/ember.js,seanpdoyle/ember.js,HipsterBrown/ember.js,loadimpact/ember.js,BrianSipple/ember.js,HipsterBrown/ember.js,trek/ember.js,marcioj/ember.js,johnnyshields/ember.js,femi-saliu/ember.js,nruth/ember.js,ef4/ember.js,pixelhandler/ember.js,adatapost/ember.js,adamesque/ember.js,intercom/ember.js,lsthornt/ember.js,koriroys/ember.js,marijaselakovic/ember.js,XrXr/ember.js,jplwood/ember.js,schreiaj/ember.js,cjc343/ember.js,develoser/ember.js,ridixcr/ember.js,nickiaconis/ember.js,lazybensch/ember.js,lazybensch/ember.js,simudream/ember.js,cyberkoi/ember.js,claimsmall/ember.js,dschmidt/ember.js,kellyselden/ember.js,balinterdi/ember.js,kanongil/ember.js,raytiley/ember.js,patricksrobertson/ember.js,Robdel12/ember.js,abulrim/ember.js,soulcutter/ember.js,workmanw/ember.js,ianstarz/ember.js,xtian/ember.js,ubuntuvim/ember.js,johnnyshields/ember.js,opichals/ember.js,ef4/ember.js,rwjblue/ember.js,chadhietala/mixonic-ember,sivakumar-kailasam/ember.js,faizaanshamsi/ember.js,sharma1nitish/ember.js,kanongil/ember.js,cyjia/ember.js,njagadeesh/ember.js,quaertym/ember.js,jamesarosen/ember.js,marcioj/ember.js,jerel/ember.js,cyjia/ember.js,xcskier56/ember.js,kennethdavidbuck/ember.js,jonathanKingston/ember.js,givanse/ember.js,kmiyashiro/ember.js,fivetanley/ember.js,visualjeff/ember.js,csantero/ember.js,thejameskyle/ember.js,omurbilgili/ember.js,cbou/ember.js,MatrixZ/ember.js,chadhietala/ember.js,kidaa/ember.js,fxkr/ember.js,ebryn/ember.js,nipunas/ember.js,pangratz/ember.js,soulcutter/ember.js,schreiaj/ember.js,danielgynn/ember.js,Vassi/ember.js,nipunas/ember.js,bmac/ember.js,visualjeff/ember.js,brzpegasus/ember.js,Serabe/ember.js,benstoltz/ember.js,trentmwillis/ember.js,cibernox/ember.js,develoser/ember.js,jmurphyau/ember.js,koriroys/ember.js,chadhietala/mixonic-ember,jherdman/ember.js,ridixcr/ember.js,antigremlin/ember.js,jasonmit/ember.js,mfeckie/ember.js,antigremlin/ember.js,ef4/ember.js,workmanw/ember.js,delftswa2016/ember.js,TriumphantAkash/ember.js,furkanayhan/ember.js,qaiken/ember.js,Leooo/ember.js,mdehoog/ember.js,antigremlin/ember.js,cbou/ember.js,givanse/ember.js,mrjavascript/ember.js,gdi2290/ember.js,martndemus/ember.js,JesseQin/ember.js,cjc343/ember.js,dgeb/ember.js,nruth/ember.js,howmuchcomputer/ember.js,bmac/ember.js,kaeufl/ember.js,sharma1nitish/ember.js,blimmer/ember.js,raytiley/ember.js,rlugojr/ember.js,Turbo87/ember.js,asakusuma/ember.js,tricknotes/ember.js,runspired/ember.js,jish/ember.js,fpauser/ember.js,delftswa2016/ember.js,ryanlabouve/ember.js,faizaanshamsi/ember.js,bcardarella/ember.js,yuhualingfeng/ember.js,Kuzirashi/ember.js,rlugojr/ember.js,gnarf/ember.js,xiujunma/ember.js,xiujunma/ember.js,szines/ember.js,boztek/ember.js,anilmaurya/ember.js,Serabe/ember.js,mmpestorich/ember.js,vikram7/ember.js,emberjs/ember.js,runspired/ember.js,Eric-Guo/ember.js,EricSchank/ember.js,jbrown/ember.js,gnarf/ember.js,trentmwillis/ember.js,cgvarela/ember.js,femi-saliu/ember.js,TriumphantAkash/ember.js,njagadeesh/ember.js,twokul/ember.js,nickiaconis/ember.js,thoov/ember.js,wecc/ember.js,mike-north/ember.js,pangratz/ember.js,nipunas/ember.js,tianxiangbing/ember.js,max-konin/ember.js,schreiaj/ember.js,SaladFork/ember.js
--- +++ @@ -7,10 +7,7 @@ */ /** - `Ember.ObjectController` is part of Ember's Controller layer. A single shared - instance of each `Ember.ObjectController` subclass in your application's - namespace will be created at application initialization and be stored on your - application's `Ember.Router` instance. + `Ember.ObjectController` is part of Ember's Controller layer. `Ember.ObjectController` derives its functionality from its superclass `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.
3cf539e029290331c735da82b1c0dc3189eeff6b
src/sprites/Player/index.js
src/sprites/Player/index.js
import Phaser from 'phaser'; import frames from '../../sprite-frames'; import update from './update'; export default class extends Phaser.Sprite { constructor({ game, x, y }) { super(game, x, y, 'guy', frames.GUY.STAND_DOWN); this.anchor.setTo(0.5, 0.5); this.faceDirection = 'DOWN'; this.faceObject = null; this.inventory = { water: 0 }; this.update = update.bind(this); } }
import Phaser from 'phaser'; import frames from '../../sprite-frames'; import update from './update'; import Inventory from './inventory'; export default class extends Phaser.Sprite { constructor({ game, x, y }) { super(game, x, y, 'guy', frames.GUY.STAND_DOWN); this.anchor.setTo(0.5, 0.5); this.faceDirection = 'DOWN'; this.faceObject = null; this.inventory = new Inventory(this.game); this.update = update.bind(this); } }
Use inventory class instead of plain object
Use inventory class instead of plain object
JavaScript
mit
ThomasMays/incremental-forest,ThomasMays/incremental-forest
--- +++ @@ -3,6 +3,7 @@ import frames from '../../sprite-frames'; import update from './update'; +import Inventory from './inventory'; export default class extends Phaser.Sprite { constructor({ game, x, y }) { @@ -13,9 +14,7 @@ this.faceDirection = 'DOWN'; this.faceObject = null; - this.inventory = { - water: 0 - }; + this.inventory = new Inventory(this.game); this.update = update.bind(this); }
bf85e9c098f4223c23c86ff3626bf8e36917b46c
src/templates/navigation.js
src/templates/navigation.js
import React from 'react' import { NavLink } from 'react-router-dom' import styles from './navigation.module.styl' export default ({ sports }) => ( <nav> <ol className={`${styles['sports-list']}`}> { sports.map(({ node }, idx) => ( <li key={idx} className={`${styles['sport-item']}`}> <h3 className={styles['no-margin']}> <NavLink to={`/${node.name}`} activeClassName={styles.active} className={styles['nav-link']}> { node.name } </NavLink> </h3> <ol className={`${styles['countries-list']}`}> { node.countries.map((country, idx) => ( <li key={idx} className={`${styles['country-item']}`}> <h3 className={styles['no-margin']}> <NavLink to={`/${node.name}/${country.name}`} activeClassName={styles.active} className={styles['nav-link']}> { country.name } </NavLink> </h3> </li> )) } </ol> </li> )) } </ol> </nav> )
import React from 'react' import NavLink from 'gatsby-link' import styles from './navigation.module.styl' export default ({ sports }) => ( <nav> <ol className={`${styles['sports-list']}`}> { sports.map(({ node }, idx) => ( <li key={idx} className={`${styles['sport-item']}`}> <h3 className={styles['no-margin']}> <NavLink to={`/${node.name}`} activeClassName={styles.active} className={styles['nav-link']}> { node.name } </NavLink> </h3> <ol className={`${styles['countries-list']}`}> { node.countries.map((country, idx) => ( <li key={idx} className={`${styles['country-item']}`}> <h3 className={styles['no-margin']}> <NavLink to={`/${node.name}/${country.name}`} activeClassName={styles.active} className={styles['nav-link']}> { country.name } </NavLink> </h3> </li> )) } </ol> </li> )) } </ol> </nav> )
Update NavLinks: use gatsby-link to avoid code chunks necessary for pages not being loaded.
Update NavLinks: use gatsby-link to avoid code chunks necessary for pages not being loaded.
JavaScript
mit
LuisLoureiro/placard-wrapper
--- +++ @@ -1,5 +1,5 @@ import React from 'react' -import { NavLink } from 'react-router-dom' +import NavLink from 'gatsby-link' import styles from './navigation.module.styl'
ba1b1ddf5181e78d3220c5e3d1d880bcf775c9ea
blueprints/ember-cli-template-lint/files/.template-lintrc.js
blueprints/ember-cli-template-lint/files/.template-lintrc.js
/* jshint node:true */ 'use strict'; module.exports = { 'bare-strings': true, 'block-indentation': 2, 'html-comments': true, 'nested-interactive': true, 'lint-self-closing-void-elements': true, 'triple-curlies': true, 'deprecated-each-syntax': true };
/* jshint node:true */ 'use strict'; module.exports = { extend: 'recommended' };
Use the recommended config from ember-template-lint.
Use the recommended config from ember-template-lint.
JavaScript
mit
rwjblue/ember-cli-template-lint,rwjblue/ember-cli-template-lint
--- +++ @@ -2,11 +2,5 @@ 'use strict'; module.exports = { - 'bare-strings': true, - 'block-indentation': 2, - 'html-comments': true, - 'nested-interactive': true, - 'lint-self-closing-void-elements': true, - 'triple-curlies': true, - 'deprecated-each-syntax': true + extend: 'recommended' };
6a2776fef20474fdcd75abb063ba76b830ea82b3
ws-fallback.js
ws-fallback.js
module.exports = WebSocket || MozWebSocket || window.WebSocket || window.MozWebSocket
var ws = null if (typeof WebSocket !== 'undefined') { ws = WebSocket } else if (typeof MozWebSocket !== 'undefined') { ws = MozWebSocket } else { ws = window.WebSocket || window.MozWebSocket } module.exports = ws
Use typeof for checking globals.
Use typeof for checking globals.
JavaScript
bsd-2-clause
maxogden/websocket-stream,maxogden/websocket-stream
--- +++ @@ -1 +1,12 @@ -module.exports = WebSocket || MozWebSocket || window.WebSocket || window.MozWebSocket + +var ws = null + +if (typeof WebSocket !== 'undefined') { + ws = WebSocket +} else if (typeof MozWebSocket !== 'undefined') { + ws = MozWebSocket +} else { + ws = window.WebSocket || window.MozWebSocket +} + +module.exports = ws
4874126c3445112d491f091be13eb999bf9f8fa3
system/res/js/key_import.js
system/res/js/key_import.js
var KeyImporterController = function() { this.sendArmor = function() { armorContainer = $('#import-armor'); data = "armor="+armorContainer.val(); $.post( '/node/api/keyring/post/import', data, function(data){ obj = $.parseJSON(data); if(obj.result != 'ok') { $('#import-ok').text("Imported Failed!") return; } $('#import-ok').text("Imported key for `"+obj.name+"`") } ); } } var KeyImporter = new KeyImporterController();
var KeyImporterController = function() { this.sendArmor = function() { armorContainer = $('#import-armor'); data = "armor="+encodeURIComponent(armorContainer.val()); $.post( '/node/api/keyring/post/import', data, function(data){ obj = $.parseJSON(data); if(obj.result != 'ok') { $('#import-ok').text("Imported Failed!") return; } $('#import-ok').text("Imported key for `"+obj.name+"`") } ); } } var KeyImporter = new KeyImporterController();
Correct encoding for key import
Correct encoding for key import The armor was getting mashed on transmission
JavaScript
apache-2.0
SpringDVS/php.web.node,SpringDVS/nodeweb_php,SpringDVS/php.web.node,SpringDVS/nodeweb_php
--- +++ @@ -2,7 +2,7 @@ this.sendArmor = function() { armorContainer = $('#import-armor'); - data = "armor="+armorContainer.val(); + data = "armor="+encodeURIComponent(armorContainer.val()); $.post( '/node/api/keyring/post/import',
5c1cee5e80329595c654e95be79888b9d11387cc
app/models/session-type.js
app/models/session-type.js
import DS from 'ember-data'; export default DS.Model.extend({ title: DS.attr('string'), sessionTypeCssClass: DS.attr('string'), assessment: DS.attr('boolean'), assessmentOption: DS.belongsTo('assessment-option', {async: true}), school: DS.belongsTo('school', {async: true}), aamcMethods: DS.hasMany('aamc-method', {async: true}), sessions: DS.hasMany('session', {async: true}), });
import DS from 'ember-data'; export default DS.Model.extend({ title: DS.attr('string'), sessionTypeCssClass: DS.attr('string'), assessment: DS.attr('boolean'), assessmentOption: DS.belongsTo('assessment-option', {async: true}), school: DS.belongsTo('school', {async: true}), aamcMethods: DS.hasMany('aamc-method', {async: true}), });
Remove sessions from seasionType model
Remove sessions from seasionType model No longer part of the API
JavaScript
mit
jrjohnson/frontend,dartajax/frontend,dartajax/frontend,gboushey/frontend,jrjohnson/frontend,djvoa12/frontend,thecoolestguy/frontend,ilios/frontend,stopfstedt/frontend,thecoolestguy/frontend,ilios/frontend,stopfstedt/frontend,gboushey/frontend,djvoa12/frontend,gabycampagna/frontend,gabycampagna/frontend
--- +++ @@ -7,5 +7,4 @@ assessmentOption: DS.belongsTo('assessment-option', {async: true}), school: DS.belongsTo('school', {async: true}), aamcMethods: DS.hasMany('aamc-method', {async: true}), - sessions: DS.hasMany('session', {async: true}), });
0640d35ab77d16c24db7e9b889723ab7f093df2f
build/dev-server-chrome.js
build/dev-server-chrome.js
require('./check-versions')(); var config = require('../config'); if (!process.env.NODE_ENV) { process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV); } var webpack = require('webpack'); var webpackConfig = require('./webpack.dev.conf'); const compiler = webpack(webpackConfig); const watching = compiler.watch({}, (err, stats) => { if (err) throw err; process.stdout.write(stats.toString({ colors: true, modules: false, children: false, chunks: false, chunkModules: false }) + '\n\n'); }); module.exports = { close: () => { watching.close(() => { console.log('Watching ended'); }); } };
require('./check-versions')(); let config = require('../config'); if (!process.env.NODE_ENV) { process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV); } let webpack = require('webpack'); let webpackConfig = require('./webpack.dev.conf'); const compiler = webpack(webpackConfig); const watching = compiler.watch({}, (err, stats) => { if (err) throw err; process.stdout.write(stats.toString({ colors: true, modules: false, children: false, chunks: false, chunkModules: false, assets: false, hash: false, version: false, timings: false, }) + '\n\n'); }); module.exports = { close: () => { watching.close(); }, };
Improve output message and lint
Improve output message and lint
JavaScript
mit
nextgensparx/quantum-router,nextgensparx/quantum-router
--- +++ @@ -1,12 +1,12 @@ require('./check-versions')(); -var config = require('../config'); +let config = require('../config'); if (!process.env.NODE_ENV) { process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV); } -var webpack = require('webpack'); -var webpackConfig = require('./webpack.dev.conf'); +let webpack = require('webpack'); +let webpackConfig = require('./webpack.dev.conf'); const compiler = webpack(webpackConfig); @@ -17,14 +17,17 @@ modules: false, children: false, chunks: false, - chunkModules: false + chunkModules: false, + + assets: false, + hash: false, + version: false, + timings: false, }) + '\n\n'); }); module.exports = { close: () => { - watching.close(() => { - console.log('Watching ended'); - }); - } + watching.close(); + }, };
43bf846321bdbfed04a3f2338805013342bb84d9
js/controllers/imprint.js
js/controllers/imprint.js
"use strict"; // Serves the imprint for the application module.exports = 'controllers/imprint'; var dependencies = []; angular.module(module.exports, dependencies) .controller('ImprintCtrl', function ($scope, $http) { $scope.config = config; if (config.server) { $http.get(config.server + '/') .success(function (data) { $scope.server = data; }); } });
"use strict"; // Serves the imprint for the application module.exports = 'controllers/imprint'; var dependencies = []; angular.module(module.exports, dependencies) .controller('ImprintCtrl', function ($scope, $http) { $scope.config = config; $http .get(config.server + '/') .success(function (data) { $scope.server = data; }); });
Remove unneeded check if there is a server
Remove unneeded check if there is a server
JavaScript
mit
dragonservice/sso-client,dragonservice/sso-client
--- +++ @@ -8,10 +8,9 @@ angular.module(module.exports, dependencies) .controller('ImprintCtrl', function ($scope, $http) { $scope.config = config; - if (config.server) { - $http.get(config.server + '/') - .success(function (data) { - $scope.server = data; - }); - } + $http + .get(config.server + '/') + .success(function (data) { + $scope.server = data; + }); });
96ab389bb9a363adecec8241bc4c71e95c71d4c8
coursebuilder/modules/student_groups/_static/js/student_groups_list.js
coursebuilder/modules/student_groups/_static/js/student_groups_list.js
var XSSI_PREFIX = ")]}'"; function parseJson(s) { return JSON.parse(s.replace(XSSI_PREFIX, "")); } $(function(){ $('div[data-delete-url]').each(function(index, element){ var groupName = $(element).data('group-name'); var button = $('<button id="delete-' + groupName + '" ' + 'class="gcb-list__icon gcb-delete-student-group ' + 'delete-button gcb-list__icon--rowhover material-icons">' + 'delete</button>') var deleteUrl = $(element).data('delete-url'); button.click(function(){ if (confirm('You are about to delete this group. Really proceed?')) { $.ajax({ url: deleteUrl, method: 'DELETE', error: function(response) { // Here, we are re-using the OEditor style delete handler, so // we need to cope with a CB-encoded response style. if (response.status == 200 && response.statusText == "OK") { var payload = parseJson(response.responseText); if (payload.status == 200 && payload.message == "Deleted.") { location.reload(); } else { cbShowMsgAutoHide('Deletion failed: ' + payload.message); } } else { cbShowMsgAutoHide('Deletion failed: ' + response.responseText) } }, success: function() { location.reload(); } }); } }); $(element).append(button) }); });
var XSSI_PREFIX = ")]}'"; function parseJson(s) { return JSON.parse(s.replace(XSSI_PREFIX, "")); } $(function(){ $('div[data-delete-url]').each(function(index, element){ var groupName = $(element).data('group-name'); var button = $('<button id="delete-' + groupName + '" ' + 'class="gcb-list__icon gcb-delete-student-group ' + 'delete-button gcb-list__icon--rowhover material-icons">' + 'delete</button>') var deleteUrl = $(element).data('delete-url'); button.click(function(){ if (confirm('You are about to delete this group. Really proceed?')) { $.ajax({ url: deleteUrl, method: 'DELETE', error: function(response) { // Here, we are re-using the OEditor style delete handler, so // we need to cope with a CB-encoded response style. if (response.status == 200) { var payload = parseJson(response.responseText); if (payload.status == 200 && payload.message == "Deleted.") { location.reload(); } else { cbShowMsgAutoHide('Deletion failed: ' + payload.message); } } else { cbShowMsgAutoHide('Deletion failed: ' + response.responseText) } }, success: function() { location.reload(); } }); } }); $(element).append(button) }); });
Change JS parser to only look for 200 success code not the actual "OK".
Change JS parser to only look for 200 success code not the actual "OK". Oddly, in production, Chrome returns request.status as 'parsererror' rather than "OK", which is what we get when running against a dev server. The 'parseerror' is actually fairly reasonable -- we send back JSON with our script-buster prefix of })]. Change on 2016/09/23 by mgainer <mgainer@google.com> ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=134080221
JavaScript
apache-2.0
andela-angene/coursebuilder-core,andela-angene/coursebuilder-core,andela-angene/coursebuilder-core,andela-angene/coursebuilder-core
--- +++ @@ -20,7 +20,7 @@ error: function(response) { // Here, we are re-using the OEditor style delete handler, so // we need to cope with a CB-encoded response style. - if (response.status == 200 && response.statusText == "OK") { + if (response.status == 200) { var payload = parseJson(response.responseText); if (payload.status == 200 && payload.message == "Deleted.") { location.reload();
644b2a98ded16b7268f0cd2f28b20cbfb4814505
lib/cli/src/generators/REACT/template-csf/.storybook/main.js
lib/cli/src/generators/REACT/template-csf/.storybook/main.js
module.exports = { stories: ['../stories/**/*.stories.js'], addons: ['@storybook/addon-actions', '@storybook/addon-links'], };
module.exports = { stories: ['../stories/**/*.stories.(ts|tsx|js|jsx)'], addons: ['@storybook/addon-actions', '@storybook/addon-links'], };
Support Both js and jsx or ts and tsx
Support Both js and jsx or ts and tsx
JavaScript
mit
kadirahq/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook
--- +++ @@ -1,4 +1,4 @@ module.exports = { - stories: ['../stories/**/*.stories.js'], + stories: ['../stories/**/*.stories.(ts|tsx|js|jsx)'], addons: ['@storybook/addon-actions', '@storybook/addon-links'], };
6fb67b0a4047610c067b2e118a695bca742a6201
cloudcode/cloud/main.js
cloudcode/cloud/main.js
// Parse CloudCode Parse.Cloud.beforeSave(Parse.Installation, function(request, response) { Parse.Cloud.useMasterKey(); var androidId = request.object.get("androidId"); if (androidId == null || androidId == "") { console.warn("No androidId found, exit"); response.success(); } var query = new Parse.Query(Parse.Installation); query.equalTo("deviceType", "android"); query.equalTo("androidId", androidId); query.addAscending("createdAt"); query.find().then(function(results) { for (var i = 0; i < results.length; ++i) { if (results[i].get("installationId") != request.object.get("installationId")) { console.warn("App id " + results[i].get("installationId") + ", delete!"); results[i].destroy().then(function() { console.warn("Delete success"); }, function() { console.warn("Delete error"); } ); } else { console.warn("Current App id " + results[i].get("installationId") + ", dont delete"); } } response.success(); }, function(error) { response.error("Can't find Installation objects"); } ); });
// Parse CloudCode Parse.Cloud.beforeSave(Parse.Installation, function(request, response) { Parse.Cloud.useMasterKey(); var androidId = request.object.get("androidId"); if (androidId == null || androidId == "") { console.warn("No androidId found, exit"); return response.success(); } var query = new Parse.Query(Parse.Installation); query.equalTo("deviceType", "android"); query.equalTo("androidId", androidId); query.addAscending("createdAt"); query.find().then(function(results) { for (var i = 0; i < results.length; ++i) { if (results[i].get("installationId") != request.object.get("installationId")) { console.warn("App id " + results[i].get("installationId") + ", delete!"); results[i].destroy().then(function() { console.warn("Delete success"); }, function() { console.warn("Delete error"); }); } else { console.warn("Current App id " + results[i].get("installationId") + ", dont delete"); } } response.success(); }, function(error) { response.error("Can't find Installation objects"); }); });
Fix typo on error handling conditional
Fix typo on error handling conditional
JavaScript
mit
timanrebel/Parse,DouglasHennrich/Parse,gimdongwoo/Parse,timanrebel/Parse,DouglasHennrich/Parse,DouglasHennrich/Parse,DouglasHennrich/Parse,timanrebel/Parse,gimdongwoo/Parse,DouglasHennrich/Parse,timanrebel/Parse,gimdongwoo/Parse,gimdongwoo/Parse
--- +++ @@ -1,36 +1,32 @@ // Parse CloudCode Parse.Cloud.beforeSave(Parse.Installation, function(request, response) { - Parse.Cloud.useMasterKey(); - - var androidId = request.object.get("androidId"); - if (androidId == null || androidId == "") { - console.warn("No androidId found, exit"); - response.success(); - } - - var query = new Parse.Query(Parse.Installation); - query.equalTo("deviceType", "android"); - query.equalTo("androidId", androidId); - query.addAscending("createdAt"); - query.find().then(function(results) { - for (var i = 0; i < results.length; ++i) { - if (results[i].get("installationId") != request.object.get("installationId")) { - console.warn("App id " + results[i].get("installationId") + ", delete!"); - results[i].destroy().then(function() { - console.warn("Delete success"); - }, - function() { - console.warn("Delete error"); - } - ); - } else { - console.warn("Current App id " + results[i].get("installationId") + ", dont delete"); - } + Parse.Cloud.useMasterKey(); + + var androidId = request.object.get("androidId"); + if (androidId == null || androidId == "") { + console.warn("No androidId found, exit"); + return response.success(); } - response.success(); - }, - function(error) { - response.error("Can't find Installation objects"); - } - ); + + var query = new Parse.Query(Parse.Installation); + query.equalTo("deviceType", "android"); + query.equalTo("androidId", androidId); + query.addAscending("createdAt"); + query.find().then(function(results) { + for (var i = 0; i < results.length; ++i) { + if (results[i].get("installationId") != request.object.get("installationId")) { + console.warn("App id " + results[i].get("installationId") + ", delete!"); + results[i].destroy().then(function() { + console.warn("Delete success"); + }, function() { + console.warn("Delete error"); + }); + } else { + console.warn("Current App id " + results[i].get("installationId") + ", dont delete"); + } + } + response.success(); + }, function(error) { + response.error("Can't find Installation objects"); + }); });
a8cf1c8156c2c87cf8a68a5cc362797a29cf760c
src/webWorker/decodeTask/decoders/decodeJPEGLossless.js
src/webWorker/decodeTask/decoders/decodeJPEGLossless.js
"use strict"; (function (cornerstoneWADOImageLoader) { function decodeJPEGLossless(imageFrame, pixelData) { // check to make sure codec is loaded if(typeof jpeg === 'undefined' || typeof jpeg.lossless === 'undefined' || typeof jpeg.lossless.Decoder === 'undefined') { throw 'No JPEG Lossless decoder loaded'; } var byteOutput = imageFrame.bitsAllocated <= 8 ? 1 : 2; //console.time('jpeglossless'); var buffer = pixelData.buffer; var decoder = new jpeg.lossless.Decoder(); var decompressedData = decoder.decode(buffer, buffer.byteOffset, buffer.length, byteOutput); //console.timeEnd('jpeglossless'); if (imageFrame.pixelRepresentation === 0) { if (imageFrame.bitsAllocated === 16) { imageFrame.pixelData = new Uint16Array(decompressedData.buffer); return imageFrame; } else { // untested! imageFrame.pixelData = new Uint8Array(decompressedData.buffer); return imageFrame; } } else { imageFrame.pixelData = new Int16Array(decompressedData.buffer); return imageFrame; } } // module exports cornerstoneWADOImageLoader.decodeJPEGLossless = decodeJPEGLossless; }(cornerstoneWADOImageLoader));
"use strict"; (function (cornerstoneWADOImageLoader) { function decodeJPEGLossless(imageFrame, pixelData) { // check to make sure codec is loaded if(typeof jpeg === 'undefined' || typeof jpeg.lossless === 'undefined' || typeof jpeg.lossless.Decoder === 'undefined') { throw 'No JPEG Lossless decoder loaded'; } var byteOutput = imageFrame.bitsAllocated <= 8 ? 1 : 2; //console.time('jpeglossless'); var buffer = pixelData.buffer; var decoder = new jpeg.lossless.Decoder(); var decompressedData = decoder.decode(buffer, pixelData.byteOffset, pixelData.length, byteOutput); //console.timeEnd('jpeglossless'); if (imageFrame.pixelRepresentation === 0) { if (imageFrame.bitsAllocated === 16) { imageFrame.pixelData = new Uint16Array(decompressedData.buffer); return imageFrame; } else { // untested! imageFrame.pixelData = new Uint8Array(decompressedData.buffer); return imageFrame; } } else { imageFrame.pixelData = new Int16Array(decompressedData.buffer); return imageFrame; } } // module exports cornerstoneWADOImageLoader.decodeJPEGLossless = decodeJPEGLossless; }(cornerstoneWADOImageLoader));
Fix a bug which causes that JPEG lossless images cannot be decompressed in Safari
Fix a bug which causes that JPEG lossless images cannot be decompressed in Safari
JavaScript
mit
mikewolfd/cornerstoneWADOImageLoader,google/cornerstoneWADOImageLoader,google/cornerstoneWADOImageLoader,chafey/cornerstoneWADOImageLoader,cornerstonejs/cornerstoneWADOImageLoader,mikewolfd/cornerstoneWADOImageLoader,chafey/cornerstoneWADOImageLoader,cornerstonejs/cornerstoneWADOImageLoader,google/cornerstoneWADOImageLoader,chafey/cornerstoneWADOImageLoader,mikewolfd/cornerstoneWADOImageLoader,cornerstonejs/cornerstoneWADOImageLoader
--- +++ @@ -13,7 +13,7 @@ //console.time('jpeglossless'); var buffer = pixelData.buffer; var decoder = new jpeg.lossless.Decoder(); - var decompressedData = decoder.decode(buffer, buffer.byteOffset, buffer.length, byteOutput); + var decompressedData = decoder.decode(buffer, pixelData.byteOffset, pixelData.length, byteOutput); //console.timeEnd('jpeglossless'); if (imageFrame.pixelRepresentation === 0) { if (imageFrame.bitsAllocated === 16) {
224e79ca27a2d1d7c0ea4b312ba850ea69e37c40
lib/binding_web/prefix.js
lib/binding_web/prefix.js
var TreeSitter = function() { var initPromise; class Parser { constructor() { this.initialize(); } initialize() { throw new Error("cannot construct a Parser before calling `init()`"); } static init(moduleOptions) { if (initPromise) return initPromise; Module = Object.assign({ }, Module, moduleOptions); return initPromise = new Promise((resolveInitPromise) => {
var TreeSitter = function() { var initPromise; var document = typeof window == 'object' ? {currentScript: window.document.currentScript} : null; class Parser { constructor() { this.initialize(); } initialize() { throw new Error("cannot construct a Parser before calling `init()`"); } static init(moduleOptions) { if (initPromise) return initPromise; Module = Object.assign({}, Module, moduleOptions); return initPromise = new Promise((resolveInitPromise) => {
Fix script directory that's passed to locateFile
web: Fix script directory that's passed to locateFile
JavaScript
mit
tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter
--- +++ @@ -1,5 +1,9 @@ var TreeSitter = function() { var initPromise; + var document = typeof window == 'object' + ? {currentScript: window.document.currentScript} + : null; + class Parser { constructor() { this.initialize(); @@ -11,5 +15,5 @@ static init(moduleOptions) { if (initPromise) return initPromise; - Module = Object.assign({ }, Module, moduleOptions); + Module = Object.assign({}, Module, moduleOptions); return initPromise = new Promise((resolveInitPromise) => {
45ba55ea6238a1123c3937c50a8036ab9909159c
client/components/titleEditor/titleEditor.controller.js
client/components/titleEditor/titleEditor.controller.js
'use strict'; /*global Wodo*/ angular.module('manticoreApp') .controller('TitleEditorCtrl', function ($scope, $timeout) { function handleTitleChanged(changes) { var title = changes.setProperties['dc:title']; if (title !== undefined && title !== $scope.title) { $timeout(function () { $scope.title = title; }); } } $scope.changeTitle = function () { if ($scope.title !== $scope.editor.getMetadata('dc:title')) { $scope.editor.setMetadata({ 'dc:title': $scope.title }); } }; $scope.handleEnterKey = function ($event) { if ($event.keyCode === 13) { $event.target.blur(); } }; $scope.$watch('joined', function (online) { if (online === undefined) { return; } if (online) { $scope.editor.addEventListener(Wodo.EVENT_METADATACHANGED, handleTitleChanged); $scope.title = $scope.editor.getMetadata('dc:title'); } else { $scope.editor.removeEventListener(Wodo.EVENT_METADATACHANGED, handleTitleChanged); } }); function init() { $scope.title = $scope.document.title; } init(); });
'use strict'; /*global Wodo*/ angular.module('manticoreApp') .controller('TitleEditorCtrl', function ($scope, $timeout) { function handleTitleChanged(changes) { var title = changes.setProperties['dc:title']; if (title !== undefined && title !== $scope.title) { $timeout(function () { $scope.title = title; }); } } $scope.changeTitle = function () { if ($scope.title !== $scope.editor.getMetadata('dc:title')) { $scope.editor.setMetadata({ 'dc:title': $scope.title }); } }; $scope.handleEnterKey = function ($event) { if ($event.keyCode === 13) { $event.target.blur(); } }; $scope.$watch('joined', function (online) { if (online === undefined) { return; } if (online) { $scope.editor.addEventListener(Wodo.EVENT_METADATACHANGED, handleTitleChanged); } else { $scope.editor.removeEventListener(Wodo.EVENT_METADATACHANGED, handleTitleChanged); } }); function init() { $scope.title = $scope.document.title; } init(); });
Set metadata as UI title only when someone changes it
Set metadata as UI title only when someone changes it
JavaScript
agpl-3.0
adityab/Manticore,adityab/Manticore,adityab/Manticore
--- +++ @@ -31,7 +31,6 @@ if (online === undefined) { return; } if (online) { $scope.editor.addEventListener(Wodo.EVENT_METADATACHANGED, handleTitleChanged); - $scope.title = $scope.editor.getMetadata('dc:title'); } else { $scope.editor.removeEventListener(Wodo.EVENT_METADATACHANGED, handleTitleChanged); }
4131eb36ac232a33980f706ec201c33c68681596
.infrastructure/webpack/helpers/loadersByExtension.js
.infrastructure/webpack/helpers/loadersByExtension.js
function extsToRegExp (exts) { return new RegExp('\\.(' + exts.map(function (ext) { return ext.replace(/\./g, '\\.') }).join('|') + ')(\\?.*)?$') } module.exports = function loadersByExtension (obj) { var loaders = [] Object.keys(obj).forEach(function (key) { var exts = key.split('|') var value = obj[key] var entry = { extensions: exts, test: extsToRegExp(exts) } if (Array.isArray(value)) { entry.loaders = value } else if (typeof value === 'string') { entry.loader = value } else { Object.keys(value).forEach(function (valueKey) { entry[valueKey] = value[valueKey] }) } loaders.push(entry) }) return loaders }
function extsToRegExp (exts) { return new RegExp('\\.(' + exts.map(function (ext) { return ext.replace(/\./g, '\\.') }).join('|') + ')(\\?.*)?$') } module.exports = function loadersByExtension (obj) { var loaders = [] Object.keys(obj).forEach(function (key) { var exts = key.split('|') var value = obj[key] var entry = { extensions: exts, test: extsToRegExp(exts) } if (Array.isArray(value)) { entry.loaders = value } else if (typeof value === 'string') { entry.loader = value } else { Object.keys(value).forEach(function (valueKey) { entry[valueKey] = value[valueKey] }) } loaders.push(entry) }) return loaders }
Update coding styles in webpack loaders
Update coding styles in webpack loaders
JavaScript
mpl-2.0
beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy
--- +++ @@ -1,28 +1,28 @@ function extsToRegExp (exts) { - return new RegExp('\\.(' + exts.map(function (ext) { - return ext.replace(/\./g, '\\.') - }).join('|') + ')(\\?.*)?$') + return new RegExp('\\.(' + exts.map(function (ext) { + return ext.replace(/\./g, '\\.') + }).join('|') + ')(\\?.*)?$') } module.exports = function loadersByExtension (obj) { - var loaders = [] - Object.keys(obj).forEach(function (key) { - var exts = key.split('|') - var value = obj[key] - var entry = { - extensions: exts, - test: extsToRegExp(exts) - } - if (Array.isArray(value)) { - entry.loaders = value - } else if (typeof value === 'string') { - entry.loader = value - } else { - Object.keys(value).forEach(function (valueKey) { - entry[valueKey] = value[valueKey] - }) - } - loaders.push(entry) - }) - return loaders + var loaders = [] + Object.keys(obj).forEach(function (key) { + var exts = key.split('|') + var value = obj[key] + var entry = { + extensions: exts, + test: extsToRegExp(exts) + } + if (Array.isArray(value)) { + entry.loaders = value + } else if (typeof value === 'string') { + entry.loader = value + } else { + Object.keys(value).forEach(function (valueKey) { + entry[valueKey] = value[valueKey] + }) + } + loaders.push(entry) + }) + return loaders }