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
6593af6c87d41248d9cefc0248b8992a68658d59
patterns-samples/Photos.PhotoDetailNarrowSample.js
patterns-samples/Photos.PhotoDetailNarrowSample.js
enyo.kind({ name: "moon.sample.photos.PhotoDetailNarrowSample", kind : "moon.Panel", classes: "photo-detail", fit: true, title : "PHOTO NAME", titleAbove : "03", titleBelow : "2013-04-08", headerComponents : [ { kind : "moon.IconButton", style : "border:none;", src : "assets/icon-favorite.png"}, { kind : "moon.IconButton", style : "border:none;", src : "assets/icon-download.png"}, { kind : "moon.IconButton", style : "border:none;", src : "assets/icon-next.png"}, ], components: [ {kind : "enyo.Spotlight"}, { kind : "enyo.Image", src : "./assets/default-movie.png", style : "width:600px;height:400px;" } ] });
enyo.kind({ name: "moon.sample.photos.PhotoDetailNarrowSample", kind: "moon.Panel", classes: "photo-detail", fit: true, title: "PHOTO NAME", titleAbove: "03", titleBelow: "2013-04-08", headerComponents : [ {kind: "moon.IconButton", style: "border:none;", src: "assets/icon-favorite.png"}, {kind: "moon.IconButton", style: "border:none;", src: "assets/icon-download.png"}, {kind: "moon.IconButton", style: "border:none;", src: "assets/icon-next.png"}, ], components: [ { //bindFrom: "src" name: "photoDetail", kind: "enyo.Image", src: "", //ontap: "changImage", style: "width:600px;height:400px;" } ], bindings: [ {from: ".controller.src", to: "$.photoDetail.src"} ] }); // Sample model enyo.ready(function(){ var sampleModel = new enyo.Model({ src: "./assets/default-movie.png" }); // Application to render sample new enyo.Application({ view: { classes: "enyo-unselectable moon", components: [ {kind: "enyo.Spotlight"}, { kind: "moon.sample.photos.PhotoDetailNarrowSample", controller: ".app.controllers.photoController", classes: "enyo-fit" } ] }, controllers: [ { name: "photoController", kind: "enyo.ModelController", model: sampleModel, changImage: function(inSender, inEvent) { enyo.log("Item: " + inEvent.originator.parent.controller.model.get("menuItem")); } } ] }); });
Apply MVC to older one
GF-4661: Apply MVC to older one Enyo-DCO-1.1-Signed-off-by: David Um <david.um@lge.com>
JavaScript
apache-2.0
mcanthony/moonstone,mcanthony/moonstone,mcanthony/moonstone,enyojs/moonstone
--- +++ @@ -1,24 +1,63 @@ enyo.kind({ name: "moon.sample.photos.PhotoDetailNarrowSample", - kind : "moon.Panel", + kind: "moon.Panel", classes: "photo-detail", fit: true, - title : "PHOTO NAME", - titleAbove : "03", - titleBelow : "2013-04-08", + title: "PHOTO NAME", + titleAbove: "03", + titleBelow: "2013-04-08", headerComponents : [ - { kind : "moon.IconButton", style : "border:none;", src : "assets/icon-favorite.png"}, - { kind : "moon.IconButton", style : "border:none;", src : "assets/icon-download.png"}, - { kind : "moon.IconButton", style : "border:none;", src : "assets/icon-next.png"}, + {kind: "moon.IconButton", style: "border:none;", src: "assets/icon-favorite.png"}, + {kind: "moon.IconButton", style: "border:none;", src: "assets/icon-download.png"}, + {kind: "moon.IconButton", style: "border:none;", src: "assets/icon-next.png"}, ], components: [ - {kind : "enyo.Spotlight"}, { - kind : "enyo.Image", - src : "./assets/default-movie.png", - style : "width:600px;height:400px;" + //bindFrom: "src" + name: "photoDetail", + kind: "enyo.Image", + src: "", + //ontap: "changImage", + style: "width:600px;height:400px;" } + ], + bindings: [ + {from: ".controller.src", to: "$.photoDetail.src"} ] }); + +// Sample model + +enyo.ready(function(){ + var sampleModel = new enyo.Model({ + src: "./assets/default-movie.png" + }); + +// Application to render sample + + new enyo.Application({ + view: { + classes: "enyo-unselectable moon", + components: [ + {kind: "enyo.Spotlight"}, + { + kind: "moon.sample.photos.PhotoDetailNarrowSample", + controller: ".app.controllers.photoController", + classes: "enyo-fit" + } + ] + }, + controllers: [ + { + name: "photoController", + kind: "enyo.ModelController", + model: sampleModel, + changImage: function(inSender, inEvent) { + enyo.log("Item: " + inEvent.originator.parent.controller.model.get("menuItem")); + } + } + ] + }); +});
ed91eac72f4af9dc76e52d85fee204a65d604249
node-red-contrib-alasql.js
node-red-contrib-alasql.js
module.exports = function (RED) { var alasql = require('alasql'); function AlasqlNodeIn(config) { RED.nodes.createNode(this, config); var node = this; node.query = config.query; node.on("input", function (msg) { var sql = this.query || 'SELECT * FROM ?'; var bind = Array.isArray(msg.payload) ? msg.payload : [msg.payload]; alasql.promise(sql, [bind]) .then(function (res) { msg.payload = res; node.status({fill: "green", shape: "dot", text: ' Records: ' + msg.payload.length}); node.send(msg); }).catch((err) => { node.error(err, msg); }); }); } RED.nodes.registerType("alasql", AlasqlNodeIn); }
module.exports = function (RED) { var alasql = require('alasql'); function AlasqlNodeIn(config) { RED.nodes.createNode(this, config); var node = this; node.query = config.query; node.on("input", function (msg) { var sql = this.query || 'SELECT * FROM ?'; var bind = Array.isArray(msg.payload) ? msg.payload : [msg.payload]; alasql.promise(sql, [bind]) .then(function (res) { msg.payload = res; node.status({fill: "green", shape: "dot", text: ' Records: ' + msg.payload.length}); node.send(msg); }).catch((err) => { node.error(err, msg); }); }); this.on('close', () => { node.status({}); }); } RED.nodes.registerType("alasql", AlasqlNodeIn); };
Add on.('close') to clear node status on Deploy
Add on.('close') to clear node status on Deploy
JavaScript
mit
AlaSQL/node-red-contrib-alasql,AlaSQL/node-red-contrib-alasql
--- +++ @@ -17,7 +17,10 @@ node.error(err, msg); }); }); + this.on('close', () => { + node.status({}); + }); } RED.nodes.registerType("alasql", AlasqlNodeIn); -} +};
cd32c55741feb1bdbf5695b11ed2b0e4bdb11cf1
src/constants/index.js
src/constants/index.js
export const SOCKET_URL = 'wss://ws.onfido.com:9876' export const XHR_URL = 'https://api.onfido.com' export const DOCUMENT_CAPTURE = 'DOCUMENT_CAPTURE' export const FACE_CAPTURE = 'FACE_CAPTURE' export const SET_TOKEN = 'SET_TOKEN' export const SET_AUTHENTICATED = 'SET_AUTHENTICATED' export const SET_WEBSOCKET_SUPPORT = 'SET_WEBSOCKET_SUPPORT' export const SET_GUM_SUPPORT = 'SET_GUM_SUPPORT' export const SET_DOCUMENT_CAPTURED = 'SET_DOCUMENT_CAPTURED' export const SET_FACE_CAPTURED = 'SET_FACE_CAPTURED' export const SET_DOCUMENT_TYPE = 'SET_DOCUMENT_TYPE'
export const SOCKET_URL = 'wss://ws.onfido.com:9876' export const SOCKET_URL_DEV = 'wss://document-check-staging.onfido.co.uk:9876' export const XHR_URL = 'https://api.onfido.com' export const DOCUMENT_CAPTURE = 'DOCUMENT_CAPTURE' export const FACE_CAPTURE = 'FACE_CAPTURE' export const SET_TOKEN = 'SET_TOKEN' export const SET_AUTHENTICATED = 'SET_AUTHENTICATED' export const SET_WEBSOCKET_SUPPORT = 'SET_WEBSOCKET_SUPPORT' export const SET_GUM_SUPPORT = 'SET_GUM_SUPPORT' export const SET_DOCUMENT_CAPTURED = 'SET_DOCUMENT_CAPTURED' export const SET_FACE_CAPTURED = 'SET_FACE_CAPTURED' export const SET_DOCUMENT_TYPE = 'SET_DOCUMENT_TYPE' export const CAPTURE_IS_VALID = 'CAPTURE_IS_VALID'
Add constants for capture valid
Add constants for capture valid
JavaScript
mit
onfido/onfido-sdk-core
--- +++ @@ -1,4 +1,5 @@ export const SOCKET_URL = 'wss://ws.onfido.com:9876' +export const SOCKET_URL_DEV = 'wss://document-check-staging.onfido.co.uk:9876' export const XHR_URL = 'https://api.onfido.com' export const DOCUMENT_CAPTURE = 'DOCUMENT_CAPTURE' @@ -11,3 +12,5 @@ export const SET_DOCUMENT_CAPTURED = 'SET_DOCUMENT_CAPTURED' export const SET_FACE_CAPTURED = 'SET_FACE_CAPTURED' export const SET_DOCUMENT_TYPE = 'SET_DOCUMENT_TYPE' + +export const CAPTURE_IS_VALID = 'CAPTURE_IS_VALID'
649b7be4c27fc54464e3d1a0560f76e8f3505eb8
examples/webpack/config.js
examples/webpack/config.js
const CopyPlugin = require('copy-webpack-plugin'); const ExampleBuilder = require('./example-builder'); const fs = require('fs'); const path = require('path'); const src = path.join(__dirname, '..'); const examples = fs.readdirSync(src) .filter(name => /^(?!index).*\.html$/.test(name)) .map(name => name.replace(/\.html$/, '')); const entry = {}; examples.forEach(example => { entry[example] = `./${example}.js`; }); module.exports = { context: src, target: 'web', entry: entry, optimization: { splitChunks: { name: 'common', // TODO: figure out why this isn't working minChunks: 2 } }, plugins: [ new ExampleBuilder({ templates: path.join(__dirname, '..', 'templates'), common: 'common' }), new CopyPlugin([ {from: '../css', to: 'css'}, {from: 'data', to: 'data'}, {from: 'resources', to: 'resources'}, {from: 'Jugl.js', to: 'Jugl.js'}, {from: 'index.html', to: 'index.html'} ]) ], // TODO: figure out why this hangs // devtool: 'source-map', output: { filename: '[name].js', path: path.join(__dirname, '..', '..', 'build', 'examples') } };
const CopyPlugin = require('copy-webpack-plugin'); const ExampleBuilder = require('./example-builder'); const fs = require('fs'); const path = require('path'); const src = path.join(__dirname, '..'); const examples = fs.readdirSync(src) .filter(name => /^(?!index).*\.html$/.test(name)) .map(name => name.replace(/\.html$/, '')); const entry = {}; examples.forEach(example => { entry[example] = `./${example}.js`; }); module.exports = { context: src, target: 'web', entry: entry, optimization: { runtimeChunk: { name: 'common' }, splitChunks: { name: 'common', chunks: 'initial', minChunks: 2 } }, plugins: [ new ExampleBuilder({ templates: path.join(__dirname, '..', 'templates'), common: 'common' }), new CopyPlugin([ {from: '../css', to: 'css'}, {from: 'data', to: 'data'}, {from: 'resources', to: 'resources'}, {from: 'Jugl.js', to: 'Jugl.js'}, {from: 'index.html', to: 'index.html'} ]) ], devtool: 'source-map', output: { filename: '[name].js', path: path.join(__dirname, '..', '..', 'build', 'examples') } };
Make common chunk (and sourcemap) work
Make common chunk (and sourcemap) work
JavaScript
bsd-2-clause
fredj/ol3,ahocevar/ol3,stweil/ol3,mzur/ol3,stweil/ol3,ahocevar/ol3,stweil/ol3,fredj/ol3,mzur/ol3,adube/ol3,ahocevar/openlayers,geekdenz/ol3,ahocevar/openlayers,bjornharrtell/ol3,adube/ol3,stweil/openlayers,tschaub/ol3,bjornharrtell/ol3,adube/ol3,tschaub/ol3,tschaub/ol3,tschaub/ol3,geekdenz/openlayers,geekdenz/ol3,bjornharrtell/ol3,geekdenz/openlayers,oterral/ol3,ahocevar/ol3,ahocevar/ol3,openlayers/openlayers,openlayers/openlayers,fredj/ol3,stweil/openlayers,stweil/openlayers,stweil/ol3,mzur/ol3,geekdenz/openlayers,ahocevar/openlayers,geekdenz/ol3,geekdenz/ol3,openlayers/openlayers,fredj/ol3,oterral/ol3,oterral/ol3,mzur/ol3
--- +++ @@ -19,8 +19,12 @@ target: 'web', entry: entry, optimization: { + runtimeChunk: { + name: 'common' + }, splitChunks: { - name: 'common', // TODO: figure out why this isn't working + name: 'common', + chunks: 'initial', minChunks: 2 } }, @@ -37,8 +41,7 @@ {from: 'index.html', to: 'index.html'} ]) ], - // TODO: figure out why this hangs - // devtool: 'source-map', + devtool: 'source-map', output: { filename: '[name].js', path: path.join(__dirname, '..', '..', 'build', 'examples')
04fd62bb2301d95fce136b3776e65c7fa9a7189b
src/chrome/lib/install.js
src/chrome/lib/install.js
(function () { 'use strict'; var browserExtension = new h.HypothesisChromeExtension({ chromeTabs: chrome.tabs, chromeBrowserAction: chrome.browserAction, extensionURL: function (path) { return chrome.extension.getURL(path); }, isAllowedFileSchemeAccess: function (fn) { return chrome.extension.isAllowedFileSchemeAccess(fn); }, }); browserExtension.listen(window); chrome.runtime.onInstalled.addListener(onInstalled); chrome.runtime.onUpdateAvailable.addListener(onUpdateAvailable); function onInstalled(installDetails) { if (installDetails.reason === 'install') { browserExtension.firstRun(); } // We need this so that 3rd party cookie blocking does not kill us. // See https://github.com/hypothesis/h/issues/634 for more info. // This is intended to be a temporary fix only. var details = { primaryPattern: 'https://hypothes.is/*', setting: 'allow' }; chrome.contentSettings.cookies.set(details); chrome.contentSettings.images.set(details); chrome.contentSettings.javascript.set(details); browserExtension.install(); } function onUpdateAvailable() { // TODO: Implement a "reload" notification that tears down the current // tabs and calls chrome.runtime.reload(). } })();
(function () { 'use strict'; var browserExtension = new h.HypothesisChromeExtension({ chromeTabs: chrome.tabs, chromeBrowserAction: chrome.browserAction, extensionURL: function (path) { return chrome.extension.getURL(path); }, isAllowedFileSchemeAccess: function (fn) { return chrome.extension.isAllowedFileSchemeAccess(fn); }, }); browserExtension.listen(window); chrome.runtime.onInstalled.addListener(onInstalled); chrome.runtime.requestUpdateCheck(function (status) { chrome.runtime.onUpdateAvailable.addListener(onUpdateAvailable); }); function onInstalled(installDetails) { if (installDetails.reason === 'install') { browserExtension.firstRun(); } // We need this so that 3rd party cookie blocking does not kill us. // See https://github.com/hypothesis/h/issues/634 for more info. // This is intended to be a temporary fix only. var details = { primaryPattern: 'https://hypothes.is/*', setting: 'allow' }; chrome.contentSettings.cookies.set(details); chrome.contentSettings.images.set(details); chrome.contentSettings.javascript.set(details); browserExtension.install(); } function onUpdateAvailable() { chrome.runtime.reload(); } })();
Update the Chrome extension more aggressively
Update the Chrome extension more aggressively Request a chrome update when the extension starts and reload the extension when it's installed.
JavaScript
bsd-2-clause
hypothesis/browser-extension,hypothesis/browser-extension,hypothesis/browser-extension,project-star/browser-extension,hypothesis/browser-extension,project-star/browser-extension,project-star/browser-extension
--- +++ @@ -14,7 +14,9 @@ browserExtension.listen(window); chrome.runtime.onInstalled.addListener(onInstalled); - chrome.runtime.onUpdateAvailable.addListener(onUpdateAvailable); + chrome.runtime.requestUpdateCheck(function (status) { + chrome.runtime.onUpdateAvailable.addListener(onUpdateAvailable); + }); function onInstalled(installDetails) { if (installDetails.reason === 'install') { @@ -36,7 +38,6 @@ } function onUpdateAvailable() { - // TODO: Implement a "reload" notification that tears down the current - // tabs and calls chrome.runtime.reload(). + chrome.runtime.reload(); } })();
96f0fe140e5cbe77d5c31feb60f40c4c562be059
src/ui/Video.js
src/ui/Video.js
"use strict"; import React from 'react'; let { PropTypes } = React; let Video = React.createClass({ propTypes: { src: PropTypes.string.isRequired, width: PropTypes.number.isRequired, height: PropTypes.number.isRequired, currentTimeChanged: PropTypes.func, durationChanged: PropTypes.func, }, componentDidMount() { let video = React.findDOMNode(this.refs.video); video.addEventListener('timeupdate', this.props.currentTimeChanged); video.addEventListener('durationchange', this.props.durationChanged); video.addEventListener('progress', this.props.onProgress); video.addEventListener('ended', this.props.onEnd); }, componentWillUnmount() { let video = React.findDOMNode(this.refs.video); video.removeEventListener('timeupdate', this.props.currentTimeChanged); video.removeEventListener('durationchange', this.props.durationChanged); video.removeEventListener('progress', this.props.onProgress); video.removeEventListener('ended', this.props.onEnd); }, render() { let { src, width, height, currentTimeChanged, durationChanged, ...restProps} = this.props; return (<video ref="video" {...restProps} width={width} height={height} timeupdate={currentTimeChanged} durationchange={durationChanged} > <source src={src} /> </video>); }, }); module.exports = Video;
"use strict"; import React from 'react'; let { PropTypes } = React; module.exports = React.createClass({ displayName: 'Video', propTypes: { src: PropTypes.string.isRequired, width: PropTypes.number.isRequired, height: PropTypes.number.isRequired, currentTimeChanged: PropTypes.func, durationChanged: PropTypes.func, }, componentDidMount() { let video = React.findDOMNode(this.refs.video); video.addEventListener('timeupdate', this.props.currentTimeChanged); video.addEventListener('durationchange', this.props.durationChanged); video.addEventListener('progress', this.props.onProgress); video.addEventListener('ended', this.props.onEnd); }, componentWillUnmount() { let video = React.findDOMNode(this.refs.video); video.removeEventListener('timeupdate', this.props.currentTimeChanged); video.removeEventListener('durationchange', this.props.durationChanged); video.removeEventListener('progress', this.props.onProgress); video.removeEventListener('ended', this.props.onEnd); }, shouldComponentUpdate(nextProps) { if ( this.props.width !== nextProps.width || this.props.height !== nextProps.height || this.props.src !== nextProps.src ) { return true; } return false; }, render() { const videoProps = { autoPlay: this.props.autoPlay, width: this.props.width, height: this.props.height, }; return (<video ref="video" {...videoProps}> <source src={this.props.src} /> </video>); }, });
Implement "shouldComponentUpdate" method to minimise noop render calls.
Implement "shouldComponentUpdate" method to minimise noop render calls.
JavaScript
mit
Andreyco/react-video,Andreyco/react-video
--- +++ @@ -3,7 +3,9 @@ import React from 'react'; let { PropTypes } = React; -let Video = React.createClass({ +module.exports = React.createClass({ + + displayName: 'Video', propTypes: { src: PropTypes.string.isRequired, @@ -29,17 +31,27 @@ video.removeEventListener('ended', this.props.onEnd); }, + shouldComponentUpdate(nextProps) { + if ( + this.props.width !== nextProps.width || + this.props.height !== nextProps.height || + this.props.src !== nextProps.src + ) { + return true; + } + return false; + }, + render() { - let { src, width, height, currentTimeChanged, durationChanged, ...restProps} = this.props; + const videoProps = { + autoPlay: this.props.autoPlay, + width: this.props.width, + height: this.props.height, + }; - return (<video ref="video" {...restProps} - width={width} height={height} - timeupdate={currentTimeChanged} - durationchange={durationChanged} - > - <source src={src} /> + return (<video ref="video" {...videoProps}> + <source src={this.props.src} /> </video>); + }, }); - -module.exports = Video;
37786b6ca041b387ff9be400a1f13412f0f21db8
src/token.js
src/token.js
var MaapError = require("./utils/MaapError.js"); const EventEmitter = require('events'); const util = require('util'); /** * Set dsl's store and point to access at the any engine defined in MaaS. * Token inherits from EventEmitter. Any engine create own events to * comunicate with the other engines. The only once own event of Token is * "update". The event "update" is emit when the new model to be register * into the token. * * @history * | Name | Action performed | Date | * | --- | --- | --- | * | Andrea Mantovani | Create class | 2016-06-01 | * * @author Andrea Mantovani * @license MIT */ var Token = function () { this.modelRegistry = []; this.status = { model: [] }; EventEmitter.call(this); }; util.inherits(Token, EventEmitter); /** * @description * Extract the models stored in the token. * @return {Model[]} */ Token.prototype.extract = function () { return this.modelRegistry; }; /** * @description * Save into this token the model extracted from the dsl file and * send the notifies for each observer attached at the token. * @param model {Model} * The model to store */ Token.prototype.register = function (model) { this.modelRegistry.push(model); this.status.model = model; this.emit("update"); }; module.exports = Token;
var MaapError = require("./utils/MaapError"); const EventEmitter = require("events"); const util = require("util"); /** * Set dsl's store and point to access at the any engine defined in MaaS. * Token inherits from EventEmitter. Any engine create own events to * comunicate with the other engines. The only once own event of Token is * "update". The event "update" is emit when the new model to be register * into the token. The event send the follow object : * ``` * { * models: Model[] * } * ``` * `status.models` is the array with the last models loaded. * * * @history * | Name | Action performed | Date | * | --- | --- | --- | * | Andrea Mantovani | Create class | 2016-06-01 | * * @author Andrea Mantovani * @license MIT */ var Token = function () { this.status = { models: [] }; EventEmitter.call(this); }; util.inherits(Token, EventEmitter); /** * @description * Send the notifies for each observer attached at the token with the model loaded. * @param model {Model} * The model to store */ Token.prototype.register = function (model) { this.status.model = model; this.emit("update", this.status); }; module.exports = Token;
Remove unused array of model
Remove unused array of model
JavaScript
mit
BugBusterSWE/DSLEngine
--- +++ @@ -1,13 +1,20 @@ -var MaapError = require("./utils/MaapError.js"); -const EventEmitter = require('events'); -const util = require('util'); +var MaapError = require("./utils/MaapError"); +const EventEmitter = require("events"); +const util = require("util"); /** * Set dsl's store and point to access at the any engine defined in MaaS. * Token inherits from EventEmitter. Any engine create own events to * comunicate with the other engines. The only once own event of Token is * "update". The event "update" is emit when the new model to be register - * into the token. + * into the token. The event send the follow object : + * ``` + * { + * models: Model[] + * } + * ``` + * `status.models` is the array with the last models loaded. + * * * @history * | Name | Action performed | Date | @@ -18,9 +25,8 @@ * @license MIT */ var Token = function () { - this.modelRegistry = []; this.status = { - model: [] + models: [] }; EventEmitter.call(this); @@ -30,25 +36,13 @@ /** * @description - * Extract the models stored in the token. - * @return {Model[]} - */ -Token.prototype.extract = function () { - return this.modelRegistry; -}; - -/** - * @description - * Save into this token the model extracted from the dsl file and - * send the notifies for each observer attached at the token. + * Send the notifies for each observer attached at the token with the model loaded. * @param model {Model} * The model to store */ Token.prototype.register = function (model) { - this.modelRegistry.push(model); - this.status.model = model; - this.emit("update"); + this.emit("update", this.status); }; module.exports = Token;
5866282cc1d94776dc92ab8eeccf447384860715
test/filters.js
test/filters.js
var requirejs = require('requirejs'); var test = require('tape'); requirejs.config({ baseUrl: 'src', }); test('simple substring can be found', function(t) { t.plan(1); var filters = requirejs('filters'); t.assert(filters.isMatch('world', 'hello world and friends')); }); test('multi-word search criteria can be matched', function(t) { t.plan(1); var filters = requirejs('filters'); t.assert(filters.isMatch('world friends', 'hello world and friends')); }); test('all search words must be in search index to be a match', function(t) { t.plan(1); var filters = requirejs('filters'); t.assert(!filters.isMatch('world friends the', 'hello world and friends')); });
var requirejs = require('requirejs'); var test = require('tape'); requirejs.config({ baseUrl: 'src', }); test('simple substring can be found', function(t) { t.plan(1); var filters = requirejs('filters'); t.ok(filters.isMatch('world', 'hello world and friends')); }); test('multi-word search criteria can be matched', function(t) { t.plan(1); var filters = requirejs('filters'); t.ok(filters.isMatch('world friends', 'hello world and friends')); }); test('all search words must be in search index to be a match', function(t) { t.plan(1); var filters = requirejs('filters'); t.notOk(filters.isMatch('world friends the', 'hello world and friends')); });
Use ok/notOk instead of assert
Use ok/notOk instead of assert notOk(condition) is more apparent than assert(!condition). Use ok/notOk to be obvious and consistent.
JavaScript
mit
lightster/quick-switcher,lightster/quick-switcher,lightster/quick-switcher
--- +++ @@ -10,7 +10,7 @@ var filters = requirejs('filters'); - t.assert(filters.isMatch('world', 'hello world and friends')); + t.ok(filters.isMatch('world', 'hello world and friends')); }); test('multi-word search criteria can be matched', function(t) { @@ -18,7 +18,7 @@ var filters = requirejs('filters'); - t.assert(filters.isMatch('world friends', 'hello world and friends')); + t.ok(filters.isMatch('world friends', 'hello world and friends')); }); test('all search words must be in search index to be a match', function(t) { @@ -26,5 +26,5 @@ var filters = requirejs('filters'); - t.assert(!filters.isMatch('world friends the', 'hello world and friends')); + t.notOk(filters.isMatch('world friends the', 'hello world and friends')); });
0c75269a50e1d140c8b2be6c8ef243ac692ba811
test/index.js
test/index.js
var config = require('./config'); var should = require('should'); var nock = require('nock'); var up = require('../index')(config); var baseApi = nock('https://jawbone.com:443'); describe('up', function(){ describe('.moves', function(){ describe('.get()', function(){ it('should return correct url', function(){ up.moves.get({}, function(err, body) { body.should.equal('https://jawbone.com/nudge/api/v.1.1/users/@me/moves?'); }, debug); }); }); describe('.get({ xid: 123 })', function(){ it('should return correct url', function(){ up.moves.get({ xid: 123 }, function(err, body) { body.should.equal('https://jawbone.com/nudge/api/v.1.1/moves/123'); }, debug); }); }); }); });
var config = require('./config'); var should = require('should'); var nock = require('nock'); var up = require('../index')(config); var baseApi = nock('https://jawbone.com:443'); describe('up', function(){ describe('.moves', function(){ describe('.get()', function(){ it('should call correct url', function(done){ var api = baseApi.matchHeader('Accept', 'application/json') .get('/nudge/api/v.1.1/users/@me/moves?') .reply(200, 'OK!'); up.moves.get({}, function(err, body) { (err === null).should.be.true; body.should.equal('OK!'); api.isDone().should.be.true; api.pendingMocks().should.be.empty; done(); }); }); }); describe('.get({ xid: 123 })', function(){ it('should return correct url', function(done){ var api = baseApi.matchHeader('Accept', 'application/json') .get('/nudge/api/v.1.1/moves/123') .reply(200, 'OK!'); up.moves.get({ xid: 123 }, function(err, body) { (err === null).should.be.true; body.should.equal('OK!'); api.isDone().should.be.true; api.pendingMocks().should.be.empty; done(); }); }); }); }); });
Update initial unit tests to use Nock
Update initial unit tests to use Nock
JavaScript
mit
ryanseys/node-jawbone-up,banaee/node-jawbone-up
--- +++ @@ -8,18 +8,38 @@ describe('up', function(){ describe('.moves', function(){ describe('.get()', function(){ - it('should return correct url', function(){ + it('should call correct url', function(done){ + var api = baseApi.matchHeader('Accept', 'application/json') + .get('/nudge/api/v.1.1/users/@me/moves?') + .reply(200, 'OK!'); + up.moves.get({}, function(err, body) { - body.should.equal('https://jawbone.com/nudge/api/v.1.1/users/@me/moves?'); - }, debug); + (err === null).should.be.true; + body.should.equal('OK!'); + + api.isDone().should.be.true; + api.pendingMocks().should.be.empty; + + done(); + }); }); }); describe('.get({ xid: 123 })', function(){ - it('should return correct url', function(){ + it('should return correct url', function(done){ + var api = baseApi.matchHeader('Accept', 'application/json') + .get('/nudge/api/v.1.1/moves/123') + .reply(200, 'OK!'); + up.moves.get({ xid: 123 }, function(err, body) { - body.should.equal('https://jawbone.com/nudge/api/v.1.1/moves/123'); - }, debug); + (err === null).should.be.true; + body.should.equal('OK!'); + + api.isDone().should.be.true; + api.pendingMocks().should.be.empty; + + done(); + }); }); }); });
d519b8e5022bc7ba0266182bcb3b6d225461d7e4
test/index.js
test/index.js
'use strict'; var expect = require('chaijs/chai').expect; var entries = require('..'); describe('entries', function() { it('produce a nested array of key-value pairs', function() { var input = { a: 1, b: 2, '3': 'c', '4': 'd' }; var expected = [ ['a', 1], ['b', 2], ['3', 'c'], ['4', 'd'] ]; expect(entries(input)).to.deep.have.members(expected); }); it('should work with nested objects', function() { var input = { a: {} }; expect(entries(input)[0][1]).to.equal(input.a); }); it('should work on an empty object', function() { expect(entries({})).to.deep.have.members([]); }); });
'use strict'; var expect = require('chaijs/chai').expect; var entries = require('..'); describe('entries', function() { it('produce a nested array of key-value pairs', function() { var input = { a: 1, b: 2, '3': 'c', '4': 'd' }; var expected = [ ['a', 1], ['b', 2], ['3', 'c'], ['4', 'd'] ]; expect(entries(input)).to.deep.have.members(expected); }); it('should work with nested objects', function() { var input = { a: {} }; expect(entries(input)[0][1]).to.equal(input.a); }); it('should work on an empty object', function() { expect(entries({})).to.deep.have.members([]); }); if (typeof Object.create === 'function') { describe('IE9+ tests', function() { it('should ignore inherited properties (IE9+)', function() { var parent = { parent: true }; var child = Object.create(parent, { child: { value: true } }); expect(entries(child)).to.deep.equal([['child', true]]); }); it('should ignore non-enumerable properties (IE9+)', function() { var source = Object.create({}, { visible: { value: true, enumerable: true }, invisible: { value: true, enumerable: false } }); expect(entries(source)).to.deep.equal([['visible', true]]); }); }); } });
Add enumerables, inherited props tests
Add enumerables, inherited props tests
JavaScript
mit
ndhoule/entries
--- +++ @@ -20,4 +20,26 @@ it('should work on an empty object', function() { expect(entries({})).to.deep.have.members([]); }); + + if (typeof Object.create === 'function') { + describe('IE9+ tests', function() { + it('should ignore inherited properties (IE9+)', function() { + var parent = { parent: true }; + var child = Object.create(parent, { + child: { value: true } + }); + + expect(entries(child)).to.deep.equal([['child', true]]); + }); + + it('should ignore non-enumerable properties (IE9+)', function() { + var source = Object.create({}, { + visible: { value: true, enumerable: true }, + invisible: { value: true, enumerable: false } + }); + + expect(entries(source)).to.deep.equal([['visible', true]]); + }); + }); + } });
85d8dbb12ac354540cd8a1f6d48db57e158c09d2
tests/docs.js
tests/docs.js
'use strict'; var docs = require('../docs/docs'); var expect = require('chai').expect; var sinon = require('sinon'); var stub = sinon.stub; var utils = require('./helpers/utils'); var each = utils.each; var any = utils.any; var getContextStub = require('./helpers/get-context-stub'); var Canvas = require('../lib/index.js'); describe('docs', function () { var element = document.createElement('canvas'); stub(element, 'getContext', getContextStub); var canvas = new Canvas(element); it('is a list of groups', function () { expect(docs.length).to.be.above(1); each(docs, function (value) { expect(value.name).to.exist; expect(value.methods).to.exist; }); }); it('should contain all of the canvasimo methods (or aliases)', function () { each(canvas, function (value, key) { var anyGroupContainsTheMethod = any(docs, function (group) { return any(group.methods, function (method) { return method.name === key || method.alias === key; }); }); expect(anyGroupContainsTheMethod).to.be.true; }); }); it('should have names and descriptions for all methods', function () { each(docs, function (group) { each(group.methods, function (method) { expect(method.name).to.exist; expect(method.description).to.exist; expect(method.name.length).to.be.above(5); expect(method.description.length).to.be.above(5); }); }); }); });
'use strict'; var docs = require('../docs/docs'); var expect = require('chai').expect; var sinon = require('sinon'); var stub = sinon.stub; var utils = require('./helpers/utils'); var each = utils.each; var any = utils.any; var getContextStub = require('./helpers/get-context-stub'); var Canvas = require('../lib/index.js'); describe('docs', function () { var element = document.createElement('canvas'); stub(element, 'getContext', getContextStub); var canvas = new Canvas(element); it('is a list of groups', function () { expect(docs.length).to.be.above(1); each(docs, function (value) { expect(value.name).to.exist; expect(value.methods).to.exist; }); }); it('should contain all of the canvasimo methods (or aliases)', function () { each(canvas, function (value, key) { var anyGroupContainsTheMethod = any(docs, function (group) { return any(group.methods, function (method) { return method.name === key || method.alias === key; }); }); expect(anyGroupContainsTheMethod).to.be.true; }); }); });
Remove test for doc names & descriptions
Remove test for doc names & descriptions
JavaScript
mit
JakeSidSmith/canvasimo,JakeSidSmith/canvasimo,JakeSidSmith/sensible-canvas-interface
--- +++ @@ -37,15 +37,4 @@ }); }); - it('should have names and descriptions for all methods', function () { - each(docs, function (group) { - each(group.methods, function (method) { - expect(method.name).to.exist; - expect(method.description).to.exist; - expect(method.name.length).to.be.above(5); - expect(method.description.length).to.be.above(5); - }); - }); - }); - });
52d61f5483950edb225adbab7b2cadc47a7c84cf
pipeline/app/assets/javascripts/app.js
pipeline/app/assets/javascripts/app.js
'use strict'; var pathwayApp = angular.module('pathwayApp', ['ui.router', 'templates', 'Devise', 'ngCookies']); pathwayApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) { //Default route $urlRouterProvider.otherwise('/'); $locationProvider.html5Mode(true); $stateProvider .state('home', { url: '/', templateUrl: 'index.html', }) .state('login', { url: '/user/login', templateUrl: 'login.html', controller: 'UserController' }) .state('register', { url: '/user/new', templateUrl: 'register.html', controller: 'UserController' }) .state('discover', { url: '/discover', templateUrl: 'discover.html', controller: 'HomeController' .state('createProject', { url: '/project/new', templateUrl: 'newProject.html', controller: 'ProjectController' }) .state('showPathway', { url: '/pathway/:id', templateUrl: 'pathway.html', controller: 'PathwayController' }) .state('showProject', { url: '/pathway/:pathway_id/project/:id', templateUrl: 'project.html', controller: 'ProjectController' }) });
'use strict'; var pathwayApp = angular.module('pathwayApp', ['ui.router', 'templates', 'Devise', 'ngCookies']); pathwayApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) { //Default route $urlRouterProvider.otherwise('/'); $locationProvider.html5Mode(true); $stateProvider .state('home', { url: '/', templateUrl: 'index.html', }) .state('login', { url: '/user/login', templateUrl: 'login.html', controller: 'UserController' }) .state('register', { url: '/user/new', templateUrl: 'register.html', controller: 'UserController' }) .state('discover', { url: '/discover', templateUrl: 'discover.html', controller: 'HomeController' }) .state('createProject', { url: '/project/new', templateUrl: 'newProject.html', controller: 'ProjectController' }) .state('showPathway', { url: '/pathway/:id', templateUrl: 'pathway.html', controller: 'PathwayController' }) .state('showProject', { url: '/pathway/:pathway_id/project/:id', templateUrl: 'project.html', controller: 'ProjectController' }) });
Add brackets to end state
Add brackets to end state
JavaScript
mit
aattsai/Pathway,aattsai/Pathway,aattsai/Pathway
--- +++ @@ -25,6 +25,7 @@ url: '/discover', templateUrl: 'discover.html', controller: 'HomeController' + }) .state('createProject', { url: '/project/new', templateUrl: 'newProject.html',
ce3a0467d18cbb96fb37614c8a26337bbe1d80ec
website/app/application/core/account/settings/settings.js
website/app/application/core/account/settings/settings.js
(function (module) { module.controller("AccountSettingsController", AccountSettingsController); AccountSettingsController.$inject = ["mcapi", "User", "toastr"]; /* @ngInject */ function AccountSettingsController(mcapi, User, toastr) { var ctrl = this; ctrl.fullname = User.attr().fullname; ctrl.updateName = updateName; /////////////////////////// function updateName() { mcapi('/users/%', ctrl.mcuser.email) .success(function () { User.save(ctrl.mcuser); toastr.success('User name updated', 'Success', { closeButton: true }); }).error(function () { }).put({fullname: ctrl.fullname}); } } }(angular.module('materialscommons')));
(function (module) { module.controller("AccountSettingsController", AccountSettingsController); AccountSettingsController.$inject = ["mcapi", "User", "toastr"]; /* @ngInject */ function AccountSettingsController(mcapi, User, toastr) { var ctrl = this; ctrl.fullname = User.attr().fullname; ctrl.updateName = updateName; /////////////////////////// function updateName() { mcapi('/users/%', ctrl.mcuser.email) .success(function () { User.attr.fullname = ctrl.fullname; User.save(); toastr.success('User name updated', 'Success', { closeButton: true }); }).error(function () { }).put({fullname: ctrl.fullname}); } } }(angular.module('materialscommons')));
Update to User.save api references.
Update to User.save api references.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
--- +++ @@ -14,7 +14,8 @@ function updateName() { mcapi('/users/%', ctrl.mcuser.email) .success(function () { - User.save(ctrl.mcuser); + User.attr.fullname = ctrl.fullname; + User.save(); toastr.success('User name updated', 'Success', { closeButton: true });
526e10a3a99be78506cd5a58fe2e03d8a5461d96
src/render_template.js
src/render_template.js
"use strict"; var resolveItemText = require('./resolve_item_text') , makeInlineCitation = require('./make_inline_citation') , makeBibliographyEntry = require('./make_bibliography_entry') , formatItems = require('./format_items') , getCSLItems = require('./csl_from_documents') module.exports = function renderTemplate(opts, cslEngine) { var itemsByID = formatItems(opts) , cslItems , parser cslItems = getCSLItems(itemsByID.document) cslEngine.sys.items = cslItems; cslEngine.updateItems(Object.keys(cslItems), true); parser = require('editorsnotes-markup-parser')({ projectBaseURL: opts.projectBaseURL, resolveItemText: resolveItemText.bind(null, itemsByID), makeInlineCitation: makeInlineCitation.bind(null, cslEngine), makeBibliographyEntry: makeBibliographyEntry.bind(null, cslEngine) }); return parser.render(opts.data); }
"use strict"; var resolveItemText = require('./resolve_item_text') , makeInlineCitation = require('./make_inline_citation') , makeBibliographyEntry = require('./make_bibliography_entry') , formatItems = require('./format_items') , getCSLItems = require('./csl_from_documents') module.exports = function renderTemplate(opts, cslEngine) { var itemsByID = formatItems(opts) , cslItems , parser cslItems = getCSLItems(itemsByID.document) cslEngine.sys.items = cslItems; cslEngine.updateItems(Object.keys(cslItems), true); parser = require('editorsnotes-markup-parser')({ projectBaseURL: opts.projectBaseURL, resolveItemText: resolveItemText.bind(null, itemsByID), makeInlineCitation: makeInlineCitation.bind(null, cslEngine), makeBibliographyEntry: makeBibliographyEntry.bind(null, cslEngine) }); return parser.render(opts.data, {}); }
Add second argument to render() method of markdown parser
Add second argument to render() method of markdown parser
JavaScript
agpl-3.0
editorsnotes/editorsnotes-markup-renderer
--- +++ @@ -22,5 +22,5 @@ makeBibliographyEntry: makeBibliographyEntry.bind(null, cslEngine) }); - return parser.render(opts.data); + return parser.render(opts.data, {}); }
e01550117cb3911806f9eea8465b5fe709fc26ed
scripts/ayuda.js
scripts/ayuda.js
document.getElementById("ayuda").setAttribute("aria-current", "page"); function prueba() { alert("prueba"); } var aside = document.getElementById("complementario"); var button = document.createElement("BUTTON"); var text = document.createTextNode("Prueba"); button.appendChild(text); aside.appendChild(button); button.addEventListener("click", prueba);
document.getElementById("ayuda").setAttribute("aria-current", "page"); function prueba() { alert("prueba"); } var aside = document.getElementById("complementario"); var button = document.createElement("BUTTON"); var text = document.createTextNode("Prueba"); button.appendChild(text); aside.appendChild(button); button.addEventListener("click", prueba, true);
Use capture set to true in onclick event
Use capture set to true in onclick event
JavaScript
mit
nvdaes/nvdaes.github.io,nvdaes/nvdaes.github.io
--- +++ @@ -9,4 +9,4 @@ var text = document.createTextNode("Prueba"); button.appendChild(text); aside.appendChild(button); -button.addEventListener("click", prueba); +button.addEventListener("click", prueba, true);
27fa2729c44fd95129e81894bc52e8e937df5070
management.js
management.js
/** * Management of a device. Supports quering it for information and changing * the WiFi settings. */ class DeviceManagement { constructor(device) { this.device = device; } /** * Get information about this device. Includes model info, token and * connection information. */ info() { return this.device.call('miIO.info'); } /** * Update the wireless settings of this device. Needs `ssid` and `passwd` * to be set in the options object. * * `uid` can be set to associate the device with a Mi Home user id. */ updateWireless(options) { if(typeof options.ssid !== 'string') { throw new Error('options.ssid must be a string'); } if(typeof options.passwd !== 'string') { throw new Error('options.passwd must be a string'); } return this.device.call('miIO.config_router', options) .then(result => { if(! result !== 0) { throw new Error('Failed updating wireless'); } return true; }); } } module.exports = DeviceManagement;
/** * Management of a device. Supports quering it for information and changing * the WiFi settings. */ class DeviceManagement { constructor(device) { this.device = device; } /** * Get information about this device. Includes model info, token and * connection information. */ info() { return this.device.call('miIO.info'); } /** * Update the wireless settings of this device. Needs `ssid` and `passwd` * to be set in the options object. * * `uid` can be set to associate the device with a Mi Home user id. */ updateWireless(options) { if(typeof options.ssid !== 'string') { throw new Error('options.ssid must be a string'); } if(typeof options.passwd !== 'string') { throw new Error('options.passwd must be a string'); } return this.device.call('miIO.config_router', options) .then(result => { if(! result !== 0) { throw new Error('Failed updating wireless'); } return true; }); } /** * Get the wireless state of this device. Includes if the device is * online and counters for things such as authentication failures and * connection success and failures. */ wirelessState() { return this.device.call('miIO.wifi_assoc_state'); } } module.exports = DeviceManagement;
Add ability to get wireless state of a device
Add ability to get wireless state of a device
JavaScript
mit
aholstenson/miio
--- +++ @@ -38,6 +38,15 @@ return true; }); } + + /** + * Get the wireless state of this device. Includes if the device is + * online and counters for things such as authentication failures and + * connection success and failures. + */ + wirelessState() { + return this.device.call('miIO.wifi_assoc_state'); + } } module.exports = DeviceManagement;
7d56f85029af381d27a70d3eec719a3270febe14
src/hooks/verify-token.js
src/hooks/verify-token.js
import jwt from 'jsonwebtoken'; import errors from 'feathers-errors'; /** * Verifies that a JWT token is valid * * @param {Object} options - An options object * @param {String} options.secret - The JWT secret */ export default function(options = {}){ const secret = options.secret; return function(hook) { const token = hook.params.token; if (!token) { return Promise.resolve(hook); } return new Promise(function(resolve, reject){ jwt.verify(token, secret, options, function (error, payload) { if (error) { // Return a 401 if the token has expired or is invalid. return reject(new errors.NotAuthenticated(error)); } // Attach our decoded token payload to the params hook.params.payload = payload; resolve(hook); }); }); }; }
import jwt from 'jsonwebtoken'; import errors from 'feathers-errors'; /** * Verifies that a JWT token is valid * * @param {Object} options - An options object * @param {String} options.secret - The JWT secret */ export default function(options = {}){ const secret = options.secret; if (!secret) { console.log('no secret', options); throw new Error('You need to pass `options.secret` to the verifyToken() hook.'); } return function(hook) { const token = hook.params.token; if (!token) { return Promise.resolve(hook); } return new Promise(function(resolve, reject){ jwt.verify(token, secret, options, function (error, payload) { if (error) { // Return a 401 if the token has expired or is invalid. return reject(new errors.NotAuthenticated(error)); } // Attach our decoded token payload to the params hook.params.payload = payload; resolve(hook); }); }); }; }
Throw an error if you don't pass a secret to verifyToken hook
Throw an error if you don't pass a secret to verifyToken hook
JavaScript
mit
feathersjs/feathers-passport-jwt,feathersjs/feathers-passport-jwt,feathersjs/feathers-authentication,eblin/feathers-authentication,eblin/feathers-authentication,m1ch3lcl/feathers-authentication,m1ch3lcl/feathers-authentication
--- +++ @@ -9,6 +9,11 @@ */ export default function(options = {}){ const secret = options.secret; + + if (!secret) { + console.log('no secret', options); + throw new Error('You need to pass `options.secret` to the verifyToken() hook.'); + } return function(hook) { const token = hook.params.token;
6b883624c19abad009db96f0d00d1ef84b1defe9
scripts/cd-server.js
scripts/cd-server.js
// Continuous delivery server const { spawn } = require('child_process') const { resolve } = require('path') const { createServer } = require('http') const { parse } = require('qs') const hostname = '127.0.0.1' const port = 80 const server = createServer((req, res) => { const { headers, method, url } = req // When a successful build has happened, kill the process, triggering a restart if (req.method === 'POST' && req.url === '/webhook') { // Send response res.statusCode = 200 res.end() let body = [] req .on('error', err => { console.error(err) }) .on('data', chunk => { body.push(chunk) }) .on('end', () => { body = Buffer.concat(body).toString() const { payload } = parse(body) console.log(payload.result + ' ' + payload.branch) const passed = payload.result == 0 const master = payload.branch == 'master' if (passed && master) { process.exit(0) } }) } res.statusCode = 404 res.end() }).listen(port)
// Continuous delivery server const { spawn } = require('child_process') const { resolve } = require('path') const { createServer } = require('http') const { parse } = require('qs') const hostname = '127.0.0.1' const port = 80 const server = createServer((req, res) => { const { headers, method, url } = req // When a successful build has happened, kill the process, triggering a restart if (req.method === 'POST' && req.url === '/webhook') { // Send response res.statusCode = 200 res.end() let body = [] req .on('error', err => { console.error(err) }) .on('data', chunk => { body.push(chunk) }) .on('end', () => { body = Buffer.concat(body).toString() const { payload } = parse(body) const data = JSON.parse(payload) console.log(data.result + ' ' + data.branch) const passed = data.result == 0 const master = data.branch == 'master' if (passed && master) { process.exit(0) } }) } res.statusCode = 404 res.end() }).listen(port)
Fix parsing bug in CD server.
Fix parsing bug in CD server.
JavaScript
mit
jsonnull/jsonnull.com,jsonnull/jsonnull.com,jsonnull/jsonnull.com
--- +++ @@ -26,11 +26,12 @@ .on('end', () => { body = Buffer.concat(body).toString() const { payload } = parse(body) + const data = JSON.parse(payload) - console.log(payload.result + ' ' + payload.branch) + console.log(data.result + ' ' + data.branch) - const passed = payload.result == 0 - const master = payload.branch == 'master' + const passed = data.result == 0 + const master = data.branch == 'master' if (passed && master) { process.exit(0)
9dc1d156c37c0d7ce8d30451371f1a42a9edd87c
app/assets/javascripts/angular/controllers/pie_ctrl.js
app/assets/javascripts/angular/controllers/pie_ctrl.js
angular.module("Prometheus.controllers").controller('PieCtrl', ["$scope", "$http", "SharedWidgetSetup", function($scope, $http, SharedWidgetSetup) { SharedWidgetSetup($scope); $scope.errorMessages = []; // Query for the data. $scope.refreshGraph = function() { var exp = $scope.graph.expression; var server = $scope.serversById[exp['serverID'] || 1]; $scope.requestInFlight = true; var url = document.createElement('a'); url.href = server.url; url.pathname = 'api/query_range' $http.get(url.href, { params: { expr: exp.expression } }).then(function(payload) { $scope.$broadcast('redrawGraphs', payload.data.Value); }, function(data, status, b) { var errMsg = "Expression " + exp.expression + ": Server returned status " + status + "."; $scope.errorMessages.push(errMsg); }).finally(function() { $scope.requestInFlight = false; }); }; if ($scope.graph.expression.expression) { $scope.refreshGraph(); } if (location.pathname.match(/^\/w\//)) { // On a widget page. $scope.widgetPage = true; $scope.dashboard = dashboard; } }]);
angular.module("Prometheus.controllers").controller('PieCtrl', ["$scope", "$http", "SharedWidgetSetup", function($scope, $http, SharedWidgetSetup) { SharedWidgetSetup($scope); $scope.errorMessages = []; // Query for the data. $scope.refreshGraph = function() { var exp = $scope.graph.expression; var server = $scope.serversById[exp['serverID'] || 1]; $scope.requestInFlight = true; var url = document.createElement('a'); url.href = server.url; url.pathname = 'api/query' $http.get(url.href, { params: { expr: exp.expression } }).then(function(payload) { $scope.$broadcast('redrawGraphs', payload.data.Value); }, function(data, status, b) { var errMsg = "Expression " + exp.expression + ": Server returned status " + status + "."; $scope.errorMessages.push(errMsg); }).finally(function() { $scope.requestInFlight = false; }); }; if ($scope.graph.expression.expression) { $scope.refreshGraph(); } if (location.pathname.match(/^\/w\//)) { // On a widget page. $scope.widgetPage = true; $scope.dashboard = dashboard; } }]);
Fix incorrect url for pie charts.
Fix incorrect url for pie charts.
JavaScript
apache-2.0
lborguetti/promdash,alonpeer/promdash,juliusv/promdash,jmptrader/promdash,juliusv/promdash,juliusv/promdash,jmptrader/promdash,lborguetti/promdash,jonnenauha/promdash,prometheus/promdash,alonpeer/promdash,prometheus/promdash,thooams/promdash,juliusv/promdash,jmptrader/promdash,jmptrader/promdash,jonnenauha/promdash,jonnenauha/promdash,lborguetti/promdash,thooams/promdash,thooams/promdash,prometheus/promdash,jonnenauha/promdash,lborguetti/promdash,thooams/promdash,alonpeer/promdash,prometheus/promdash,alonpeer/promdash
--- +++ @@ -14,7 +14,7 @@ $scope.requestInFlight = true; var url = document.createElement('a'); url.href = server.url; - url.pathname = 'api/query_range' + url.pathname = 'api/query' $http.get(url.href, { params: { expr: exp.expression
d0be0c668a41dcd07c888a146d09ab57819fe432
server/core/types.js
server/core/types.js
/* @flow */ 'use babel'; export type Post = { title: string, content: string, postCreated : any, postPublished: string, lastUpdated: string, status: string, author: string, tags: Array<string>, generated_keys?: any } export type Author = { name: string, email: string, username: string, password: string, token: string, generated_keys?: any } export type PostCreated = { year: string, month: string, date: string } export type PostDocument = { filename: string, postCreated: PostCreated, compiledContent: string, post: Post }
/* @flow */ 'use babel' export type Post = { title: string, content: string, postCreated : any, postPublished: string, lastUpdated: string, status: string, author: string, tags: Array<string>, generated_keys?: any } export type PostSum = { title: string, status: string, id: string, author: string } export type Author = { name: string, email: string, username: string, password: string, token: string, generated_keys?: any } export type PostCreated = { year: string, month: string, date: string } export type PostDocument = { filename: string, postCreated: PostCreated, compiledContent: string, post: Post }
Add PostSum type. This is post summary for list view
Add PostSum type. This is post summary for list view
JavaScript
mit
junwatu/blogel,junwatu/blogel,junwatu/blogel
--- +++ @@ -1,36 +1,43 @@ /* @flow */ -'use babel'; +'use babel' export type Post = { - title: string, - content: string, - postCreated : any, - postPublished: string, - lastUpdated: string, - status: string, - author: string, - tags: Array<string>, - generated_keys?: any + title: string, + content: string, + postCreated : any, + postPublished: string, + lastUpdated: string, + status: string, + author: string, + tags: Array<string>, + generated_keys?: any +} + +export type PostSum = { + title: string, + status: string, + id: string, + author: string } export type Author = { - name: string, - email: string, - username: string, - password: string, - token: string, - generated_keys?: any + name: string, + email: string, + username: string, + password: string, + token: string, + generated_keys?: any } export type PostCreated = { - year: string, - month: string, - date: string + year: string, + month: string, + date: string } export type PostDocument = { - filename: string, - postCreated: PostCreated, - compiledContent: string, - post: Post + filename: string, + postCreated: PostCreated, + compiledContent: string, + post: Post }
b8db7e248edc31bd5231088832feacf35843b73e
app/assets/javascripts/student_profile/main.js
app/assets/javascripts/student_profile/main.js
$(function() { // only run if the correct page if (!($('body').hasClass('students') && $('body').hasClass('show'))) return; // imports var createEl = window.shared.ReactHelpers.createEl; var PageContainer = window.shared.PageContainer; var parseQueryString = window.shared.parseQueryString; // mixpanel analytics MixpanelUtils.registerUser(serializedData.currentEducator); MixpanelUtils.track('PAGE_VISIT', { page_key: 'STUDENT_PROFILE' }); // entry point, reading static bootstrapped data from the page var serializedData = $('#serialized-data').data(); ReactDOM.render(createEl(PageContainer, { nowMomentFn: function() { return moment.utc(); }, serializedData: serializedData, queryParams: parseQueryString(window.location.search) }), document.getElementById('main')); });
$(function() { // only run if the correct page if (!($('body').hasClass('students') && $('body').hasClass('show'))) return; // imports var createEl = window.shared.ReactHelpers.createEl; var PageContainer = window.shared.PageContainer; var parseQueryString = window.shared.parseQueryString; var MixpanelUtils = window.shared.MixpanelUtils; // mixpanel analytics MixpanelUtils.registerUser(serializedData.currentEducator); MixpanelUtils.track('PAGE_VISIT', { page_key: 'STUDENT_PROFILE' }); // entry point, reading static bootstrapped data from the page var serializedData = $('#serialized-data').data(); ReactDOM.render(createEl(PageContainer, { nowMomentFn: function() { return moment.utc(); }, serializedData: serializedData, queryParams: parseQueryString(window.location.search) }), document.getElementById('main')); });
Fix bug in profile page import
Fix bug in profile page import
JavaScript
mit
erose/studentinsights,erose/studentinsights,jhilde/studentinsights,erose/studentinsights,studentinsights/studentinsights,jhilde/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights,jhilde/studentinsights,jhilde/studentinsights,erose/studentinsights,studentinsights/studentinsights
--- +++ @@ -6,6 +6,7 @@ var createEl = window.shared.ReactHelpers.createEl; var PageContainer = window.shared.PageContainer; var parseQueryString = window.shared.parseQueryString; + var MixpanelUtils = window.shared.MixpanelUtils; // mixpanel analytics MixpanelUtils.registerUser(serializedData.currentEducator);
34b539fbe0b7af085bfc9a5e497b403694e3ac0e
Dangerfile.js
Dangerfile.js
// CHANGELOG check const hasAppChanges = _.filter(git.modified_files, function(path) { return _.includes(path, 'lib/'); }).length > 0 if (hasAppChanges && _.includes(git.modified_files, "CHANGELOG.md") === false) { fail("No CHANGELOG added.") } const testFiles = _.filter(git.modified_files, function(path) { return _.includes(path, '__tests__/'); }) const logicalTestPaths = _.map(testFiles, function(path) { // turns "lib/__tests__/i-am-good-tests.js" into "lib/i-am-good.js" return path.replace(/__tests__\//, '').replace(/-tests\./, '.') }) const sourcePaths = _.filter(git.modified_files, function(path) { return _.includes(path, 'lib/') && !_.includes(path, '__tests__/'); }) // Check that any new file has a corresponding tests file const untestedFiles = _.difference(sourcePaths, logicalTestPaths) if (untestedFiles.length > 0) { warn("The following files do not have tests: " + github.html_link(untestedFiles)) }
// CHANGELOG check const hasAppChanges = _.filter(git.modified_files, function(path) { return _.includes(path, 'lib/'); }).length > 0 if (hasAppChanges && _.includes(git.modified_files, "CHANGELOG.md") === false) { fail("No CHANGELOG added.") } const testFiles = _.filter(git.modified_files, function(path) { return _.includes(path, '__tests__/'); }) const logicalTestPaths = _.map(testFiles, function(path) { // turns "lib/__tests__/i-am-good-tests.js" into "lib/i-am-good.js" return path.replace(/__tests__\//, '').replace(/-tests\./, '.') }) const sourcePaths = _.filter(git.modified_files, function(path) { return _.includes(path, 'lib/') && !_.includes(path, '__tests__/'); }) // Check that any new file has a corresponding tests file const untestedFiles = _.difference(sourcePaths, logicalTestPaths) if (untestedFiles.length > 0) { warn("The following files do not have tests: " + github.html_link(untestedFiles), false) }
Make test results not sticky
Make test results not sticky
JavaScript
mit
artsy/emission,artsy/eigen,artsy/eigen,artsy/emission,artsy/eigen,artsy/eigen,artsy/eigen,artsy/eigen,artsy/eigen,artsy/emission,artsy/emission,artsy/emission,artsy/emission,artsy/emission
--- +++ @@ -23,5 +23,5 @@ // Check that any new file has a corresponding tests file const untestedFiles = _.difference(sourcePaths, logicalTestPaths) if (untestedFiles.length > 0) { - warn("The following files do not have tests: " + github.html_link(untestedFiles)) + warn("The following files do not have tests: " + github.html_link(untestedFiles), false) }
8b6befcd13104e8eb829947d42a843ec648b5296
addon/utils/validators/ember-component.js
addon/utils/validators/ember-component.js
/** * The PropTypes.EmberComponent validator */ import Ember from 'ember' const {typeOf} = Ember import logger from '../logger' export default function (ctx, name, value, def, logErrors, throwErrors) { const isObject = typeOf(value) === 'object' const valid = isObject && Object.keys(value).some((key) => { // NOTE: this is based on internal API and thus could break without warning. return key.indexOf('COMPONENT_CELL') === 0 }) if (!valid && logErrors) { logger.warn(ctx, `Expected property ${name} to be an Ember.Component`, throwErrors) } return valid }
/** * The PropTypes.EmberComponent validator */ import Ember from 'ember' const {typeOf} = Ember import logger from '../logger' export default function (ctx, name, value, def, logErrors, throwErrors) { const isObject = typeOf(value) === 'object' const valid = isObject && Object.keys(value).some((key) => { // NOTE: this is based on internal API and thus could break without warning. return ( key.indexOf('COMPONENT_CELL') === 0 || // Pre Glimmer 2 key.indexOf('COMPONENT DEFINITION') === 0 // Glimmer 2 ) }) if (!valid && logErrors) { logger.warn(ctx, `Expected property ${name} to be an Ember.Component`, throwErrors) } return valid }
Fix EmberComponent prop type for Ember 2.11
Fix EmberComponent prop type for Ember 2.11
JavaScript
mit
ciena-blueplanet/ember-prop-types,sandersky/ember-prop-types,sandersky/ember-prop-types,sandersky/ember-prop-types,ciena-blueplanet/ember-prop-types,ciena-blueplanet/ember-prop-types
--- +++ @@ -12,7 +12,10 @@ const valid = isObject && Object.keys(value).some((key) => { // NOTE: this is based on internal API and thus could break without warning. - return key.indexOf('COMPONENT_CELL') === 0 + return ( + key.indexOf('COMPONENT_CELL') === 0 || // Pre Glimmer 2 + key.indexOf('COMPONENT DEFINITION') === 0 // Glimmer 2 + ) }) if (!valid && logErrors) {
0f68aa298d5cc7c2578126456197fe0ce0798db1
build/start.js
build/start.js
require('./doBuild'); require('./server');
var build = require('./build'); build() .catch(function(err) { require('trace'); require('clarify'); console.trace(err); }); require('./server');
Tweak heroku build to put it into production mode
Tweak heroku build to put it into production mode
JavaScript
mit
LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements
--- +++ @@ -1,2 +1,10 @@ -require('./doBuild'); +var build = require('./build'); + +build() + .catch(function(err) { + require('trace'); + require('clarify'); + console.trace(err); + }); + require('./server');
929e1be1fb2c7f9d42262cb0c53f39cc4c05b718
app/components/default-clock/component.js
app/components/default-clock/component.js
import Ember from 'ember'; import moment from 'moment'; export default Ember.Component.extend({ // TODO update time regularly classNames: ['component', 'clock'], timeFormat: '24h', formattedTime: function() { // TODO support 12h format let output = new moment().format('H:mm'); return output; }.property(), formattedGreeting: function() { // TODO use name from config return `${this.get('greeting')}, ${this.get('name')}.` ; }.property('greeting'), greeting: function() { let greeting; if (moment().hour() < 12) { greeting = "Good morning"; } else if (moment().hour() < 18) { greeting = "Good afternoon"; } else { greeting = "Good evening"; } return greeting; }.property(), });
import Ember from 'ember'; import moment from 'moment'; export default Ember.Component.extend({ classNames: ['component', 'clock'], timeFormat: '24h', time: new moment(), tick() { let self = this; this.set('time', new moment()); setTimeout(function(){ self.tick(); }, 2000); }, formattedTime: function() { // TODO support 12h format let output = new moment().format('H:mm'); return output; }.property('time'), formattedGreeting: function() { return `${this.get('greeting')}, ${this.get('name')}.`; }.property('greeting'), greeting: function() { let greeting; if (moment().hour() < 12) { greeting = "Good morning"; } else if (moment().hour() < 18) { greeting = "Good afternoon"; } else { greeting = "Good evening"; } return greeting; }.property(), startClock: function() { this.tick(); }.on('init') });
Update clock every couple of seconds
Update clock every couple of seconds
JavaScript
agpl-3.0
skddc/dashtab,skddc/dashtab,skddc/dashtab
--- +++ @@ -2,21 +2,26 @@ import moment from 'moment'; export default Ember.Component.extend({ - // TODO update time regularly classNames: ['component', 'clock'], timeFormat: '24h', + time: new moment(), + + tick() { + let self = this; + this.set('time', new moment()); + setTimeout(function(){ self.tick(); }, 2000); + }, formattedTime: function() { // TODO support 12h format let output = new moment().format('H:mm'); return output; - }.property(), + }.property('time'), formattedGreeting: function() { - // TODO use name from config - return `${this.get('greeting')}, ${this.get('name')}.` ; + return `${this.get('greeting')}, ${this.get('name')}.`; }.property('greeting'), greeting: function() { @@ -33,4 +38,8 @@ return greeting; }.property(), + startClock: function() { + this.tick(); + }.on('init') + });
cb755108580ee143b9e74883a2948598473e341d
src/transferring/index.js
src/transferring/index.js
import * as http_data from "./http-data"; import * as urlModule from "url"; const transferrers = {}; function transfer(request) { // url - the resource URI to send a message to // options.method - the method to use for transferring // options.form - the Form API object representing the form data submission // converted to a message body via encoding (see: options.enctype) // options.enctype - the encoding to use to encode form into message body // options.body - an already encoded message body // if both body and form are present, form is ignored if (!request) throw new Error("'request' param is required."); var url = request.url; var options = request.options; if (!url) throw new Error("'request.url' param is required."); var protocol = urlModule.parse(url).protocol; if (!protocol) throw new Error("'request.url' param must have a protocol scheme."); protocol = protocol.replace(":", ""); if (protocol in transferrers === false) throw new Error("No transferrer registered for protocol: " + protocol); var transferrer = transferrers[protocol]; return transferrer(request); } transfer.register = function registerTransferrer(scheme, transferrer) { transferrers[scheme] = transferrer; }; transfer.register("http", http_data.transfer); transfer.register("data", http_data.transfer); export { transfer };
import * as http_data from "./http-data"; import * as urlModule from "url"; function transfer(request) { // url - the resource URI to send a message to // options.method - the method to use for transferring // options.form - the Form API object representing the form data submission // converted to a message body via encoding (see: options.enctype) // options.enctype - the encoding to use to encode form into message body // options.body - an already encoded message body // if both body and form are present, form is ignored if (!request) throw new Error("'request' param is required."); var url = request.url; var options = request.options; if (!url) throw new Error("'request.url' param is required."); var protocol = urlModule.parse(url).protocol; if (!protocol) throw new Error("'request.url' param must have a protocol scheme."); protocol = protocol.replace(":", ""); if (protocol in transfer.registrations === false) throw new Error("No transferrer registered for protocol: " + protocol); var transferrer = transfer.registrations[protocol]; return transferrer(request); } transfer.registrations = {}; transfer.register = function registerTransferrer(protocol, transferrer) { transfer.registrations[protocol] = transferrer; }; transfer.register("http", http_data.transfer); transfer.register("data", http_data.transfer); export { transfer };
Make Transfer Consistent w/ Views
Make Transfer Consistent w/ Views
JavaScript
mit
lynx-json/jsua
--- +++ @@ -1,6 +1,5 @@ import * as http_data from "./http-data"; import * as urlModule from "url"; -const transferrers = {}; function transfer(request) { // url - the resource URI to send a message to @@ -21,14 +20,16 @@ if (!protocol) throw new Error("'request.url' param must have a protocol scheme."); protocol = protocol.replace(":", ""); - if (protocol in transferrers === false) throw new Error("No transferrer registered for protocol: " + protocol); + if (protocol in transfer.registrations === false) throw new Error("No transferrer registered for protocol: " + protocol); - var transferrer = transferrers[protocol]; + var transferrer = transfer.registrations[protocol]; return transferrer(request); } -transfer.register = function registerTransferrer(scheme, transferrer) { - transferrers[scheme] = transferrer; +transfer.registrations = {}; + +transfer.register = function registerTransferrer(protocol, transferrer) { + transfer.registrations[protocol] = transferrer; }; transfer.register("http", http_data.transfer);
5575571bf0dca4f941e87164839605dc6aca0014
js/buttons/delete-button.js
js/buttons/delete-button.js
"use strict"; /*global module, require*/ var modalDialogueFactory = require("./processes/modal-dialogue.js"), commentFactory = require("./accordion-comment.js"), online = { online: true, offline: false }, standalone = { embedded: false, standalone: true }; module.exports = function(store, specifyButton, closeFileMenu) { var modalDialogueProcess = modalDialogueFactory(closeFileMenu); return specifyButton( "Delete", null, function(wasActive, buttonProcess, onProcessEnd) { if (store.getTitle()) { var submit = function() { store.deleteDocument( store.getTitle() ); // ToDo do something with this. // comment.getComment(); dialogue.exit(); }, dialogue = modalDialogueProcess(wasActive, buttonProcess, onProcessEnd, submit), head = dialogue.element.append("h4") .text("Delete '" + store.getTitle() + "'"), comment = commentFactory(dialogue.element), action = dialogue.element.append("div") .classed("dialogue-action", true) .attr("delete-action", true) .on("click", submit) .text("Delete"); return dialogue; } else { return null; } }, { onlineOffline: online, embeddedStandalone: standalone, search: {} } ); };
"use strict"; /*global module, require*/ var modalDialogueFactory = require("./processes/modal-dialogue.js"), commentFactory = require("./accordion-comment.js"), online = { online: true, offline: false }, standalone = { embedded: false, standalone: true }; module.exports = function(store, specifyButton, closeFileMenu) { var modalDialogueProcess = modalDialogueFactory(closeFileMenu); return specifyButton( "Delete", null, function(wasActive, buttonProcess, onProcessEnd) { if (store.getTitle()) { var submit = function() { store.deleteDocument( store.getTitle() ); // ToDo do something with this. // comment.getComment(); dialogue.exit(); }, dialogue = modalDialogueProcess(wasActive, buttonProcess, onProcessEnd, submit), head = dialogue.element.append("h4") .text("Delete '" + store.getTitle() + "'"), comment = commentFactory(dialogue.element), action = dialogue.element.append("div") .classed("dialogue-action", true) .attr("delete-action", true) .on("click", submit) .text("Delete"); return dialogue; } else { return null; } }, { onlineOffline: online, embeddedStandalone: standalone, readWriteSync: { untitled: false, read: false, write: true, sync: true } } ); };
Delete button enabled on the right occasions.
Delete button enabled on the right occasions.
JavaScript
mit
cse-bristol/multiuser-file-menu,cse-bristol/multiuser-file-menu
--- +++ @@ -55,7 +55,12 @@ { onlineOffline: online, embeddedStandalone: standalone, - search: {} + readWriteSync: { + untitled: false, + read: false, + write: true, + sync: true + } } ); };
59db5d86469bf8f474f8a1ab40588d218831c99c
model/lib/data-snapshot/index.js
model/lib/data-snapshot/index.js
// Not to mix with `DataSnapshots` class which is about different thing // (serialized list views updated reactively) // // This one is about snaphots of data made in specific moments of time. // Snaphots are not reactive in any way. They're updated only if given specific moment repeats // for entity it refers to. // e.g. We want to store a state of submitted dataForms at business process at its submission // After it's stored it's not updated (and safe against any external changes like model changes) // Just in case of re-submissions (e.g. return of file from sent back case) the snapshot is // overwritten with regenerated value 'use strict'; var memoize = require('memoizee/plain') , ensureDb = require('dbjs/valid-dbjs') , extendBase = require('../../base'); module.exports = memoize(function (db) { extendBase(ensureDb(db)); return db.Object.extend('DataSnapshot', { jsonString: { type: db.String } // 'resolved' property evaluation is configured in ./resolve.js }); }, { normalizer: require('memoizee/normalizers/get-1')() });
// Not to mix with `DataSnapshots` class which is about different thing // (serialized list views updated reactively) // // This one is about snaphots of data made in specific moments of time. // Snaphots are not reactive in any way. They're updated only if given specific moment repeats // for entity it refers to. // e.g. We want to store a state of submitted dataForms at business process at its submission // After it's stored it's not updated (and safe against any external changes like model changes) // Just in case of re-submissions (e.g. return of file from sent back case) the snapshot is // overwritten with regenerated value 'use strict'; var memoize = require('memoizee/plain') , ensureDb = require('dbjs/valid-dbjs') , extendBase = require('../../base'); module.exports = memoize(function (db) { extendBase(ensureDb(db)); return db.Object.extend('DataSnapshot', { jsonString: { type: db.String }, // Generates snapshot (if it was not generated already) generate: { type: db.Function, value: function (ignore) { if (!this.jsonString) this.regenerate(); } }, // Generates snapshot (overwrites old snapshot if it exist) regenerate: { type: db.Function, value: function (ignore) { this.jsonString = JSON.stringify(this.owner.toJSON()); } } }); }, { normalizer: require('memoizee/normalizers/get-1')() });
Introduce `generate` and `regenerate` methods
Introduce `generate` and `regenerate` methods
JavaScript
mit
egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations
--- +++ @@ -18,7 +18,14 @@ module.exports = memoize(function (db) { extendBase(ensureDb(db)); return db.Object.extend('DataSnapshot', { - jsonString: { type: db.String } - // 'resolved' property evaluation is configured in ./resolve.js + jsonString: { type: db.String }, + // Generates snapshot (if it was not generated already) + generate: { type: db.Function, value: function (ignore) { + if (!this.jsonString) this.regenerate(); + } }, + // Generates snapshot (overwrites old snapshot if it exist) + regenerate: { type: db.Function, value: function (ignore) { + this.jsonString = JSON.stringify(this.owner.toJSON()); + } } }); }, { normalizer: require('memoizee/normalizers/get-1')() });
425470a41a20f416fb05c575a443ffffb9aac71d
test/load-json-spec.js
test/load-json-spec.js
/* global describe, it */ import assert from 'assert'; import {KATAS_URL, URL_PREFIX} from '../src/config.js'; import GroupedKata from '../src/grouped-kata.js'; describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { const loadRemoteFileStub = (url, onLoaded) => { let validData = JSON.stringify({groups: {}}); onLoaded(null, validData); }; function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } new GroupedKata(loadRemoteFileStub, KATAS_URL).load(() => {}, onSuccess); }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { const loadRemoteFileStub = (url, onLoaded) => { onLoaded(new Error('')); }; function onError(err) { assert.ok(err); done(); } new GroupedKata(loadRemoteFileStub, '').load(onError); }); it('for invalid data', function(done) { const invalidData = JSON.stringify({propertyGroupsMissing:{}}); const loadRemoteFileStub = (url, onLoaded) => { onLoaded(null, invalidData); }; function onError(err) { assert.ok(err); done(); } new GroupedKata(loadRemoteFileStub, '').load(onError); }); }); });
/* global describe, it */ import assert from 'assert'; import GroupedKata from '../src/grouped-kata.js'; function remoteFileLoaderWhichReturnsGivenData(data) { return (url, onLoaded) => { onLoaded(null, data); }; } function remoteFileLoaderWhichReturnsError(error) { return (url, onLoaded) => { onLoaded(error); }; } describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } const validData = JSON.stringify({groups: {}}); const loaderStub = remoteFileLoaderWhichReturnsGivenData(validData); new GroupedKata(loaderStub, 'irrelevant url').load(() => {}, onSuccess); }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { function onError(err) { assert.ok(err); done(); } const loaderStub = remoteFileLoaderWhichReturnsError(new Error('')); new GroupedKata(loaderStub, 'irrelevant url').load(onError); }); it('for invalid data', function(done) { function onError(err) { assert.ok(err); done(); } const invalidData = JSON.stringify({propertyGroupsMissing:{}}); const loaderStub = remoteFileLoaderWhichReturnsGivenData(invalidData); new GroupedKata(loaderStub, 'irrelevant url').load(onError); }); }); });
Refactor duplication out of tests.
Refactor duplication out of tests.
JavaScript
mit
wolframkriesing/es6-react-workshop,wolframkriesing/es6-react-workshop
--- +++ @@ -1,47 +1,51 @@ /* global describe, it */ import assert from 'assert'; -import {KATAS_URL, URL_PREFIX} from '../src/config.js'; import GroupedKata from '../src/grouped-kata.js'; + +function remoteFileLoaderWhichReturnsGivenData(data) { + return (url, onLoaded) => { + onLoaded(null, data); + }; +} +function remoteFileLoaderWhichReturnsError(error) { + return (url, onLoaded) => { + onLoaded(error); + }; +} describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { - const loadRemoteFileStub = (url, onLoaded) => { - let validData = JSON.stringify({groups: {}}); - onLoaded(null, validData); - }; function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } - new GroupedKata(loadRemoteFileStub, KATAS_URL).load(() => {}, onSuccess); + const validData = JSON.stringify({groups: {}}); + const loaderStub = remoteFileLoaderWhichReturnsGivenData(validData); + new GroupedKata(loaderStub, 'irrelevant url').load(() => {}, onSuccess); }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { - const loadRemoteFileStub = (url, onLoaded) => { - onLoaded(new Error('')); - }; function onError(err) { assert.ok(err); done(); } - new GroupedKata(loadRemoteFileStub, '').load(onError); + const loaderStub = remoteFileLoaderWhichReturnsError(new Error('')); + new GroupedKata(loaderStub, 'irrelevant url').load(onError); }); it('for invalid data', function(done) { - const invalidData = JSON.stringify({propertyGroupsMissing:{}}); - const loadRemoteFileStub = (url, onLoaded) => { - onLoaded(null, invalidData); - }; function onError(err) { assert.ok(err); done(); } - new GroupedKata(loadRemoteFileStub, '').load(onError); + const invalidData = JSON.stringify({propertyGroupsMissing:{}}); + const loaderStub = remoteFileLoaderWhichReturnsGivenData(invalidData); + new GroupedKata(loaderStub, 'irrelevant url').load(onError); }); }); });
a1d6637ecd4f9d8c0745d3ea59ec83742e371c24
src/plugins/appVersion.js
src/plugins/appVersion.js
// install : cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git // link : https://github.com/whiteoctober/cordova-plugin-app-version angular.module('ngCordova.plugins.appVersion', []) .factory('$cordovaAppVersion', ['$q', function ($q) { return { getAppVersion: function () { var q = $q.defer(); cordova.getAppVersion(function (version) { q.resolve(version); }); return q.promise; } }; }]);
// install : cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git // link : https://github.com/whiteoctober/cordova-plugin-app-version angular.module('ngCordova.plugins.appVersion', []) .factory('$cordovaAppVersion', ['$q', function ($q) { return { getVersionNumber: function () { var q = $q.defer(); cordova.getAppVersion.getVersionNumber(function (version) { q.resolve(version); }); return q.promise; }, getVersionCode: function () { var q = $q.defer(); cordova.getAppVersion.getVersionCode(function (code) { q.resolve(code); }); return q.promise; } }; }]);
Update due to the plugin split into two functions getAppVersion.getVersionNumber() and getAppVersion.getVersionCode() to return build number
Update due to the plugin split into two functions getAppVersion.getVersionNumber() and getAppVersion.getVersionCode() to return build number
JavaScript
mit
listrophy/ng-cordova,dangerfarms/ng-cordova,sesubash/ng-cordova,driftyco/ng-cordova,justinwp/ng-cordova,DavidePastore/ng-cordova,cihadhoruzoglu/ng-cordova,5amfung/ng-cordova,candril/ng-cordova,omefire/ng-cordova,alanquigley/ng-cordova,Jewelbots/ng-cordova,beauby/ng-cordova,GreatAnubis/ng-cordova,Freundschaft/ng-cordova,andrew168/ng-cordova,HereSinceres/ng-cordova,nraboy/ng-cordova,omefire/ng-cordova,guaerguagua/ng-cordova,brunogonncalves/ng-cordova,b-cuts/ng-cordova,boboldehampsink/ng-cordova,dangerfarms/ng-cordova,honger05/ng-cordova,GreatAnubis/ng-cordova,fwitzke/ng-cordova,SebastianRolf/ng-cordova,beauby/ng-cordova,ralic/ng-cordova,b-cuts/ng-cordova,edewit/ng-cordova,promactkaran/ng-cordova,sesubash/ng-cordova,gortok/ng-cordova,Jeremy017/ng-cordova,nraboy/ng-cordova,scripterkaran/ng-cordova,fxckdead/ng-cordova,jamalx31/ng-cordova,ralic/ng-cordova,andrew168/ng-cordova,j0k3r/ng-cordova,jskrzypek/ng-cordova,j0k3r/ng-cordova,Sharinglabs/ng-cordova,johnli388/ng-cordova,honger05/ng-cordova,Jewelbots/ng-cordova,5amfung/ng-cordova,selimg/ng-cordova,alanquigley/ng-cordova,boboldehampsink/ng-cordova,brunogonncalves/ng-cordova,jarbitlira/ng-cordova,sesubash/ng-cordova,edewit/ng-cordova,candril/ng-cordova,fxckdead/ng-cordova,kidush/ng-cordova,kublaj/ng-cordova,gortok/ng-cordova,DavidePastore/ng-cordova,omefire/ng-cordova,glustful/ng-cordova,SidneyS/ng-cordova,mattlewis92/ng-cordova,toddhalfpenny/ng-cordova,moez-sadok/ng-cordova,moez-sadok/ng-cordova,matheusrocha89/ng-cordova,SidneyS/ng-cordova,toddhalfpenny/ng-cordova,b-cuts/ng-cordova,scripterkaran/ng-cordova,brunogonncalves/ng-cordova,alanquigley/ng-cordova,athiradandira/ng-cordova,listrophy/ng-cordova,kidush/ng-cordova,andreground/ng-cordova,fxckdead/ng-cordova,saschalink/ng-cordova,scripterkaran/ng-cordova,promactkaran/ng-cordova,Tobiaswk/ng-cordova,toddhalfpenny/ng-cordova,j0k3r/ng-cordova,dangerfarms/ng-cordova,lulee007/ng-cordova,jarbitlira/ng-cordova,Jeremy017/ng-cordova,kidush/ng-cordova,guaerguagua/ng-cordova,lukemartin/ng-cordova,DavidePastore/ng-cordova,boboldehampsink/ng-cordova,5amfung/ng-cordova,kublaj/ng-cordova,fwitzke/ng-cordova,guaerguagua/ng-cordova,kublaj/ng-cordova,Sharinglabs/ng-cordova,jamalx31/ng-cordova,HereSinceres/ng-cordova,justinwp/ng-cordova,jason-engage/ng-cordova,candril/ng-cordova,dlermen12/ng-cordova,saschalink/ng-cordova,moez-sadok/ng-cordova,microlv/ng-cordova,thomasbabuj/ng-cordova,blocktrail/ng-cordova,andrew168/ng-cordova,jason-engage/ng-cordova,jamalx31/ng-cordova,Jewelbots/ng-cordova,1337/ng-cordova,nraboy/ng-cordova,jason-engage/ng-cordova,edewit/ng-cordova,blocktrail/ng-cordova,promactkaran/ng-cordova,johnli388/ng-cordova,microlv/ng-cordova,Sharinglabs/ng-cordova,glustful/ng-cordova,saschalink/ng-cordova,glustful/ng-cordova,SebastianRolf/ng-cordova,athiradandira/ng-cordova,lulee007/ng-cordova,matheusrocha89/ng-cordova,honger05/ng-cordova,selimg/ng-cordova,driftyco/ng-cordova,lulee007/ng-cordova,jarbitlira/ng-cordova,gortok/ng-cordova,athiradandira/ng-cordova,Freundschaft/ng-cordova,lukemartin/ng-cordova,GreatAnubis/ng-cordova,microlv/ng-cordova,jskrzypek/ng-cordova,1337/ng-cordova,blocktrail/ng-cordova,thomasbabuj/ng-cordova,johnli388/ng-cordova,SebastianRolf/ng-cordova,jskrzypek/ng-cordova,matheusrocha89/ng-cordova,dlermen12/ng-cordova,dlermen12/ng-cordova,cihadhoruzoglu/ng-cordova,fwitzke/ng-cordova,lukemartin/ng-cordova,mattlewis92/ng-cordova,andreground/ng-cordova,1337/ng-cordova,Freundschaft/ng-cordova,driftyco/ng-cordova,Jeremy017/ng-cordova,mattlewis92/ng-cordova,SidneyS/ng-cordova,listrophy/ng-cordova,beauby/ng-cordova,thomasbabuj/ng-cordova,selimg/ng-cordova,ralic/ng-cordova,justinwp/ng-cordova,Tobiaswk/ng-cordova,Tobiaswk/ng-cordova,andreground/ng-cordova,cihadhoruzoglu/ng-cordova,HereSinceres/ng-cordova
--- +++ @@ -6,10 +6,19 @@ .factory('$cordovaAppVersion', ['$q', function ($q) { return { - getAppVersion: function () { + getVersionNumber: function () { var q = $q.defer(); - cordova.getAppVersion(function (version) { + cordova.getAppVersion.getVersionNumber(function (version) { q.resolve(version); + }); + + return q.promise; + }, + + getVersionCode: function () { + var q = $q.defer(); + cordova.getAppVersion.getVersionCode(function (code) { + q.resolve(code); }); return q.promise;
bea6c3a94e10aafefba91fd791dece9a26a1fe13
src/mist/io/static/js/app/views/image_list_item.js
src/mist/io/static/js/app/views/image_list_item.js
define('app/views/image_list_item', [ 'text!app/templates/image_list_item.html','ember'], /** * * Image List Item View * * @returns Class */ function(image_list_item_html) { return Ember.View.extend({ tagName:'li', starImage: function() { var payload = { 'action': 'star' }; var backend_id = this.image.backend.id var image_id = this.image.id; $.ajax({ url: '/backends/' + backend_id + '/images/' + image_id, type: "POST", data: JSON.stringify(payload), contentType: "application/json", headers: { "cache-control": "no-cache" }, dataType: "json" }); }, didInsertElement: function(){ $('#images-list').listview('refresh'); try{ $('#images-list .ember-checkbox').checkboxradio(); } catch(e){} }, launchImage: function(){ var AddView = Mist.MachineAddView.create(); AddView.selectProvider(this.image.backend); AddView.selectImage(this.image); $('#images .dialog-add').panel('open'); }, template: Ember.Handlebars.compile(image_list_item_html), }); } );
define('app/views/image_list_item', [ 'text!app/templates/image_list_item.html','ember'], /** * * Image List Item View * * @returns Class */ function(image_list_item_html) { return Ember.View.extend({ tagName:'li', starImage: function() { var payload = { 'action': 'star' }; var backend_id = this.image.backend.id var image_id = this.image.id; var that = this; $.ajax({ url: '/backends/' + backend_id + '/images/' + image_id, type: "POST", data: JSON.stringify(payload), contentType: "application/json", headers: { "cache-control": "no-cache" }, dataType: "json", success: function (){ var backend = Mist.backendsController.getBackendById(backend_id); if (backend.images.content.indexOf(that.image) == -1) { if (image.star == false) { backend.images.content.unshiftObject(that.image); } } } }); }, didInsertElement: function(){ $('#images-list').listview('refresh'); try{ $('#images-list .ember-checkbox').checkboxradio(); } catch(e){} }, launchImage: function(){ var AddView = Mist.MachineAddView.create(); AddView.selectProvider(this.image.backend); AddView.selectImage(this.image); $('#images .dialog-add').panel('open'); }, template: Ember.Handlebars.compile(image_list_item_html), }); } );
Fix star image from advanced search in javascript
Fix star image from advanced search in javascript
JavaScript
agpl-3.0
afivos/mist.io,munkiat/mist.io,afivos/mist.io,munkiat/mist.io,afivos/mist.io,munkiat/mist.io,zBMNForks/mist.io,Lao-liu/mist.io,munkiat/mist.io,Lao-liu/mist.io,kelonye/mist.io,zBMNForks/mist.io,DimensionDataCBUSydney/mist.io,johnnyWalnut/mist.io,kelonye/mist.io,zBMNForks/mist.io,johnnyWalnut/mist.io,DimensionDataCBUSydney/mist.io,kelonye/mist.io,Lao-liu/mist.io,Lao-liu/mist.io,DimensionDataCBUSydney/mist.io,johnnyWalnut/mist.io,DimensionDataCBUSydney/mist.io
--- +++ @@ -16,14 +16,23 @@ }; var backend_id = this.image.backend.id var image_id = this.image.id; + var that = this; $.ajax({ url: '/backends/' + backend_id + '/images/' + image_id, type: "POST", data: JSON.stringify(payload), contentType: "application/json", headers: { "cache-control": "no-cache" }, - dataType: "json" - }); + dataType: "json", + success: function (){ + var backend = Mist.backendsController.getBackendById(backend_id); + if (backend.images.content.indexOf(that.image) == -1) { + if (image.star == false) { + backend.images.content.unshiftObject(that.image); + } + } + } + }); }, didInsertElement: function(){
e7da62df0ace6f30593df7d18ae983cb7e44c778
test/test-creation.js
test/test-creation.js
/*global describe, beforeEach, it*/ 'use strict'; var path = require('path'); var helpers = require('yeoman-generator').test; describe('browserify generator', function () { beforeEach(function (done) { helpers.testDirectory(path.join(__dirname, 'temp'), function (err) { if (err) { return done(err); } this.app = helpers.createGenerator('browserify:app', [ '../../app' ]); done(); }.bind(this)); }); it('creates expected files', function (done) { var expected = [ // add files you expect to exist here. '.jshintrc', '.editorconfig' ]; helpers.mockPrompt(this.app, { 'framework': 'foundation', 'modernizr': true, 'jade': true }); this.app.options['skip-install'] = true; this.app.run({}, function () { helpers.assertFiles(expected); done(); }); }); });
/*global describe, beforeEach, it*/ 'use strict'; var path = require('path'); var helpers = require('yeoman-generator').test; describe('browserify generator', function () { beforeEach(function (done) { helpers.testDirectory(path.join(__dirname, 'temp'), function (err) { if (err) { return done(err); } this.app = helpers.createGenerator('browserify:app', [ '../../app' ]); done(); }.bind(this)); }); it('creates expected files', function (done) { var expected = [ // add files you expect to exist here. '.jshintrc', '.editorconfig' ]; helpers.mockPrompt(this.app, { 'framework': ['foundation'], 'compiler': ['libsass'], 'foundation': true, 'modernizr': true, 'jade': true, 'libsass': true }); this.app.options['skip-install'] = true; this.app.run({}, function () { helpers.assertFiles(expected); done(); }); }); });
Update tests to reflect addition of list prompts and compiler list in generator.
Update tests to reflect addition of list prompts and compiler list in generator.
JavaScript
mit
dlmoody/generator-browserify,vincentmac/generator-browserify,dlmoody/generator-browserify
--- +++ @@ -27,9 +27,12 @@ ]; helpers.mockPrompt(this.app, { - 'framework': 'foundation', + 'framework': ['foundation'], + 'compiler': ['libsass'], + 'foundation': true, 'modernizr': true, - 'jade': true + 'jade': true, + 'libsass': true }); this.app.options['skip-install'] = true; this.app.run({}, function () {
0bb4c1bd060627ddeb098f107fc7ec5d8cddbb0d
core/client/assets/lib/touch-editor.js
core/client/assets/lib/touch-editor.js
var createTouchEditor = function createTouchEditor() { var noop = function () {}, TouchEditor; TouchEditor = function (el, options) { /*jshint unused:false*/ this.textarea = el; this.win = { document : this.textarea }; this.ready = true; this.wrapping = document.createElement('div'); var textareaParent = this.textarea.parentNode; this.wrapping.appendChild(this.textarea); textareaParent.appendChild(this.wrapping); this.textarea.style.opacity = 1; }; TouchEditor.prototype = { setOption: function (type, handler) { if (type === 'onChange') { $(this.textarea).change(handler); } }, eachLine: function () { return []; }, getValue: function () { return this.textarea.value; }, setValue: function (code) { this.textarea.value = code; }, focus: noop, getCursor: function () { return { line: 0, ch: 0 }; }, setCursor: noop, currentLine: function () { return 0; }, cursorPosition: function () { return { character: 0 }; }, addMarkdown: noop, nthLine: noop, refresh: noop, selectLines: noop, on: noop }; return TouchEditor; }; export default createTouchEditor;
var createTouchEditor = function createTouchEditor() { var noop = function () {}, TouchEditor; TouchEditor = function (el, options) { /*jshint unused:false*/ this.textarea = el; this.win = { document : this.textarea }; this.ready = true; this.wrapping = document.createElement('div'); var textareaParent = this.textarea.parentNode; this.wrapping.appendChild(this.textarea); textareaParent.appendChild(this.wrapping); this.textarea.style.opacity = 1; }; TouchEditor.prototype = { setOption: function (type, handler) { if (type === 'onChange') { $(this.textarea).change(handler); } }, eachLine: function () { return []; }, getValue: function () { return this.textarea.value; }, setValue: function (code) { this.textarea.value = code; }, focus: noop, getCursor: function () { return { line: 0, ch: 0 }; }, setCursor: noop, currentLine: function () { return 0; }, cursorPosition: function () { return { character: 0 }; }, addMarkdown: noop, nthLine: noop, refresh: noop, selectLines: noop, on: noop, off: noop }; return TouchEditor; }; export default createTouchEditor;
Add off as a noop function to touch editor.
Add off as a noop function to touch editor. Closes #3107
JavaScript
mit
tandrewnichols/ghost,katiefenn/Ghost,situkangsayur/Ghost,anijap/PhotoGhost,tmp-reg/Ghost,ericbenson/GhostAzureSetup,rollokb/Ghost,Rovak/Ghost,aschmoe/jesse-ghost-app,JonSmith/Ghost,blankmaker/Ghost,jparyani/GhostSS,dai-shi/Ghost,dymx101/Ghost,ErisDS/Ghost,Smile42RU/Ghost,gabfssilva/Ghost,virtuallyearthed/Ghost,Feitianyuan/Ghost,jgladch/taskworksource,dYale/blog,lethalbrains/Ghost,tadityar/Ghost,davidenq/Ghost-Blog,carlosmtx/Ghost,cqricky/Ghost,jiachenning/Ghost,omaracrystal/Ghost,epicmiller/pages,sceltoas/Ghost,chevex/undoctrinate,madole/diverse-learners,sajmoon/Ghost,vainglori0us/urban-fortnight,Shauky/Ghost,skleung/blog,vloom/blog,sifatsultan/js-ghost,kmeurer/Ghost,mhhf/ghost-latex,djensen47/Ghost,tidyui/Ghost,manishchhabra/Ghost,dbalders/Ghost,load11/ghost,neynah/GhostSS,dylanchernick/ghostblog,krahman/Ghost,shrimpy/Ghost,mlabieniec/ghost-env,letsjustfixit/Ghost,ErisDS/Ghost,nakamuraapp/new-ghost,sebgie/Ghost,devleague/uber-hackathon,Kikobeats/Ghost,ThorstenHans/Ghost,ghostchina/Ghost.zh,singular78/Ghost,wangjun/Ghost,mnitchie/Ghost,YY030913/Ghost,letsjustfixit/Ghost,optikalefx/Ghost,load11/ghost,Brunation11/Ghost,manishchhabra/Ghost,duyetdev/islab,sifatsultan/js-ghost,AlexKVal/Ghost,kortemy/Ghost,johnnymitch/Ghost,Alxandr/Blog,JonSmith/Ghost,yangli1990/Ghost,thehogfather/Ghost,smaty1/Ghost,phillipalexander/Ghost,NovaDevelopGroup/Academy,ckousik/Ghost,bosung90/Ghost,ryanbrunner/crafters,rouanw/Ghost,panezhang/Ghost,benstoltz/Ghost,singular78/Ghost,FredericBernardo/Ghost,uploadcare/uploadcare-ghost-demo,rollokb/Ghost,zackslash/Ghost,NovaDevelopGroup/Academy,davidenq/Ghost-Blog,mlabieniec/ghost-env,ineitzke/Ghost,jaswilli/Ghost,lethalbrains/Ghost,Loyalsoldier/Ghost,bsansouci/Ghost,cncodog/Ghost-zh-codog,diancloud/Ghost,carlyledavis/Ghost,akveo/akveo-blog,kortemy/Ghost,SkynetInc/steam,axross/ghost,ManRueda/Ghost,beautyOfProgram/Ghost,daihuaye/Ghost,kaiqigong/Ghost,klinker-apps/ghost,Jai-Chaudhary/Ghost,pathayes/FoodBlog,pollbox/ghostblog,diogogmt/Ghost,v3rt1go/Ghost,Netazoic/bad-gateway,kwangkim/Ghost,schematical/Ghost,leonli/ghost,ManRueda/Ghost,wallmarkets/Ghost,dbalders/Ghost,javimolla/Ghost,mohanambati/Ghost,AlexKVal/Ghost,BlueHatbRit/Ghost,hilerchyn/Ghost,Alxandr/Blog,ivantedja/ghost,ASwitlyk/Ghost,netputer/Ghost,tyrikio/Ghost,scopevale/wethepeopleweb.org,lf2941270/Ghost,liftup/ghost,r14r/fork_nodejs_ghost,trunk-studio/Ghost,allspiritseve/mindlikewater,ITJesse/Ghost-zh,duyetdev/islab,e10/Ghost,francisco-filho/Ghost,devleague/uber-hackathon,JohnONolan/Ghost,Japh/shortcoffee,praveenscience/Ghost,nneko/Ghost,bitjson/Ghost,camilodelvasto/herokughost,bisoe/Ghost,kmeurer/Ghost,dgem/Ghost,rchrd2/Ghost,jiachenning/Ghost,beautyOfProgram/Ghost,praveenscience/Ghost,edsadr/Ghost,diancloud/Ghost,tidyui/Ghost,jomofrodo/ccb-ghost,kaychaks/kaushikc.org,flomotlik/Ghost,novaugust/Ghost,darvelo/Ghost,UnbounDev/Ghost,Alxandr/Blog,dbalders/Ghost,cysys/ghost-openshift,lowkeyfred/Ghost,mdbw/ghost,jaswilli/Ghost,qdk0901/Ghost,bosung90/Ghost,lukekhamilton/Ghost,dqj/Ghost,MadeOnMars/Ghost,sankumsek/Ghost-ashram,jeonghwan-kim/Ghost,stridespace/Ghost,chris-yoon90/Ghost,lukw00/Ghost,kaychaks/kaushikc.org,sergeylukin/Ghost,telco2011/Ghost,sergeylukin/Ghost,bastianbin/Ghost,SachaG/bjjbot-blog,ineitzke/Ghost,cqricky/Ghost,olsio/Ghost,jparyani/GhostSS,IbrahimAmin/Ghost,NamedGod/Ghost,thehogfather/Ghost,rito/Ghost,UnbounDev/Ghost,madole/diverse-learners,gcamana/Ghost,pbevin/Ghost,cobbspur/Ghost,ddeveloperr/Ghost,greenboxindonesia/Ghost,Gargol/Ghost,wangjun/Ghost,kevinansfield/Ghost,zackslash/Ghost,disordinary/Ghost,Kaenn/Ghost,wemakeweb/Ghost,handcode7/Ghost,jorgegilmoreira/ghost,barbastan/Ghost,katrotz/blog.katrotz.space,dymx101/Ghost,e10/Ghost,panezhang/Ghost,thomasalrin/Ghost,ManRueda/manrueda-blog,GroupxDev/javaPress,zhiyishou/Ghost,jgillich/Ghost,sfpgmr/Ghost,tmp-reg/Ghost,cwonrails/Ghost,bastianbin/Ghost,leonli/ghost,theonlypat/Ghost,PDXIII/Ghost-FormMailer,makapen/Ghost,yanntech/Ghost,rameshponnada/Ghost,bitjson/Ghost,jgillich/Ghost,denzelwamburu/denzel.xyz,johnnymitch/Ghost,psychobunny/Ghost,makapen/Ghost,dgem/Ghost,achimos/ghost_as,Jai-Chaudhary/Ghost,Yarov/yarov,flpms/ghost-ad,jacostag/Ghost,TryGhost/Ghost,Azzurrio/Ghost,dqj/Ghost,zhiyishou/Ghost,Yarov/yarov,woodyrew/Ghost,Bunk/Ghost,ivanoats/ivanstorck.com,rizkyario/Ghost,bsansouci/Ghost,cysys/ghost-openshift,GroupxDev/javaPress,axross/ghost,ThorstenHans/Ghost,andrewconnell/Ghost,wemakeweb/Ghost,jacostag/Ghost,javorszky/Ghost,ghostchina/Ghost-zh,Dnlyc/Ghost,sebgie/Ghost,situkangsayur/Ghost,bbmepic/Ghost,diogogmt/Ghost,metadevfoundation/Ghost,atandon/Ghost,mattchupp/blog,eduardojmatos/eduardomatos.me,skleung/blog,Polyrhythm/dolce,NikolaiIvanov/Ghost,k2byew/Ghost,yangli1990/Ghost,disordinary/Ghost,acburdine/Ghost,Kikobeats/Ghost,skmezanul/Ghost,tadityar/Ghost,lukekhamilton/Ghost,sangcu/Ghost,pathayes/FoodBlog,notno/Ghost,olsio/Ghost,Netazoic/bad-gateway,sebgie/Ghost,ManRueda/manrueda-blog,melissaroman/ghost-blog,ITJesse/Ghost-zh,no1lov3sme/Ghost,UsmanJ/Ghost,NodeJSBarenko/Ghost,SachaG/bjjbot-blog,JohnONolan/Ghost,davidenq/Ghost-Blog,Romdeau/Ghost,johngeorgewright/blog.j-g-w.info,Brunation11/Ghost,IbrahimAmin/Ghost,zeropaper/Ghost,claudiordgz/Ghost,DesenTao/Ghost,vainglori0us/urban-fortnight,theonlypat/Ghost,karmakaze/Ghost,PaulBGD/Ghost-Plus,JohnONolan/Ghost,NovaDevelopGroup/Academy,lukaszklis/Ghost,mlabieniec/ghost-env,lanffy/Ghost,k2byew/Ghost,camilodelvasto/herokughost,icowan/Ghost,v3rt1go/Ghost,imjerrybao/Ghost,uniqname/everydaydelicious,pensierinmusica/Ghost,adam-paterson/blog,tksander/Ghost,codeincarnate/Ghost,PeterCxy/Ghost,ngosinafrica/SiteForNGOs,kolorahl/Ghost,DesenTao/Ghost,Rovak/Ghost,javorszky/Ghost,jomahoney/Ghost,syaiful6/Ghost,mdbw/ghost,carlosmtx/Ghost,kortemy/Ghost,cwonrails/Ghost,kaiqigong/Ghost,bigertech/Ghost,rafaelstz/Ghost,gleneivey/Ghost,pensierinmusica/Ghost,etdev/blog,rito/Ghost,tanbo800/Ghost,weareleka/blog,wallmarkets/Ghost,augbog/Ghost,syaiful6/Ghost,morficus/Ghost,no1lov3sme/Ghost,epicmiller/pages,sceltoas/Ghost,schneidmaster/theventriloquist.us,Trendy/Ghost,RoopaS/demo-intern,ballPointPenguin/Ghost,llv22/Ghost,RufusMbugua/TheoryOfACoder,vishnuharidas/Ghost,laispace/laiblog,petersucks/blog,pedroha/Ghost,daimaqiao/Ghost-Bridge,tksander/Ghost,Kaenn/Ghost,allanjsx/Ghost,kolorahl/Ghost,KnowLoading/Ghost,hnq90/Ghost,etanxing/Ghost,cicorias/Ghost,dggr/Ghost-sr,achimos/ghost_as,hoxoa/Ghost,ashishapy/ghostpy,ananthhh/Ghost,icowan/Ghost,Azzurrio/Ghost,laispace/laiblog,Elektro1776/javaPress,jiangjian-zh/Ghost,atandon/Ghost,julianromera/Ghost,JonathanZWhite/Ghost,telco2011/Ghost,TryGhost/Ghost,aroneiermann/GhostJade,arvidsvensson/Ghost,anijap/PhotoGhost,ghostchina/Ghost.zh,ClarkGH/Ghost,jorgegilmoreira/ghost,etdev/blog,riyadhalnur/Ghost,lanffy/Ghost,Japh/Ghost,ckousik/Ghost,hilerchyn/Ghost,djensen47/Ghost,omaracrystal/Ghost,Xibao-Lv/Ghost,Feitianyuan/Ghost,STANAPO/Ghost,etanxing/Ghost,devleague/uber-hackathon,javimolla/Ghost,mattchupp/blog,ryanbrunner/crafters,wspandihai/Ghost,leninhasda/Ghost,mnitchie/Ghost,allanjsx/Ghost,telco2011/Ghost,KnowLoading/Ghost,gabfssilva/Ghost,delgermurun/Ghost,jin/Ghost,camilodelvasto/localghost,lf2941270/Ghost,notno/Ghost,InnoD-WebTier/hardboiled_ghost,cicorias/Ghost,cncodog/Ghost-zh-codog,jamesslock/Ghost,exsodus3249/Ghost,vloom/blog,mohanambati/Ghost,skmezanul/Ghost,bisoe/Ghost,ASwitlyk/Ghost,MadeOnMars/Ghost,hoxoa/Ghost,PDXIII/Ghost-FormMailer,riyadhalnur/Ghost,codeincarnate/Ghost,ladislas/ghost,TryGhost/Ghost,Klaudit/Ghost,Coding-House/Ghost,nmukh/Ghost,rizkyario/Ghost,schematical/Ghost,novaugust/Ghost,BayPhillips/Ghost,Kaenn/Ghost,veyo-care/Ghost,benstoltz/Ghost,morficus/Ghost,alecho/Ghost,GarrethDottin/Habits-Design,Netazoic/bad-gateway,ghostchina/Ghost-zh,klinker-apps/ghost,julianromera/Ghost,sfpgmr/Ghost,thinq4yourself/Unmistakable-Blog,rchrd2/Ghost,obsoleted/Ghost,kevinansfield/Ghost,BayPhillips/Ghost,psychobunny/Ghost,aschmoe/jesse-ghost-app,ericbenson/GhostAzureSetup,smedrano/Ghost,akveo/akveo-blog,andrewconnell/Ghost,phillipalexander/Ghost,yundt/seisenpenji,jiangjian-zh/Ghost,acburdine/Ghost,JulienBrks/Ghost,pedroha/Ghost,cysys/ghost-openshift,rameshponnada/Ghost,augbog/Ghost,arvidsvensson/Ghost,YY030913/Ghost,smedrano/Ghost,stridespace/Ghost,zeropaper/Ghost,hnarayanan/narayanan.co,alexandrachifor/Ghost,llv22/Ghost,VillainyStudios/Ghost,VillainyStudios/Ghost,prosenjit-itobuz/Ghost,Aaron1992/Ghost,PaulBGD/Ghost-Plus,netputer/Ghost,obsoleted/Ghost,Japh/shortcoffee,edurangel/Ghost,pbevin/Ghost,rafaelstz/Ghost,GroupxDev/javaPress,FredericBernardo/Ghost,rmoorman/Ghost,pollbox/ghostblog,ballPointPenguin/Ghost,sunh3/Ghost,RufusMbugua/TheoryOfACoder,dai-shi/Ghost,r1N0Xmk2/Ghost,mttschltz/ghostblog,ryansukale/ux.ryansukale.com,jeonghwan-kim/Ghost,exsodus3249/Ghost,lcamacho/Ghost,flomotlik/Ghost,Bunk/Ghost,r14r/fork_nodejs_ghost,yanntech/Ghost,dggr/Ghost-sr,neynah/GhostSS,vainglori0us/urban-fortnight,hyokosdeveloper/Ghost,janvt/Ghost,jaguerra/Ghost,camilodelvasto/localghost,flpms/ghost-ad,GarrethDottin/Habits-Design,PepijnSenders/whatsontheotherside,fredeerock/atlabghost,melissaroman/ghost-blog,jparyani/GhostSS,veyo-care/Ghost,edurangel/Ghost,thinq4yourself/Unmistakable-Blog,mtvillwock/Ghost,jomahoney/Ghost,ManRueda/Ghost,jomofrodo/ccb-ghost,lukaszklis/Ghost,NikolaiIvanov/Ghost,Trendy/Ghost,ManRueda/manrueda-blog,Romdeau/Ghost,barbastan/Ghost,mikecastro26/ghost-custom,smaty1/Ghost,novaugust/Ghost,imjerrybao/Ghost,AnthonyCorrado/Ghost,mohanambati/Ghost,hnarayanan/narayanan.co,ignasbernotas/nullifer,dYale/blog,petersucks/blog,ananthhh/Ghost,mayconxhh/Ghost,Elektro1776/javaPress,ClarkGH/Ghost,singular78/Ghost,mttschltz/ghostblog,influitive/crafters,cwonrails/Ghost,katrotz/blog.katrotz.space,nmukh/Ghost,jin/Ghost,rizkyario/Ghost,Japh/Ghost,hnq90/Ghost,denzelwamburu/denzel.xyz,zumobi/Ghost,rmoorman/Ghost,rouanw/Ghost,PepijnSenders/whatsontheotherside,InnoD-WebTier/hardboiled_ghost,wspandihai/Ghost,daimaqiao/Ghost-Bridge,claudiordgz/Ghost,ignasbernotas/nullifer,qdk0901/Ghost,PeterCxy/Ghost,dggr/Ghost-sr,AileenCGN/Ghost,ErisDS/Ghost,Remchi/Ghost,daimaqiao/Ghost-Bridge,greyhwndz/Ghost,delgermurun/Ghost,memezilla/Ghost,tanbo800/Ghost,dylanchernick/ghostblog,uploadcare/uploadcare-ghost-demo,tuan/Ghost,xiongjungit/Ghost,InnoD-WebTier/hardboiled_ghost,cncodog/Ghost-zh-codog,trunk-studio/Ghost,alecho/Ghost,lowkeyfred/Ghost,ashishapy/ghostpy,karmakaze/Ghost,jaguerra/Ghost,ryansukale/ux.ryansukale.com,influitive/crafters,bbmepic/Ghost,handcode7/Ghost,mayconxhh/Ghost,allanjsx/Ghost,gleneivey/Ghost,davidmenger/nodejsfan,Smile42RU/Ghost,memezilla/Ghost,letsjustfixit/Ghost,NamedGod/Ghost,Elektro1776/javaPress,kwangkim/Ghost,Sebastian1011/Ghost,ddeveloperr/Ghost,ygbhf/Ghost,leninhasda/Ghost,laispace/laiblog,gcamana/Ghost,tyrikio/Ghost,xiongjungit/Ghost,SkynetInc/steam,adam-paterson/blog,chris-yoon90/Ghost,MrMaksimize/sdg1,ygbhf/Ghost,francisco-filho/Ghost,leonli/ghost,blankmaker/Ghost,Sebastian1011/Ghost,Xibao-Lv/Ghost,ljhsai/Ghost,JulienBrks/Ghost,sunh3/Ghost,Remchi/Ghost,velimir0xff/Ghost,yundt/seisenpenji,developer-prosenjit/Ghost,neynah/GhostSS,lukw00/Ghost,weareleka/blog,carlyledavis/Ghost,developer-prosenjit/Ghost,woodyrew/Ghost,patterncoder/patterncoder,fredeerock/atlabghost,kevinansfield/Ghost,floofydoug/Ghost,virtuallyearthed/Ghost,jomofrodo/ccb-ghost,darvelo/Ghost,floofydoug/Ghost,tchapi/igneet-blog,Netazoic/bad-gateway,sajmoon/Ghost,sangcu/Ghost,kmeurer/GhostAzureSetup,Kikobeats/Ghost,UsmanJ/Ghost,thomasalrin/Ghost,velimir0xff/Ghost,aroneiermann/GhostJade,jorgegilmoreira/ghost,Klaudit/Ghost,TribeMedia/Ghost,metadevfoundation/Ghost,ivanoats/ivanstorck.com,mhhf/ghost-latex,greenboxindonesia/Ghost,johngeorgewright/blog.j-g-w.info,TribeMedia/Ghost,allspiritseve/mindlikewater,liftup/ghost,jamesslock/Ghost,aexmachina/blog-old,tandrewnichols/ghost,mtvillwock/Ghost,prosenjit-itobuz/Ghost,patterncoder/patterncoder,r1N0Xmk2/Ghost,LeandroNascimento/Ghost,AnthonyCorrado/Ghost,ljhsai/Ghost,trepafi/ghost-base,Gargol/Ghost,stridespace/Ghost,Dnlyc/Ghost,BlueHatbRit/Ghost,shannonshsu/Ghost,zumobi/Ghost,ladislas/ghost,LeandroNascimento/Ghost,acburdine/Ghost,Loyalsoldier/Ghost,janvt/Ghost,patrickdbakke/ghost-spa,JonathanZWhite/Ghost,schneidmaster/theventriloquist.us,optikalefx/Ghost,hyokosdeveloper/Ghost,ngosinafrica/SiteForNGOs,nneko/Ghost,edsadr/Ghost,ghostchina/website,Coding-House/Ghost,greyhwndz/Ghost,shrimpy/Ghost,freele/ghost,STANAPO/Ghost,shannonshsu/Ghost,daihuaye/Ghost,davidmenger/nodejsfan
--- +++ @@ -46,7 +46,8 @@ nthLine: noop, refresh: noop, selectLines: noop, - on: noop + on: noop, + off: noop }; return TouchEditor;
dd2db0cee5a24f8564a2d306aa9098eba400c1a4
states/level-fail-menu.js
states/level-fail-menu.js
'use strict'; const textUtil = require('../utils/text'); module.exports = { init(nextLevelId, cameraPosition) { this.nextLevelId = nextLevelId; this.cameraPosition = cameraPosition; }, create() { // TODO: Add an overlay to darken the game. this.camera.x = this.cameraPosition.x; this.camera.y = this.cameraPosition.y; const retryText = textUtil.addFixedText( this.game, this.camera.view.width / 2, this.camera.view.height / 2, 'Try Again', { fontSize: 48 } ); retryText.anchor.set(0.5); retryText.inputEnabled = true; retryText.events.onInputUp.add(function retry() { this.closeMenu('level'); }, this); const mainMenuText = textUtil.addFixedText( this.game, retryText.x, retryText.y + 80, 'Go to Main Menu', { fontSize: 48 } ); mainMenuText.anchor.set(0.5); mainMenuText.inputEnabled = true; mainMenuText.events.onInputUp.add(function mainMenu() { this.closeMenu('main-menu'); }, this); }, closeMenu(nextState) { this.sound.destroy(); this.state.start(nextState, true, false, this.nextLevelId); }, };
'use strict'; const textUtil = require('../utils/text'); module.exports = { init(nextLevelId, cameraPosition) { this.nextLevelId = nextLevelId; this.cameraPosition = cameraPosition; }, create() { // TODO: Fade this in. const overlay = this.add.graphics(); overlay.beginFill(0x000000, 0.5); overlay.drawRect(0, 0, this.world.width, this.world.height); overlay.endFill(); this.camera.x = this.cameraPosition.x; this.camera.y = this.cameraPosition.y; const retryText = textUtil.addFixedText( this.game, this.camera.view.width / 2, this.camera.view.height / 2, 'Try Again', { fontSize: 48 } ); retryText.anchor.set(0.5); retryText.inputEnabled = true; retryText.events.onInputUp.add(function retry() { this.closeMenu('level'); }, this); const mainMenuText = textUtil.addFixedText( this.game, retryText.x, retryText.y + 80, 'Go to Main Menu', { fontSize: 48 } ); mainMenuText.anchor.set(0.5); mainMenuText.inputEnabled = true; mainMenuText.events.onInputUp.add(function mainMenu() { this.closeMenu('main-menu'); }, this); }, closeMenu(nextState) { this.sound.destroy(); this.state.start(nextState, true, false, this.nextLevelId); }, };
Create an overlay to cover the level for the retry menu
Create an overlay to cover the level for the retry menu
JavaScript
mit
to-the-end/to-the-end,to-the-end/to-the-end
--- +++ @@ -9,7 +9,12 @@ }, create() { - // TODO: Add an overlay to darken the game. + // TODO: Fade this in. + const overlay = this.add.graphics(); + + overlay.beginFill(0x000000, 0.5); + overlay.drawRect(0, 0, this.world.width, this.world.height); + overlay.endFill(); this.camera.x = this.cameraPosition.x; this.camera.y = this.cameraPosition.y;
39db65de05c816848c07bfbc9b3562d590a34521
scripts/assign-env-vars.js
scripts/assign-env-vars.js
// Used to assign stage-specific env vars in our CI setup // to the env var names used in app code. // All env vars we want to pick up from the CI environment. const envVars = [ 'NODE_ENV', 'AWS_REGION', // AWS Cognito 'COGNITO_REGION', 'COGNITO_IDENTITYPOOLID', 'COGNITO_USERPOOLID', 'COGNITO_CLIENTID', // Web app 'PUBLIC_PATH', 'WEB_HOST', 'WEB_PORT', // GraphQL 'TABLE_NAME_APPENDIX', 'GRAPHQL_PORT', // Endpoints 'GRAPHQL_ENDPOINT', 'DYNAMODB_ENDPOINT', 'S3_ENDPOINT' // Secrets ] // Expect one argument, the stage name. const assignEnvVars = function (stageName) { // Using the name of the stage, assign the stage-specific // value to the environment value name. const stageNameUppercase = stageName ? stageName.toUpperCase() : '' const stagePrefix = stageNameUppercase ? `${stageNameUppercase}_` : '' envVars.forEach((envVar) => { let stageEnvVar = `${stagePrefix}${envVar}` process.env[envVar] = process.env[stageEnvVar] }) } module.exports = assignEnvVars
// Used to assign stage-specific env vars in our CI setup // to the env var names used in app code. // All env vars we want to pick up from the CI environment. const envVars = [ 'NODE_ENV', 'AWS_REGION', // AWS Cognito 'COGNITO_REGION', 'COGNITO_IDENTITYPOOLID', 'COGNITO_USERPOOLID', 'COGNITO_CLIENTID', // Web app 'PUBLIC_PATH', 'WEB_HOST', 'WEB_PORT', // GraphQL 'TABLE_NAME_APPENDIX', 'GRAPHQL_PORT', // Endpoints 'GRAPHQL_ENDPOINT', 'DYNAMODB_ENDPOINT', 'S3_ENDPOINT' // Secrets ] // Expect one argument, the stage name. const assignEnvVars = function (stageName, allEnvVarsRequired = true) { // Using the name of the stage, assign the stage-specific // value to the environment value name. const stageNameUppercase = stageName ? stageName.toUpperCase() : '' const stagePrefix = stageNameUppercase ? `${stageNameUppercase}_` : '' envVars.forEach((envVar) => { let stageEnvVarName = `${stagePrefix}${envVar}` let stageEnvVar = process.env[stageEnvVarName] // Optionally throw an error if an env variable is not set. if ( (typeof stageEnvVar === 'undefined' || stageEnvVar === null) && allEnvVarsRequired ) { throw new Error(`Environment variable ${stageEnvVarName} must be set.`) } process.env[envVar] = stageEnvVar }) } module.exports = assignEnvVars
Throw error if an expected env var is not set.
Throw error if an expected env var is not set.
JavaScript
mpl-2.0
gladly-team/tab,gladly-team/tab,gladly-team/tab
--- +++ @@ -26,14 +26,23 @@ ] // Expect one argument, the stage name. -const assignEnvVars = function (stageName) { +const assignEnvVars = function (stageName, allEnvVarsRequired = true) { // Using the name of the stage, assign the stage-specific // value to the environment value name. const stageNameUppercase = stageName ? stageName.toUpperCase() : '' const stagePrefix = stageNameUppercase ? `${stageNameUppercase}_` : '' envVars.forEach((envVar) => { - let stageEnvVar = `${stagePrefix}${envVar}` - process.env[envVar] = process.env[stageEnvVar] + let stageEnvVarName = `${stagePrefix}${envVar}` + let stageEnvVar = process.env[stageEnvVarName] + + // Optionally throw an error if an env variable is not set. + if ( + (typeof stageEnvVar === 'undefined' || stageEnvVar === null) && + allEnvVarsRequired + ) { + throw new Error(`Environment variable ${stageEnvVarName} must be set.`) + } + process.env[envVar] = stageEnvVar }) }
e3d04be3e031feabc28d5b13deaa4b445f885a05
static/js/views/dbView.js
static/js/views/dbView.js
_r(function (app) { if ( ! window.app.views.hasOwnProperty('db')) { app.views.db = {}; } /** * Database selection box */ app.views.db.box = app.base.formView.extend({ model: app.models.Db, module: 'db', action: 'box', auto_render: true, $el: $('<div id="db_box"></div>').appendTo('body > div.container'), events: { 'click .show_form': 'showForm', 'click .hide_form': 'hideForm' }, afterRender: function () { if (app.user_self.get('name')) { this.$el.show(); } app.base.formView.prototype.afterRender.apply(this, Array.prototype.slice.call(arguments)); }, load: function (callback) { this.model.fetch(function (db) { callback(null, db); }); }, showForm: function () { this.$el.addClass('with_form'); }, hideForm: function () { this.$el.removeClass('with_form'); this.render(); }, saved: function () { this.render(); this.model.once('saved', this.saved); } }); });
_r(function (app) { if ( ! window.app.views.hasOwnProperty('db')) { app.views.db = {}; } /** * Database selection box */ app.views.db.box = app.base.formView.extend({ model: app.models.Db, module: 'db', action: 'box', auto_render: true, $el: $('<div id="db_box"></div>').appendTo('body > div.container'), events: { 'click .show_form': 'showForm', 'click .hide_form': 'hideForm' }, afterRender: function () { if (app.user_self.get('name')) { this.$el.show(); } app.base.formView.prototype.afterRender.apply(this, Array.prototype.slice.call(arguments)); }, load: function (callback) { this.model.fetch(function (db) { callback(null, db); }); }, showForm: function () { this.$el.addClass('with_form'); }, hideForm: function () { this.$el.removeClass('with_form'); this.render(); }, saved: function () { this.hideForm(); this.model.once('saved', this.saved); app.reload(); } }); });
Fix db box to hide itself on successful change
Fix db box to hide itself on successful change
JavaScript
mit
maritz/nohm-admin,maritz/nohm-admin
--- +++ @@ -44,8 +44,9 @@ }, saved: function () { - this.render(); + this.hideForm(); this.model.once('saved', this.saved); + app.reload(); } });
85f32436c920101c8877462d11445ca44bc32832
lib/plugins/body_parser.js
lib/plugins/body_parser.js
// Copyright 2012 Mark Cavage, Inc. All rights reserved. var jsonParser = require('./json_body_parser'); var formParser = require('./form_body_parser'); var multipartParser = require('./multipart_parser'); var errors = require('../errors'); var UnsupportedMediaTypeError = errors.UnsupportedMediaTypeError; function bodyParser(options) { var parseForm = formParser(options); var parseJson = jsonParser(options); var parseMultipart = multipartParser(options); return function parseBody(req, res, next) { if (req.method !== 'POST' && req.method !== 'PUT' && req.method !== 'PATCH') return next(); if (req.contentLength === 0 && !req.chunked) return next(); if (req.contentType === 'application/json') { return parseJson(req, res, next); } else if (req.contentType === 'application/x-www-form-urlencoded') { return parseForm(req, res, next); } else if (req.contentType === 'multipart/form-data') { return parseMultipart(req, res, next); } else if (options.rejectUnknown !== false) { return next(new UnsupportedMediaTypeError('Unsupported Content-Type: ' + req.contentType)); } return next(); }; } module.exports = bodyParser;
// Copyright 2012 Mark Cavage, Inc. All rights reserved. var jsonParser = require('./json_body_parser'); var formParser = require('./form_body_parser'); var multipartParser = require('./multipart_parser'); var errors = require('../errors'); var UnsupportedMediaTypeError = errors.UnsupportedMediaTypeError; function bodyParser(options) { var parseForm = formParser(options); var parseJson = jsonParser(options); var parseMultipart = multipartParser(options); return function parseBody(req, res, next) { if (req.method !== 'POST' && req.method !== 'PUT' && req.method !== 'PATCH') return next(); if (req.contentLength === 0 && !req.chunked) return next(); if (req.contentType === 'application/json') { return parseJson(req, res, next); } else if (req.contentType === 'application/x-www-form-urlencoded') { return parseForm(req, res, next); } else if (req.contentType === 'multipart/form-data') { return parseMultipart(req, res, next); } else if (options && options.rejectUnknown !== false) { return next(new UnsupportedMediaTypeError('Unsupported Content-Type: ' + req.contentType)); } return next(); }; } module.exports = bodyParser;
Check that options is not empty
Check that options is not empty
JavaScript
mit
TheDeveloper/node-restify,prasmussen/node-restify,adunkman/node-restify,chaordic/node-restify,kevinykchan/node-restify,uWhisp/node-restify,jclulow/node-restify,ferhatsb/node-restify
--- +++ @@ -28,7 +28,7 @@ return parseForm(req, res, next); } else if (req.contentType === 'multipart/form-data') { return parseMultipart(req, res, next); - } else if (options.rejectUnknown !== false) { + } else if (options && options.rejectUnknown !== false) { return next(new UnsupportedMediaTypeError('Unsupported Content-Type: ' + req.contentType)); }
623796045a00bb3cd67dd88ece4c89cae01e9f09
karma.conf.js
karma.conf.js
module.exports = function(config) { const files = [ { pattern: 'browser/everything.html', included: false, served: true, }, { pattern: 'browser/everything.js', included: true, served: true, }, { pattern: 'spec/fixtures/*.json', included: false, served: true, }, { pattern: 'browser/vendor/requirejs/*.js', included: false, served: true, }, { pattern: 'browser/vendor/react/*.js', included: false, served: true, }, { pattern: 'browser/manifest.appcache', included: false, served: true, }, 'spec/*.js', ]; const configuration = { basePath: '', frameworks: ['mocha', 'chai'], files, exclude: [], preprocessors: {}, reporters: ['mocha'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: false, browsers: ['Chrome', 'ChromeHeadless', 'ChromeHeadlessNoSandbox'], customLaunchers: { ChromeHeadlessNoSandbox: { base: 'ChromeHeadless', flags: ['--no-sandbox'], }, }, singleRun: true, concurrency: Infinity }; config.set(configuration); }
module.exports = function(config) { const files = [ { pattern: 'browser/everything.html', included: false, served: true, }, { pattern: 'browser/everything.js', included: true, served: true, }, { pattern: 'spec/fixtures/*.json', included: false, served: true, }, { pattern: 'browser/vendor/requirejs/*.js', included: false, served: true, }, { pattern: 'browser/vendor/react/*.js', included: false, served: true, }, { pattern: 'browser/manifest.appcache', included: false, served: true, }, 'spec/*.js', ]; const configuration = { basePath: '', frameworks: ['mocha', 'chai'], files, exclude: [], preprocessors: {}, reporters: ['mocha'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadlessNoSandbox: { base: 'ChromeHeadless', flags: ['--no-sandbox'], }, }, singleRun: true, concurrency: Infinity }; if (process.env.TRAVIS) { configuration.browsers = ['ChromeHeadlessNoSandbox']; } config.set(configuration); }
Switch browser list when running in Travis
Switch browser list when running in Travis
JavaScript
mit
noflo/noflo-browser,noflo/noflo-browser
--- +++ @@ -44,7 +44,7 @@ colors: true, logLevel: config.LOG_INFO, autoWatch: false, - browsers: ['Chrome', 'ChromeHeadless', 'ChromeHeadlessNoSandbox'], + browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadlessNoSandbox: { base: 'ChromeHeadless', @@ -55,5 +55,9 @@ concurrency: Infinity }; + if (process.env.TRAVIS) { + configuration.browsers = ['ChromeHeadlessNoSandbox']; + } + config.set(configuration); }
bbce11a5b7cf71b35d1ab77d48eacd8ddc755b9e
karma.conf.js
karma.conf.js
const options = { frameworks: ['kocha', 'browserify'], files: [ 'packages/karma-kocha/__tests__/*.js' ], preprocessors: { 'packages/karma-kocha/__tests__/*.js': ['browserify'] }, browserify: { debug: true }, reporters: ['progress'], browsers: ['Chrome'], singleRun: true, plugins: [ require.resolve('./packages/karma-kocha'), 'karma-browserify', 'karma-chrome-launcher' ] } if (false && process.env.CI) { // Sauce Labs settings const customLaunchers = require('./karma.custom-launchers.js') options.plugins.push('karma-sauce-launcher') options.customLaunchers = customLaunchers options.browsers = Object.keys(options.customLaunchers) options.reporters.push('saucelabs') options.sauceLabs = { testName: 'kocha-ci' } } module.exports = config => config.set(options)
const options = { frameworks: ['kocha', 'browserify'], files: [ 'packages/karma-kocha/__tests__/*.js' ], preprocessors: { 'packages/karma-kocha/__tests__/*.js': ['browserify'] }, browserify: { debug: true }, reporters: ['progress'], browsers: ['Chrome'], singleRun: true, plugins: [ require.resolve('./packages/karma-kocha'), 'karma-browserify', 'karma-chrome-launcher' ] } if (process.env.CI) { // Sauce Labs settings const customLaunchers = require('./karma.custom-launchers.js') options.plugins.push('karma-sauce-launcher') options.customLaunchers = customLaunchers options.browsers = Object.keys(options.customLaunchers) options.reporters.push('saucelabs') options.sauceLabs = { testName: 'kocha-ci' } } module.exports = config => config.set(options)
Revert "chore: disable sauce tests for now"
Revert "chore: disable sauce tests for now" This reverts commit 28a0a9db5263bb5408507f520b6fe6aa7404b13b.
JavaScript
mit
kt3k/kocha
--- +++ @@ -17,7 +17,7 @@ ] } -if (false && process.env.CI) { +if (process.env.CI) { // Sauce Labs settings const customLaunchers = require('./karma.custom-launchers.js') options.plugins.push('karma-sauce-launcher')
245ddf33d7d4fecbf000a6cd42f3c54cbc476238
karma.conf.js
karma.conf.js
/* global module:false */ module.exports = function (config) { config.set({ basePath: '', frameworks: ['mocha', 'chai'], reporters: ['dots', 'progress'], browsers: ['ChromeIncognito', 'Firefox', 'Safari'], singleRun: true, customLaunchers: { ChromeIncognito: { base: 'Chrome', flags: ['--incognito'] } }, files: [ 'idbstore.min.js', 'test/**/*spec.js' ] }); };
/* global module:false */ module.exports = function (config) { config.set({ basePath: '', frameworks: ['mocha', 'chai'], reporters: ['dots', 'progress'], browsers: ['ChromeIncognito', 'Firefox'], singleRun: true, customLaunchers: { ChromeIncognito: { base: 'Chrome', flags: ['--incognito'] } }, files: [ 'idbstore.min.js', 'test/**/*spec.js' ] }); };
Remove Safari from automated tests
Remove Safari from automated tests
JavaScript
mit
jensarps/IDBWrapper,jayfunk/IDBWrapper,jayfunk/IDBWrapper,jensarps/IDBWrapper
--- +++ @@ -7,7 +7,7 @@ reporters: ['dots', 'progress'], - browsers: ['ChromeIncognito', 'Firefox', 'Safari'], + browsers: ['ChromeIncognito', 'Firefox'], singleRun: true,
0d6fd08589942a675b380a03dd1f35b100648ce8
karma.conf.js
karma.conf.js
const base = require('skatejs-build/karma.conf'); module.exports = (config) => { base(config); config.files = [ // React 'https://scontent.xx.fbcdn.net/t39.3284-6/13591530_1796350410598576_924751100_n.js', // React DOM 'https://scontent.xx.fbcdn.net/t39.3284-6/13591520_511026312439094_2118166596_n.js', ].concat(config.files); // Ensure mobile browsers have enough time to run. config.browserNoActivityTimeout = 120000; };
const base = require('skatejs-build/karma.conf'); module.exports = (config) => { base(config); config.files = [ // React 'https://scontent.xx.fbcdn.net/t39.3284-6/13591530_1796350410598576_924751100_n.js', // React DOM 'https://scontent.xx.fbcdn.net/t39.3284-6/13591520_511026312439094_2118166596_n.js', ].concat(config.files); // Ensure mobile browsers have enough time to run. config.browserNoActivityTimeout = 60000; };
Revert "chore: test timeout increase"
Revert "chore: test timeout increase" This reverts commit 844e5e87baa3b27ec0da354805d7c29f46d219d9.
JavaScript
mit
chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs,skatejs/skatejs,chrisdarroch/skatejs
--- +++ @@ -11,5 +11,5 @@ ].concat(config.files); // Ensure mobile browsers have enough time to run. - config.browserNoActivityTimeout = 120000; + config.browserNoActivityTimeout = 60000; };
ee97033aab6492b08c23f7eb52e93c9f4f58b9bf
jest.config.js
jest.config.js
module.exports = { "modulePaths": [ "<rootDir>/app", "<rootDir>/node_modules" ], "moduleFileExtensions": [ "js", "json" ], "testRegex": "/test/*/.*-test.js$", "testEnvironment": "node", "testTimeout": 10000, "collectCoverage": true, "reporters": [ "default", [ "jest-junit", { "outputDirectory": "test/junit", "outputName": "TESTS.xml" } ] ], "collectCoverageFrom": [ "app/**/*.js", "!**/node_modules/**", "!**/test/**" ], "coverageDirectory": "<rootDir>/coverage", "coverageReporters": [ "json", "lcov", "html" ] }
module.exports = { "modulePaths": [ "<rootDir>/app", "<rootDir>/node_modules" ], "moduleFileExtensions": [ "js", "json" ], "testRegex": "/test/*/.*-test.js$", "testEnvironment": "node", "testTimeout": 10000, "collectCoverage": true, "reporters": [ "default", [ "jest-junit", { "outputDirectory": "test/junit", "outputName": "TESTS.xml" } ] ], "collectCoverageFrom": [ "app/**/*.js", "!**/node_modules/**", "!**/test/**" ], "coverageDirectory": "<rootDir>/coverage", "coverageReporters": [ "json", "lcov", "html", "cobertura" ] }
Add Cobertura Test coverage output
Add Cobertura Test coverage output
JavaScript
apache-2.0
stamp-web/stamp-webservices
--- +++ @@ -30,6 +30,7 @@ "coverageReporters": [ "json", "lcov", - "html" + "html", + "cobertura" ] }
13b19fd044152ac6bf1213aa4d22fa0cb1623da6
js/redirect.js
js/redirect.js
/*global chrome,document,window */ (function init(angular) { "use strict"; try { chrome.storage.local.get(["url", "tab.selected", "always-tab-update"], function (items) { var url = items.url; if (url) { url = (0 !== url.indexOf("about:") && -1 === url.indexOf("://")) ? ("http://" + url) : url; if (/^http[s]?:/i.test(url) && items["always-tab-update"] !== true) { document.location.href = url; } else { chrome.tabs.getCurrent(function (tab) { // a keen user may open the extension's background page and set: // chrome.storage.local.set({'tab.selected': false}); var selected = items["tab.selected"] === undefined ? true : (items["tab.selected"] == "true"); chrome.tabs.update(tab.id, { "url": url, "highlighted": selected }); }); } } else { angular.resumeBootstrap(); } }); } catch(e){ // If anything goes wrong with the redirection logic, fail to custom apps page. console.error(e); angular.resumeBootstrap(); } })(angular);
/*global chrome,document,window */ (function init(angular) { "use strict"; try { chrome.storage.local.get(["url", "tab.selected", "always-tab-update"], function (items) { var url = items.url; if (url) { url = (0 !== url.indexOf("about:") && 0 !== url.indexOf("data:") && -1 === url.indexOf("://")) ? ("http://" + url) : url; if (/^http[s]?:/i.test(url) && items["always-tab-update"] !== true) { document.location.href = url; } else { chrome.tabs.getCurrent(function (tab) { // a keen user may open the extension's background page and set: // chrome.storage.local.set({'tab.selected': false}); var selected = items["tab.selected"] === undefined ? true : (items["tab.selected"] == "true"); chrome.tabs.update(tab.id, { "url": url, "highlighted": selected }); }); } } else { angular.resumeBootstrap(); } }); } catch(e){ // If anything goes wrong with the redirection logic, fail to custom apps page. console.error(e); angular.resumeBootstrap(); } })(angular);
Allow data URIs to be set as the new tab page
Allow data URIs to be set as the new tab page
JavaScript
mit
jimschubert/NewTab-Redirect,jimschubert/NewTab-Redirect
--- +++ @@ -5,7 +5,7 @@ chrome.storage.local.get(["url", "tab.selected", "always-tab-update"], function (items) { var url = items.url; if (url) { - url = (0 !== url.indexOf("about:") && -1 === url.indexOf("://")) ? ("http://" + url) : url; + url = (0 !== url.indexOf("about:") && 0 !== url.indexOf("data:") && -1 === url.indexOf("://")) ? ("http://" + url) : url; if (/^http[s]?:/i.test(url) && items["always-tab-update"] !== true) { document.location.href = url; } else {
1696f212f0ff83997f2aadb6b14a9cd4d716a172
src/commands/post.js
src/commands/post.js
const Command = require('../structures/Command'); const snekfetch = require('snekfetch'); const { inspect } = require('util'); class PostCommand extends Command { constructor() { super({ name: 'post', description: 'Update the guild count on <https://bots.discord.pw>', ownersOnly: true }); } async run(message, args) { const { config: { useDiscordBots, discordBotsAPI }, user, guilds, logger } = message.client; if (!useDiscordBots) return; snekfetch.post(`https://bots.discord.pw/api/bots/${user.id}/stats`) .set('Authorization', `${discordBotsAPI}`) .set('Content-type', 'application/json; charset=utf-8') .send(`{"server_count": ${guilds.size}}`) .then(res => message.reply('POST request sent successfully!')) .catch(err => { const errorDetails = `${err.host ? err.host : ''} ${err.text ? err.text : ''}`.trim(); message.reply(`an error occurred updating the guild count: \`\`${err.status}: ${errorDetails}\`\``); logger.error(inspect(err)); }); } } module.exports = PostCommand;
const Command = require('../structures/Command'); const snekfetch = require('snekfetch'); const { inspect } = require('util'); class PostCommand extends Command { constructor() { super({ name: 'post', description: 'Update the guild count on <https://bots.discord.pw>', ownersOnly: true }); } async run(message, args) { const { config: { useDiscordBots, discordBotsAPI }, user, guilds, logger } = message.client; if (!useDiscordBots) return; snekfetch.post(`https://bots.discord.pw/api/bots/${user.id}/stats`) .set('Authorization', `${discordBotsAPI}`) .set('Content-type', 'application/json; charset=utf-8') .send(`{"server_count": ${guilds.size}}`) .then(res => message.reply('POST request sent successfully!')) .catch(err => { message.reply(`an error occurred updating the guild count: \`\`${err.statusCode}: ${err.statusText}\`\``); logger.error(`Error updating to DiscordBots: ${err.statusCode} - ${err.statusText}`); }); } } module.exports = PostCommand;
Fix this logging n stuff
Fix this logging n stuff
JavaScript
mit
robflop/robbot
--- +++ @@ -20,9 +20,8 @@ .send(`{"server_count": ${guilds.size}}`) .then(res => message.reply('POST request sent successfully!')) .catch(err => { - const errorDetails = `${err.host ? err.host : ''} ${err.text ? err.text : ''}`.trim(); - message.reply(`an error occurred updating the guild count: \`\`${err.status}: ${errorDetails}\`\``); - logger.error(inspect(err)); + message.reply(`an error occurred updating the guild count: \`\`${err.statusCode}: ${err.statusText}\`\``); + logger.error(`Error updating to DiscordBots: ${err.statusCode} - ${err.statusText}`); }); } }
7f4469c16415a1e2c6b02f750104eced8e1c7554
src/config/server.js
src/config/server.js
import path from 'path'; import fs from 'fs'; export function requestHandler (req, res) { const indexPagePath = path.resolve(__dirname + '/..') + '/index.html'; fs.readFile(indexPagePath, (err, data) => { if (err) { res.writeHead(500); return res.end('Error loading index.html'); } res.writeHead(200); res.end(data); }); }
import path from 'path'; import fs from 'fs'; export function requestHandler (req, res) { const indexPagePath = path.resolve(__dirname + '/../..') + '/index.html'; fs.readFile(indexPagePath, (err, data) => { if (err) { res.writeHead(500); return res.end('Error loading index.html'); } res.writeHead(200); res.end(data); }); }
Correct path for index html file
Correct path for index html file
JavaScript
agpl-3.0
empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core
--- +++ @@ -2,7 +2,7 @@ import fs from 'fs'; export function requestHandler (req, res) { - const indexPagePath = path.resolve(__dirname + '/..') + '/index.html'; + const indexPagePath = path.resolve(__dirname + '/../..') + '/index.html'; fs.readFile(indexPagePath, (err, data) => { if (err) { res.writeHead(500);
914e94f9e5531465fdf6028734fb99402fae3411
templates/html5/output.js
templates/html5/output.js
::if embeddedLibraries::::foreach (embeddedLibraries):: ::__current__::::end::::end:: // lime.embed namespace wrapper (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; $hx_exports.lime.$scripts["::APP_FILE::"] = (function(exports, global) { ::SOURCE_FILE:: }); // End namespace wrapper $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; exports.lime.embed.apply(exports.lime, arguments); return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);
var $hx_script = (function(exports, global) { ::SOURCE_FILE::}); (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; $hx_exports.lime.$scripts["::APP_FILE::"] = $hx_script; $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; exports.lime.embed.apply(exports.lime, arguments); return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); ::if embeddedLibraries::::foreach (embeddedLibraries)::::__current__:: ::end::::end::
Fix line numbers for HTML5 source maps
Fix line numbers for HTML5 source maps
JavaScript
mit
madrazo/lime-1,player-03/lime,madrazo/lime-1,MinoGames/lime,openfl/lime,player-03/lime,openfl/lime,madrazo/lime-1,madrazo/lime-1,MinoGames/lime,openfl/lime,openfl/lime,madrazo/lime-1,player-03/lime,MinoGames/lime,openfl/lime,player-03/lime,player-03/lime,MinoGames/lime,MinoGames/lime,MinoGames/lime,player-03/lime,madrazo/lime-1,player-03/lime,MinoGames/lime,openfl/lime,madrazo/lime-1,openfl/lime
--- +++ @@ -1,13 +1,8 @@ -::if embeddedLibraries::::foreach (embeddedLibraries):: -::__current__::::end::::end:: -// lime.embed namespace wrapper +var $hx_script = (function(exports, global) { ::SOURCE_FILE::}); (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; -$hx_exports.lime.$scripts["::APP_FILE::"] = (function(exports, global) { -::SOURCE_FILE:: -}); -// End namespace wrapper +$hx_exports.lime.$scripts["::APP_FILE::"] = $hx_script; $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; @@ -15,3 +10,5 @@ return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); +::if embeddedLibraries::::foreach (embeddedLibraries)::::__current__:: +::end::::end::
22eb68d51eefaefaa8def3b0ef44d4a551babcca
lib/plugin/router/router.js
lib/plugin/router/router.js
"use strict"; const Item = require('./item'); const Handler = require('./handler'); const Plugin = require('../plugin'); const url = require('url'); const {coroutine: co} = require('bluebird'); class Router extends Plugin { constructor(engine) { super(engine); engine.registry.http.incoming.set({id: 'http', incoming: (...args) => this.incoming(...args)}); this.router = new Item(); return this; } incoming(context) { // TODO: Proper favicon.ico handling. if (context.request.url == '/favicon.ico') {return Promise.resolve();} let handlers = Item.sortHandlers(this.router.collectHandlers(context.request._parsedUrl.pathname)); return co(function*() { for (let key in handlers) { if (context.httpResponse == undefined) { context.handler = handlers[key]; yield (new context.handler()).init(context); } } })(); } } module.exports = Router;
"use strict"; const Item = require('./item'); const Handler = require('./handler'); const Plugin = require('../plugin'); const url = require('url'); const {coroutine: co} = require('bluebird'); class Router extends Plugin { constructor(engine) { super(engine); engine.registry.http.incoming.set({id: 'http', incoming: (...args) => this.incoming(...args)}); this.router = new Item(); return this; } incoming(context) { // TODO: Proper favicon.ico handling. if (context.request.url == '/favicon.ico') {return Promise.resolve();} let handlers = Item.sortHandlers(this.router.collectHandlers(context.request._parsedUrl.pathname)); return co(function*() { for (let key in handlers) { if (context.httpResponse === undefined) { context.handler = handlers[key]; yield (new context.handler()).init(context); } } })(); } } module.exports = Router;
Clarify httpResponse check with ===
Clarify httpResponse check with ===
JavaScript
mit
coreyp1/defiant,coreyp1/defiant
--- +++ @@ -20,7 +20,7 @@ let handlers = Item.sortHandlers(this.router.collectHandlers(context.request._parsedUrl.pathname)); return co(function*() { for (let key in handlers) { - if (context.httpResponse == undefined) { + if (context.httpResponse === undefined) { context.handler = handlers[key]; yield (new context.handler()).init(context); }
d64c1914a95e150b32ec750171187b8354059cd8
lib/errors.js
lib/errors.js
/* * Grasspiler / errors.js * copyright (c) 2016 Susisu */ "use strict"; function endModule() { module.exports = Object.freeze({ ParseError, CompileError }); } class ParseError extends Error { constructor(message) { super(message); this.name = this.constructor.name; } } class CompileError extends Error { constructor(trace, message) { super(message); this.trace = trace; } addTrace(trace) { return new CompileError(trace.concat(this.trace), this.message); } toString() { const traceStr = this.trace.map(t => t.toString() + ":\n").join(""); return traceStr + this.message; } } endModule();
/* * Grasspiler / errors.js * copyright (c) 2016 Susisu */ "use strict"; function endModule() { module.exports = Object.freeze({ ParseError, CompileError }); } class ParseError extends Error { constructor(message) { super(message); this.name = this.constructor.name; } } class CompileError extends Error { constructor(trace, message) { super(message); this.name = this.constructor.name; this.trace = trace; } addTrace(trace) { return new CompileError(trace.concat(this.trace), this.message); } toString() { const traceStr = this.trace.map(t => t.toString() + ":\n").join(""); return this.name + ": " + traceStr + this.message; } } endModule();
Add name property to compile error
Add name property to compile error
JavaScript
mit
susisu/Grasspiler
--- +++ @@ -22,6 +22,7 @@ class CompileError extends Error { constructor(trace, message) { super(message); + this.name = this.constructor.name; this.trace = trace; } @@ -31,7 +32,7 @@ toString() { const traceStr = this.trace.map(t => t.toString() + ":\n").join(""); - return traceStr + this.message; + return this.name + ": " + traceStr + this.message; } }
df3766e78ec0c5af757135192e5a1ff6b051199f
lib/errors.js
lib/errors.js
/** * Copyright 2013 Rackspace * * 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 * * http://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. * */ var util = require('util'); /** * * @constructor * * @param {String} message The error message. */ function ClientTimeoutError(message) { Error.call(this, error); this.message = message; this.name = 'ClientTimeoutException'; } util.inherits(ClientTimeoutError, Error); exports.ClientTimeoutError = ClientTimeoutError;
/** * Copyright 2014 Rackspace * * 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 * * http://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. * */ var util = require('util'); /** * Error for when the client times out a query. * @constructor * * @param {String} message The error message. */ function ClientTimeoutError(message) { Error.call(this, error); this.message = message; this.name = 'ClientTimeoutException'; } util.inherits(ClientTimeoutError, Error); exports.ClientTimeoutError = ClientTimeoutError;
Add missing comment and fix copyright date.
Add missing comment and fix copyright date.
JavaScript
apache-2.0
racker/node-cassandra-client,racker/node-cassandra-client
--- +++ @@ -1,5 +1,5 @@ /** - * Copyright 2013 Rackspace + * Copyright 2014 Rackspace * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ /** - * + * Error for when the client times out a query. * @constructor * * @param {String} message The error message.
4b0660934648ff19db30803f5faf84bedfe2c5d2
packages/github/github_client.js
packages/github/github_client.js
Github = {}; // Request Github credentials for the user // @param options {optional} // @param credentialRequestCompleteCallback {Function} Callback function to call on // completion. Takes one argument, credentialToken on success, or Error on // error. Github.requestCredential = function (options, credentialRequestCompleteCallback) { // support both (options, callback) and (callback). if (!credentialRequestCompleteCallback && typeof options === 'function') { credentialRequestCompleteCallback = options; options = {}; } var config = ServiceConfiguration.configurations.findOne({service: 'github'}); if (!config) { credentialRequestCompleteCallback && credentialRequestCompleteCallback( new ServiceConfiguration.ConfigError()); return; } var credentialToken = Random.secret(); var scope = (options && options.requestPermissions) || []; var flatScope = _.map(scope, encodeURIComponent).join('+'); var loginStyle = OAuth._loginStyle('github', config, options); var loginUrl = 'https://github.com/login/oauth/authorize' + '?client_id=' + config.clientId + '&scope=' + flatScope + '&redirect_uri=' + OAuth._redirectUri('github', config) + '&state=' + OAuth._stateParam(loginStyle, credentialToken); OAuth.launchLogin({ loginService: "github", loginStyle: loginStyle, loginUrl: loginUrl, credentialRequestCompleteCallback: credentialRequestCompleteCallback, credentialToken: credentialToken, popupOptons: {width: 900, height: 450} }); };
Github = {}; // Request Github credentials for the user // @param options {optional} // @param credentialRequestCompleteCallback {Function} Callback function to call on // completion. Takes one argument, credentialToken on success, or Error on // error. Github.requestCredential = function (options, credentialRequestCompleteCallback) { // support both (options, callback) and (callback). if (!credentialRequestCompleteCallback && typeof options === 'function') { credentialRequestCompleteCallback = options; options = {}; } var config = ServiceConfiguration.configurations.findOne({service: 'github'}); if (!config) { credentialRequestCompleteCallback && credentialRequestCompleteCallback( new ServiceConfiguration.ConfigError()); return; } var credentialToken = Random.secret(); var scope = (options && options.requestPermissions) || []; var flatScope = _.map(scope, encodeURIComponent).join('+'); var loginStyle = OAuth._loginStyle('github', config, options); var loginUrl = 'https://github.com/login/oauth/authorize' + '?client_id=' + config.clientId + '&scope=' + flatScope + '&redirect_uri=' + OAuth._redirectUri('github', config) + '&state=' + OAuth._stateParam(loginStyle, credentialToken); OAuth.launchLogin({ loginService: "github", loginStyle: loginStyle, loginUrl: loginUrl, credentialRequestCompleteCallback: credentialRequestCompleteCallback, credentialToken: credentialToken, popupOptions: {width: 900, height: 450} }); };
Fix 'popupOptions' typo in 'github'
Fix 'popupOptions' typo in 'github'
JavaScript
mit
EduShareOntario/meteor,daltonrenaldo/meteor,dev-bobsong/meteor,youprofit/meteor,skarekrow/meteor,PatrickMcGuinness/meteor,DCKT/meteor,henrypan/meteor,HugoRLopes/meteor,jdivy/meteor,benjamn/meteor,yalexx/meteor,daltonrenaldo/meteor,youprofit/meteor,Profab/meteor,sitexa/meteor,TribeMedia/meteor,esteedqueen/meteor,yanisIk/meteor,esteedqueen/meteor,DCKT/meteor,Paulyoufu/meteor-1,LWHTarena/meteor,ljack/meteor,tdamsma/meteor,jenalgit/meteor,dandv/meteor,papimomi/meteor,TribeMedia/meteor,whip112/meteor,ljack/meteor,Puena/meteor,nuvipannu/meteor,kengchau/meteor,neotim/meteor,daltonrenaldo/meteor,vacjaliu/meteor,fashionsun/meteor,meteor-velocity/meteor,jrudio/meteor,pandeysoni/meteor,dfischer/meteor,Hansoft/meteor,alphanso/meteor,iman-mafi/meteor,kidaa/meteor,yonas/meteor-freebsd,henrypan/meteor,GrimDerp/meteor,GrimDerp/meteor,yonas/meteor-freebsd,paul-barry-kenzan/meteor,mauricionr/meteor,sdeveloper/meteor,ndarilek/meteor,esteedqueen/meteor,AnjirHossain/meteor,dboyliao/meteor,luohuazju/meteor,oceanzou123/meteor,Jeremy017/meteor,jg3526/meteor,allanalexandre/meteor,oceanzou123/meteor,baiyunping333/meteor,calvintychan/meteor,msavin/meteor,eluck/meteor,whip112/meteor,queso/meteor,baiyunping333/meteor,Paulyoufu/meteor-1,aldeed/meteor,AlexR1712/meteor,dandv/meteor,sitexa/meteor,karlito40/meteor,williambr/meteor,mubassirhayat/meteor,vjau/meteor,lassombra/meteor,yiliaofan/meteor,Jonekee/meteor,jirengu/meteor,cherbst/meteor,mubassirhayat/meteor,D1no/meteor,vjau/meteor,allanalexandre/meteor,baysao/meteor,luohuazju/meteor,Ken-Liu/meteor,stevenliuit/meteor,ljack/meteor,aramk/meteor,yinhe007/meteor,qscripter/meteor,joannekoong/meteor,ndarilek/meteor,namho102/meteor,whip112/meteor,mubassirhayat/meteor,johnthepink/meteor,cog-64/meteor,framewr/meteor,Jeremy017/meteor,mirstan/meteor,LWHTarena/meteor,pandeysoni/meteor,oceanzou123/meteor,lorensr/meteor,bhargav175/meteor,papimomi/meteor,lpinto93/meteor,benjamn/meteor,daslicht/meteor,planet-training/meteor,dfischer/meteor,shadedprofit/meteor,devgrok/meteor,DCKT/meteor,AlexR1712/meteor,zdd910/meteor,queso/meteor,saisai/meteor,kencheung/meteor,qscripter/meteor,Puena/meteor,mauricionr/meteor,shadedprofit/meteor,yyx990803/meteor,saisai/meteor,baysao/meteor,yalexx/meteor,vjau/meteor,wmkcc/meteor,yanisIk/meteor,alexbeletsky/meteor,paul-barry-kenzan/meteor,lorensr/meteor,nuvipannu/meteor,msavin/meteor,brdtrpp/meteor,AnjirHossain/meteor,yalexx/meteor,cherbst/meteor,lieuwex/meteor,namho102/meteor,jg3526/meteor,msavin/meteor,akintoey/meteor,tdamsma/meteor,Quicksteve/meteor,JesseQin/meteor,jenalgit/meteor,chmac/meteor,Prithvi-A/meteor,shmiko/meteor,ljack/meteor,yalexx/meteor,aramk/meteor,cog-64/meteor,JesseQin/meteor,sdeveloper/meteor,williambr/meteor,codingang/meteor,newswim/meteor,shmiko/meteor,juansgaitan/meteor,pandeysoni/meteor,Paulyoufu/meteor-1,yyx990803/meteor,queso/meteor,IveWong/meteor,vjau/meteor,JesseQin/meteor,yanisIk/meteor,sclausen/meteor,iman-mafi/meteor,newswim/meteor,servel333/meteor,kengchau/meteor,guazipi/meteor,namho102/meteor,alexbeletsky/meteor,johnthepink/meteor,eluck/meteor,lieuwex/meteor,alexbeletsky/meteor,henrypan/meteor,jeblister/meteor,youprofit/meteor,calvintychan/meteor,guazipi/meteor,brettle/meteor,joannekoong/meteor,udhayam/meteor,yonglehou/meteor,IveWong/meteor,lassombra/meteor,Urigo/meteor,sunny-g/meteor,GrimDerp/meteor,nuvipannu/meteor,PatrickMcGuinness/meteor,daltonrenaldo/meteor,chiefninew/meteor,karlito40/meteor,lpinto93/meteor,queso/meteor,baysao/meteor,rozzzly/meteor,brettle/meteor,Urigo/meteor,arunoda/meteor,kencheung/meteor,karlito40/meteor,judsonbsilva/meteor,meteor-velocity/meteor,papimomi/meteor,framewr/meteor,shrop/meteor,chinasb/meteor,meonkeys/meteor,colinligertwood/meteor,somallg/meteor,whip112/meteor,HugoRLopes/meteor,HugoRLopes/meteor,sunny-g/meteor,Theviajerock/meteor,evilemon/meteor,aldeed/meteor,benjamn/meteor,benstoltz/meteor,mubassirhayat/meteor,aldeed/meteor,papimomi/meteor,yanisIk/meteor,chasertech/meteor,bhargav175/meteor,eluck/meteor,jg3526/meteor,codingang/meteor,joannekoong/meteor,4commerce-technologies-AG/meteor,sclausen/meteor,Profab/meteor,Theviajerock/meteor,devgrok/meteor,msavin/meteor,baysao/meteor,jagi/meteor,paul-barry-kenzan/meteor,yinhe007/meteor,D1no/meteor,yonglehou/meteor,vjau/meteor,justintung/meteor,shrop/meteor,wmkcc/meteor,Theviajerock/meteor,kidaa/meteor,pjump/meteor,hristaki/meteor,TechplexEngineer/meteor,Puena/meteor,juansgaitan/meteor,benstoltz/meteor,dev-bobsong/meteor,guazipi/meteor,namho102/meteor,dfischer/meteor,bhargav175/meteor,Quicksteve/meteor,sdeveloper/meteor,yyx990803/meteor,jg3526/meteor,dev-bobsong/meteor,Theviajerock/meteor,johnthepink/meteor,katopz/meteor,lieuwex/meteor,dev-bobsong/meteor,ericterpstra/meteor,mauricionr/meteor,codedogfish/meteor,chengxiaole/meteor,jeblister/meteor,pandeysoni/meteor,yinhe007/meteor,steedos/meteor,vjau/meteor,skarekrow/meteor,meteor-velocity/meteor,skarekrow/meteor,neotim/meteor,lpinto93/meteor,Jonekee/meteor,ericterpstra/meteor,udhayam/meteor,sunny-g/meteor,dboyliao/meteor,jdivy/meteor,benjamn/meteor,Urigo/meteor,Urigo/meteor,williambr/meteor,saisai/meteor,chasertech/meteor,arunoda/meteor,chengxiaole/meteor,eluck/meteor,rabbyalone/meteor,jeblister/meteor,modulexcite/meteor,mirstan/meteor,katopz/meteor,Paulyoufu/meteor-1,neotim/meteor,judsonbsilva/meteor,sclausen/meteor,chinasb/meteor,baysao/meteor,ljack/meteor,steedos/meteor,Jonekee/meteor,TechplexEngineer/meteor,AnthonyAstige/meteor,skarekrow/meteor,Profab/meteor,chengxiaole/meteor,evilemon/meteor,Quicksteve/meteor,AnthonyAstige/meteor,yalexx/meteor,daltonrenaldo/meteor,TechplexEngineer/meteor,AnjirHossain/meteor,servel333/meteor,cbonami/meteor,katopz/meteor,judsonbsilva/meteor,shmiko/meteor,guazipi/meteor,yyx990803/meteor,emmerge/meteor,hristaki/meteor,AnthonyAstige/meteor,oceanzou123/meteor,benstoltz/meteor,evilemon/meteor,alphanso/meteor,devgrok/meteor,aleclarson/meteor,Paulyoufu/meteor-1,benstoltz/meteor,sitexa/meteor,emmerge/meteor,lorensr/meteor,AnjirHossain/meteor,michielvanoeffelen/meteor,jg3526/meteor,Puena/meteor,whip112/meteor,allanalexandre/meteor,codingang/meteor,zdd910/meteor,mirstan/meteor,shrop/meteor,4commerce-technologies-AG/meteor,jenalgit/meteor,baysao/meteor,ljack/meteor,shmiko/meteor,lpinto93/meteor,modulexcite/meteor,Eynaliyev/meteor,arunoda/meteor,yonas/meteor-freebsd,l0rd0fwar/meteor,planet-training/meteor,Prithvi-A/meteor,allanalexandre/meteor,D1no/meteor,cog-64/meteor,meonkeys/meteor,karlito40/meteor,akintoey/meteor,baiyunping333/meteor,udhayam/meteor,dev-bobsong/meteor,luohuazju/meteor,eluck/meteor,deanius/meteor,paul-barry-kenzan/meteor,imanmafi/meteor,jeblister/meteor,skarekrow/meteor,mirstan/meteor,lorensr/meteor,cog-64/meteor,karlito40/meteor,jrudio/meteor,JesseQin/meteor,yiliaofan/meteor,mjmasn/meteor,benjamn/meteor,codedogfish/meteor,chasertech/meteor,GrimDerp/meteor,justintung/meteor,ashwathgovind/meteor,dev-bobsong/meteor,PatrickMcGuinness/meteor,jagi/meteor,kengchau/meteor,chasertech/meteor,rabbyalone/meteor,shmiko/meteor,Hansoft/meteor,lpinto93/meteor,4commerce-technologies-AG/meteor,rozzzly/meteor,akintoey/meteor,chengxiaole/meteor,SeanOceanHu/meteor,Jeremy017/meteor,colinligertwood/meteor,TribeMedia/meteor,kengchau/meteor,alexbeletsky/meteor,cbonami/meteor,mirstan/meteor,rabbyalone/meteor,D1no/meteor,arunoda/meteor,kengchau/meteor,cherbst/meteor,aldeed/meteor,aramk/meteor,imanmafi/meteor,shadedprofit/meteor,somallg/meteor,kencheung/meteor,Jeremy017/meteor,TribeMedia/meteor,benstoltz/meteor,lawrenceAIO/meteor,queso/meteor,justintung/meteor,h200863057/meteor,judsonbsilva/meteor,LWHTarena/meteor,AnthonyAstige/meteor,ericterpstra/meteor,Urigo/meteor,brdtrpp/meteor,paul-barry-kenzan/meteor,allanalexandre/meteor,johnthepink/meteor,meteor-velocity/meteor,pjump/meteor,hristaki/meteor,SeanOceanHu/meteor,ndarilek/meteor,dandv/meteor,Hansoft/meteor,chmac/meteor,juansgaitan/meteor,dfischer/meteor,steedos/meteor,yonglehou/meteor,steedos/meteor,chiefninew/meteor,katopz/meteor,ashwathgovind/meteor,colinligertwood/meteor,karlito40/meteor,l0rd0fwar/meteor,LWHTarena/meteor,ndarilek/meteor,colinligertwood/meteor,mubassirhayat/meteor,deanius/meteor,Puena/meteor,ljack/meteor,youprofit/meteor,elkingtonmcb/meteor,EduShareOntario/meteor,youprofit/meteor,youprofit/meteor,imanmafi/meteor,imanmafi/meteor,chiefninew/meteor,JesseQin/meteor,brettle/meteor,shadedprofit/meteor,luohuazju/meteor,esteedqueen/meteor,qscripter/meteor,AlexR1712/meteor,dboyliao/meteor,Ken-Liu/meteor,ndarilek/meteor,Eynaliyev/meteor,johnthepink/meteor,joannekoong/meteor,cbonami/meteor,stevenliuit/meteor,AnjirHossain/meteor,ljack/meteor,rozzzly/meteor,namho102/meteor,Hansoft/meteor,justintung/meteor,ndarilek/meteor,Paulyoufu/meteor-1,Eynaliyev/meteor,chiefninew/meteor,rozzzly/meteor,ericterpstra/meteor,Ken-Liu/meteor,chiefninew/meteor,zdd910/meteor,aleclarson/meteor,baiyunping333/meteor,justintung/meteor,mauricionr/meteor,shadedprofit/meteor,PatrickMcGuinness/meteor,Jeremy017/meteor,jirengu/meteor,qscripter/meteor,D1no/meteor,yanisIk/meteor,Ken-Liu/meteor,GrimDerp/meteor,emmerge/meteor,mauricionr/meteor,deanius/meteor,lpinto93/meteor,AlexR1712/meteor,Jonekee/meteor,lassombra/meteor,newswim/meteor,lawrenceAIO/meteor,D1no/meteor,lawrenceAIO/meteor,daltonrenaldo/meteor,mubassirhayat/meteor,chmac/meteor,mjmasn/meteor,baysao/meteor,HugoRLopes/meteor,codedogfish/meteor,Quicksteve/meteor,yiliaofan/meteor,dboyliao/meteor,aldeed/meteor,LWHTarena/meteor,daltonrenaldo/meteor,modulexcite/meteor,papimomi/meteor,deanius/meteor,papimomi/meteor,AlexR1712/meteor,arunoda/meteor,jdivy/meteor,HugoRLopes/meteor,michielvanoeffelen/meteor,SeanOceanHu/meteor,jagi/meteor,TechplexEngineer/meteor,jagi/meteor,evilemon/meteor,stevenliuit/meteor,JesseQin/meteor,jrudio/meteor,yiliaofan/meteor,Urigo/meteor,tdamsma/meteor,karlito40/meteor,allanalexandre/meteor,papimomi/meteor,eluck/meteor,henrypan/meteor,nuvipannu/meteor,Eynaliyev/meteor,msavin/meteor,framewr/meteor,zdd910/meteor,codingang/meteor,lieuwex/meteor,Jonekee/meteor,chengxiaole/meteor,alphanso/meteor,queso/meteor,D1no/meteor,Eynaliyev/meteor,mjmasn/meteor,neotim/meteor,PatrickMcGuinness/meteor,cbonami/meteor,meonkeys/meteor,yinhe007/meteor,sclausen/meteor,bhargav175/meteor,queso/meteor,oceanzou123/meteor,lieuwex/meteor,jirengu/meteor,aldeed/meteor,pjump/meteor,cbonami/meteor,aramk/meteor,4commerce-technologies-AG/meteor,l0rd0fwar/meteor,oceanzou123/meteor,chengxiaole/meteor,judsonbsilva/meteor,SeanOceanHu/meteor,aramk/meteor,michielvanoeffelen/meteor,dfischer/meteor,Eynaliyev/meteor,fashionsun/meteor,yyx990803/meteor,emmerge/meteor,Jeremy017/meteor,jrudio/meteor,tdamsma/meteor,EduShareOntario/meteor,Eynaliyev/meteor,rabbyalone/meteor,yanisIk/meteor,yanisIk/meteor,ashwathgovind/meteor,juansgaitan/meteor,jenalgit/meteor,ashwathgovind/meteor,IveWong/meteor,brdtrpp/meteor,sunny-g/meteor,jdivy/meteor,karlito40/meteor,stevenliuit/meteor,lieuwex/meteor,skarekrow/meteor,AnthonyAstige/meteor,DCKT/meteor,jirengu/meteor,pandeysoni/meteor,alexbeletsky/meteor,colinligertwood/meteor,katopz/meteor,meonkeys/meteor,luohuazju/meteor,henrypan/meteor,elkingtonmcb/meteor,jenalgit/meteor,hristaki/meteor,saisai/meteor,jg3526/meteor,qscripter/meteor,saisai/meteor,SeanOceanHu/meteor,TribeMedia/meteor,vacjaliu/meteor,rabbyalone/meteor,fashionsun/meteor,DCKT/meteor,paul-barry-kenzan/meteor,Prithvi-A/meteor,yiliaofan/meteor,codedogfish/meteor,somallg/meteor,bhargav175/meteor,dboyliao/meteor,jeblister/meteor,pjump/meteor,allanalexandre/meteor,jeblister/meteor,yonas/meteor-freebsd,framewr/meteor,bhargav175/meteor,vacjaliu/meteor,eluck/meteor,judsonbsilva/meteor,AnjirHossain/meteor,chinasb/meteor,planet-training/meteor,imanmafi/meteor,sunny-g/meteor,kidaa/meteor,servel333/meteor,judsonbsilva/meteor,DCKT/meteor,Prithvi-A/meteor,ashwathgovind/meteor,chmac/meteor,Puena/meteor,katopz/meteor,daslicht/meteor,dandv/meteor,HugoRLopes/meteor,mjmasn/meteor,sdeveloper/meteor,Urigo/meteor,brettle/meteor,sunny-g/meteor,alexbeletsky/meteor,vacjaliu/meteor,yinhe007/meteor,hristaki/meteor,pandeysoni/meteor,esteedqueen/meteor,rabbyalone/meteor,brdtrpp/meteor,IveWong/meteor,planet-training/meteor,kencheung/meteor,h200863057/meteor,wmkcc/meteor,devgrok/meteor,sunny-g/meteor,stevenliuit/meteor,guazipi/meteor,mjmasn/meteor,IveWong/meteor,joannekoong/meteor,ndarilek/meteor,devgrok/meteor,Theviajerock/meteor,mjmasn/meteor,iman-mafi/meteor,deanius/meteor,yonas/meteor-freebsd,newswim/meteor,servel333/meteor,akintoey/meteor,elkingtonmcb/meteor,benstoltz/meteor,lawrenceAIO/meteor,williambr/meteor,planet-training/meteor,calvintychan/meteor,saisai/meteor,namho102/meteor,williambr/meteor,alphanso/meteor,jirengu/meteor,TribeMedia/meteor,rozzzly/meteor,fashionsun/meteor,LWHTarena/meteor,sitexa/meteor,framewr/meteor,cog-64/meteor,jg3526/meteor,namho102/meteor,baiyunping333/meteor,Profab/meteor,HugoRLopes/meteor,vjau/meteor,mjmasn/meteor,cbonami/meteor,SeanOceanHu/meteor,l0rd0fwar/meteor,colinligertwood/meteor,PatrickMcGuinness/meteor,imanmafi/meteor,h200863057/meteor,chasertech/meteor,whip112/meteor,aldeed/meteor,luohuazju/meteor,lieuwex/meteor,johnthepink/meteor,yonglehou/meteor,wmkcc/meteor,TechplexEngineer/meteor,shrop/meteor,EduShareOntario/meteor,Theviajerock/meteor,michielvanoeffelen/meteor,meteor-velocity/meteor,evilemon/meteor,Hansoft/meteor,somallg/meteor,imanmafi/meteor,jrudio/meteor,meteor-velocity/meteor,jdivy/meteor,jdivy/meteor,iman-mafi/meteor,kengchau/meteor,ashwathgovind/meteor,Jeremy017/meteor,zdd910/meteor,chiefninew/meteor,chinasb/meteor,EduShareOntario/meteor,modulexcite/meteor,DAB0mB/meteor,justintung/meteor,dboyliao/meteor,shmiko/meteor,HugoRLopes/meteor,JesseQin/meteor,mirstan/meteor,lassombra/meteor,h200863057/meteor,meonkeys/meteor,juansgaitan/meteor,kidaa/meteor,SeanOceanHu/meteor,l0rd0fwar/meteor,akintoey/meteor,Quicksteve/meteor,tdamsma/meteor,fashionsun/meteor,Hansoft/meteor,nuvipannu/meteor,chasertech/meteor,codingang/meteor,mauricionr/meteor,dandv/meteor,vacjaliu/meteor,hristaki/meteor,emmerge/meteor,rozzzly/meteor,hristaki/meteor,Ken-Liu/meteor,wmkcc/meteor,chmac/meteor,Ken-Liu/meteor,allanalexandre/meteor,udhayam/meteor,henrypan/meteor,shrop/meteor,somallg/meteor,planet-training/meteor,jenalgit/meteor,4commerce-technologies-AG/meteor,codingang/meteor,yiliaofan/meteor,ashwathgovind/meteor,sdeveloper/meteor,kencheung/meteor,lassombra/meteor,jdivy/meteor,chmac/meteor,chinasb/meteor,brdtrpp/meteor,l0rd0fwar/meteor,mubassirhayat/meteor,mauricionr/meteor,somallg/meteor,sclausen/meteor,michielvanoeffelen/meteor,steedos/meteor,cherbst/meteor,TechplexEngineer/meteor,aramk/meteor,tdamsma/meteor,emmerge/meteor,eluck/meteor,4commerce-technologies-AG/meteor,steedos/meteor,iman-mafi/meteor,kidaa/meteor,evilemon/meteor,jagi/meteor,Quicksteve/meteor,sclausen/meteor,yonas/meteor-freebsd,somallg/meteor,Prithvi-A/meteor,stevenliuit/meteor,brettle/meteor,lorensr/meteor,arunoda/meteor,justintung/meteor,yiliaofan/meteor,sitexa/meteor,paul-barry-kenzan/meteor,michielvanoeffelen/meteor,jirengu/meteor,lorensr/meteor,modulexcite/meteor,juansgaitan/meteor,sitexa/meteor,yonglehou/meteor,cherbst/meteor,nuvipannu/meteor,oceanzou123/meteor,cherbst/meteor,meonkeys/meteor,msavin/meteor,DCKT/meteor,alexbeletsky/meteor,benstoltz/meteor,baiyunping333/meteor,sclausen/meteor,whip112/meteor,sdeveloper/meteor,aramk/meteor,DAB0mB/meteor,calvintychan/meteor,TechplexEngineer/meteor,elkingtonmcb/meteor,yinhe007/meteor,zdd910/meteor,sitexa/meteor,codedogfish/meteor,pjump/meteor,kengchau/meteor,GrimDerp/meteor,chiefninew/meteor,deanius/meteor,IveWong/meteor,yonglehou/meteor,mirstan/meteor,cbonami/meteor,brettle/meteor,Paulyoufu/meteor-1,daltonrenaldo/meteor,planet-training/meteor,shadedprofit/meteor,AlexR1712/meteor,elkingtonmcb/meteor,kencheung/meteor,SeanOceanHu/meteor,servel333/meteor,pjump/meteor,tdamsma/meteor,Theviajerock/meteor,emmerge/meteor,ericterpstra/meteor,lorensr/meteor,servel333/meteor,esteedqueen/meteor,yalexx/meteor,h200863057/meteor,guazipi/meteor,fashionsun/meteor,daslicht/meteor,devgrok/meteor,Profab/meteor,elkingtonmcb/meteor,neotim/meteor,yinhe007/meteor,chinasb/meteor,dandv/meteor,Jonekee/meteor,dfischer/meteor,jagi/meteor,katopz/meteor,cog-64/meteor,joannekoong/meteor,ericterpstra/meteor,codedogfish/meteor,h200863057/meteor,lpinto93/meteor,yonas/meteor-freebsd,akintoey/meteor,vacjaliu/meteor,Puena/meteor,dboyliao/meteor,cog-64/meteor,DAB0mB/meteor,jeblister/meteor,wmkcc/meteor,chengxiaole/meteor,servel333/meteor,fashionsun/meteor,Prithvi-A/meteor,wmkcc/meteor,ericterpstra/meteor,alphanso/meteor,h200863057/meteor,yyx990803/meteor,rozzzly/meteor,brdtrpp/meteor,TribeMedia/meteor,chasertech/meteor,colinligertwood/meteor,calvintychan/meteor,alphanso/meteor,yalexx/meteor,lassombra/meteor,cherbst/meteor,AnjirHossain/meteor,DAB0mB/meteor,devgrok/meteor,dboyliao/meteor,nuvipannu/meteor,baiyunping333/meteor,joannekoong/meteor,kidaa/meteor,brdtrpp/meteor,EduShareOntario/meteor,Eynaliyev/meteor,Prithvi-A/meteor,alphanso/meteor,williambr/meteor,williambr/meteor,Ken-Liu/meteor,calvintychan/meteor,mubassirhayat/meteor,daslicht/meteor,iman-mafi/meteor,GrimDerp/meteor,shmiko/meteor,EduShareOntario/meteor,johnthepink/meteor,udhayam/meteor,qscripter/meteor,newswim/meteor,IveWong/meteor,shadedprofit/meteor,brettle/meteor,calvintychan/meteor,lawrenceAIO/meteor,DAB0mB/meteor,pandeysoni/meteor,benjamn/meteor,LWHTarena/meteor,aleclarson/meteor,chmac/meteor,dfischer/meteor,deanius/meteor,4commerce-technologies-AG/meteor,lawrenceAIO/meteor,modulexcite/meteor,dandv/meteor,evilemon/meteor,pjump/meteor,zdd910/meteor,Quicksteve/meteor,PatrickMcGuinness/meteor,brdtrpp/meteor,daslicht/meteor,steedos/meteor,chiefninew/meteor,somallg/meteor,guazipi/meteor,codingang/meteor,daslicht/meteor,planet-training/meteor,dev-bobsong/meteor,juansgaitan/meteor,AlexR1712/meteor,meonkeys/meteor,yyx990803/meteor,AnthonyAstige/meteor,lassombra/meteor,DAB0mB/meteor,akintoey/meteor,rabbyalone/meteor,yanisIk/meteor,codedogfish/meteor,Profab/meteor,chinasb/meteor,newswim/meteor,msavin/meteor,Jonekee/meteor,udhayam/meteor,framewr/meteor,neotim/meteor,modulexcite/meteor,esteedqueen/meteor,sdeveloper/meteor,qscripter/meteor,udhayam/meteor,bhargav175/meteor,jrudio/meteor,AnthonyAstige/meteor,l0rd0fwar/meteor,jagi/meteor,skarekrow/meteor,saisai/meteor,meteor-velocity/meteor,kidaa/meteor,youprofit/meteor,arunoda/meteor,iman-mafi/meteor,shrop/meteor,newswim/meteor,lawrenceAIO/meteor,stevenliuit/meteor,D1no/meteor,daslicht/meteor,DAB0mB/meteor,Hansoft/meteor,henrypan/meteor,vacjaliu/meteor,framewr/meteor,neotim/meteor,sunny-g/meteor,jenalgit/meteor,shrop/meteor,yonglehou/meteor,Profab/meteor,elkingtonmcb/meteor,servel333/meteor,benjamn/meteor,tdamsma/meteor,alexbeletsky/meteor,michielvanoeffelen/meteor,ndarilek/meteor,luohuazju/meteor,kencheung/meteor,AnthonyAstige/meteor,jirengu/meteor
--- +++ @@ -38,6 +38,6 @@ loginUrl: loginUrl, credentialRequestCompleteCallback: credentialRequestCompleteCallback, credentialToken: credentialToken, - popupOptons: {width: 900, height: 450} + popupOptions: {width: 900, height: 450} }); };
a0f8a7bcc765f8fb07a2760a09307faf39404aca
lib/adapter.js
lib/adapter.js
/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://cksource.com/ckfinder/license */ ( function( window, bender ) { 'use strict'; var unlock = bender.defer(), originalRequire = window.require; // TODO what if require is never called? bender.require = function( deps, callback ) { originalRequire( deps, function() { callback.apply( null, arguments ); unlock(); } ); }; } )( this, bender );
/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://cksource.com/ckfinder/license */ ( function( window, bender ) { 'use strict'; bender.require = function( deps, callback ) { var unlock = bender.defer(); window.require( deps, function() { callback.apply( null, arguments ); unlock(); } ); }; } )( this, bender );
Move bender.defer() inside the require call.
Move bender.defer() inside the require call.
JavaScript
mit
benderjs/benderjs-amd
--- +++ @@ -6,12 +6,10 @@ ( function( window, bender ) { 'use strict'; - var unlock = bender.defer(), - originalRequire = window.require; + bender.require = function( deps, callback ) { + var unlock = bender.defer(); - // TODO what if require is never called? - bender.require = function( deps, callback ) { - originalRequire( deps, function() { + window.require( deps, function() { callback.apply( null, arguments ); unlock(); } );
1057855e5c60e281e8c2450d4ac5560c385da771
package.js
package.js
Package.describe({ name: 'verody:groupaccount', version: '0.1.0', summary: 'Account management package providing qualified access to a single Meteor server account from one or more sets of credentials.', git: 'https://github.com/ekobi/meteor-groupaccount.git', documentation: 'README.md' }); Package.onUse(function(api) { api.use('npm-bcrypt@=0.7.8_2'); api.use([ 'accounts-base', 'ecmascript', 'sha', 'ejson', 'ddp', 'check', 'underscore' ], ['client', 'server']); api.versionsFrom('1.2.1'); api.imply ('accounts-base'); api.addFiles(['groupaccount.js']); api.export('GroupAccounts'); }); Package.onTest(function(api) { api.use(['tinytest', 'random']); api.use(['accounts-base', 'verody:groupaccount', 'sha']); api.addFiles('groupaccount-tests.js'); });
Package.describe({ name: 'verody:groupaccount', version: '0.1.0', summary: 'Provides qualified access to a single Meteor user account from one or more sets of credentials.', git: 'https://github.com/ekobi/meteor-groupaccount.git', documentation: 'README.md' }); Package.onUse(function(api) { api.use('npm-bcrypt@=0.7.8_2'); api.use([ 'accounts-base', 'ecmascript', 'sha', 'ejson', 'ddp', 'check', 'underscore' ], ['client', 'server']); api.versionsFrom('1.2.1'); api.imply ('accounts-base'); api.addFiles(['groupaccount.js']); api.export('GroupAccounts'); }); Package.onTest(function(api) { api.use(['tinytest', 'random']); api.use(['accounts-base', 'verody:groupaccount', 'sha']); api.addFiles('groupaccount-tests.js'); });
Trim summary to fit 100 character limit.
Trim summary to fit 100 character limit.
JavaScript
mit
ekobi/meteor-groupaccount,ekobi/meteor-groupaccount,ekobi/meteor-groupaccount
--- +++ @@ -1,7 +1,7 @@ Package.describe({ name: 'verody:groupaccount', version: '0.1.0', - summary: 'Account management package providing qualified access to a single Meteor server account from one or more sets of credentials.', + summary: 'Provides qualified access to a single Meteor user account from one or more sets of credentials.', git: 'https://github.com/ekobi/meteor-groupaccount.git', documentation: 'README.md' });
5010579e063b1534d77638b08e6f61646d6969c8
tasks/ember-handlebars.js
tasks/ember-handlebars.js
/* * grunt-ember-handlebars * https://github.com/yaymukund/grunt-ember-handlebars * * Copyright (c) 2012 Mukund Lakshman * Licensed under the MIT license. * * A grunt task that precompiles Ember.js Handlebars templates into * separate .js files of the same name. This script expects the * following setup: * * tasks/ * ember-templates.js * lib/ * headless-ember.js * ember.js * * headless-ember and ember.js can both be found in the main Ember repo: * https://github.com/emberjs/ember.js/tree/master/lib */ var precompiler = require('./lib/precompiler'), path = require('path'); module.exports = function(grunt) { grunt.registerMultiTask('ember_handlebars', 'Precompile Ember Handlebars templates', function() { // Precompile each file and write it to the output directory. grunt.util._.forEach(this.file.src.map(path.resolve), function(file) { grunt.log.write('Precompiling "' + file + '" to "' + this.dest + '"\n'); var compiled = precompiler.precompile(file); out = path.join(this.dest, compiled.filename); grunt.file.write(out, compiled.src, 'utf8'); }, {dest: this.file.dest}); }); };
/* * grunt-ember-handlebars * https://github.com/yaymukund/grunt-ember-handlebars * * Copyright (c) 2012 Mukund Lakshman * Licensed under the MIT license. * * A grunt task that precompiles Ember.js Handlebars templates into * separate .js files of the same name. This script expects the * following setup: * * tasks/ * ember-templates.js * lib/ * headless-ember.js * ember.js * * headless-ember and ember.js can both be found in the main Ember repo: * https://github.com/emberjs/ember.js/tree/master/lib */ var precompiler = require('./lib/precompiler'), path = require('path'); module.exports = function(grunt) { grunt.registerMultiTask('ember_handlebars', 'Precompile Ember Handlebars templates', function() { // Precompile each file and write it to the output directory. grunt.util._.forEach(this.filesSrc.map(path.resolve), function(file) { grunt.log.write('Precompiling "' + file + '" to "' + this.dest + '"\n'); var compiled = precompiler.precompile(file); out = path.join(this.dest, compiled.filename); grunt.file.write(out, compiled.src, 'utf8'); }, {dest: this.file.dest}); }); };
Change file.src to filesSrc for grunt 0.4.0rc5.
Change file.src to filesSrc for grunt 0.4.0rc5. See https://github.com/gruntjs/grunt/issues/606
JavaScript
mit
yaymukund/grunt-ember-handlebars,gooddata/grunt-ember-handlebars,gooddata/grunt-ember-handlebars
--- +++ @@ -26,7 +26,7 @@ grunt.registerMultiTask('ember_handlebars', 'Precompile Ember Handlebars templates', function() { // Precompile each file and write it to the output directory. - grunt.util._.forEach(this.file.src.map(path.resolve), function(file) { + grunt.util._.forEach(this.filesSrc.map(path.resolve), function(file) { grunt.log.write('Precompiling "' + file + '" to "' + this.dest + '"\n'); var compiled = precompiler.precompile(file);
fe3cf35e9c1ba40fe92e0b018bfa55026b6a786d
util/install-bundle.js
util/install-bundle.js
'use strict'; const fs = require('fs'); const cp = require('child_process'); const os = require('os'); const commander = require('commander'); const parse = require('git-url-parse'); const gitRoot = cp.execSync('git rev-parse --show-toplevel').toString('utf8').trim(); process.chdir(gitRoot); commander.command('install-bundle <remote url>'); commander.parse(process.argv); if (commander.args.length < 1) { console.error(`Syntax: ${process.argv0} <remote url>`); process.exit(0); } const [remote] = commander.args; if (fs.existsSync(gitRoot + `/bundles/${remote}`)) { console.error('Bundle already installed'); process.exit(0); } try { cp.execSync(`git ls-remote ${remote}`); } catch (err) { process.exit(0); } const { name } = parse(remote); console.log("Adding bundle..."); cp.execSync(`git submodule add ${remote} bundles/${name}`); console.log("Installing deps...") if (fs.existsSync(`${gitRoot}/bundles/${name}/package.json`)) { const npmCmd = os.platform().startsWith('win') ? 'npm.cmd' : 'npm'; cp.spawnSync(npmCmd, ['install', '--no-audit'], { cwd: `${gitRoot}/bundles/${name}` }); } console.log("Bundle installed. Commit the bundle with `git commit -m \"Added ${name} bundle\"`");
'use strict'; const fs = require('fs'); const cp = require('child_process'); const os = require('os'); const commander = require('commander'); const parse = require('git-url-parse'); const gitRoot = cp.execSync('git rev-parse --show-toplevel').toString('utf8').trim(); process.chdir(gitRoot); commander.command('install-bundle <remote url>'); commander.parse(process.argv); if (commander.args.length < 1) { console.error(`Syntax: ${process.argv0} <remote url>`); process.exit(0); } const [remote] = commander.args; if (fs.existsSync(gitRoot + `/bundles/${remote}`)) { console.error('Bundle already installed'); process.exit(0); } try { cp.execSync(`git ls-remote ${remote}`); } catch (err) { process.exit(0); } const { name } = parse(remote); console.log("Adding bundle..."); cp.execSync(`git submodule add ${remote} bundles/${name}`); console.log("Installing deps...") if (fs.existsSync(`${gitRoot}/bundles/${name}/package.json`)) { const npmCmd = os.platform().startsWith('win') ? 'npm.cmd' : 'npm'; cp.spawnSync(npmCmd, ['install', '--no-audit'], { cwd: `${gitRoot}/bundles/${name}` }); } console.log(`Bundle installed. Commit the bundle with: git commit -m \"Added ${name} bundle\"");
Fix typo in install bundle script
Fix typo in install bundle script
JavaScript
mit
shawncplus/ranviermud
--- +++ @@ -43,4 +43,4 @@ }); } -console.log("Bundle installed. Commit the bundle with `git commit -m \"Added ${name} bundle\"`"); +console.log(`Bundle installed. Commit the bundle with: git commit -m \"Added ${name} bundle\"");
3e968acae5397d7b33d409fc0c26da610c1ba9b0
Resources/js/InjectCSS.js
Resources/js/InjectCSS.js
document.documentElement.style.webkitTouchCallout='none'; var root = document.getElementsByTagName( 'html' )[0] root.setAttribute( 'class', 'hybrid' ); var styleElement = document.createElement('style'); root.appendChild(styleElement); styleElement.textContent = '${CSS}';
document.documentElement.style.webkitTouchCallout='none'; var root = document.getElementsByTagName( 'html' )[0] root.setAttribute( 'class', 'neeman-hybrid-app' ); var styleElement = document.createElement('style'); root.appendChild(styleElement); styleElement.textContent = '${CSS}';
Switch HTML tag to one less likely to be used by another library.
Switch HTML tag to one less likely to be used by another library.
JavaScript
mit
intellum/neeman,intellum/neeman,intellum/neeman,intellum/neeman
--- +++ @@ -1,7 +1,7 @@ document.documentElement.style.webkitTouchCallout='none'; var root = document.getElementsByTagName( 'html' )[0] -root.setAttribute( 'class', 'hybrid' ); +root.setAttribute( 'class', 'neeman-hybrid-app' ); var styleElement = document.createElement('style'); root.appendChild(styleElement);
cfe506bf86d27cf1c1c9677adf7902e3c003dfe7
lib/webhook.js
lib/webhook.js
/* * Copyright (c) 2014-2020 Bjoern Kimminich. * SPDX-License-Identifier: MIT */ const request = require('request') const colors = require('colors/safe') const logger = require('../lib/logger') const utils = require('../lib/utils') const os = require('os') exports.notify = (challenge) => { request.post(process.env.SOLUTIONS_WEBHOOK, { json: { solution: { issuer: `owasp_juiceshop-${utils.version()}@${os.hostname()}`, challenge: challenge.key, evidence: null, issuedOn: new Date().toISOString() } } }, (error, res) => { if (error) { console.error(error) return } logger.info(`Webhook ${colors.bold(process.env.SOLUTIONS_WEBHOOK)} notified about ${colors.cyan(challenge.key)} being solved: ${res.statusCode < 400 ? colors.green(res.statusCode) : colors.red(res.statusCode)}`) }) }
/* * Copyright (c) 2014-2020 Bjoern Kimminich. * SPDX-License-Identifier: MIT */ const request = require('request') const colors = require('colors/safe') const logger = require('../lib/logger') const utils = require('../lib/utils') const os = require('os') exports.notify = (challenge) => { request.post(process.env.SOLUTIONS_WEBHOOK, { json: { solution: { challenge: challenge.key, evidence: null, issuedOn: new Date().toISOString() }, issuer: `owasp_juiceshop-${utils.version()}@${os.hostname()}` } }, (error, res) => { if (error) { console.error(error) return } logger.info(`Webhook ${colors.bold(process.env.SOLUTIONS_WEBHOOK)} notified about ${colors.cyan(challenge.key)} being solved: ${res.statusCode < 400 ? colors.green(res.statusCode) : colors.red(res.statusCode)}`) }) }
Move additional field "issuer" out of the "solution" object
Move additional field "issuer" out of the "solution" object
JavaScript
mit
bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop
--- +++ @@ -14,11 +14,11 @@ json: { solution: { - issuer: `owasp_juiceshop-${utils.version()}@${os.hostname()}`, challenge: challenge.key, evidence: null, issuedOn: new Date().toISOString() - } + }, + issuer: `owasp_juiceshop-${utils.version()}@${os.hostname()}` } }, (error, res) => { if (error) {
84a3c8c53f6e5c307aacceb91b7caaec7829bb95
src/webapp/api/scripts/importers/exhibit-json-importer.js
src/webapp/api/scripts/importers/exhibit-json-importer.js
/*================================================== * Exhibit.ExhibitJSONImporter *================================================== */ Exhibit.ExhibitJSONImporter = { }; Exhibit.importers["application/json"] = Exhibit.ExhibitJSONImporter; Exhibit.ExhibitJSONImporter.load = function(link, database, cont) { var url = Exhibit.Persistence.resolveURL(link.href); var fError = function(statusText, status, xmlhttp) { Exhibit.UI.hideBusyIndicator(); Exhibit.UI.showHelp(Exhibit.l10n.failedToLoadDataFileMessage(url)); if (cont) cont(); }; var fDone = function(xmlhttp) { Exhibit.UI.hideBusyIndicator(); try { var o = null; try { o = eval("(" + xmlhttp.responseText + ")"); } catch (e) { Exhibit.UI.showJsonFileValidation(Exhibit.l10n.badJsonMessage(url, e), url); } if (o != null) { database.loadData(o, Exhibit.Persistence.getBaseURL(url)); } } catch (e) { SimileAjax.Debug.exception("Error loading Exhibit JSON data from " + url, e); } finally { if (cont) cont(); } }; Exhibit.UI.showBusyIndicator(); SimileAjax.XmlHttp.get(url, fError, fDone); };
/*================================================== * Exhibit.ExhibitJSONImporter *================================================== */ Exhibit.ExhibitJSONImporter = { }; Exhibit.importers["application/json"] = Exhibit.ExhibitJSONImporter; Exhibit.ExhibitJSONImporter.load = function(link, database, cont) { var url = typeof link == "string" ? link : link.href; url = Exhibit.Persistence.resolveURL(url); var fError = function(statusText, status, xmlhttp) { Exhibit.UI.hideBusyIndicator(); Exhibit.UI.showHelp(Exhibit.l10n.failedToLoadDataFileMessage(url)); if (cont) cont(); }; var fDone = function(xmlhttp) { Exhibit.UI.hideBusyIndicator(); try { var o = null; try { o = eval("(" + xmlhttp.responseText + ")"); } catch (e) { Exhibit.UI.showJsonFileValidation(Exhibit.l10n.badJsonMessage(url, e), url); } if (o != null) { database.loadData(o, Exhibit.Persistence.getBaseURL(url)); } } catch (e) { SimileAjax.Debug.exception("Error loading Exhibit JSON data from " + url, e); } finally { if (cont) cont(); } }; Exhibit.UI.showBusyIndicator(); SimileAjax.XmlHttp.get(url, fError, fDone); };
Allow either a string (a (relative) url) or <link href> object passed to the exhibit json importer.
Allow either a string (a (relative) url) or <link href> object passed to the exhibit json importer.
JavaScript
bsd-3-clause
zepheira/exhibit,zepheira/exhibit,zepheira/exhibit,zepheira/exhibit,zepheira/exhibit,zepheira/exhibit
--- +++ @@ -8,7 +8,8 @@ Exhibit.importers["application/json"] = Exhibit.ExhibitJSONImporter; Exhibit.ExhibitJSONImporter.load = function(link, database, cont) { - var url = Exhibit.Persistence.resolveURL(link.href); + var url = typeof link == "string" ? link : link.href; + url = Exhibit.Persistence.resolveURL(url); var fError = function(statusText, status, xmlhttp) { Exhibit.UI.hideBusyIndicator();
54b35d592d3d2c7e9c4357acc2c3cdc3a3c5478f
src/client/blog/posts/posts-service.js
src/client/blog/posts/posts-service.js
BlogPostsFactory.$inject = ['$resource']; function BlogPostsFactory($resource){ return $resource('/api/v1/posts/:postId'); } angular.module('blog.posts.service', [ 'ngResource' ]).factory('Posts', BlogPostsFactory);
BlogPostsFactory.$inject = ['$resource']; function BlogPostsFactory($resource){ return $resource('/api/v1/posts/:postId', {postId: '@id'}); } angular.module('blog.posts.service', [ 'ngResource' ]).factory('Posts', BlogPostsFactory);
Allow saving with the posts.
Allow saving with the posts.
JavaScript
isc
RupertJS/rupert-example-blog,RupertJS/rupert-example-blog
--- +++ @@ -1,6 +1,6 @@ BlogPostsFactory.$inject = ['$resource']; function BlogPostsFactory($resource){ - return $resource('/api/v1/posts/:postId'); + return $resource('/api/v1/posts/:postId', {postId: '@id'}); } angular.module('blog.posts.service', [
ff4ac1f418508c005d5afa713027af33dcf29ff1
test/helper.js
test/helper.js
var nock = require('nock') , io = require('../index'); var helper = exports; // // Define the default options // var default_options = helper.default_options = { endpoint: 'https://api.orchestrate.io', api: 'v0' }; // // Create a new fake server // helper.fakeIo = require('./support/fake-io').createServer(default_options); helper.io = io;
/* * helper.js * */ var io = require('../index'); var helper = exports; var default_options = helper.default_options = { endpoint: 'https://api.orchestrate.io', api: 'v0' }; // // Create a new fake server // helper.fakeIo = require('./support/fake-io').createServer(default_options); helper.io = io;
Stop to require a useless module
Stop to require a useless module
JavaScript
mit
giraffi/node-orchestrate.io
--- +++ @@ -1,11 +1,10 @@ -var nock = require('nock') - , io = require('../index'); +/* + * helper.js + * + */ +var io = require('../index'); var helper = exports; - -// -// Define the default options -// var default_options = helper.default_options = { endpoint: 'https://api.orchestrate.io', api: 'v0'
ef35f61e3d19f4afefdf31343434d475a8a0e80f
test/tests/integration/endpoints/facebook-connect-test.js
test/tests/integration/endpoints/facebook-connect-test.js
var torii, container; import buildFBMock from 'test/helpers/build-fb-mock'; import toriiContainer from 'test/helpers/torii-container'; import configuration from 'torii/configuration'; var originalConfiguration = configuration.endpoints['facebook-connect'], originalGetScript = $.getScript, originalFB = window.FB; module('Facebook Connect - Integration', { setup: function(){ container = toriiContainer(); torii = container.lookup('torii:main'); configuration.endpoints['facebook-connect'] = {apiKey: 'dummy'}; window.FB = buildFBMock(); }, teardown: function(){ window.FB = originalFB; configuration.endpoints['facebook-connect'] = originalConfiguration; $.getScript = originalGetScript; Ember.run(container, 'destroy'); } }); test("Opens facebook connect session", function(){ $.getScript = function(){ window.fbAsyncInit(); } Ember.run(function(){ torii.open('facebook-connect').then(function(){ ok(true, "Facebook connect opened"); }, function(){ ok(false, "Facebook connect failed to open"); }); }); });
var torii, container; import buildFBMock from 'test/helpers/build-fb-mock'; import toriiContainer from 'test/helpers/torii-container'; import configuration from 'torii/configuration'; var originalConfiguration = configuration.endpoints['facebook-connect'], originalGetScript = $.getScript, originalFB = window.FB; module('Facebook Connect - Integration', { setup: function(){ container = toriiContainer(); torii = container.lookup('torii:main'); configuration.endpoints['facebook-connect'] = {appId: 'dummy'}; window.FB = buildFBMock(); }, teardown: function(){ window.FB = originalFB; configuration.endpoints['facebook-connect'] = originalConfiguration; $.getScript = originalGetScript; Ember.run(container, 'destroy'); } }); test("Opens facebook connect session", function(){ $.getScript = function(){ window.fbAsyncInit(); } Ember.run(function(){ torii.open('facebook-connect').then(function(){ ok(true, "Facebook connect opened"); }, function(){ ok(false, "Facebook connect failed to open"); }); }); });
Use appId instead of apiKey
Use appId instead of apiKey
JavaScript
mit
Vestorly/torii,cjroebuck/torii,cibernox/torii,garno/torii,anilmaurya/torii,cjroebuck/torii,Vestorly/ember-tron,image-tester/torii,bantic/torii,rwjblue/torii,raycohen/torii,embersherpa/torii,gnagel/torii,garno/torii,rancher/torii,embersherpa/torii,abulrim/torii,curit/torii,gannetson/torii,anilmaurya/torii,greyhwndz/torii,rwjblue/torii,jagthedrummer/torii,jdurand/torii,djgraham/torii,jagthedrummer/torii,mwpastore/torii,Gast/torii,Gast/torii,djgraham/torii,cibernox/torii,Vestorly/torii,raycohen/torii,greyhwndz/torii,jdurand/torii,bantic/torii,gnagel/torii,abulrim/torii,gannetson/torii,bmeyers22/torii,bmeyers22/torii,mwpastore/torii,curit/torii
--- +++ @@ -12,7 +12,7 @@ setup: function(){ container = toriiContainer(); torii = container.lookup('torii:main'); - configuration.endpoints['facebook-connect'] = {apiKey: 'dummy'}; + configuration.endpoints['facebook-connect'] = {appId: 'dummy'}; window.FB = buildFBMock(); }, teardown: function(){
3d0972cc6f42359bc3a94254c808a1a6e34517a9
src/custom/cappasity-users-activate.js
src/custom/cappasity-users-activate.js
const ld = require('lodash'); const moment = require('moment'); const setMetadata = require('../utils/updateMetadata.js'); /** * Adds metadata from billing into usermix * @param {String} username * @return {Promise} */ module.exports = function mixPlan(username, audience) { const { amqp, config } = this; const { payments } = config; const route = [payments.prefix, payments.routes.planGet].join('.'); const id = 'free'; return amqp .publishAndWait(route, id, { timeout: 5000 }) .bind(this) .then(function mix(plan) { const subscription = ld.findWhere(plan.subs, { name: id }); const nextCycle = moment().add(1, 'month').format(); const update = { username, audience, metadata: { '$set': { plan: id, nextCycle, models: subscription.models, modelPrice: subscription.price, }, }, }; return setMetadata.call(this, update); }); };
const Promise = require('bluebird'); const ld = require('lodash'); const moment = require('moment'); const setMetadata = require('../utils/updateMetadata.js'); /** * Adds metadata from billing into usermix * @param {String} username * @return {Promise} */ module.exports = function mixPlan(username, audience) { const { amqp, config } = this; const { payments } = config; const route = [payments.prefix, payments.routes.planGet].join('.'); const id = 'free'; // make sure that ms-payments is launched before return Promise .delay(10000) .then(() => { return amqp .publishAndWait(route, id, { timeout: 5000 }) .bind(this) .then(function mix(plan) { const subscription = ld.findWhere(plan.subs, { name: id }); const nextCycle = moment().add(1, 'month').format(); const update = { username, audience, metadata: { '$set': { plan: id, nextCycle, models: subscription.models, modelPrice: subscription.price, }, }, }; return setMetadata.call(this, update); }); }); };
Add sleep in custom action
Add sleep in custom action
JavaScript
mit
makeomatic/ms-users,makeomatic/ms-users
--- +++ @@ -1,3 +1,4 @@ +const Promise = require('bluebird'); const ld = require('lodash'); const moment = require('moment'); const setMetadata = require('../utils/updateMetadata.js'); @@ -13,25 +14,30 @@ const route = [payments.prefix, payments.routes.planGet].join('.'); const id = 'free'; - return amqp - .publishAndWait(route, id, { timeout: 5000 }) - .bind(this) - .then(function mix(plan) { - const subscription = ld.findWhere(plan.subs, { name: id }); - const nextCycle = moment().add(1, 'month').format(); - const update = { - username, - audience, - metadata: { - '$set': { - plan: id, - nextCycle, - models: subscription.models, - modelPrice: subscription.price, + // make sure that ms-payments is launched before + return Promise + .delay(10000) + .then(() => { + return amqp + .publishAndWait(route, id, { timeout: 5000 }) + .bind(this) + .then(function mix(plan) { + const subscription = ld.findWhere(plan.subs, { name: id }); + const nextCycle = moment().add(1, 'month').format(); + const update = { + username, + audience, + metadata: { + '$set': { + plan: id, + nextCycle, + models: subscription.models, + modelPrice: subscription.price, + }, }, - }, - }; + }; - return setMetadata.call(this, update); + return setMetadata.call(this, update); + }); }); };
b14b34b232b4873137ea3f3c7a90f86b9013885a
Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js
Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow strict-local */ import '../Core/InitializeCore';
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow strict-local */ // TODO: Remove this module when the import is removed from the React renderers. // This module is used by React to initialize the React Native runtime, // but it is now a no-op. // This is redundant because all React Native apps are already executing // `InitializeCore` before the entrypoint of the JS bundle // (see https://github.com/react-native-community/cli/blob/e1da64317a1178c2b262d82c2f14210cdfa3ebe1/packages/cli-plugin-metro/src/tools/loadMetroConfig.ts#L93) // and importing it unconditionally from React only prevents users from // customizing what they want to include in their apps (re: app size).
Make runtime initialization from React renderers a no-op
Make runtime initialization from React renderers a no-op Summary: This module is imported by all flavors of the React Native renderers (dev/prod, Fabric/Paper, etc.), which itself imports `InitializeCore`. This is effectively a no-op in most React Native apps because Metro adds it as a module to execute before the entrypoint of the bundle. This import would be harmless if all React Native apps included all polyfills and globals, but some of them don't want to include everything and instead of importing `InitializeCore` they import individual setup functions (like `setupXhr`). Having this automatic import in the renderer defeats that purpose (most importantly for app size), so we should remove it. The main motivation for this change is to increase the number (and spec-compliance) of Web APIs that are supported out of the box without adding that cost to apps that choose not to use some of them (see https://github.com/facebook/react-native/pull/30188#issuecomment-929352747). Changelog: [General][Removed] Breaking: Removed initialization of React Native polyfills and global variables from React renderers. Note: this will only be a breaking change for apps not using the React Native CLI, Expo nor have a Metro configuration that executes `InitializeCore` automatically before the bundle EntryPoint. Reviewed By: yungsters Differential Revision: D31472153 fbshipit-source-id: 92eb113c83f77dbe414869fbce152a22f3617dcb
JavaScript
mit
javache/react-native,javache/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,javache/react-native,janicduplessis/react-native,javache/react-native,facebook/react-native,facebook/react-native,facebook/react-native,javache/react-native,janicduplessis/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,javache/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native
--- +++ @@ -8,4 +8,13 @@ * @flow strict-local */ -import '../Core/InitializeCore'; +// TODO: Remove this module when the import is removed from the React renderers. + +// This module is used by React to initialize the React Native runtime, +// but it is now a no-op. + +// This is redundant because all React Native apps are already executing +// `InitializeCore` before the entrypoint of the JS bundle +// (see https://github.com/react-native-community/cli/blob/e1da64317a1178c2b262d82c2f14210cdfa3ebe1/packages/cli-plugin-metro/src/tools/loadMetroConfig.ts#L93) +// and importing it unconditionally from React only prevents users from +// customizing what they want to include in their apps (re: app size).
dfb9b5b2b45d76a463af38eb6362922bf6ea9f9e
rikitrakiws.js
rikitrakiws.js
var log4js = require('log4js'); var logger = log4js.getLogger(); var express = require('express'); var favicon = require('serve-favicon'); var bodyParser = require('body-parser'); var port = process.env.OPENSHIFT_NODEJS_PORT || 3000; var ipaddress = process.env.OPENSHIFT_NODEJS_IP; var loglevel = process.env.LOGLEVEL || 'DEBUG'; var app = express(); app.use(favicon(__dirname + '/public/favicon.ico')); logger.setLevel(loglevel); app.use(express.static('public')); app.use(log4js.connectLogger(log4js.getLogger('http'), { level: 'auto' })); app.use(bodyParser.json({limit: '5mb'})); app.use(bodyParser.raw({limit: '10mb', type: 'image/jpeg'})); app.use('/api/', require('./routes/').router); app.use(function (req, res, next) { res.removeHeader("WWW-Authenticate"); next(); }); /* app.use(function(error, req, res, next) { if (error) { logger.error('InvalidInput', error.message); res.status(error.status).send({error: 'InvalidInput', description: error.message}); } else { next(); } }); */ app.listen(port, ipaddress, function () { logger.info('starting rikitrakiws', this.address()); });
var log4js = require('log4js'); var logger = log4js.getLogger(); var express = require('express'); var favicon = require('serve-favicon'); var bodyParser = require('body-parser'); var port = process.env.OPENSHIFT_NODEJS_PORT || 3000; var ipaddress = process.env.OPENSHIFT_NODEJS_IP; var loglevel = process.env.LOGLEVEL || 'DEBUG'; var app = express(); app.use(favicon(__dirname + '/public/favicon.ico')); logger.setLevel(loglevel); app.use(express.static('public')); app.use(log4js.connectLogger(log4js.getLogger('http'), { level: 'auto' })); app.use(bodyParser.json({limit: '5mb'})); app.use(bodyParser.raw({limit: '10mb', type: 'image/jpeg'})); app.use(function (req, res, next) { res.removeHeader("WWW-Authenticate"); next(); }); app.use('/api/', require('./routes/').router); /* app.use(function(error, req, res, next) { if (error) { logger.error('InvalidInput', error.message); res.status(error.status).send({error: 'InvalidInput', description: error.message}); } else { next(); } }); */ app.listen(port, ipaddress, function () { logger.info('starting rikitrakiws', this.address()); });
Drop header to avoid auth browser popup
Drop header to avoid auth browser popup
JavaScript
mit
jimmyangel/rikitrakiws,jimmyangel/rikitrakiws
--- +++ @@ -17,13 +17,12 @@ app.use(bodyParser.json({limit: '5mb'})); app.use(bodyParser.raw({limit: '10mb', type: 'image/jpeg'})); - -app.use('/api/', require('./routes/').router); - app.use(function (req, res, next) { res.removeHeader("WWW-Authenticate"); next(); }); + +app.use('/api/', require('./routes/').router); /* app.use(function(error, req, res, next) { if (error) {
e4b7c59821ba71bb49c212e65bc23da3eeaa26a6
app/config.js
app/config.js
var mapboxDataTeam = require('mapbox-data-team'); const config = { 'API_BASE': 'https://api-osm-comments-staging.tilestream.net/api/v1/', 'MAPBOX_ACCESS_TOKEN': 'pk.eyJ1Ijoic2FuamF5YiIsImEiOiI3NjVvMFY0In0.byn_eCZGAwR1yaPeC-SVKw', 'OSM_BASE': 'https://www.openstreetmap.org/', 'STATIC_MAPS_BASE': 'https://api.mapbox.com/v4/mapbox.streets/', 'USERS': mapboxDataTeam.getUsernames() }; export default config;
var mapboxDataTeam = require('mapbox-data-team'); const config = { 'API_BASE': 'https://api-osm-comments-production.tilestream.net/api/v1/', 'MAPBOX_ACCESS_TOKEN': 'pk.eyJ1Ijoic2FuamF5YiIsImEiOiI3NjVvMFY0In0.byn_eCZGAwR1yaPeC-SVKw', 'OSM_BASE': 'https://www.openstreetmap.org/', 'STATIC_MAPS_BASE': 'https://api.mapbox.com/v4/mapbox.streets/', 'USERS': mapboxDataTeam.getUsernames() }; export default config;
Switch to the production endpoint
Switch to the production endpoint
JavaScript
bsd-2-clause
mapbox/osm-comments,mapbox/osm-comments
--- +++ @@ -1,7 +1,7 @@ var mapboxDataTeam = require('mapbox-data-team'); const config = { - 'API_BASE': 'https://api-osm-comments-staging.tilestream.net/api/v1/', + 'API_BASE': 'https://api-osm-comments-production.tilestream.net/api/v1/', 'MAPBOX_ACCESS_TOKEN': 'pk.eyJ1Ijoic2FuamF5YiIsImEiOiI3NjVvMFY0In0.byn_eCZGAwR1yaPeC-SVKw', 'OSM_BASE': 'https://www.openstreetmap.org/', 'STATIC_MAPS_BASE': 'https://api.mapbox.com/v4/mapbox.streets/',
81d56eb96900ee77e31bd3cfc09751084f076c57
src/containers/toputilizers/components/TopUtilizersForm.js
src/containers/toputilizers/components/TopUtilizersForm.js
import React from 'react'; import PropTypes from 'prop-types'; import { Button } from 'react-bootstrap'; import FontAwesome from 'react-fontawesome'; import ContentContainer from '../../../components/applayout/ContentContainer'; import TopUtilizersSelectionRowContainer from '../containers/TopUtilizersSelectionRowContainer'; import styles from '../styles.module.css'; const getChildren = (rowData) => { return rowData.map((row) => { return <TopUtilizersSelectionRowContainer id={row.id} />; }); }; const TopUtilizersForm = ({ handleClick, rowData, onSubmit }) => { return ( <ContentContainer> <form className={styles.formWrapper} onSubmit={onSubmit}> <div className={styles.labelsRow}> Select search parameters </div> <div className={styles.rowsWrapper}> {getChildren(rowData)} </div> <div className={styles.addLink}> <a href="#" className={styles.addLink} onClick={handleClick}> <FontAwesome className={styles.plusIcon} name="plus" />Add search parameter </a> </div> <div className={styles.buttonWrapper}> <Button type="submit" className={styles.submitButton}>Find top utilizers</Button> </div> </form> </ContentContainer> ); }; TopUtilizersForm.propTypes = { handleClick: PropTypes.func.isRequired, rowData: PropTypes.array.isRequired, onSubmit: PropTypes.func.isRequired }; export default TopUtilizersForm;
import React from 'react'; import PropTypes from 'prop-types'; import { Button } from 'react-bootstrap'; import FontAwesome from 'react-fontawesome'; import ContentContainer from '../../../components/applayout/ContentContainer'; import TopUtilizersSelectionRowContainer from '../containers/TopUtilizersSelectionRowContainer'; import styles from '../styles.module.css'; const getChildren = (rowData) => { return rowData.map((row) => { return <TopUtilizersSelectionRowContainer key={row.id} />; }); }; const TopUtilizersForm = ({ handleClick, rowData, onSubmit }) => { return ( <ContentContainer> <form className={styles.formWrapper} onSubmit={onSubmit}> <div className={styles.labelsRow}> Select search parameters </div> <div className={styles.rowsWrapper}> {getChildren(rowData)} </div> <div className={styles.addLink}> <a href="#" className={styles.addLink} onClick={handleClick}> <FontAwesome className={styles.plusIcon} name="plus" />Add search parameter </a> </div> <div className={styles.buttonWrapper}> <Button type="submit" className={styles.submitButton}>Find top utilizers</Button> </div> </form> </ContentContainer> ); }; TopUtilizersForm.propTypes = { handleClick: PropTypes.func.isRequired, rowData: PropTypes.array.isRequired, onSubmit: PropTypes.func.isRequired }; export default TopUtilizersForm;
Add key to selection rows
Add key to selection rows
JavaScript
apache-2.0
dataloom/gallery,kryptnostic/gallery,dataloom/gallery,kryptnostic/gallery
--- +++ @@ -9,7 +9,7 @@ const getChildren = (rowData) => { return rowData.map((row) => { - return <TopUtilizersSelectionRowContainer id={row.id} />; + return <TopUtilizersSelectionRowContainer key={row.id} />; }); };
58239dac2cc98052570cd13e87905c9fb3b11de5
src/scenes/home/opCodeCon/opCodeCon.js
src/scenes/home/opCodeCon/opCodeCon.js
import React from 'react'; import commonUrl from 'shared/constants/commonLinks'; import LinkButton from 'shared/components/linkButton/linkButton'; import styles from './opCodeCon.css'; const OpCodeCon = () => ( <div className={styles.hero}> <div className={styles.heading}> <h1>OpCodeCon</h1> <h3>Join us for our inaugural Operation Code Convention!</h3> <p>September 19th-20th, 2018</p> <p>Raleigh Convention Center, Raleigh, NC</p> <p> <a href="mailto:eilish@operationcode.org" className={styles.textLink}> Contact us </a>{' '} for sponsorship information. </p> <LinkButton role="button" text="Donate" theme="red" link={commonUrl.donateLink} isExternal /> {/* <p>Check back for more information.</p> */} </div> </div> ); export default OpCodeCon;
import React from 'react'; import commonUrl from 'shared/constants/commonLinks'; import LinkButton from 'shared/components/linkButton/linkButton'; import styles from './opCodeCon.css'; const OpCodeCon = () => ( <div className={styles.hero}> <div className={styles.heading}> <h1>OpCodeCon</h1> <h3>Join us for our inaugural Operation Code Convention!</h3> <p>September 19th-20th, 2018</p> <p>Raleigh Convention Center, Raleigh, NC</p> <p> <a href="mailto:eilish@operationcode.org" className={styles.textLink}> Contact us </a>{' '} for sponsorship information. </p> <LinkButton role="button" text="Donate" theme="red" link={commonUrl.donateLink} isExternal /> {/* <p>Check back for more information.</p> */} </div> </div> ); export default OpCodeCon;
Fix ESLint error causing Travis build to fail
Fix ESLint error causing Travis build to fail 'jsx-max-props-per-line' rule
JavaScript
mit
sethbergman/operationcode_frontend,OperationCode/operationcode_frontend,sethbergman/operationcode_frontend,sethbergman/operationcode_frontend,hollomancer/operationcode_frontend,OperationCode/operationcode_frontend,hollomancer/operationcode_frontend,OperationCode/operationcode_frontend,hollomancer/operationcode_frontend
--- +++ @@ -16,7 +16,13 @@ </a>{' '} for sponsorship information. </p> - <LinkButton role="button" text="Donate" theme="red" link={commonUrl.donateLink} isExternal /> + <LinkButton + role="button" + text="Donate" + theme="red" + link={commonUrl.donateLink} + isExternal + /> {/* <p>Check back for more information.</p> */} </div> </div>
c4e00daab05ac6cc0b9965fd5a07539b3281bd2e
app/routes.js
app/routes.js
module.exports = { bind : function (app) { app.get('/', function (req, res) { console.log("Clearing the session.") delete req.session res.render('index'); }); app.get('/examples/template-data', function (req, res) { res.render('examples/template-data', { 'name' : 'Foo' }); }); app.post('/start-flow', function(req, res) { res.redirect('/service-before'); }); // add your routes here } };
function clear_session(req) { console.log("Clearing the session.") delete req.session } module.exports = { bind : function (app) { app.get('/', function (req, res) { clear_session(req); res.render('index'); }); app.get('/index', function (req, res) { clear_session(req); res.render('index'); }); app.get('/examples/template-data', function (req, res) { res.render('examples/template-data', { 'name' : 'Foo' }); }); app.post('/start-flow', function(req, res) { res.redirect('/service-before'); }); // add your routes here } };
Clear the session on accessing the index page too.
Clear the session on accessing the index page too.
JavaScript
mit
stephenjoe1/pay-staff-tool,stephenjoe1/pay-staff-tool,stephenjoe1/pay-staff-tool
--- +++ @@ -1,11 +1,21 @@ +function clear_session(req) { + console.log("Clearing the session.") + delete req.session +} + module.exports = { bind : function (app) { app.get('/', function (req, res) { - console.log("Clearing the session.") - delete req.session + clear_session(req); res.render('index'); }); + + app.get('/index', function (req, res) { + clear_session(req); + res.render('index'); + }); + app.get('/examples/template-data', function (req, res) { res.render('examples/template-data', { 'name' : 'Foo' });
8ebb4b1d798c02dd62d7b0e584f567374c4a930c
NoteWrangler/public/js/routes.js
NoteWrangler/public/js/routes.js
// js/routes (function() { "use strict"; angular.module("NoteWrangler") .config(config); function config($routeProvider) { $routeProvider .when("/notes", { templateUrl: "../templates/pages/notes/index.html", controller: "NotesIndexController", controllerAs: "notesIndexCtrl" }) .when("/users", { templateUrl: "../templates/pages/users/index.html" }) .when("/notes/new", { templateUrl: "templates/pages/notes/new.html", controller: "NotesCreateController", controllerAs: "notesCreateCtrl" }) .when("/notes/:id", { templateUrl: "templates/pages/notes/show.html", controller: "NotesShowController", controllerAs: "notesShowCtrl" }) .otherwise({ redirectTo: "/" }); } })();
// js/routes (function() { "use strict"; angular.module("NoteWrangler") .config(config); function config($routeProvider) { $routeProvider .when("/notes", { templateUrl: "../templates/pages/notes/index.html", controller: "NotesIndexController", controllerAs: "notesIndexCtrl" }) .when("/users", { templateUrl: "../templates/pages/users/index.html" }) .when("/notes/new", { templateUrl: "templates/pages/notes/new.html", controller: "NotesCreateController", controllerAs: "notesCreateCtrl" }) .when("/notes/:id", { templateUrl: "templates/pages/notes/show.html", controller: "NotesShowController", controllerAs: "notesShowCtrl" }) .otherwise({ redirectTo: "/", templateUrl: "templates/pages/index/index.html" }); } })();
Add templateUrl for default route
Add templateUrl for default route
JavaScript
mit
var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training
--- +++ @@ -27,7 +27,8 @@ controllerAs: "notesShowCtrl" }) .otherwise({ - redirectTo: "/" + redirectTo: "/", + templateUrl: "templates/pages/index/index.html" }); } })();
d60038a85207a5126048733c700b15cd39b7e80b
modules/web.js
modules/web.js
var express = require('express'); var webInterface = function(dbot) { var dbot = dbot; var pub = 'public'; var app = express.createServer(); app.use(express.compiler({ src: pub, enable: ['sass'] })); app.use(express.static(pub)); app.set('view engine', 'jade'); app.get('/', function(req, res) { res.redirect('/quotes'); //res.render('index', { }); }); app.get('/quotes', function(req, res) { // Lists the quote categories res.render('quotelist', { 'quotelist': Object.keys(dbot.db.quoteArrs) }); }); app.get('/quotes/:key', function(req, res) { // Lists the quotes in a category var key = req.params.key.toLowerCase(); if(dbot.db.quoteArrs.hasOwnProperty(key)) { res.render('quotes', { 'quotes': dbot.db.quoteArrs[key], locals: {url_regex: RegExp.prototype.url_regex()}}); } else { res.render('error', { 'message': 'No quotes under that key.' }); } }); app.listen(9443); return { 'onDestroy': function() { app.close(); } }; }; exports.fetch = function(dbot) { return webInterface(dbot); };
var express = require('express'); var webInterface = function(dbot) { var dbot = dbot; var pub = 'public'; var app = express.createServer(); app.use(express.compiler({ src: pub, enable: ['sass'] })); app.use(express.static(pub)); app.set('view engine', 'jade'); app.get('/', function(req, res) { res.redirect('/quotes'); //res.render('index', { }); }); app.get('/quotes', function(req, res) { // Lists the quote categories res.render('quotelist', { 'quotelist': Object.keys(dbot.db.quoteArrs) }); }); app.get('/quotes/:key', function(req, res) { // Lists the quotes in a category var key = req.params.key.toLowerCase(); if(dbot.db.quoteArrs.hasOwnProperty(key)) { res.render('quotes', { 'quotes': dbot.db.quoteArrs[key], locals: {url_regex: RegExp.prototype.url_regex()}}); } else { res.render('error', { 'message': 'No quotes under that key.' }); } }); app.listen(443); return { 'onDestroy': function() { app.close(); } }; }; exports.fetch = function(dbot) { return webInterface(dbot); };
Move listen port back to 443
Move listen port back to 443
JavaScript
mit
zuzak/dbot,zuzak/dbot
--- +++ @@ -30,7 +30,7 @@ } }); - app.listen(9443); + app.listen(443); return { 'onDestroy': function() {
b33eafc06f6f89166cecd8cde664c470cc249b31
lib/app.js
lib/app.js
var app = require("express")(); app.get('/', function (req, res) { res.send('c\'est ne une jsbin'); }); app.listen(3000);
var express = require('express'), path = require('path'), app = express(); app.root = path.join(__dirname, '..', 'public'); app.use(express.logger()); app.use(express.static(app.root)); app.get('/', function (req, res) { res.send('c\'est ne une jsbin'); }); module.exports = app; // Run a local development server if this file is called directly. if (require.main === module) { app.listen(3000); }
Add support for serving static files and logging
Add support for serving static files and logging
JavaScript
mit
thsunmy/jsbin,jsbin/jsbin,filamentgroup/jsbin,mingzeke/jsbin,jwdallas/jsbin,kentcdodds/jsbin,jsbin/jsbin,knpwrs/jsbin,IvanSanchez/jsbin,martinvd/jsbin,blesh/jsbin,saikota/jsbin,pandoraui/jsbin,carolineartz/jsbin,dhval/jsbin,svacha/jsbin,mlucool/jsbin,dennishu001/jsbin,eggheadio/jsbin,Freeformers/jsbin,mcanthony/jsbin,ctide/jsbin,johnmichel/jsbin,eggheadio/jsbin,ctide/jsbin,arcseldon/jsbin,ilyes14/jsbin,y3sh/jsbin-fork,mingzeke/jsbin,francoisp/jsbin,AverageMarcus/jsbin,KenPowers/jsbin,Freeformers/jsbin,KenPowers/jsbin,IveWong/jsbin,late-warrior/jsbin,dedalik/jsbin,jasonsanjose/jsbin-app,yize/jsbin,nitaku/jervis,HeroicEric/jsbin,mlucool/jsbin,fend-classroom/jsbin,Hamcha/jsbin,saikota/jsbin,Hamcha/jsbin,simonThiele/jsbin,KenPowers/jsbin,mcanthony/jsbin,simonThiele/jsbin,jamez14/jsbin,yohanboniface/jsbin,dennishu001/jsbin,jamez14/jsbin,dedalik/jsbin,knpwrs/jsbin,pandoraui/jsbin,minwe/jsbin,knpwrs/jsbin,dhval/jsbin,francoisp/jsbin,yize/jsbin,carolineartz/jsbin,juliankrispel/jsbin,mdo/jsbin,peterblazejewicz/jsbin,IveWong/jsbin,fgrillo21/NPA-Exam,jasonsanjose/jsbin-app,ilyes14/jsbin,minwe/jsbin,fgrillo21/NPA-Exam,digideskio/jsbin,y3sh/jsbin-fork,AverageMarcus/jsbin,IvanSanchez/jsbin,johnmichel/jsbin,fend-classroom/jsbin,remotty/jsbin,vipulnsward/jsbin,HeroicEric/jsbin,vipulnsward/jsbin,thsunmy/jsbin,digideskio/jsbin,martinvd/jsbin,jwdallas/jsbin,arcseldon/jsbin,late-warrior/jsbin,svacha/jsbin,kirjs/jsbin,roman01la/jsbin,juliankrispel/jsbin,yohanboniface/jsbin,kirjs/jsbin,roman01la/jsbin,peterblazejewicz/jsbin,kentcdodds/jsbin,filamentgroup/jsbin
--- +++ @@ -1,7 +1,19 @@ -var app = require("express")(); +var express = require('express'), + path = require('path'), + app = express(); + +app.root = path.join(__dirname, '..', 'public'); + +app.use(express.logger()); +app.use(express.static(app.root)); app.get('/', function (req, res) { res.send('c\'est ne une jsbin'); }); -app.listen(3000); +module.exports = app; + +// Run a local development server if this file is called directly. +if (require.main === module) { + app.listen(3000); +}
4390638b4674024c7abd266450916fbe4f78ea5a
prompts.js
prompts.js
'use strict'; var _ = require('lodash'); var prompts = [ { type: 'input', name: 'projectName', message: 'Machine-name of your project?', // Name of the parent directory. default: _.last(process.cwd().split('/')), validate: function (input) { return (input.search(' ') === -1) ? true : 'No spaces allowed.'; } }, { type: 'list', name: 'webserver', message: 'Choose your webserver:', choices: [ 'apache', 'nginx', 'custom' ], default: 'apache' }, { name: 'webImage', message: 'Specify your webserver Docker image:', default: 'phase2/apache24php55', when: function(answers) { return answers.webserver == 'custom'; }, validate: function(input) { if (_.isString(input)) { return true; } return 'A validate docker image identifier is required.'; } } ]; module.exports = prompts;
'use strict'; var _ = require('lodash'); var prompts = [ { type: 'input', name: 'projectName', message: 'Machine-name of your project?', // Name of the parent directory. default: _.last(process.cwd().split('/')), validate: function (input) { return (input.search(' ') === -1) ? true : 'No spaces allowed.'; } }, { type: 'list', name: 'webserver', message: 'Choose your webserver:', choices: [ 'apache', 'nginx', 'custom' ], default: 'apache' }, { name: 'webImage', message: 'Specify your webserver Docker image:', default: 'phase2/apache24php55', when: function(answers) { return answers.webserver == 'custom'; }, validate: function(input) { if (_.isString(input)) { return true; } return 'A validate docker image identifier is required.'; } }, { type: 'list', name: 'cacheInternal', message: 'Choose a cache backend:', default: 'memcache', choices: [ 'memcache', 'database' ] } ]; module.exports = prompts;
Add support for memcache with Drupal config via override.settings.php.
Add support for memcache with Drupal config via override.settings.php.
JavaScript
mit
phase2/generator-outrigger-drupal,phase2/generator-outrigger-drupal,phase2/generator-outrigger-drupal
--- +++ @@ -38,6 +38,16 @@ return 'A validate docker image identifier is required.'; } + }, + { + type: 'list', + name: 'cacheInternal', + message: 'Choose a cache backend:', + default: 'memcache', + choices: [ + 'memcache', + 'database' + ] } ];
9c69add5dbeb82687180f0f225defbe8cc2f0553
shows/paste.js
shows/paste.js
function(doc, req) { start({ "headers" : { "Content-type": "text/html" } }); var Mustache = require("vendor/mustache"); var x = Mustache.to_html(this.templates.paste, doc); return x; }
function(doc, req) { start({ "Content-type": "text/html; charset='utf-8'" }); var Mustache = require("vendor/mustache"); Mustache.to_html(this.templates.paste, doc, null, send); }
Use CouchDB send function when displaying the template
Use CouchDB send function when displaying the template Also correct the start function which was wrong before.
JavaScript
mit
gdamjan/paste-couchapp
--- +++ @@ -1,10 +1,7 @@ function(doc, req) { start({ - "headers" : { - "Content-type": "text/html" - } + "Content-type": "text/html; charset='utf-8'" }); var Mustache = require("vendor/mustache"); - var x = Mustache.to_html(this.templates.paste, doc); - return x; + Mustache.to_html(this.templates.paste, doc, null, send); }
2aacce141e11e2e30f566cad900c9fa1f4234d2b
tests/dummy/app/routes/nodes/detail/draft-registrations.js
tests/dummy/app/routes/nodes/detail/draft-registrations.js
import Ember from 'ember'; export default Ember.Route.extend({ model() { let node = this.modelFor('nodes.detail'); return node.get('draftRegistrations'); } });
import Ember from 'ember'; export default Ember.Route.extend({ model() { let node = this.modelFor('nodes.detail'); let drafts = node.get('draftRegistrations'); return Ember.RSVP.hash({ node: node, drafts: drafts }); }, });
Make both node and draft model available in draft template.
Make both node and draft model available in draft template.
JavaScript
apache-2.0
crcresearch/ember-osf,CenterForOpenScience/ember-osf,pattisdr/ember-osf,hmoco/ember-osf,baylee-d/ember-osf,hmoco/ember-osf,jamescdavis/ember-osf,CenterForOpenScience/ember-osf,pattisdr/ember-osf,chrisseto/ember-osf,binoculars/ember-osf,binoculars/ember-osf,cwilli34/ember-osf,jamescdavis/ember-osf,crcresearch/ember-osf,baylee-d/ember-osf,chrisseto/ember-osf,cwilli34/ember-osf
--- +++ @@ -3,6 +3,10 @@ export default Ember.Route.extend({ model() { let node = this.modelFor('nodes.detail'); - return node.get('draftRegistrations'); - } + let drafts = node.get('draftRegistrations'); + return Ember.RSVP.hash({ + node: node, + drafts: drafts + }); + }, });
0ef49d43df60f47ba98979c19c1c10d9808d1443
web/static/js/query.js
web/static/js/query.js
App.QueryController = Ember.Controller.extend({ needs: ['insight'], columnsBinding: "controllers.insight.columns", limitBinding: "controllers.insight.limit", _schema: Em.ArrayProxy.create({content:[]}), _records: Em.ArrayProxy.create({content:[]}), schema: function(){ this.execute(); return this._schema; }.property(), records: function(){ this.execute(); return this._records; }.property(), url: function(){ var cols = this.get('columns'); return "/json?limit=%@".fmt(this.get('limit')) + (cols ? "&cols=%@".fmt(cols):""); }.property("columns"), execute: _.debounce(function(){ var self = this; var array = []; Ember.$.getJSON(this.get('url'), function(json) { var schema = json.schema; self.set('_schema.content', schema); json.records.forEach(function(record,i){ var o = _.object(schema, record); array.push(Em.Object.create(o)); }); self.set('_records.content', array); }); return self; },300).observes('url') });
App.QueryController = Ember.Controller.extend({ needs: ['insight'], orderBy: null, where: null, columnsBinding: "controllers.insight.columns", limitBinding: "controllers.insight.limit", whereBinding: "controllers.insight.where", _schema: Em.ArrayProxy.create({content:[]}), _records: Em.ArrayProxy.create({content:[]}), schema: function(){ this.execute(); return this._schema; }.property(), records: function(){ this.execute(); return this._records; }.property(), url: function(){ var args = [ "limit=%@".fmt(this.get('limit')), ] var limit = this.get('limit'); var orderBy = this.get('orderBy'); if(orderBy){ args.push('order_by=%@'.fmt(orderBy.join(' '))); } var cols = this.get('columns'); if(cols){ args.push("cols=%@".fmt(cols)); } var where = this.get('where'); console.log(where) if(where){ args.push("where=%@".fmt(where)); } return "/json?" + args.join('&'); }.property("columns", "limit", "orderBy", "where"), execute: _.debounce(function(){ var self = this; var array = []; Ember.$.getJSON(this.get('url'), function(json) { var schema = json.schema; self.set('_schema.content', schema); json.records.forEach(function(record,i){ var o = _.object(schema, record); array.push(Em.Object.create(o)); }); self.set('_records.content', array); }); return self; },300).observes('url') });
Allow editing of filters, ordering and limits.
Allow editing of filters, ordering and limits.
JavaScript
mpl-2.0
mozilla/caravela,mozilla/caravela,mozilla/caravela,mozilla/caravela
--- +++ @@ -1,8 +1,10 @@ App.QueryController = Ember.Controller.extend({ needs: ['insight'], - + orderBy: null, + where: null, columnsBinding: "controllers.insight.columns", limitBinding: "controllers.insight.limit", + whereBinding: "controllers.insight.where", _schema: Em.ArrayProxy.create({content:[]}), _records: Em.ArrayProxy.create({content:[]}), @@ -19,11 +21,33 @@ url: function(){ + + var args = [ + "limit=%@".fmt(this.get('limit')), + + ] + var limit = this.get('limit'); + + var orderBy = this.get('orderBy'); + if(orderBy){ + args.push('order_by=%@'.fmt(orderBy.join(' '))); + } + var cols = this.get('columns'); - return "/json?limit=%@".fmt(this.get('limit')) + - (cols ? "&cols=%@".fmt(cols):""); + if(cols){ + args.push("cols=%@".fmt(cols)); + } + + var where = this.get('where'); + console.log(where) + if(where){ + args.push("where=%@".fmt(where)); + } + + + return "/json?" + args.join('&'); - }.property("columns"), + }.property("columns", "limit", "orderBy", "where"), execute: _.debounce(function(){
1e28a1f64256b02c70d1534561760657c6076179
ui/app/common/authentication/directives/pncRequiresAuth.js
ui/app/common/authentication/directives/pncRequiresAuth.js
/* * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 * * http://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. */ (function () { 'use strict'; var module = angular.module('pnc.common.authentication'); /** * @ngdoc directive * @name pnc.common.authentication:pncRequiresAuth * @restrict A * @description * @example * @author Alex Creasy */ module.directive('pncRequiresAuth', [ 'authService', function (authService) { return { restrict: 'A', link: function (scope, elem, attrs) { if (!authService.isAuthenticated()) { attrs.$set('disabled', 'disabled'); attrs.$set('title', 'Log in to run this action'); elem.addClass('pointer-events-auto'); } } }; } ]); })();
/* * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 * * http://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. */ (function () { 'use strict'; var module = angular.module('pnc.common.authentication'); /** * @ngdoc directive * @name pnc.common.authentication:pncRequiresAuth * @restrict A * @description * @example * @author Alex Creasy */ module.directive('pncRequiresAuth', [ 'authService', function (authService) { return { restrict: 'A', link: function (scope, elem, attrs) { if (!authService.isAuthenticated()) { attrs.$set('disabled', 'disabled'); attrs.$set('title', 'Log in to run this action'); attrs.$set('tooltip', ''); // hack to hide bootstrap tooltip in FF elem.addClass('pointer-events-auto'); } } }; } ]); })();
Add title when action buttons is disabled - FF fix
Add title when action buttons is disabled - FF fix
JavaScript
apache-2.0
jdcasey/pnc,jbartece/pnc,jsenko/pnc,alexcreasy/pnc,ruhan1/pnc,thauser/pnc,alexcreasy/pnc,jsenko/pnc,jbartece/pnc,dans123456/pnc,thescouser89/pnc,matejonnet/pnc,matedo1/pnc,jdcasey/pnc,ruhan1/pnc,rnc/pnc,jbartece/pnc,matedo1/pnc,matedo1/pnc,pkocandr/pnc,thauser/pnc,alexcreasy/pnc,project-ncl/pnc,jsenko/pnc,dans123456/pnc,thauser/pnc,jdcasey/pnc,dans123456/pnc,ruhan1/pnc
--- +++ @@ -37,6 +37,7 @@ if (!authService.isAuthenticated()) { attrs.$set('disabled', 'disabled'); attrs.$set('title', 'Log in to run this action'); + attrs.$set('tooltip', ''); // hack to hide bootstrap tooltip in FF elem.addClass('pointer-events-auto'); } }
c530d6bee2bc659945b711c215b9f0368f0a8981
background.js
background.js
chrome.contextMenus.create( { "title": "Define \"%s\"", "contexts":["selection"], "onclick": function(info, tab){ chrome.tabs.create( {url: "http://www.google.com/search?q=define" + encodeURIComponent(" " + info.selectionText) }); } });
chrome.contextMenus.create( { "title": "Define \"%s\"", "contexts":["selection"], "onclick": function(info, tab){ chrome.tabs.create( {url: "http://www.google.com/search?q=define" + encodeURIComponent(" " + info.selectionText).replace(/%20/g, "+") }); } });
Improve the looks of the tab's URL by using "+" instead of "%20"
Improve the looks of the tab's URL by using "+" instead of "%20"
JavaScript
mit
nwjlyons/google-dictionary-lookup
--- +++ @@ -4,7 +4,7 @@ "contexts":["selection"], "onclick": function(info, tab){ chrome.tabs.create( - {url: "http://www.google.com/search?q=define" + encodeURIComponent(" " + info.selectionText) + {url: "http://www.google.com/search?q=define" + encodeURIComponent(" " + info.selectionText).replace(/%20/g, "+") }); } });
608891cff627257521353d513397b01294bbf855
lib/logger.js
lib/logger.js
'use strict'; var path = require('path'); var winston = require('winston'); // // Logging levels // var config = { levels: { silly: 0, verbose: 1, debug: 2, info: 3, warn: 4, error: 5 }, colors: { silly: 'magenta', verbose: 'cyan', debug: 'blue', info: 'green', warn: 'yellow', error: 'red' } }; var logger = module.exports = function(label) { label = path.relative(__dirname, label); var debug = true; if (process.env.DEBUG !== undefined) { debug = process.env.DEBUG === 'true'; } return new (winston.Logger)({ transports: [ new (winston.transports.Console)({ level: 'silly', silent: !debug, label: label, colorize: true, debug: false }) ], levels: config.levels, colors: config.colors }); };
'use strict'; var path = require('path'); var winston = require('winston'); // // Logging levels // var config = { levels: { silly: 0, verbose: 1, debug: 2, info: 3, warn: 4, error: 5 }, colors: { silly: 'magenta', verbose: 'cyan', debug: 'blue', info: 'green', warn: 'yellow', error: 'red' } }; var logger = module.exports = function(label) { label = path.relative(__dirname, label); var debug = false; if (process.env.DEBUG !== undefined) { debug = process.env.DEBUG === 'true'; } return new (winston.Logger)({ transports: [ new (winston.transports.Console)({ level: 'silly', silent: !debug, label: label, colorize: true, debug: false }) ], levels: config.levels, colors: config.colors }); };
Disable debug mode by default
Disable debug mode by default
JavaScript
apache-2.0
mwaylabs/mcap-cli
--- +++ @@ -29,7 +29,7 @@ label = path.relative(__dirname, label); - var debug = true; + var debug = false; if (process.env.DEBUG !== undefined) { debug = process.env.DEBUG === 'true'; }
e5e82e6af9505c9f5a04a8acbe8170349faf80b7
modules/openlmis-web/src/main/webapp/public/js/shared/directives/angular-flot.js
modules/openlmis-web/src/main/webapp/public/js/shared/directives/angular-flot.js
/** * Created with IntelliJ IDEA. * User: issa * Date: 2/10/14 * Time: 1:18 AM */ app.directive('aFloat', function() { function link(scope, element, attrs){ scope.$watch('afData', function(){ init(scope.afData,scope.afOption); }); scope.$watch('afOption', function(){ init(scope.afData,scope.afOption); }); function init(o,d){ var totalWidth = element.width(), totalHeight = element.height(); if (totalHeight === 0 || totalWidth === 0) { throw new Error('Please set height and width for the aFloat element'+'width is '+ele); } if(element.is(":visible") && !isUndefined(d)){ $.plot(element, o , d); } } } return { restrict: 'EA', template: '<div></div>', link: link, replace:true, scope: { afOption: '=', afData: '=' } }; });
/** * Created with IntelliJ IDEA. * User: issa * Date: 2/10/14 * Time: 1:18 AM */ app.directive('aFloat', function() { function link(scope, element, attrs){ scope.$watch('afData', function(){ init(scope.afData,scope.afOption); }); scope.$watch('afOption', function(){ init(scope.afData,scope.afOption); }); function init(o,d){ var totalWidth = element.width(), totalHeight = element.height(); if (totalHeight === 0 || totalWidth === 0) { throw new Error('Please set height and width for the aFloat element'+'width is '+element); } if(element.is(":visible") && !isUndefined(d) && !isUndefined(o)){ $.plot(element, o , d); } } } return { restrict: 'EA', template: '<div></div>', link: link, replace:true, scope: { afOption: '=', afData: '=' } }; });
Fix angular jqflot integration error
Fix angular jqflot integration error
JavaScript
agpl-3.0
OpenLMIS/open-lmis,jasolangi/jasolangi.github.io,jasolangi/jasolangi.github.io,USAID-DELIVER-PROJECT/elmis,OpenLMIS/open-lmis,vimsvarcode/elmis,vimsvarcode/elmis,vimsvarcode/elmis,kelvinmbwilo/vims,vimsvarcode/elmis,jasolangi/jasolangi.github.io,USAID-DELIVER-PROJECT/elmis,kelvinmbwilo/vims,vimsvarcode/elmis,kelvinmbwilo/vims,OpenLMIS/open-lmis,USAID-DELIVER-PROJECT/elmis,USAID-DELIVER-PROJECT/elmis,kelvinmbwilo/vims,OpenLMIS/open-lmis
--- +++ @@ -20,10 +20,10 @@ var totalWidth = element.width(), totalHeight = element.height(); if (totalHeight === 0 || totalWidth === 0) { - throw new Error('Please set height and width for the aFloat element'+'width is '+ele); + throw new Error('Please set height and width for the aFloat element'+'width is '+element); } - if(element.is(":visible") && !isUndefined(d)){ + if(element.is(":visible") && !isUndefined(d) && !isUndefined(o)){ $.plot(element, o , d); } }
596710cc1308f0da187aca5f3cbe4f0b39a478a6
frontend/Components/Dashboard.style.js
frontend/Components/Dashboard.style.js
const u = require('../styles/utils'); module.exports = { '.dashboard': { 'padding': u.inRem(20), }, '.dashboard’s-title': { 'font-size': u.inRem(40), 'line-height': u.inRem(40), }, '.dashboard’s-subtitle': { 'font-size': u.inRem(12), 'text-transform': 'uppercase', 'letter-spacing': '0.2em', }, };
const u = require('../styles/utils'); const dashboardPadding = 20; const categoryBorderWidth = 1; const categoryBorder = `${categoryBorderWidth}px solid rgba(255, 255, 255, .2)`; module.exports = { '.dashboard': { 'padding': u.inRem(dashboardPadding), }, '.dashboard’s-title': { 'font-size': u.inRem(40), 'line-height': u.inRem(40), }, '.dashboard’s-subtitle': { 'font-size': u.inRem(12), 'text-transform': 'uppercase', 'letter-spacing': '0.2em', }, '.dashboard’s-categories': { 'list-style-type': 'none', 'padding-top': u.inRem(40), 'margin': `0 ${u.inRem(-dashboardPadding)}`, 'border-bottom': categoryBorder, }, '.dashboard’s-category': { 'line-height': u.inRem(40), 'padding': [ u.inRem(10 - categoryBorderWidth / 2), u.inRem(20), ].join(' '), 'border-top': categoryBorder, }, };
Make categories a bit prettier
Make categories a bit prettier
JavaScript
mit
magnificat/magnificat.surge.sh,magnificat/magnificat.surge.sh,magnificat/magnificat.surge.sh
--- +++ @@ -1,8 +1,14 @@ const u = require('../styles/utils'); + +const dashboardPadding = 20; + +const categoryBorderWidth = 1; +const categoryBorder = + `${categoryBorderWidth}px solid rgba(255, 255, 255, .2)`; module.exports = { '.dashboard': { - 'padding': u.inRem(20), + 'padding': u.inRem(dashboardPadding), }, '.dashboard’s-title': { @@ -15,4 +21,20 @@ 'text-transform': 'uppercase', 'letter-spacing': '0.2em', }, + + '.dashboard’s-categories': { + 'list-style-type': 'none', + 'padding-top': u.inRem(40), + 'margin': `0 ${u.inRem(-dashboardPadding)}`, + 'border-bottom': categoryBorder, + }, + + '.dashboard’s-category': { + 'line-height': u.inRem(40), + 'padding': [ + u.inRem(10 - categoryBorderWidth / 2), + u.inRem(20), + ].join(' '), + 'border-top': categoryBorder, + }, };
96507503d52fef205e9462de3bdcd7d38f18c453
lib/routes.js
lib/routes.js
Router.configure({ layoutTemplate: '_layout' }); //From what I can tell this has been depreciated //https://github.com/iron-meteor/iron-router/blob/739bcc1445db3ad6bf90bda4e0cab3203a0ae526/lib/router.js#L88 Router.map(function() { // initiative routes this.route('initiatives', { path: '/', template: 'initiatives', data: function() { return { userData: Meteor.subscribe("userData"), initiatives: Initiatives.find({}, {sort: {votes: -1}}) } } }); this.route('initiative', { path: '/initiative/:_id', template: 'initiativeShow', data: function () { return { initiative: Initiatives.findOne(this.params._id) } } }); this.route('profile', { path: '/profile', template: 'profileShow', data: function() { return { profile: Meteor.user() } } }) // login routes this.route('login', { path: '/login', template: 'publicLogin' }); this.route('about'); });
Router.configure({ layoutTemplate: '_layout' }); //From what I can tell this has been depreciated //https://github.com/iron-meteor/iron-router/blob/739bcc1445db3ad6bf90bda4e0cab3203a0ae526/lib/router.js#L88 Router.map(function() { // initiative routes this.route('initiatives', { path: '/', template: 'initiatives', data: function() { return { userData: Meteor.subscribe("userData"), initiatives: Initiatives.find({}, {sort: {votes: -1}}) } } }); this.route('initiative', { path: '/initiative/:_id', template: 'initiativeShow', data: function () { return { userData: Meteor.subscribe("userData"), initiative: Initiatives.findOne(this.params._id) } } }); this.route('profile', { path: '/profile', template: 'profileShow', data: function() { return { profile: Meteor.user() } } }) // login routes this.route('login', { path: '/login', template: 'publicLogin' }); this.route('about'); });
Fix initiativeShow to subscribe to userData
Fix initiativeShow to subscribe to userData
JavaScript
mit
mtr-cherish/cherish,mtr-cherish/cherish
--- +++ @@ -23,6 +23,7 @@ template: 'initiativeShow', data: function () { return { + userData: Meteor.subscribe("userData"), initiative: Initiatives.findOne(this.params._id) } }
2e357b2fd8d384047a98a2d13f074c378c6c7cbb
src/background/settings.js
src/background/settings.js
/** * Incomplete type for settings in the `settings.json` file. * * This contains only the settings that the background script uses. Other * settings are used when generating the `manifest.json` file. * * @typedef Settings * @prop {string} apiUrl * @prop {string} buildType * @prop {{ dsn: string, release: string }} [raven] * @prop {string} serviceUrl */ // nb. This will error if the build has not been run yet. import settings from '../../build/settings.json'; /** * Configuration data for the extension. */ export default /** @type {Settings} */ ({ ...settings, // Ensure API url does not end with '/' apiUrl: settings.apiUrl.replace(/\/^/, ''), });
/** * Incomplete type for settings in the `settings.json` file. * * This contains only the settings that the background script uses. Other * settings are used when generating the `manifest.json` file. * * @typedef Settings * @prop {string} apiUrl * @prop {string} buildType * @prop {{ dsn: string, release: string }} [raven] * @prop {string} serviceUrl */ // nb. This will error if the build has not been run yet. import settings from '../../build/settings.json'; /** * Configuration data for the extension. */ export default /** @type {Settings} */ ({ ...settings, // Ensure API url does not end with '/' apiUrl: settings.apiUrl.replace(/\/$/, ''), });
Correct regex pattern in the replace
Correct regex pattern in the replace I believe the intention is to strip out the last `/` character, if any (as the comment say).
JavaScript
bsd-2-clause
hypothesis/browser-extension,hypothesis/browser-extension,hypothesis/browser-extension,hypothesis/browser-extension
--- +++ @@ -21,5 +21,5 @@ ...settings, // Ensure API url does not end with '/' - apiUrl: settings.apiUrl.replace(/\/^/, ''), + apiUrl: settings.apiUrl.replace(/\/$/, ''), });
4fead2fa52d33a187879371f2cb5b9af2ad2aa14
api/routes/houseRoutes.js
api/routes/houseRoutes.js
'use strict' var passport = require('passport') module.exports = function(app) { var house = require('../controllers/houseController') app.route('/houses') .get(house.list_all_houses) .post(passport.authenticate('jwt', { session: false }), function(req, res) { var token = getToken(req.headers) if (token) { console.log("Creates a house: " + req.user) house.create_a_house(req, res) } else { return res.status(403).send({ success: false, message: 'Unauthorized.' }) } }) app.route('/houses/:houseId') .get(house.read_a_house) .put(house.update_a_house) .delete(house.delete_a_house) } const getToken = (headers) => { if (headers && headers.authorization) { var parted = headers.authorization.split(' ') if (parted.length === 2) { return parted[1] } else { return null } } else { return null } }
'use strict' var passport = require('passport') module.exports = function(app) { var house = require('../controllers/houseController') var versioning = require('../config/versioning') app.route(versioning.url + '/houses') .get(house.list_all_houses) .post(passport.authenticate('jwt', { session: false }), function(req, res) { var token = getToken(req.headers) if (token) { // User from token is at req.user house.create_a_house(req, res) } else { return res.status(403).send({ success: false, message: 'Unauthorized.' }) } }) app.route(versioning.url + '/houses/:houseId') .get(house.read_a_house) .put(house.update_a_house) .delete(house.delete_a_house) } // JWT approach of getting token from request headers const getToken = (headers) => { if (headers && headers.authorization) { var parted = headers.authorization.split(' ') if (parted.length === 2) { return parted[1] } else { return null } } else { return null } }
Add API versioning for House endpoints.
Add API versioning for House endpoints.
JavaScript
apache-2.0
sotirelisc/housebot-api
--- +++ @@ -4,8 +4,9 @@ module.exports = function(app) { var house = require('../controllers/houseController') + var versioning = require('../config/versioning') - app.route('/houses') + app.route(versioning.url + '/houses') .get(house.list_all_houses) .post(passport.authenticate('jwt', { session: false @@ -13,7 +14,7 @@ function(req, res) { var token = getToken(req.headers) if (token) { - console.log("Creates a house: " + req.user) + // User from token is at req.user house.create_a_house(req, res) } else { return res.status(403).send({ @@ -23,12 +24,13 @@ } }) - app.route('/houses/:houseId') + app.route(versioning.url + '/houses/:houseId') .get(house.read_a_house) .put(house.update_a_house) .delete(house.delete_a_house) } +// JWT approach of getting token from request headers const getToken = (headers) => { if (headers && headers.authorization) { var parted = headers.authorization.split(' ')
c1941e8deb1011fcda896467dea65f2a1a067bcd
app/libs/details/index.js
app/libs/details/index.js
'use strict'; module.exports = { get: function(task) { return new Promise((resolve, reject) => { // Check type if ( task.type === undefined || ! ['show', 'move'].includes(task.type) ) { return reject('Invalid job type "' + task.type + '" specified'); } // Get metadata, auth with trakt and get media information this.metadata.get(task.file).then((meta) => { task.meta = meta; return this[task.type](task.basename); }).then((info) => { task.details = info; return resolve(task); }).catch((err) => { return reject(err); }); }); }, metadata: require('./metadata'), show: require('./show'), movie: require('./movie') };
'use strict'; // Load requirements const fs = require('fs'), path = require('path'); // Define the config directory let configDir = path.resolve('./config'); // Create config directory if we don't have one if ( ! fs.existsSync(configDir) ) { fs.mkdirSync(configDir); } module.exports = { get: function(task) { return new Promise((resolve, reject) => { // Check type if ( task.type === undefined || ! ['show', 'move'].includes(task.type) ) { return reject('Invalid job type "' + task.type + '" specified'); } // Get metadata, auth with trakt and get media information this.metadata.get(task.file).then((meta) => { task.meta = meta; return this[task.type](task.basename); }).then((info) => { task.details = info; return resolve(task); }).catch((err) => { return reject(err); }); }); }, metadata: require('./metadata'), show: require('./show'), movie: require('./movie') };
Create config directory if not present
WIP: Create config directory if not present
JavaScript
apache-2.0
transmutejs/core
--- +++ @@ -1,4 +1,16 @@ 'use strict'; + +// Load requirements +const fs = require('fs'), + path = require('path'); + +// Define the config directory +let configDir = path.resolve('./config'); + +// Create config directory if we don't have one +if ( ! fs.existsSync(configDir) ) { + fs.mkdirSync(configDir); +} module.exports = {
4b534e9a9412d28c5a5e741287c0153af2286c2f
addons/graphql/src/preview.js
addons/graphql/src/preview.js
import React from 'react'; import GraphiQL from 'graphiql'; import { fetch } from 'global'; import 'graphiql/graphiql.css'; import FullScreen from './components/FullScreen'; const FETCH_OPTIONS = { method: 'post', headers: { 'Content-Type': 'application/json' }, }; function getDefautlFetcher(url) { return params => { const body = JSON.stringify(params); const options = Object.assign({ body }, FETCH_OPTIONS); return fetch(url, options).then(res => res.json()); }; } function reIndentQuery(query) { const lines = query.split('\n'); const spaces = lines[lines.length - 1].length - 1; return lines.map((l, i) => (i === 0 ? l : l.slice(spaces)).join('\n')); } export function setupGraphiQL(config) { return (_query, variables = '{}') => { const query = reIndentQuery(_query); const fetcher = config.fetcher || getDefautlFetcher(config.url); return () => <FullScreen> <GraphiQL query={query} variables={variables} fetcher={fetcher} /> </FullScreen>; }; }
import React from 'react'; import GraphiQL from 'graphiql'; import { fetch } from 'global'; import 'graphiql/graphiql.css'; import FullScreen from './components/FullScreen'; const FETCH_OPTIONS = { method: 'post', headers: { 'Content-Type': 'application/json' }, }; function getDefautlFetcher(url) { return params => { const body = JSON.stringify(params); const options = Object.assign({ body }, FETCH_OPTIONS); return fetch(url, options).then(res => res.json()); }; } function reIndentQuery(query) { const lines = query.split('\n'); const spaces = lines[lines.length - 1].length - 1; return lines.map((l, i) => (i === 0 ? l : l.slice(spaces))).join('\n'); } export function setupGraphiQL(config) { return (_query, variables = '{}') => { const query = reIndentQuery(_query); const fetcher = config.fetcher || getDefautlFetcher(config.url); return () => <FullScreen> <GraphiQL query={query} variables={variables} fetcher={fetcher} /> </FullScreen>; }; }
Fix bug in addons/graphql in reIndentQuery
Fix bug in addons/graphql in reIndentQuery
JavaScript
mit
enjoylife/storybook,storybooks/storybook,rhalff/storybook,jribeiro/storybook,nfl/react-storybook,jribeiro/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,rhalff/storybook,enjoylife/storybook,nfl/react-storybook,jribeiro/storybook,nfl/react-storybook,kadirahq/react-storybook,storybooks/storybook,rhalff/storybook,rhalff/storybook,enjoylife/storybook,nfl/react-storybook,rhalff/storybook,enjoylife/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook,rhalff/storybook,storybooks/storybook,jribeiro/storybook
--- +++ @@ -21,7 +21,7 @@ function reIndentQuery(query) { const lines = query.split('\n'); const spaces = lines[lines.length - 1].length - 1; - return lines.map((l, i) => (i === 0 ? l : l.slice(spaces)).join('\n')); + return lines.map((l, i) => (i === 0 ? l : l.slice(spaces))).join('\n'); } export function setupGraphiQL(config) {
1208ee980cf3e5b3c2c847c2a8d27b4ec7207f0f
client/src/js/samples/components/Analyses/Create.js
client/src/js/samples/components/Analyses/Create.js
import React, { PropTypes } from "react"; import { Modal } from "react-bootstrap"; import { AlgorithmSelect, Button } from "virtool/js/components/Base"; const getInitialState = () => ({ algorithm: "pathoscope_bowtie" }); export default class CreateAnalysis extends React.Component { constructor (props) { super(props); this.state = getInitialState(); } static propTypes = { show: PropTypes.bool, sampleId: PropTypes.string, onSubmit: PropTypes.func }; handleSubmit = (event) => { event.preventDefault(); this.props.onSubmit(this.props.sampleId, this.state.algorithm); this.onHide(); }; render = () => ( <Modal show={this.props.show} onHide={this.props.onHide} onExited={() => this.setState(getInitialState())}> <Modal.Header> New Analysis </Modal.Header> <form onSubmit={this.handleSubmit}> <Modal.Body> <div className="toolbar"> <AlgorithmSelect value={this.state.algorithm} onChange={(e) => this.setState({algorithm: e.target.value})} /> </div> </Modal.Body> <Modal.Footer> <Button type="submit" bsStyle="primary" icon="play" > Start </Button> </Modal.Footer> </form> </Modal> ); }
import React, { PropTypes } from "react"; import { Modal } from "react-bootstrap"; import { AlgorithmSelect, Button } from "virtool/js/components/Base"; const getInitialState = () => ({ algorithm: "pathoscope_bowtie" }); export default class CreateAnalysis extends React.Component { constructor (props) { super(props); this.state = getInitialState(); } static propTypes = { show: PropTypes.bool, sampleId: PropTypes.string, onSubmit: PropTypes.func, onHide: PropTypes.func }; handleSubmit = (event) => { event.preventDefault(); this.props.onSubmit(this.props.sampleId, this.state.algorithm); this.props.onHide(); }; render = () => ( <Modal show={this.props.show} onHide={this.props.onHide} onExited={() => this.setState(getInitialState())}> <Modal.Header> New Analysis </Modal.Header> <form onSubmit={this.handleSubmit}> <Modal.Body> <div className="toolbar"> <AlgorithmSelect value={this.state.algorithm} onChange={(e) => this.setState({algorithm: e.target.value})} /> </div> </Modal.Body> <Modal.Footer> <Button type="submit" bsStyle="primary" icon="play" > Start </Button> </Modal.Footer> </form> </Modal> ); }
Hide create analysis modal on success
Hide create analysis modal on success
JavaScript
mit
igboyes/virtool,igboyes/virtool,virtool/virtool,virtool/virtool
--- +++ @@ -16,13 +16,14 @@ static propTypes = { show: PropTypes.bool, sampleId: PropTypes.string, - onSubmit: PropTypes.func + onSubmit: PropTypes.func, + onHide: PropTypes.func }; handleSubmit = (event) => { event.preventDefault(); this.props.onSubmit(this.props.sampleId, this.state.algorithm); - this.onHide(); + this.props.onHide(); }; render = () => (
3d81d8597aec5d77525edf6b479e02317b75ca36
app/dashboard/routes/importer/helper/determine_path.js
app/dashboard/routes/importer/helper/determine_path.js
var slugify = require('./slugify'); var join = require('path').join; var moment = require('moment'); module.exports = function (title, page, draft, dateStamp) { var relative_path_without_extension; var slug = slugify(title); var name = name || slug; name = name.split('/').join('-'); if (page) { relative_path_without_extension = join('Pages', name); } else if (draft) { relative_path_without_extension = join('Drafts', name); } else { relative_path_without_extension = join(moment(dateStamp).format('YYYY'), moment(dateStamp).format('MM') + '-' + moment(dateStamp).format('DD') + '-' + name); } return relative_path_without_extension; };
var slugify = require("./slugify"); var join = require("path").join; var moment = require("moment"); module.exports = function(title, page, draft, dateStamp, slug) { var relative_path_without_extension; var name; slug = slugify(title || slug); name = name || slug; name = name.split("/").join("-"); if (page) { relative_path_without_extension = join("Pages", name); } else if (draft) { relative_path_without_extension = join("Drafts", name); } else { relative_path_without_extension = join( moment(dateStamp).format("YYYY"), moment(dateStamp).format("MM") + "-" + moment(dateStamp).format("DD") + "-" + name ); } return relative_path_without_extension; };
Allow optional slug in function which determines an imported entry's path
Allow optional slug in function which determines an imported entry's path
JavaScript
cc0-1.0
davidmerfield/Blot,davidmerfield/Blot,davidmerfield/Blot,davidmerfield/Blot
--- +++ @@ -1,23 +1,30 @@ -var slugify = require('./slugify'); -var join = require('path').join; -var moment = require('moment'); +var slugify = require("./slugify"); +var join = require("path").join; +var moment = require("moment"); -module.exports = function (title, page, draft, dateStamp) { +module.exports = function(title, page, draft, dateStamp, slug) { + var relative_path_without_extension; + var name; - var relative_path_without_extension; + slug = slugify(title || slug); + name = name || slug; - var slug = slugify(title); - var name = name || slug; - - name = name.split('/').join('-'); + name = name.split("/").join("-"); if (page) { - relative_path_without_extension = join('Pages', name); + relative_path_without_extension = join("Pages", name); } else if (draft) { - relative_path_without_extension = join('Drafts', name); + relative_path_without_extension = join("Drafts", name); } else { - relative_path_without_extension = join(moment(dateStamp).format('YYYY'), moment(dateStamp).format('MM') + '-' + moment(dateStamp).format('DD') + '-' + name); - } + relative_path_without_extension = join( + moment(dateStamp).format("YYYY"), + moment(dateStamp).format("MM") + + "-" + + moment(dateStamp).format("DD") + + "-" + + name + ); + } return relative_path_without_extension; };
62ddd0bc9c88d199090089d5506d4894dc5d8737
Resources/ui/handheld/android/ResponsesNewWindow.js
Resources/ui/handheld/android/ResponsesNewWindow.js
function ResponsesNewWindow(surveyID) { try { var ResponsesIndexView = require('ui/common/responses/ResponsesIndexView'); var ResponsesNewView = require('ui/common/responses/ResponsesNewView'); var ConfirmDialog = require('ui/common/components/ConfirmDialog'); var self = Ti.UI.createWindow({ navBarHidden : true, backgroundColor : "#fff" }); var view = new ResponsesNewView(surveyID); self.add(view); view.addEventListener('ResponsesNewView:savedResponse', function() { Ti.App.fireEvent('ResponseNewWindow:closed'); view.cleanup(); view = null; self.close(); }); var confirmDialog = new ConfirmDialog(L("confirm"), L("confirm_clear_answers"), onConfirm = function(e) { view.cleanup(); view = null; self.close(); }); self.addEventListener('android:back', function() { confirmDialog.show(); }); return self; } catch(e) { var auditor = require('helpers/Auditor'); auditor.writeIntoAuditFile(arguments.callee.name + " - " + e.toString()); } } module.exports = ResponsesNewWindow;
function ResponsesNewWindow(surveyID) { try { var ResponsesIndexView = require('ui/common/responses/ResponsesIndexView'); var ResponsesNewView = require('ui/common/responses/ResponsesNewView'); var ConfirmDialog = require('ui/common/components/ConfirmDialog'); var self = Ti.UI.createWindow({ navBarHidden : true, backgroundColor : "#fff" }); var view = new ResponsesNewView(surveyID); self.add(view); view.addEventListener('ResponsesNewView:savedResponse', function() { Ti.App.fireEvent('ResponseNewWindow:closed'); view.cleanup(); view = null; self.close(); }); var confirmDialog = new ConfirmDialog(L("confirm"), L("confirm_clear_answers"), onConfirm = function(e) { if(view) { view.cleanup(); } view = null; self.close(); }); self.addEventListener('android:back', function() { confirmDialog.show(); }); return self; } catch(e) { var auditor = require('helpers/Auditor'); auditor.writeIntoAuditFile(arguments.callee.name + " - " + e.toString()); } } module.exports = ResponsesNewWindow;
Add a guard clause to ResponseNewWindow
Add a guard clause to ResponseNewWindow
JavaScript
mit
nilenso/ashoka-survey-mobile,nilenso/ashoka-survey-mobile
--- +++ @@ -19,7 +19,9 @@ }); var confirmDialog = new ConfirmDialog(L("confirm"), L("confirm_clear_answers"), onConfirm = function(e) { + if(view) { view.cleanup(); + } view = null; self.close(); });
fc112a5d2fe9418150c15740b297e2c74af72ab2
lib/VideoCapture.js
lib/VideoCapture.js
// This module is responsible for capturing videos 'use strict'; const config = require('config'); const PiCamera = require('pi-camera'); const myCamera = new PiCamera({ mode: 'video', output: process.argv[2], width: config.get('camera.videoWidth'), height: config.get('camera.videoHeight'), timeout: config.get('camera.videoTimeout'), nopreview: true, }); process.on('message', (message) => { if (message.cmd === 'set') { myCamera.config = Object.assign(myCamera.config, message.set); } else if (message.cmd === 'capture') { myCamera.record() .then((result) => process.send({ response: 'success', result, error: null, })) .catch((error) => process.send({ response: 'failure', error, })); } });
// This module is responsible for capturing videos 'use strict'; const config = require('config'); const PiCamera = require('pi-camera'); const myCamera = new PiCamera({ mode: 'video', output: process.argv[2], width: config.get('camera.videoWidth'), height: config.get('camera.videoHeight'), timeout: config.get('camera.videoTimeout'), nopreview: true, }); process.on('message', (message) => { if (message.cmd === 'set') { myCamera.config = Object.assign(myCamera.config, message.set); } else if (message.cmd === 'capture') { setTimeout(() => { myCamera.record() .then((result) => process.send({ response: 'success', result, error: null, })) .catch((error) => process.send({ response: 'failure', error, })); }, 500); } });
Add minor delay to video capture. Hopefully this helps the camera moduel keep up.
Add minor delay to video capture. Hopefully this helps the camera moduel keep up.
JavaScript
mit
stetsmando/pi-motion-detection
--- +++ @@ -18,15 +18,17 @@ myCamera.config = Object.assign(myCamera.config, message.set); } else if (message.cmd === 'capture') { - myCamera.record() - .then((result) => process.send({ - response: 'success', - result, - error: null, - })) - .catch((error) => process.send({ - response: 'failure', - error, - })); + setTimeout(() => { + myCamera.record() + .then((result) => process.send({ + response: 'success', + result, + error: null, + })) + .catch((error) => process.send({ + response: 'failure', + error, + })); + }, 500); } });
e6516d3ef113bb35bcee5fd199ab06d14ca3f036
src/main/webapp/styles.js
src/main/webapp/styles.js
const propertiesReader = require("properties-reader"); const defaults = { "primary-color": "#1890ff", "info-color": "#1890ff", "link-color": "#1890ff", "font-size-base": "14px", "border-radius-base": "2px", }; function formatAntStyles() { const custom = {}; const re = /styles.ant.([\w+-]*)/; try { const properties = propertiesReader("/etc/irida/irida.conf"); properties.each((key, value) => { const found = key.match(re); if (found) { custom[found[1]] = value; } }); } catch (e) { console.log("No styles in `/etc/irida/irida.conf`"); } return Object.assign({}, defaults, custom); } module.exports = { formatAntStyles };
const propertiesReader = require("properties-reader"); const fs = require("fs"); const defaults = { "primary-color": "#1890ff", "info-color": "#1890ff", "link-color": "#1890ff", "font-size-base": "14px", "border-radius-base": "2px", }; const iridaConfig = "/etc/irida/irida.conf"; const propertiesConfig = "../resources/configuration.properties"; function formatAntStyles() { const colourProperties = {}; const re = /styles.ant.([\w+-]*)/; try { if (fs.existsSync(propertiesConfig)) { const properties = propertiesReader(propertiesConfig); properties.each((key, value) => { const found = key.match(re); if (found) { colourProperties[found[1]] = value; } }); } if (fs.existsSync(iridaConfig)) { const properties = propertiesReader(iridaConfig); properties.each((key, value) => { const found = key.match(re); if (found) { colourProperties[found[1]] = value; } }); } } catch (e) { console.log("No styles in `/etc/irida/irida.conf`"); } return Object.assign({}, defaults, colourProperties); } module.exports = { formatAntStyles };
Check to see what values are in which file.
Check to see what values are in which file.
JavaScript
apache-2.0
phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida
--- +++ @@ -1,4 +1,5 @@ const propertiesReader = require("properties-reader"); +const fs = require("fs"); const defaults = { "primary-color": "#1890ff", @@ -7,23 +8,37 @@ "font-size-base": "14px", "border-radius-base": "2px", }; +const iridaConfig = "/etc/irida/irida.conf"; +const propertiesConfig = "../resources/configuration.properties"; function formatAntStyles() { - const custom = {}; + const colourProperties = {}; const re = /styles.ant.([\w+-]*)/; try { - const properties = propertiesReader("/etc/irida/irida.conf"); - properties.each((key, value) => { - const found = key.match(re); - if (found) { - custom[found[1]] = value; - } - }); + if (fs.existsSync(propertiesConfig)) { + const properties = propertiesReader(propertiesConfig); + properties.each((key, value) => { + const found = key.match(re); + if (found) { + colourProperties[found[1]] = value; + } + }); + } + + if (fs.existsSync(iridaConfig)) { + const properties = propertiesReader(iridaConfig); + properties.each((key, value) => { + const found = key.match(re); + if (found) { + colourProperties[found[1]] = value; + } + }); + } } catch (e) { console.log("No styles in `/etc/irida/irida.conf`"); } - return Object.assign({}, defaults, custom); + return Object.assign({}, defaults, colourProperties); } module.exports = { formatAntStyles };
f998f5fe7aedb8e33a81727c8371b690a698c73b
src/browser.js
src/browser.js
/* * * This is used to build the bundle with browserify. * * The bundle is used by people who doesn't use browserify. * Those who use browserify will install with npm and require the module, * the package.json file points to index.js. */ import Auth0Lock from './classic'; import Auth0LockPasswordless from './passwordless'; global.window.Auth0Lock = Auth0Lock; global.window.Auth0LockPasswordless = Auth0LockPasswordless; //use amd or just throught to window object. if (typeof global.window.define == 'function' && global.window.define.amd) { global.window.define('auth0Lock', function () { return Auth0Lock; }); global.window.define('auth0LockPasswordless', function () { return Auth0LockPasswordless; }); } else if (global.window) { global.window.Auth0Lock = Auth0Lock; global.window.Auth0LockPasswordless = Auth0LockPasswordless; }
/* * * This is used to build the bundle with browserify. * * The bundle is used by people who doesn't use browserify. * Those who use browserify will install with npm and require the module, * the package.json file points to index.js. */ import Auth0Lock from './classic'; // import Auth0LockPasswordless from './passwordless'; global.window.Auth0Lock = Auth0Lock; // global.window.Auth0LockPasswordless = Auth0LockPasswordless; //use amd or just throught to window object. if (typeof global.window.define == 'function' && global.window.define.amd) { global.window.define('auth0Lock', function () { return Auth0Lock; }); // global.window.define('auth0LockPasswordless', function () { return Auth0LockPasswordless; }); } else if (global.window) { global.window.Auth0Lock = Auth0Lock; // global.window.Auth0LockPasswordless = Auth0LockPasswordless; }
Exclude passwordless stuff from build
Exclude passwordless stuff from build
JavaScript
mit
mike-casas/lock,mike-casas/lock,mike-casas/lock
--- +++ @@ -8,15 +8,15 @@ */ import Auth0Lock from './classic'; -import Auth0LockPasswordless from './passwordless'; +// import Auth0LockPasswordless from './passwordless'; global.window.Auth0Lock = Auth0Lock; -global.window.Auth0LockPasswordless = Auth0LockPasswordless; +// global.window.Auth0LockPasswordless = Auth0LockPasswordless; //use amd or just throught to window object. if (typeof global.window.define == 'function' && global.window.define.amd) { global.window.define('auth0Lock', function () { return Auth0Lock; }); - global.window.define('auth0LockPasswordless', function () { return Auth0LockPasswordless; }); +// global.window.define('auth0LockPasswordless', function () { return Auth0LockPasswordless; }); } else if (global.window) { global.window.Auth0Lock = Auth0Lock; - global.window.Auth0LockPasswordless = Auth0LockPasswordless; +// global.window.Auth0LockPasswordless = Auth0LockPasswordless; }
0458bfe4e4fbe287049722f4efa46df1fa2be52f
lib/js/SetBased/Abc/Core/Page/CorePage.js
lib/js/SetBased/Abc/Core/Page/CorePage.js
/*jslint browser: true, single: true, maxlen: 120, eval: true, white: true */ /*global define */ /*global set_based_abc_inline_js*/ //---------------------------------------------------------------------------------------------------------------------- define( 'SetBased/Abc/Core/Page/CorePage', ['jquery', 'SetBased/Abc/Page/Page', 'SetBased/Abc/Core/InputTable', 'SetBased/Abc/Table/OverviewTablePackage', 'SetBased/Abc/Form/FormPackage'], function ($, Page, InputTable, OverviewTable, Form) { 'use strict'; //------------------------------------------------------------------------------------------------------------------ $('form').submit(InputTable.setCsrfValue); Form.registerForm('form'); InputTable.registerTable('form'); Page.enableDatePicker(); OverviewTable.registerTable('.overview_table'); $('.icon_action').click(Page.showConfirmMessage); if (window.hasOwnProperty('set_based_abc_inline_js')) { eval(set_based_abc_inline_js); } //------------------------------------------------------------------------------------------------------------------ } ); //----------------------------------------------------------------------------------------------------------------------
/*jslint browser: true, single: true, maxlen: 120, eval: true, white: true */ /*global define */ /*global set_based_abc_inline_js*/ //---------------------------------------------------------------------------------------------------------------------- define( 'SetBased/Abc/Core/Page/CorePage', ['jquery', 'SetBased/Abc/Page/Page', 'SetBased/Abc/Core/InputTable', 'SetBased/Abc/Table/OverviewTablePackage', 'SetBased/Abc/Form/FormPackage'], function ($, Page, InputTable, OverviewTable, Form) { 'use strict'; //------------------------------------------------------------------------------------------------------------------ $('form').submit(InputTable.setCsrfValue); Form.registerForm('form'); InputTable.registerTable('form'); Page.enableDatePicker(); OverviewTable.registerTable('.overview-table'); $('.icon_action').click(Page.showConfirmMessage); if (window.hasOwnProperty('set_based_abc_inline_js')) { eval(set_based_abc_inline_js); } //------------------------------------------------------------------------------------------------------------------ } ); //----------------------------------------------------------------------------------------------------------------------
Align with changes in OverviewTable.
Align with changes in OverviewTable.
JavaScript
mit
SetBased/php-abc-core,SetBased/php-abc-core
--- +++ @@ -20,7 +20,7 @@ Page.enableDatePicker(); - OverviewTable.registerTable('.overview_table'); + OverviewTable.registerTable('.overview-table'); $('.icon_action').click(Page.showConfirmMessage);
2ddf6d6222e6c0fa6f6b29665b90a2ba6fbd5d0f
src/app/libparsio/technical/services/update.service.js
src/app/libparsio/technical/services/update.service.js
/* * Author: Alexandre Havrileck (Oxyno-zeta) * Date: 25/06/16 * Licence: See Readme */ (function () { 'use strict'; angular .module('libparsio.technical.services') .factory('updateService', updateService); /** @ngInject */ function updateService($q, updateDaoService, updateWrapperService, updateCacheService) { var service = { initialize: initialize }; return service; //////////////// /* ************************************* */ /* ******** PRIVATE FUNCTIONS ******** */ /* ************************************* */ /* ************************************* */ /* ******** PUBLIC FUNCTIONS ******** */ /* ************************************* */ /** * Initialize. */ function initialize() { var promises = []; promises.push(updateDaoService.getReleases()); promises.push(updateWrapperService.getAppVersion()); $q.all(promises).then(function(response){ var release = response[0]; //var appVersion = response[1]; var appVersion = '0.1.0'; var version = updateWrapperService.clean(release['tag_name']); // Check if version if greater than actual var isGreaterThan = updateWrapperService.isGreaterThan(version, appVersion); if (isGreaterThan){ updateCacheService.putAllData(true, version); } }); } } })();
/* * Author: Alexandre Havrileck (Oxyno-zeta) * Date: 25/06/16 * Licence: See Readme */ (function () { 'use strict'; angular .module('libparsio.technical.services') .factory('updateService', updateService); /** @ngInject */ function updateService($q, updateDaoService, updateWrapperService, updateCacheService) { var service = { initialize: initialize }; return service; //////////////// /* ************************************* */ /* ******** PRIVATE FUNCTIONS ******** */ /* ************************************* */ /* ************************************* */ /* ******** PUBLIC FUNCTIONS ******** */ /* ************************************* */ /** * Initialize. */ function initialize() { var promises = []; promises.push(updateDaoService.getReleases()); promises.push(updateWrapperService.getAppVersion()); $q.all(promises).then(function(response){ var release = response[0]; var appVersion = response[1]; var version = updateWrapperService.clean(release['tag_name']); // Check if version if greater than actual var isGreaterThan = updateWrapperService.isGreaterThan(version, appVersion); if (isGreaterThan){ updateCacheService.putAllData(true, version); } }); } } })();
Remove mock version in code
[App] Remove mock version in code
JavaScript
mit
oxyno-zeta/LibParsio,oxyno-zeta/LibParsio
--- +++ @@ -39,8 +39,7 @@ $q.all(promises).then(function(response){ var release = response[0]; - //var appVersion = response[1]; - var appVersion = '0.1.0'; + var appVersion = response[1]; var version = updateWrapperService.clean(release['tag_name']);
74b84e2aa981ed9d8972afa97b998c8110a6dc6e
packages/net/__imports__.js
packages/net/__imports__.js
exports.map = { 'node': ['net.env.node.stdio'], 'browser': ['net.env.browser.csp'], 'mobile': [] } exports.resolve = function(env, opts) { return exports.map[env] || []; };
exports.map = { 'node': [ 'net.env.node.stdio' ], 'browser': [ 'net.env.browser.csp', 'net.env.browser.postmessage' ], 'mobile': [] } exports.resolve = function(env, opts) { return exports.map[env] || []; };
Fix for missing dynamic import
Fix for missing dynamic import
JavaScript
mit
hashcube/js.io,hashcube/js.io,gameclosure/js.io,gameclosure/js.io
--- +++ @@ -1,6 +1,11 @@ exports.map = { - 'node': ['net.env.node.stdio'], - 'browser': ['net.env.browser.csp'], + 'node': [ + 'net.env.node.stdio' + ], + 'browser': [ + 'net.env.browser.csp', + 'net.env.browser.postmessage' + ], 'mobile': [] }
f390c9257874452e2a7e2aa918502a713d7ea4e2
app/assets/javascripts/discourse/views/topic_footer_buttons_view.js
app/assets/javascripts/discourse/views/topic_footer_buttons_view.js
/** This view is used for rendering the buttons at the footer of the topic @class TopicFooterButtonsView @extends Discourse.ContainerView @namespace Discourse @module Discourse **/ Discourse.TopicFooterButtonsView = Discourse.ContainerView.extend({ elementId: 'topic-footer-buttons', topicBinding: 'controller.content', init: function() { this._super(); this.createButtons(); }, // Add the buttons below a topic createButtons: function() { var topic = this.get('topic'); if (Discourse.User.current()) { if (!topic.get('isPrivateMessage')) { // We hide some controls from private messages if (this.get('topic.details.can_invite_to')) { this.attachViewClass(Discourse.InviteReplyButton); } this.attachViewClass(Discourse.StarButton); this.attachViewClass(Discourse.ShareButton); this.attachViewClass(Discourse.ClearPinButton); if (this.get('topic.details.can_flag_topic')) { this.attachViewClass(Discourse.FlagTopicButton); } } if (this.get('topic.details.can_create_post')) { this.attachViewClass(Discourse.ReplyButton); } this.attachViewClass(Discourse.NotificationsButton); this.trigger('additionalButtons', this); } else { // If not logged in give them a login control this.attachViewClass(Discourse.LoginReplyButton); } } });
/** This view is used for rendering the buttons at the footer of the topic @class TopicFooterButtonsView @extends Discourse.ContainerView @namespace Discourse @module Discourse **/ Discourse.TopicFooterButtonsView = Discourse.ContainerView.extend({ elementId: 'topic-footer-buttons', topicBinding: 'controller.content', init: function() { this._super(); this.createButtons(); }, // Add the buttons below a topic createButtons: function() { var topic = this.get('topic'); if (Discourse.User.current()) { if (!topic.get('isPrivateMessage')) { // We hide some controls from private messages if (this.get('topic.details.can_invite_to') && !this.get('topic.category.read_restricted')) { this.attachViewClass(Discourse.InviteReplyButton); } this.attachViewClass(Discourse.StarButton); this.attachViewClass(Discourse.ShareButton); this.attachViewClass(Discourse.ClearPinButton); if (this.get('topic.details.can_flag_topic')) { this.attachViewClass(Discourse.FlagTopicButton); } } if (this.get('topic.details.can_create_post')) { this.attachViewClass(Discourse.ReplyButton); } this.attachViewClass(Discourse.NotificationsButton); this.trigger('additionalButtons', this); } else { // If not logged in give them a login control this.attachViewClass(Discourse.LoginReplyButton); } } });
Hide the Invite button in topics in secured categories
Hide the Invite button in topics in secured categories
JavaScript
mit
natefinch/discourse,natefinch/discourse
--- +++ @@ -21,7 +21,7 @@ if (Discourse.User.current()) { if (!topic.get('isPrivateMessage')) { // We hide some controls from private messages - if (this.get('topic.details.can_invite_to')) { + if (this.get('topic.details.can_invite_to') && !this.get('topic.category.read_restricted')) { this.attachViewClass(Discourse.InviteReplyButton); } this.attachViewClass(Discourse.StarButton);
b05684290a939fc4475335aad1d348b208a22d0f
cloud-functions-angular-start/src/firebase-messaging-sw.js
cloud-functions-angular-start/src/firebase-messaging-sw.js
importScripts('https://www.gstatic.com/firebasejs/3.6.6/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/3.6.6/firebase-messaging.js'); // Initialize the Firebase app in the service worker by passing in the // messagingSenderId. firebase.initializeApp({ // TODO add your messagingSenderId messagingSenderId: '662518903527' }); var messaging = firebase.messaging();
importScripts('https://www.gstatic.com/firebasejs/3.6.6/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/3.6.6/firebase-messaging.js'); // Initialize the Firebase app in the service worker by passing in the // messagingSenderId. firebase.initializeApp({ // TODO add your messagingSenderId messagingSenderId: '' }); var messaging = firebase.messaging();
Remove hard-coded message sender id.
Remove hard-coded message sender id.
JavaScript
apache-2.0
firebase/codelab-friendlychat-web,firebase/codelab-friendlychat-web
--- +++ @@ -5,6 +5,6 @@ // messagingSenderId. firebase.initializeApp({ // TODO add your messagingSenderId - messagingSenderId: '662518903527' + messagingSenderId: '' }); var messaging = firebase.messaging();
cfac1524d1d33c1c6594f54f29d7691b121f89ab
background.js
background.js
(function () { 'use strict'; // Awesome Browser Shortcuts chrome.commands.onCommand.addListener(function (command) { var tabQuery = {active: true, currentWindow: true}; if (command === 'toggle-pin') { // Get current tab in the active window chrome.tabs.query(tabQuery, function(tabs) { var currentTab = tabs[0]; chrome.tabs.update(currentTab.id, {'pinned': !currentTab.pinned}); }); } else if (command === 'move-tab-left') { chrome.tabs.query(tabQuery, function (tabs) { var currentTab = tabs[0]; chrome.tabs.move(currentTab.id, {'index': currentTab.index - 1}); }); } else if (command === 'move-tab-right') { chrome.tabs.query(tabQuery, function (tabs) { var currentTab = tabs[0]; // TODO: Move tab to first if current index is the last one // Chrome moves non-existent index to the last chrome.tabs.move(currentTab.id, {'index': currentTab.index + 1}); }); } else if (command === 'duplicate=tab') { chrome.tabs.query(tabQuery, function (tabs) { var currentTab = tabs[0]; chrome.tabs.duplicate(currentTab.id); }) } }); })();
(function () { 'use strict'; // Awesome Browser Shortcuts chrome.commands.onCommand.addListener(function (command) { var tabQuery = {active: true, currentWindow: true}; if (command === 'toggle-pin') { // Get current tab in the active window chrome.tabs.query(tabQuery, function(tabs) { var currentTab = tabs[0]; chrome.tabs.update(currentTab.id, {'pinned': !currentTab.pinned}); }); } else if (command === 'move-tab-left') { chrome.tabs.query(tabQuery, function (tabs) { var currentTab = tabs[0]; chrome.tabs.move(currentTab.id, {'index': currentTab.index - 1}); }); } else if (command === 'move-tab-right') { chrome.tabs.query(tabQuery, function (tabs) { var currentTab = tabs[0]; // TODO: Move tab to first if current index is the last one // Chrome moves non-existent index to the last chrome.tabs.move(currentTab.id, {'index': currentTab.index + 1}); }); } else if (command === 'duplicate-tab') { chrome.tabs.query(tabQuery, function (tabs) { var currentTab = tabs[0]; chrome.tabs.duplicate(currentTab.id); }); } }); })();
Fix Duplicate Tab shortcut typo
Fix Duplicate Tab shortcut typo
JavaScript
mit
djadmin/browse-awesome
--- +++ @@ -24,11 +24,11 @@ chrome.tabs.move(currentTab.id, {'index': currentTab.index + 1}); }); } - else if (command === 'duplicate=tab') { + else if (command === 'duplicate-tab') { chrome.tabs.query(tabQuery, function (tabs) { var currentTab = tabs[0]; chrome.tabs.duplicate(currentTab.id); - }) + }); } }); })();
ab4b56ad493205c736dea190cd776e2c89a42e5b
servers.js
servers.js
var fork = require('child_process').fork; var amountConcurrentServers = process.argv[2] || 2; var port = initialPortServer(); var servers = []; var path = __dirname; var disableAutomaticGarbageOption = '--expose-gc'; for(var i = 0; i < amountConcurrentServers; i++) { var portForServer = port + i; var serverIdentifier = i; console.log('Creating server: ' + serverIdentifier + ' - ' + portForServer + ' - ' + serverIdentifier); servers[i] = fork( path +'/server.js', [portForServer, serverIdentifier], {execArgv: [disableAutomaticGarbageOption]}); } process.on('exit', function() { console.log('exit process'); for(var i = 0; i < amountConcurrentServers; i++) { servers[i].kill(); } }); function initialPortServer() { if(process.argv[3]) { return parseInt(process.argv[3]); } return 3000; }
var fork = require('child_process').fork; var amountConcurrentServers = process.argv[2] || 2; var port = initialPortServer(); var servers = []; var path = __dirname; var disableAutomaticGarbageOption = '--expose-gc'; for(var i = 0; i < amountConcurrentServers; i++) { var portForServer = port + i; var serverIdentifier = i; console.log('Creating server: ' + serverIdentifier + ' - ' + portForServer + ' - ' + serverIdentifier); servers[i] = fork( path +'/server.js', [portForServer, serverIdentifier], {execArgv: [disableAutomaticGarbageOption]}); servers[i].on('exit', function() { console.log('[benchmark][app][' + i +'][event] EXIT'); }); servers[i].on('close', function() { console.log('[benchmark][app][' + i +'][event] EXIT'); }); servers[i].on('disconnect', function() { console.log('[benchmark][app][' + i +'][event] EXIT'); }); servers[i].on('error', function() { console.log('[benchmark][app][' + i +'][event] EXIT'); }); servers[i].on('uncaughtException', function() { console.log('[benchmark][app][' + i +'][event] EXIT'); }); servers[i].on('SIGTERM', function() { console.log('[benchmark][app][' + i +'][event] EXIT'); }); servers[i].on('SIGINT', function() { console.log('[benchmark][app][' + i +'][event] EXIT'); }); } process.on('exit', function() { console.log('exit process'); for(var i = 0; i < amountConcurrentServers; i++) { servers[i].kill(); } }); function initialPortServer() { if(process.argv[3]) { return parseInt(process.argv[3]); } return 3000; }
Add log for child process
Add log for child process
JavaScript
mit
eltortuganegra/server-websocket-benchmark,eltortuganegra/server-websocket-benchmark
--- +++ @@ -10,6 +10,27 @@ var serverIdentifier = i; console.log('Creating server: ' + serverIdentifier + ' - ' + portForServer + ' - ' + serverIdentifier); servers[i] = fork( path +'/server.js', [portForServer, serverIdentifier], {execArgv: [disableAutomaticGarbageOption]}); + servers[i].on('exit', function() { + console.log('[benchmark][app][' + i +'][event] EXIT'); + }); + servers[i].on('close', function() { + console.log('[benchmark][app][' + i +'][event] EXIT'); + }); + servers[i].on('disconnect', function() { + console.log('[benchmark][app][' + i +'][event] EXIT'); + }); + servers[i].on('error', function() { + console.log('[benchmark][app][' + i +'][event] EXIT'); + }); + servers[i].on('uncaughtException', function() { + console.log('[benchmark][app][' + i +'][event] EXIT'); + }); + servers[i].on('SIGTERM', function() { + console.log('[benchmark][app][' + i +'][event] EXIT'); + }); + servers[i].on('SIGINT', function() { + console.log('[benchmark][app][' + i +'][event] EXIT'); + }); } process.on('exit', function() {
aa044b333981737f5abf7f3f620965af043aa914
package.js
package.js
Package.describe({ name: 'staringatlights:autoform-generic-error', version: '1.0.0', // Brief, one-line summary of the package. summary: 'Enables generic error handling in AutoForm.', // URL to the Git repository containing the source code for this package. git: 'https://github.com/abecks/meteor-autoform-generic-error', // By default, Meteor will default to using README.md for documentation. // To avoid submitting documentation, set this field to null. documentation: 'README.md' }); Package.onUse(function(api) { api.versionsFrom('1.1.0.3'); api.use(['templating', 'aldeed:autoform@5.3.0'], 'client'); api.addFiles('autoform-generic-error.html', 'client'); api.addFiles('autoform-generic-error.js', 'client'); });
Package.describe({ name: 'staringatlights:autoform-generic-error', version: '1.0.0', // Brief, one-line summary of the package. summary: 'Enables generic error handling in AutoForm.', // URL to the Git repository containing the source code for this package. git: 'https://github.com/abecks/meteor-autoform-generic-error', // By default, Meteor will default to using README.md for documentation. // To avoid submitting documentation, set this field to null. documentation: 'README.md' }); Package.onUse(function(api) { api.versionsFrom('1.1.0.3'); api.use(['templating', 'aldeed:autoform'], 'client'); api.addFiles('autoform-generic-error.html', 'client'); api.addFiles('autoform-generic-error.js', 'client'); });
Remove version constaint on AutoForm
Remove version constaint on AutoForm
JavaScript
mit
abecks/meteor-autoform-generic-error,abecks/meteor-autoform-generic-error
--- +++ @@ -12,7 +12,7 @@ Package.onUse(function(api) { api.versionsFrom('1.1.0.3'); - api.use(['templating', 'aldeed:autoform@5.3.0'], 'client'); + api.use(['templating', 'aldeed:autoform'], 'client'); api.addFiles('autoform-generic-error.html', 'client'); api.addFiles('autoform-generic-error.js', 'client'); });
0c8ac4b02930dc5ea3dbec668ac5077f0d834237
lib/requiredKeys.js
lib/requiredKeys.js
module.exports = [ { type: 'bitcoin', purpose: 'payment' }, { type: 'bitcoin', purpose: 'messaging' }, { type: 'ec', purpose: 'sign' }, { type: 'ec', purpose: 'update' } ]
module.exports = [ { type: 'bitcoin', purpose: 'payment' }, { type: 'bitcoin', purpose: 'messaging' }, { type: 'ec', purpose: 'sign' }, { type: 'ec', purpose: 'update' }, { type: 'dsa', purpose: 'sign' } ]
Revert "don't require dsa key"
Revert "don't require dsa key" This reverts commit ce8f474a2832374f109129d9847cdce526ae318c.
JavaScript
mit
tradle/identity
--- +++ @@ -15,5 +15,9 @@ { type: 'ec', purpose: 'update' + }, + { + type: 'dsa', + purpose: 'sign' } ]
0e28a2b11bd735e90410736548b88acd5c910eaf
src/components/layout.js
src/components/layout.js
import React from 'react' import { StaticQuery, graphql } from 'gatsby' import Navigation from '../components/navigation' export default ({ children }) => ( <StaticQuery query={graphql` query NavigationQuery { allMongodbPlacardDevSportsAndCountries { edges { node { name countries { name } } } } } `} render={data => ( <div> <Navigation sports={data.allMongodbPlacardDevSportsAndCountries.edges} /> {children} </div> )} /> )
import React from 'react' import { StaticQuery, graphql } from 'gatsby' import Navigation from '../components/navigation' export default ({ children }) => ( <StaticQuery query={graphql` query NavigationQuery { allMongodbPlacardDevSportsAndCountries { edges { node { name countries { name } } } } } `} render={data => ( <> <Navigation sports={data.allMongodbPlacardDevSportsAndCountries.edges} /> {children} </> )} /> )
Use short syntax version for the Fragment.
Use short syntax version for the Fragment.
JavaScript
mit
LuisLoureiro/placard-wrapper
--- +++ @@ -19,12 +19,12 @@ } `} render={data => ( - <div> + <> <Navigation sports={data.allMongodbPlacardDevSportsAndCountries.edges} /> {children} - </div> + </> )} /> )