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
05b7b2045613cb6c7cc6507a0ade7028016c9df9
tests/unit/components/email-input-test.js
tests/unit/components/email-input-test.js
import Ember from 'ember'; import { moduleForComponent, test } from 'ember-qunit'; import startApp from '../../helpers/start-app'; var App; moduleForComponent('email-input', 'email-input component', { setup: function() { App = startApp(); }, teardown: function() { Ember.run(App, 'destroy'); }, unit: true }); test('masked values are correct', function(assert) { assert.expect(1); this.subject(); // append the component to the DOM this.render(); // testing filled in value fillIn('input', 'test@test.test'); triggerEvent('input', 'blur'); andThen(function() { // wait for async helpers to complete assert.equal(find('input').val(), 'test@test.test'); }); }); test('unmasked values are correct', function(assert) { assert.expect(1); var component = this.subject(); // append the component to the DOM this.render(); // testing default value fillIn('input', 'test@test.test'); triggerEvent('input', 'blur'); andThen(function() { // wait for async helpers to complete assert.equal(component.get('unmaskedValue'), 'testtesttest'); }); });
import Ember from 'ember'; import { moduleForComponent, test } from 'ember-qunit'; import startApp from '../../helpers/start-app'; var App; moduleForComponent('email-input', 'email-input component', { setup: function() { App = startApp(); }, teardown: function() { Ember.run(App, 'destroy'); }, unit: true }); test('masked values are correct', function(assert) { assert.expect(1); this.subject(); // append the component to the DOM this.render(); // testing filled in value fillIn('input', 'test@test.test'); triggerEvent('input', 'blur'); andThen(function() { // wait for async helpers to complete assert.equal(find('input').val(), 'test@test.test'); }); }); // Test below is failing because of wrong assertion of unmaskedValue // The unmasked value in the case of email-input will always be same as // masked input. // test('unmasked values are correct', function(assert) { // assert.expect(1); // // var component = this.subject(); // // // append the component to the DOM // this.render(); // // // testing default value // fillIn('input', 'test@test.test'); // triggerEvent('input', 'blur'); // andThen(function() { // wait for async helpers to complete // assert.equal(component.get('unmaskedValue'), 'testtesttest'); // }); // });
Comment out faulty email-input assertion test
Comment out faulty email-input assertion test
JavaScript
mit
pzuraq/ember-inputmask,blimmer/ember-inputmask,blimmer/ember-inputmask,pzuraq/ember-inputmask
--- +++ @@ -29,18 +29,22 @@ }); }); -test('unmasked values are correct', function(assert) { - assert.expect(1); +// Test below is failing because of wrong assertion of unmaskedValue +// The unmasked value in the case of email-input will always be same as +// masked input. - var component = this.subject(); - - // append the component to the DOM - this.render(); - - // testing default value - fillIn('input', 'test@test.test'); - triggerEvent('input', 'blur'); - andThen(function() { // wait for async helpers to complete - assert.equal(component.get('unmaskedValue'), 'testtesttest'); - }); -}); +// test('unmasked values are correct', function(assert) { +// assert.expect(1); +// +// var component = this.subject(); +// +// // append the component to the DOM +// this.render(); +// +// // testing default value +// fillIn('input', 'test@test.test'); +// triggerEvent('input', 'blur'); +// andThen(function() { // wait for async helpers to complete +// assert.equal(component.get('unmaskedValue'), 'testtesttest'); +// }); +// });
28a144d15ebab7c5eaae35fc8fd432962da25046
migrate/index.js
migrate/index.js
const mongoModel = require('./mongo-model'); const sqlModel = require('./sql-model'); function main() { sqlModel.sequelize.sync() .then(() => mongoModel.find({})) .then(users => { console.log('MongoDB query done. Length: ', users.length); let promises = []; for (let user of users) { promises.push(sqlModel.User.create({ refreshToken: user.tokens.refresh_token, accessToken: user.tokens.access_token, googleID: user.googleId, renewEnabled: user.renewEnabled, libraryLogin: user.libraryLogin, libraryPassword: user.libraryPassword, renewDate: user.renewDate, calendarEnabled: user.calendarEnabled, calendarName: user.calendarName, emailEnabled: user.emailEnabled, emailAddress: user.emailAddress, isAdmin: user.isAdmin })); promises.push(user.logs.map(log => { return sqlModel.Logs.create({ userID: user.googleId, time: log.time, message: log.message, level: log.level }) })); } return Promise.all(promises); }) .then(() => { console.log('Done'); process.exit(0); }); } main();
const mongoModel = require('./mongo-model'); const sqlModel = require('./sql-model'); function main() { sqlModel.sequelize.sync() .then(() => mongoModel.find({})) .then(users => { console.log('MongoDB query done. Length: ', users.length); let promises = []; for (let user of users) { let userReq = sqlModel.User.create({ refreshToken: user.tokens.refresh_token, accessToken: user.tokens.access_token, googleID: user.googleId, renewEnabled: user.renewEnabled, libraryLogin: user.libraryLogin, libraryPassword: user.libraryPassword, renewDate: user.renewDate, calendarEnabled: user.calendarEnabled, calendarName: user.calendarName, emailEnabled: user.emailEnabled, emailAddress: user.emailAddress, isAdmin: user.isAdmin }); let logReq = sqlModel.Logs.bulkCreate(user.logs.map(log => { return { userID: user.googleId, time: log.time, message: log.message, level: log.level } })); promises.push(userReq); promises.push(logReq); } return Promise.all(promises); }) .then(() => { console.log('Done'); process.exit(0); }); } main();
Use bulk operation in migration script for performance
FEAT: Use bulk operation in migration script for performance
JavaScript
mit
Holi0317/sms-library-helper,Holi0317/sms-library-helper,Holi0317/sms-library-helper,Holi0317/sms-library-helper
--- +++ @@ -8,7 +8,7 @@ console.log('MongoDB query done. Length: ', users.length); let promises = []; for (let user of users) { - promises.push(sqlModel.User.create({ + let userReq = sqlModel.User.create({ refreshToken: user.tokens.refresh_token, accessToken: user.tokens.access_token, googleID: user.googleId, @@ -21,16 +21,20 @@ emailEnabled: user.emailEnabled, emailAddress: user.emailAddress, isAdmin: user.isAdmin - })); + }); - promises.push(user.logs.map(log => { - return sqlModel.Logs.create({ + let logReq = sqlModel.Logs.bulkCreate(user.logs.map(log => { + return { userID: user.googleId, time: log.time, message: log.message, level: log.level - }) + } })); + + promises.push(userReq); + promises.push(logReq); + } return Promise.all(promises); })
386c6336dd96ca76768ff0245eef00bfbd0b167c
newrelic.js
newrelic.js
'use strict' /** * New Relic agent configuration. * * See lib/config.defaults.js in the agent distribution for a more complete * description of configuration variables and their potential values. */ exports.config = { /** * Array of application names. */ app_name: ['My Application'], /** * Your New Relic license key. */ license_key: 'license key here', logging: { /** * Level at which to log. 'trace' is most useful to New Relic when diagnosing * issues with the agent, 'info' and higher will impose the least overhead on * production applications. */ level: 'info' } }
'use strict' /** * New Relic agent configuration. * * See lib/config.defaults.js in the agent distribution for a more complete * description of configuration variables and their potential values. */ exports.config = { /** * Array of application names. */ app_name: [process.env.BLINK_NEW_RELIC_APP_NAME], /** * Your New Relic license key. */ license_key: process.env.BLINK_NEW_RELIC_LICENSE_KEY, logging: { /** * Level at which to log. 'trace' is most useful to New Relic when diagnosing * issues with the agent, 'info' and higher will impose the least overhead on * production applications. */ level: process.env.BLINK_NEW_RELIC_LOGGING_LEVEL, } }
Configure New Relic from env vars
Configure New Relic from env vars
JavaScript
mit
DoSomething/blink,DoSomething/blink
--- +++ @@ -10,17 +10,17 @@ /** * Array of application names. */ - app_name: ['My Application'], + app_name: [process.env.BLINK_NEW_RELIC_APP_NAME], /** * Your New Relic license key. */ - license_key: 'license key here', + license_key: process.env.BLINK_NEW_RELIC_LICENSE_KEY, logging: { /** * Level at which to log. 'trace' is most useful to New Relic when diagnosing * issues with the agent, 'info' and higher will impose the least overhead on * production applications. */ - level: 'info' + level: process.env.BLINK_NEW_RELIC_LOGGING_LEVEL, } }
6498f1040644407b5b28d52c54e959d94fa40865
brunch-config.js
brunch-config.js
module.exports.config = { files: { javascripts: { joinTo: { "js/app.js": /^app/, "js/vendor.js": /^(?!app)/ }, order: { before: [ "bower_components/jquery/dist/jquery.js", "bower_components/underscore/underscore.js", "bower_components/react/react.js" ] } }, stylesheets: { joinTo: "css/app.css" }, templates: { joinTo: "js/app.js" } }, plugins: { react: { autoIncludeCommentBlock: true, harmony: true, transformOptions : { sourceMap : true } }, reactTags: { verbose: true } }, server: { port: 3333, run: true } };
module.exports.config = { files: { javascripts: { joinTo: { "js/app.js": /^app/, "js/vendor.js": /^(?!app)/ }, order: { before: [ "bower_components/jquery/dist/jquery.js", "bower_components/underscore/underscore.js", "bower_components/bluebird/js/browser/bluebird.js", "bower_components/react/react.js" ] } }, stylesheets: { joinTo: "css/app.css" }, templates: { joinTo: "js/app.js" } }, plugins: { react: { autoIncludeCommentBlock: true, harmony: true, transformOptions : { sourceMap : true } }, reactTags: { verbose: true } }, server: { path: 'app.js', port: 3333, run: true } };
Use express server instead of brunch default
Use express server instead of brunch default
JavaScript
mit
chubas/instaband,gdljs/instaband,gdljs/instaband,chubas/instaband
--- +++ @@ -9,6 +9,7 @@ before: [ "bower_components/jquery/dist/jquery.js", "bower_components/underscore/underscore.js", + "bower_components/bluebird/js/browser/bluebird.js", "bower_components/react/react.js" ] } @@ -35,6 +36,7 @@ } }, server: { + path: 'app.js', port: 3333, run: true }
eca9c24ce69b92dfb9d97424c8dd67518dcf3489
tutorials/barChart/barChart.js
tutorials/barChart/barChart.js
function makeBarChart() { var xScale = new Plottable.OrdinalScale().rangeType("bands"); var yScale = new Plottable.LinearScale(); var xAxis = new Plottable.XAxis(xScale, "bottom", function(d) { return d; }); var yAxis = new Plottable.YAxis(yScale, "left"); var renderer = new Plottable.BarRenderer(barData, xScale, yScale) .project("x", "category", xScale) .project("y", "value", yScale) .project("fill", function() { return "steelblue"; } ); yScale.padDomain(); var chart = new Plottable.Table([ [yAxis, renderer], [null, xAxis ] ]); chart.renderTo("#bar-chart"); }
function makeBarChart() { var xScale = new Plottable.OrdinalScale().rangeType("bands"); var yScale = new Plottable.LinearScale(); var xAxis = new Plottable.XAxis(xScale, "bottom", function(d) { return d; }); var yAxis = new Plottable.YAxis(yScale, "left"); var renderer = new Plottable.BarRenderer(barData, xScale, yScale) .project("x", "category", xScale) .project("y", "value", yScale) .project("fill", function() { return "steelblue"; } ); var chart = new Plottable.Table([ [yAxis, renderer], [null, xAxis ] ]); chart.renderTo("#bar-chart"); }
Remove padding call from tutorial.
Remove padding call from tutorial.
JavaScript
mit
iobeam/plottable,RobertoMalatesta/plottable,softwords/plottable,iobeam/plottable,jacqt/plottable,danmane/plottable,RobertoMalatesta/plottable,onaio/plottable,NextTuesday/plottable,onaio/plottable,alyssaq/plottable,gdseller/plottable,iobeam/plottable,gdseller/plottable,palantir/plottable,gdseller/plottable,NextTuesday/plottable,danmane/plottable,jacqt/plottable,RobertoMalatesta/plottable,palantir/plottable,palantir/plottable,softwords/plottable,jacqt/plottable,softwords/plottable,onaio/plottable,palantir/plottable,alyssaq/plottable,alyssaq/plottable,NextTuesday/plottable,danmane/plottable
--- +++ @@ -8,7 +8,6 @@ .project("x", "category", xScale) .project("y", "value", yScale) .project("fill", function() { return "steelblue"; } ); - yScale.padDomain(); var chart = new Plottable.Table([ [yAxis, renderer],
4b6e340e7683e57a5747d4b3b57e419d4f1545fa
bootstrap.js
bootstrap.js
var slice = [].slice var util = require('util') exports.createInterrupterCreator = function (_Error) { return function (path) { var ejector = function (name, depth, context, properties) { var vargs = slice.call(arguments) name = vargs.shift() typeof vargs[0] == 'number' ? depth = vargs.shift() : 4 context = vargs.shift() || {} properties = vargs.shift() || {} var keys = Object.keys(context) var body = '' var dump = '' var stack = '' if (keys != 0) { var cause = null body = '\n' if (context.cause) { cause = properties.cause = context.cause delete context.cause keys-- } if (keys != 0) { dump = '\n' + util.inspect(context, { depth: depth }) + '\n' } if (cause != null) { dump += '\ncause: ' + cause.stack + '\n\nstack:' } } message = path + ':' + name + body + dump var error = new Error(message) for (var key in properties) { error[key] = properties[key] } if (_Error.captureStackTrace) { _Error.captureStackTrace(error, ejector) } return error } return ejector } }
var slice = [].slice var util = require('util') exports.createInterrupterCreator = function (_Error) { return function (path) { var ejector = function (name, depth, context, properties) { var vargs = slice.call(arguments) name = vargs.shift() typeof vargs[0] == 'number' ? depth = vargs.shift() : 4 context = vargs.shift() || {} properties = vargs.shift() || {} var keys = Object.keys(context) var body = '' var dump = '' var stack = '' if (keys != 0) { var cause = null body = '\n' if (context.cause) { cause = properties.cause = context.cause delete context.cause keys-- } if (keys != 0) { dump = '\n' + util.inspect(context, { depth: depth }) + '\n' } if (cause != null) { dump += '\ncause: ' + cause.stack + '\n\nstack:' } } var message = path + ':' + name + body + dump var error = new Error(message) for (var key in properties) { error[key] = properties[key] } if (_Error.captureStackTrace) { _Error.captureStackTrace(error, ejector) } return error } return ejector } }
Fix variable leak to global namespace.
Fix variable leak to global namespace.
JavaScript
mit
bigeasy/interrupt
--- +++ @@ -28,7 +28,7 @@ dump += '\ncause: ' + cause.stack + '\n\nstack:' } } - message = path + ':' + name + body + dump + var message = path + ':' + name + body + dump var error = new Error(message) for (var key in properties) { error[key] = properties[key]
0897f65359bb90e777866f9af6be8601ed5062c4
src/js/UserAPI.js
src/js/UserAPI.js
/* global console, MashupPlatform */ var UserAPI = (function () { "use strict"; var url = "https://account.lab.fiware.org/user"; /***************************************************************** * C O N S T R U C T O R * *****************************************************************/ function UserAPI () { } /******************************************************************/ /* P R I V A T E F U N C T I O N S */ /******************************************************************/ function getUser(accessToken, success, error) { MashupPlatform.http.makeRequest(url + "/?access_token=" + accessToken, { method: 'GET', requestHeaders: { "X-FI-WARE-OAuth-Token": "true", "X-FI-WARE-OAuth-Header-Name": "X-Auth-Token" }, onSuccess: success, onError: error }); } function test(success, error) { } /******************************************************************/ /* P U B L I C F U N C T I O N S */ /******************************************************************/ UserAPI.prototype = { getUser: function (accessToken, success, error) { getUser(accessToken, success, error); }, test: function (success, error) { test(success, error); } }; return UserAPI; })();
/* global console, MashupPlatform */ var UserAPI = (function () { "use strict"; var url = "https://account.lab.fiware.org/user"; /***************************************************************** * C O N S T R U C T O R * *****************************************************************/ function UserAPI () { } /******************************************************************/ /* P R I V A T E F U N C T I O N S */ /******************************************************************/ function getUser(success, error) { MashupPlatform.http.makeRequest(url, { method: 'GET', requestHeaders: { "X-FI-WARE-OAuth-Token": "true", //"X-FI-WARE-OAuth-Header-Name": "X-Auth-Token" "x-fi-ware-oauth-get-parameter": "access_token" }, onSuccess: success, onError: error }); } function test(success, error) { } /******************************************************************/ /* P U B L I C F U N C T I O N S */ /******************************************************************/ UserAPI.prototype = { getUser: function (accessToken, success, error) { getUser(accessToken, success, error); }, test: function (success, error) { test(success, error); } }; return UserAPI; })();
Update user api to real functionaliy
Update user api to real functionaliy
JavaScript
apache-2.0
fidash/widget-calendar,fidash/widget-calendar
--- +++ @@ -3,7 +3,7 @@ var UserAPI = (function () { "use strict"; - var url = "https://account.lab.fiware.org/user"; + var url = "https://account.lab.fiware.org/user"; /***************************************************************** * C O N S T R U C T O R * @@ -16,12 +16,13 @@ /******************************************************************/ /* P R I V A T E F U N C T I O N S */ /******************************************************************/ - function getUser(accessToken, success, error) { - MashupPlatform.http.makeRequest(url + "/?access_token=" + accessToken, { + function getUser(success, error) { + MashupPlatform.http.makeRequest(url, { method: 'GET', requestHeaders: { "X-FI-WARE-OAuth-Token": "true", - "X-FI-WARE-OAuth-Header-Name": "X-Auth-Token" + //"X-FI-WARE-OAuth-Header-Name": "X-Auth-Token" + "x-fi-ware-oauth-get-parameter": "access_token" }, onSuccess: success, onError: error
9d311a37f5381ed26a7e212966f30d5a14bc60ca
src/lib/common.js
src/lib/common.js
/* * Copyright (c) 2013 Csernik Flaviu Andrei * * See the file LICENSE.txt for copying permission. * */ "use strict"; function PropertyNotInitialized(obj, propName) { this.property = propName; this.obj = obj; } PropertyNotInitialized.prototype.toString = function () { return this.obj + " : " + this.property + " not initialized."; }; function isInteger(n) { return typeof n === "number" && Math.floor(n) == n; } function checkNat(callerName, n) { if (isInteger) { if (value <= 0) { throw new RangeError("downsampleFactor must be a positive." + "given number is not: " + value); } } else { throw new TypeError("downsampleFactor accepts an integer but" + "given type is " + typeof value); } }
/* * Copyright (c) 2013 Csernik Flaviu Andrei * * See the file LICENSE.txt for copying permission. * */ "use strict"; window.AudioContext = window.AudioContext || window.webkitAudioContext; function PropertyNotInitialized(obj, propName) { this.property = propName; this.obj = obj; } PropertyNotInitialized.prototype.toString = function () { return this.obj + " : " + this.property + " not initialized."; }; function isInteger(n) { return typeof n === "number" && Math.floor(n) == n; } function checkNat(callerName, n) { if (isInteger) { if (value <= 0) { throw new RangeError("downsampleFactor must be a positive." + "given number is not: " + value); } } else { throw new TypeError("downsampleFactor accepts an integer but" + "given type is " + typeof value); } }
Fix AudioContext not define reference error.
Fix AudioContext not define reference error.
JavaScript
mit
archblob/amit
--- +++ @@ -6,6 +6,8 @@ */ "use strict"; + +window.AudioContext = window.AudioContext || window.webkitAudioContext; function PropertyNotInitialized(obj, propName) { this.property = propName;
45ec083349602a01eacfaf7416e48c9fb2cd5ca7
test/host/rhino.js
test/host/rhino.js
/*jshint rhino:true*/ print("Rhino showcase"); load("src/boot.js"); java.lang.System.exit(0);
/*jshint rhino:true*/ print("Rhino showcase"); /*exported gpfSourcesPath*/ var gpfSourcesPath = "src/"; load("src/boot.js"); java.lang.System.exit(0);
Allow boot by specifying the source path
Allow boot by specifying the source path
JavaScript
mit
ArnaudBuchholz/gpf-js,ArnaudBuchholz/gpf-js
--- +++ @@ -1,5 +1,6 @@ /*jshint rhino:true*/ print("Rhino showcase"); +/*exported gpfSourcesPath*/ +var gpfSourcesPath = "src/"; load("src/boot.js"); - java.lang.System.exit(0);
d2a4451e43db96c425f5546ed5b9fe08bb1588df
website/static/js/clipboard.js
website/static/js/clipboard.js
'use strict'; var $ = require('jquery'); var Clipboard = require('clipboard'); var setTooltip = function (elm, message) { $(elm).tooltip('hide') .attr('title', message) .tooltip('show'); } var hideTooltip = function (elm) { setTimeout(function() { $(elm).tooltip('hide'); }, 2000); } var makeClient = function(elm) { var $elm = $(elm); var client = new Clipboard(elm); client.on('success', function(e){ setTooltip(e.trigger, 'Copied!'); hideTooltip(e.trigger); }); client.on('error', function(e){ setTooltip(e.trigger, 'Copy failed!'); hideTooltip(e.trigger); }); return client; }; module.exports = makeClient;
'use strict'; var $ = require('jquery'); var Clipboard = require('clipboard'); var setTooltip = function (elm, message) { $(elm).tooltip('hide') .attr('title', message) .tooltip('show'); }; var hideTooltip = function (elm) { setTimeout(function() { $(elm).tooltip('hide'); }, 2000); }; var makeClient = function(elm) { var $elm = $(elm); var client = new Clipboard(elm); client.on('success', function(e){ setTooltip(e.trigger, 'Copied!'); hideTooltip(e.trigger); }); client.on('error', function(e){ setTooltip(e.trigger, 'Copy failed!'); hideTooltip(e.trigger); }); return client; }; module.exports = makeClient;
Fix styling issues for travis tests
Fix styling issues for travis tests
JavaScript
apache-2.0
Johnetordoff/osf.io,sloria/osf.io,icereval/osf.io,felliott/osf.io,baylee-d/osf.io,felliott/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,chennan47/osf.io,mfraezz/osf.io,TomBaxter/osf.io,crcresearch/osf.io,mattclark/osf.io,adlius/osf.io,caneruguz/osf.io,TomBaxter/osf.io,saradbowman/osf.io,HalcyonChimera/osf.io,icereval/osf.io,leb2dg/osf.io,caneruguz/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,laurenrevere/osf.io,sloria/osf.io,baylee-d/osf.io,laurenrevere/osf.io,binoculars/osf.io,chennan47/osf.io,caseyrollins/osf.io,aaxelb/osf.io,mfraezz/osf.io,adlius/osf.io,Johnetordoff/osf.io,leb2dg/osf.io,chrisseto/osf.io,sloria/osf.io,cslzchen/osf.io,crcresearch/osf.io,CenterForOpenScience/osf.io,mfraezz/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,TomBaxter/osf.io,brianjgeiger/osf.io,aaxelb/osf.io,HalcyonChimera/osf.io,cslzchen/osf.io,caseyrollins/osf.io,erinspace/osf.io,erinspace/osf.io,felliott/osf.io,adlius/osf.io,binoculars/osf.io,CenterForOpenScience/osf.io,mattclark/osf.io,aaxelb/osf.io,caneruguz/osf.io,laurenrevere/osf.io,saradbowman/osf.io,brianjgeiger/osf.io,leb2dg/osf.io,leb2dg/osf.io,cslzchen/osf.io,caneruguz/osf.io,CenterForOpenScience/osf.io,pattisdr/osf.io,chrisseto/osf.io,chrisseto/osf.io,HalcyonChimera/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,chennan47/osf.io,caseyrollins/osf.io,adlius/osf.io,pattisdr/osf.io,mattclark/osf.io,crcresearch/osf.io,felliott/osf.io,pattisdr/osf.io,icereval/osf.io,binoculars/osf.io,chrisseto/osf.io,baylee-d/osf.io,erinspace/osf.io
--- +++ @@ -7,13 +7,13 @@ $(elm).tooltip('hide') .attr('title', message) .tooltip('show'); -} +}; var hideTooltip = function (elm) { setTimeout(function() { $(elm).tooltip('hide'); }, 2000); -} +}; var makeClient = function(elm) { var $elm = $(elm);
593695be54f4e68a613cdb1b514ae90d1a3cb362
client/scripts/app.js
client/scripts/app.js
'use strict'; (function() { angular.module('bifrost',[ 'lumx', 'ui.router', 'lbServices', 'leaflet-directive', 'ngMaterial', 'angularFileUpload' ]) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('main', { url: '/', templateUrl: 'views/main.html' }) .state('project', { url: '/projects/:id', templateUrl: 'views/project.html', controller: 'ProjectController' }) .state('create', { url: '/create', templateUrl: 'views/create.html', controller: 'CreateController' }) .state('projects', { url: '/projects', templateUrl: 'views/projects.html', controller: 'ProjectsController' }).state('login', { url: '/login', templateUrl: 'views/login.html' }); $urlRouterProvider.otherwise('/'); }); })();
'use strict'; (function() { angular.module('bifrost',[ 'lumx', 'ui.router', 'lbServices', 'leaflet-directive', 'ngMaterial', 'angularFileUpload' ]) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('main', { url: '/', templateUrl: 'views/main.html' }) .state('project', { url: '/projects/:id', templateUrl: 'views/project.html', controller: 'ProjectController' }) .state('create', { url: '/create', templateUrl: 'views/create.html', controller: 'CreateController' }) .state('projects', { url: '/projects', templateUrl: 'views/projects.html', controller: 'ProjectsController' }).state('login', { url: '/login', templateUrl: 'views/login.html' }); $urlRouterProvider.otherwise('/'); }) .run(function($rootScope, $location, Supporter) { $rootScope.$on('$stateChangeStart', function(event, next) { Supporter.getCurrent().$promise .then(function(user) { if (!user) { $location.url('/login'); } }) .catch(function() { $location.url('/login'); }); }); }); })();
Return to login page if didn't login
Return to login page if didn't login
JavaScript
mit
bifrostio/bifrost,bifrostio/bifrost
--- +++ @@ -35,5 +35,18 @@ }); $urlRouterProvider.otherwise('/'); + }) + .run(function($rootScope, $location, Supporter) { + $rootScope.$on('$stateChangeStart', function(event, next) { + Supporter.getCurrent().$promise + .then(function(user) { + if (!user) { + $location.url('/login'); + } + }) + .catch(function() { + $location.url('/login'); + }); + }); }); })();
b25451ded86bab0ed28424131e1a826b4479c69f
rules/core/constants.js
rules/core/constants.js
'use strict'; const COMPOSITION_METHODS = ['compose', 'flow', 'flowRight', 'pipe']; const FOREACH_METHODS = ['forEach', 'forEachRight', 'each', 'eachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight']; const SIDE_EFFECT_METHODS = FOREACH_METHODS.concat(['bindAll']); module.exports = { COMPOSITION_METHODS, FOREACH_METHODS, SIDE_EFFECT_METHODS };
'use strict'; const COMPOSITION_METHODS = ['compose', 'flow', 'flowRight', 'pipe']; const FOREACH_METHODS = ['forEach', 'forEachRight', 'each', 'eachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight']; const SIDE_EFFECT_METHODS = FOREACH_METHODS.concat(['bindAll', 'defer', 'delay']); module.exports = { COMPOSITION_METHODS, FOREACH_METHODS, SIDE_EFFECT_METHODS };
Add defer and delay as side-effect methods
Add defer and delay as side-effect methods
JavaScript
mit
jfmengels/eslint-plugin-lodash-fp
--- +++ @@ -2,7 +2,7 @@ const COMPOSITION_METHODS = ['compose', 'flow', 'flowRight', 'pipe']; const FOREACH_METHODS = ['forEach', 'forEachRight', 'each', 'eachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight']; -const SIDE_EFFECT_METHODS = FOREACH_METHODS.concat(['bindAll']); +const SIDE_EFFECT_METHODS = FOREACH_METHODS.concat(['bindAll', 'defer', 'delay']); module.exports = { COMPOSITION_METHODS,
c5fdf4c1da80aea1d05a1ba84a03252af371f819
server/config/config.js
server/config/config.js
var path = require('path'); var rootPath = path.normalize(__dirname + '/../../'); module.exports = { local: { baseUrl: 'http://localhost:3051', db: 'mongodb://localhost/rp_local', rootPath: rootPath, port: process.env.PORT || 3051 }, staging : { baseUrl: 'http://dev.resourceprojects.org', //db: '@aws-us-east-1-portal.14.dblayer.com:10669/rp_dev?ssl=true', db: '@aws-us-east-1-portal.14.dblayer.com:10669,aws-us-east-1-portal.13.dblayer.com:10499/rp_dev?ssl=true', rootPath: rootPath, port: process.env.PORT || 80 } };
var path = require('path'); var rootPath = path.normalize(__dirname + '/../../'); module.exports = { local: { baseUrl: 'http://localhost:3030', db: 'mongodb://localhost/rp_local', rootPath: rootPath, port: process.env.PORT || 3016 }, staging : { baseUrl: 'http://dev.resourceprojects.org', //db: '@aws-us-east-1-portal.14.dblayer.com:10669/rp_dev?ssl=true', db: '@aws-us-east-1-portal.14.dblayer.com:10669,aws-us-east-1-portal.13.dblayer.com:10499/rp_dev?ssl=true', rootPath: rootPath, port: process.env.PORT || 80 } };
Add to download links ng-csv
Add to download links ng-csv
JavaScript
mit
NRGI/rp-org-frontend,NRGI/rp-org-frontend
--- +++ @@ -3,10 +3,10 @@ module.exports = { local: { - baseUrl: 'http://localhost:3051', + baseUrl: 'http://localhost:3030', db: 'mongodb://localhost/rp_local', rootPath: rootPath, - port: process.env.PORT || 3051 + port: process.env.PORT || 3016 }, staging : { baseUrl: 'http://dev.resourceprojects.org',
66b3fb8e7f084eda5d25c6d17af213d1596649a7
tests/.eslintrc.js
tests/.eslintrc.js
module.exports = { 'extends': '../.eslintrc.js', 'env': { 'mocha': true }, 'rules': { 'func-names': 0, 'no-unused-expressions': 0, 'no-console': 0, // These are said to be deprecated, but we use them in tests. 'react/no-find-dom-node': 0, 'react/no-render-return-value': 0, }, 'globals': { 'expect': false } };
module.exports = { 'extends': '../.eslintrc.js', 'env': { 'mocha': true }, 'rules': { 'func-names': 0, 'no-unused-expressions': 0, 'no-console': 0 }, 'globals': { 'expect': false } };
Enable back the findDOMNode and render lint rules
Enable back the findDOMNode and render lint rules
JavaScript
mit
NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet
--- +++ @@ -8,11 +8,7 @@ 'rules': { 'func-names': 0, 'no-unused-expressions': 0, - 'no-console': 0, - - // These are said to be deprecated, but we use them in tests. - 'react/no-find-dom-node': 0, - 'react/no-render-return-value': 0, + 'no-console': 0 }, 'globals': {
7c402a2c17fb491c5ea2ac212d4a89c15b093c5d
closure/goog/test_module.js
closure/goog/test_module.js
// Copyright 2014 The Closure Library Authors. All Rights Reserved. // // 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. /** * @fileoverview A test file for testing goog.module. * @suppress {unusedLocalVariables} */ goog.module('goog.test_module'); goog.setTestOnly('goog.test_module'); goog.module.declareLegacyNamespace(); /** @suppress {extraRequire} */ var testModuleDep = goog.require('goog.test_module_dep'); // Verify that when this module loads the script tag in the next // line doesn't cause the script tag it is loaded in to be closed // prematurely. var aScriptTagShouldntBreakAnything = '<script>hello</script>world'; /** @constructor */ var test = function() {}; // Verify that when this module loads the script tag is not modified by // escaping code in base.js. test.CLOSING_SCRIPT_TAG = '</script>'; exports = test;
// Copyright 2014 The Closure Library Authors. All Rights Reserved. // // 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. /** * @fileoverview A test file for testing goog.module. * @suppress {unusedLocalVariables} */ goog.module('goog.test_module'); goog.module.declareLegacyNamespace(); goog.setTestOnly('goog.test_module'); /** @suppress {extraRequire} */ var testModuleDep = goog.require('goog.test_module_dep'); // Verify that when this module loads the script tag in the next // line doesn't cause the script tag it is loaded in to be closed // prematurely. var aScriptTagShouldntBreakAnything = '<script>hello</script>world'; /** @constructor */ var test = function() {}; // Verify that when this module loads the script tag is not modified by // escaping code in base.js. test.CLOSING_SCRIPT_TAG = '</script>'; exports = test;
Move goog.module.declareLegacyNamespace() calls to be next to goog.module
Move goog.module.declareLegacyNamespace() calls to be next to goog.module ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=271418472
JavaScript
apache-2.0
google/closure-library,lucidsoftware/closure-library,lucidsoftware/closure-library,lucidsoftware/closure-library,google/closure-library,lucidsoftware/closure-library,google/closure-library,google/closure-library,google/closure-library
--- +++ @@ -18,8 +18,8 @@ */ goog.module('goog.test_module'); +goog.module.declareLegacyNamespace(); goog.setTestOnly('goog.test_module'); -goog.module.declareLegacyNamespace(); /** @suppress {extraRequire} */
117ce3f5b86de2ec4d773537bd88c9f2e9d38391
split-file-cli.js
split-file-cli.js
#!/usr/bin/env node var split = require('./split-file.js'); if (require.main === module) { cli(); } function cli() { var option = process.argv[2]; switch (option) { case '-m': cliMerge(); break; case '-s': cliSplit(); break; default: console.log("Choose a option -s for split -m for merge"); } } function cliSplit() { var file = process.argv[3]; var parts = process.argv[4]; split.splitFile(file, parts, function (err, names) { console.log(err + ' : ' + names); }); } function cliMerge() { var files = []; var output_file = process.argv[3]; for (var i = 4; i < process.argv.length; i++) { files.push(process.argv[i]); } split.mergeFiles(files, output_file, function (err, names) { console.log(err + ' : ' + names); }); }
#!/usr/bin/env node var split = require('./split-file.js'); if (require.main === module) { cli(); } function cli() { var option = process.argv[2]; switch (option) { case '-m': cliMerge(); break; case '-s': cliSplit(); break; default: printLegend(); } } function cliSplit() { var file = process.argv[3]; var parts = parseInt(process.argv[4]); if (isNaN(parts)) { return printLegend(); } split.splitFile(file, parts, function (err, names) { if (err) { console.log('An error occured:'); console.log(err); return; } console.log('Successfully splitted into: ' + names); }); } function cliMerge() { var files = []; var output_file = process.argv[3]; for (var i = 4; i < process.argv.length; i++) { files.push(process.argv[i]); } split.mergeFiles(files, output_file, function (err, names) { if (err) { console.log('An error occured:'); console.log(err); return; } console.log('Succesfully merged the parts into ' + output_file); }); } function printLegend() { console.log("Usage: split-file -s input.bin 5"); console.log(" split-file -m output.bin part1 part2 ..."); console.log(""); console.log(" -s <input> <num_parts>"); console.log(" Split the input file in the number of parts given."); console.log(""); console.log(" -m <output> <part> <part> ..."); console.log(" Merge the given parts into the output file."); console.log(""); console.log(""); console.log("NPM Module 'split-file' by Tom Valk."); console.log("Visit https://github.com/tomvlk/node-split-file for info and help."); }
Add legend for the CLI tool helping new users to understand the CLI commands.
[FEATURE] Add legend for the CLI tool helping new users to understand the CLI commands.
JavaScript
mit
tomvlk/node-split-file
--- +++ @@ -16,16 +16,26 @@ cliSplit(); break; default: - console.log("Choose a option -s for split -m for merge"); + printLegend(); } } function cliSplit() { var file = process.argv[3]; - var parts = process.argv[4]; + var parts = parseInt(process.argv[4]); + + if (isNaN(parts)) { + return printLegend(); + } split.splitFile(file, parts, function (err, names) { - console.log(err + ' : ' + names); + if (err) { + console.log('An error occured:'); + console.log(err); + return; + } + + console.log('Successfully splitted into: ' + names); }); } @@ -38,6 +48,27 @@ } split.mergeFiles(files, output_file, function (err, names) { - console.log(err + ' : ' + names); + if (err) { + console.log('An error occured:'); + console.log(err); + return; + } + + console.log('Succesfully merged the parts into ' + output_file); }); } + +function printLegend() { + console.log("Usage: split-file -s input.bin 5"); + console.log(" split-file -m output.bin part1 part2 ..."); + console.log(""); + console.log(" -s <input> <num_parts>"); + console.log(" Split the input file in the number of parts given."); + console.log(""); + console.log(" -m <output> <part> <part> ..."); + console.log(" Merge the given parts into the output file."); + console.log(""); + console.log(""); + console.log("NPM Module 'split-file' by Tom Valk."); + console.log("Visit https://github.com/tomvlk/node-split-file for info and help."); +}
cc2dc0d455685b8294dc9b23bdad33f715afafd6
src/background.js
src/background.js
'use strict'; chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('chrome.html', { 'bounds': { 'width': 1024, 'height': 768 } }); });
'use strict'; // check for update and restart app automatically chrome.runtime.onUpdateAvailable.addListener(function(details) { console.log("Updating to version " + details.version); chrome.runtime.reload(); }); chrome.runtime.requestUpdateCheck(function(status) { if (status === "update_found") { console.log("Update pending..."); } else if (status === "no_update") { console.log("No update found."); } else if (status === "throttled") { console.log("Checking updates too frequently."); } }); // open chrome app in new window chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('chrome.html', { 'bounds': { 'width': 1024, 'height': 768 } }); });
Check for updates on every start of teh chrome app and restart automatically.
Check for updates on every start of teh chrome app and restart automatically.
JavaScript
mit
sheafferusa/mail-html5,clochix/mail-html5,halitalf/mail-html5,kalatestimine/mail-html5,dopry/mail-html5,kalatestimine/mail-html5,whiteout-io/mail,whiteout-io/mail,tanx/hoodiecrow,halitalf/mail-html5,b-deng/mail-html5,dopry/mail-html5,whiteout-io/mail-html5,sheafferusa/mail-html5,whiteout-io/mail-html5,halitalf/mail-html5,whiteout-io/mail,sheafferusa/mail-html5,b-deng/mail-html5,tanx/hoodiecrow,sheafferusa/mail-html5,whiteout-io/mail,whiteout-io/mail-html5,clochix/mail-html5,clochix/mail-html5,b-deng/mail-html5,dopry/mail-html5,whiteout-io/mail-html5,clochix/mail-html5,tanx/hoodiecrow,halitalf/mail-html5,kalatestimine/mail-html5,b-deng/mail-html5,dopry/mail-html5,kalatestimine/mail-html5
--- +++ @@ -1,5 +1,21 @@ 'use strict'; +// check for update and restart app automatically +chrome.runtime.onUpdateAvailable.addListener(function(details) { + console.log("Updating to version " + details.version); + chrome.runtime.reload(); +}); +chrome.runtime.requestUpdateCheck(function(status) { + if (status === "update_found") { + console.log("Update pending..."); + } else if (status === "no_update") { + console.log("No update found."); + } else if (status === "throttled") { + console.log("Checking updates too frequently."); + } +}); + +// open chrome app in new window chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('chrome.html', { 'bounds': {
35bb630e30e6ec721a1b2dbfceccc8bdc6fef425
config/environment.js
config/environment.js
/* jshint node: true */ module.exports = function(environment) { var ENV = { environment: environment, baseURL: '/', locationType: 'hash', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { // Here you can pass flags/options to your application instance // when it is created } }; var execSync = require('exec-sync'); var gitStatus = execSync('git describe --long --abbrev=10 --all --always --dirty'); var parts = gitStatus.split('-'); var hash = parts[parts.length-1]; if (parts[parts.length-1] == 'dirty') { hash = parts[parts.length-2] + '-dirty'; } ENV.APP.version = require('../package.json').version + ' (' + hash + ')'; if (environment === 'development') { ENV.APP.LOG_RESOLVER = true; ENV.APP.LOG_ACTIVE_GENERATION = true; ENV.APP.LOG_MODULE_RESOLVER = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; ENV.APP.LOG_VIEW_LOOKUPS = true; } if (environment === 'production') { } return ENV; };
/* jshint node: true */ module.exports = function(environment) { var ENV = { environment: environment, baseURL: '/', locationType: 'hash', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { // Here you can pass flags/options to your application instance // when it is created } }; var hash = '(unknown git revision)'; try { var execSync = require('exec-sync'); var gitStatus = execSync('git describe --long --abbrev=10 --all --always --dirty'); var parts = gitStatus.split('-'); var hash = parts[parts.length-1]; if (parts[parts.length-1] == 'dirty') { hash = parts[parts.length-2] + '-dirty'; } } catch(error) { console.error('exec-sync: git describe failed', error); } ENV.APP.version = require('../package.json').version + ' (' + hash + ')'; if (environment === 'development') { ENV.APP.LOG_RESOLVER = true; ENV.APP.LOG_ACTIVE_GENERATION = true; ENV.APP.LOG_MODULE_RESOLVER = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; ENV.APP.LOG_VIEW_LOOKUPS = true; } if (environment === 'production') { } return ENV; };
Handle exec-sync failure on Windows.
Handle exec-sync failure on Windows.
JavaScript
apache-2.0
fhchina/Klondike,Stift/Klondike,Stift/Klondike,fhchina/Klondike,fhchina/Klondike,Stift/Klondike,themotleyfool/Klondike,themotleyfool/Klondike,davidvmckay/Klondike,jochenvangasse/Klondike,themotleyfool/Klondike,jochenvangasse/Klondike,davidvmckay/Klondike,jochenvangasse/Klondike,davidvmckay/Klondike
--- +++ @@ -18,15 +18,20 @@ } }; - var execSync = require('exec-sync'); + var hash = '(unknown git revision)'; + try { + var execSync = require('exec-sync'); - var gitStatus = execSync('git describe --long --abbrev=10 --all --always --dirty'); + var gitStatus = execSync('git describe --long --abbrev=10 --all --always --dirty'); - var parts = gitStatus.split('-'); - var hash = parts[parts.length-1]; + var parts = gitStatus.split('-'); + var hash = parts[parts.length-1]; - if (parts[parts.length-1] == 'dirty') { - hash = parts[parts.length-2] + '-dirty'; + if (parts[parts.length-1] == 'dirty') { + hash = parts[parts.length-2] + '-dirty'; + } + } catch(error) { + console.error('exec-sync: git describe failed', error); } ENV.APP.version = require('../package.json').version + ' (' + hash + ')';
22b4fdbbef2d1fcff51334fa1ae5492345ec6576
packages/antwar/src/config/dev.js
packages/antwar/src/config/dev.js
import * as path from "path"; import merge from "webpack-merge"; import HtmlWebpackPlugin from "html-webpack-plugin"; import webpack from "webpack"; import getCommon from "./common"; module.exports = config => getCommon(config).then(function(commonConfig) { const devConfig = { cache: true, node: { __filename: true, fs: "empty", }, output: { path: path.join(process.cwd(), "./.antwar/build/"), filename: "[name].js", publicPath: "/", chunkFilename: "[chunkhash].js", }, plugins: [ new HtmlWebpackPlugin({ template: (config.antwar.template && config.antwar.template.file) || path.join(__dirname, "../../templates/page.ejs"), context: { cssFiles: [], jsFiles: [], ...config.template, }, }), new webpack.NamedModulesPlugin(), ], }; return merge(commonConfig, devConfig, config.webpack); });
import * as path from "path"; import merge from "webpack-merge"; import HtmlWebpackPlugin from "html-webpack-plugin"; import webpack from "webpack"; import getCommon from "./common"; module.exports = config => getCommon(config).then(function(commonConfig) { const template = config.antwar.template || {}; const devConfig = { node: { __filename: true, fs: "empty", }, output: { path: path.join(process.cwd(), "./.antwar/build/"), filename: "[name].js", publicPath: "/", chunkFilename: "[chunkhash].js", }, plugins: [ new HtmlWebpackPlugin({ template: template.file || path.join(__dirname, "../../templates/page.ejs"), context: { ...template.context, cssFiles: [], jsFiles: [], }, }), new webpack.NamedModulesPlugin(), ], }; return merge(commonConfig, devConfig, config.webpack); });
Allow initial context to be passed from antwar configuration
fix: Allow initial context to be passed from antwar configuration
JavaScript
mit
antwarjs/antwar
--- +++ @@ -6,8 +6,8 @@ module.exports = config => getCommon(config).then(function(commonConfig) { + const template = config.antwar.template || {}; const devConfig = { - cache: true, node: { __filename: true, fs: "empty", @@ -21,12 +21,11 @@ plugins: [ new HtmlWebpackPlugin({ template: - (config.antwar.template && config.antwar.template.file) || - path.join(__dirname, "../../templates/page.ejs"), + template.file || path.join(__dirname, "../../templates/page.ejs"), context: { + ...template.context, cssFiles: [], jsFiles: [], - ...config.template, }, }), new webpack.NamedModulesPlugin(),
e2d99cbda42e1993f667cbf09e9c20b6f325cdfe
src/reducers/Items.js
src/reducers/Items.js
import types from '../types' import createReducer from '../shared/create-reducer'; const initialState = [] function itemsRequest( state ){ return state } function itemsError( state ){ return state } function itemsSucess(state, action) { return { ...state, data: action.result } } function changeItemState(state, action){ let items = [] state.data.map(function (item) { if (item.id === action.id) { item.removed = !item.removed } items.push(item) }) return { ...state, data: items } } const handlers = { [types.ITEMS_REQUEST]: itemsRequest, [types.ITEMS_SUCESS]: itemsSucess, [types.ITEMS_ERROR]: itemsError, [types.CHANGE_ITEM_STATE]: changeItemState } export default createReducer( initialState, handlers );
import types from '../types' import createReducer from '../shared/create-reducer'; import Immutable from 'immutable' function itemsRequest( state ){ return state } function itemsError( state ){ return state } function itemsSucess(state, action) { return Immutable.List(action.result); } function changeItemState(state, action){ let items = state.map((item) => { if (item.id === action.id) { item.removed = !item.removed; } return item; }); return items; } const handlers = { [types.ITEMS_REQUEST]: itemsRequest, [types.ITEMS_SUCESS]: itemsSucess, [types.ITEMS_ERROR]: itemsError, [types.CHANGE_ITEM_STATE]: changeItemState } export default createReducer(handlers, []);
Create an inmutable list with server received data; refactor changeItemState
Create an inmutable list with server received data; refactor changeItemState
JavaScript
mit
atSistemas/react-base
--- +++ @@ -1,29 +1,24 @@ import types from '../types' import createReducer from '../shared/create-reducer'; - -const initialState = [] +import Immutable from 'immutable' function itemsRequest( state ){ return state } function itemsError( state ){ return state } function itemsSucess(state, action) { - return { ...state, data: action.result } + return Immutable.List(action.result); } function changeItemState(state, action){ - let items = [] - state.data.map(function (item) { + let items = state.map((item) => { if (item.id === action.id) { - item.removed = !item.removed + item.removed = !item.removed; } - items.push(item) - }) - - return { ...state, data: items } + return item; + }); + return items; } - - const handlers = { [types.ITEMS_REQUEST]: itemsRequest, @@ -32,4 +27,4 @@ [types.CHANGE_ITEM_STATE]: changeItemState } -export default createReducer( initialState, handlers ); +export default createReducer(handlers, []);
c2aa71310c99a5dd6d6c827afa9ee3f3ca2338c7
config/environment.js
config/environment.js
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'letnar-frontend', environment: environment, baseURL: '/', locationType: 'auto', adapterNamespace: 'api', contentSecurityPolicy: { 'connect-src': "*", 'script-src': "'unsafe-eval' *", }, EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { // Here you can pass flags/options to your application instance // when it is created } }; if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; ENV.APP.LOG_VIEW_LOOKUPS = true; } if (environment === 'test') { // Testem prefers this... ENV.baseURL = '/'; ENV.locationType = 'auto'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; ENV.APP.rootElement = '#ember-testing'; } if (environment === 'production') { ENV.baseURL = '/ember-map-demo'; ENV.adapterNamespace = 'ember-map-demo/api'; } return ENV; };
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'letnar-frontend', environment: environment, baseURL: '/', locationType: 'auto', adapterNamespace: 'api', contentSecurityPolicy: { 'connect-src': "*", 'script-src': "'unsafe-eval' *", }, EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { // Here you can pass flags/options to your application instance // when it is created } }; if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; ENV.APP.LOG_VIEW_LOOKUPS = true; } if (environment === 'test') { // Testem prefers this... ENV.baseURL = '/'; ENV.locationType = 'auto'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; ENV.APP.rootElement = '#ember-testing'; } if (environment === 'production') { ENV.baseURL = '/ember-map-demo'; ENV.adapterNamespace = 'ember-map-demo/api'; ENV.locationType = 'hash'; } return ENV; };
Use hash location type for Github pages.
Use hash location type for Github pages.
JavaScript
mit
simi/ember-map-demo,simi/ember-map-demo
--- +++ @@ -47,6 +47,7 @@ if (environment === 'production') { ENV.baseURL = '/ember-map-demo'; ENV.adapterNamespace = 'ember-map-demo/api'; + ENV.locationType = 'hash'; } return ENV;
14c1746ece7314d8c906aeb4272bb288a15947c3
website/addons/s3/static/s3-rubeus-cfg.js
website/addons/s3/static/s3-rubeus-cfg.js
(function(Rubeus) { Rubeus.cfg.s3 = { uploadMethod: 'PUT', uploadUrl: null, uploadAdded: function(file, item) { var self = this; var parent = self.getByID(item.parentID); var name = file.name; // Make it possible to upload into subfolders while (parent.depth > 1 && !parent.isAddonRoot) { name = parent.name + '/' + name; parent = self.getByID(parent.parentID); } file.destination = name; self.dropzone.options.signedUrlFrom = parent.urls.upload; }, uploadSending: function(file, formData, xhr) { xhr.setRequestHeader('Content-Type', file.type || 'application/octet-stream'); xhr.setRequestHeader('x-amz-acl', 'private'); }, uploadSuccess: function(file, item, data) { // FIXME: need to update the item with new data, but can't do that // from the returned data from S3 } }; })(Rubeus);
(function(Rubeus) { Rubeus.cfg.s3 = { uploadMethod: 'PUT', uploadUrl: null, uploadAdded: function(file, item) { var self = this; var parent = self.getByID(item.parentID); var name = file.name; // Make it possible to upload into subfolders while (parent.depth > 1 && !parent.isAddonRoot) { name = parent.name + '/' + name; parent = self.getByID(parent.parentID); } file.destination = name; self.dropzone.options.signedUrlFrom = parent.urls.upload; }, uploadSending: function(file, formData, xhr) { xhr.setRequestHeader('Content-Type', file.type || 'application/octet-stream'); xhr.setRequestHeader('x-amz-acl', 'private'); }, uploadSuccess: function(file, item, data) { item.urls = { 'delete': nodeApiUrl + 's3/delete/' + file.destination + '/', 'download': nodeApiUrl + 's3/download/' + file.destination + '/', 'view': '/' + nodeId + '/s3/view/' + file.destination + '/' } } }; })(Rubeus);
Update file after being uploaded.
Update file after being uploaded.
JavaScript
apache-2.0
Ghalko/osf.io,sloria/osf.io,bdyetton/prettychart,GageGaskins/osf.io,abought/osf.io,petermalcolm/osf.io,erinspace/osf.io,zachjanicki/osf.io,mluo613/osf.io,doublebits/osf.io,CenterForOpenScience/osf.io,jolene-esposito/osf.io,himanshuo/osf.io,lyndsysimon/osf.io,mluke93/osf.io,Johnetordoff/osf.io,danielneis/osf.io,caneruguz/osf.io,KAsante95/osf.io,zamattiac/osf.io,mattclark/osf.io,TomBaxter/osf.io,kushG/osf.io,cwisecarver/osf.io,zkraime/osf.io,laurenrevere/osf.io,caseyrygt/osf.io,alexschiller/osf.io,brianjgeiger/osf.io,billyhunt/osf.io,ZobairAlijan/osf.io,jnayak1/osf.io,TomHeatwole/osf.io,zkraime/osf.io,doublebits/osf.io,MerlinZhang/osf.io,binoculars/osf.io,jolene-esposito/osf.io,lamdnhan/osf.io,mluo613/osf.io,chennan47/osf.io,acshi/osf.io,samchrisinger/osf.io,lyndsysimon/osf.io,felliott/osf.io,haoyuchen1992/osf.io,caseyrollins/osf.io,ZobairAlijan/osf.io,ckc6cz/osf.io,jmcarp/osf.io,MerlinZhang/osf.io,hmoco/osf.io,Johnetordoff/osf.io,reinaH/osf.io,HalcyonChimera/osf.io,leb2dg/osf.io,haoyuchen1992/osf.io,asanfilippo7/osf.io,mluke93/osf.io,jmcarp/osf.io,sbt9uc/osf.io,cosenal/osf.io,TomHeatwole/osf.io,alexschiller/osf.io,jnayak1/osf.io,SSJohns/osf.io,KAsante95/osf.io,monikagrabowska/osf.io,samchrisinger/osf.io,dplorimer/osf,GageGaskins/osf.io,njantrania/osf.io,brandonPurvis/osf.io,asanfilippo7/osf.io,barbour-em/osf.io,samanehsan/osf.io,doublebits/osf.io,sbt9uc/osf.io,samanehsan/osf.io,lyndsysimon/osf.io,HalcyonChimera/osf.io,hmoco/osf.io,caneruguz/osf.io,kch8qx/osf.io,himanshuo/osf.io,rdhyee/osf.io,revanthkolli/osf.io,saradbowman/osf.io,kwierman/osf.io,mfraezz/osf.io,pattisdr/osf.io,dplorimer/osf,HalcyonChimera/osf.io,ckc6cz/osf.io,leb2dg/osf.io,ticklemepierce/osf.io,DanielSBrown/osf.io,barbour-em/osf.io,baylee-d/osf.io,kushG/osf.io,cosenal/osf.io,HarryRybacki/osf.io,adlius/osf.io,SSJohns/osf.io,cosenal/osf.io,kushG/osf.io,revanthkolli/osf.io,abought/osf.io,cwisecarver/osf.io,jeffreyliu3230/osf.io,petermalcolm/osf.io,MerlinZhang/osf.io,revanthkolli/osf.io,acshi/osf.io,caneruguz/osf.io,kch8qx/osf.io,reinaH/osf.io,alexschiller/osf.io,chennan47/osf.io,cldershem/osf.io,brandonPurvis/osf.io,alexschiller/osf.io,AndrewSallans/osf.io,danielneis/osf.io,acshi/osf.io,TomHeatwole/osf.io,dplorimer/osf,aaxelb/osf.io,zamattiac/osf.io,himanshuo/osf.io,emetsger/osf.io,HarryRybacki/osf.io,laurenrevere/osf.io,binoculars/osf.io,TomHeatwole/osf.io,sbt9uc/osf.io,fabianvf/osf.io,felliott/osf.io,kwierman/osf.io,zamattiac/osf.io,jinluyuan/osf.io,rdhyee/osf.io,reinaH/osf.io,arpitar/osf.io,chrisseto/osf.io,cldershem/osf.io,fabianvf/osf.io,CenterForOpenScience/osf.io,cldershem/osf.io,RomanZWang/osf.io,Nesiehr/osf.io,lamdnhan/osf.io,jeffreyliu3230/osf.io,kch8qx/osf.io,adlius/osf.io,petermalcolm/osf.io,KAsante95/osf.io,laurenrevere/osf.io,ZobairAlijan/osf.io,arpitar/osf.io,Johnetordoff/osf.io,bdyetton/prettychart,kch8qx/osf.io,mattclark/osf.io,TomBaxter/osf.io,wearpants/osf.io,samchrisinger/osf.io,njantrania/osf.io,lamdnhan/osf.io,mfraezz/osf.io,GaryKriebel/osf.io,CenterForOpenScience/osf.io,DanielSBrown/osf.io,KAsante95/osf.io,njantrania/osf.io,mluo613/osf.io,haoyuchen1992/osf.io,GaryKriebel/osf.io,monikagrabowska/osf.io,billyhunt/osf.io,zkraime/osf.io,leb2dg/osf.io,caseyrollins/osf.io,felliott/osf.io,aaxelb/osf.io,alexschiller/osf.io,adlius/osf.io,erinspace/osf.io,AndrewSallans/osf.io,amyshi188/osf.io,fabianvf/osf.io,cldershem/osf.io,kwierman/osf.io,doublebits/osf.io,barbour-em/osf.io,bdyetton/prettychart,zachjanicki/osf.io,icereval/osf.io,jnayak1/osf.io,jolene-esposito/osf.io,jinluyuan/osf.io,brandonPurvis/osf.io,billyhunt/osf.io,ticklemepierce/osf.io,GageGaskins/osf.io,HalcyonChimera/osf.io,wearpants/osf.io,DanielSBrown/osf.io,caseyrollins/osf.io,samanehsan/osf.io,adlius/osf.io,aaxelb/osf.io,binoculars/osf.io,hmoco/osf.io,crcresearch/osf.io,cslzchen/osf.io,jinluyuan/osf.io,billyhunt/osf.io,rdhyee/osf.io,pattisdr/osf.io,sloria/osf.io,CenterForOpenScience/osf.io,wearpants/osf.io,ticklemepierce/osf.io,ZobairAlijan/osf.io,RomanZWang/osf.io,icereval/osf.io,GageGaskins/osf.io,himanshuo/osf.io,abought/osf.io,zkraime/osf.io,cslzchen/osf.io,HarryRybacki/osf.io,SSJohns/osf.io,caseyrygt/osf.io,DanielSBrown/osf.io,Nesiehr/osf.io,monikagrabowska/osf.io,Ghalko/osf.io,amyshi188/osf.io,mluo613/osf.io,wearpants/osf.io,brandonPurvis/osf.io,chrisseto/osf.io,Ghalko/osf.io,Nesiehr/osf.io,jnayak1/osf.io,Nesiehr/osf.io,kwierman/osf.io,RomanZWang/osf.io,cwisecarver/osf.io,billyhunt/osf.io,dplorimer/osf,GaryKriebel/osf.io,mluo613/osf.io,hmoco/osf.io,lamdnhan/osf.io,brianjgeiger/osf.io,cslzchen/osf.io,brandonPurvis/osf.io,sloria/osf.io,mluke93/osf.io,leb2dg/osf.io,njantrania/osf.io,Ghalko/osf.io,jinluyuan/osf.io,abought/osf.io,asanfilippo7/osf.io,barbour-em/osf.io,samchrisinger/osf.io,emetsger/osf.io,kushG/osf.io,kch8qx/osf.io,saradbowman/osf.io,caneruguz/osf.io,chrisseto/osf.io,icereval/osf.io,baylee-d/osf.io,mluke93/osf.io,ckc6cz/osf.io,danielneis/osf.io,SSJohns/osf.io,felliott/osf.io,danielneis/osf.io,aaxelb/osf.io,MerlinZhang/osf.io,crcresearch/osf.io,GaryKriebel/osf.io,sbt9uc/osf.io,arpitar/osf.io,cslzchen/osf.io,bdyetton/prettychart,jolene-esposito/osf.io,jmcarp/osf.io,acshi/osf.io,chrisseto/osf.io,monikagrabowska/osf.io,doublebits/osf.io,jmcarp/osf.io,samanehsan/osf.io,petermalcolm/osf.io,erinspace/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,ckc6cz/osf.io,zachjanicki/osf.io,fabianvf/osf.io,acshi/osf.io,baylee-d/osf.io,amyshi188/osf.io,cwisecarver/osf.io,zachjanicki/osf.io,zamattiac/osf.io,brianjgeiger/osf.io,emetsger/osf.io,emetsger/osf.io,arpitar/osf.io,pattisdr/osf.io,revanthkolli/osf.io,caseyrygt/osf.io,monikagrabowska/osf.io,crcresearch/osf.io,rdhyee/osf.io,haoyuchen1992/osf.io,lyndsysimon/osf.io,TomBaxter/osf.io,asanfilippo7/osf.io,mattclark/osf.io,jeffreyliu3230/osf.io,amyshi188/osf.io,HarryRybacki/osf.io,RomanZWang/osf.io,ticklemepierce/osf.io,KAsante95/osf.io,jeffreyliu3230/osf.io,cosenal/osf.io,reinaH/osf.io,RomanZWang/osf.io,chennan47/osf.io,brianjgeiger/osf.io,GageGaskins/osf.io,mfraezz/osf.io,caseyrygt/osf.io
--- +++ @@ -24,8 +24,11 @@ }, uploadSuccess: function(file, item, data) { - // FIXME: need to update the item with new data, but can't do that - // from the returned data from S3 + item.urls = { + 'delete': nodeApiUrl + 's3/delete/' + file.destination + '/', + 'download': nodeApiUrl + 's3/download/' + file.destination + '/', + 'view': '/' + nodeId + '/s3/view/' + file.destination + '/' + } } };
dc5e223410001b9f2099041931d4b4553f769295
server/config/config.js
server/config/config.js
const dotenv = require('dotenv'); dotenv.config(); module.exports = { development: { username: 'Newman', password: 'andela2017', database: 'postit-db-dev', host: '127.0.0.1', port: 5432, secret_key: process.env.SECRET_KEY, dialect: 'postgres' }, test: { username: 'Newman', password: 'andela2017', database: 'postit-db-test', // username: 'postgres', // password: '', // database: 'postit_db_test', host: '127.0.0.1', port: 5432, secret_key: process.env.SECRET_KEY, dialect: 'postgres' }, production: { use_env_variable: 'PROD_DB_URL', username: '?', password: '?', database: '?', host: '?', dialect: '?' } };
const dotenv = require('dotenv'); dotenv.config(); module.exports = { development: { username: 'Newman', password: 'andela2017', database: 'postit-db-dev', host: '127.0.0.1', port: 5432, secret_key: process.env.SECRET_KEY, dialect: 'postgres' }, test: { // username: 'Newman', // password: 'andela2017', // database: 'postit-db-test', username: 'postgres', password: '', database: 'postit_db_test', host: '127.0.0.1', port: 5432, secret_key: process.env.SECRET_KEY, dialect: 'postgres' }, production: { use_env_variable: 'PROD_DB_URL', username: '?', password: '?', database: '?', host: '?', dialect: '?' } };
Troubleshoot failing tests on Travis
Troubleshoot failing tests on Travis
JavaScript
mit
Philipeano/post-it,Philipeano/post-it
--- +++ @@ -13,12 +13,12 @@ dialect: 'postgres' }, test: { - username: 'Newman', - password: 'andela2017', - database: 'postit-db-test', - // username: 'postgres', - // password: '', - // database: 'postit_db_test', + // username: 'Newman', + // password: 'andela2017', + // database: 'postit-db-test', + username: 'postgres', + password: '', + database: 'postit_db_test', host: '127.0.0.1', port: 5432, secret_key: process.env.SECRET_KEY,
9a7d13540e5a731ec868d8051600c17d93683337
src/test/test-main.js
src/test/test-main.js
// Fetch all the files to be loaded by Karma; parse the actual tests // based on '.spec.js' filter var tests = []; for (var file in window.__karma__.files) { if (window.__karma__.files.hasOwnProperty(file)) { if (/\.spec\.js$/.test(file)) { tests.push(file); } } } // Fetch the base (main) config, override by Karma specific base url. // Then run the tests. var baseUrl = '/base/app'; require([ baseUrl + '/config.js'], function(mainConfig) { require.config({ baseUrl: baseUrl }); // Start the tests require([].concat(tests), function() { window.__karma__.start(); //console.log('Tests ran:', tests); }); });
// Fetch all the files to be loaded by Karma; parse the actual tests // based on '.spec.js' filter var tests = []; for (var file in window.__karma__.files) { if (window.__karma__.files.hasOwnProperty(file)) { /* Add all the files within app/test path with .spec.js suffix */ if (/test\/app.+\.spec\.js$/.test(file)) { tests.push(file); } } } // Fetch the base (main) config, override by Karma specific base url. // Then run the tests. var baseUrl = '/base/app'; require([ baseUrl + '/config.js'], function(mainConfig) { require.config({ baseUrl: baseUrl }); // Start the tests require([].concat(tests), function() { window.__karma__.start(); //console.log('Tests ran:', tests); }); });
Make stricter filter for matching the .spec files, so that we don't get 3rd party spec files into the test
Make stricter filter for matching the .spec files, so that we don't get 3rd party spec files into the test
JavaScript
mit
SC5/grunt-boreless-boilerplate,SC5/grunt-boreless-boilerplate
--- +++ @@ -3,7 +3,8 @@ var tests = []; for (var file in window.__karma__.files) { if (window.__karma__.files.hasOwnProperty(file)) { - if (/\.spec\.js$/.test(file)) { + /* Add all the files within app/test path with .spec.js suffix */ + if (/test\/app.+\.spec\.js$/.test(file)) { tests.push(file); } }
db1dcca22cfc9f5e4adf4c8e90d6e792ce9ee5ca
src/ts-sockets.js
src/ts-sockets.js
// activity item template var itemtemplate = ['<div class="activity-item">', '<a href="{{modifier_url}}">', '<img src="{{modifier_siteicon}}" />', '</a>', '<div>', '<p>', '<a href="{{modifier_url}}">{{modifier}}</a> is {{action}} ', '<a class="tiddler-title" href="{{tiddler_url}}">{{tiddler_title}}</a>', '</p>', '</div>', '</div>'].join(""); var ws = new WebSocket('ws://localhost:8080/'); var el = $("#realtime")[0] || document.body; var container = $("<ul />").appendTo(el); ws.onmessage = function(e) { var url = e.data; $.ajax({ url: url, dataType: "json", success: function(tiddler) { var html = Mustache.to_html(itemtemplate, tiddler); $("<li />").html(html).prependTo(container); } }) };
// activity item template var itemtemplate = ['<li class="activity-item">', '<a href="{{modifier_url}}">', '<img src="{{modifier_siteicon}}" />', '</a>', '<div>', '<p>', '<a href="{{modifier_url}}">{{modifier}}</a> is {{action}} ', '<a class="tiddler-title" href="{{tiddler_url}}">{{tiddler_title}}</a>', '</p>', '</div>', '</li>'].join(""); var ws = new WebSocket('ws://10.10.1.142:8080/'); var el = $("#realtime")[0] || document.body; var container = $("<ul />").appendTo(el); ws.onmessage = function(e) { var url = e.data; $.ajax({ url: url, dataType: "json", success: function(tiddler) { var html = Mustache.to_html(itemtemplate, tiddler); container.prepend(html); } }) };
Improve html markup of added item
Improve html markup of added item
JavaScript
bsd-3-clause
TiddlySpace/tiddlyspacesockets,TiddlySpace/tiddlyspacesockets
--- +++ @@ -1,5 +1,5 @@ // activity item template -var itemtemplate = ['<div class="activity-item">', +var itemtemplate = ['<li class="activity-item">', '<a href="{{modifier_url}}">', '<img src="{{modifier_siteicon}}" />', '</a>', @@ -9,9 +9,9 @@ '<a class="tiddler-title" href="{{tiddler_url}}">{{tiddler_title}}</a>', '</p>', '</div>', -'</div>'].join(""); +'</li>'].join(""); -var ws = new WebSocket('ws://localhost:8080/'); +var ws = new WebSocket('ws://10.10.1.142:8080/'); var el = $("#realtime")[0] || document.body; var container = $("<ul />").appendTo(el); ws.onmessage = function(e) { @@ -21,7 +21,7 @@ dataType: "json", success: function(tiddler) { var html = Mustache.to_html(itemtemplate, tiddler); - $("<li />").html(html).prependTo(container); + container.prepend(html); } }) };
3d22c4f290734201fd8466a18c529c82c33a0660
static/js/main.js
static/js/main.js
function AppCtrl($scope, $http) { $scope.search = function() { $scope.loading = true; $scope.movie = null; $http.get('/search/' + $scope.imdbId).then(function(response) { $scope.loading = false; $scope.movie = response.data; }); }; }
function AppCtrl($scope, $http) { $scope.search = function() { $scope.loading = true; $scope.movie = null; $http.get('/search/' + $scope.imdbId.match(/tt[\d]{7}/)[0]).then(function(response) { $scope.loading = false; $scope.movie = response.data; }); }; }
Support full IMDB URLs in the search field.
Support full IMDB URLs in the search field.
JavaScript
mit
renstrom/imdb-api,renstrom/imdb-api
--- +++ @@ -3,7 +3,7 @@ $scope.loading = true; $scope.movie = null; - $http.get('/search/' + $scope.imdbId).then(function(response) { + $http.get('/search/' + $scope.imdbId.match(/tt[\d]{7}/)[0]).then(function(response) { $scope.loading = false; $scope.movie = response.data; });
99c430f70769028a876db54df19e359cca03b128
static/js/src/main.js
static/js/src/main.js
// commonjs code goes here (function () { var i18n = window.i18n = require('i18next'); var XHR = require('i18next-xhr-backend'); var lngDetector = require('i18next-browser-languagedetector'); var Cache = require('i18next-localstorage-cache'); var backendOptions = { loadPath: '/static/locale/__lng__/translations.json' }; var callbacks = []; var initialized = false; var detectionOptions = { order: ['htmlTag'], htmlTag: document.documentElement }; var cacheOptions = { enabled: true, prefix: page_params.server_generation + ':' }; i18n.use(XHR) .use(lngDetector) .use(Cache) .init({ nsSeparator: false, keySeparator: false, interpolation: { prefix: "__", suffix: "__" }, backend: backendOptions, detection: detectionOptions, cache: cacheOptions }, function () { var i; initialized = true; for (i=0; i<callbacks.length; i++) { callbacks[i](); } }); i18n.ensure_i18n = function (callback) { if (initialized) { callback(); } else { callbacks.push(callback); } }; }());
// commonjs code goes here (function () { var i18n = window.i18n = require('i18next'); var XHR = require('i18next-xhr-backend'); var lngDetector = require('i18next-browser-languagedetector'); var Cache = require('i18next-localstorage-cache'); var backendOptions = { loadPath: '/static/locale/__lng__/translations.json' }; var callbacks = []; var initialized = false; var detectionOptions = { order: ['htmlTag'], htmlTag: document.documentElement }; var cacheOptions = { enabled: true, prefix: page_params.server_generation + ':' }; i18n.use(XHR) .use(lngDetector) .use(Cache) .init({ nsSeparator: false, keySeparator: false, interpolation: { prefix: "__", suffix: "__" }, backend: backendOptions, detection: detectionOptions, cache: cacheOptions, fallbackLng: 'en' }, function () { var i; initialized = true; for (i=0; i<callbacks.length; i++) { callbacks[i](); } }); i18n.ensure_i18n = function (callback) { if (initialized) { callback(); } else { callbacks.push(callback); } }; }());
Make English the fallback language in i18next.
Make English the fallback language in i18next. Fixes: #1580
JavaScript
apache-2.0
punchagan/zulip,showell/zulip,andersk/zulip,paxapy/zulip,susansls/zulip,dattatreya303/zulip,timabbott/zulip,verma-varsha/zulip,eeshangarg/zulip,jrowan/zulip,blaze225/zulip,sharmaeklavya2/zulip,jainayush975/zulip,souravbadami/zulip,eeshangarg/zulip,synicalsyntax/zulip,peguin40/zulip,j831/zulip,sup95/zulip,dawran6/zulip,kou/zulip,mahim97/zulip,susansls/zulip,JPJPJPOPOP/zulip,TigorC/zulip,vikas-parashar/zulip,krtkmj/zulip,SmartPeople/zulip,vaidap/zulip,reyha/zulip,souravbadami/zulip,sup95/zulip,brainwane/zulip,brainwane/zulip,eeshangarg/zulip,niftynei/zulip,sonali0901/zulip,peguin40/zulip,SmartPeople/zulip,mohsenSy/zulip,amyliu345/zulip,JPJPJPOPOP/zulip,kou/zulip,dattatreya303/zulip,PhilSk/zulip,AZtheAsian/zulip,vabs22/zulip,jainayush975/zulip,niftynei/zulip,ryanbackman/zulip,showell/zulip,mahim97/zulip,umkay/zulip,reyha/zulip,shubhamdhama/zulip,arpith/zulip,jrowan/zulip,kou/zulip,samatdav/zulip,aakash-cr7/zulip,zacps/zulip,mohsenSy/zulip,jphilipsen05/zulip,tommyip/zulip,arpith/zulip,synicalsyntax/zulip,umkay/zulip,punchagan/zulip,ahmadassaf/zulip,rht/zulip,brainwane/zulip,j831/zulip,vaidap/zulip,Diptanshu8/zulip,Diptanshu8/zulip,kou/zulip,blaze225/zulip,Juanvulcano/zulip,showell/zulip,brainwane/zulip,jackrzhang/zulip,amanharitsh123/zulip,Galexrt/zulip,cosmicAsymmetry/zulip,vikas-parashar/zulip,jainayush975/zulip,TigorC/zulip,sharmaeklavya2/zulip,ahmadassaf/zulip,Juanvulcano/zulip,PhilSk/zulip,sup95/zulip,rht/zulip,synicalsyntax/zulip,punchagan/zulip,vabs22/zulip,paxapy/zulip,peguin40/zulip,isht3/zulip,sharmaeklavya2/zulip,ahmadassaf/zulip,sonali0901/zulip,vabs22/zulip,verma-varsha/zulip,Galexrt/zulip,sharmaeklavya2/zulip,andersk/zulip,SmartPeople/zulip,zulip/zulip,PhilSk/zulip,amanharitsh123/zulip,dhcrzf/zulip,susansls/zulip,paxapy/zulip,eeshangarg/zulip,brockwhittaker/zulip,mohsenSy/zulip,dhcrzf/zulip,verma-varsha/zulip,jainayush975/zulip,jainayush975/zulip,dawran6/zulip,dawran6/zulip,mahim97/zulip,isht3/zulip,reyha/zulip,christi3k/zulip,vikas-parashar/zulip,grave-w-grave/zulip,j831/zulip,calvinleenyc/zulip,Jianchun1/zulip,Galexrt/zulip,amanharitsh123/zulip,showell/zulip,jackrzhang/zulip,aakash-cr7/zulip,hackerkid/zulip,grave-w-grave/zulip,jackrzhang/zulip,Diptanshu8/zulip,jackrzhang/zulip,souravbadami/zulip,timabbott/zulip,shubhamdhama/zulip,j831/zulip,TigorC/zulip,reyha/zulip,peguin40/zulip,Jianchun1/zulip,amanharitsh123/zulip,vaidap/zulip,vabs22/zulip,grave-w-grave/zulip,joyhchen/zulip,niftynei/zulip,cosmicAsymmetry/zulip,rht/zulip,kou/zulip,ahmadassaf/zulip,rishig/zulip,sharmaeklavya2/zulip,amyliu345/zulip,susansls/zulip,ahmadassaf/zulip,calvinleenyc/zulip,vikas-parashar/zulip,umkay/zulip,PhilSk/zulip,christi3k/zulip,christi3k/zulip,ryanbackman/zulip,AZtheAsian/zulip,dattatreya303/zulip,andersk/zulip,niftynei/zulip,ryanbackman/zulip,KingxBanana/zulip,shubhamdhama/zulip,jphilipsen05/zulip,Juanvulcano/zulip,kou/zulip,peguin40/zulip,jrowan/zulip,blaze225/zulip,Galexrt/zulip,Jianchun1/zulip,rishig/zulip,krtkmj/zulip,christi3k/zulip,jrowan/zulip,sup95/zulip,mahim97/zulip,Jianchun1/zulip,SmartPeople/zulip,hackerkid/zulip,rht/zulip,umkay/zulip,punchagan/zulip,umkay/zulip,jphilipsen05/zulip,niftynei/zulip,mohsenSy/zulip,Diptanshu8/zulip,sonali0901/zulip,zacps/zulip,tommyip/zulip,tommyip/zulip,krtkmj/zulip,KingxBanana/zulip,amanharitsh123/zulip,amyliu345/zulip,Juanvulcano/zulip,synicalsyntax/zulip,jainayush975/zulip,shubhamdhama/zulip,krtkmj/zulip,dhcrzf/zulip,timabbott/zulip,dattatreya303/zulip,arpith/zulip,tommyip/zulip,hackerkid/zulip,joyhchen/zulip,blaze225/zulip,Galexrt/zulip,aakash-cr7/zulip,krtkmj/zulip,vaidap/zulip,ahmadassaf/zulip,aakash-cr7/zulip,samatdav/zulip,SmartPeople/zulip,souravbadami/zulip,paxapy/zulip,reyha/zulip,samatdav/zulip,shubhamdhama/zulip,dawran6/zulip,tommyip/zulip,samatdav/zulip,brockwhittaker/zulip,zulip/zulip,christi3k/zulip,showell/zulip,hackerkid/zulip,KingxBanana/zulip,ryanbackman/zulip,zulip/zulip,cosmicAsymmetry/zulip,susansls/zulip,krtkmj/zulip,JPJPJPOPOP/zulip,cosmicAsymmetry/zulip,AZtheAsian/zulip,blaze225/zulip,JPJPJPOPOP/zulip,calvinleenyc/zulip,samatdav/zulip,jackrzhang/zulip,jphilipsen05/zulip,aakash-cr7/zulip,umkay/zulip,synicalsyntax/zulip,timabbott/zulip,arpith/zulip,rht/zulip,sonali0901/zulip,brockwhittaker/zulip,kou/zulip,jrowan/zulip,SmartPeople/zulip,AZtheAsian/zulip,niftynei/zulip,zulip/zulip,rishig/zulip,shubhamdhama/zulip,mohsenSy/zulip,showell/zulip,andersk/zulip,timabbott/zulip,mahim97/zulip,Juanvulcano/zulip,zulip/zulip,sharmaeklavya2/zulip,dattatreya303/zulip,zacps/zulip,amyliu345/zulip,brockwhittaker/zulip,ryanbackman/zulip,Jianchun1/zulip,brockwhittaker/zulip,sonali0901/zulip,ahmadassaf/zulip,rishig/zulip,souravbadami/zulip,zacps/zulip,dattatreya303/zulip,calvinleenyc/zulip,cosmicAsymmetry/zulip,reyha/zulip,isht3/zulip,krtkmj/zulip,zulip/zulip,AZtheAsian/zulip,TigorC/zulip,arpith/zulip,susansls/zulip,souravbadami/zulip,mohsenSy/zulip,vabs22/zulip,Juanvulcano/zulip,TigorC/zulip,paxapy/zulip,KingxBanana/zulip,umkay/zulip,jrowan/zulip,zacps/zulip,joyhchen/zulip,andersk/zulip,KingxBanana/zulip,paxapy/zulip,dawran6/zulip,grave-w-grave/zulip,timabbott/zulip,dhcrzf/zulip,jphilipsen05/zulip,dhcrzf/zulip,eeshangarg/zulip,eeshangarg/zulip,showell/zulip,hackerkid/zulip,arpith/zulip,jphilipsen05/zulip,dhcrzf/zulip,Galexrt/zulip,calvinleenyc/zulip,amyliu345/zulip,JPJPJPOPOP/zulip,isht3/zulip,brainwane/zulip,joyhchen/zulip,j831/zulip,tommyip/zulip,Galexrt/zulip,samatdav/zulip,j831/zulip,vikas-parashar/zulip,eeshangarg/zulip,punchagan/zulip,Jianchun1/zulip,hackerkid/zulip,TigorC/zulip,vabs22/zulip,brockwhittaker/zulip,timabbott/zulip,andersk/zulip,vaidap/zulip,brainwane/zulip,AZtheAsian/zulip,andersk/zulip,vaidap/zulip,rht/zulip,joyhchen/zulip,isht3/zulip,punchagan/zulip,jackrzhang/zulip,verma-varsha/zulip,tommyip/zulip,verma-varsha/zulip,sonali0901/zulip,dhcrzf/zulip,grave-w-grave/zulip,punchagan/zulip,KingxBanana/zulip,christi3k/zulip,aakash-cr7/zulip,rishig/zulip,JPJPJPOPOP/zulip,PhilSk/zulip,rishig/zulip,joyhchen/zulip,hackerkid/zulip,blaze225/zulip,jackrzhang/zulip,zulip/zulip,calvinleenyc/zulip,vikas-parashar/zulip,Diptanshu8/zulip,verma-varsha/zulip,rht/zulip,zacps/zulip,synicalsyntax/zulip,peguin40/zulip,grave-w-grave/zulip,Diptanshu8/zulip,PhilSk/zulip,amanharitsh123/zulip,shubhamdhama/zulip,cosmicAsymmetry/zulip,dawran6/zulip,amyliu345/zulip,sup95/zulip,brainwane/zulip,sup95/zulip,rishig/zulip,synicalsyntax/zulip,isht3/zulip,mahim97/zulip,ryanbackman/zulip
--- +++ @@ -34,7 +34,8 @@ }, backend: backendOptions, detection: detectionOptions, - cache: cacheOptions + cache: cacheOptions, + fallbackLng: 'en' }, function () { var i; initialized = true;
1548ab81fd04e92a7a32ddfaeb072cd72493877d
grunt/contrib-connect.js
grunt/contrib-connect.js
// Local web server running on port 9001 with livereload functionality module.exports = function(grunt) { grunt.config('connect', { livereload: { options: { port: 9001, middleware: function(connect, options) { return[ require('connect-livereload')(), connect.static(options.base), connect.directory(options.base) ]; } }, }, }); grunt.loadNpmTasks('grunt-contrib-connect'); };
// Local web server running on port 9001 with livereload functionality module.exports = function(grunt) { grunt.config('connect', { livereload: { options: { port: 9001, middleware: function(connect, options) { return[ require('connect-livereload')(), connect.static(options.base[0]), connect.directory(options.base) ]; } }, }, }); grunt.loadNpmTasks('grunt-contrib-connect'); };
Fix annoying bug in connect middleware
Fix annoying bug in connect middleware
JavaScript
mit
yellowled/yl-bp,yellowled/yl-bp
--- +++ @@ -1,5 +1,4 @@ // Local web server running on port 9001 with livereload functionality - module.exports = function(grunt) { grunt.config('connect', { livereload: { @@ -8,7 +7,7 @@ middleware: function(connect, options) { return[ require('connect-livereload')(), - connect.static(options.base), + connect.static(options.base[0]), connect.directory(options.base) ]; }
f93e4206fd2caf2c25b85940fd377547133cb545
static/userdetails.js
static/userdetails.js
(function() { var user_id = localStorage.getItem('user_id'); var session_id = localStorage.getItem('session_id'); if (user_id == null || session_id == null) { alert('Not signed in.'); } else { alert(user_id + ' ' + session_id); } })();
(function() { var user_id = $.cookie('user_id'); var session_id = $.cookie('session_id'); if (user_id == null || session_id == null) { alert('Not signed in.'); } else { alert(user_id + ' ' + session_id); } })();
Use cookie instead of local storage.
Use cookie instead of local storage.
JavaScript
agpl-3.0
ushahidi/riverid-python,ushahidi/riverid-python,ushahidi/riverid-python
--- +++ @@ -1,6 +1,6 @@ (function() { - var user_id = localStorage.getItem('user_id'); - var session_id = localStorage.getItem('session_id'); + var user_id = $.cookie('user_id'); + var session_id = $.cookie('session_id'); if (user_id == null || session_id == null) { alert('Not signed in.'); } else {
d6cb1d94c0a0397615ba5f4f90ac281b644ab3d9
image_occlusion_enhanced/svg-edit/svg-edit-2.6/extensions/ext-panning.js
image_occlusion_enhanced/svg-edit/svg-edit-2.6/extensions/ext-panning.js
/*globals svgEditor, svgCanvas*/ /*jslint eqeq: true*/ /* * ext-panning.js * * Licensed under the MIT License * * Copyright(c) 2013 Luis Aguirre * */ /* This is a very basic SVG-Edit extension to let tablet/mobile devices panning without problem */ svgEditor.addExtension('ext-panning', function() {'use strict'; return { name: 'Extension Panning', svgicons: svgEditor.curConfig.extPath + 'ext-panning.xml', buttons: [{ id: 'ext-panning', type: 'mode', title: 'Panning', key: 'Q', events: { click: function() { svgCanvas.setMode('ext-panning'); svgEditor.toolButtonClick('#ext-panning') } } }], mouseDown: function() { if (svgCanvas.getMode() == 'ext-panning') { svgEditor.setPanning(true); return {started: true}; } }, mouseUp: function() { if (svgCanvas.getMode() == 'ext-panning') { svgEditor.setPanning(false); return { keep: false, element: null }; } } }; });
/*globals svgEditor, svgCanvas*/ /*jslint eqeq: true*/ /* * ext-panning.js * * Licensed under the MIT License * * Copyright(c) 2013 Luis Aguirre * */ /* This is a very basic SVG-Edit extension to let tablet/mobile devices panning without problem */ svgEditor.addExtension('ext-panning', function() {'use strict'; return { name: 'Extension Panning', svgicons: svgEditor.curConfig.extPath + 'ext-panning.xml', buttons: [{ id: 'ext-panning', type: 'mode', title: 'Panning', key: 'Q', events: { click: function() { svgCanvas.setMode('ext-panning'); svgEditor.toolButtonClick('#ext-panning') $('#styleoverrides').text('#svgcanvas *{cursor:move;pointer-events:all}, #svgcanvas {cursor:default}'); } } }], mouseDown: function() { if (svgCanvas.getMode() == 'ext-panning') { svgEditor.setPanning(true); return {started: true}; } }, mouseUp: function() { if (svgCanvas.getMode() == 'ext-panning') { svgEditor.setPanning(false); return { keep: false, element: null }; } } }; });
Switch to appropriate cursor style when panning active
Switch to appropriate cursor style when panning active
JavaScript
bsd-2-clause
Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-enhanced,Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-enhanced
--- +++ @@ -26,6 +26,7 @@ click: function() { svgCanvas.setMode('ext-panning'); svgEditor.toolButtonClick('#ext-panning') + $('#styleoverrides').text('#svgcanvas *{cursor:move;pointer-events:all}, #svgcanvas {cursor:default}'); } } }],
1cebf1bf3cd75e2ba67062078dd178594f41d7e1
js/library.js
js/library.js
/* * Developed by Radu Puspana * Date August 2017 * Version 1.0 */ // Round the n-th decimal of a float number // number Number the floating point number to be rounded // decimalIndex Number the decimal position to be rounded // E.g decimalIndex = 1, the first digit shuld be rounded // E.g decimalIndex = 2, the second digit shuld be rounded // return Number the number with a rounded decimal function roundDecimal(number, decimalIndex) { var multiplier = Math.pow(10, decimalIndex || 0); return Math.round(number * multiplier) / multiplier; } console.log("Library has finished loading.");
/* * Developed by Radu Puspana * Date August 2017 * Version 1.0 */ // Round the n-th decimal of a float number // number Number the floating point number to be rounded // decimalIndex Number the decimal position to be rounded // E.g decimalIndex = 1, the first decimal will be rounded // E.g decimalIndex = 2, the second decimal will be rounded // return Number a floating point number with the required decimal rounded function roundDecimal(number, decimalIndex) { var multiplier = Math.pow(10, decimalIndex || 0); return Math.round(number * multiplier) / multiplier; } console.log("Library has finished loading.");
Edit the roundDecimal() comment correcting mistakes
Edit the roundDecimal() comment correcting mistakes
JavaScript
mit
rpuspana/myExpenses,rpuspana/myExpenses
--- +++ @@ -8,9 +8,9 @@ // Round the n-th decimal of a float number // number Number the floating point number to be rounded // decimalIndex Number the decimal position to be rounded -// E.g decimalIndex = 1, the first digit shuld be rounded -// E.g decimalIndex = 2, the second digit shuld be rounded -// return Number the number with a rounded decimal +// E.g decimalIndex = 1, the first decimal will be rounded +// E.g decimalIndex = 2, the second decimal will be rounded +// return Number a floating point number with the required decimal rounded function roundDecimal(number, decimalIndex) { var multiplier = Math.pow(10, decimalIndex || 0); return Math.round(number * multiplier) / multiplier;
09b7512cd8196f643440448d9f885e3996670f56
app/assets/javascripts/admin/spree_paypal_express.js
app/assets/javascripts/admin/spree_paypal_express.js
//= require admin/spree_backend SpreePaypalExpress = { hideSettings: function(paymentMethod) { if (SpreePaypalExpress.paymentMethodID && paymentMethod.val() == SpreePaypalExpress.paymentMethodID) { $('.payment-method-settings').children().hide(); $('#payment_amount').prop('disabled', 'disabled'); $('button[type="submit"]').prop('disabled', 'disabled'); $('#paypal-warning').show(); } else if (SpreePaypalExpress.paymentMethodID) { $('.payment-method-settings').children().show(); $('button[type=submit]').prop('disabled', ''); $('#payment_amount').prop('disabled', ''); $('#paypal-warning').hide(); } } } $(document).ready(function() { checkedPaymentMethod = $('[data-hook="payment_method_field"] input[type="radio"]:checked'); SpreePaypalExpress.hideSettings(checkedPaymentMethod); paymentMethods = $('[data-hook="payment_method_field"] input[type="radio"]').click(function (e) { SpreePaypalExpress.hideSettings($(e.target)); }); });
//= require admin/spree_backend SpreePaypalExpress = { hideSettings: function(paymentMethod) { if (SpreePaypalExpress.paymentMethodID && paymentMethod.val() == SpreePaypalExpress.paymentMethodID) { $('.payment-method-settings').children().hide(); $('#payment_amount').prop('disabled', 'disabled'); $('button[type="submit"]').prop('disabled', 'disabled'); $('#paypal-warning').show(); } else if (SpreePaypalExpress.paymentMethodID) { $('.payment-method-settings').children().show(); $('button[type=submit]').prop('disabled', ''); $('#payment_amount').prop('disabled', ''); $('#paypal-warning').hide(); } } }
Remove dead code around unused payment_method_field data-hook
Remove dead code around unused payment_method_field data-hook
JavaScript
agpl-3.0
mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,openfoodfoundation/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,openfoodfoundation/openfoodnetwork
--- +++ @@ -15,11 +15,3 @@ } } } - -$(document).ready(function() { - checkedPaymentMethod = $('[data-hook="payment_method_field"] input[type="radio"]:checked'); - SpreePaypalExpress.hideSettings(checkedPaymentMethod); - paymentMethods = $('[data-hook="payment_method_field"] input[type="radio"]').click(function (e) { - SpreePaypalExpress.hideSettings($(e.target)); - }); -});
480fa7537fda14c7f25d986b2276565271a96323
karma.conf.js
karma.conf.js
'use strict' module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine-jquery', 'jasmine'], files: [ 'src/audiochart.js', 'spec/*.html', 'spec/*.js' ], reporters: ['progress'], colors: true, logLevel: config.LOG_INFO, autoWatch: true, // browsers: ['Chrome', 'Firefox', 'Safari'], browsers: ['Chrome'], singleRun: true, concurrency: Infinity }) }
'use strict' module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine-jquery', 'jasmine'], files: [ 'src/audiochart.js', 'spec/*.html', 'spec/*.js' ], reporters: ['progress'], colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome', 'Firefox'], singleRun: true, concurrency: Infinity }) }
Enable Chrome and Firefox for tests
Enable Chrome and Firefox for tests Safari is not reliable ATM due to https://github.com/karma-runner/karma-safari-launcher/issues/24
JavaScript
mit
matatk/audiochart,matatk/audiochart
--- +++ @@ -12,8 +12,7 @@ colors: true, logLevel: config.LOG_INFO, autoWatch: true, - // browsers: ['Chrome', 'Firefox', 'Safari'], - browsers: ['Chrome'], + browsers: ['Chrome', 'Firefox'], singleRun: true, concurrency: Infinity })
59292cc35cbfdebbedd4a58f7527a715d4dc5f55
karma.conf.js
karma.conf.js
const path = require("path"); const parts = require("./webpack.parts"); module.exports = config => { const tests = "tests/*.test.js"; config.set({ frameworks: ["mocha"], files: [ { pattern: tests, }, ], preprocessors: { [tests]: ["webpack"], }, webpack: parts.loadJavaScript(), singleRun: true, browsers: ["PhantomJS"], }); };
const path = require("path"); const parts = require("./webpack.parts"); module.exports = config => { const tests = "tests/*.test.js"; process.env.BABEL_ENV = "karma"; config.set({ frameworks: ["mocha"], files: [ { pattern: tests, }, ], preprocessors: { [tests]: ["webpack"], }, webpack: parts.loadJavaScript(), singleRun: true, browsers: ["PhantomJS"], }); };
Set babel env while running Karma
chore: Set babel env while running Karma This is needed for the coverage setup to work.
JavaScript
mit
survivejs-demos/webpack-demo
--- +++ @@ -3,6 +3,8 @@ module.exports = config => { const tests = "tests/*.test.js"; + + process.env.BABEL_ENV = "karma"; config.set({ frameworks: ["mocha"],
a92338bff1d78a07bd7598867b9a08e071317394
client/src/initialize.js
client/src/initialize.js
import boot from './boot'; import logger from 'debug'; import React from 'react/addons'; const debug = logger('app:init'); // Executed when the browser has loaded everything. window.onload = () => { debug('`onload` event fired.'); debug('Initialize and start application.'); // TODO: pass global functions to react components through context, not // window. const {t, router, application} = boot(window); // Handy localization shortcut. window.t = t; // Helper to allow link creation all around the application. window.router = router; debug('Mount React application'); const node = document.querySelector('#mount-point'); React.render(application, node); debug('Application started.'); };
import boot from './boot'; import logger from 'debug'; import React from 'react/addons'; const debug = logger('app:init'); // Executed when the browser has loaded everything. window.onload = () => { debug('`onload` event fired.'); debug('Initialize and start application.'); // TODO: pass global functions to react components through context, not // window. const {t, router, application} = boot(window); // Handy localization shortcut. window.t = t; // Helper to allow link creation all around the application. window.router = router; debug('Mount React application'); const node = document.querySelector('#mount-point'); React.render(application, node); debug('Application started.'); }; // Helper that people can use to enable logging from the console. window.debug = (pattern = 'app:*') => { console.info(`Reload the page to see logs that match pattern ${pattern}`); // eslint-disable-line localStorage.setItem('debug', pattern); };
Add helper function to help users enable logging
Add helper function to help users enable logging
JavaScript
mit
jsilvestre/tasky,jsilvestre/tasky,jsilvestre/tasky
--- +++ @@ -25,3 +25,9 @@ debug('Application started.'); }; + +// Helper that people can use to enable logging from the console. +window.debug = (pattern = 'app:*') => { + console.info(`Reload the page to see logs that match pattern ${pattern}`); // eslint-disable-line + localStorage.setItem('debug', pattern); +};
144d98ff633d3d00868e1aa716d85ea5f9ced5a6
lib/install/void-step.js
lib/install/void-step.js
'use strict'; const BaseStep = require('./base-step'); module.exports = class VoidStep extends BaseStep { start() { return new Promise(() => {}); } };
'use strict'; const BaseStep = require('./base-step'); module.exports = class VoidStep extends BaseStep { constructor(options, action) { super(options); this.action = action; } start() { this.action && this.action(); return new Promise(() => {}); } };
Add an action function to void steps so as to execute code on start
Add an action function to void steps so as to execute code on start It does not alter the step behaviour, it's just a way to trigger additional actions when needed
JavaScript
bsd-3-clause
kiteco/kite-installer
--- +++ @@ -3,5 +3,12 @@ const BaseStep = require('./base-step'); module.exports = class VoidStep extends BaseStep { - start() { return new Promise(() => {}); } + constructor(options, action) { + super(options); + this.action = action; + } + start() { + this.action && this.action(); + return new Promise(() => {}); + } };
1cee6a5ef930508959fdde398285ea181655fbca
Scripts/Default.js
Scripts/Default.js
// This function is run when the app is ready to start interacting with the host application. // It ensures the DOM is ready before updating the span elements with values from the current message. Office.initialize = function () { $(document).ready(function () { $(window).resize(onResize); initViewModels(); updateStatus(ImportedStrings.mha_loading); sendHeadersRequest(); }); }; function enableSpinner() { $("#response").css("background-image", "url(../Resources/loader.gif)"); $("#response").css("background-repeat", "no-repeat"); $("#response").css("background-position", "center"); } function disableSpinner() { $("#response").css("background", "none"); } function hideStatus() { disableSpinner(); } function updateStatus(statusText) { enableSpinner(); $("#status").text(statusText); if (viewModel !== null) { viewModel.status = statusText; } positionResponse(); recalculateVisibility(); } function getHeadersComplete(headers) { updateStatus(ImportedStrings.mha_foundHeaders); $("#originalHeaders").text(headers); parseHeadersToTables(headers); } function showError(message) { updateStatus(message); disableSpinner(); rebuildSections(); }
// This function is run when the app is ready to start interacting with the host application. // It ensures the DOM is ready before updating the span elements with values from the current message. Office.initialize = function () { $(document).ready(function () { $(window).resize(onResize); initViewModels(); updateStatus(ImportedStrings.mha_loading); sendHeadersRequest(); $("#diagnostics").text(viewModel.diagnostics); }); }; function enableSpinner() { $("#response").css("background-image", "url(../Resources/loader.gif)"); $("#response").css("background-repeat", "no-repeat"); $("#response").css("background-position", "center"); } function disableSpinner() { $("#response").css("background", "none"); } function hideStatus() { disableSpinner(); } function updateStatus(statusText) { enableSpinner(); $("#status").text(statusText); if (viewModel !== null) { viewModel.status = statusText; } positionResponse(); recalculateVisibility(); } function getHeadersComplete(headers) { updateStatus(ImportedStrings.mha_foundHeaders); $("#originalHeaders").text(headers); parseHeadersToTables(headers); } function showError(message) { updateStatus(message); disableSpinner(); rebuildSections(); }
Set diagnostics into old UI
Set diagnostics into old UI
JavaScript
mit
stephenegriffin/MHA,stephenegriffin/MHA,stephenegriffin/MHA
--- +++ @@ -6,6 +6,7 @@ initViewModels(); updateStatus(ImportedStrings.mha_loading); sendHeadersRequest(); + $("#diagnostics").text(viewModel.diagnostics); }); };
c1eb5999f16ebb5bae06babafc91e64f34db0c2b
app/components/common/form-inputs/index.js
app/components/common/form-inputs/index.js
import React from 'react'; import PropTypes from 'prop-types'; import Text from './text'; import Radio from './radio'; import Select from './select'; import Date from './date'; import Blob from './blob'; import Number from './number'; // REDUX-FORM custom inputs // http://redux-form.com/6.5.0/docs/api/Field.md/ export default function getInputForm(props) { switch (props.question.type) { case 'text': return <Text {...props} />; case 'number': return <Number {...props} />; case 'radio': return <Radio {...props} />; case 'select': return <Select {...props} />; case 'date': return <Date {...props} />; case 'point': return <Text {...props} />; case 'blob': return <Blob {...props} />; default: return null; } } getInputForm.propTypes = { question: PropTypes.shape({ value: PropTypes.number, type: PropTypes.string.isRequired, defaultValue: PropTypes.oneOfType([ PropTypes.number.isRequired, PropTypes.string.isRequired ]) }).isRequired };
import React from 'react'; import PropTypes from 'prop-types'; import Text from './text'; import Radio from './radio'; import Select from './select'; import Date from './date'; import Blob from './blob'; // TODO: fix numbers input in iOS as we can't accept the value // import Number from './number'; // REDUX-FORM custom inputs // http://redux-form.com/6.5.0/docs/api/Field.md/ export default function getInputForm(props) { switch (props.question.type) { case 'text': return <Text {...props} />; case 'number': return <Text {...props} />; // Use the number component here case 'radio': return <Radio {...props} />; case 'select': return <Select {...props} />; case 'date': return <Date {...props} />; case 'point': return <Text {...props} />; case 'blob': return <Blob {...props} />; default: return null; } } getInputForm.propTypes = { question: PropTypes.shape({ value: PropTypes.number, type: PropTypes.string.isRequired, defaultValue: PropTypes.oneOfType([ PropTypes.number.isRequired, PropTypes.string.isRequired ]) }).isRequired };
Use input text for numbers
Use input text for numbers
JavaScript
mit
Vizzuality/forest-watcher,Vizzuality/forest-watcher,Vizzuality/forest-watcher,Vizzuality/forest-watcher,Vizzuality/forest-watcher
--- +++ @@ -5,7 +5,8 @@ import Select from './select'; import Date from './date'; import Blob from './blob'; -import Number from './number'; +// TODO: fix numbers input in iOS as we can't accept the value +// import Number from './number'; // REDUX-FORM custom inputs // http://redux-form.com/6.5.0/docs/api/Field.md/ @@ -14,7 +15,7 @@ case 'text': return <Text {...props} />; case 'number': - return <Number {...props} />; + return <Text {...props} />; // Use the number component here case 'radio': return <Radio {...props} />; case 'select':
714e1d5cc8a46a1466cc5e1a2e75ddf43e4fc78f
src/io/c9/ace/Config.js
src/io/c9/ace/Config.js
/** * @license * Copyright 2019 The FOAM Authors. All Rights Reserved. * http://www.apache.org/licenses/LICENSE-2.0 */ foam.CLASS({ package: 'io.c9.ace', name: 'Config', properties: [ { class: 'Int', name: 'height', value: 500 }, { class: 'Int', name: 'width', value: 700 }, { class: 'Enum', of: 'io.c9.ace.Theme', name: 'theme' }, { class: 'Enum', of: 'io.c9.ace.Mode', name: 'mode', value: 'JAVA' }, { class: 'Enum', of: 'io.c9.ace.KeyBinding', name: 'keyBinding', value: 'ACE' }, { class: 'Boolean', name: 'isReadOnly' } ] });
/** * @license * Copyright 2019 The FOAM Authors. All Rights Reserved. * http://www.apache.org/licenses/LICENSE-2.0 */ foam.CLASS({ package: 'io.c9.ace', name: 'Config', properties: [ { class: 'Int', name: 'height', value: 400 }, { class: 'Int', name: 'width', value: 500 }, { class: 'Enum', of: 'io.c9.ace.Theme', name: 'theme' }, { class: 'Enum', of: 'io.c9.ace.Mode', name: 'mode', value: 'JAVA' }, { class: 'Enum', of: 'io.c9.ace.KeyBinding', name: 'keyBinding', value: 'ACE' }, { class: 'Boolean', name: 'isReadOnly' } ] });
Change Ace editor default size.
Change Ace editor default size.
JavaScript
apache-2.0
foam-framework/foam2,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,jacksonic/vjlofvhjfgm,jacksonic/vjlofvhjfgm,foam-framework/foam2
--- +++ @@ -11,12 +11,12 @@ { class: 'Int', name: 'height', - value: 500 + value: 400 }, { class: 'Int', name: 'width', - value: 700 + value: 500 }, { class: 'Enum',
a2f5836cc763ed63d2bba47e494c636f64ef0b7e
public/javascripts/application.js
public/javascripts/application.js
$(document).ready(function() { if (window.location.href.search(/query=/) == -1) { $('#query').one('click, focus', function() { $(this).val(''); }); } $(document).bind('keyup', function(event) { if ($(event.target).is(':input')) { return; } if (event.which == 83) { $('#query').focus(); } }); $('#version_for_stats').change(function() { window.location.href = $(this).val(); }); });
$(document).ready(function() { $('#version_for_stats').change(function() { window.location.href = $(this).val(); }); });
Remove JS that handled not-quite-placeholder.
Remove JS that handled not-quite-placeholder.
JavaScript
mit
rubygems/rubygems.org-backup,square/rubygems.org,rubygems/rubygems.org-backup,square/rubygems.org,square/rubygems.org,rubygems/rubygems.org-backup
--- +++ @@ -1,22 +1,5 @@ $(document).ready(function() { - if (window.location.href.search(/query=/) == -1) { - $('#query').one('click, focus', function() { - $(this).val(''); - }); - } - - $(document).bind('keyup', function(event) { - if ($(event.target).is(':input')) { - return; - } - - if (event.which == 83) { - $('#query').focus(); - } - }); - $('#version_for_stats').change(function() { window.location.href = $(this).val(); }); - });
17fb38813a8b843c889e8fa826e5d686fad4ff1a
gulp/ios.js
gulp/ios.js
import bg from 'gulp-bg'; import gulp from 'gulp'; // If this doesn't work, while manual Xcode works, try: // 1) delete ios/build directory // 2) reset content and settings in iOS simulator gulp.task('ios', ['native'], bg('react-native', 'run-ios'));
import bg from 'gulp-bg'; import gulp from 'gulp'; // If this doesn't work, while manual Xcode works, try: // 1) delete ios/build directory // 2) reset content and settings in iOS simulator gulp.task('ios', ['native'], bg( 'react-native', 'run-ios', '--simulator', 'iPhone 5s' ));
Set iPhone 5s as default simulator
Set iPhone 5s as default simulator Design for the smallest mobile device first.
JavaScript
mit
robinpokorny/este,abelaska/este,TheoMer/este,christophediprima/este,TheoMer/este,syroegkin/mikora.eu,christophediprima/este,sikhote/davidsinclair,TheoMer/este,christophediprima/este,steida/este,amrsekilly/updatedEste,este/este,christophediprima/este,abelaska/este,skallet/este,abelaska/este,skallet/este,sikhote/davidsinclair,TheoMer/Gyms-Of-The-World,TheoMer/Gyms-Of-The-World,amrsekilly/updatedEste,robinpokorny/este,este/este,este/este,TheoMer/Gyms-Of-The-World,steida/este,robinpokorny/este,este/este,skallet/este,sikhote/davidsinclair,syroegkin/mikora.eu,syroegkin/mikora.eu,amrsekilly/updatedEste,cjk/smart-home-app
--- +++ @@ -4,4 +4,6 @@ // If this doesn't work, while manual Xcode works, try: // 1) delete ios/build directory // 2) reset content and settings in iOS simulator -gulp.task('ios', ['native'], bg('react-native', 'run-ios')); +gulp.task('ios', ['native'], bg( + 'react-native', 'run-ios', '--simulator', 'iPhone 5s' +));
08b70906907f70d83a2e441bce45863c3f749c85
api/routes/tasks.js
api/routes/tasks.js
import {Router} from 'express' import models from '../models'; export default () => { let app = Router() app.get('/new', (req, res) => { res.render('tasks/new') }) app.get('/:id', (req, res) => { models.Task.find(req.params.id).then((task) => { res.render('tasks/show', {task}) }) }) app.post('/', (req, res) => { models.Task.create(req.body.task).then((task) => { model.User.find(req.params.id).then((user) => { res.redirect('/' + task.dataValues.id); }) }) }) return app }
import {Router} from 'express' import models from '../models'; export default () => { let app = Router({mergeParams: true}) app.get('/new', (req, res) => { models.Serfs.findAll().then((serfs) => { res.render('tasks/new', {serfs}) }) }) app.get('/:id', (req, res) => { models.Task.find(req.params.id).then((task) => { res.render('tasks/show', {task}) }) }) app.post('/', (req, res) => { // models.Task.create(req.body.task).then((task) => { console.log(req.params) models.User.find(req.params.userId).then((user) => { console.log(user) user.createTask(req.body).then((task) => { res.redirect('/users/' + req.params.userId + "/tasks/" + task.id); }) }) // }) }) return app }
Add functionality to include serfs
Add functionality to include serfs
JavaScript
mit
taodav/MicroSerfs,taodav/MicroSerfs
--- +++ @@ -2,11 +2,13 @@ import models from '../models'; export default () => { - let app = Router() + let app = Router({mergeParams: true}) app.get('/new', (req, res) => { - res.render('tasks/new') + models.Serfs.findAll().then((serfs) => { + res.render('tasks/new', {serfs}) + }) }) app.get('/:id', (req, res) => { @@ -15,11 +17,15 @@ }) }) app.post('/', (req, res) => { - models.Task.create(req.body.task).then((task) => { - model.User.find(req.params.id).then((user) => { - res.redirect('/' + task.dataValues.id); + // models.Task.create(req.body.task).then((task) => { + console.log(req.params) + models.User.find(req.params.userId).then((user) => { + console.log(user) + user.createTask(req.body).then((task) => { + res.redirect('/users/' + req.params.userId + "/tasks/" + task.id); + }) }) - }) + // }) }) return app }
a36bd915dfe25fbb53da2fc83b6c048beb5fa5af
js/headless/localserver.js
js/headless/localserver.js
var server = require('webserver').create(), fs = require('fs'); var serverUrl = '127.0.0.1:8888'; var workingDirectory = fs.workingDirectory.replace(/\//g, fs.separator); function create() { var serverCreated = server.listen(serverUrl, function (request, response) { var cleanedUrl = request.url .replace(/\//g, fs.separator) .replace(/\?.*$/g, '') .replace(/js\/js\//,'js/'); //console.log('Requesting ' + request.url + ', loading ' + cleanedUrl); var pagePath = workingDirectory + cleanedUrl; var extension = pagePath.replace(/^.*\.(.*)$/,'$1'); switch (extension) { case 'svg': response.setHeader("Content-Type", "image/svg+xml"); break; } response.statusCode = 200; try { response.write(fs.read(pagePath)); } catch(err) { console.error('Error while reading ' + cleanedUrl + '(requested URL : '+request.url+')'); response.close(); phantom.exit(1); } response.close(); }); if (!serverCreated) { console.error('Error while creating HTTP server'); phantom.exit(1); } } function close() { server.close(); } module.exports = { create: create, url: serverUrl, close: close };
var server = require('webserver').create(), fs = require('fs'); var serverUrl = '127.0.0.1:8888'; var workingDirectory = fs.workingDirectory.replace(/\//g, fs.separator); function create() { var serverCreated = server.listen(serverUrl, function (request, response) { var cleanedUrl = decodeURIComponent(request.url .replace(/\//g, fs.separator) .replace(/\?.*$/g, '') .replace(/js\/js\//,'js/')); //console.log('Requesting ' + request.url + ', loading ' + cleanedUrl); var pagePath = workingDirectory + cleanedUrl; var extension = pagePath.replace(/^.*\.(.*)$/,'$1'); switch (extension) { case 'svg': response.setHeader("Content-Type", "image/svg+xml"); break; } response.statusCode = 200; try { response.write(fs.read(pagePath)); } catch(err) { console.error('Error while reading ' + cleanedUrl + '(requested URL : '+request.url+')'); response.close(); phantom.exit(1); } response.close(); }); if (!serverCreated) { console.error('Error while creating HTTP server'); phantom.exit(1); } } function close() { server.close(); } module.exports = { create: create, url: serverUrl, close: close };
Fix SVG load with spaces in filename
Fix SVG load with spaces in filename
JavaScript
apache-2.0
bperel/geotime,bperel/geotime,bperel/geotime
--- +++ @@ -6,10 +6,10 @@ function create() { var serverCreated = server.listen(serverUrl, function (request, response) { - var cleanedUrl = request.url + var cleanedUrl = decodeURIComponent(request.url .replace(/\//g, fs.separator) .replace(/\?.*$/g, '') - .replace(/js\/js\//,'js/'); + .replace(/js\/js\//,'js/')); //console.log('Requesting ' + request.url + ', loading ' + cleanedUrl); var pagePath = workingDirectory + cleanedUrl; var extension = pagePath.replace(/^.*\.(.*)$/,'$1');
90ea06f0d7955419f9f19dc464655b4f589fddee
tasks/reports.js
tasks/reports.js
'use strict'; const r = require('../services/reddit'); let reportedItemNames = new Set(); let hasFinishedFirstRun = false; const SUBREDDITS = ['pokemontrades', 'SVExchange']; module.exports = { period: 60, onStart: true, task () { return r.get_subreddit(SUBREDDITS.join('+')).get_reports({limit: hasFinishedFirstRun ? 25 : 50}).then(items => { // Don't output the new reports on the first fetch, as that would cause old reports to be listed. // Unfortunately, there is no way to tell whether reports on an item have been ignored using the OAuth API. const newItemsToReport = hasFinishedFirstRun ? items.filter(item => !reportedItemNames.has(item.name)) : []; items.forEach(item => reportedItemNames.add(item.name)); hasFinishedFirstRun = true; return newItemsToReport.map(formatItem); }); } }; function formatItem (item) { const permalink = item.constructor.name === 'Comment' ? item.link_url + item.id : item.url; const reportReason = (item.user_reports.length ? item.user_reports[0][0] : item.mod_reports.length ? item.mod_reports[0][0] : '') || '<no reason>'; return `[New report]: "${reportReason}" (on ${item.constructor.name.toLowerCase()} by /u/${item.author.name}, ${permalink} )`; }
'use strict'; const r = require('../services/reddit'); let reportedItemNames = new Set(); let hasFinishedFirstRun = false; const SUBREDDITS = ['pokemontrades', 'SVExchange']; module.exports = { period: 60, onStart: true, task () { return r.get_subreddit(SUBREDDITS.join('+')).get_reports({limit: hasFinishedFirstRun ? 25 : 50}).then(items => { // Don't output the new reports on the first fetch, as that would cause old reports to be listed. // Unfortunately, there is no way to tell whether reports on an item have been ignored using the OAuth API. const newItemsToReport = hasFinishedFirstRun ? items.filter(item => !reportedItemNames.has(item.name)) : []; items.forEach(item => reportedItemNames.add(item.name)); hasFinishedFirstRun = true; return newItemsToReport.map(formatItem); }).catch((e) => console.log(`Error fetching subreddit reports. Error code: ${e.statusCode}`)); } }; function formatItem (item) { const permalink = item.constructor.name === 'Comment' ? item.link_url + item.id : item.url; const reportReason = (item.user_reports.length ? item.user_reports[0][0] : item.mod_reports.length ? item.mod_reports[0][0] : '') || '<no reason>'; return `[New report]: "${reportReason}" (on ${item.constructor.name.toLowerCase()} by /u/${item.author.name}, ${permalink} )`; }
Remove initial error if reddit isn't given correct information
Remove initial error if reddit isn't given correct information
JavaScript
apache-2.0
pokemontrades/porygon-bot
--- +++ @@ -16,7 +16,7 @@ items.forEach(item => reportedItemNames.add(item.name)); hasFinishedFirstRun = true; return newItemsToReport.map(formatItem); - }); + }).catch((e) => console.log(`Error fetching subreddit reports. Error code: ${e.statusCode}`)); } };
fe0608cb308a8f083a7db4502b0f9c92d37b00e9
test/workbook.js
test/workbook.js
import {Workbook} from '../src/parsing/workbook.js'; import {expect} from 'chai'; import fs from 'fs'; describe('Workbook parsing', () => { let file = fs.readFileSync('example/example-with-data.xlsx'); let wb = new Workbook(file); it('should build a Workbook instance from a binary file', () => { expect(wb).to.be.an.instanceOf(Workbook); }); it('should return a list of Sheet names', () => { expect(wb.sheetNames()).to.exist; expect(wb.sheetNames()).to.be.an.instanceOf(Array); }); it('should return a Sheet by its name', () => { expect(wb.sheet('Sheet1')).to.exist; expect(wb.sheet('Sheet2')).to.not.exist; }); it('should save the current Workbook into a file', () => { }); });
import {Workbook} from '../src/parsing/workbook.js'; import {expect} from 'chai'; import fs from 'fs'; describe('Workbook parsing', () => { let file = fs.readFileSync('example/example-with-data.xlsx'); let wb = new Workbook(file); it('should build a Workbook instance from a binary file', () => { expect(wb).to.be.an.instanceOf(Workbook); }); it('should return a list of Sheet names', () => { expect(wb.sheetNames()).to.exist; expect(wb.sheetNames()).to.be.an.instanceOf(Array); }); it('should return a Sheet by its name', () => { expect(wb.sheet('Sheet1')).to.exist; expect(wb.sheet('Sheet2')).to.not.exist; }); it('should save the current Workbook into a file', () => { expect(false).to.be.true; }); });
Add failing test for Workbook file save function
Add failing test for Workbook file save function
JavaScript
mit
biosustain/microplate
--- +++ @@ -22,7 +22,7 @@ }); it('should save the current Workbook into a file', () => { - + expect(false).to.be.true; }); });
e4dfa6dab47f7fb2e9ad815c4069ae5a198e953b
lib/cli.js
lib/cli.js
'use strict'; var findup = require('findup-sync'); var spawnSync = require('child_process').spawnSync; var gruntPath = findup('node_modules/grunt-cli/bin/grunt', {cwd: __dirname}); process.title = 'grunth'; var harmonyFlags = [ '--harmony_scoping', // '--harmony_modules', // We have `require` and ES6 modules are still in flux // '--harmony_symbols', // `Symbol('s')` throws // '--harmony_proxies', // `new Proxy({}, {})` throws // '--harmony_collections', // `new Set([2]).size` should be `1` '--harmony_generators', // '--harmony_iteration', // no `for-of`, the description must be wrong '--harmony_numeric_literals', '--harmony_strings', '--harmony_arrays', '--harmony_maths', ]; module.exports = function cli(params) { spawnSync('node', harmonyFlags.concat([gruntPath]).concat(params), { cwd: process.cwd(), stdio: 'inherit', } ); };
'use strict'; var findup = require('findup-sync'); var spawnSync = require('child_process').spawnSync; var gruntPath = findup('node_modules/grunt-cli/bin/grunt', {cwd: __dirname}); process.title = 'grunth'; var harmonyFlags = [ '--harmony_scoping', // '--harmony_modules', // We have `require` and ES6 modules are still in flux '--harmony_symbols', // `Symbol('s')` throws // '--harmony_proxies', // `new Proxy({}, {})` throws // '--harmony_collections', // `new Set([2]).size` should be `1` '--harmony_generators', // '--harmony_iteration', // no `for-of`, the description must be wrong '--harmony_numeric_literals', '--harmony_strings', '--harmony_arrays', '--harmony_maths', ]; module.exports = function cli(params) { spawnSync('node', harmonyFlags.concat([gruntPath]).concat(params), { cwd: process.cwd(), stdio: 'inherit', } ); };
Enable Symbol (it works fine on Node v0.12 branch)
Enable Symbol (it works fine on Node v0.12 branch)
JavaScript
mit
EE/grunth-cli
--- +++ @@ -9,7 +9,7 @@ var harmonyFlags = [ '--harmony_scoping', // '--harmony_modules', // We have `require` and ES6 modules are still in flux -// '--harmony_symbols', // `Symbol('s')` throws + '--harmony_symbols', // `Symbol('s')` throws // '--harmony_proxies', // `new Proxy({}, {})` throws // '--harmony_collections', // `new Set([2]).size` should be `1` '--harmony_generators',
3ceb06bb42c156b58e25888b8c97c41f8b320de0
sixpack/static/js/script.js
sixpack/static/js/script.js
$(function () { // Display correct URL on "no-experiments" page. $('#base-domain').html(document.location.origin); // Draw charts on Details page. if ($('#details-page').length) { var id, alternative_name, color; var colors = $('#details-page').find('span.circle').get(); var chart = new Chart($('.chart').data('experiment'), function () { $('.chart').each(function (index, val) { id = $(this).attr('id'); alternative_name = id.substring(6, id.length); color = $(colors[index]).css('stroke'); chart.drawAlternative(alternative_name, color); }); }); } // Draw charts on Dashboard page. $('#dashboard-page ul.experiments .chart').each(function (index, val) { var colors = []; var circles = $(this).parent().find('span.circle').get(); _.each(circles, function (val, index) { colors.push($(circles[index]).css('stroke')); }); var experiment_name = $(this).data('experiment'); var chart = new Chart(experiment_name, function () { chart.drawExperiment(experiment_name, colors); }); }); });
$(function () { // Display correct URL on "no-experiments" page. $('#base-domain').html(document.location.origin); // Draw charts on Details page. if ($('#details-page').length) { var id, alternative_name, color; var colors = $('#details-page').find('span.circle').get(); var chart = new Chart($('.chart').data('experiment'), function () { $('.chart').each(function (index, val) { id = $(this).attr('id'); alternative_name = id.substring(6, id.length); color = $(colors[index]).css('stroke'); chart.drawAlternative(alternative_name, color); }); }); } // Draw charts on Dashboard page. if ($('#dashboard-page').length) { $('li').waypoint(function (direction) { var el = $(this).find('.chart'); // Prevent loading more than once: if (el.data('loaded')) return; el.data('loaded', true); var colors = []; var circles = el.parent().find('span.circle').get(); _.each(circles, function (val, index) { colors.push($(circles[index]).css('stroke')); }); var experiment_name = el.data('experiment'); var chart = new Chart(experiment_name, function () { chart.drawExperiment(experiment_name, colors); }); }, { offset: 'bottom-in-view' }); } });
Load Dashboard charts on scroll.
Load Dashboard charts on scroll.
JavaScript
bsd-2-clause
seatgeek/sixpack,seatgeek/sixpack,llonchj/sixpack,vpuzzella/sixpack,vpuzzella/sixpack,nickveenhof/sixpack,blackskad/sixpack,smokymountains/sixpack,llonchj/sixpack,spjwebster/sixpack,llonchj/sixpack,blackskad/sixpack,vpuzzella/sixpack,smokymountains/sixpack,seatgeek/sixpack,seatgeek/sixpack,vpuzzella/sixpack,nickveenhof/sixpack,nickveenhof/sixpack,blackskad/sixpack,smokymountains/sixpack,spjwebster/sixpack,blackskad/sixpack,llonchj/sixpack,spjwebster/sixpack
--- +++ @@ -18,15 +18,25 @@ } // Draw charts on Dashboard page. - $('#dashboard-page ul.experiments .chart').each(function (index, val) { - var colors = []; - var circles = $(this).parent().find('span.circle').get(); - _.each(circles, function (val, index) { - colors.push($(circles[index]).css('stroke')); + if ($('#dashboard-page').length) { + $('li').waypoint(function (direction) { + var el = $(this).find('.chart'); + + // Prevent loading more than once: + if (el.data('loaded')) return; + el.data('loaded', true); + + var colors = []; + var circles = el.parent().find('span.circle').get(); + _.each(circles, function (val, index) { + colors.push($(circles[index]).css('stroke')); + }); + var experiment_name = el.data('experiment'); + var chart = new Chart(experiment_name, function () { + chart.drawExperiment(experiment_name, colors); + }); + }, { + offset: 'bottom-in-view' }); - var experiment_name = $(this).data('experiment'); - var chart = new Chart(experiment_name, function () { - chart.drawExperiment(experiment_name, colors); - }); - }); + } });
0e0d3278002b01c4cd0d732fd937141d6a0f262a
api-server/src/routes/auth.js
api-server/src/routes/auth.js
import * as m from '../models' import parse from 'co-body' import jwt from 'koa-jwt' import {JWT_KEY} from '../config' export default ({api}) => { api.post('/auth', async ctx => { const body = await parse.json(ctx) try { if (!body.username) throw new Error('Username is required') if (!body.password) throw new Error('Password is required') const user = await m.User.findOne({_id: body.username}) if (!user) ctx.throw(401, 'Wrong username or password. Login failed') const isValidPw = await user.checkPassword(body.password) if (!isValidPw) ctx.throw(401, 'Wrong username or password. Login failed') ctx.status = 200 ctx.body = { usertoken: jwt.sign({username: body.username, role: 'user'}, JWT_KEY), username: body.username } } catch (err) { ctx.throw(400, err) } }) return api }
import * as m from '../models' import parse from 'co-body' import jwt from 'koa-jwt' import {JWT_KEY} from '../config' export default ({api}) => { api.post('/auth', async ctx => { const body = await parse.json(ctx) try { if (!body.username) throw new Error('Username is required') if (!body.password) throw new Error('Password is required') const user = await m.User.findOne({_id: body.username}) if (!user) ctx.throw(401, 'Wrong username or password. Login failed') const isValidPw = await user.checkPassword(body.password) if (!isValidPw) ctx.throw(401, 'Wrong username or password. Login failed') const usertoken = jwt.sign( {username: body.username, role: 'user'}, JWT_KEY, {expiresIn: '1h'} ) ctx.status = 200 ctx.body = { usertoken, username: body.username, exp: jwt.decode(usertoken).exp } } catch (err) { ctx.throw(400, err) } }) return api }
Set up exp time for JWT
Set up exp time for JWT
JavaScript
mit
websash/q-and-a-react-redux-app,websash/q-and-a-react-redux-app
--- +++ @@ -17,10 +17,13 @@ const isValidPw = await user.checkPassword(body.password) if (!isValidPw) ctx.throw(401, 'Wrong username or password. Login failed') + const usertoken = jwt.sign( + {username: body.username, role: 'user'}, JWT_KEY, {expiresIn: '1h'} + ) + ctx.status = 200 ctx.body = { - usertoken: jwt.sign({username: body.username, role: 'user'}, JWT_KEY), - username: body.username + usertoken, username: body.username, exp: jwt.decode(usertoken).exp } } catch (err) { ctx.throw(400, err)
acbb593cec671d223aa0b13020f1201bb016e987
public/config/example_openidc.js
public/config/example_openidc.js
window.config = { // default: '/' routerBasename: '/', // default: '' relativeWebWorkerScriptsPath: '', servers: { dicomWeb: [ { name: 'Orthanc', wadoUriRoot: 'http://127.0.0.1/pacs/wado', qidoRoot: 'http://127.0.0.1/pacs/dicom-web', wadoRoot: 'http://127.0.0.1/pacs/dicom-web', qidoSupportsIncludeField: false, imageRendering: 'wadors', thumbnailRendering: 'wadors', requestOptions: { auth: 'orthanc:orthanc', logRequests: true, logResponses: false, logTiming: true, }, }, ], }, oidc: [ { // ~ REQUIRED // Authorization Server URL authority: 'http://127.0.0.1/auth/realms/master', client_id: 'ohif-viewer', redirect_uri: '/callback', // `OHIFStandaloneViewer.js` response_type: 'id_token', scope: 'openid', // email profile openid // ~ OPTIONAL post_logout_redirect_uri: '/logout-redirect.html', }, ], }
window.config = { // default: '/' routerBasename: '/', // default: '' relativeWebWorkerScriptsPath: '', servers: { dicomWeb: [ { name: 'Orthanc', wadoUriRoot: 'http://127.0.0.1/pacs/wado', qidoRoot: 'http://127.0.0.1/pacs/dicom-web', wadoRoot: 'http://127.0.0.1/pacs/dicom-web', qidoSupportsIncludeField: false, imageRendering: 'wadors', thumbnailRendering: 'wadors', // REQUIRED TAG: // https://github.com/OHIF/ohif-core/blob/59e1e04b92be24aee5d4402445cb3dcedb746995/src/studies/retrieveStudyMetadata.js#L54 requestOptions: { // auth: 'orthanc:orthanc', // undefined to use JWT + Bearer auth requestFromBrowser: true, // logRequests: true, // logResponses: false, // logTiming: true, }, }, ], }, oidc: [ { // ~ REQUIRED // Authorization Server URL authority: 'http://127.0.0.1/auth/realms/master', client_id: 'ohif-viewer', redirect_uri: '/callback', // `OHIFStandaloneViewer.js` response_type: 'id_token', scope: 'openid', // email profile openid // ~ OPTIONAL post_logout_redirect_uri: '/logout-redirect.html', }, ], }
Make sure we're setting our bearer token; not basic auth
Make sure we're setting our bearer token; not basic auth
JavaScript
mit
OHIF/Viewers,OHIF/Viewers,OHIF/Viewers
--- +++ @@ -13,11 +13,14 @@ qidoSupportsIncludeField: false, imageRendering: 'wadors', thumbnailRendering: 'wadors', + // REQUIRED TAG: + // https://github.com/OHIF/ohif-core/blob/59e1e04b92be24aee5d4402445cb3dcedb746995/src/studies/retrieveStudyMetadata.js#L54 requestOptions: { - auth: 'orthanc:orthanc', - logRequests: true, - logResponses: false, - logTiming: true, + // auth: 'orthanc:orthanc', // undefined to use JWT + Bearer auth + requestFromBrowser: true, + // logRequests: true, + // logResponses: false, + // logTiming: true, }, }, ],
8747f9e4501b623c8eaa125c455fe1b45a8669bf
src/project/member/client.js
src/project/member/client.js
'use strict'; let apiClient; class DrushIOMember { constructor(client, project, identifier, data = {}) { apiClient = client; this.identifier = identifier; this.project = project; this.data = data; } /** * Updates the given membership with the provided details. * * @param {Object} details * @param {Object} details.role * @param {String} details.role.type * * @returns {Promise} */ update(details) { return new Promise((resolve, reject) => { apiClient.patch(`/projects/${this.project.identifier}/members/${this.identifier}`, details).then((response) => { this.data = response.body; resolve(this); }).catch((err) => { reject(err); }) }); } remove() { return new Promise((resolve, reject) => { apiClient.del(`/projects/${this.project.identifier}/members/${this.identifier}`).then(() => { resolve(); }).catch((err) => { reject(err); }) }); } } export default DrushIOMember;
'use strict'; let apiClient; class DrushIOMember { constructor(client, project, identifier, data = {}) { apiClient = client; this.identifier = identifier; this.project = project; this.data = data; } /** * Updates the given membership with the provided details. * * @param {Object} details * @param {Object} details.role * @param {String} details.role.type * * @returns {Promise} */ update(details) { return new Promise((resolve, reject) => { apiClient.patch(`/projects/${this.project.identifier}/members/${this.identifier}`, details).then((response) => { this.data = response.body; resolve(this); }).catch((err) => { reject(err); }) }); } remove() { return new Promise((resolve, reject) => { apiClient.del(`/projects/${this.project.identifier}/members/${this.identifier}`).then(() => { resolve(); }).catch((err) => { reject(err); }) }); } /** * Re-sends the invitation for the given membership. */ invite() { return new Promise((resolve, reject) => { apiClient.post(`/projects/${this.project.identifier}/members/${this.identifier}/invite`).then(() => { resolve(); }).catch((err) => { reject(err); }) }); } } export default DrushIOMember;
Allow invitations to members to be re-sent.
Allow invitations to members to be re-sent.
JavaScript
mit
drush-io/api-client-js,drush-io/api-client-js
--- +++ @@ -41,6 +41,19 @@ }); } + /** + * Re-sends the invitation for the given membership. + */ + invite() { + return new Promise((resolve, reject) => { + apiClient.post(`/projects/${this.project.identifier}/members/${this.identifier}/invite`).then(() => { + resolve(); + }).catch((err) => { + reject(err); + }) + }); + } + } export default DrushIOMember;
3f43dbfb81de9cab58fdc83c02f864872ad69210
examples/demo/index.js
examples/demo/index.js
'use strict'; var angular = require('angular'); // Require the almost-static-site main module var mainModule = require('../../main'); // Define the Demo App var app = window.app = angular.module('demoApp', [ 'assMain' ]); // Here you can define app specific angular extensions to the almost-static-site main module module.exports = app;
/*global angular*/ 'use strict'; require('angular'); // Require the almost-static-site main module var mainModule = require('../../main'); // Define the Demo App var app = window.app = angular.module('demoApp', [ 'assMain' ]); // Here you can define app specific angular extensions to the almost-static-site main module module.exports = app;
Fix angular 1.3 CommonJS require on example/demo
Fix angular 1.3 CommonJS require on example/demo
JavaScript
mit
unkhz/almost-static-site,unkhz/almost-static-site
--- +++ @@ -1,6 +1,7 @@ +/*global angular*/ 'use strict'; -var angular = require('angular'); +require('angular'); // Require the almost-static-site main module var mainModule = require('../../main');
c0bfd8a797232d1ee43f9f554b932f0c6df10b2f
addon/index.js
addon/index.js
let PolarBear = Ember.Object.extend({ schedule(target, f, interval) { return Ember.run.later(this, function() { f.apply(target); this.start(target, f, interval); }, interval); }, kill() { return Ember.run.cancel(this.get('timer')); }, start(target, f, interval = 500) { this.set('timer', this.schedule(target, f, interval)); } }); PolarBear.reopenClass({ type: 'PolarBear' }); export default PolarBear.create();
let PolarBear = Ember.Object.extend({ interval: 1000, schedule(f) { return Ember.run.later(this, function() { f.apply(this); this.start(f); }, this.get('interval')); }, kill() { return Ember.run.cancel(this.get('timer')); }, start(f) { this.set('timer', this.schedule(f)); } }); PolarBear.reopenClass({ type: 'PolarBear' }); export default PolarBear;
Revert "Instantiate when it is imporeted"
Revert "Instantiate when it is imporeted" This reverts commit e80b68bb5791247ae80179e541e04f865002206b.
JavaScript
mit
sozuuuuu/ember-cli-polar-bear,sozuuuuu/ember-cli-polar-bear
--- +++ @@ -1,17 +1,19 @@ let PolarBear = Ember.Object.extend({ - schedule(target, f, interval) { + interval: 1000, + + schedule(f) { return Ember.run.later(this, function() { - f.apply(target); - this.start(target, f, interval); - }, interval); + f.apply(this); + this.start(f); + }, this.get('interval')); }, kill() { return Ember.run.cancel(this.get('timer')); }, - start(target, f, interval = 500) { - this.set('timer', this.schedule(target, f, interval)); + start(f) { + this.set('timer', this.schedule(f)); } }); @@ -19,5 +21,5 @@ type: 'PolarBear' }); -export default PolarBear.create(); +export default PolarBear;
7dd9607934d0dc964878f570a21274874c719dbe
hn.js
hn.js
// Adapted from https://github.com/etcet/HNES/blob/master/js/hn.js $(document).ready(function() { $('body > center > table > tbody > tr:first-child').attr('id', 'header'); $('#header td').removeAttr('bgcolor'); $('#header > td > table > tbody > tr > td:first-child').removeAttr('style').attr('id', 'img-wrapper'); $('#header > td > table > tbody > tr > td:nth-child(2)').removeAttr('style').attr('id', 'title'); });
// Adapted from https://github.com/etcet/HNES/blob/master/js/hn.js $(document).ready(function() { $('body > center > table > tbody > tr:first-child').attr('id', 'header'); $('#header td').removeAttr('bgcolor'); $('#header > td > table > tbody > tr > td:first-child').removeAttr('style').attr('id', 'img-wrapper'); $('#header > td > table > tbody > tr > td:nth-child(2)').removeAttr('style').attr('id', 'title'); $('body > center > table > tbody > tr:nth-child(3)').attr('id', 'articles'); $('#articles > td > table tr:nth-child(3n-2)').addClass('article-title'); $('#articles > td > table tr:nth-child(3n-1)').addClass('article-details'); $('#articles > td > table tr:nth-child(3n)').remove(); });
Add classes to article table elements.
Add classes to article table elements.
JavaScript
mit
johnotander/hckrnws
--- +++ @@ -7,4 +7,11 @@ $('#header td').removeAttr('bgcolor'); $('#header > td > table > tbody > tr > td:first-child').removeAttr('style').attr('id', 'img-wrapper'); $('#header > td > table > tbody > tr > td:nth-child(2)').removeAttr('style').attr('id', 'title'); + + $('body > center > table > tbody > tr:nth-child(3)').attr('id', 'articles'); + + $('#articles > td > table tr:nth-child(3n-2)').addClass('article-title'); + $('#articles > td > table tr:nth-child(3n-1)').addClass('article-details'); + $('#articles > td > table tr:nth-child(3n)').remove(); + });
23a43dc3226d73c9138284051510b6d4315d7dcb
postcss.config.js
postcss.config.js
module.exports = { plugins: [ require('postcss-import'), require('postcss-css-reset'), require('postcss-custom-properties'), require('postcss-extend'), require('postcss-nested'), require('postcss-color-function'), require('postcss-button'), require('postcss-inline-svg'), require('postcss-svgo'), require('postcss-flexbox'), require('postcss-neat')({ neatMaxWidth: '960px' }), require('postcss-extend'), require('postcss-custom-media'), require('postcss-media-minmax'), require('postcss-cssnext')({ browsers: [ 'last 2 versions', 'ie >= 10' ] }), require('cssnano')({ autoprefixer: false, // already prefixed w/ cssnext save: true, core: true, sourcemap: true }) ] };
module.exports = { plugins: [ require('postcss-import'), require('postcss-css-reset'), require('postcss-custom-properties'), require('postcss-extend'), require('postcss-nested'), require('postcss-color-function'), require('postcss-button'), require('postcss-inline-svg'), require('postcss-svgo'), require('postcss-flexbox'), require('postcss-neat')({ neatMaxWidth: '1200px' }), require('postcss-extend'), require('postcss-custom-media'), require('postcss-media-minmax'), require('postcss-cssnext')({ browsers: [ 'last 2 versions', 'ie >= 10' ] }), require('cssnano')({ autoprefixer: false, // already prefixed w/ cssnext save: true, core: true, sourcemap: true }) ] };
Fix value of max. width ('neatMaxWidth') used by postcss-neat
Fix value of max. width ('neatMaxWidth') used by postcss-neat
JavaScript
apache-2.0
input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl-explorer,input-output-hk/cardano-sl-explorer,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/cardano-sl-explorer
--- +++ @@ -11,7 +11,7 @@ require('postcss-svgo'), require('postcss-flexbox'), require('postcss-neat')({ - neatMaxWidth: '960px' + neatMaxWidth: '1200px' }), require('postcss-extend'), require('postcss-custom-media'),
671aeb8ef771da601e037ad93af5ce97a2c020c7
app/javascript/old/navtabs.js
app/javascript/old/navtabs.js
$(document).on('turbo:load turbo:render', function() { var $panels, $tabs; $tabs = $('#lab_tests').tabs(); $panels = $('.ui-tabs-panel'); $('#departments').tabs({ cache: true }); $('#departments').tabs('paging', { nextButton: '&rarr;', prevButton: '&larr;', follow: true, followOnSelect: true }); $('#order_tests').tabs({ cache: true }); return $('#order_tests').tabs('paging', { nextButton: '&rarr;', prevButton: '&larr;', follow: true, followOnSelect: true }); });
$(document).on('turbo:load turbo:render', function() { $('#departments').tabs({ cache: true }); $('#departments').tabs('paging', { nextButton: '&rarr;', prevButton: '&larr;', follow: true, followOnSelect: true }); $('#order_tests').tabs({ cache: true }); return $('#order_tests').tabs('paging', { nextButton: '&rarr;', prevButton: '&larr;', follow: true, followOnSelect: true }); });
Remove declared but unused vars
Remove declared but unused vars
JavaScript
mit
Labtec/OpenLIS,Labtec/OpenLIS,Labtec/OpenLIS
--- +++ @@ -1,7 +1,4 @@ $(document).on('turbo:load turbo:render', function() { - var $panels, $tabs; - $tabs = $('#lab_tests').tabs(); - $panels = $('.ui-tabs-panel'); $('#departments').tabs({ cache: true });
152727eb30260004929c5e212cd1217e76deb371
app/javascript/app/providers/agriculture-countries-context-provider/agriculture-countries-context-provider-reducers.js
app/javascript/app/providers/agriculture-countries-context-provider/agriculture-countries-context-provider-reducers.js
export const initialState = { loading: false, loaded: false, data: [], error: false }; const setLoading = (loading, state) => ({ ...state, loading }); const setLoaded = (loaded, state) => ({ ...state, loaded }); const setError = (state, error) => ({ ...state, error }); export default { fetchAgricultureCountriesContextsInit: state => setLoading(true, state), fetchAgricultureCountriesContextsReady: (state, { payload: { data } }) => setLoaded(true, setLoading(false, { ...state, data })), fetchAgricultureCountriesContextsFail: state => setLoading(setError(state, true), false) };
export const initialState = { loading: false, loaded: false, data: [], error: false }; const setLoading = (loading, state) => ({ ...state, loading }); const setLoaded = (loaded, state) => ({ ...state, loaded }); const setError = (state, error) => ({ ...state, error }); export default { fetchAgricultureCountriesContextsInit: state => setLoading(true, state), fetchAgricultureCountriesContextsReady: ( state, { payload: { data, meta } } ) => setLoaded(true, setLoading(false, { ...state, data, meta })), fetchAgricultureCountriesContextsFail: state => setLoading(setError(state, true), false) };
Add meta data to agriculture contexts store
Add meta data to agriculture contexts store
JavaScript
mit
Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch
--- +++ @@ -11,8 +11,10 @@ export default { fetchAgricultureCountriesContextsInit: state => setLoading(true, state), - fetchAgricultureCountriesContextsReady: (state, { payload: { data } }) => - setLoaded(true, setLoading(false, { ...state, data })), + fetchAgricultureCountriesContextsReady: ( + state, + { payload: { data, meta } } + ) => setLoaded(true, setLoading(false, { ...state, data, meta })), fetchAgricultureCountriesContextsFail: state => setLoading(setError(state, true), false) };
1e1aaff133bdc271386a02247811063dcbaf672e
app/js/main.js
app/js/main.js
/* * EksiOkuyucu - unofficial eksisozluk client * http://eksiokuyucu.com/ * * Copyright (C) 2014 Onur Aslan <onuraslan@gmail.com> * Licensed under MIT * https://github.com/onuraslan/EksiOkuyucu/blob/master/COPYING */ require.config ({ paths: { requireLib: 'libs/require', jquery: 'libs/jquery-1.11.0.min', underscore: 'libs/underscore-min', backbone: 'libs/backbone-min', text: 'libs/text', bootstrap: 'libs/bootstrap.min', templates: '../templates' }, shim: { 'bootstrap': { deps: ["jquery"] } } }); require([ 'app', ], function (App) { App.initialize (); });
/* * EksiOkuyucu - eksisozluk reader * https://github.com/onuraslan/EksiOkuyucu * * Copyright (C) 2015 Onur Aslan <onur@onur.im> * Licensed under MIT */ require.config ({ paths: { requireLib: 'libs/require', jquery: 'libs/jquery-1.11.0.min', underscore: 'libs/underscore-min', backbone: 'libs/backbone-min', text: 'libs/text', bootstrap: 'libs/bootstrap.min', templates: '../templates' }, shim: { 'bootstrap': { deps: ["jquery"] } } }); require([ 'app', ], function (App) { App.initialize (); });
Update copyright year, homepage and email
Update copyright year, homepage and email
JavaScript
mit
onur/EksiOkuyucu,onuraslan/EksiOkuyucu,onur/EksiOkuyucu,onuraslan/EksiOkuyucu
--- +++ @@ -1,10 +1,9 @@ /* - * EksiOkuyucu - unofficial eksisozluk client - * http://eksiokuyucu.com/ + * EksiOkuyucu - eksisozluk reader + * https://github.com/onuraslan/EksiOkuyucu * - * Copyright (C) 2014 Onur Aslan <onuraslan@gmail.com> + * Copyright (C) 2015 Onur Aslan <onur@onur.im> * Licensed under MIT - * https://github.com/onuraslan/EksiOkuyucu/blob/master/COPYING */ require.config ({
31cba1e550f8332ca46801b6884159af34324725
package.js
package.js
Package.describe({ summary: "Twilio API Wrapper for Meteor" }); Npm.depends({ "twilio": "1.1.4" }); Package.on_use(function(api) { if (api.export) api.export('Twilio', 'server'); api.add_files('twilio_npm.js', 'server'); });
Package.describe({ summary: "Twilio API Wrapper for Meteor" }); Npm.depends({ "twilio": "1.4.0" }); Package.on_use(function(api) { if (api.export) api.export('Twilio', 'server'); api.add_files('twilio_npm.js', 'server'); });
Update twilio module reference to 1.4.0
Update twilio module reference to 1.4.0 Latest twilio-node: https://github.com/twilio/twilio-node/
JavaScript
mit
bright-sparks/twilio-meteor,andreioprisan/twilio-meteor
--- +++ @@ -2,7 +2,7 @@ summary: "Twilio API Wrapper for Meteor" }); -Npm.depends({ "twilio": "1.1.4" }); +Npm.depends({ "twilio": "1.4.0" }); Package.on_use(function(api) { if (api.export) api.export('Twilio', 'server');
f98f628dec56251db734226843b26a3d5c01e97a
app/package.js
app/package.js
const { clone, pull } = require('./lib/git') const path = require('path') const jetpack = require('fs-jetpack') const configuration = require('./configuration') class Package { constructor (url) { this.path = path.join(configuration.pluginDir, url) this.url = url this.clone = clone this.pull = pull } load () { return this.download().then(() => { const plugin = require(path.join(this.path, 'zazu.js')) plugin.blocks = plugin.blocks || {} plugin.blocks.external = plugin.blocks.external || [] plugin.blocks.input = plugin.blocks.input || [] plugin.blocks.output = plugin.blocks.output || [] return plugin }) } update () { if (!jetpack.exists(this.path)) { return Promise.reject('Package' + this.url + ' does not exist') } return this.pull(this.path) } download () { if (jetpack.exists(this.path)) { return Promise.resolve('exists') } return this.clone(this.url, this.path).then(() => { return 'downloaded' }) } } module.exports = Package
const { clone, pull } = require('./lib/git') const path = require('path') const jetpack = require('fs-jetpack') const freshRequire = require('./lib/freshRequire') const configuration = require('./configuration') class Package { constructor (url) { this.path = path.join(configuration.pluginDir, url) this.url = url this.clone = clone this.pull = pull } load () { return this.download().then(() => { const plugin = freshRequire(path.join(this.path, 'zazu.js')) plugin.blocks = plugin.blocks || {} plugin.blocks.external = plugin.blocks.external || [] plugin.blocks.input = plugin.blocks.input || [] plugin.blocks.output = plugin.blocks.output || [] return plugin }) } update () { if (!jetpack.exists(this.path)) { return Promise.reject('Package' + this.url + ' does not exist') } return this.pull(this.path) } download () { if (jetpack.exists(this.path)) { return Promise.resolve('exists') } return this.clone(this.url, this.path).then(() => { return 'downloaded' }) } } module.exports = Package
Allow new blocks to be reloaded.
Allow new blocks to be reloaded.
JavaScript
mit
tinytacoteam/zazu,tinytacoteam/zazu
--- +++ @@ -1,6 +1,7 @@ const { clone, pull } = require('./lib/git') const path = require('path') const jetpack = require('fs-jetpack') +const freshRequire = require('./lib/freshRequire') const configuration = require('./configuration') @@ -14,7 +15,7 @@ load () { return this.download().then(() => { - const plugin = require(path.join(this.path, 'zazu.js')) + const plugin = freshRequire(path.join(this.path, 'zazu.js')) plugin.blocks = plugin.blocks || {} plugin.blocks.external = plugin.blocks.external || [] plugin.blocks.input = plugin.blocks.input || []
a472c660b51be2a1aed5012caa68661a0d7906f4
app/utilities/search/index.js
app/utilities/search/index.js
'use strict' const Fuse = require('fuse.js') let fuse = null let fuseIndex = [] const fuseOptions = { shouldSort: true, tokenize: true, matchAllTokens: true, findAllMatches: true, threshold: 0.2, location: 0, distance: 100, maxPatternLength: 32, minMatchCharLength: 1, keys: [ 'description', 'language' ] } function resetFuseIndex (list) { fuseIndex = list } function initFuseSearch () { fuse = new Fuse(fuseIndex, fuseOptions) } function addToFuseIndex (item) { fuseIndex.push(item) } function updateFuseIndex (item) { const newIndex = fuseIndex.filter(gist => { return gist.id !== item.id }) newIndex.push(item) fuseIndex = newIndex } function fuseSearch (pattern) { return fuse.search(pattern.trim() || '') } module.exports = { resetFuseIndex: resetFuseIndex, updateFuseIndex: updateFuseIndex, addToFuseIndex: addToFuseIndex, initFuseSearch: initFuseSearch, fuseSearch: fuseSearch }
'use strict' const Fuse = require('fuse.js') let fuse = null let fuseIndex = [] const fuseOptions = { shouldSort: true, tokenize: true, matchAllTokens: true, findAllMatches: true, threshold: 0.2, location: 0, distance: 100, maxPatternLength: 32, minMatchCharLength: 1, keys: [ 'description', 'language' ] } function resetFuseIndex (list) { fuseIndex = list } function initFuseSearch () { fuse = new Fuse(fuseIndex, fuseOptions) } function addToFuseIndex (item) { fuseIndex.push(item) } function updateFuseIndex (item) { const newIndex = fuseIndex.filter(gist => { return gist.id !== item.id }) newIndex.push(item) fuseIndex = newIndex } function fuseSearch (pattern) { const trimmedPattern = pattern.trim() if (!trimmedPattern || trimmedPattern.length <= 1) return [] return fuse.search(trimmedPattern) } module.exports = { resetFuseIndex: resetFuseIndex, updateFuseIndex: updateFuseIndex, addToFuseIndex: addToFuseIndex, initFuseSearch: initFuseSearch, fuseSearch: fuseSearch }
Disable the search when the input pattern's length is less than or equal to 1
Disable the search when the input pattern's length is less than or equal to 1
JavaScript
mit
wujysh/Lepton,wujysh/Lepton
--- +++ @@ -41,7 +41,10 @@ } function fuseSearch (pattern) { - return fuse.search(pattern.trim() || '') + const trimmedPattern = pattern.trim() + if (!trimmedPattern || trimmedPattern.length <= 1) return [] + + return fuse.search(trimmedPattern) } module.exports = {
10921ad47828ed7b5a2c3d6d3e40e7ad69418bc7
examples/request/app.js
examples/request/app.js
import { Request } from 'react-axios' import React from 'react' import ReactDOM from 'react-dom' class App extends React.Component { constructor(props) { super(props) this.state = {} } render() { return ( <div> <code> <Request method="get" url="/api/request"> {(error, response, isLoading) => { if(error) { return (<div>Something bad happened: {error.message}</div>) } else if(isLoading) { return (<div className="loader"></div>) } else if(response !== null) { return (<div>{response.data.message}</div>) } return null }} </Request> </code> </div> ) } } ReactDOM.render( <App />, document.getElementById('app') )
import { Request, Get, Post, Put, Delete, Head, Patch } from 'react-axios' import React from 'react' import ReactDOM from 'react-dom' class App extends React.Component { constructor(props) { super(props) this.state = {} } renderResponse(error, response, isLoading) { if(error) { return (<div>Something bad happened: {error.message}</div>) } else if(isLoading) { return (<div className="loader"></div>) } else if(response !== null) { return (<div>{response.data.message}</div>) } return null } render() { return ( <div> <code> <h2>Request</h2> <Request method="get" url="/api/request"> {this.renderResponse} </Request> <h2>Get</h2> <Get url="/api/get"> {this.renderResponse} </Get> <h2>Post</h2> <Post url="/api/post" data={{ id: '12345' }}> {this.renderResponse} </Post> <h2>Delete</h2> <Delete url="/api/delete" data={{ id: '12345' }}> {this.renderResponse} </Delete> <h2>Put</h2> <Put url="/api/put" data={{ id: '12345' }}> {this.renderResponse} </Put> <h2>Patch</h2> <Patch url="/api/patch" data={{ id: '12345' }}> {this.renderResponse} </Patch> <h2>Head</h2> <Head url="/api/head"> {this.renderResponse} </Head> </code> </div> ) } } ReactDOM.render( <App />, document.getElementById('app') )
Add examples for each component type.
Add examples for each component type.
JavaScript
mit
sheaivey/react-axios,sheaivey/react-axios
--- +++ @@ -1,4 +1,4 @@ -import { Request } from 'react-axios' +import { Request, Get, Post, Put, Delete, Head, Patch } from 'react-axios' import React from 'react' import ReactDOM from 'react-dom' @@ -8,22 +8,49 @@ this.state = {} } + renderResponse(error, response, isLoading) { + if(error) { + return (<div>Something bad happened: {error.message}</div>) + } else if(isLoading) { + return (<div className="loader"></div>) + } else if(response !== null) { + return (<div>{response.data.message}</div>) + } + return null + } + render() { return ( <div> <code> + <h2>Request</h2> <Request method="get" url="/api/request"> - {(error, response, isLoading) => { - if(error) { - return (<div>Something bad happened: {error.message}</div>) - } else if(isLoading) { - return (<div className="loader"></div>) - } else if(response !== null) { - return (<div>{response.data.message}</div>) - } - return null - }} + {this.renderResponse} </Request> + <h2>Get</h2> + <Get url="/api/get"> + {this.renderResponse} + </Get> + <h2>Post</h2> + <Post url="/api/post" data={{ id: '12345' }}> + {this.renderResponse} + </Post> + <h2>Delete</h2> + <Delete url="/api/delete" data={{ id: '12345' }}> + {this.renderResponse} + </Delete> + <h2>Put</h2> + <Put url="/api/put" data={{ id: '12345' }}> + {this.renderResponse} + </Put> + <h2>Patch</h2> + <Patch url="/api/patch" data={{ id: '12345' }}> + {this.renderResponse} + </Patch> + <h2>Head</h2> + <Head url="/api/head"> + {this.renderResponse} + </Head> </code> </div> )
490ae36bd10f9ccf6c8efc89fec5ac5c981a28aa
examples/profile-cards-react-with-styles/src/components/Profile.js
examples/profile-cards-react-with-styles/src/components/Profile.js
/* eslint-disable react/prop-types */ import React from 'react'; import { Image, View, Text } from 'react-sketchapp'; import { css, withStyles } from '../withStyles'; const Profile = ({ user, styles }) => ( <View {...css(styles.container)}> {/* <Image source={user.profile_image_url} {...css(styles.avatar)} /> */} <View {...css(styles.titleWrapper)}> <Text {...css(styles.title)}>{user.name}</Text> <Text {...css(styles.subtitle)}>{`@${user.screen_name}`}</Text> </View> <Text {...css(styles.body)}>{user.description}</Text> <Text {...css(styles.body)}>{user.location}</Text> <Text {...css(styles.body)}>{user.url}</Text> </View> ); export default withStyles(({ colors, fonts, spacing }) => ({ container: { backgroundColor: colors.Haus, padding: spacing, width: 260, marginRight: spacing, }, avatar: { height: 220, resizeMode: 'contain', marginBottom: spacing * 2, borderRadius: 10, }, titleWrapper: { marginBottom: spacing, }, title: { ...fonts['Title 2'] }, subtitle: { ...fonts['Title 3'] }, body: { ...fonts.Body }, }))(Profile);
/* eslint-disable react/prop-types */ import React from 'react'; import { Image, View, Text } from 'react-sketchapp'; import { css, withStyles } from '../withStyles'; const Profile = ({ user, styles }) => ( <View {...css(styles.container)}> <Image source={user.profile_image_url} {...css(styles.avatar)} /> <View {...css(styles.titleWrapper)}> <Text {...css(styles.title)}>{user.name}</Text> <Text {...css(styles.subtitle)}>{`@${user.screen_name}`}</Text> </View> <Text {...css(styles.body)}>{user.description}</Text> <Text {...css(styles.body)}>{user.location}</Text> <Text {...css(styles.body)}>{user.url}</Text> </View> ); export default withStyles(({ colors, fonts, spacing }) => ({ container: { backgroundColor: colors.Haus, padding: spacing, width: 260, marginRight: spacing, }, avatar: { height: 220, resizeMode: 'contain', marginBottom: spacing * 2, borderRadius: 10, }, titleWrapper: { marginBottom: spacing, }, title: { ...fonts['Title 2'] }, subtitle: { ...fonts['Title 3'] }, body: { ...fonts.Body }, }))(Profile);
Fix commented out avatar in profile-cards-react-with-styles
Fix commented out avatar in profile-cards-react-with-styles
JavaScript
mit
weaintplastic/react-sketchapp
--- +++ @@ -5,7 +5,7 @@ const Profile = ({ user, styles }) => ( <View {...css(styles.container)}> - {/* <Image source={user.profile_image_url} {...css(styles.avatar)} /> */} + <Image source={user.profile_image_url} {...css(styles.avatar)} /> <View {...css(styles.titleWrapper)}> <Text {...css(styles.title)}>{user.name}</Text> <Text {...css(styles.subtitle)}>{`@${user.screen_name}`}</Text>
fb057f1f94237885bc027d0f209739cc384166b7
bin/sync-algolia.js
bin/sync-algolia.js
import algolia from 'algoliasearch'; import icons from '../dist/icons.json'; import tags from '../src/tags.json'; const ALGOLIA_APP_ID = '5EEOG744D0'; if ( process.env.TRAVIS_PULL_REQUEST === 'false' && process.env.TRAVIS_BRANCH === 'master' ) { syncAlgolia(); } else { console.log('Skipped Algolia sync.'); } function syncAlgolia() { // ALGOLIA_ADMIN_KEY must be added as an environment variable in Travis CI const client = algolia(ALGOLIA_APP_ID, process.env.ALGOLIA_ADMIN_KEY); console.log('Initializing target and temporary indexes...'); const index = client.initIndex('icons'); const indexTmp = client.initIndex('icons_tmp'); console.log('Copying target index settings into temporary index...'); client.copyIndex(index.indexName, indexTmp.indexName, ['settings'], err => { if (err) throw err; }); const records = Object.keys(icons).map(name => ({ name, tags: tags[name] || [], })); console.log('Pushing data to the temporary index...'); indexTmp.addObjects(records, err => { if (err) throw err; }); console.log('Moving temporary index to target index...'); client.moveIndex(indexTmp.indexName, index.indexName, err => { if (err) throw err; }); }
import algolia from 'algoliasearch'; import icons from '../dist/icons.json'; import tags from '../src/tags.json'; const ALGOLIA_APP_ID = '5EEOG744D0'; if ( process.env.TRAVIS_PULL_REQUEST === 'false' && process.env.TRAVIS_BRANCH === 'master' ) { syncAlgolia(); } else { console.log('Skipped Algolia sync.'); } function syncAlgolia() { // ALGOLIA_ADMIN_KEY must be added as an environment variable in Travis CI const client = algolia(ALGOLIA_APP_ID, process.env.ALGOLIA_ADMIN_KEY); console.log('Initializing target and temporary indexes...'); const index = client.initIndex('icons'); const indexTmp = client.initIndex('icons_tmp'); index.setSettings({ searchableAttributes: ['unordered(name)', 'unordered(tags)'], customRanking: ['asc(name)'], }); console.log('Copying target index settings into temporary index...'); client.copyIndex(index.indexName, indexTmp.indexName, ['settings'], err => { if (err) throw err; }); const records = Object.keys(icons).map(name => ({ name, tags: tags[name] || [], })); console.log('Pushing data to the temporary index...'); indexTmp.addObjects(records, err => { if (err) throw err; }); console.log('Moving temporary index to target index...'); client.moveIndex(indexTmp.indexName, index.indexName, err => { if (err) throw err; }); }
Initialize algolia settings in script
build: Initialize algolia settings in script
JavaScript
mit
colebemis/feather,colebemis/feather
--- +++ @@ -21,6 +21,11 @@ const index = client.initIndex('icons'); const indexTmp = client.initIndex('icons_tmp'); + index.setSettings({ + searchableAttributes: ['unordered(name)', 'unordered(tags)'], + customRanking: ['asc(name)'], + }); + console.log('Copying target index settings into temporary index...'); client.copyIndex(index.indexName, indexTmp.indexName, ['settings'], err => { if (err) throw err;
b676b5db32487ef6754bf4a1ddd2df5d7d455ff2
app/js/services.js
app/js/services.js
angular.module('F1FeederApp.services', []) .factory('ergastAPIservice', function($http) { var ergastAPI = {}; ergastAPI.getDrivers = function() { return $http({ method: 'JSONP', url: 'http://ergast.com/api/f1/2013/driverStandings.json?callback=JSON_CALLBACK' }); } ergastAPI.getDriverDetails = function(id) { return $http({ method: 'JSONP', url: 'http://ergast.com/api/f1/2013/drivers/'+ id +'/driverStandings.json?callback=JSON_CALLBACK' }); } ergastAPI.getDriverRaces = function(id) { return $http({ method: 'JSONP', url: 'http://ergast.com/api/f1/2013/drivers/'+ id +'/results.json?callback=JSON_CALLBACK' }); } return ergastAPI; });
angular.module('F1FeederApp.services', []) .factory('ergastAPIservice', function($http) { var ergastAPI = {}; ergastAPI.getDrivers = function() { return $http({ method: 'JSONP', url: 'http://ergast.com/api/f1/2016/driverStandings.json?callback=JSON_CALLBACK' }); } ergastAPI.getDriverDetails = function(id) { return $http({ method: 'JSONP', url: 'http://ergast.com/api/f1/2016/drivers/'+ id +'/driverStandings.json?callback=JSON_CALLBACK' }); } ergastAPI.getDriverRaces = function(id) { return $http({ method: 'JSONP', url: 'http://ergast.com/api/f1/2016/drivers/'+ id +'/results.json?callback=JSON_CALLBACK' }); } return ergastAPI; });
Update data source to 2016 feed
Update data source to 2016 feed
JavaScript
mit
buchananjason/softsource,buchananjason/softsource
--- +++ @@ -6,21 +6,21 @@ ergastAPI.getDrivers = function() { return $http({ method: 'JSONP', - url: 'http://ergast.com/api/f1/2013/driverStandings.json?callback=JSON_CALLBACK' + url: 'http://ergast.com/api/f1/2016/driverStandings.json?callback=JSON_CALLBACK' }); } ergastAPI.getDriverDetails = function(id) { return $http({ method: 'JSONP', - url: 'http://ergast.com/api/f1/2013/drivers/'+ id +'/driverStandings.json?callback=JSON_CALLBACK' + url: 'http://ergast.com/api/f1/2016/drivers/'+ id +'/driverStandings.json?callback=JSON_CALLBACK' }); } ergastAPI.getDriverRaces = function(id) { return $http({ method: 'JSONP', - url: 'http://ergast.com/api/f1/2013/drivers/'+ id +'/results.json?callback=JSON_CALLBACK' + url: 'http://ergast.com/api/f1/2016/drivers/'+ id +'/results.json?callback=JSON_CALLBACK' }); }
5e766f596a8f5173d77e86079555f82bd90a1c38
shared/config/env/development.js
shared/config/env/development.js
'use strict'; var _ = require('lodash'); var base = require('./base'); const development = _.merge({}, base, { env: 'development', auth0: { callbackURL: process.env.AUTH0_CALLBACK_URL || 'http://localhost:9000/auth/callback', clientID: process.env.AUTH0_CLIENT_ID || 'uyTltKDRg1BKu3nzDu6sLpHS44sInwOu', }, kbhAccessKey: process.env.KBH_ACCESS_KEY, siteTitle: 'kbhbilleder.dk (dev)', allowRobots: true, es: { log: 'error' //use 'trace' for verbose mode }, }); module.exports = development;
'use strict'; var _ = require('lodash'); var base = require('./base'); const development = _.merge({}, base, { auth0: { callbackURL: process.env.AUTH0_CALLBACK_URL || 'http://localhost:9000/auth/callback', clientID: process.env.AUTH0_CLIENT_ID || 'uyTltKDRg1BKu3nzDu6sLpHS44sInwOu', }, env: 'development', kbhAccessKey: process.env.KBH_ACCESS_KEY, siteTitle: 'kbhbilleder.dk (dev)', allowRobots: true, es: { log: 'error' //use 'trace' for verbose mode }, }); module.exports = development;
Align ordering of config vars between files
Align ordering of config vars between files
JavaScript
mit
CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder
--- +++ @@ -4,11 +4,11 @@ var base = require('./base'); const development = _.merge({}, base, { - env: 'development', auth0: { callbackURL: process.env.AUTH0_CALLBACK_URL || 'http://localhost:9000/auth/callback', clientID: process.env.AUTH0_CLIENT_ID || 'uyTltKDRg1BKu3nzDu6sLpHS44sInwOu', }, + env: 'development', kbhAccessKey: process.env.KBH_ACCESS_KEY, siteTitle: 'kbhbilleder.dk (dev)', allowRobots: true,
315a504853934027997a08faf7d91a2da5aead4f
simulators/moisture_simulator.js
simulators/moisture_simulator.js
/* * Moisture simulator * */ module.exports = function(sensor_id){ var simulator = {}; simulator.id = sensor_id; simulator.type = 'humidity'; simulator.unit = 'humidity.%perL'; simulator.getValue = function(){ return Math.round((60 + 5 * Math.random())*100)/100; }; return simulator; };
/* * Moisture simulator * */ module.exports = function(sensor_id){ var simulator = {}; simulator.id = sensor_id; simulator.type = 'moisture'; simulator.unit = 'humidity.%perL'; simulator.getValue = function(){ return Math.round((60 + 5 * Math.random())*100)/100; }; return simulator; };
Update simulator.type for moisture simulator
Update simulator.type for moisture simulator
JavaScript
apache-2.0
HomeAgain/HomePi
--- +++ @@ -7,7 +7,7 @@ var simulator = {}; simulator.id = sensor_id; - simulator.type = 'humidity'; + simulator.type = 'moisture'; simulator.unit = 'humidity.%perL'; simulator.getValue = function(){
4f531ab17b81b0412a4d093cae41989ebaac4e92
website/src/app/project/experiments/experiment/components/notes/mc-experiment-notes.component.js
website/src/app/project/experiments/experiment/components/notes/mc-experiment-notes.component.js
angular.module('materialscommons').component('mcExperimentNotes', { templateUrl: 'app/project/experiments/experiment/components/notes/mc-experiment-notes.html', bindings: { experiment: '=' } });
angular.module('materialscommons').component('mcExperimentNotes', { templateUrl: 'app/project/experiments/experiment/components/notes/mc-experiment-notes.html', controller: MCExperimentNotesComponentController, bindings: { experiment: '=' } }); class MCExperimentNotesComponentController { /*@ngInject*/ constructor($scope) { $scope.editorOptions = {}; } addNote() { } }
Add controller (to be filled out).
Add controller (to be filled out).
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
--- +++ @@ -1,6 +1,18 @@ angular.module('materialscommons').component('mcExperimentNotes', { templateUrl: 'app/project/experiments/experiment/components/notes/mc-experiment-notes.html', + controller: MCExperimentNotesComponentController, bindings: { experiment: '=' } }); + +class MCExperimentNotesComponentController { + /*@ngInject*/ + constructor($scope) { + $scope.editorOptions = {}; + } + + addNote() { + + } +}
9b3ab9735e8e95b342514996d8603d333b957604
src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.admin-extra.js
src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.admin-extra.js
import defaultConfig from './webpack.config.default'; export default function webpackConfigAdminExtra(speedupLocalDevelopment, optimize = false) { const config = defaultConfig(speedupLocalDevelopment, optimize); config.entry = './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/admin/js/admin-bundle-extra.js'; config.output = { filename: './{% if isV4 %}public{% else %}web{% endif %}/frontend/js/admin-bundle-extra.js', }; return config; }
import defaultConfig from './webpack.config.default'; export default function webpackConfigAdminExtra(speedupLocalDevelopment, optimize = false) { const config = defaultConfig(speedupLocalDevelopment, optimize); config.entry = './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/admin/js/admin-bundle-extra.js'; config.output = { path: path.resolve(__dirname, '../../{% if isV4 %}public{% else %}web{% endif %}/frontend/js'), filename: 'admin-bundle-extra.js', }; return config; }
Fix webpack output path for admin-bundle-extra js
[GeneratorBundle] Fix webpack output path for admin-bundle-extra js
JavaScript
mit
wesleylancel/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,dbeerten/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,wesleylancel/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,dbeerten/KunstmaanBundlesCMS,mwoynarski/KunstmaanBundlesCMS,fchris82/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,wesleylancel/KunstmaanBundlesCMS,Numkil/KunstmaanBundlesCMS,fchris82/KunstmaanBundlesCMS,mwoynarski/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,fchris82/KunstmaanBundlesCMS,fchris82/KunstmaanBundlesCMS,dbeerten/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,dbeerten/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,insiders/KunstmaanBundlesCMS,mwoynarski/KunstmaanBundlesCMS,Kunstmaan/KunstmaanBundlesCMS,mwoynarski/KunstmaanBundlesCMS,FVKVN/KunstmaanBundlesCMS,wesleylancel/KunstmaanBundlesCMS
--- +++ @@ -5,7 +5,8 @@ config.entry = './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/admin/js/admin-bundle-extra.js'; config.output = { - filename: './{% if isV4 %}public{% else %}web{% endif %}/frontend/js/admin-bundle-extra.js', + path: path.resolve(__dirname, '../../{% if isV4 %}public{% else %}web{% endif %}/frontend/js'), + filename: 'admin-bundle-extra.js', }; return config;
65dc838950683034ca613889b24cfb0a1abfb183
app.js
app.js
'use strict'; var static_server = require('./static_server'); static_server('dist');
'use strict'; var static_server = require('./static_server'); static_server(process.env.DIST || 'dist');
Allow env to specify dist directory
Allow env to specify dist directory
JavaScript
mit
UoSMediaFrameworks/uos-media-playback-framework-legacy,UoSMediaFrameworks/uos-media-playback-framework-legacy,UoSMediaFrameworks/uos-media-playback-framework-legacy
--- +++ @@ -2,4 +2,4 @@ var static_server = require('./static_server'); -static_server('dist'); +static_server(process.env.DIST || 'dist');
0aed1cbe613be7a8925c377d9ffbba59ac237de6
app/scripts/app.js
app/scripts/app.js
'use strict'; /** * @ngdoc overview * @name torrentSubscribeFrontendApp * @description * # torrentSubscribeFrontendApp * * Main module of the application. */ angular .module('torrentSubscribeFrontendApp', [ 'ngResource', 'ngSanitize', 'ngRoute', 'constants', 'ngStorage' ]).config( [ '$compileProvider', function( $compileProvider ) { $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension|magnet):/); } ]).config(function($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'views/main.html', controller: 'SearchCtrl', }) .when('/client', { templateUrl: 'views/client.html', controller: 'ClientCtrl' }) .when('/freespace', { templateUrl: 'views/freespace.html' }) .when('/files', { templateUrl: 'views/files.html', controller: 'FilesCtrl' }) .when('/login', { templateUrl: 'views/login.html', controller: 'LoginCtrl' }); // configure html5 to get links working on jsfiddle $locationProvider.html5Mode(true); });
'use strict'; /** * @ngdoc overview * @name torrentSubscribeFrontendApp * @description * # torrentSubscribeFrontendApp * * Main module of the application. */ angular .module('torrentSubscribeFrontendApp', [ 'ngResource', 'ngSanitize', 'ngRoute', 'constants', 'ngStorage' ]).config( [ '$compileProvider', function( $compileProvider ) { $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension|magnet):/); } ]).config(function($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'views/main.html', controller: 'SearchCtrl', }) .when('/client', { templateUrl: 'views/client.html', controller: 'ClientCtrl' }) .when('/freespace', { templateUrl: 'views/freespace.html' }) .when('/files', { templateUrl: 'views/files.html', controller: 'FilesCtrl' }) .when('/login', { templateUrl: 'views/login.html', controller: 'LoginCtrl' }); // configure html5 to get links working on jsfiddle $locationProvider.html5Mode(true); }).config(["$routeProvider", "$httpProvider", function($routeProvider, $httpProvider){ $httpProvider.defaults.headers.common['Access-Control-Allow-Headers'] = '*'; } ]);;
Add Access-Control-Allow-Headers to http header
Add Access-Control-Allow-Headers to http header
JavaScript
mit
aqibmushtaq/torrent-subscribe-frontend,aqibmushtaq/torrent-subscribe-frontend
--- +++ @@ -45,4 +45,8 @@ // configure html5 to get links working on jsfiddle $locationProvider.html5Mode(true); -}); +}).config(["$routeProvider", "$httpProvider", + function($routeProvider, $httpProvider){ + $httpProvider.defaults.headers.common['Access-Control-Allow-Headers'] = '*'; + } +]);;
4a78c9450b187a4eb136e6bef52cb46f682243ba
lib/scriptify.js
lib/scriptify.js
'use strict'; var browserify = require('browserify'), detective = require('detective'); var fs = require('fs'), Path = require('path'); module.exports = function (path, cb) { fs.readFile(path, { encoding: 'utf8' }, function (err, source) { if (err) return cb(err); var bundle = browserify({ basedir: Path.dirname(path) }); bundle.require(detective(source)); bundle.bundle(function (err, require) { // TODO: Preserve strict mode. return cb(err, require + source); }); }); };
'use strict'; var browserify = require('browserify'), detective = require('detective'); var fs = require('fs'), Path = require('path'); module.exports = function (path, cb) { fs.readFile(path, { encoding: 'utf8' }, function (err, source) { if (err) return cb(err); var bundle = browserify({ basedir: Path.dirname(path) }); var dependencies = detective(source); if (!dependencies.length) { return cb(null, source); } bundle.require(dependencies); bundle.bundle(function (err, requirable) { var loader = function require() { var REQUIRE_ASSIGNMENT; return require.apply(this, arguments); }; var script = source + ';' + loader.toString().replace(/REQUIRE_ASSIGNMENT/, requirable); return cb(err, script); }); }); };
Append require function definition to the end
Append require function definition to the end
JavaScript
mit
eush77/nodei
--- +++ @@ -14,10 +14,21 @@ var bundle = browserify({ basedir: Path.dirname(path) }); - bundle.require(detective(source)); - bundle.bundle(function (err, require) { - // TODO: Preserve strict mode. - return cb(err, require + source); + + var dependencies = detective(source); + if (!dependencies.length) { + return cb(null, source); + } + + bundle.require(dependencies); + bundle.bundle(function (err, requirable) { + var loader = function require() { + var REQUIRE_ASSIGNMENT; + return require.apply(this, arguments); + }; + var script = source + ';' + loader.toString().replace(/REQUIRE_ASSIGNMENT/, requirable); + + return cb(err, script); }); }); };
b9311ff37cea38d3c95d7d6f43a97ee598e3f186
src/components/Link/Link.js
src/components/Link/Link.js
import React, {PureComponent} from 'react'; import classNames from 'classnames'; import {Link as RoutedLink} from 'react-router-dom'; import styles from './Link.scss'; export default class Link extends PureComponent { static defaultProps = { selected: false, }; routedLink() { const {url, selected, className} = this.props; return ( <RoutedLink className={classNames(styles.Link, selected && styles.Selected, className)} to={url} > {this.props.children} </RoutedLink> ); } btnLink() { const {onClick} = this.props; return ( <button className={classNames(styles.Link)} onClick={onClick} > {this.props.children} </button> ); } render() { const {url, external, onClick, selected, className, routed, button} = this.props; if (routed) { return this.routedLink(); } if (button) { return this.btnLink(); } return ( <a className={classNames(styles.Link, selected && styles.Selected, className)} onClick={onClick} onTouchStart={onClick} target={external ? '_blank' : null} href={url} > {this.props.children} </a> ); } }
import React, {PureComponent} from 'react'; import classNames from 'classnames'; import {Link as RoutedLink} from 'react-router-dom'; import styles from './Link.scss'; export default class Link extends PureComponent { static defaultProps = { selected: false, }; routedLink() { const {url, selected, className} = this.props; return ( <RoutedLink className={classNames(styles.Link, selected && styles.Selected, className)} to={url} > {this.props.children} </RoutedLink> ); } btnLink() { const {onClick} = this.props; return ( <button className={classNames(styles.Link)} onClick={onClick} > {this.props.children} </button> ); } render() { const {url, external, onClick, selected, className, routed, button} = this.props; if (routed) { return this.routedLink(); } if (button) { return this.btnLink(); } return ( <a className={classNames(styles.Link, selected && styles.Selected, className)} onClick={onClick} onTouchStart={onClick} target={external ? '_blank' : null} rel={external ? 'noopener' : null} href={url} > {this.props.children} </a> ); } }
Add rel="noopener" for external anchors
Add rel="noopener" for external anchors Recommended by Lighthouse https://developers.google.com/web/tools/lighthouse/audits/noopener
JavaScript
mit
tech-conferences/confs.tech,tech-conferences/confs.tech,tech-conferences/confs.tech
--- +++ @@ -52,6 +52,7 @@ onClick={onClick} onTouchStart={onClick} target={external ? '_blank' : null} + rel={external ? 'noopener' : null} href={url} > {this.props.children}
e4c11a660be53873fdd47fcbf5fee21c369f0f4d
components/OrganisationList.js
components/OrganisationList.js
import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { jsdom } from 'jsdom' import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery require("jsdom").env("", function(err, window) { if (err) { console.error(err); return; } var $ = require("jquery")(window); require('bootstrap'); }); class OrganisationList extends Component { render() { var numberOfOrgs = this.props.organisations.length; var rows = []; var counter = 0; for(var i=0; i<numberOfOrgs; i++) { rows.push(<OrganisationListRow name={this.props.organisations[i].name} id={this.props.organisations[i].id} key={counter}/>); counter++; }; return( <table className="table table-striped table-bordered table-hover"> <thead className="thead"> <th>Name</th> <th>Id</th> </thead> <tbody className="tbody"> {rows} //<OrganisationListRow name={this.props.organisations[0].name} id={this.props.organisations[0].id}/> </tbody> </table> ); } } export default OrganisationList
import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { jsdom } from 'jsdom' import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery // require("jsdom").env("", function(err, window) { // if (err) { // console.error(err); // return; // } // // var $ = require("jquery")(window); // require('bootstrap'); // }); class OrganisationList extends Component { render() { var numberOfOrgs = this.props.organisations.length; var rows = []; var counter = 0; for(var i=0; i<numberOfOrgs; i++) { rows.push(<OrganisationListRow name={this.props.organisations[i].name} id={this.props.organisations[i].id} key={counter}/>); counter++; }; return( <table className="table table-striped table-bordered table-hover"> <thead className="thead"> <th>Name</th> <th>Id</th> </thead> <tbody className="tbody"> {rows} //<OrganisationListRow name={this.props.organisations[0].name} id={this.props.organisations[0].id}/> </tbody> </table> ); } } export default OrganisationList
Comment out bootstrap to make test suite pass
Comment out bootstrap to make test suite pass
JavaScript
apache-2.0
CodeHubOrg/organisations-database,CodeHubOrg/organisations-database
--- +++ @@ -4,19 +4,19 @@ import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery -require("jsdom").env("", function(err, window) { - if (err) { - console.error(err); - return; - } - - var $ = require("jquery")(window); - require('bootstrap'); -}); +// require("jsdom").env("", function(err, window) { +// if (err) { +// console.error(err); +// return; +// } +// +// var $ = require("jquery")(window); +// require('bootstrap'); +// }); class OrganisationList extends Component { - + render() { var numberOfOrgs = this.props.organisations.length; var rows = [];
274079af4bfb6a434c1dbfb6deb9dde56bb68cce
web.js
web.js
var keystone = require('keystone'); keystone.init({ 'name': 'Mottram Evangelical Church', 'favicon': 'public/favicon.ico', 'less': 'public', 'static': 'public', 'views': 'templates/views', 'view engine': 'jade', 'auto update': true, 'mongo': 'mongodb://localhost/mottramec', 'session': true, 'auth': true, 'user model': 'User', 'cookie secret': process.env.MOTTRAM_CONFIG_COOKIE_SECRET, 's3 config': { 'key' : process.env.MOTTRAM_CONFIG_S3_KEY, 'secret' : process.env.MOTTRAM_CONFIG_S3_SECRET, 'bucket' : 'mottramec' }, 'cloudinary config': { 'cloud_name' : 'jamlen', 'api_key' : process.env.MOTTRAM_CONFIG_CLOUDINARY_KEY, 'api_secret' : process.env.MOTTRAM_CONFIG_CLOUDINARY_SECRET } }); require('./models'); keystone.set('routes', require('./routes')); keystone.start();
var keystone = require('keystone'); keystone.init({ 'name': 'Mottram Evangelical Church', 'favicon': 'public/favicon.ico', 'less': 'public', 'static': 'public', 'views': 'templates/views', 'view engine': 'jade', 'auto update': true, 'mongo': 'mongodb://'+ (process.env.MOTTRAM_CONFIG_MONGO_CON || 'localhost')+'/mottramec', 'session': true, 'auth': true, 'user model': 'User', 'cookie secret': process.env.MOTTRAM_CONFIG_COOKIE_SECRET, 's3 config': { 'key' : process.env.MOTTRAM_CONFIG_S3_KEY, 'secret' : process.env.MOTTRAM_CONFIG_S3_SECRET, 'bucket' : 'mottramec' }, 'cloudinary config': { 'cloud_name' : 'jamlen', 'api_key' : process.env.MOTTRAM_CONFIG_CLOUDINARY_KEY, 'api_secret' : process.env.MOTTRAM_CONFIG_CLOUDINARY_SECRET } }); require('./models'); keystone.set('routes', require('./routes')); keystone.start();
Change mongo connection to read from process.env OR use localhost
Change mongo connection to read from process.env OR use localhost
JavaScript
mit
jamlen/mottramec,jamlen/mottramec
--- +++ @@ -11,7 +11,7 @@ 'view engine': 'jade', 'auto update': true, - 'mongo': 'mongodb://localhost/mottramec', + 'mongo': 'mongodb://'+ (process.env.MOTTRAM_CONFIG_MONGO_CON || 'localhost')+'/mottramec', 'session': true, 'auth': true,
4383afc7734b785e381bc6c372db28ece4a2fdc1
src/navigation-bar/navigation-bar-view.js
src/navigation-bar/navigation-bar-view.js
/** @jsx React.DOM */ var React = require('react'); var View = React.createClass({ render: function() { return ( <header className="navigation-bar"> <button className="logo"></button> <button className="icon new" title="Start new TDD session" onClick={this.props.onNew}>New</button> <button className="icon save" title="Save and Run tests (⌘S)" onClick={this.props.onSave}>Save and Run ({this.props.metaKeySymbol}S)</button> <div className="account"> {this.props.username} <button className="button">Signout</button> </div> </header> ); } }); module.exports = View;
/** @jsx React.DOM */ var React = require('react'); var View = React.createClass({ render: function() { return ( <header className="navigation-bar"> <button className="logo"></button> <button className="icon save" title="Save and Run tests (⌘S)" onClick={this.props.onSave}>Save and Run ({this.props.metaKeySymbol}S)</button> </header> ); } }); module.exports = View;
Remove UI controls that are not needed now.
Remove UI controls that are not needed now.
JavaScript
mit
tddbin/tddbin-frontend,tddbin/tddbin-frontend,tddbin/tddbin-frontend
--- +++ @@ -8,12 +8,7 @@ return ( <header className="navigation-bar"> <button className="logo"></button> - <button className="icon new" title="Start new TDD session" onClick={this.props.onNew}>New</button> <button className="icon save" title="Save and Run tests (⌘S)" onClick={this.props.onSave}>Save and Run ({this.props.metaKeySymbol}S)</button> - <div className="account"> - {this.props.username} - <button className="button">Signout</button> - </div> </header> ); }
d40c221293b87ab1da056f5eab6f07cc6db3b137
tasks/coverage.js
tasks/coverage.js
/* * grunt-istanbul-coverage * https://github.com/daniellmb/grunt-istanbul-coverage * * Copyright (c) 2013 Daniel Lamb * Licensed under the MIT license. */ 'use strict'; module.exports = function (grunt) { var helper = require('./helpers').init(grunt); grunt.registerTask('coverage', 'check coverage thresholds', function () { //set default options var options = this.options({ thresholds: { 'statements': 90, 'branches': 90, 'lines': 90, 'functions': 90 }, dir: null, root: '' }); //check code coverage helper.checkCoverage(options, this.async()); }); };
/* * grunt-istanbul-coverage * https://github.com/daniellmb/grunt-istanbul-coverage * * Copyright (c) 2013 Daniel Lamb * Licensed under the MIT license. */ 'use strict'; module.exports = function (grunt) { var helper = require('./helpers').init(grunt); grunt.registerMultiTask('coverage', 'check coverage thresholds', function () { //set default options var options = this.options({ thresholds: { 'statements': 90, 'branches': 90, 'lines': 90, 'functions': 90 }, dir: null, root: '' }); //check code coverage helper.checkCoverage(options, this.async()); }); };
Switch task to be a multitask so you can have multipe options for what you need
Switch task to be a multitask so you can have multipe options for what you need
JavaScript
mit
daniellmb/grunt-istanbul-coverage
--- +++ @@ -12,7 +12,7 @@ var helper = require('./helpers').init(grunt); - grunt.registerTask('coverage', 'check coverage thresholds', function () { + grunt.registerMultiTask('coverage', 'check coverage thresholds', function () { //set default options var options = this.options({ thresholds: {
33793017933028ea196e9df30a055380dec5ca33
test/setupTest.js
test/setupTest.js
/* eslint-env mocha */ // TODO : Do not reference the server from here or any related files import { dropTestDb } from './utils' import { SERVER_PORTS } from './constants' import nconf from 'nconf' // TODO : Remove the need for this nconf.set('router', { httpPort: SERVER_PORTS.httpPort }) before(async () => { await dropTestDb() })
/* eslint-env mocha */ require('../src/config/config') import { SERVER_PORTS } from './constants' import nconf from 'nconf' // Set the router http port to the mocked constant value for the tests nconf.set('router', { httpPort: SERVER_PORTS.httpPort })
Remove the clearing of the database from the script
Remove the clearing of the database from the script This was causing race conditions with some of the files which were already connected to a mongo connection and then not having a reference to an existing collection. This was picked up in the LogsAPITests were the tests were failing intermittently. Replaced the inclusion of the entire utils script with just the required config script to override the router httpPort OHM-732
JavaScript
mpl-2.0
jembi/openhim-core-js,jembi/openhim-core-js
--- +++ @@ -1,12 +1,8 @@ /* eslint-env mocha */ -// TODO : Do not reference the server from here or any related files -import { dropTestDb } from './utils' +require('../src/config/config') + import { SERVER_PORTS } from './constants' import nconf from 'nconf' -// TODO : Remove the need for this +// Set the router http port to the mocked constant value for the tests nconf.set('router', { httpPort: SERVER_PORTS.httpPort }) - -before(async () => { - await dropTestDb() -})
147e61e4f7557bcc3154fdfee50b128366229fb0
api-server/development-entry.js
api-server/development-entry.js
const nodemon = require('nodemon'); nodemon({ ext: 'js json', // --silent squashes an ELIFECYCLE error when the server exits exec: 'DEBUG=fcc* npm run --silent babel-dev-server', watch: './server', spawn: true }); nodemon.on('restart', function nodemonRestart(files) { console.log('App restarted due to: ', files); });
const path = require('path'); const nodemon = require('nodemon'); nodemon({ ext: 'js json', // --silent squashes an ELIFECYCLE error when the server exits exec: 'DEBUG=fcc* npm run --silent babel-dev-server', watch: path.resolve(__dirname, './server'), spawn: true }); nodemon.on('restart', function nodemonRestart(files) { console.log('App restarted due to: ', files); });
Resolve the correct watch path for nodemon
fix(nodemon): Resolve the correct watch path for nodemon
JavaScript
bsd-3-clause
FreeCodeCamp/FreeCodeCamp,BhaveshSGupta/FreeCodeCamp,jonathanihm/freeCodeCamp,pahosler/freecodecamp,HKuz/FreeCodeCamp,BhaveshSGupta/FreeCodeCamp,otavioarc/freeCodeCamp,BhaveshSGupta/FreeCodeCamp,raisedadead/FreeCodeCamp,raisedadead/FreeCodeCamp,FreeCodeCamp/FreeCodeCamp,otavioarc/freeCodeCamp,HKuz/FreeCodeCamp,pahosler/freecodecamp,jonathanihm/freeCodeCamp
--- +++ @@ -1,10 +1,11 @@ +const path = require('path'); const nodemon = require('nodemon'); nodemon({ ext: 'js json', // --silent squashes an ELIFECYCLE error when the server exits exec: 'DEBUG=fcc* npm run --silent babel-dev-server', - watch: './server', + watch: path.resolve(__dirname, './server'), spawn: true });
2921f6035d43a143f575144c540e9b9ca328370e
app/renderer/views/SearchBar.js
app/renderer/views/SearchBar.js
import React, { Component } from 'react' import styled from 'styled-components' import TextInput from './TextInput' import { Search } from '../icons' export default class SearchBar extends Component { constructor (props) { super(props) this.onChange = this.onChange.bind(this) } onChange (e) { e.preventDefault() if (this.props.handleQueryChange) { this.props.handleQueryChange(e.target.value) } } render () { return ( <Bar> <SearchIcon large /> <TextInput placeholder='Title, genre, actor' value={this.props.searchQuery} onChange={this.onChange} /> </Bar> ) } } const Bar = styled.div` display: flex; color: white; opacity: 0.7; margin-right: 10px; ` const SearchIcon = styled(Search)` margin-top: 7px; margin-right: 8px; `
import React, { Component } from 'react' import styled from 'styled-components' import TextInput from './TextInput' import { Search, Close } from '../icons' export default class SearchBar extends Component { constructor (props) { super(props) this.update = this.update.bind(this) this.clear = this.clear.bind(this) this.send = this.send.bind(this) } update (e) { e.preventDefault() this.send(e.target.value) } clear (e) { e.preventDefault() this.send('') } send (text) { if (this.props.handleQueryChange) { this.props.handleQueryChange(text) } } render () { return ( <Bar> <SearchIcon large /> <TextInput placeholder='Title, genre, actor' value={this.props.searchQuery} onChange={this.update} /> {this.renderClose()} </Bar> ) } renderClose () { return (this.props.searchQuery) ? <span><CloseButton onClick={this.clear} /></span> : null } } const Bar = styled.div` display: flex; color: white; opacity: 0.7; margin-right: 10px; ` const SearchIcon = styled(Search)` margin-top: 7px; margin-right: 8px; ` const CloseButton = styled(Close)` color: rgba(0,0,0,0.5); cursor: pointer; margin-left: -25px padding-top: 6px; `
Add close button to search bar
Add close button to search bar
JavaScript
apache-2.0
blenoski/movie-night,blenoski/movie-night
--- +++ @@ -1,18 +1,29 @@ import React, { Component } from 'react' import styled from 'styled-components' import TextInput from './TextInput' -import { Search } from '../icons' +import { Search, Close } from '../icons' export default class SearchBar extends Component { constructor (props) { super(props) - this.onChange = this.onChange.bind(this) + this.update = this.update.bind(this) + this.clear = this.clear.bind(this) + this.send = this.send.bind(this) } - onChange (e) { + update (e) { e.preventDefault() + this.send(e.target.value) + } + + clear (e) { + e.preventDefault() + this.send('') + } + + send (text) { if (this.props.handleQueryChange) { - this.props.handleQueryChange(e.target.value) + this.props.handleQueryChange(text) } } @@ -23,10 +34,17 @@ <TextInput placeholder='Title, genre, actor' value={this.props.searchQuery} - onChange={this.onChange} + onChange={this.update} /> + {this.renderClose()} </Bar> ) + } + + renderClose () { + return (this.props.searchQuery) + ? <span><CloseButton onClick={this.clear} /></span> + : null } } @@ -41,3 +59,10 @@ margin-top: 7px; margin-right: 8px; ` + +const CloseButton = styled(Close)` + color: rgba(0,0,0,0.5); + cursor: pointer; + margin-left: -25px + padding-top: 6px; +`
b2ba9755f4ce484bcd02b1abf912cede7fa254fe
app/server/controllers/index.js
app/server/controllers/index.js
var models = require('../models'), _validate = require('../../helpers/express-validators'), _h = require('../../helpers/helpers'), jwt = require('jsonwebtoken'), co = require('co'), userHelper = require('./controller-helpers').userHelper, docHelper = require('./controller-helpers').docHelper, roleHelper = require('./controller-helpers').roleHelper; module.exports = { authController: require('./auth-controller')(models, _validate, _h, jwt, co), userController: require('./user-controller')(_validate, _h, userHelper), docController: require('./document-controller')(_validate, _h, docHelper), roleController: require('./role-controller')(_validate, _h, roleHelper) };
var models = require('../models'), _validate = require('../../helpers/express-validators'), _h = require('../../helpers/helpers'), jwt = require('jsonwebtoken'), co = require('co'), cloudinary = require('cloudinary'), userHelper = require('./controller-helpers').userHelper, docHelper = require('./controller-helpers').docHelper, roleHelper = require('./controller-helpers').roleHelper; module.exports = { authController: require('./auth-controller')(models, _validate, _h, jwt, co), userController: require('./user-controller')(_validate, _h, userHelper), docController: require('./document-controller')(_validate, _h, docHelper), roleController: require('./role-controller')(_validate, _h, roleHelper), uploadController: require('./img-upload-controller') (_validate, cloudinary, models, co) };
Add image upload and delete routes to parent route
Add image upload and delete routes to parent route
JavaScript
mit
andela-blawrence/DMS-REST-API,andela-blawrence/DMS-REST-API
--- +++ @@ -3,6 +3,7 @@ _h = require('../../helpers/helpers'), jwt = require('jsonwebtoken'), co = require('co'), + cloudinary = require('cloudinary'), userHelper = require('./controller-helpers').userHelper, docHelper = require('./controller-helpers').docHelper, roleHelper = require('./controller-helpers').roleHelper; @@ -11,5 +12,7 @@ authController: require('./auth-controller')(models, _validate, _h, jwt, co), userController: require('./user-controller')(_validate, _h, userHelper), docController: require('./document-controller')(_validate, _h, docHelper), - roleController: require('./role-controller')(_validate, _h, roleHelper) + roleController: require('./role-controller')(_validate, _h, roleHelper), + uploadController: require('./img-upload-controller') + (_validate, cloudinary, models, co) };
ec3f99bf3e4af37752e3207f746311db3034ea6c
webpack.config.js
webpack.config.js
var path = require('path'); var Paths = { APP: path.resolve(__dirname, 'src/js'), BUILD_OUTPUT: path.resolve(__dirname, 'out/webpack') }; module.exports = { entry: { app: Paths.APP }, resolve: { extensions: [ '', '.js', '.jsx' ], root: [ Paths.APP ] }, output: { path: Paths.BUILD_OUTPUT, filename: 'killrvideo.js' }, module: { loaders: [ // Babel transpiler (see .babelrc file for presets) { test: /\.jsx?$/, include: Paths.APP, loader: 'babel' } ] } };
var path = require('path'); var webpack = require('webpack'); var Paths = { APP: path.resolve(__dirname, 'src/js'), BUILD_OUTPUT: path.resolve(__dirname, 'out/webpack') }; module.exports = { entry: { app: Paths.APP, vendor: [ 'bluebird', 'classnames', 'falcor', 'falcor-http-datasource', 'jsuri', 'load-script', 'lodash', 'md5', 'moment', 'react', 'react-bootstrap', 'react-dom', 'react-dropzone', 'react-gemini-scrollbar', 'react-redux', 'react-router', 'react-router-redux', 'redux', 'redux-actions', 'redux-form', 'redux-logger', 'redux-promise-middleware', 'redux-thunk', 'reselect', 'socket.io-client', 'validate.js', 'xhr' ] }, resolve: { extensions: [ '', '.js', '.jsx' ], root: [ Paths.APP ] }, output: { path: Paths.BUILD_OUTPUT, filename: 'killrvideo.js' }, plugins: [ new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }) ], module: { loaders: [ // Babel transpiler (see .babelrc file for presets) { test: /\.jsx?$/, include: Paths.APP, loader: 'babel' } ] } };
Create a second webpack chunk for vendor dependencies
Create a second webpack chunk for vendor dependencies
JavaScript
apache-2.0
KillrVideo/killrvideo-web,KillrVideo/killrvideo-web,KillrVideo/killrvideo-web
--- +++ @@ -1,4 +1,5 @@ var path = require('path'); +var webpack = require('webpack'); var Paths = { APP: path.resolve(__dirname, 'src/js'), @@ -7,7 +8,14 @@ module.exports = { entry: { - app: Paths.APP + app: Paths.APP, + vendor: [ + 'bluebird', 'classnames', 'falcor', 'falcor-http-datasource', 'jsuri', 'load-script', 'lodash', + 'md5', 'moment', 'react', 'react-bootstrap', 'react-dom', 'react-dropzone', 'react-gemini-scrollbar', + 'react-redux', 'react-router', 'react-router-redux', 'redux', 'redux-actions', 'redux-form', + 'redux-logger', 'redux-promise-middleware', 'redux-thunk', 'reselect', 'socket.io-client', 'validate.js', + 'xhr' + ] }, resolve: { extensions: [ '', '.js', '.jsx' ], @@ -19,6 +27,12 @@ path: Paths.BUILD_OUTPUT, filename: 'killrvideo.js' }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + filename: 'vendor.js' + }) + ], module: { loaders: [ // Babel transpiler (see .babelrc file for presets)
8934f90f07961a59b1a1b75dad018e217c34ee3d
webpack.config.js
webpack.config.js
var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var BundleTracker = require('webpack-bundle-tracker'); var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin"); module.exports = { context: __dirname, devtool: 'eval-source-map', entry: { // Used to extract common libraries vendor: ['react', 'react-dom'], frontpageEvents: [ './assets/js/frontpage/events/index' ] }, output: { path: path.resolve('./assets/webpack_bundles/'), filename: '[name]-[hash].js' }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, { test: /\.less$/, loader: ExtractTextPlugin.extract('style', 'css!less'), } ] }, lessLoader: { includePath: [path.resolve(__dirname, './styles')] }, plugins: [ new CommonsChunkPlugin({ names: ['vendor'], minChunks: Infinity }), new BundleTracker({filename: './webpack-stats.json'}) ] };
var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var BundleTracker = require('webpack-bundle-tracker'); var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin"); module.exports = { context: __dirname, devtool: 'eval-source-map', entry: { // Used to extract common libraries vendor: [ 'classnames', 'es6-promise', 'isomorphic-fetch', 'moment', 'react', 'react-bootstrap', 'react-dom' ], frontpageEvents: [ './assets/js/frontpage/events/index' ] }, output: { path: path.resolve('./assets/webpack_bundles/'), filename: '[name]-[hash].js' }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, { test: /\.less$/, loader: ExtractTextPlugin.extract('style', 'css!less'), } ] }, lessLoader: { includePath: [path.resolve(__dirname, './styles')] }, plugins: [ new CommonsChunkPlugin({ names: ['vendor'], minChunks: Infinity }), new BundleTracker({filename: './webpack-stats.json'}) ] };
Add more modules to vendor entry
Add more modules to vendor entry
JavaScript
mit
dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4
--- +++ @@ -9,7 +9,10 @@ devtool: 'eval-source-map', entry: { // Used to extract common libraries - vendor: ['react', 'react-dom'], + vendor: [ + 'classnames', 'es6-promise', 'isomorphic-fetch', + 'moment', 'react', 'react-bootstrap', 'react-dom' + ], frontpageEvents: [ './assets/js/frontpage/events/index' ]
1a616f91fcf697b1d073cfb2281e378927fb8f3d
webpack.config.js
webpack.config.js
var getConfig = require('hjs-webpack') var webpack = require('webpack') var path = require('path'); module.exports = getConfig({ in: 'src/app.js', out: 'public', clearBeforeBuild: true }); module.exports.node = { child_process: 'empty' } module.exports.devServer.host = '0.0.0.0' module.exports.resolve.root = path.resolve('./src')
var getConfig = require('hjs-webpack') var webpack = require('webpack') var path = require('path'); module.exports = getConfig({ in: 'src/app.js', out: 'public', clearBeforeBuild: true, }); module.exports.node = { child_process: 'empty' } if(process.env.NODE_ENV === 'development'){ module.exports.devServer.host = '0.0.0.0' } //uncomment to suppress log output //module.exports.devServer.noInfo = true; //module.exports.devServer.quiet=true; module.exports.resolve.root = path.resolve('./src')
Check NODE_ENV before setting devserver host
Check NODE_ENV before setting devserver host Optional quiet mode. Remove comments to enable quiet mode.
JavaScript
mit
getguesstimate/guesstimate-app
--- +++ @@ -5,12 +5,18 @@ module.exports = getConfig({ in: 'src/app.js', out: 'public', - clearBeforeBuild: true + clearBeforeBuild: true, }); module.exports.node = { child_process: 'empty' } -module.exports.devServer.host = '0.0.0.0' +if(process.env.NODE_ENV === 'development'){ + module.exports.devServer.host = '0.0.0.0' +} + +//uncomment to suppress log output +//module.exports.devServer.noInfo = true; +//module.exports.devServer.quiet=true; module.exports.resolve.root = path.resolve('./src')
34877f95ac93068b5dcc1d0746fbc505fe378b42
Bookmarklet.js
Bookmarklet.js
/* * Bookmarklet.js */ import { getGlobalName, getTitle, getVersion } from './utils/constants'; import { addNodes, removeNodes } from './utils/dom'; import { MessageDialog } from './utils/dialog'; export { Bookmarklet }; /* eslint no-console: 0 */ function logVersionInfo (appName) { console.log(getTitle() + ' v' + getVersion() + ' ' + appName); } function Bookmarklet (params) { let globalName = getGlobalName(params.appName); // use singleton pattern if (typeof window[globalName] === 'object') return window[globalName]; this.appName = params.appName; this.cssClass = params.cssClass; this.msgText = params.msgText; this.params = params; this.show = false; let dialog = new MessageDialog(); window.addEventListener('resize', event => { removeNodes(this.cssClass); dialog.resize(); this.show = false; }); window[globalName] = this; logVersionInfo(this.appName); } Bookmarklet.prototype.run = function () { let dialog = new MessageDialog(); dialog.hide(); this.show = !this.show; if (this.show) { if (addNodes(this.params) === 0) { dialog.show(this.appName, this.msgText); this.show = false; } } else { removeNodes(this.cssClass); } };
/* * Bookmarklet.js */ import { getGlobalName, getTitle, getVersion } from './utils/constants'; import { addNodes, removeNodes } from './utils/dom'; import { MessageDialog } from './utils/dialog'; export { Bookmarklet }; /* eslint no-console: 0 */ function logVersionInfo (appName) { console.log(getTitle() + ' : v' + getVersion() + ' : ' + appName); } function Bookmarklet (params) { let globalName = getGlobalName(params.appName); // use singleton pattern if (typeof window[globalName] === 'object') return window[globalName]; this.appName = params.appName; this.cssClass = params.cssClass; this.msgText = params.msgText; this.params = params; this.show = false; let dialog = new MessageDialog(); window.addEventListener('resize', event => { removeNodes(this.cssClass); dialog.resize(); this.show = false; }); window[globalName] = this; logVersionInfo(this.appName); } Bookmarklet.prototype.run = function () { let dialog = new MessageDialog(); dialog.hide(); this.show = !this.show; if (this.show) { if (addNodes(this.params) === 0) { dialog.show(this.appName, this.msgText); this.show = false; } } else { removeNodes(this.cssClass); } };
Format version info with separators
Format version info with separators
JavaScript
apache-2.0
oaa-tools/bookmarklets-library,oaa-tools/bookmarklets-library
--- +++ @@ -9,7 +9,7 @@ /* eslint no-console: 0 */ function logVersionInfo (appName) { - console.log(getTitle() + ' v' + getVersion() + ' ' + appName); + console.log(getTitle() + ' : v' + getVersion() + ' : ' + appName); } function Bookmarklet (params) {
3a0bdaf3812b78ceb53e1040afcde6abf40498cb
webpack.config.js
webpack.config.js
module.exports = { entry: './docs/App.jsx', output: { filename: './docs/bundle.js' }, devServer: { inline: true }, module: { rules: [{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader' }] }, devtool: 'source-map' }
const path = require('path') module.exports = { entry: './docs/App.jsx', output: { filename: './docs/bundle.js' }, devServer: { inline: true, contentBase: path.join(__dirname, 'docs'), }, module: { rules: [{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader' }] }, devtool: 'source-map' }
Change contentBase to docs folder in webpack build.
Change contentBase to docs folder in webpack build.
JavaScript
mit
mosch/react-avatar-editor,mosch/react-avatar-editor,mosch/react-avatar-editor
--- +++ @@ -1,10 +1,13 @@ +const path = require('path') + module.exports = { entry: './docs/App.jsx', output: { filename: './docs/bundle.js' }, devServer: { - inline: true + inline: true, + contentBase: path.join(__dirname, 'docs'), }, module: { rules: [{
e937804e7ed3952d044cff127e3460e2be660c12
demo/case1/router2-content.js
demo/case1/router2-content.js
;(_ => { 'use strict'; class Router2Content extends HTMLElement { createdCallback() { this.hidden = true; // by default } } window.addEventListener('hashchange', (e) => { var containers = document.querySelectorAll('router2-content'); for (var i = 0; i < containers.length; i++) { containers[i].hidden = true; } var hash = window.location.hash.slice(1); var matched = document.querySelector(`router2-content[hash="${hash}"]`); if (matched) { matched.hidden = false; } }); document.registerElement('router2-content', Router2Content); })();
;(_ => { 'use strict'; function matchHash() { var containers = document.querySelectorAll('router2-content'); for (var i = 0; i < containers.length; i++) { containers[i].hidden = true; } var hash = window.location.hash.slice(1); // nothing to unhide... if (!hash) { return; } var matched = document.querySelector(`router2-content[hash="${hash}"]`); if (matched) { matched.hidden = false; } else { throw new Error(`hash "${hash}" does not match any content`); } } class Router2Content extends HTMLElement { createdCallback() { this.hidden = true; // by default } } window.addEventListener('hashchange', (e) => { matchHash(); }); window.addEventListener('load', (e) => { matchHash(); }); document.registerElement('router2-content', Router2Content); })();
Add more complexity to the simple example
Add more complexity to the simple example
JavaScript
isc
m3co/router3,m3co/router3
--- +++ @@ -1,5 +1,25 @@ ;(_ => { 'use strict'; + + function matchHash() { + var containers = document.querySelectorAll('router2-content'); + for (var i = 0; i < containers.length; i++) { + containers[i].hidden = true; + } + + var hash = window.location.hash.slice(1); + // nothing to unhide... + if (!hash) { + return; + } + + var matched = document.querySelector(`router2-content[hash="${hash}"]`); + if (matched) { + matched.hidden = false; + } else { + throw new Error(`hash "${hash}" does not match any content`); + } + } class Router2Content extends HTMLElement { createdCallback() { @@ -8,16 +28,11 @@ } window.addEventListener('hashchange', (e) => { - var containers = document.querySelectorAll('router2-content'); - for (var i = 0; i < containers.length; i++) { - containers[i].hidden = true; - } + matchHash(); + }); + window.addEventListener('load', (e) => { + matchHash(); + }); - var hash = window.location.hash.slice(1); - var matched = document.querySelector(`router2-content[hash="${hash}"]`); - if (matched) { - matched.hidden = false; - } - }); document.registerElement('router2-content', Router2Content); })();
0d713d31c56891ebd5ce563a079cf623c4650da6
static/js/eq-item-detail.js
static/js/eq-item-detail.js
'use strict' var eq = { item: { detail: function () { var elem = document.getElementById('item-detail-search') var value = elem.getElementsByTagName('input')[0].value window.location.href = [ '/action/eq/item-detail/', value.replace(/ /g, '+') ].join('') return false }, reset: function () { var elem = document.getElementById('item-detail-search') elem.getElementsByTagName('input')[0].value = '' } } } $('#item-search-detail').click(function () { var form = document.getElementById('item-detail-search') var elem = form.getElementsByTagName('input')[0] elem.value = $(this).val() window.location.href = [ '/action/eq/item-detail/', elem.value.replace(/ /g, '+') ].join('') }) eq.item.reset()
/* global $, alert, localStorage */ /* eslint-env jquery, browser */ 'use strict' var eq = { item: { detail: function () { var elem = document.getElementById('item-detail-search') var value = elem.getElementsByTagName('input')[0].value window.location.href = [ '/action/eq/item-detail/', value.replace(/ /g, '+') ].join('') return false }, reset: function () { var elem = document.getElementById('item-detail-search') elem.getElementsByTagName('input')[0].value = '' } } } $('#item-search-detail').click(function () { var form = document.getElementById('item-detail-search') var elem = form.getElementsByTagName('input')[0] elem.value = $(this).val() window.location.href = [ '/action/eq/item-detail/', elem.value.replace(/ /g, '+') ].join('') }) eq.item.reset()
Update for other js file the linting
Update for other js file the linting
JavaScript
agpl-3.0
ahungry/com.ahungry,ahungry/com.ahungry,ahungry/com.ahungry,ahungry/com.ahungry
--- +++ @@ -1,3 +1,6 @@ +/* global $, alert, localStorage */ +/* eslint-env jquery, browser */ + 'use strict' var eq = {
c9d6413c5480f4fb059904ed3f84821ad1513570
android_ignore_translation_errors.js
android_ignore_translation_errors.js
#!/usr/bin/env node // add additional build-extras.gradle file to instruct android's lint to ignore translation errors // v0.1.c // causing error in the build --release // Issue: https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/80 // // Warning: This solution does not solve the problem only makes it possible to build --release var fs = require('fs'); var rootdir = process.argv[2]; if(rootdir){ var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []); for(var x = 0; x < platforms.length; x++){ var platform = platforms[x].trim().toLowerCase(); try{ if(platform == 'android'){ var lintOptions = 'android { \nlintOptions {\ndisable \'MissingTranslation\' \ndisable \'ExtraTranslation\' \n} \n}'; fs.writeFileSync('platforms/android/build-extras.gradle', lintOptions, 'UTF-8'); process.stdout.write('Added build-extras.gradle '); } }catch(e){ process.stdout.write(e); } } }
#!/usr/bin/env node // add additional build-extras.gradle file to instruct android's lint to ignore translation errors // v0.1.c // causing error in the build --release // Issue: https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/80 // // Warning: This solution does not solve the problem only makes it possible to build --release var fs = require('fs'); var rootdir = process.argv[2]; if(rootdir){ var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []); for(var x = 0; x < platforms.length; x++){ var platform = platforms[x].trim().toLowerCase(); try{ if(platform == 'android'){ var lintOptions = 'android { \nlintOptions {\ndisable \'MissingTranslation\' \ndisable \'ExtraTranslation\' \n} \n}'; fs.appendFileSync('platforms/android/build-extras.gradle', lintOptions, 'UTF-8'); process.stdout.write('Added build-extras.gradle '); } }catch(e){ process.stdout.write(e); } } }
Use append mode in case other hooks want to write to build-extras.gradle
Use append mode in case other hooks want to write to build-extras.gradle
JavaScript
mit
driftyco/ionic-package-hooks,driftyco/ionic-package-hooks
--- +++ @@ -20,7 +20,7 @@ try{ if(platform == 'android'){ var lintOptions = 'android { \nlintOptions {\ndisable \'MissingTranslation\' \ndisable \'ExtraTranslation\' \n} \n}'; - fs.writeFileSync('platforms/android/build-extras.gradle', lintOptions, 'UTF-8'); + fs.appendFileSync('platforms/android/build-extras.gradle', lintOptions, 'UTF-8'); process.stdout.write('Added build-extras.gradle '); } }catch(e){
d81ef09da6115f93e7f271b12aba9062a8d14028
api/controllers/StorageController.js
api/controllers/StorageController.js
/** * UploadController * * @description :: Server-side logic for managing uploads * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers */ /* globals JsonApiService */ module.exports = { upload: function(req, res) { let user = req.user; StorageService.findOrCreate(user, (err, storage) => { let filename = req.query["filename"]; req.file(filename).upload(function (err, uploadedFiles) { if (err) { return res.negotiate(err); } // If no files were uploaded, respond with an error. if (uploadedFiles.length === 0){ return res.badRequest('No file was uploaded'); } PlazaService.upload( storage, uploadedFiles[0], (err, data) => { res.send("Upload successful"); }); }); }); }, files: function(req, res) { PlazaService.files("localhost", "", "/home/qleblqnc/", (files) => { res.send(files); }) } };
/** * UploadController * * @description :: Server-side logic for managing uploads * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers */ /* globals JsonApiService */ module.exports = { upload: function(req, res) { let user = req.user; StorageService.findOrCreate(user, (err, storage) => { let filename = req.query["filename"]; req.file(filename).upload(function (err, uploadedFiles) { if (err) { return res.negotiate(err); } // If no files were uploaded, respond with an error. if (uploadedFiles.length === 0){ return res.badRequest('No file was uploaded'); } PlazaService.upload( storage, uploadedFiles[0], (err, data) => { res.send("Upload successful"); }); }); }); }, files: function(req, res) { let filename = req.query["filename"]; let user = req.user; StorageService.findOrCreate(user, (err, storage) => { PlazaService.files(storage.hostname, "", "/home/" + storage.username, (files) => { res.send(files); }) }) } };
Fix GET /files endpoint to list files in user storage.
Fix GET /files endpoint to list files in user storage.
JavaScript
agpl-3.0
Nanocloud/nanocloud,corentindrouet/nanocloud,Leblantoine/nanocloud,corentindrouet/nanocloud,romain-ortega/nanocloud,Nanocloud/nanocloud,Nanocloud/nanocloud,Gentux/nanocloud,romain-ortega/nanocloud,corentindrouet/nanocloud,Leblantoine/nanocloud,Gentux/nanocloud,romain-ortega/nanocloud,dynamiccast/nanocloud,Gentux/nanocloud,Leblantoine/nanocloud,dynamiccast/nanocloud,romain-ortega/nanocloud,Nanocloud/nanocloud,dynamiccast/nanocloud,romain-ortega/nanocloud,Nanocloud/nanocloud,Leblantoine/nanocloud,romain-ortega/nanocloud,Gentux/nanocloud,Gentux/nanocloud,Gentux/nanocloud,romain-ortega/nanocloud,Nanocloud/nanocloud,dynamiccast/nanocloud,dynamiccast/nanocloud,corentindrouet/nanocloud,Leblantoine/nanocloud,Nanocloud/nanocloud,Gentux/nanocloud,romain-ortega/nanocloud,corentindrouet/nanocloud,Nanocloud/nanocloud,dynamiccast/nanocloud,corentindrouet/nanocloud,corentindrouet/nanocloud,Leblantoine/nanocloud,corentindrouet/nanocloud,Leblantoine/nanocloud,Gentux/nanocloud,Leblantoine/nanocloud
--- +++ @@ -36,8 +36,13 @@ }, files: function(req, res) { - PlazaService.files("localhost", "", "/home/qleblqnc/", (files) => { - res.send(files); + let filename = req.query["filename"]; + let user = req.user; + + StorageService.findOrCreate(user, (err, storage) => { + PlazaService.files(storage.hostname, "", "/home/" + storage.username, (files) => { + res.send(files); + }) }) } };
ad3892d7cd65d973c4277e17c0e0f6bbf60c9153
jshint/jshint.config.js
jshint/jshint.config.js
module.exports = { options : { latedef : true, noempty : true, undef : true, strict : false, node : true, browser : true, eqnull : true, scripturl : true, predef : [ "$", "jQuery", "Classify", "Avalon", "Page", "Highcharts", "Recaptcha", "alert", "confirm", "SWFUpload" ] }, format : "JS Lint {{type}}: [{{file}}:{{line}}] {{message}}", skippedFiles : [ ".build/csslint/csslint-node.js", ".build/jshint/jshint.js", "public/static/javascript/lib/classify.min.js", "public/static/javascript/lib/utils.min.js" ], skippedDirectories : [ ".build/uglify", "public/static/javascript/vendor", "tmp" ] };
module.exports = { options : { latedef : true, noempty : true, undef : true, strict : false, node : true, browser : true, eqnull : true, scripturl : true, predef : [ "$", "jQuery", "Classify", "Avalon", "Page", "Highcharts", "Recaptcha", "alert", "confirm", "SWFUpload", "Handlebars" ] }, format : "JS Lint {{type}}: [{{file}}:{{line}}] {{message}}", skippedFiles : [ ".build/csslint/csslint-node.js", ".build/jshint/jshint.js", "public/static/javascript/lib/classify.min.js", "public/static/javascript/lib/utils.min.js" ], skippedDirectories : [ ".build/uglify", "public/static/javascript/vendor", "tmp" ] };
Switch internal templater to handlebars
Switch internal templater to handlebars
JavaScript
mit
weikinhuang/closedinterval-git-hooks,weikinhuang/closedinterval-git-hooks
--- +++ @@ -18,7 +18,8 @@ "Recaptcha", "alert", "confirm", - "SWFUpload" + "SWFUpload", + "Handlebars" ] }, format : "JS Lint {{type}}: [{{file}}:{{line}}] {{message}}",
1bc1a5cc39570cff0713f748505d3973fb9ec534
lib/package/plugins/serviceCalloutResponseName.js
lib/package/plugins/serviceCalloutResponseName.js
/* Copyright 2019 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ var plugin = { ruleId: "PO020", name: "Check ServiceCallout for Response variable name", message: "Using response for the Response name causes unexepcted side effects.", fatal: false, severity: 2, //error nodeType: "Policy", enabled: true }, debug = require("debug")("bundlelinter:" + plugin.name), myUtil = require("../myUtil.js"); var onPolicy = function(policy,cb) { var hadWarning = false; if ( policy.getType() === "ServiceCallout" && myUtil.selectTagValue(policy, "/ServiceCallout/Response") === "response" ) { hadWarning = true; policy.addMessage({ plugin, message: 'Policy has a Response variable named "response", this may lead to unexpected side effects. Rename the Resopnse variable.' }); } if (typeof(cb) == 'function') { cb(null, hadWarning); } }; module.exports = { plugin, onPolicy };
/* Copyright 2019 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ var plugin = { ruleId: "PO020", name: "Check ServiceCallout for Response variable name", message: "Using response for the Response name causes unexepcted side effects.", fatal: false, severity: 2, //error nodeType: "Policy", enabled: true }, debug = require("debug")("bundlelinter:" + plugin.name), myUtil = require("../myUtil.js"); var onPolicy = function(policy,cb) { var hadWarning = false; if ( policy.getType() === "ServiceCallout" && myUtil.selectTagValue(policy, "/ServiceCallout/Response") === "response" ) { hadWarning = true; policy.addMessage({ plugin, message: 'Policy has a Response variable named "response", this may lead to unexpected side effects. Rename the Response variable.' }); } if (typeof(cb) == 'function') { cb(null, hadWarning); } }; module.exports = { plugin, onPolicy };
Fix typo: 'Resopnse' should be 'Response'
Fix typo: 'Resopnse' should be 'Response'
JavaScript
apache-2.0
apigee/apigeelint,apigeecs/bundle-linter
--- +++ @@ -37,7 +37,7 @@ policy.addMessage({ plugin, message: - 'Policy has a Response variable named "response", this may lead to unexpected side effects. Rename the Resopnse variable.' + 'Policy has a Response variable named "response", this may lead to unexpected side effects. Rename the Response variable.' }); } if (typeof(cb) == 'function') {
0b4baf7c5fd6b33a6bc9ba0e410852cb99b48a42
test/utils/truncate.spec.js
test/utils/truncate.spec.js
const expect = require('unexpected'); const truncate = require('./truncate'); it('should truncate trace output', () => { expect( truncate( [ 'expected callback was called times 2', ' expected', ' callback(); at Object.it (Users/alex/Documents/projects/jest-unexpected/test/jestUnexpected.spec.js:111:22)', ' to have length 2', ' expected 1 to be 2' ].join('\n') ), 'to equal', [ 'expected callback was called times 2', ' expected', ' callback(); at Object.it (<path>:*:*)', ' to have length 2', ' expected 1 to be 2' ].join('\n') ); }); it('should truncate trace output for node 4', () => { const isTranspiled = true; expect( truncate( [ 'expected callback was called times 2', ' expected', ' callback(); at Users/alex/Documents/projects/jest-unexpected/test/jestUnexpected.spec.js:111:22', ' to have length 2', ' expected 1 to be 2' ].join('\n'), isTranspiled ), 'to equal', [ 'expected callback was called times 2', ' expected', ' callback(); at (<path>:*:*)', ' to have length 2', ' expected 1 to be 2' ].join('\n') ); });
const expect = require('unexpected'); const truncate = require('./truncate'); it('should truncate trace output', () => { expect( truncate( [ 'expected callback was called times 2', ' expected', ' callback(); at Object.it (Users/alex/Documents/projects/jest-unexpected/test/jestUnexpected.spec.js:111:22)', ' to have length 2', ' expected 1 to be 2' ].join('\n') ), 'to equal', [ 'expected callback was called times 2', ' expected', ' callback(); at Object.it (<path>:*:*)', ' to have length 2', ' expected 1 to be 2' ].join('\n') ); });
Remove leftover test after f198d9a.
Remove leftover test after f198d9a.
JavaScript
bsd-3-clause
alexjeffburke/jest-unexpected
--- +++ @@ -22,28 +22,3 @@ ].join('\n') ); }); - -it('should truncate trace output for node 4', () => { - const isTranspiled = true; - - expect( - truncate( - [ - 'expected callback was called times 2', - ' expected', - ' callback(); at Users/alex/Documents/projects/jest-unexpected/test/jestUnexpected.spec.js:111:22', - ' to have length 2', - ' expected 1 to be 2' - ].join('\n'), - isTranspiled - ), - 'to equal', - [ - 'expected callback was called times 2', - ' expected', - ' callback(); at (<path>:*:*)', - ' to have length 2', - ' expected 1 to be 2' - ].join('\n') - ); -});
d776024c9e45c7f95ccf3f6e0e8f16ad9515b458
tests/models/DeviceModel.js
tests/models/DeviceModel.js
/*jshint expr:true */ describe('DeviceModel', function() { describe('instantiation', function() { beforeEach(function() { this.model = new spiderOakApp.DeviceModel({ name: "Test device", url: "Test%20device/", icon: "mac" }); }); it('should have a name', function() { this.model.get("name").should.be.a("string"); this.model.get("name").should.equal("Test device"); }); it('should have a URL', function() { this.model.get("url").should.a("string"); this.model.get("url").should.equal("Test%20device/"); }); it('should have an icon', function() { this.model.get("icon").should.a("string"); this.model.get("icon").should.equal("mac"); }); }); });
/*jshint expr:true */ describe('DeviceModel', function() { describe('instantiation', function() { beforeEach(function() { this.model = new spiderOakApp.DeviceModel({ name: "Test device", url: "Test%20device/", icon: "mac" }); }); it('should have a name', function() { this.model.get("name").should.be.a("string"); this.model.get("name").should.equal("Test device"); }); it('should have a URL', function() { this.model.get("url").should.be.a("string"); this.model.get("url").should.equal("Test%20device/"); }); it('should have an icon', function() { this.model.get("icon").should.be.a("string"); this.model.get("icon").should.equal("mac"); }); }); });
Fix chaining grammar typoo - use '.should.be.a()' instead of (working, but less clear) '.should.a()'
Fix chaining grammar typoo - use '.should.be.a()' instead of (working, but less clear) '.should.a()'
JavaScript
apache-2.0
SpiderOak/SpiderOakMobileClient,SpiderOak/SpiderOakMobileClient,antoniodesouza/SpiderOakMobileClient,antoniodesouza/SpiderOakMobileClient
--- +++ @@ -13,11 +13,11 @@ this.model.get("name").should.equal("Test device"); }); it('should have a URL', function() { - this.model.get("url").should.a("string"); + this.model.get("url").should.be.a("string"); this.model.get("url").should.equal("Test%20device/"); }); it('should have an icon', function() { - this.model.get("icon").should.a("string"); + this.model.get("icon").should.be.a("string"); this.model.get("icon").should.equal("mac"); }); });
c6e569a9089d701761b7d93a0a8d9231e825db63
chai.js
chai.js
module.exports = { rules: { // disallow usage of expressions in statement position 'no-unused-expressions': 0 } }
module.exports = { globals: { expect: true }, rules: { // disallow usage of expressions in statement position 'no-unused-expressions': 0 } }
Mark expect as a global when using Chai
Mark expect as a global when using Chai In some test running configurations (such as when using Karma), `expect` is treated as a global symbol and does not need to be imported. This PR updates `chai.js` to mark `expect` as a global so ESLint doesn’t report it as an undefined value.
JavaScript
mit
CodingZeal/eslint-config-zeal
--- +++ @@ -1,4 +1,7 @@ module.exports = { + globals: { + expect: true + }, rules: { // disallow usage of expressions in statement position 'no-unused-expressions': 0
13ea6366af1ad73ae2c7e4e3e685dab2e8edee76
config/ember-try.js
config/ember-try.js
module.exports = { scenarios: [ { name: 'default', dependencies: { } }, { name: 'ember-release', dependencies: { 'ember': 'components/ember#release' }, resolutions: { 'ember': 'release' } }, { name: 'ember-beta', dependencies: { 'ember': 'components/ember#beta' }, resolutions: { 'ember': 'beta' } }, { name: 'ember-canary', dependencies: { 'ember': 'components/ember#canary' }, resolutions: { 'ember': 'canary' } } ] };
module.exports = { scenarios: [ { name: 'default', dependencies: { } }, { name: 'ember-1.13', dependencies: { 'ember': '1.13.8' }, resolutions: { 'ember': '1.13.8' } }, { name: 'ember-release', dependencies: { 'ember': 'components/ember#release' }, resolutions: { 'ember': 'release' } }, { name: 'ember-beta', dependencies: { 'ember': 'components/ember#beta' }, resolutions: { 'ember': 'beta' } }, { name: 'ember-canary', dependencies: { 'ember': 'components/ember#canary' }, resolutions: { 'ember': 'canary' } } ] };
Add Ember 1.13 to the test matrix
Add Ember 1.13 to the test matrix
JavaScript
mit
cibernox/ember-basic-dropdown,cibernox/ember-basic-dropdown,cibernox/ember-basic-dropdown,cibernox/ember-basic-dropdown
--- +++ @@ -3,6 +3,15 @@ { name: 'default', dependencies: { } + }, + { + name: 'ember-1.13', + dependencies: { + 'ember': '1.13.8' + }, + resolutions: { + 'ember': '1.13.8' + } }, { name: 'ember-release',
4071285dce8afab8daff52cf46799719d5ed0a48
lib/views/bottom-tab.js
lib/views/bottom-tab.js
'use strict'; class BottomTab extends HTMLElement{ initialize(Content, onClick) { this._active = false this._visibility = true this.innerHTML = Content this.classList.add('linter-tab') this.countSpan = document.createElement('span') this.countSpan.classList.add('count') this.countSpan.textContent = '0' this.appendChild(document.createTextNode(' ')) this.appendChild(this.countSpan) this.addEventListener('click', onClick) } get active() { return this._active } set active(value) { this._active = value if (value) { this.classList.add('active') } else { this.classList.remove('active') } } set count(value) { this.countSpan.textContent = value } set visibility(value){ this._visibility = value if(value){ this.removeAttribute('hidden') } else { this.setAttribute('hidden', true) } } get visibility(){ return this._visibility } } module.exports = BottomTab = document.registerElement('linter-bottom-tab', { prototype: BottomTab.prototype })
'use strict'; class BottomTab extends HTMLElement{ constructor(Content){ this.innerHTML = Content } attachedCallback() { this.active = false this.visibility = false this.classList.add('linter-tab') this.countSpan = document.createElement('span') this.countSpan.classList.add('count') this.countSpan.textContent = '0' this.appendChild(document.createTextNode(' ')) this.appendChild(this.countSpan) } get active() { return this._active } set active(value) { this._active = value if (value) { this.classList.add('active') } else { this.classList.remove('active') } } set count(value) { this.countSpan.textContent = value } set visibility(value){ this._visibility = value if(value){ this.removeAttribute('hidden') } else { this.setAttribute('hidden', true) } } get visibility(){ return this._visibility } } module.exports = BottomTab = document.registerElement('linter-bottom-tab', { prototype: BottomTab.prototype })
Move DOM Updates to attachedCallback of BottomTab
:new: Move DOM Updates to attachedCallback of BottomTab
JavaScript
mit
JohnMurga/linter,kaeluka/linter,Arcanemagus/linter,levity/linter,UltCombo/linter,shawninder/linter,iam4x/linter,AtomLinter/Linter,steelbrain/linter,DanPurdy/linter,blakeembrey/linter,e-jigsaw/Linter,mdgriffith/linter,elkeis/linter,atom-community/linter,AsaAyers/linter
--- +++ @@ -1,11 +1,12 @@ 'use strict'; class BottomTab extends HTMLElement{ - - initialize(Content, onClick) { - this._active = false - this._visibility = true + constructor(Content){ this.innerHTML = Content + } + attachedCallback() { + this.active = false + this.visibility = false this.classList.add('linter-tab') this.countSpan = document.createElement('span') @@ -14,8 +15,6 @@ this.appendChild(document.createTextNode(' ')) this.appendChild(this.countSpan) - - this.addEventListener('click', onClick) } get active() { return this._active
f29f864c971c460d7ba121db0ad3017c63573bec
client/src/actions/channelsActions.js
client/src/actions/channelsActions.js
import {fetchChannels} from '../api/channelsApi' export function getArticles(channel) { return function(dispatch) { return fetchChannels(channel) .then(response => { dispatch({ type: 'GET_ARTICLES', payload: { name: channel.name, articles: response.articles } }) return response.articles }) .catch(error => { throw(error); }); } }
import {fetchChannels} from '../api/channelsApi' export function getArticles(channel) { return function(dispatch) { return fetchChannels(channel) .then(response => { dispatch({ type: 'GET_ARTICLES', payload: { name: channel.name, articles: response.articles } }) }) .catch(error => { throw(error); }); } }
Remove return value from getArticles
Remove return value from getArticles
JavaScript
mit
kevinladkins/newsfeed,kevinladkins/newsfeed,kevinladkins/newsfeed
--- +++ @@ -11,12 +11,9 @@ articles: response.articles } }) - return response.articles }) .catch(error => { throw(error); }); } } - -
f6702eaf4dae76b1d678c1e3885b2b0ebdb4bc69
common/form/mixin/action-behaviour.js
common/form/mixin/action-behaviour.js
var assign = require('object-assign'); var actionMixin = { /** * Get the entity identifier for the form loading. * @returns {object} - The identifier of the entity. */ _getId: function formGetId() { if(this.getId){ return this.getId(); } return this.state.id; }, /** * Get the constructed entity from the state. * @returns {object} - the entity informations. */ _getEntity: function formGetEntity(){ if(this.getEntity){ return this.getEntity(); } //Build the entity value from the ref getVaue. var htmlData = {}; for(var r in this.refs){ htmlData[r] = this.refs[r].getValue(); } return assign({}, this.state, htmlData); }, /** * Load data action call. */ _loadData: function formLoadData() { this.action.load(this._getId()); } }; module.exports = actionMixin;
var assign = require('object-assign'); var isFunction = require('lodash/lang/isFunction'); var actionMixin = { /** * Get the entity identifier for the form loading. * @returns {object} - The identifier of the entity. */ _getId: function formGetId() { if(this.getId){ return this.getId(); } return this.state.id; }, /** * Get the constructed entity from the state. * @returns {object} - the entity informations. */ _getEntity: function formGetEntity(){ if(this.getEntity){ return this.getEntity(); } //Build the entity value from the ref getVaue. var htmlData = {}; for(var r in this.refs){ //todo @pierr see if this is sufficient. if(this.refs[r] && isFunction(this.refs[r].getValue)){ htmlData[r] = this.refs[r].getValue(); } } return assign({}, this.state, htmlData); }, /** * Load data action call. */ _loadData: function formLoadData() { this.action.load(this._getId()); } }; module.exports = actionMixin;
Add checking befor getEntity value..
[form] Add checking befor getEntity value..
JavaScript
mit
JRLK/focus-components,sebez/focus-components,Ephrame/focus-components,JRLK/focus-components,Ephrame/focus-components,JRLK/focus-components,Bernardstanislas/focus-components,anisgh/focus-components,JabX/focus-components,Jerom138/focus-components,anisgh/focus-components,asimsir/focus-components,Bernardstanislas/focus-components,KleeGroup/focus-components,Bernardstanislas/focus-components,KleeGroup/focus-components,asimsir/focus-components,get-focus/focus-components,anisgh/focus-components,Jerom138/focus-components,sebez/focus-components,JabX/focus-components,Ephrame/focus-components,Jerom138/focus-components
--- +++ @@ -1,4 +1,5 @@ var assign = require('object-assign'); +var isFunction = require('lodash/lang/isFunction'); var actionMixin = { /** @@ -22,7 +23,10 @@ //Build the entity value from the ref getVaue. var htmlData = {}; for(var r in this.refs){ - htmlData[r] = this.refs[r].getValue(); + //todo @pierr see if this is sufficient. + if(this.refs[r] && isFunction(this.refs[r].getValue)){ + htmlData[r] = this.refs[r].getValue(); + } } return assign({}, this.state, htmlData); },
312023a21652ae5d6ddb8a8ce5c0dcd3e5c68e69
src/main/webapp/scripts/index.js
src/main/webapp/scripts/index.js
/** * Check if user is logged in */ function authUser() { fetch('/login') .then(response => response.json()) .then(userAuthInfo => { if(userAuthInfo.isLoggedIn) { console.log("User is logged in"); } else { console.log("User is logged out"); } }); }
/** * Check if user is logged in */ function authUser() { fetch('/login') .then(response => response.json()) .then(userAuthInfo => { let loginButton = document.getElementById('google-login-button'); let loginButtonText = document.getElementById('google-login-button-text'); if(userAuthInfo.isLoggedIn) { loginButton.setAttribute('href', userAuthInfo.logoutUrl); loginButtonText.innerText('Sign out with Google'); } else { loginButton.setAttribute('href', userAuthInfo.loginUrl); loginButtonText.innerText('Sign in with Google'); } }); }
Make google login button functional with JS
Make google login button functional with JS
JavaScript
apache-2.0
googleinterns/step27-2020,googleinterns/step27-2020,googleinterns/step27-2020
--- +++ @@ -5,10 +5,15 @@ fetch('/login') .then(response => response.json()) .then(userAuthInfo => { + let loginButton = document.getElementById('google-login-button'); + let loginButtonText = document.getElementById('google-login-button-text'); + if(userAuthInfo.isLoggedIn) { - console.log("User is logged in"); + loginButton.setAttribute('href', userAuthInfo.logoutUrl); + loginButtonText.innerText('Sign out with Google'); } else { - console.log("User is logged out"); + loginButton.setAttribute('href', userAuthInfo.loginUrl); + loginButtonText.innerText('Sign in with Google'); } }); }
09eb706f499092bc67ad5470acabd1f620e77349
client/routes.js
client/routes.js
Router.map(function() { // Read paths from a JSON configuration file. // Formatted as { '/path': 'template', ... } // This seems nicer in a config file than hard coding it here. // Pull this from routes.js var welcome_routes = { "/": "welcome_blurb", "/welcome": "welcome_blurb", "/login": "login", "/register": "register" }; var top_and_side_routes = { "/about": "about", "/library": "library" }; var paths = Object.keys(welcome_routes); for (var idx in paths) { var key = paths[idx]; this.route(welcome_routes[key], { path: key, layoutTemplate: 'welcome' }); } var paths = Object.keys(top_and_side_routes); for (var idx in paths) { var key = paths[idx]; this.route(top_and_side_routes[key], { path: key, layoutTemplate: 'top_and_side' }); } });
Router.map(function() { // Read paths from a JSON configuration file. // Formatted as { '/path': 'template', ... } // This seems nicer in a config file than hard coding it here. // Pull this from routes.js var welcome_routes = { "/welcome": "welcome_blurb", "/login": "login", "/register": "register" }; var top_and_side_routes = { "/about": "about", "/library": "library" }; this.route('root', { path: '/', action: function() { Router.go('welcome_blurb'); } }); var paths = Object.keys(welcome_routes); for (var idx in paths) { var key = paths[idx]; this.route(welcome_routes[key], { path: key, layoutTemplate: 'welcome' }); } var paths = Object.keys(top_and_side_routes); for (var idx in paths) { var key = paths[idx]; this.route(top_and_side_routes[key], { path: key, layoutTemplate: 'top_and_side' }); } });
Make / and /welcome show the same page by redirecting to /welcome in the / route.
Make / and /welcome show the same page by redirecting to /welcome in the / route.
JavaScript
agpl-3.0
FinalsClub/Annotorious
--- +++ @@ -4,7 +4,6 @@ // This seems nicer in a config file than hard coding it here. // Pull this from routes.js var welcome_routes = { - "/": "welcome_blurb", "/welcome": "welcome_blurb", "/login": "login", "/register": "register" @@ -14,6 +13,13 @@ "/about": "about", "/library": "library" }; + + this.route('root', { + path: '/', + action: function() { + Router.go('welcome_blurb'); + } + }); var paths = Object.keys(welcome_routes); for (var idx in paths) {