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 |
|---|---|---|---|---|---|---|---|---|---|---|
688e2647dc85c0743fb2c16f27705077fb478999 | app/default/services/storage.js | app/default/services/storage.js | /* global angular */
angular.module('app')
.factory('Storage', function ($window) {
'use strict';
function getItem(key) {
var value = $window.localStorage.getItem(key);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
if (key.startsWith('$$')) {
return undefined;
}
if (key === 'eventsource') {
return undefined;
}
return value;
}));
}
function removeItem(key) {
$window.localStorage.removeItem(key);
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem
};
});
| /* global angular */
angular.module('app')
.factory('Storage', function ($window) {
'use strict';
function getItem(key) {
var value = $window.localStorage.getItem(key);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
if (key.slice(0, 2) === '$$') {
return undefined;
}
if (key === 'eventsource') {
return undefined;
}
return value;
}));
}
function removeItem(key) {
$window.localStorage.removeItem(key);
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem
};
});
| Fix issue with startsWith not existing(?) | Fix issue with startsWith not existing(?)
| JavaScript | agpl-3.0 | johansten/stargazer,johansten/stargazer,johansten/stargazer | ---
+++
@@ -15,7 +15,7 @@
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
- if (key.startsWith('$$')) {
+ if (key.slice(0, 2) === '$$') {
return undefined;
}
|
df03e27de9f58ace8a49486bd2eb690db085845f | app/initializers/app-version.js | app/initializers/app-version.js | import config from '../config/environment';
import Ember from 'ember';
export default {
name: 'App Version',
initialize: function() {
Ember.libraries.register('App', config.APP.version);
}
}
| import config from '../config/environment';
import Ember from 'ember';
var capitalize = Ember.String.capitalize;
export default {
name: 'App Version',
initialize: function(container, application) {
var appName = capitalize(application.toString());
Ember.libraries.register(appName, config.APP.version);
}
}
| Use the app's real name instead of 'App' | Use the app's real name instead of 'App' | JavaScript | mit | atsjj/ember-cli-app-version,stefanpenner/ember-cli-app-version,joliss/ember-cli-app-version,jelhan/ember-cli-app-version,stefanpenner/ember-cli-app-version,atsjj/ember-cli-app-version,cibernox/ember-cli-app-version,cibernox/ember-cli-app-version,philipbjorge/ember-cli-app-version,jelhan/ember-cli-app-version,philipbjorge/ember-cli-app-version,embersherpa/ember-cli-app-version,embersherpa/ember-cli-app-version,joliss/ember-cli-app-version | ---
+++
@@ -1,9 +1,11 @@
import config from '../config/environment';
import Ember from 'ember';
+var capitalize = Ember.String.capitalize;
export default {
name: 'App Version',
- initialize: function() {
- Ember.libraries.register('App', config.APP.version);
+ initialize: function(container, application) {
+ var appName = capitalize(application.toString());
+ Ember.libraries.register(appName, config.APP.version);
}
} |
83848b882034a54d88d6c0a5a6ad1891ac66f2eb | public/index.js | public/index.js | (function() {
const backKey = 37;
const backSpaceKey = 8;
const forwardKey = 39;
const spaceKey = 32;
const content = [
'<h1>async @ async</h1>',
'<h1>Test 1</h1>',
'<h1>Test 2</h1>'
]
function setPageContent(index) {
document.body.innerHTML = content[index];
}
function navigate(by) {
const index = (parseInt(document.location.hash.slice(1), 10) || 0) + by;
if (index < 0) {
return;
}
history.pushState({index}, '', `#${index}`);
setPageContent(index);
}
window.addEventListener('popstate', evt => {
const index = evt.state.index;
if (typeof index === 'number' && !isNaN(index)) {
setPageContent(evt.state.index);
}
});
document.addEventListener('keyup', evt => {
switch (evt.keyCode) {
case backKey:
case backSpaceKey:
navigate(-1);
break;
case forwardKey:
case spaceKey:
navigate(+1);
break;
default:
console.log(evt.keyCode);
}
});
new EventSource('/emitter').addEventListener('navigate', evt => navigate(JSON.parse(evt.data).by));
navigate(0);
}());
| (function () {
var backKey = 37;
var backSpaceKey = 8;
var forwardKey = 39;
var spaceKey = 32;
var content = [
'<h1>async @ async</h1>',
'<h1>Test 1</h1>',
'<h1>Test 2</h1>'
]
function setPageContent(index) {
document.body.innerHTML = content[index];
}
function navigate(by) {
var index = (parseInt(document.location.hash.slice(1), 10) || 0) + by;
if (index < 0) {
return;
}
history.pushState({index: index}, '', '#' + index);
setPageContent(index);
}
window.addEventListener('popstate', function (evt) {
var index = evt.state.index;
if (typeof index === 'number' && !isNaN(index)) {
setPageContent(evt.state.index);
}
});
document.addEventListener('keyup', function (evt) {
switch (evt.keyCode) {
case backKey:
case backSpaceKey:
navigate(-1);
break;
case forwardKey:
case spaceKey:
navigate(+1);
break;
default:
console.log(evt.keyCode);
}
});
new EventSource('/emitter').addEventListener('navigate', function (evt) {
navigate(JSON.parse(evt.data).by);
});
navigate(0);
}());
| Update frontend code to work on ES5 only. | Update frontend code to work on ES5 only.
| JavaScript | mit | qubyte/toisu-talk,qubyte/toisu-talk | ---
+++
@@ -1,10 +1,10 @@
-(function() {
- const backKey = 37;
- const backSpaceKey = 8;
- const forwardKey = 39;
- const spaceKey = 32;
+(function () {
+ var backKey = 37;
+ var backSpaceKey = 8;
+ var forwardKey = 39;
+ var spaceKey = 32;
- const content = [
+ var content = [
'<h1>async @ async</h1>',
'<h1>Test 1</h1>',
'<h1>Test 2</h1>'
@@ -15,25 +15,25 @@
}
function navigate(by) {
- const index = (parseInt(document.location.hash.slice(1), 10) || 0) + by;
+ var index = (parseInt(document.location.hash.slice(1), 10) || 0) + by;
if (index < 0) {
return;
}
- history.pushState({index}, '', `#${index}`);
+ history.pushState({index: index}, '', '#' + index);
setPageContent(index);
}
- window.addEventListener('popstate', evt => {
- const index = evt.state.index;
+ window.addEventListener('popstate', function (evt) {
+ var index = evt.state.index;
if (typeof index === 'number' && !isNaN(index)) {
setPageContent(evt.state.index);
}
});
- document.addEventListener('keyup', evt => {
+ document.addEventListener('keyup', function (evt) {
switch (evt.keyCode) {
case backKey:
case backSpaceKey:
@@ -50,7 +50,9 @@
}
});
- new EventSource('/emitter').addEventListener('navigate', evt => navigate(JSON.parse(evt.data).by));
+ new EventSource('/emitter').addEventListener('navigate', function (evt) {
+ navigate(JSON.parse(evt.data).by);
+ });
navigate(0);
}()); |
ba57b490524be1982abeaaa141117e28a4dab4fc | raspberry-worker/app.js | raspberry-worker/app.js | var util = require('util');
var teleinfo = require('./teleinfo.js');
var request = require('request');
var trameEvents = teleinfo.teleinfo('/dev/ttyAMA0');
// Handle elec information
trameEvents.on('tramedecodee', function (data) {
sendData(data);
});
/**
* Sends the buffered data to the API and empty the buffer
*/
function sendData(data) {
var options = {
uri: 'http://theyetifield.tk/frames/',
method: 'POST',
json: {
frames: [data]
}
};
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log("Frames successfully sent.");
} else {
console.error('An error occurred when sending frames:', error);
}
});
} | var util = require('util');
var teleinfo = require('./teleinfo.js');
var request = require('request');
var trameEvents = teleinfo.teleinfo('/dev/ttyAMA0');
// Handle elec information
trameEvents.on('onDecodedFrame', function (data) {
sendData(data);
});
/**
* Sends the buffered data to the API and empty the buffer
*/
function sendData(data) {
var options = {
uri: 'http://theyetifield.tk/frames/',
method: 'POST',
json: {
frames: [data]
}
};
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log("Frames successfully sent.");
} else {
console.error('An error occurred when sending frames:', error);
}
});
} | Fix registering to the teleinfo service event. | Fix registering to the teleinfo service event.
| JavaScript | mit | florianleger/pitou | ---
+++
@@ -5,7 +5,7 @@
var trameEvents = teleinfo.teleinfo('/dev/ttyAMA0');
// Handle elec information
-trameEvents.on('tramedecodee', function (data) {
+trameEvents.on('onDecodedFrame', function (data) {
sendData(data);
});
|
8e17841c078aa869372f6cec1dd1790455efbc8c | js/id/svg/tag_classes.js | js/id/svg/tag_classes.js | iD.svg.TagClasses = function() {
var keys = iD.util.trueObj([
'highway', 'railway', 'motorway', 'amenity', 'natural',
'landuse', 'building', 'oneway', 'bridge'
]), tagClassRe = /^tag-/;
return function(selection) {
selection.each(function(d, i) {
var classes, value = this.className;
if (value.baseVal !== undefined) value = value.baseVal;
classes = value.trim().split(/\s+/).filter(function(name) {
return name.length && !tagClassRe.test(name);
});
var tags = d.tags;
for (var k in tags) {
if (!keys[k]) continue;
classes.push('tag-' + k);
classes.push('tag-' + k + '-' + tags[k]);
}
return d3.select(this).attr('class', classes.join(' '));
});
};
};
| iD.svg.TagClasses = function() {
var keys = iD.util.trueObj([
'highway', 'railway', 'motorway', 'amenity', 'natural',
'landuse', 'building', 'oneway', 'bridge'
]), tagClassRe = /^tag-/;
return function tagClassesSelection(selection) {
selection.each(function tagClassesEach(d, i) {
var classes, value = this.className;
if (value.baseVal !== undefined) value = value.baseVal;
classes = value.trim().split(/\s+/).filter(function(name) {
return name.length && !tagClassRe.test(name);
});
var tags = d.tags;
for (var k in tags) {
if (!keys[k]) continue;
classes.push('tag-' + k);
classes.push('tag-' + k + '-' + tags[k]);
}
return this.className = classes.join(' ');
});
};
};
| Make tag classes functions non-anonymous | Make tag classes functions non-anonymous
| JavaScript | isc | edpop/iD,1ec5/iD,mapmeld/iD,kartta-labs/iD,AndreasHae/iD,kartta-labs/iD,AndreasHae/iD,1ec5/iD,zbycz/iD,edpop/iD,bagage/iD,tbicr/iD,openstreetmap/iD,openstreetmap/iD,edpop/iD,energiekollektiv/openmod.sh-id,mapmeld/iD,bagage/iD,andreic-telenav/iD,morray/iD,digidem/iD,morray/iD,ngageoint/hootenanny-ui,kartta-labs/iD,ngageoint/hootenanny-ui,mapmeld/iD,openstreetmap/iD,zbycz/iD,digidem/iD,AndreasHae/iD,andreic-telenav/iD,kepta/iD,energiekollektiv/openmod.sh-id,ngageoint/hootenanny-ui,1ec5/iD,tbicr/iD,bagage/iD,kepta/iD | ---
+++
@@ -4,8 +4,8 @@
'landuse', 'building', 'oneway', 'bridge'
]), tagClassRe = /^tag-/;
- return function(selection) {
- selection.each(function(d, i) {
+ return function tagClassesSelection(selection) {
+ selection.each(function tagClassesEach(d, i) {
var classes, value = this.className;
if (value.baseVal !== undefined) value = value.baseVal;
@@ -21,7 +21,7 @@
classes.push('tag-' + k + '-' + tags[k]);
}
- return d3.select(this).attr('class', classes.join(' '));
+ return this.className = classes.join(' ');
});
};
}; |
91b7d0ed5bea6b478e3735e7f6941f04f25c69f9 | app/aboutDialog.js | app/aboutDialog.js | const electron = require('electron')
const app = require('electron').app
const dialog = electron.dialog
const Channel = require('./channel')
const path = require('path')
module.exports.showAbout = function () {
dialog.showMessageBox({
title: 'Brave',
message: 'Version: ' + app.getVersion() + '\n' +
'Electron: ' + process.versions['atom-shell'] + '\n' +
'libchromiumcontent: ' + process.versions['chrome'] + '\n' +
'Channel: ' + Channel.channel(),
icon: path.join(__dirname, '..', 'app', 'img', 'braveAbout.png'),
buttons: ['Ok']
})
}
| const electron = require('electron')
const app = require('electron').app
const dialog = electron.dialog
const Channel = require('./channel')
const path = require('path')
module.exports.showAbout = function () {
dialog.showMessageBox({
title: 'Brave',
message: 'Brave: ' + app.getVersion() + '\n' +
'Electron: ' + process.versions['atom-shell'] + '\n' +
'libchromiumcontent: ' + process.versions['chrome'] + '\n' +
'V8: ' + process.versions.v8 + '\n' +
'Node.js: ' + process.versions.node + '\n' +
'OpenSSL: ' + process.versions.openssl + '\n' +
'Update channel: ' + Channel.channel(),
icon: path.join(__dirname, '..', 'app', 'img', 'braveAbout.png'),
buttons: ['Ok']
})
}
| Add more info to about box | Add more info to about box
Auditors: da39a3ee5e6b4b0d3255bfef95601890afd80709@diracdeltas
| JavaScript | mpl-2.0 | timborden/browser-laptop,pmkary/braver,diasdavid/browser-laptop,darkdh/browser-laptop,willy-b/browser-laptop,Sh1d0w/browser-laptop,manninglucas/browser-laptop,darkdh/browser-laptop,diasdavid/browser-laptop,MKuenzi/browser-laptop,luixxiul/browser-laptop,manninglucas/browser-laptop,MKuenzi/browser-laptop,jonathansampson/browser-laptop,Sh1d0w/browser-laptop,diasdavid/browser-laptop,willy-b/browser-laptop,jonathansampson/browser-laptop,jonathansampson/browser-laptop,darkdh/browser-laptop,dcposch/browser-laptop,luixxiul/browser-laptop,pmkary/braver,darkdh/browser-laptop,dcposch/browser-laptop,dcposch/browser-laptop,luixxiul/browser-laptop,MKuenzi/browser-laptop,willy-b/browser-laptop,diasdavid/browser-laptop,timborden/browser-laptop,timborden/browser-laptop,Sh1d0w/browser-laptop,luixxiul/browser-laptop,willy-b/browser-laptop,Sh1d0w/browser-laptop,MKuenzi/browser-laptop,manninglucas/browser-laptop,pmkary/braver,manninglucas/browser-laptop,timborden/browser-laptop,jonathansampson/browser-laptop,pmkary/braver,dcposch/browser-laptop | ---
+++
@@ -7,10 +7,13 @@
module.exports.showAbout = function () {
dialog.showMessageBox({
title: 'Brave',
- message: 'Version: ' + app.getVersion() + '\n' +
+ message: 'Brave: ' + app.getVersion() + '\n' +
'Electron: ' + process.versions['atom-shell'] + '\n' +
'libchromiumcontent: ' + process.versions['chrome'] + '\n' +
- 'Channel: ' + Channel.channel(),
+ 'V8: ' + process.versions.v8 + '\n' +
+ 'Node.js: ' + process.versions.node + '\n' +
+ 'OpenSSL: ' + process.versions.openssl + '\n' +
+ 'Update channel: ' + Channel.channel(),
icon: path.join(__dirname, '..', 'app', 'img', 'braveAbout.png'),
buttons: ['Ok']
}) |
0ccf9b2d7c98c0da7210ac5eb4431d8586e305fe | app/reducers/ui.js | app/reducers/ui.js | /* global document */
import { Map } from 'immutable';
import { handleActions } from 'redux-actions';
import { SIDEBAR_TOGGLE, PANE_TOGGLE, PANE_RESIZE, SIDEBAR_RESIZE } from '../actions/ui';
import { FOLDER_OPEN } from '../actions/files';
const initialState = Map({
sidebarVisible: false,
paneVisible: true,
paneSize: ((document.documentElement.clientWidth - 250) / 2),
sidebarSize: 250
});
const uiReducer = handleActions({
[SIDEBAR_TOGGLE]: state => (state.set('sidebarVisible', !state.get('sidebarVisible'))),
[FOLDER_OPEN]: state => (state.set('sidebarVisible', true)),
[PANE_TOGGLE]: state => (state.set('paneVisible', !state.get('paneVisible'))),
[PANE_RESIZE]: (state, { payload }) => (state.set('paneSize', payload)),
[SIDEBAR_RESIZE]: (state, { payload }) => (state.set('sidebarSize', payload))
}, initialState);
export default uiReducer;
| /* global document */
import { Map } from 'immutable';
import { handleActions } from 'redux-actions';
import { SIDEBAR_TOGGLE, PANE_TOGGLE, PANE_RESIZE, SIDEBAR_RESIZE } from '../actions/ui';
import { FOLDER_OPEN } from '../actions/files';
const initialState = Map({
sidebarVisible: false,
paneVisible: true,
paneSize: (document.documentElement.clientWidth / 2),
sidebarSize: 250
});
const uiReducer = handleActions({
[SIDEBAR_TOGGLE]: (state) => {
const sidebarVisible = !state.get('sidebarVisible');
const sidebarSize = state.get('sidebarSize');
let paneSize = state.get('paneSize');
if (sidebarVisible) {
paneSize -= (sidebarSize / 2);
} else {
paneSize += (sidebarSize / 2);
}
return state.merge({ sidebarVisible, paneSize });
},
[FOLDER_OPEN]: state => (state.set('sidebarVisible', true)),
[PANE_TOGGLE]: state => (state.set('paneVisible', !state.get('paneVisible'))),
[PANE_RESIZE]: (state, { payload }) => (state.set('paneSize', payload)),
[SIDEBAR_RESIZE]: (state, { payload }) => (state.set('sidebarSize', payload))
}, initialState);
export default uiReducer;
| Adjust the other pains on sidebar toggle | Adjust the other pains on sidebar toggle
| JavaScript | bsd-3-clause | Mobelux/docdown-editor,Mobelux/docdown-editor | ---
+++
@@ -8,12 +8,22 @@
const initialState = Map({
sidebarVisible: false,
paneVisible: true,
- paneSize: ((document.documentElement.clientWidth - 250) / 2),
+ paneSize: (document.documentElement.clientWidth / 2),
sidebarSize: 250
});
const uiReducer = handleActions({
- [SIDEBAR_TOGGLE]: state => (state.set('sidebarVisible', !state.get('sidebarVisible'))),
+ [SIDEBAR_TOGGLE]: (state) => {
+ const sidebarVisible = !state.get('sidebarVisible');
+ const sidebarSize = state.get('sidebarSize');
+ let paneSize = state.get('paneSize');
+ if (sidebarVisible) {
+ paneSize -= (sidebarSize / 2);
+ } else {
+ paneSize += (sidebarSize / 2);
+ }
+ return state.merge({ sidebarVisible, paneSize });
+ },
[FOLDER_OPEN]: state => (state.set('sidebarVisible', true)),
[PANE_TOGGLE]: state => (state.set('paneVisible', !state.get('paneVisible'))),
[PANE_RESIZE]: (state, { payload }) => (state.set('paneSize', payload)), |
b4c35d82964091a811f0fca5950298df3117566e | src/sagas/DevNullApi.js | src/sagas/DevNullApi.js | import config from '../config'
export const feedback: (feedback) => any =
(feedback) => {
const options = {
method: 'POST',
headers: {
'Content-Type': "application/json",
"Voter-ID": feedback.uuid
},
body: JSON.stringify(feedback.feedback)
}
return fetch(`${config.urls.devnull}/events/${feedback.eventId}/sessions/${feedback.sessionId}/feedbacks`, options)
.then(res => {
if (res.status === 202) {
return { message: 'Feedback submitted' }
} else if(res.status === 403) {
return { message : 'Please try again. Feedback opens 10 min before session ends.' }
} else {
return res.status
}
}
)
} | import config from '../config'
export const feedback: (feedback) => any =
(feedback) => {
const options = {
method: 'POST',
headers: {
'Content-Type': "application/json",
"Voter-ID": feedback.uuid
},
body: JSON.stringify(feedback.feedback)
}
return fetch(`${config.urls.devnull}/events/${feedback.eventId}/sessions/${feedback.sessionId}/feedbacks`, options)
.then(res => {
if (res.status === 202) {
return { message: 'Feedback submitted' }
} else if(res.status === 403) {
return { message : 'Please try again. Feedback opens 10 min before session ends.' }
} else {
return { message: 'Ops somthing went wrong.' }
}
}
)
} | Add feedback for unidentified errors | Add feedback for unidentified errors
| JavaScript | mit | javaBin/appZone,javaBin/appZone,javaBin/appZone,javaBin/appZone,javaBin/appZone,javaBin/appZone,javaBin/appZone | ---
+++
@@ -17,7 +17,7 @@
} else if(res.status === 403) {
return { message : 'Please try again. Feedback opens 10 min before session ends.' }
} else {
- return res.status
+ return { message: 'Ops somthing went wrong.' }
}
}
) |
caedfe69291165ddedb0a041be3eb65a9a12442a | koans/AboutGenerators.js | koans/AboutGenerators.js | describe("About Generators", function () {
describe("Basic usage", function () {
it("should understand concept", function () {
function* createGenerator() {
//`yield` keyword exits function execution
yield 1;
}
var generator = createGenerator();
expect(generator.next().value).toEqual(FILL_ME_IN);
var completedGenerator = generator.next()
expect(completedGenerator.value).toEqual(FILL_ME_IN);
expect(completedGenerator.done).toEqual(FILL_ME_IN);
debugger;
});
});
});
| describe("About Generators", function () {
describe("Basic usage", function () {
it("should understand syntax", function () {
// `*` immediately after `function` denotes a generator
function* createGenerator() {
//`yield` keyword exits function execution
yield 1;
}
// invoking a generator function returns a generator interface
// `.next()` is used to `start` a generator
// Also used to resume function execution to the next `yield`
var generator = createGenerator();
expect(generator.next().value).toEqual(FILL_ME_IN);
var completedGenerator = generator.next()
expect(completedGenerator.value).toEqual(FILL_ME_IN);
expect(completedGenerator.done).toEqual(FILL_ME_IN);
debugger;
});
});
});
| Add helper comments in generators koans | docs: Add helper comments in generators koans
| JavaScript | mit | tawashley/es6-javascript-koans,tawashley/es6-javascript-koans,tawashley/es6-javascript-koans | ---
+++
@@ -2,18 +2,23 @@
describe("Basic usage", function () {
- it("should understand concept", function () {
+ it("should understand syntax", function () {
+
+ // `*` immediately after `function` denotes a generator
function* createGenerator() {
//`yield` keyword exits function execution
yield 1;
}
+ // invoking a generator function returns a generator interface
+ // `.next()` is used to `start` a generator
+ // Also used to resume function execution to the next `yield`
var generator = createGenerator();
expect(generator.next().value).toEqual(FILL_ME_IN);
var completedGenerator = generator.next()
-
+
expect(completedGenerator.value).toEqual(FILL_ME_IN);
expect(completedGenerator.done).toEqual(FILL_ME_IN);
|
9327492da4820fe23b5b54e055add59f53209ff7 | src/firefox-preamble.js | src/firefox-preamble.js | Components.utils.import("resource://gre/modules/devtools/Console.jsm");
Components.utils.import("resource://gre/modules/Timer.jsm");
// This module does not support all of es6 promise functionality.
// Components.utils.import("resource://gre/modules/Promise.jsm");
const XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest");
Components.utils.importGlobalProperties(['URL']);
var freedom;
function setupFreedom(options, manifest) {
if (this.freedom) {
return this.freedom;
}
var lastSlash = manifest.lastIndexOf("/");
var manifestLocation = manifest.substring(0, lastSlash + 1);
//var manifestFilename = manifest.substring(lastSlash + 1);
firefox_config = {
isApp: false,
manifest: manifest,
portType: 'Worker',
stayLocal: true,
location: manifestLocation
};
| Components.utils.import("resource://gre/modules/devtools/Console.jsm");
Components.utils.import("resource://gre/modules/Timer.jsm");
// This module does not support all of es6 promise functionality.
// Components.utils.import("resource://gre/modules/Promise.jsm");
const XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest");
Components.utils.importGlobalProperties(['URL']);
var freedom;
function setupFreedom(manifest) {
if (this.freedom) {
return this.freedom;
}
var lastSlash = manifest.lastIndexOf("/");
var manifestLocation = manifest.substring(0, lastSlash + 1);
//var manifestFilename = manifest.substring(lastSlash + 1);
firefox_config = {
isApp: false,
manifest: manifest,
portType: 'Worker',
stayLocal: true,
location: manifestLocation
};
| Remove options argument to setupFreedom. | Remove options argument to setupFreedom.
| JavaScript | apache-2.0 | freedomjs/freedom-for-firefox,freedomjs/freedom-for-firefox | ---
+++
@@ -7,7 +7,7 @@
var freedom;
-function setupFreedom(options, manifest) {
+function setupFreedom(manifest) {
if (this.freedom) {
return this.freedom;
} |
9389a381553b1c613e6467be78e8a4ce3bb1f729 | src/lib/launchDarkly.js | src/lib/launchDarkly.js | import launchDarklyBrowser from "ldclient-js";
export function ldBrowserInit (key, user) {
return launchDarklyBrowser.initialize(key, user);
}
export function getAllFeatureFlags (key, user) {
const ldClient = ldBrowserInit(key, user);
return ldClient.allFlags();
}
| import launchDarklyBrowser from "ldclient-js";
export function ldBrowserInit (key, user) {
return launchDarklyBrowser.initialize(key, user);
}
export function getAllFeatureFlags (key, user) {
const ldClient = ldBrowserInit(key, user);
return new Promise((resolve, reject) => {
ldClient.on("ready", () => {
resolve(ldClient.allFlags());
});
});
}
| Refactor grabbing all feature flags to implement a promise | Refactor grabbing all feature flags to implement a promise
| JavaScript | mit | TrueCar/react-launch-darkly | ---
+++
@@ -6,5 +6,9 @@
export function getAllFeatureFlags (key, user) {
const ldClient = ldBrowserInit(key, user);
- return ldClient.allFlags();
+ return new Promise((resolve, reject) => {
+ ldClient.on("ready", () => {
+ resolve(ldClient.allFlags());
+ });
+ });
} |
abdcfb2985a8e6ddf0781d6dd4b8063ced47f1c9 | src/lib/require-auth.js | src/lib/require-auth.js | "use strict";
var m = require("mithril"),
db = require("./firebase");
module.exports = function(component) {
return {
controller : function() {
var auth = db.getAuth();
// Unauthed or expired auth? BOUNCED
if(!auth || (auth.expires * 1000) < Date.now()) {
return m.route("/login");
}
},
view : function() {
return m.component(component);
}
};
};
| "use strict";
var m = require("mithril"),
db = require("./firebase");
module.exports = function(component) {
return {
controller : function() {
var auth = db.getAuth();
// Unauthed or expired auth? BOUNCED
if(global.crucible.auth && (!auth || (auth.expires * 1000) < Date.now())) {
return m.route("/login");
}
},
view : function() {
return m.component(component);
}
};
};
| Fix the rest of the auth brouhaha | Fix the rest of the auth brouhaha
| JavaScript | mit | Ryan-McMillan/crucible,kevinkace/crucible,tivac/anthracite,Ryan-McMillan/crucible,tivac/crucible,kevinkace/crucible,tivac/anthracite,tivac/crucible | ---
+++
@@ -10,7 +10,7 @@
var auth = db.getAuth();
// Unauthed or expired auth? BOUNCED
- if(!auth || (auth.expires * 1000) < Date.now()) {
+ if(global.crucible.auth && (!auth || (auth.expires * 1000) < Date.now())) {
return m.route("/login");
}
}, |
c7dcb0bb57dd3ce0ec39c67e4e3eb2c298361971 | common/lib/xmodule/xmodule/js/src/capa/imageinput.js | common/lib/xmodule/xmodule/js/src/capa/imageinput.js | /////////////////////////////////////////////////////////////////////////////
//
// Simple image input
//
////////////////////////////////////////////////////////////////////////////////
// click on image, return coordinates
// put a dot at location of click, on imag
// window.image_input_click = function(id,event){
function image_input_click(id,event){
iidiv = document.getElementById("imageinput_"+id);
pos_x = event.offsetX?(event.offsetX):event.pageX-iidiv.offsetLeft;
pos_y = event.offsetY?(event.offsetY):event.pageY-iidiv.offsetTop;
result = "[" + pos_x + "," + pos_y + "]";
cx = (pos_x-15) +"px";
cy = (pos_y-15) +"px" ;
// alert(result);
document.getElementById("cross_"+id).style.left = cx;
document.getElementById("cross_"+id).style.top = cy;
document.getElementById("cross_"+id).style.visibility = "visible" ;
document.getElementById("input_"+id).value =result;
}
| /////////////////////////////////////////////////////////////////////////////
//
// Simple image input
//
////////////////////////////////////////////////////////////////////////////////
// click on image, return coordinates
// put a dot at location of click, on imag
window.image_input_click = function(id,event){
iidiv = document.getElementById("imageinput_"+id);
pos_x = event.offsetX?(event.offsetX):event.pageX-iidiv.offsetLeft;
pos_y = event.offsetY?(event.offsetY):event.pageY-iidiv.offsetTop;
result = "[" + pos_x + "," + pos_y + "]";
cx = (pos_x-15) +"px";
cy = (pos_y-15) +"px" ;
// alert(result);
document.getElementById("cross_"+id).style.left = cx;
document.getElementById("cross_"+id).style.top = cy;
document.getElementById("cross_"+id).style.visibility = "visible" ;
document.getElementById("input_"+id).value =result;
};
| Attach image_input_click function to window object | Attach image_input_click function to window object
So other parts of the page can access it
| JavaScript | agpl-3.0 | franosincic/edx-platform,Edraak/edx-platform,chauhanhardik/populo,vismartltd/edx-platform,jjmiranda/edx-platform,xinjiguaike/edx-platform,unicri/edx-platform,arifsetiawan/edx-platform,arifsetiawan/edx-platform,eestay/edx-platform,cpennington/edx-platform,ak2703/edx-platform,kamalx/edx-platform,antoviaque/edx-platform,Edraak/edraak-platform,chauhanhardik/populo,vasyarv/edx-platform,waheedahmed/edx-platform,hkawasaki/kawasaki-aio8-2,LearnEra/LearnEraPlaftform,pabloborrego93/edx-platform,dsajkl/reqiop,mcgachey/edx-platform,nanolearningllc/edx-platform-cypress,ak2703/edx-platform,chudaol/edx-platform,raccoongang/edx-platform,franosincic/edx-platform,beacloudgenius/edx-platform,pelikanchik/edx-platform,Lektorium-LLC/edx-platform,jjmiranda/edx-platform,shurihell/testasia,jzoldak/edx-platform,nttks/edx-platform,4eek/edx-platform,ak2703/edx-platform,Endika/edx-platform,kamalx/edx-platform,eemirtekin/edx-platform,dcosentino/edx-platform,mjg2203/edx-platform-seas,caesar2164/edx-platform,xingyepei/edx-platform,y12uc231/edx-platform,xingyepei/edx-platform,shubhdev/openedx,adoosii/edx-platform,gymnasium/edx-platform,benpatterson/edx-platform,appliedx/edx-platform,devs1991/test_edx_docmode,zhenzhai/edx-platform,devs1991/test_edx_docmode,ferabra/edx-platform,4eek/edx-platform,jazkarta/edx-platform,etzhou/edx-platform,dcosentino/edx-platform,zofuthan/edx-platform,don-github/edx-platform,10clouds/edx-platform,zubair-arbi/edx-platform,romain-li/edx-platform,shashank971/edx-platform,mitocw/edx-platform,J861449197/edx-platform,cyanna/edx-platform,antonve/s4-project-mooc,itsjeyd/edx-platform,vismartltd/edx-platform,pku9104038/edx-platform,apigee/edx-platform,atsolakid/edx-platform,proversity-org/edx-platform,4eek/edx-platform,xinjiguaike/edx-platform,martynovp/edx-platform,xuxiao19910803/edx-platform,B-MOOC/edx-platform,auferack08/edx-platform,olexiim/edx-platform,AkA84/edx-platform,EDUlib/edx-platform,devs1991/test_edx_docmode,ovnicraft/edx-platform,zerobatu/edx-platform,motion2015/edx-platform,IONISx/edx-platform,nanolearningllc/edx-platform-cypress-2,jswope00/GAI,beni55/edx-platform,SravanthiSinha/edx-platform,cecep-edu/edx-platform,y12uc231/edx-platform,ovnicraft/edx-platform,knehez/edx-platform,jjmiranda/edx-platform,y12uc231/edx-platform,jazkarta/edx-platform,polimediaupv/edx-platform,Kalyzee/edx-platform,eemirtekin/edx-platform,Edraak/edx-platform,ahmedaljazzar/edx-platform,UXE/local-edx,kxliugang/edx-platform,defance/edx-platform,dsajkl/reqiop,gsehub/edx-platform,eduNEXT/edx-platform,jazkarta/edx-platform-for-isc,Lektorium-LLC/edx-platform,B-MOOC/edx-platform,mcgachey/edx-platform,tanmaykm/edx-platform,louyihua/edx-platform,mbareta/edx-platform-ft,kmoocdev2/edx-platform,arifsetiawan/edx-platform,hkawasaki/kawasaki-aio8-2,chauhanhardik/populo,eduNEXT/edunext-platform,SivilTaram/edx-platform,edx-solutions/edx-platform,Edraak/edx-platform,rhndg/openedx,stvstnfrd/edx-platform,ESOedX/edx-platform,wwj718/edx-platform,beni55/edx-platform,MakeHer/edx-platform,shubhdev/edxOnBaadal,bitifirefly/edx-platform,MSOpenTech/edx-platform,Livit/Livit.Learn.EdX,xuxiao19910803/edx-platform,jamiefolsom/edx-platform,pepeportela/edx-platform,bigdatauniversity/edx-platform,jazkarta/edx-platform-for-isc,shubhdev/edx-platform,mtlchun/edx,yokose-ks/edx-platform,polimediaupv/edx-platform,inares/edx-platform,nanolearningllc/edx-platform-cypress,shubhdev/edxOnBaadal,antoviaque/edx-platform,knehez/edx-platform,angelapper/edx-platform,pku9104038/edx-platform,philanthropy-u/edx-platform,ahmadio/edx-platform,nanolearningllc/edx-platform-cypress-2,openfun/edx-platform,jazkarta/edx-platform-for-isc,motion2015/edx-platform,eduNEXT/edunext-platform,mitocw/edx-platform,auferack08/edx-platform,UXE/local-edx,shubhdev/edx-platform,amir-qayyum-khan/edx-platform,arbrandes/edx-platform,pepeportela/edx-platform,inares/edx-platform,valtech-mooc/edx-platform,jbzdak/edx-platform,motion2015/a3,JioEducation/edx-platform,rue89-tech/edx-platform,abdoosh00/edraak,ampax/edx-platform-backup,DNFcode/edx-platform,cselis86/edx-platform,jamesblunt/edx-platform,zerobatu/edx-platform,alu042/edx-platform,itsjeyd/edx-platform,hkawasaki/kawasaki-aio8-0,dsajkl/123,10clouds/edx-platform,nikolas/edx-platform,Edraak/circleci-edx-platform,xuxiao19910803/edx,xinjiguaike/edx-platform,nikolas/edx-platform,ZLLab-Mooc/edx-platform,RPI-OPENEDX/edx-platform,cselis86/edx-platform,LearnEra/LearnEraPlaftform,inares/edx-platform,martynovp/edx-platform,beacloudgenius/edx-platform,halvertoluke/edx-platform,etzhou/edx-platform,cyanna/edx-platform,vikas1885/test1,jbzdak/edx-platform,y12uc231/edx-platform,prarthitm/edxplatform,prarthitm/edxplatform,nanolearning/edx-platform,nikolas/edx-platform,sameetb-cuelogic/edx-platform-test,eduNEXT/edunext-platform,AkA84/edx-platform,bigdatauniversity/edx-platform,devs1991/test_edx_docmode,jolyonb/edx-platform,rhndg/openedx,jonathan-beard/edx-platform,ak2703/edx-platform,LearnEra/LearnEraPlaftform,abdoosh00/edraak,jazkarta/edx-platform-for-isc,arbrandes/edx-platform,CredoReference/edx-platform,J861449197/edx-platform,gsehub/edx-platform,mushtaqak/edx-platform,valtech-mooc/edx-platform,ZLLab-Mooc/edx-platform,Livit/Livit.Learn.EdX,nanolearning/edx-platform,hamzehd/edx-platform,yokose-ks/edx-platform,pelikanchik/edx-platform,MSOpenTech/edx-platform,apigee/edx-platform,nanolearningllc/edx-platform-cypress,sameetb-cuelogic/edx-platform-test,adoosii/edx-platform,Unow/edx-platform,auferack08/edx-platform,nttks/edx-platform,jjmiranda/edx-platform,chudaol/edx-platform,carsongee/edx-platform,utecuy/edx-platform,ampax/edx-platform-backup,IndonesiaX/edx-platform,Stanford-Online/edx-platform,abdoosh00/edx-rtl-final,doganov/edx-platform,iivic/BoiseStateX,fly19890211/edx-platform,nttks/edx-platform,tanmaykm/edx-platform,MakeHer/edx-platform,fintech-circle/edx-platform,playm2mboy/edx-platform,gymnasium/edx-platform,JCBarahona/edX,ahmadiga/min_edx,Kalyzee/edx-platform,edx/edx-platform,bigdatauniversity/edx-platform,iivic/BoiseStateX,chauhanhardik/populo_2,ESOedX/edx-platform,IndonesiaX/edx-platform,J861449197/edx-platform,defance/edx-platform,kursitet/edx-platform,miptliot/edx-platform,motion2015/a3,a-parhom/edx-platform,edx/edx-platform,jbzdak/edx-platform,eduNEXT/edx-platform,pepeportela/edx-platform,zadgroup/edx-platform,IONISx/edx-platform,Semi-global/edx-platform,fly19890211/edx-platform,morenopc/edx-platform,analyseuc3m/ANALYSE-v1,J861449197/edx-platform,nanolearning/edx-platform,prarthitm/edxplatform,romain-li/edx-platform,bigdatauniversity/edx-platform,zerobatu/edx-platform,doismellburning/edx-platform,rhndg/openedx,pku9104038/edx-platform,Edraak/edx-platform,devs1991/test_edx_docmode,hamzehd/edx-platform,ovnicraft/edx-platform,CredoReference/edx-platform,tiagochiavericosta/edx-platform,appliedx/edx-platform,RPI-OPENEDX/edx-platform,wwj718/edx-platform,cognitiveclass/edx-platform,yokose-ks/edx-platform,procangroup/edx-platform,kxliugang/edx-platform,UOMx/edx-platform,ampax/edx-platform,beni55/edx-platform,ampax/edx-platform,10clouds/edx-platform,mjirayu/sit_academy,kamalx/edx-platform,chudaol/edx-platform,wwj718/ANALYSE,romain-li/edx-platform,hamzehd/edx-platform,4eek/edx-platform,DefyVentures/edx-platform,SivilTaram/edx-platform,kmoocdev/edx-platform,WatanabeYasumasa/edx-platform,andyzsf/edx,adoosii/edx-platform,Kalyzee/edx-platform,jbassen/edx-platform,peterm-itr/edx-platform,shabab12/edx-platform,eestay/edx-platform,andyzsf/edx,tiagochiavericosta/edx-platform,EDUlib/edx-platform,kxliugang/edx-platform,Ayub-Khan/edx-platform,msegado/edx-platform,jolyonb/edx-platform,nagyistoce/edx-platform,JCBarahona/edX,edry/edx-platform,jamiefolsom/edx-platform,lduarte1991/edx-platform,bitifirefly/edx-platform,amir-qayyum-khan/edx-platform,ampax/edx-platform-backup,auferack08/edx-platform,pku9104038/edx-platform,don-github/edx-platform,shabab12/edx-platform,jbassen/edx-platform,edx/edx-platform,jelugbo/tundex,ampax/edx-platform-backup,edx-solutions/edx-platform,pomegranited/edx-platform,rismalrv/edx-platform,deepsrijit1105/edx-platform,gymnasium/edx-platform,BehavioralInsightsTeam/edx-platform,MSOpenTech/edx-platform,morenopc/edx-platform,hmcmooc/muddx-platform,cselis86/edx-platform,Semi-global/edx-platform,Unow/edx-platform,mcgachey/edx-platform,cyanna/edx-platform,zhenzhai/edx-platform,zofuthan/edx-platform,ahmadiga/min_edx,utecuy/edx-platform,zhenzhai/edx-platform,dkarakats/edx-platform,mjirayu/sit_academy,cecep-edu/edx-platform,longmen21/edx-platform,mjirayu/sit_academy,arifsetiawan/edx-platform,chrisndodge/edx-platform,doismellburning/edx-platform,morenopc/edx-platform,bdero/edx-platform,adoosii/edx-platform,vasyarv/edx-platform,ZLLab-Mooc/edx-platform,atsolakid/edx-platform,cecep-edu/edx-platform,cognitiveclass/edx-platform,don-github/edx-platform,DNFcode/edx-platform,shubhdev/openedx,prarthitm/edxplatform,Endika/edx-platform,4eek/edx-platform,jswope00/griffinx,DNFcode/edx-platform,tiagochiavericosta/edx-platform,IONISx/edx-platform,kamalx/edx-platform,pomegranited/edx-platform,wwj718/ANALYSE,alu042/edx-platform,jswope00/griffinx,olexiim/edx-platform,Edraak/circleci-edx-platform,nagyistoce/edx-platform,appliedx/edx-platform,gsehub/edx-platform,UXE/local-edx,Edraak/circleci-edx-platform,jruiperezv/ANALYSE,UOMx/edx-platform,ahmadiga/min_edx,tanmaykm/edx-platform,jonathan-beard/edx-platform,deepsrijit1105/edx-platform,analyseuc3m/ANALYSE-v1,chudaol/edx-platform,gymnasium/edx-platform,wwj718/ANALYSE,doganov/edx-platform,dkarakats/edx-platform,unicri/edx-platform,pelikanchik/edx-platform,fly19890211/edx-platform,nttks/jenkins-test,halvertoluke/edx-platform,leansoft/edx-platform,mushtaqak/edx-platform,mushtaqak/edx-platform,appsembler/edx-platform,nanolearningllc/edx-platform-cypress,mitocw/edx-platform,analyseuc3m/ANALYSE-v1,appsembler/edx-platform,rhndg/openedx,lduarte1991/edx-platform,wwj718/edx-platform,jswope00/griffinx,stvstnfrd/edx-platform,WatanabeYasumasa/edx-platform,wwj718/edx-platform,jonathan-beard/edx-platform,cselis86/edx-platform,JCBarahona/edX,chand3040/cloud_that,mjirayu/sit_academy,ferabra/edx-platform,bdero/edx-platform,chauhanhardik/populo_2,valtech-mooc/edx-platform,cognitiveclass/edx-platform,msegado/edx-platform,antoviaque/edx-platform,vikas1885/test1,nagyistoce/edx-platform,shubhdev/openedx,cyanna/edx-platform,shubhdev/openedx,synergeticsedx/deployment-wipro,morenopc/edx-platform,ovnicraft/edx-platform,beni55/edx-platform,ZLLab-Mooc/edx-platform,atsolakid/edx-platform,synergeticsedx/deployment-wipro,shubhdev/edx-platform,shubhdev/edxOnBaadal,cpennington/edx-platform,vasyarv/edx-platform,dkarakats/edx-platform,ovnicraft/edx-platform,angelapper/edx-platform,louyihua/edx-platform,Endika/edx-platform,andyzsf/edx,solashirai/edx-platform,vasyarv/edx-platform,alu042/edx-platform,UOMx/edx-platform,shubhdev/edx-platform,JioEducation/edx-platform,edry/edx-platform,mitocw/edx-platform,franosincic/edx-platform,hkawasaki/kawasaki-aio8-2,leansoft/edx-platform,tiagochiavericosta/edx-platform,apigee/edx-platform,mahendra-r/edx-platform,DefyVentures/edx-platform,mjg2203/edx-platform-seas,LICEF/edx-platform,Livit/Livit.Learn.EdX,sameetb-cuelogic/edx-platform-test,antonve/s4-project-mooc,waheedahmed/edx-platform,iivic/BoiseStateX,romain-li/edx-platform,ahmedaljazzar/edx-platform,UXE/local-edx,olexiim/edx-platform,inares/edx-platform,vikas1885/test1,eemirtekin/edx-platform,zadgroup/edx-platform,marcore/edx-platform,msegado/edx-platform,pelikanchik/edx-platform,arifsetiawan/edx-platform,xingyepei/edx-platform,antonve/s4-project-mooc,pabloborrego93/edx-platform,stvstnfrd/edx-platform,unicri/edx-platform,hmcmooc/muddx-platform,DNFcode/edx-platform,hastexo/edx-platform,RPI-OPENEDX/edx-platform,chrisndodge/edx-platform,waheedahmed/edx-platform,y12uc231/edx-platform,utecuy/edx-platform,franosincic/edx-platform,proversity-org/edx-platform,xingyepei/edx-platform,raccoongang/edx-platform,motion2015/edx-platform,pabloborrego93/edx-platform,kmoocdev/edx-platform,devs1991/test_edx_docmode,xuxiao19910803/edx,fly19890211/edx-platform,shubhdev/edxOnBaadal,marcore/edx-platform,jruiperezv/ANALYSE,atsolakid/edx-platform,AkA84/edx-platform,playm2mboy/edx-platform,carsongee/edx-platform,kxliugang/edx-platform,EDUlib/edx-platform,shashank971/edx-platform,CourseTalk/edx-platform,xuxiao19910803/edx,Lektorium-LLC/edx-platform,hkawasaki/kawasaki-aio8-0,jswope00/GAI,shurihell/testasia,chand3040/cloud_that,alexthered/kienhoc-platform,apigee/edx-platform,devs1991/test_edx_docmode,dsajkl/123,ZLLab-Mooc/edx-platform,hkawasaki/kawasaki-aio8-1,OmarIthawi/edx-platform,proversity-org/edx-platform,LearnEra/LearnEraPlaftform,naresh21/synergetics-edx-platform,jazkarta/edx-platform,mtlchun/edx,unicri/edx-platform,ubc/edx-platform,bdero/edx-platform,olexiim/edx-platform,kursitet/edx-platform,pepeportela/edx-platform,halvertoluke/edx-platform,LICEF/edx-platform,kmoocdev/edx-platform,Kalyzee/edx-platform,waheedahmed/edx-platform,tanmaykm/edx-platform,TsinghuaX/edx-platform,JioEducation/edx-platform,CredoReference/edx-platform,vismartltd/edx-platform,ESOedX/edx-platform,mcgachey/edx-platform,iivic/BoiseStateX,don-github/edx-platform,torchingloom/edx-platform,jelugbo/tundex,Unow/edx-platform,cecep-edu/edx-platform,TsinghuaX/edx-platform,alexthered/kienhoc-platform,jamiefolsom/edx-platform,B-MOOC/edx-platform,procangroup/edx-platform,SivilTaram/edx-platform,nanolearningllc/edx-platform-cypress-2,CourseTalk/edx-platform,motion2015/edx-platform,rue89-tech/edx-platform,shubhdev/openedx,Lektorium-LLC/edx-platform,MakeHer/edx-platform,jruiperezv/ANALYSE,ampax/edx-platform-backup,raccoongang/edx-platform,defance/edx-platform,solashirai/edx-platform,jelugbo/tundex,chand3040/cloud_that,zubair-arbi/edx-platform,mcgachey/edx-platform,zhenzhai/edx-platform,openfun/edx-platform,leansoft/edx-platform,benpatterson/edx-platform,hastexo/edx-platform,playm2mboy/edx-platform,philanthropy-u/edx-platform,kmoocdev2/edx-platform,simbs/edx-platform,nikolas/edx-platform,Softmotions/edx-platform,jamesblunt/edx-platform,eemirtekin/edx-platform,hkawasaki/kawasaki-aio8-1,abdoosh00/edx-rtl-final,knehez/edx-platform,kmoocdev2/edx-platform,Shrhawk/edx-platform,UOMx/edx-platform,etzhou/edx-platform,ahmadiga/min_edx,WatanabeYasumasa/edx-platform,hkawasaki/kawasaki-aio8-1,openfun/edx-platform,deepsrijit1105/edx-platform,jazztpt/edx-platform,Semi-global/edx-platform,polimediaupv/edx-platform,mbareta/edx-platform-ft,procangroup/edx-platform,morenopc/edx-platform,kmoocdev2/edx-platform,hmcmooc/muddx-platform,IndonesiaX/edx-platform,don-github/edx-platform,nikolas/edx-platform,chand3040/cloud_that,marcore/edx-platform,teltek/edx-platform,longmen21/edx-platform,polimediaupv/edx-platform,longmen21/edx-platform,rismalrv/edx-platform,eestay/edx-platform,mushtaqak/edx-platform,mahendra-r/edx-platform,synergeticsedx/deployment-wipro,ferabra/edx-platform,ubc/edx-platform,J861449197/edx-platform,Softmotions/edx-platform,hkawasaki/kawasaki-aio8-0,eduNEXT/edx-platform,dsajkl/123,miptliot/edx-platform,doganov/edx-platform,doismellburning/edx-platform,abdoosh00/edx-rtl-final,chauhanhardik/populo_2,devs1991/test_edx_docmode,eestay/edx-platform,ubc/edx-platform,edx-solutions/edx-platform,SravanthiSinha/edx-platform,alexthered/kienhoc-platform,yokose-ks/edx-platform,Shrhawk/edx-platform,TeachAtTUM/edx-platform,torchingloom/edx-platform,raccoongang/edx-platform,martynovp/edx-platform,mjg2203/edx-platform-seas,a-parhom/edx-platform,beacloudgenius/edx-platform,mahendra-r/edx-platform,ahmedaljazzar/edx-platform,jazztpt/edx-platform,hastexo/edx-platform,naresh21/synergetics-edx-platform,zadgroup/edx-platform,peterm-itr/edx-platform,shurihell/testasia,ferabra/edx-platform,pomegranited/edx-platform,bigdatauniversity/edx-platform,AkA84/edx-platform,amir-qayyum-khan/edx-platform,wwj718/ANALYSE,procangroup/edx-platform,stvstnfrd/edx-platform,DefyVentures/edx-platform,jelugbo/tundex,IONISx/edx-platform,hkawasaki/kawasaki-aio8-0,motion2015/a3,torchingloom/edx-platform,hastexo/edx-platform,fly19890211/edx-platform,shashank971/edx-platform,rue89-tech/edx-platform,playm2mboy/edx-platform,nanolearning/edx-platform,vismartltd/edx-platform,utecuy/edx-platform,edx/edx-platform,halvertoluke/edx-platform,sudheerchintala/LearnEraPlatForm,nanolearningllc/edx-platform-cypress,zofuthan/edx-platform,cpennington/edx-platform,nttks/edx-platform,longmen21/edx-platform,CredoReference/edx-platform,sudheerchintala/LearnEraPlatForm,IndonesiaX/edx-platform,Ayub-Khan/edx-platform,shabab12/edx-platform,doismellburning/edx-platform,Edraak/edraak-platform,beacloudgenius/edx-platform,antoviaque/edx-platform,nagyistoce/edx-platform,chand3040/cloud_that,caesar2164/edx-platform,appsembler/edx-platform,WatanabeYasumasa/edx-platform,dcosentino/edx-platform,DNFcode/edx-platform,benpatterson/edx-platform,doganov/edx-platform,analyseuc3m/ANALYSE-v1,itsjeyd/edx-platform,inares/edx-platform,sudheerchintala/LearnEraPlatForm,mbareta/edx-platform-ft,dkarakats/edx-platform,kmoocdev2/edx-platform,zubair-arbi/edx-platform,utecuy/edx-platform,chudaol/edx-platform,miptliot/edx-platform,Stanford-Online/edx-platform,alu042/edx-platform,louyihua/edx-platform,kursitet/edx-platform,martynovp/edx-platform,lduarte1991/edx-platform,SravanthiSinha/edx-platform,xuxiao19910803/edx,mahendra-r/edx-platform,fintech-circle/edx-platform,marcore/edx-platform,TeachAtTUM/edx-platform,itsjeyd/edx-platform,caesar2164/edx-platform,Stanford-Online/edx-platform,jonathan-beard/edx-platform,shurihell/testasia,nttks/edx-platform,leansoft/edx-platform,ESOedX/edx-platform,teltek/edx-platform,edx-solutions/edx-platform,jamesblunt/edx-platform,jazztpt/edx-platform,MSOpenTech/edx-platform,TeachAtTUM/edx-platform,jbzdak/edx-platform,Ayub-Khan/edx-platform,EDUlib/edx-platform,CourseTalk/edx-platform,cognitiveclass/edx-platform,jzoldak/edx-platform,leansoft/edx-platform,eduNEXT/edx-platform,zubair-arbi/edx-platform,chauhanhardik/populo,mtlchun/edx,solashirai/edx-platform,peterm-itr/edx-platform,MakeHer/edx-platform,zhenzhai/edx-platform,Semi-global/edx-platform,philanthropy-u/edx-platform,mahendra-r/edx-platform,chauhanhardik/populo,eemirtekin/edx-platform,cselis86/edx-platform,longmen21/edx-platform,alexthered/kienhoc-platform,msegado/edx-platform,jbassen/edx-platform,teltek/edx-platform,vikas1885/test1,arbrandes/edx-platform,edry/edx-platform,shashank971/edx-platform,Edraak/circleci-edx-platform,mtlchun/edx,jamiefolsom/edx-platform,lduarte1991/edx-platform,JCBarahona/edX,sameetb-cuelogic/edx-platform-test,Shrhawk/edx-platform,proversity-org/edx-platform,SivilTaram/edx-platform,hamzehd/edx-platform,xuxiao19910803/edx-platform,ahmadio/edx-platform,wwj718/ANALYSE,dsajkl/123,TsinghuaX/edx-platform,carsongee/edx-platform,wwj718/edx-platform,yokose-ks/edx-platform,Livit/Livit.Learn.EdX,kursitet/edx-platform,jswope00/GAI,deepsrijit1105/edx-platform,fintech-circle/edx-platform,B-MOOC/edx-platform,sameetb-cuelogic/edx-platform-test,Edraak/edraak-platform,zadgroup/edx-platform,jelugbo/tundex,jswope00/GAI,pomegranited/edx-platform,dcosentino/edx-platform,jzoldak/edx-platform,torchingloom/edx-platform,Shrhawk/edx-platform,zofuthan/edx-platform,synergeticsedx/deployment-wipro,doganov/edx-platform,chrisndodge/edx-platform,angelapper/edx-platform,pomegranited/edx-platform,Unow/edx-platform,jolyonb/edx-platform,benpatterson/edx-platform,dkarakats/edx-platform,iivic/BoiseStateX,ahmadiga/min_edx,dsajkl/reqiop,appsembler/edx-platform,MSOpenTech/edx-platform,jamesblunt/edx-platform,bitifirefly/edx-platform,adoosii/edx-platform,polimediaupv/edx-platform,waheedahmed/edx-platform,AkA84/edx-platform,motion2015/a3,hkawasaki/kawasaki-aio8-2,abdoosh00/edraak,mtlchun/edx,Semi-global/edx-platform,kmoocdev/edx-platform,vikas1885/test1,Endika/edx-platform,Kalyzee/edx-platform,LICEF/edx-platform,peterm-itr/edx-platform,teltek/edx-platform,xingyepei/edx-platform,xinjiguaike/edx-platform,Softmotions/edx-platform,jazkarta/edx-platform-for-isc,TsinghuaX/edx-platform,carsongee/edx-platform,unicri/edx-platform,beni55/edx-platform,chauhanhardik/populo_2,Ayub-Khan/edx-platform,hmcmooc/muddx-platform,naresh21/synergetics-edx-platform,alexthered/kienhoc-platform,jbassen/edx-platform,xinjiguaike/edx-platform,ubc/edx-platform,cognitiveclass/edx-platform,nttks/jenkins-test,nagyistoce/edx-platform,amir-qayyum-khan/edx-platform,fintech-circle/edx-platform,appliedx/edx-platform,kursitet/edx-platform,etzhou/edx-platform,chrisndodge/edx-platform,halvertoluke/edx-platform,zadgroup/edx-platform,nanolearning/edx-platform,abdoosh00/edraak,mbareta/edx-platform-ft,naresh21/synergetics-edx-platform,IONISx/edx-platform,simbs/edx-platform,openfun/edx-platform,ahmadio/edx-platform,jruiperezv/ANALYSE,zofuthan/edx-platform,openfun/edx-platform,SravanthiSinha/edx-platform,olexiim/edx-platform,jamesblunt/edx-platform,nttks/jenkins-test,atsolakid/edx-platform,defance/edx-platform,BehavioralInsightsTeam/edx-platform,mjirayu/sit_academy,Softmotions/edx-platform,dsajkl/reqiop,martynovp/edx-platform,rismalrv/edx-platform,caesar2164/edx-platform,chauhanhardik/populo_2,hamzehd/edx-platform,ahmadio/edx-platform,edry/edx-platform,JCBarahona/edX,simbs/edx-platform,xuxiao19910803/edx,abdoosh00/edx-rtl-final,Ayub-Khan/edx-platform,jswope00/griffinx,cyanna/edx-platform,rismalrv/edx-platform,bdero/edx-platform,shubhdev/edxOnBaadal,jzoldak/edx-platform,SravanthiSinha/edx-platform,philanthropy-u/edx-platform,bitifirefly/edx-platform,pabloborrego93/edx-platform,appliedx/edx-platform,ak2703/edx-platform,playm2mboy/edx-platform,DefyVentures/edx-platform,edry/edx-platform,Shrhawk/edx-platform,nttks/jenkins-test,zerobatu/edx-platform,Edraak/edx-platform,jazkarta/edx-platform,xuxiao19910803/edx-platform,simbs/edx-platform,andyzsf/edx,IndonesiaX/edx-platform,cecep-edu/edx-platform,jruiperezv/ANALYSE,rismalrv/edx-platform,mjg2203/edx-platform-seas,ferabra/edx-platform,antonve/s4-project-mooc,shurihell/testasia,knehez/edx-platform,rue89-tech/edx-platform,BehavioralInsightsTeam/edx-platform,motion2015/a3,ahmedaljazzar/edx-platform,jamiefolsom/edx-platform,RPI-OPENEDX/edx-platform,Edraak/circleci-edx-platform,shabab12/edx-platform,OmarIthawi/edx-platform,doismellburning/edx-platform,miptliot/edx-platform,kxliugang/edx-platform,dsajkl/123,jazkarta/edx-platform,shashank971/edx-platform,vasyarv/edx-platform,torchingloom/edx-platform,franosincic/edx-platform,a-parhom/edx-platform,romain-li/edx-platform,10clouds/edx-platform,zubair-arbi/edx-platform,B-MOOC/edx-platform,beacloudgenius/edx-platform,OmarIthawi/edx-platform,nanolearningllc/edx-platform-cypress-2,kamalx/edx-platform,jonathan-beard/edx-platform,LICEF/edx-platform,ampax/edx-platform,jazztpt/edx-platform,Stanford-Online/edx-platform,CourseTalk/edx-platform,rhndg/openedx,ahmadio/edx-platform,nttks/jenkins-test,eduNEXT/edunext-platform,dcosentino/edx-platform,LICEF/edx-platform,xuxiao19910803/edx-platform,eestay/edx-platform,shubhdev/edx-platform,Softmotions/edx-platform,arbrandes/edx-platform,solashirai/edx-platform,TeachAtTUM/edx-platform,jazztpt/edx-platform,cpennington/edx-platform,jbzdak/edx-platform,MakeHer/edx-platform,knehez/edx-platform,tiagochiavericosta/edx-platform,JioEducation/edx-platform,OmarIthawi/edx-platform,RPI-OPENEDX/edx-platform,nanolearningllc/edx-platform-cypress-2,antonve/s4-project-mooc,a-parhom/edx-platform,kmoocdev/edx-platform,SivilTaram/edx-platform,BehavioralInsightsTeam/edx-platform,simbs/edx-platform,ampax/edx-platform,etzhou/edx-platform,jolyonb/edx-platform,bitifirefly/edx-platform,angelapper/edx-platform,hkawasaki/kawasaki-aio8-1,Edraak/edraak-platform,jbassen/edx-platform,vismartltd/edx-platform,benpatterson/edx-platform,DefyVentures/edx-platform,motion2015/edx-platform,zerobatu/edx-platform,mushtaqak/edx-platform,msegado/edx-platform,louyihua/edx-platform,solashirai/edx-platform,ubc/edx-platform,valtech-mooc/edx-platform,valtech-mooc/edx-platform,gsehub/edx-platform,sudheerchintala/LearnEraPlatForm,rue89-tech/edx-platform,jswope00/griffinx | ---
+++
@@ -1,15 +1,13 @@
/////////////////////////////////////////////////////////////////////////////
//
-// Simple image input
+// Simple image input
//
////////////////////////////////////////////////////////////////////////////////
// click on image, return coordinates
// put a dot at location of click, on imag
-// window.image_input_click = function(id,event){
-
-function image_input_click(id,event){
+window.image_input_click = function(id,event){
iidiv = document.getElementById("imageinput_"+id);
pos_x = event.offsetX?(event.offsetX):event.pageX-iidiv.offsetLeft;
pos_y = event.offsetY?(event.offsetY):event.pageY-iidiv.offsetTop;
@@ -21,4 +19,4 @@
document.getElementById("cross_"+id).style.top = cy;
document.getElementById("cross_"+id).style.visibility = "visible" ;
document.getElementById("input_"+id).value =result;
-}
+}; |
98b618c24161bbcefefdcce0680bbbd2ad7e8237 | src/main/web/app/app.js | src/main/web/app/app.js | import Ui from "./Ui";
import Generator from "./Generator";
Ui.initializeDefaults();
$.getJSON("/features.json").done(displayFeatures);
$.getJSON("/formats.json").done(displayFormats);
function displayFeatures(features) {
features.forEach(function (feature) {
var checkbox = createFeatureCheckbox(feature);
var container = $("<div>").addClass("item").append(checkbox);
container.appendTo("#feature-list");
});
}
function createFeatureCheckbox(feature) {
let id = feature.token + "-feature";
let container = $("<div>").data(feature).addClass("ui checkbox");
$("<input type='checkbox' id='" + id + "'>").appendTo(container);
$("<label>").attr("for", id).text(feature.name).appendTo(container);
return container;
}
function displayFormats(formats) {
formats.forEach(function (format) {
let option = $("<div class='item' data-value='" + format.extension + "'>");
option.data(format).text(format.name);
option.appendTo("#format-list");
});
Ui.initializeFormats(formats.find(format => format.default));
}
| import Ui from "./Ui";
import Generator from "./Generator";
Ui.initializeDefaults();
$.getJSON("/features.json").done(displayFeatures);
$.getJSON("/formats.json").done(displayFormats);
function displayFeatures(features) {
features.forEach(function (feature) {
var checkbox = createFeatureCheckbox(feature);
var container = $("<div>").addClass("item").append(checkbox);
container.appendTo("#feature-list");
});
}
function createFeatureCheckbox(feature) {
let id = feature.token + "-feature";
let container = $("<div>").data(feature).addClass("ui checkbox");
$("<input type='checkbox' id='" + id + "'>").appendTo(container);
$("<label>").attr("for", id).text(feature.name).appendTo(container);
return container;
}
function displayFormats(formats) {
formats.forEach(function (format) {
let option = $("<div class='item' data-value='" + format.extension + "'>");
option.data(format).text(format.name);
option.appendTo("#format-list");
});
formats.some(value => {
if (value.default) {
Ui.initializeFormats(value);
return true;
}
});
}
| Use .some instead of ES6 .find | Use .some instead of ES6 .find
| JavaScript | mit | VisualDataWeb/OntoBench,VisualDataWeb/OntoBench,VisualDataWeb/OntoBench | ---
+++
@@ -30,5 +30,10 @@
option.appendTo("#format-list");
});
- Ui.initializeFormats(formats.find(format => format.default));
+ formats.some(value => {
+ if (value.default) {
+ Ui.initializeFormats(value);
+ return true;
+ }
+ });
} |
3199b01803f0b1b0f19367f40f627e6e795c5c0e | routes/index.js | routes/index.js | 'use strict'
const express = require ('express')
const api = express.Router()
const UserController = require ('../Controllers/UserController')
const MatchController = require ('../Controllers/MatchController')
const GunsController = require ('../Controllers/GunController')
const DisparoController = require ('../Controllers/DisparoController')
//DEFINED ROUTES TO API METHODS
//rutina de usuarios
api.get('/getUsers', UserController.getUsers)
api.get('/getUser', UserController.getUser)
api.post('/createUser', UserController.createUser)
//rutina de partida
api.get('/getMatchs', MatchController.getMatchs)
api.get('/getMatch', MatchController.getMatch)
api.post('/createMatch', MatchController.createMatch)
//rutina de pistolas
api.get('/getGuns', GunsController.getGuns)
//rutina de disparos
api.get('/getDisparo', DisparoController.getDisparo)
module.exports = api
| 'use strict'
const express = require ('express')
const api = express.Router()
const UserController = require ('../Controllers/UserController')
const MatchController = require ('../Controllers/MatchController')
const GunsController = require ('../Controllers/GunController')
const DisparoController = require ('../Controllers/DisparoController')
//DEFINED ROUTES TO API METHODS
//rutina de usuarios
api.get('/getUsers', UserController.getUsers)
api.get('/getUser', UserController.getUser)
api.post('/createUser', UserController.createUser)
//rutina de partida
api.get('/getMatchs', MatchController.getMatchs)
api.get('/getMatch', MatchController.getMatch)
api.post('/createMatch', MatchController.createMatch)
//rutina de pistolas
api.get('/getGuns', GunsController.getGuns)
api.get('/getGun', GunsController.getGun)
api.post('/createGun', GunsController.createGun)
//rutina de disparos
api.get('/getDisparo', DisparoController.getDisparo)
api.get('/getOneDisparo', DisparoController.getOneDisparo)
api.post('/createDisparo', DisparoController.createDisparo)
module.exports = api
| Index con todas las rutinas | Index con todas las rutinas
| JavaScript | mit | javigines/LaserTagBackend | ---
+++
@@ -23,8 +23,12 @@
//rutina de pistolas
api.get('/getGuns', GunsController.getGuns)
+api.get('/getGun', GunsController.getGun)
+api.post('/createGun', GunsController.createGun)
//rutina de disparos
api.get('/getDisparo', DisparoController.getDisparo)
+api.get('/getOneDisparo', DisparoController.getOneDisparo)
+api.post('/createDisparo', DisparoController.createDisparo)
module.exports = api |
493616dcacbbf5d05ee3a6454e27cf111fe90192 | vendor/ember-resolver/legacy-shims.js | vendor/ember-resolver/legacy-shims.js | /* globals define */
function createDeprecatedModule(moduleId) {
define(moduleId, ['exports', 'ember-resolver/resolver', 'ember'], function(exports, Resolver, Ember) {
Ember['default'].deprecate(
'Usage of `' + moduleId + '` module is deprecated, please update to `ember-resolver`.',
false,
{ id: 'ember-resolver.legacy-shims', until: '3.0.0' }
);
exports['default'] = Resolver['default'];
});
}
createDeprecatedModule('ember/resolver');
createDeprecatedModule('resolver');
| /* globals define */
function createDeprecatedModule(moduleId) {
define(moduleId, ['exports', 'dangerously-set-unified-resolver/resolver', 'ember'], function(exports, Resolver, Ember) {
Ember['default'].deprecate(
'Usage of `' + moduleId + '` module is deprecated, please update to `ember-resolver`.',
false,
{ id: 'ember-resolver.legacy-shims', until: '3.0.0' }
);
exports['default'] = Resolver['default'];
});
}
createDeprecatedModule('ember/resolver');
createDeprecatedModule('resolver');
| Add proper lookup for new name to shims | Add proper lookup for new name to shims
| JavaScript | mit | 201-created/dangerously-set-unified-resolver,201-created/dangerously-set-unified-resolver | ---
+++
@@ -1,7 +1,7 @@
/* globals define */
function createDeprecatedModule(moduleId) {
- define(moduleId, ['exports', 'ember-resolver/resolver', 'ember'], function(exports, Resolver, Ember) {
+ define(moduleId, ['exports', 'dangerously-set-unified-resolver/resolver', 'ember'], function(exports, Resolver, Ember) {
Ember['default'].deprecate(
'Usage of `' + moduleId + '` module is deprecated, please update to `ember-resolver`.',
false, |
9387ea6745e1d16fb9db4bde8ea3907775ac1ca1 | src/websocket-client.js | src/websocket-client.js | /**
* @module src/websocket-client
*/
'use strict'
const Base = require('./base')
const payload = 'a'.repeat(process.env.PB_PAYLOAD_BYTES) // ~1kb payload
var count = 0
const limit = 5000
var start
class WebsocketClient extends Base {
constructor () {
super()
this._initWebsocketClient()
start = new Date()
this._sendMessage()
}
_sendMessage () {
this._ws.emit('message', {
payload: payload
}, (responseData) => {
console.log('Response from server #', count)
count++
if (count < limit) {
this._sendMessage()
} else {
let totalTime = new Date() - start
console.log('total time', totalTime)
console.log('average RTT', totalTime / limit)
}
})
}
}
new WebsocketClient()
| /**
* @module src/websocket-client
*/
'use strict'
const Base = require('./base')
const payload = 'a'.repeat(process.env.PB_PAYLOAD_BYTES) // ~1kb payload
var count = 0
const limit = 5000
var start
class WebsocketClient extends Base {
constructor () {
super()
this._initWebsocketClient()
this._ws.on('connect', () => {
start = new Date()
console.log('connect')
this._sendMessage()
})
}
_sendMessage () {
this._ws.emit('message', {
payload: payload
}, (responseData) => {
console.log('Response from server #', count)
count++
if (count < limit) {
this._sendMessage()
} else {
let totalTime = new Date() - start
console.log('total time', totalTime)
console.log('average RTT', totalTime / limit)
}
})
}
}
new WebsocketClient()
| Set start time after socket client connect event fires | Set start time after socket client connect event fires
| JavaScript | mit | cflynn07/http-websockets-rabbitmq-perf-battle | ---
+++
@@ -16,8 +16,11 @@
constructor () {
super()
this._initWebsocketClient()
- start = new Date()
- this._sendMessage()
+ this._ws.on('connect', () => {
+ start = new Date()
+ console.log('connect')
+ this._sendMessage()
+ })
}
_sendMessage () { |
bf891428f6312e500fbcf4387a5ddcd2f71c367e | addons/Dexie.Syncable/src/apply-changes.js | addons/Dexie.Syncable/src/apply-changes.js | import { CREATE, DELETE, UPDATE } from './change_types';
import bulkUpdate from './bulk-update';
export default function initApplyChanges(db) {
return function applyChanges(changes, offset) {
const length = changes.length;
if (offset >= length) return Promise.resolve(null);
const firstChange = changes[offset];
let i, change;
for (i=offset + 1; i < length; ++i) {
change = changes[i];
if (change.type !== firstChange.type ||
change.table !== firstChange.table)
break;
}
const table = db.table(firstChange.table);
const specifyKeys = !table.schema.primKey.keyPath;
const changesToApply = changes.slice(offset, i);
const changeType = firstChange.type;
const bulkPromise =
changeType === CREATE ?
table.bulkPut(changesToApply.map(c => c.obj), specifyKeys ?
changesToApply.map(c => c.key) : undefined) :
changeType === UPDATE ?
bulkUpdate(table, changesToApply) :
changeType === DELETE ?
table.bulkDelete(changesToApply.map(c => c.key)) :
Promise.resolve(null);
return bulkPromise.then(()=>applyChanges(changes, i));
};
}
| import Dexie from 'dexie';
import { CREATE, DELETE, UPDATE } from './change_types';
import bulkUpdate from './bulk-update';
export default function initApplyChanges(db) {
return function applyChanges(changes, offset) {
const length = changes.length;
if (offset >= length) return Dexie.Promise.resolve(null);
const firstChange = changes[offset];
let i, change;
for (i=offset + 1; i < length; ++i) {
change = changes[i];
if (change.type !== firstChange.type ||
change.table !== firstChange.table)
break;
}
const table = db.table(firstChange.table);
const specifyKeys = !table.schema.primKey.keyPath;
const changesToApply = changes.slice(offset, i);
const changeType = firstChange.type;
const bulkPromise =
changeType === CREATE ?
table.bulkPut(changesToApply.map(c => c.obj), specifyKeys ?
changesToApply.map(c => c.key) : undefined) :
changeType === UPDATE ?
bulkUpdate(table, changesToApply) :
changeType === DELETE ?
table.bulkDelete(changesToApply.map(c => c.key)) :
Dexie.Promise.resolve(null);
return bulkPromise.then(()=>applyChanges(changes, i));
};
}
| Use Dexie.Promise not the global Promise | Use Dexie.Promise not the global Promise
| JavaScript | apache-2.0 | chrahunt/Dexie.js,jimmywarting/Dexie.js,dfahlander/Dexie.js,dfahlander/Dexie.js,dfahlander/Dexie.js,chrahunt/Dexie.js,jimmywarting/Dexie.js,jimmywarting/Dexie.js,dfahlander/Dexie.js,jimmywarting/Dexie.js,chrahunt/Dexie.js,chrahunt/Dexie.js | ---
+++
@@ -1,10 +1,11 @@
+import Dexie from 'dexie';
import { CREATE, DELETE, UPDATE } from './change_types';
import bulkUpdate from './bulk-update';
export default function initApplyChanges(db) {
return function applyChanges(changes, offset) {
const length = changes.length;
- if (offset >= length) return Promise.resolve(null);
+ if (offset >= length) return Dexie.Promise.resolve(null);
const firstChange = changes[offset];
let i, change;
for (i=offset + 1; i < length; ++i) {
@@ -25,7 +26,7 @@
bulkUpdate(table, changesToApply) :
changeType === DELETE ?
table.bulkDelete(changesToApply.map(c => c.key)) :
- Promise.resolve(null);
+ Dexie.Promise.resolve(null);
return bulkPromise.then(()=>applyChanges(changes, i));
}; |
e8c42800fa8045523beada8346684fa7f9beb252 | client/js/mini-app/components/footer.js | client/js/mini-app/components/footer.js | import React from 'react'
import { Link } from 'react-router-dom'
import injectSheet from 'react-jss'
import Spacer from '../../components/spacer'
const MiniAppFooter = ({ classes }) => {
return (
<div>
<Spacer height="100px" />
<div className={classes.footerRoot}>
<Link to="/about" className={classes.navigationLink}>
About
</Link>
<Link to="/feedback" className={classes.navigationLink}>
Feedback
</Link>
<div className={classes.copyrightText}>© Help Assist Her 2018</div>
</div>
</div>
)
}
const styles = {
footerRoot: {
height: '188px',
'background-color': '#3d65f9',
},
navigationLink: {
'font-family': 'sans-serif',
'font-size': '18px',
color: '#ffffff',
'text-decoration': 'none',
},
copyrightText: {
'font-family': 'sans-serif',
'font-size': '14px',
color: '#ffffff',
},
}
export default injectSheet(styles)(MiniAppFooter)
| import React from 'react'
import { Link } from 'react-router-dom'
import injectSheet from 'react-jss'
import Spacer from '../../components/spacer'
import LogoBetaWhite from '../../components/icons/icon-components/logo-beta-white'
const MiniAppFooter = ({ classes }) => {
return (
<div>
<Spacer height="100px" />
<div className={classes.footerRoot}>
<LogoBetaWhite height={25} width={160} />
<Link to="/about" className={classes.navigationLink}>
About
</Link>
<Link to="/feedback" className={classes.navigationLink}>
Feedback
</Link>
<div className={classes.copyrightText}>© Help Assist Her 2018</div>
</div>
</div>
)
}
const styles = {
footerRoot: {
height: '149px',
'background-color': '#3D65F9',
},
navigationLink: {
'font-family': 'hah-regular',
'font-size': '18px',
color: '#FFFFFF',
'text-decoration': 'none',
},
copyrightText: {
'font-family': 'hah-regular',
'font-size': '10px',
color: '#ABD3F9',
},
}
export default injectSheet(styles)(MiniAppFooter)
| Add logo and fix styling | Add logo and fix styling
| JavaScript | mit | HelpAssistHer/help-assist-her,HelpAssistHer/help-assist-her,HelpAssistHer/help-assist-her,HelpAssistHer/help-assist-her | ---
+++
@@ -3,12 +3,14 @@
import injectSheet from 'react-jss'
import Spacer from '../../components/spacer'
+import LogoBetaWhite from '../../components/icons/icon-components/logo-beta-white'
const MiniAppFooter = ({ classes }) => {
return (
<div>
<Spacer height="100px" />
<div className={classes.footerRoot}>
+ <LogoBetaWhite height={25} width={160} />
<Link to="/about" className={classes.navigationLink}>
About
</Link>
@@ -23,19 +25,19 @@
const styles = {
footerRoot: {
- height: '188px',
- 'background-color': '#3d65f9',
+ height: '149px',
+ 'background-color': '#3D65F9',
},
navigationLink: {
- 'font-family': 'sans-serif',
+ 'font-family': 'hah-regular',
'font-size': '18px',
- color: '#ffffff',
+ color: '#FFFFFF',
'text-decoration': 'none',
},
copyrightText: {
- 'font-family': 'sans-serif',
- 'font-size': '14px',
- color: '#ffffff',
+ 'font-family': 'hah-regular',
+ 'font-size': '10px',
+ color: '#ABD3F9',
},
}
|
fe58f040f946b86e91cc1028e7b0c3b537c35a41 | Resources/public/openlayers.extension.js | Resources/public/openlayers.extension.js | (function () {
"use strict";
$(document).ready(function () {
OpenLayers.Feature.prototype.equals = function (feature) {
return this.fid === feature.fid;
};
OpenLayers.Feature.prototype.isNew = false;
OpenLayers.Feature.prototype.isChanged = false;
OpenLayers.Feature.prototype.isCopy = false;
OpenLayers.Feature.prototype.disabled = false;
OpenLayers.Feature.prototype.visible = true;
OpenLayers.Feature.prototype.cluster = false;
OpenLayers.Feature.prototype.getClusterSize = function () {
return this.cluster ? this.cluster.length : null;
};
OpenLayers.Feature.prototype.setRenderIntent = function () {
var feature = this;
feature.renderIntent = "default";
if (feature.isChanged || feature.isNew) {
feature.renderIntent = 'unsaved';
}
if (feature.isCopy) {
feature.renderIntent = 'copy';
}
if (!feature.visible) {
feature.renderIntent = 'invisible';
}
}
});
})(); | (function () {
"use strict";
$(document).ready(function () {
OpenLayers.Feature.prototype.equals = function (feature) {
return this.fid === feature.fid;
};
OpenLayers.Feature.prototype.isNew = false;
OpenLayers.Feature.prototype.isChanged = false;
OpenLayers.Feature.prototype.isCopy = false;
OpenLayers.Feature.prototype.disabled = false;
OpenLayers.Feature.prototype.visible = true;
OpenLayers.Feature.prototype.cluster = false;
OpenLayers.Feature.prototype.getClusterSize = function () {
return this.cluster ? this.cluster.length : null;
};
OpenLayers.Feature.prototype.setRenderIntent = function () {
var feature = this;
feature.renderIntent = "default";
if (feature.isChanged || feature.isNew) {
feature.renderIntent = 'unsaved';
}
if (feature.isCopy) {
feature.renderIntent = 'copy';
}
if (!feature.visible) {
feature.renderIntent = 'invisible';
feature.deactivatedStyle = feature.style;
feature.style = null;
} else {
feature.style = feature.deactivatedStyle;
}
}
});
})(); | Allow setting invisible for styled features | Allow setting invisible for styled features
| JavaScript | mit | mapbender/mapbender-digitizer,mapbender/mapbender-digitizer | ---
+++
@@ -32,7 +32,13 @@
if (!feature.visible) {
feature.renderIntent = 'invisible';
+ feature.deactivatedStyle = feature.style;
+ feature.style = null;
+ } else {
+ feature.style = feature.deactivatedStyle;
}
+
+
} |
d43f28c3782a5546f89b031d7ef7d9171fd000b1 | src/App.js | src/App.js | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="App-header">
<h1>A12 Map</h1>
</div>
<p className="App-intro">
<div>
</div>
</p>
</div>
);
}
}
export default App;
| import React, { Component } from 'react';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="App-header">
<h1>A12 Map</h1>
</div>
<p className="App-intro">
<div>
</div>
</p>
</div>
);
}
}
export default App;
| Remove import - test commit | Remove import - test commit
| JavaScript | isc | a12map/a12-map,a12map/a12-map | ---
+++
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
-import logo from './logo.svg';
import './App.css';
class App extends Component { |
3cb6ac2df454c2c7235972aad437f38473129d00 | client/app/serializers/cabin.js | client/app/serializers/cabin.js | import DS from 'ember-data';
import ApplicationSerializer from '../serializers/application';
export default ApplicationSerializer.extend({
normalize: function (modelClass, resourceHash, prop) {
var normalizedHash = resourceHash;
var normalizedFasiliteter = [];
// Maps `fasiliteter` object to an array of objects with the key as `type` and value as `kommentar`
if (resourceHash.fasiliteter) {
for (var key in resourceHash.fasiliteter) {
normalizedFasiliteter.push({type: key, kommentar: resourceHash.fasiliteter[key]});
}
normalizedHash.fasiliteter = normalizedFasiliteter;
}
return this._super(modelClass, normalizedHash, prop);
},
serialize: function(snapshot, options) {
var json = this._super(snapshot, options);
// Maps `fasiliteter` array back to object
var serializedFasiliteter = {};
for (var i = 0; i < json.fasiliteter.length; i++) {
serializedFasiliteter[json.fasiliteter[i]['type']] = json.fasiliteter[i]['kommentar'] || '';
}
json.fasiliteter = serializedFasiliteter;
return json;
}
});
| import DS from 'ember-data';
import ApplicationSerializer from '../serializers/application';
export default ApplicationSerializer.extend({
normalize: function (modelClass, resourceHash, prop) {
var normalizedHash = resourceHash;
var normalizedFasiliteter = [];
// Maps `fasiliteter` object to an array of objects with the key as `type` and value as `kommentar`
if (resourceHash.fasiliteter) {
for (var key in resourceHash.fasiliteter) {
normalizedFasiliteter.push({type: key, kommentar: resourceHash.fasiliteter[key]});
}
normalizedHash.fasiliteter = normalizedFasiliteter;
}
return this._super(modelClass, normalizedHash, prop);
},
serialize: function(snapshot, options) {
var json = this._super(snapshot, options);
// Maps `fasiliteter` array back to object
if (json.fasiliteter && json.fasiliteter.length) {
var serializedFasiliteter = {};
for (var i = 0; i < json.fasiliteter.length; i++) {
serializedFasiliteter[json.fasiliteter[i]['type']] = json.fasiliteter[i]['kommentar'] || '';
}
json.fasiliteter = serializedFasiliteter;
}
return json;
}
});
| Fix bug occuring if fasiliteter is empty or does not exist | Fix bug occuring if fasiliteter is empty or does not exist
| JavaScript | mit | Turistforeningen/Hytteadmin,Turistforeningen/Hytteadmin | ---
+++
@@ -22,11 +22,14 @@
var json = this._super(snapshot, options);
// Maps `fasiliteter` array back to object
- var serializedFasiliteter = {};
- for (var i = 0; i < json.fasiliteter.length; i++) {
- serializedFasiliteter[json.fasiliteter[i]['type']] = json.fasiliteter[i]['kommentar'] || '';
+ if (json.fasiliteter && json.fasiliteter.length) {
+ var serializedFasiliteter = {};
+ for (var i = 0; i < json.fasiliteter.length; i++) {
+ serializedFasiliteter[json.fasiliteter[i]['type']] = json.fasiliteter[i]['kommentar'] || '';
+ }
+ json.fasiliteter = serializedFasiliteter;
}
- json.fasiliteter = serializedFasiliteter;
+
return json;
}
|
620fd80afaaa89475ae9f4061cbd2071446c65d2 | webpack.config.dev.js | webpack.config.dev.js | var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'eventsource-polyfill', // necessary for hot reloading with IE
'webpack-hot-middleware/client',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
}]
}
};
| var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'eventsource-polyfill', // necessary for hot reloading with IE
'webpack-hot-middleware/client',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [{
test: /\.jsx?/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
}]
}
};
| Allow JSX files to be included | Allow JSX files to be included
| JavaScript | cc0-1.0 | briandixn/react_fork,mtomcal/react-transform-boilerplate,babizhu/you-you,l2silver/react-redux-rest,JakeElder/m-s,rtablada/react-router-redux-boilerplate,osener/redux-purescript-example,leiming/pcgame-react-boilerplate,MarshalW/news-demo,JakeElder/m-s,mtomcal/react-transform-boilerplate,Neil-G/InspectionLog,gbezyuk/redux-sandbox,rtablada/standups-react,alanrsoares/cthulhu-rising,rwhitmire/react-typescript-boilerplate,rtablada/react-router-redux-boilerplate,markmiro/ui-experiments,ekatebi/ReactSandBox,dminkovsky/relay-boilerplate,Mosho1/tr-alloc-chart,alanrsoares/cthulhu-rising,laere/diversion-2,laere/grocery-app,rtablada/standups-react,leiming/pcgame-react-boilerplate,laere/grocery-app,amitayh/react-redux-test,gaearon/react-transform-boilerplate,rwhitmire/react-typescript-boilerplate,fc-io/mtg_draft_seatings_generator,preciz/webpack-react-demo,gbezyuk/redux-sandbox,arve0/react-transform-boilerplate,kidylee/Front-end-boilerplate,fc-io/mtg_draft_seatings_generator,breath103/watchmen,laere/scape,rwhitmire/react-typescript-boilerplate,MarshalW/news-demo,osener/redux-purescript-example,markmiro/ui-experiments,laere/scape,kidylee/Front-end-boilerplate,dminkovsky/relay-boilerplate,laere/diversion-2,umgauper/USDA-UX-Challenge,ekatebi/ReactSandBox,mukeshsoni/react-file-explorer,preciz/webpack-react-demo,Mosho1/tr-alloc-chart,breath103/watchmen,umgauper/USDA-UX-Challenge,gaearon/react-transform-boilerplate,Neil-G/InspectionLog,l2silver/react-redux-rest,briandixn/react_fork,arve0/react-transform-boilerplate,babizhu/you-you,amitayh/react-redux-test,mukeshsoni/react-file-explorer | ---
+++
@@ -19,7 +19,7 @@
],
module: {
loaders: [{
- test: /\.js$/,
+ test: /\.jsx?/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
}] |
15d5a67d65900272a117daea97e853355d72169d | squanch.js | squanch.js | const squanch = (...patterns) => {
return v => {
const primitives = ['Number', 'String', 'Boolean', 'Symbol'];
const isIdentical = (p, v) => p === v;
const isNull = (p, v) => isIdentical(null, p) && isIdentical(p, v);
const isUndefined = (p, v) => isIdentical(undefined, p) && isIdentical(p, v);
const isPrimitiveWithValue = (primitives, type, value) => {
return (value !== null && value !== undefined)
&& primitives.includes(type.name)
&& {}.valueOf.call(value) instanceof type;
};
const callalbeTruthy = (p, v) => {
if (p instanceof Function && ! primitives.includes(p.name)) {
return p.call(null, v);
}
};
for (let sequence of patterns) {
let [pattern, fn] = sequence;
switch(true) {
case (isNull(pattern, v)) :
case (isUndefined(pattern, v)) :
case (isIdentical(pattern, v)) :
case (isPrimitiveWithValue(primitives, pattern, v)) :
case (callalbeTruthy(pattern, v)) :
return fn.call(null, v);
break;
}
}
return 'No patterns matched';
};
};
export default squanch; | const squanch = (...patterns) => {
return v => {
const primitives = ['Number', 'String', 'Boolean', 'Symbol'];
const isIdentical = (p, v) => p === v;
const isNull = (p, v) => isIdentical(null, p) && isIdentical(p, v);
const isUndefined = (p, v) => isIdentical(undefined, p) && isIdentical(p, v);
const isPrimitiveWithValue = (primitives, type, value) => {
return (value !== null && value !== undefined)
&& primitives.includes(type.name)
&& {}.valueOf.call(value) instanceof type;
};
const callalbeTruthy = (p, v) => {
if (p instanceof Function && ! primitives.includes(p.name)) {
return p.call(null, v);
}
};
for (let sequence of patterns) {
let [pattern, fn] = sequence;
switch(true) {
case (isUndefined(pattern, v)) :
case (isNull(pattern, v)) :
case (isIdentical(pattern, v)) :
case (isPrimitiveWithValue(primitives, pattern, v)) :
case (callalbeTruthy(pattern, v)) :
return fn.call(null, v);
break;
}
}
return 'No patterns matched';
};
};
export default squanch; | Check if type is undefined first | Check if type is undefined first
| JavaScript | mit | magbicaleman/squanch | ---
+++
@@ -19,8 +19,8 @@
for (let sequence of patterns) {
let [pattern, fn] = sequence;
switch(true) {
+ case (isUndefined(pattern, v)) :
case (isNull(pattern, v)) :
- case (isUndefined(pattern, v)) :
case (isIdentical(pattern, v)) :
case (isPrimitiveWithValue(primitives, pattern, v)) :
case (callalbeTruthy(pattern, v)) : |
4f7626d98595cdabb90022879429f6e0fdcce9b2 | examples/jquery/http-request.js | examples/jquery/http-request.js | /*global $:true */
// jQuery built with "grunt custom:-ajax/script,-ajax/jsonp,-css,-deprecated,-dimensions,-effects,-event,-event/alias,-offset,-wrap,-ready,-deferred,-exports/amd,-sizzle"
// https://github.com/jquery/jquery#how-to-build-your-own-jquery
tabris.load(function() {
var MARGIN = 12;
var lastLabel;
var page = tabris.createPage({
title: "XMLHttpRequest",
topLevel: true
});
var createLabel = function(labelText) {
lastLabel = page.append("Label", {
style: ["WRAP"],
text: labelText,
markupEnabled: true,
layoutData: {left: MARGIN, right: MARGIN, top: [lastLabel, MARGIN]}
});
};
$.getJSON("http://www.telize.com/geoip", function(json) {
createLabel("The IP address is: " + json.ip);
createLabel("Latitude: " + json.latitude);
createLabel("Longitude: " + json.longitude);
});
$.getJSON("https://data.itpir.wm.edu/deflate/api.php?val=100USD1986USA&json=true", function (json) {
createLabel("Value of 1986 100$ today: " + json.deflated_amount + "$");
});
$.getJSON("http://api.automeme.net/text.json", function (json) {
createLabel("Meme: " + json[0]);
});
page.open();
}); | /*global $:true */
// jQuery built with "grunt custom:-ajax/script,-ajax/jsonp,-css,-deprecated,-dimensions,-effects,-event,-event/alias,-offset,-wrap,-ready,-deferred,-exports/amd,-sizzle"
// https://github.com/jquery/jquery#how-to-build-your-own-jquery
tabris.load(function() {
var MARGIN = 12;
var lastLabel;
var page = tabris.create("Page", {
title: "XMLHttpRequest",
topLevel: true
});
var createLabel = function(labelText) {
lastLabel = tabris.create("Label", {
style: ["WRAP"],
text: labelText,
markupEnabled: true,
layoutData: {left: MARGIN, right: MARGIN, top: [lastLabel, MARGIN]}
});
page.append(lastLabel);
};
$.getJSON("http://www.telize.com/geoip", function(json) {
createLabel("The IP address is: " + json.ip);
createLabel("Latitude: " + json.latitude);
createLabel("Longitude: " + json.longitude);
});
$.getJSON("https://data.itpir.wm.edu/deflate/api.php?val=100USD1986USA&json=true", function(json) {
createLabel("Value of 1986 100$ today: " + json.deflated_amount + "$");
});
$.getJSON("http://api.automeme.net/text.json", function(json) {
createLabel("Meme: " + json[0]);
});
page.open();
});
| Integrate recent changes in jquery demo | Integrate recent changes in jquery demo
* Make use of the new append syntax which allows appending of multiple
widgets.
* Change obsolete "createPage" method invokation to "create".
* Format the code.
Change-Id: I67f617ae6a7cfd7896ac899719da3021d6b84744
| JavaScript | bsd-3-clause | mkostikov/tabris-js,softnep0531/tabrisjs,eclipsesource/tabris-js,eclipsesource/tabris-js,eclipsesource/tabris-js,moham3d/tabris-js,softnep0531/tabrisjs,mkostikov/tabris-js,paulvi/tabris-js,pimaxdev/tabris,pimaxdev/tabris,moham3d/tabris-js | ---
+++
@@ -6,18 +6,19 @@
var MARGIN = 12;
var lastLabel;
- var page = tabris.createPage({
+ var page = tabris.create("Page", {
title: "XMLHttpRequest",
topLevel: true
});
var createLabel = function(labelText) {
- lastLabel = page.append("Label", {
+ lastLabel = tabris.create("Label", {
style: ["WRAP"],
text: labelText,
markupEnabled: true,
layoutData: {left: MARGIN, right: MARGIN, top: [lastLabel, MARGIN]}
});
+ page.append(lastLabel);
};
$.getJSON("http://www.telize.com/geoip", function(json) {
@@ -26,11 +27,11 @@
createLabel("Longitude: " + json.longitude);
});
- $.getJSON("https://data.itpir.wm.edu/deflate/api.php?val=100USD1986USA&json=true", function (json) {
+ $.getJSON("https://data.itpir.wm.edu/deflate/api.php?val=100USD1986USA&json=true", function(json) {
createLabel("Value of 1986 100$ today: " + json.deflated_amount + "$");
});
- $.getJSON("http://api.automeme.net/text.json", function (json) {
+ $.getJSON("http://api.automeme.net/text.json", function(json) {
createLabel("Meme: " + json[0]);
});
|
abf33d3feb7a0d488b13b895b7d6b7827bc29b45 | src/peg.js | src/peg.js | /*
* PEG.js @VERSION
*
* http://pegjs.majda.cz/
*
* Copyright (c) 2010-2012 David Majda
* Licensend under the MIT license.
*/
var PEG = (function(undefined) {
var PEG = {
/* PEG.js version. */
VERSION: "@VERSION",
/*
* Generates a parser from a specified grammar and returns it.
*
* The grammar must be a string in the format described by the metagramar in
* the parser.pegjs file.
*
* Throws |PEG.parser.SyntaxError| if the grammar contains a syntax error or
* |PEG.GrammarError| if it contains a semantic error. Note that not all
* errors are detected during the generation and some may protrude to the
* generated parser and cause its malfunction.
*/
buildParser: function(grammar, options) {
return PEG.compiler.compile(PEG.parser.parse(grammar), options);
}
};
/* Thrown when the grammar contains an error. */
PEG.GrammarError = function(message) {
this.name = "PEG.GrammarError";
this.message = message;
};
PEG.GrammarError.prototype = Error.prototype;
// @include "utils.js"
// @include "parser.js"
// @include "compiler.js"
return PEG;
})();
if (typeof module !== "undefined") {
module.exports = PEG;
}
| /*
* PEG.js @VERSION
*
* http://pegjs.majda.cz/
*
* Copyright (c) 2010-2012 David Majda
* Licensend under the MIT license.
*/
var PEG = (function(undefined) {
var PEG = {
/* PEG.js version (uses semantic versioning). */
VERSION: "@VERSION",
/*
* Generates a parser from a specified grammar and returns it.
*
* The grammar must be a string in the format described by the metagramar in
* the parser.pegjs file.
*
* Throws |PEG.parser.SyntaxError| if the grammar contains a syntax error or
* |PEG.GrammarError| if it contains a semantic error. Note that not all
* errors are detected during the generation and some may protrude to the
* generated parser and cause its malfunction.
*/
buildParser: function(grammar, options) {
return PEG.compiler.compile(PEG.parser.parse(grammar), options);
}
};
/* Thrown when the grammar contains an error. */
PEG.GrammarError = function(message) {
this.name = "PEG.GrammarError";
this.message = message;
};
PEG.GrammarError.prototype = Error.prototype;
// @include "utils.js"
// @include "parser.js"
// @include "compiler.js"
return PEG;
})();
if (typeof module !== "undefined") {
module.exports = PEG;
}
| Add a note about semantic versioning to |PEG.VERSION| comment | Add a note about semantic versioning to |PEG.VERSION| comment
| JavaScript | mit | GerHobbelt/pegjs,pegjs/pegjs,crguezl/pegjs,Mingun/pegjs,wwall/pegjs-fn,luisvt/pegjs,mcanthony/pegjs,jlturner/pegjs,Sciumo/pegjs,luisvt/pegjs,pegjs/pegjs,jlturner/pegjs,crguezl/pegjs,GerHobbelt/pegjs,wwall/pegjs-fn,Sciumo/pegjs,mcanthony/pegjs,Mingun/pegjs | ---
+++
@@ -9,7 +9,7 @@
var PEG = (function(undefined) {
var PEG = {
- /* PEG.js version. */
+ /* PEG.js version (uses semantic versioning). */
VERSION: "@VERSION",
/* |
ff163bfb68caf00240a345426be033e86b60da92 | app/users/users.service.js | app/users/users.service.js | {
class UsersService {
create(user) {
console.log('CREATED!');
console.log(user);
}
}
angular.module('meganote.users')
.service('UsersService', UsersService);
}
| {
angular.module('meganote.users')
.service('UsersService', [
'$http',
'API_BASE',
($http, API_BASE) => {
class UsersService {
create(user) {
return $http.post(`${API_BASE}users`, {
user,
})
.then(
res => {
console.log(res.data);
}
);
}
}
return new UsersService();
}
]);
}
| Make a POST request to create a user. | Make a POST request to create a user.
| JavaScript | mit | xternbootcamp16/meganote,xternbootcamp16/meganote | ---
+++
@@ -1,11 +1,24 @@
{
- class UsersService {
- create(user) {
- console.log('CREATED!');
- console.log(user);
- }
- }
+ angular.module('meganote.users')
+ .service('UsersService', [
+ '$http',
+ 'API_BASE',
+ ($http, API_BASE) => {
- angular.module('meganote.users')
- .service('UsersService', UsersService);
+ class UsersService {
+ create(user) {
+ return $http.post(`${API_BASE}users`, {
+ user,
+ })
+ .then(
+ res => {
+ console.log(res.data);
+ }
+ );
+ }
+ }
+ return new UsersService();
+
+ }
+ ]);
} |
049cf58b08c8208ad970aa62665e90af971424df | feature-detects/notification.js | feature-detects/notification.js | /*!
{
"name": "Notifications",
"property": "notification",
"caniuse": "notifications",
"authors": ["Theodoor van Donge"],
"notes": [{
"name": "HTML5 Rocks tutorial",
"href": "http://www.html5rocks.com/en/tutorials/notifications/quick/"
},{
"name": "W3C spec",
"href": "http://dev.w3.org/2006/webapi/WebNotifications/publish/Notifications.html#idl-if-Notification"
}],
"polyfills": ["notificationjs"]
}
!*/
/* DOC
Detects support for the Notifications API, for notifying the user of events regardless of which tab has focus.
*/
define(['Modernizr', 'prefixed'], function( Modernizr, prefixed ) {
Modernizr.addTest('notification', !!prefixed('Notifications', window));
});
| /*!
{
"name": "Notification",
"property": "notification",
"caniuse": "notifications",
"authors": ["Theodoor van Donge", "Hendrik Beskow"],
"notes": [{
"name": "HTML5 Rocks tutorial",
"href": "http://www.html5rocks.com/en/tutorials/notifications/quick/"
},{
"name": "W3C spec",
"href": "www.w3.org/TR/notifications/"
}],
"polyfills": ["desktop-notify"]
}
!*/
/* DOC
Detects support for the Notifications API
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('notification', 'Notification' in window && 'permission' in window.Notification && 'requestPermission' in window.Notification);
});
| Check for useable Notification Api | Check for useable Notification Api | JavaScript | mit | Modernizr/Modernizr,Modernizr/Modernizr | ---
+++
@@ -1,24 +1,24 @@
/*!
{
- "name": "Notifications",
+ "name": "Notification",
"property": "notification",
"caniuse": "notifications",
- "authors": ["Theodoor van Donge"],
+ "authors": ["Theodoor van Donge", "Hendrik Beskow"],
"notes": [{
"name": "HTML5 Rocks tutorial",
"href": "http://www.html5rocks.com/en/tutorials/notifications/quick/"
},{
"name": "W3C spec",
- "href": "http://dev.w3.org/2006/webapi/WebNotifications/publish/Notifications.html#idl-if-Notification"
+ "href": "www.w3.org/TR/notifications/"
}],
- "polyfills": ["notificationjs"]
+ "polyfills": ["desktop-notify"]
}
!*/
/* DOC
-Detects support for the Notifications API, for notifying the user of events regardless of which tab has focus.
+Detects support for the Notifications API
*/
-define(['Modernizr', 'prefixed'], function( Modernizr, prefixed ) {
- Modernizr.addTest('notification', !!prefixed('Notifications', window));
+define(['Modernizr'], function(Modernizr) {
+ Modernizr.addTest('notification', 'Notification' in window && 'permission' in window.Notification && 'requestPermission' in window.Notification);
}); |
38abd989fde3c3cef15042944bddb798e93b8820 | Js/Core/Lib/Core/Page.js | Js/Core/Lib/Core/Page.js | import _ from 'lodash';
class Page {
loadScript(url) {
return new Promise(resolve => {
const s = document.createElement('script');
s.type = 'text/javascript';
s.src = url;
s.async = true;
s.onload = resolve;
document.body.appendChild(s);
});
}
loadStylesheet(url) {
return new Promise(resolve => {
const s = document.createElement('link');
s.rel = 'stylesheet';
s.href = url;
s.onload = resolve;
document.head.appendChild(s);
});
}
setMeta(attributes) {
let updatedExisting = false;
_.each(['name', 'property'], name => {
if (_.has(attributes, name)) {
// Fetch existing element
const element = document.querySelector(`meta[${name}="${attributes[name]}"]`);
if (element) {
// If exists, update with new attributes
_.each(attributes, (value, key) => element.setAttribute(key, value));
updatedExisting = true;
return false;
}
}
});
if (updatedExisting) {
return;
}
// Create new element
const element = document.createElement('meta');
_.each(attributes, (value, key) => element.setAttribute(key, value));
document.head.appendChild(element);
}
setTitle(title) {
document.title = title;
}
}
export default Page; | import _ from 'lodash';
class Page {
loadScript(url) {
return new Promise(resolve => {
// Is it already inserted, possibly with server-side rendering?
if (document.querySelectorAll(`script[src="${url}"]`).length) {
return;
}
const s = document.createElement('script');
s.type = 'text/javascript';
s.src = url;
s.async = true;
s.onload = resolve;
document.body.appendChild(s);
});
}
loadStylesheet(url) {
return new Promise(resolve => {
// Is it already inserted, possibly with server-side rendering?
if (document.querySelectorAll(`link[href="${url}"]`).length) {
return;
}
const s = document.createElement('link');
s.rel = 'stylesheet';
s.href = url;
s.onload = resolve;
document.head.appendChild(s);
});
}
setMeta(attributes) {
let updatedExisting = false;
_.each(['name', 'property'], name => {
if (_.has(attributes, name)) {
// Fetch existing element
const element = document.querySelector(`meta[${name}="${attributes[name]}"]`);
if (element) {
// If exists, update with new attributes
_.each(attributes, (value, key) => element.setAttribute(key, value));
updatedExisting = true;
return false;
}
}
});
if (updatedExisting) {
return;
}
// Create new element
const element = document.createElement('meta');
_.each(attributes, (value, key) => element.setAttribute(key, value));
document.head.appendChild(element);
}
setTitle(title) {
document.title = title;
}
}
export default Page; | Check - don't insert script tags twice. | Check - don't insert script tags twice.
| JavaScript | mit | Webiny/Webiny,Webiny/Webiny,Webiny/Webiny | ---
+++
@@ -3,6 +3,10 @@
class Page {
loadScript(url) {
return new Promise(resolve => {
+ // Is it already inserted, possibly with server-side rendering?
+ if (document.querySelectorAll(`script[src="${url}"]`).length) {
+ return;
+ }
const s = document.createElement('script');
s.type = 'text/javascript';
s.src = url;
@@ -14,6 +18,10 @@
loadStylesheet(url) {
return new Promise(resolve => {
+ // Is it already inserted, possibly with server-side rendering?
+ if (document.querySelectorAll(`link[href="${url}"]`).length) {
+ return;
+ }
const s = document.createElement('link');
s.rel = 'stylesheet';
s.href = url; |
beeaf2f6431f76f58e1488cee7c0f8b64876a8fc | mixmind/static/js/collapse_remember.js | mixmind/static/js/collapse_remember.js | /* Collapse remember
* Use a cookie to "remember" the state of bootstrap collapse divs
* use the 'collapse-remember' class to get this functionality
*/
$(document).ready(function () {
const state_cookie_c = 'collapse-remember';
var page = window.location.pathname;
var state = Cookies.getJSON(state_cookie_c);
if (state === undefined) {
state = {};
Cookies.set(state_cookie_c, state);
}
if (state.hasOwnProperty(page)) {
Object.keys(state[page]).forEach(function (collapse_id) {
if (state[page][collapse_id]) {
console.log('showing: '+collapse_id);
$('#'+collapse_id).addClass('show');
}
});
}
$(".collapse-remember").on('shown.bs.collapse', function () {
state = Cookies.getJSON(state_cookie_c);
if (state[page] === undefined) {
state[page] = {};
}
var id = $(this).attr('id');
console.log('Shown: ' + id);
state[page][id] = true;
Cookies.set(state_cookie_c, state);
});
$(".collapse-remember").on('hidden.bs.collapse', function () {
state = Cookies.getJSON(state_cookie_c);
if (state[page] === undefined) {
state[page] = {};
}
var id = $(this).attr('id');
console.log('Hidden: ' + id);
state[page][id] = false;
Cookies.set(state_cookie_c, state);
});
});
| /* Collapse remember
* Use a cookie to "remember" the state of bootstrap collapse divs
* use the 'collapse-remember' class to get this functionality
*/
$(document).ready(function () {
const state_cookie_c = 'collapse-remember';
var page = window.location.pathname;
var state = Cookies.getJSON(state_cookie_c);
if (state === undefined) {
state = {};
Cookies.set(state_cookie_c, state);
}
if (state.hasOwnProperty(page)) {
Object.keys(state[page]).forEach(function (collapse_id) {
if (state[page][collapse_id]) {
console.log('showing: '+collapse_id);
$('#'+collapse_id).collapse('show');
}
});
}
$(".collapse-remember").on('show.bs.collapse', function () {
state = Cookies.getJSON(state_cookie_c);
if (state[page] === undefined) {
state[page] = {};
}
var id = $(this).attr('id');
console.log('Shown: ' + id);
state[page][id] = true;
Cookies.set(state_cookie_c, state);
});
$(".collapse-remember").on('hide.bs.collapse', function () {
state = Cookies.getJSON(state_cookie_c);
if (state[page] === undefined) {
state[page] = {};
}
var id = $(this).attr('id');
console.log('Hidden: ' + id);
state[page][id] = false;
Cookies.set(state_cookie_c, state);
});
});
| Use more updated api methods | Use more updated api methods
| JavaScript | apache-2.0 | twschum/mix-mind,twschum/mix-mind,twschum/mix-mind,twschum/mix-mind | ---
+++
@@ -14,11 +14,11 @@
Object.keys(state[page]).forEach(function (collapse_id) {
if (state[page][collapse_id]) {
console.log('showing: '+collapse_id);
- $('#'+collapse_id).addClass('show');
+ $('#'+collapse_id).collapse('show');
}
});
}
- $(".collapse-remember").on('shown.bs.collapse', function () {
+ $(".collapse-remember").on('show.bs.collapse', function () {
state = Cookies.getJSON(state_cookie_c);
if (state[page] === undefined) {
state[page] = {};
@@ -28,7 +28,7 @@
state[page][id] = true;
Cookies.set(state_cookie_c, state);
});
- $(".collapse-remember").on('hidden.bs.collapse', function () {
+ $(".collapse-remember").on('hide.bs.collapse', function () {
state = Cookies.getJSON(state_cookie_c);
if (state[page] === undefined) {
state[page] = {}; |
9827a836cc32bbe225cd335a1a1c36d91ab89ee8 | server/utils.js | server/utils.js | const mergePermanentAndMetadata = (perm, meta) => Object.assign(perm, meta);
const broadcast = (socket, channel, payload, metadata) => {
const obj = mergePermanentAndMetadata({
type: channel,
}, metadata);
obj.data = payload;
socket.broadcast.emit('action', obj);
};
const emit = (socket, channel, payload, metadata) => {
const obj = mergePermanentAndMetadata({
type: channel,
}, metadata);
obj.data = payload;
socket.emit('action', obj);
};
module.exports = {
broadcast,
emit,
};
| const mergePermanentAndMetadata = (perm, meta) => Object.assign(perm, meta);
const createSocketObject = (channel, payload, metadata) => {
const obj = mergePermanentAndMetadata({
type: channel,
}, metadata);
obj.data = payload;
return obj;
};
const broadcast = (socket, channel, payload, metadata) => {
socket.broadcast.emit('action', createSocketObject(channel, payload, metadata));
};
const emit = (socket, channel, payload, metadata) => {
socket.emit('action', createSocketObject(channel, payload, metadata));
};
module.exports = {
broadcast,
emit,
};
| Reduce code duplication in emit and broadcast | Reduce code duplication in emit and broadcast
| JavaScript | mit | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta | ---
+++
@@ -1,19 +1,19 @@
const mergePermanentAndMetadata = (perm, meta) => Object.assign(perm, meta);
-const broadcast = (socket, channel, payload, metadata) => {
+const createSocketObject = (channel, payload, metadata) => {
const obj = mergePermanentAndMetadata({
type: channel,
}, metadata);
obj.data = payload;
- socket.broadcast.emit('action', obj);
+ return obj;
+};
+
+const broadcast = (socket, channel, payload, metadata) => {
+ socket.broadcast.emit('action', createSocketObject(channel, payload, metadata));
};
const emit = (socket, channel, payload, metadata) => {
- const obj = mergePermanentAndMetadata({
- type: channel,
- }, metadata);
- obj.data = payload;
- socket.emit('action', obj);
+ socket.emit('action', createSocketObject(channel, payload, metadata));
};
module.exports = { |
b3c1ba0a91527c3ba4fcff15d578d91c373965d9 | src/fix.js | src/fix.js | "use strict";
/**
* Fix operator that continuously resolves next promise returned from the function that consumes
* resolved previous value.
*
* ```javascript
* fix(fn)(promise).catch(errorHandler);
* ```
*
* is equivalent to:
*
* ```javascript
* promise.then(fn).then(fn).then(fn) ...
* .catch(errorHandler);
* ```
*
* @param {function(<T>) : Promise} fn
* @returns {function(Promise.<T>) : Promise.<Promise>}
* @template T
*/
var fix = (fn) => (promise) => {
var rejecter;
var resolver = (v) => {
try {
var nextPromise = fn(v);
nextPromise.then(resolver);
if (nextPromise.catch) {
nextPromise.catch(rejecter);
}
} catch(err) {
rejecter(err);
}
};
return new Promise((resolve, reject) => {
rejecter = reject;
promise.then(resolver);
if (promise.catch) {
promise.catch(reject);
}
});
};
export default fix;
| "use strict";
/**
* Fix operator that continuously resolves next promise returned from the function that consumes
* resolved previous value.
*
* ```javascript
* fix(fn)(promise).catch(errorHandler);
* ```
*
* is equivalent to:
*
* ```javascript
* promise.then(fn).then(fn).then(fn) ...
* .catch(errorHandler);
* ```
*
* @param {function(<T>) : Promise} fn
* @returns {function(Promise.<T>) : Promise.<Promise>}
* @template T
*/
var fix = (fn) => (promise) => {
var rejecter;
var resolver = (v) => {
try {
var nextPromise = fn(v);
nextPromise.then(resolver, rejecter);
} catch(err) {
rejecter(err);
}
};
return new Promise((resolve, reject) => {
rejecter = reject;
promise.then(resolver, reject);
});
};
export default fix;
| Remove unnecessary branching and pass reject handler as second args to then() | Remove unnecessary branching and pass reject handler as second args to then()
| JavaScript | apache-2.0 | google/chained-promise | ---
+++
@@ -24,20 +24,14 @@
var resolver = (v) => {
try {
var nextPromise = fn(v);
- nextPromise.then(resolver);
- if (nextPromise.catch) {
- nextPromise.catch(rejecter);
- }
+ nextPromise.then(resolver, rejecter);
} catch(err) {
rejecter(err);
}
};
return new Promise((resolve, reject) => {
rejecter = reject;
- promise.then(resolver);
- if (promise.catch) {
- promise.catch(reject);
- }
+ promise.then(resolver, reject);
});
};
|
6f84cac688110a14ff91643b5ec287f06977908d | test/test-functional.js | test/test-functional.js | var _ = require('lodash');
var assert = require("assert");
var exec = require('child_process').exec;
describe('githours', function() {
describe('cli', function() {
it('should output json', function(done) {
exec('node index.js', function(err, stdout, stderr) {
if (err !== null) {
throw new Error(stderr);
}
var work = JSON.parse(stdout);
assert.notEqual(work.total.hours.length, 0);
assert.notEqual(work.total.commits.length, 0);
done();
});
});
});
});
| var _ = require('lodash');
var assert = require("assert");
var exec = require('child_process').exec;
describe('githours', function() {
describe('cli', function() {
it('should output json', function(done) {
exec('node index.js', function(err, stdout, stderr) {
if (err !== null) {
throw new Error(stderr);
}
console.log('output json', stdout);
var work = JSON.parse(stdout);
assert.notEqual(work.total.hours.length, 0);
assert.notEqual(work.total.commits.length, 0);
done();
});
});
});
});
| Add console.log to test to find out travis problem | Add console.log to test to find out travis problem
| JavaScript | mit | mrPjer/git-hours,qgustavor/git-hours,kimmobrunfeldt/git-hours | ---
+++
@@ -12,6 +12,7 @@
throw new Error(stderr);
}
+ console.log('output json', stdout);
var work = JSON.parse(stdout);
assert.notEqual(work.total.hours.length, 0);
assert.notEqual(work.total.commits.length, 0); |
711c564e7975141c7f9c594e45fc7c9ae72ce12b | route-urls.js | route-urls.js | angular.module("routeUrls", [])
.factory("urls", function($route) {
var pathsByName = {};
angular.forEach($route.routes, function (route, path) {
if (route.name) {
pathsByName[route.name] = path;
}
});
var regexs = {};
var path = function (name, params) {
var url = pathsByName[name] || "/";
angular.forEach(params || {}, function (value, key) {
var regex = regexs[key];
if (regex === undefined) {
regex = regexs[key] = new RegExp(":" + key + "(?=/|$)");
}
url = url.replace(regex, value);
});
return url;
};
return {
path: path,
href: function (name, params) {
return "#" + path(name, params);
}
};
});
| angular.module("routeUrls", [])
.factory("urls", function($route) {
// Cache the routing paths for any named routes.
var pathsByName = {};
angular.forEach($route.routes, function (route, path) {
if (route.name) {
pathsByName[route.name] = path;
}
});
// Param name to replacement regex cache.
var regexs = {};
// Build a path for the named route from the route's URL and the given
// params.
var path = function (name, params) {
var url = pathsByName[name] || "/";
angular.forEach(params || {}, function (value, key) {
var regex = regexs[key];
if (regex === undefined) {
regex = regexs[key] = new RegExp(":" + key + "(?=/|$)");
}
url = url.replace(regex, value);
});
return url;
};
return {
path: path,
href: function (name, params) {
return "#" + path(name, params);
}
};
});
| Add a few comments and make whitespace more consistent. | Add a few comments and make whitespace more consistent.
I realise 2 spaces is common in JS-land but I started using 4 so I win
for now ;).
| JavaScript | mit | emgee/angular-route-urls,emgee/angular-route-urls | ---
+++
@@ -2,6 +2,7 @@
.factory("urls", function($route) {
+ // Cache the routing paths for any named routes.
var pathsByName = {};
angular.forEach($route.routes, function (route, path) {
if (route.name) {
@@ -9,15 +10,17 @@
}
});
+ // Param name to replacement regex cache.
var regexs = {};
+ // Build a path for the named route from the route's URL and the given
+ // params.
var path = function (name, params) {
var url = pathsByName[name] || "/";
angular.forEach(params || {}, function (value, key) {
var regex = regexs[key];
-
if (regex === undefined) {
- regex = regexs[key] = new RegExp(":" + key + "(?=/|$)");
+ regex = regexs[key] = new RegExp(":" + key + "(?=/|$)");
}
url = url.replace(regex, value);
});
@@ -26,7 +29,6 @@
return {
path: path,
-
href: function (name, params) {
return "#" + path(name, params);
} |
ce75ba9a99e5fc3012822d6159beac34f6fbb86d | generators/app/steps/install.js | generators/app/steps/install.js | /**
* Step 7
* Where installation are run (npm, bower)
*/
module.exports = {
/**
* Install npm dependencies
*/
installNpmDependencies: function () {
if (!(this.options['skip-project-install'] || this.options["skip-all"])) {
this.log(chalk.yellow("Start installing npm dependencies, please wait..."));
this.npmInstall();
}
}
};
| /**
* Step 7
* Where installation are run (npm, bower)
*/
var chalk = require('chalk');
module.exports = {
/**
* Install npm dependencies
*/
installNpmDependencies: function () {
if (!(this.options['skip-project-install'] || this.options["skip-all"])) {
this.log(chalk.yellow("Start installing npm dependencies, please wait..."));
this.npmInstall();
}
}
};
| Fix bug with chalk undefined | Fix bug with chalk undefined
| JavaScript | mit | ghaiklor/generator-sails-rest-api,konstantinzolotarev/generator-trails,jaumard/generator-trails,synergycns/generator-sails-rest-api,italoag/generator-sails-rest-api,italoag/generator-sails-rest-api,ghaiklor/generator-sails-rest-api,tnunes/generator-trails,eithewliter5518/generator-sails-rest-api,mhipo1364/generator-sails-rest-api,IncoCode/generator-sails-rest-api | ---
+++
@@ -2,6 +2,8 @@
* Step 7
* Where installation are run (npm, bower)
*/
+
+var chalk = require('chalk');
module.exports = {
/** |
f6a31edd9064612e90c42c007e72bac4508ee66c | bracket-push/bracket_push_test.spec.js | bracket-push/bracket_push_test.spec.js | var bracket = require('./bracket_push');
describe('bracket push', function() {
it('checks for appropriate bracketing in a set of brackets', function() {
expect(bracket('{}')).toEqual(true);
});
xit('returns false for unclosed brackets', function() {
expect(bracket('{{')).toEqual(false);
});
xit('returns false if brackets are out of order', function() {
expect(bracket('}{')).toEqual(false);
});
xit('checks bracketing in more than one pair of brackets', function() {
expect(bracket('{}[]')).toEqual(true);
});
xit('checks bracketing in nested brackets', function() {
expect(bracket('{[]}')).toEqual(true);
});
xit('checks bracket closure with deeper nesting', function() {
expect(bracket('{[)][]}')).toEqual(false);
});
xit('checks bracket closure in a long string of brackets', function() {
expect(bracket('{[]([()])}')).toEqual(true);
});
});
| var bracket = require('./bracket_push');
describe('bracket push', function() {
it('checks for appropriate bracketing in a set of brackets', function() {
expect(bracket('{}')).toEqual(true);
});
xit('returns false for unclosed brackets', function() {
expect(bracket('{{')).toEqual(false);
});
xit('returns false if brackets are out of order', function() {
expect(bracket('}{')).toEqual(false);
});
xit('checks bracketing in more than one pair of brackets', function() {
expect(bracket('{}[]')).toEqual(true);
});
xit('checks bracketing in nested brackets', function() {
expect(bracket('{[]}')).toEqual(true);
});
xit('rejects brackets that are properly balanced but improperly nested', function() {
expect(bracket('{[}]')).toEqual(false);
});
xit('checks bracket closure with deeper nesting', function() {
expect(bracket('{[)][]}')).toEqual(false);
});
xit('checks bracket closure in a long string of brackets', function() {
expect(bracket('{[]([()])}')).toEqual(true);
});
});
| Add test for proper nesting | bracket-push: Add test for proper nesting
This rules out solutions that simply count the number of open/close
brackets without regard for whether they are properly nested.
I submitted a solution (in another language track) that would have
failed this test and did not realize it until looking at others'
solutions. It would be great if I could have known before submitting,
thus I add this test.
| JavaScript | mit | marcCanipel/xjavascript,exercism/xjavascript,exercism/xjavascript,cloudleo/xjavascript,marcCanipel/xjavascript,cloudleo/xjavascript | ---
+++
@@ -21,6 +21,10 @@
expect(bracket('{[]}')).toEqual(true);
});
+ xit('rejects brackets that are properly balanced but improperly nested', function() {
+ expect(bracket('{[}]')).toEqual(false);
+ });
+
xit('checks bracket closure with deeper nesting', function() {
expect(bracket('{[)][]}')).toEqual(false);
}); |
224b6d4018466cbd3a6b174a89cf03668c64762e | stylish.js | stylish.js | 'use strict';
var chalk = require('chalk');
var table = require('text-table');
module.exports = {
reporter: function (result, config, options) {
var total = result.length;
var ret = '';
var headers = [];
var prevfile;
options = options || {};
ret += table(result.map(function (el, i) {
var err = el.error;
var line = [
'',
chalk.gray('line ' + err.line),
chalk.gray('col ' + err.character),
chalk.blue(err.reason)
];
if (el.file !== prevfile) {
headers[i] = el.file;
}
if (options.verbose) {
line.push(chalk.gray('(' + err.code + ')'));
}
prevfile = el.file;
return line;
})).split('\n').map(function (el, i) {
return headers[i] ? '\n' + chalk.underline(headers[i]) + '\n' + el : el;
}).join('\n') + '\n\n';
if (total > 0) {
ret += chalk.red.bold('✖ ' + total + ' problem' + (total === 1 ? '' : 's') + '\n');
} else {
ret += chalk.green.bold('✔ No problems\n');
}
console.log(ret);
}
};
| 'use strict';
var chalk = require('chalk');
var table = require('text-table');
module.exports = {
reporter: function (result, config, options) {
var total = result.length;
var ret = '';
var headers = [];
var prevfile;
options = options || {};
ret += table(result.map(function (el, i) {
var err = el.error;
var line = [
'',
chalk.gray('line ' + err.line),
chalk.gray('col ' + err.character),
chalk.blue(err.reason)
];
if (el.file !== prevfile) {
headers[i] = el.file;
}
if (options.verbose) {
line.push(chalk.gray('(' + err.code + ')'));
}
prevfile = el.file;
return line;
})).split('\n').map(function (el, i) {
return headers[i] ? '\n' + chalk.underline(headers[i]) + '\n' + el : el;
}).join('\n') + '\n\n';
if (total > 0) {
ret += chalk.red.bold('✖ ' + total + ' problem' + (total === 1 ? '' : 's'));
} else {
ret += chalk.green.bold('✔ No problems');
ret = '\n' + ret.trim();
}
console.log(ret + '\n');
}
};
| Improve output when there are no lint problems | Improve output when there are no lint problems
| JavaScript | mit | jasonkarns/jshint-stylish,sindresorhus/jshint-stylish,southan/jshint-stylish,sterpe/jshint-stylish | ---
+++
@@ -36,11 +36,12 @@
}).join('\n') + '\n\n';
if (total > 0) {
- ret += chalk.red.bold('✖ ' + total + ' problem' + (total === 1 ? '' : 's') + '\n');
+ ret += chalk.red.bold('✖ ' + total + ' problem' + (total === 1 ? '' : 's'));
} else {
- ret += chalk.green.bold('✔ No problems\n');
+ ret += chalk.green.bold('✔ No problems');
+ ret = '\n' + ret.trim();
}
- console.log(ret);
+ console.log(ret + '\n');
}
}; |
1615e6726c0c03273be21a43a9e084cb1af3c658 | randomize.js | randomize.js | /**
* Name: Randomize
* Author: Matheus Lucca do Carmo (matheuslc)
* @version: 0.1
* @module randomize
*/
'use strict'
/**
* Select a random item in a range.
*
* @param {Number} firstvalue First value of range.
* @param {Number} secondvalue Second value of range.
* @returns {Number} A random number beetween first and second range.
*/
var randomize = function (firstvalue, secondvalue) {
var min = 0,
max = 0;
if (firstvalue > secondvalue) {
max = firstvalue;
min = secondvalue;
} else {
max = secondvalue;
min = firstvalue;
}
return Math.random()*(max-min+1)+min;
};
console.log(randomize(10.3,10.5)); | /**
* Name: Randomize
* Author: Matheus Lucca do Carmo (matheuslc)
* @version: 0.1
* @module randomize
*/
/**
* Select a random item in a range.
*
* @param {Number} firstvalue First value of range.
* @param {Number} secondvalue Second value of range.
* @returns {Number} A random number beetween first and second range.
*/
var randomize = function (firstvalue, secondvalue) {
var min = 0,
max = 0;
// Check min a max value
if (firstvalue > secondvalue) {
max = firstvalue;
min = secondvalue;
} else {
max = secondvalue;
min = firstvalue;
};
// Check if it's a decimal or integer number
if ((max % 1 === 0) && (min % 1 === 0)) {
return Math.floor(Math.random()*(max-min+1)+min);
} else {
return (Math.random() * (max-min)+min).toFixed(2);
};
};
/**
* Use Example
*/
// Integer Numbers
var dice = randomize(1,6);
// Decimal Numbers
var variation = randomize(10.5,10.7);
| Add support to decimal number | Add support to decimal number
| JavaScript | mit | matheuslc/js-tools | ---
+++
@@ -6,14 +6,15 @@
*/
-'use strict'
+
+
/**
* Select a random item in a range.
*
-* @param {Number} firstvalue First value of range.
-* @param {Number} secondvalue Second value of range.
-* @returns {Number} A random number beetween first and second range.
+* @param {Number} firstvalue First value of range.
+* @param {Number} secondvalue Second value of range.
+* @returns {Number} A random number beetween first and second range.
*/
@@ -21,15 +22,30 @@
var min = 0,
max = 0;
+ // Check min a max value
if (firstvalue > secondvalue) {
max = firstvalue;
min = secondvalue;
} else {
max = secondvalue;
min = firstvalue;
- }
+ };
- return Math.random()*(max-min+1)+min;
+ // Check if it's a decimal or integer number
+ if ((max % 1 === 0) && (min % 1 === 0)) {
+ return Math.floor(Math.random()*(max-min+1)+min);
+ } else {
+ return (Math.random() * (max-min)+min).toFixed(2);
+ };
};
-console.log(randomize(10.3,10.5));
+
+/**
+ * Use Example
+ */
+
+// Integer Numbers
+var dice = randomize(1,6);
+
+// Decimal Numbers
+var variation = randomize(10.5,10.7); |
d2faeb720f2ca9dc10dff8dba8e229b7fbe3004c | addons/knobs/src/components/PropField.js | addons/knobs/src/components/PropField.js | import PropTypes from 'prop-types';
import React from 'react';
import styled from 'react-emotion';
import TypeMap from './types';
const InvalidType = () => <span>Invalid Type</span>;
const Field = styled('div')({
display: 'table-row',
padding: '5px',
});
const Label = styled('label')({
display: 'table-cell',
boxSizing: 'border-box',
verticalAlign: 'top',
paddingRight: 5,
paddingTop: 5,
textAlign: 'right',
width: 80,
fontSize: 12,
fontWeight: 600,
});
export default function PropField({ onChange, onClick, knob }) {
const InputType = TypeMap[knob.type] || InvalidType;
return (
<Field>
<Label htmlFor={knob.name}>{!knob.hideLabel && `${knob.name}`}</Label>
<InputType knob={knob} onChange={onChange} onClick={onClick} />
</Field>
);
}
PropField.propTypes = {
knob: PropTypes.shape({
name: PropTypes.string,
value: PropTypes.any,
}).isRequired,
onChange: PropTypes.func.isRequired,
onClick: PropTypes.func.isRequired,
};
| import PropTypes from 'prop-types';
import React from 'react';
import { Field } from '@storybook/components';
import TypeMap from './types';
const InvalidType = () => <span>Invalid Type</span>;
export default function PropField({ onChange, onClick, knob }) {
const InputType = TypeMap[knob.type] || InvalidType;
return (
<Field label={!knob.hideLabel && `${knob.name}`}>
<InputType knob={knob} onChange={onChange} onClick={onClick} />
</Field>
);
}
PropField.propTypes = {
knob: PropTypes.shape({
name: PropTypes.string,
value: PropTypes.any,
}).isRequired,
onChange: PropTypes.func.isRequired,
onClick: PropTypes.func.isRequired,
};
| REFACTOR knobs field to use field component | REFACTOR knobs field to use field component
| JavaScript | mit | storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook | ---
+++
@@ -1,32 +1,15 @@
import PropTypes from 'prop-types';
import React from 'react';
-import styled from 'react-emotion';
+import { Field } from '@storybook/components';
import TypeMap from './types';
const InvalidType = () => <span>Invalid Type</span>;
-const Field = styled('div')({
- display: 'table-row',
- padding: '5px',
-});
-const Label = styled('label')({
- display: 'table-cell',
- boxSizing: 'border-box',
- verticalAlign: 'top',
- paddingRight: 5,
- paddingTop: 5,
- textAlign: 'right',
- width: 80,
- fontSize: 12,
- fontWeight: 600,
-});
-
export default function PropField({ onChange, onClick, knob }) {
const InputType = TypeMap[knob.type] || InvalidType;
return (
- <Field>
- <Label htmlFor={knob.name}>{!knob.hideLabel && `${knob.name}`}</Label>
+ <Field label={!knob.hideLabel && `${knob.name}`}>
<InputType knob={knob} onChange={onChange} onClick={onClick} />
</Field>
); |
30b483bc0d02cf0659c937c83c87824859c64452 | packages/app/source/client/components/registration-form/registration-form.js | packages/app/source/client/components/registration-form/registration-form.js | Space.flux.BlazeComponent.extend(Donations, 'OrgRegistrationForm', {
dependencies: {
store: 'Donations.OrgRegistrationsStore'
},
state() {
return this.store;
},
isCountry(country) {
return this.store.orgCountry() === country ? true : false;
},
events() {
return [{
'keyup input': this._onInputChange,
'change .org-country': this._onInputChange,
'click .submit': this._onSubmit
}];
},
_onInputChange() {
this.publish(new Donations.OrgRegistrationInputsChanged({
orgName: this.$('.org-name').val(),
orgCountry: this.$('.org-country option:selected').val(),
contactEmail: this.$('.contact-email').val(),
contactName: this.$('.contact-name').val(),
contactPhone: this.$('.contact-phone').val(),
password: this.$('.password').val()
}));
},
_onSubmit(event) {
event.preventDefault();
this.publish(new Donations.OrgRegistrationFormSubmitted());
}
});
Donations.OrgRegistrationForm.register('registration_form');
| Space.flux.BlazeComponent.extend(Donations, 'OrgRegistrationForm', {
ENTER: 13,
dependencies: {
store: 'Donations.OrgRegistrationsStore'
},
state() {
return this.store;
},
isCountry(country) {
return this.store.orgCountry() === country ? true : false;
},
events() {
return [{
'keyup input': this._onInputChange,
'change .org-country': this._onInputChange,
'click .submit': this._onSubmit
}];
},
_onInputChange(event) {
if(event.keyCode === this.ENTER) {
this._onSubmit(event)
}
this.publish(new Donations.OrgRegistrationInputsChanged({
orgName: this.$('.org-name').val(),
orgCountry: this.$('.org-country option:selected').val(),
contactEmail: this.$('.contact-email').val(),
contactName: this.$('.contact-name').val(),
contactPhone: this.$('.contact-phone').val(),
password: this.$('.password').val()
}));
},
_onSubmit(event) {
event.preventDefault();
this.publish(new Donations.OrgRegistrationFormSubmitted());
}
});
Donations.OrgRegistrationForm.register('registration_form');
| Add enter keymap to OrgRegistration | Add enter keymap to OrgRegistration
| JavaScript | mit | meteor-space/donations,meteor-space/donations,meteor-space/donations | ---
+++
@@ -1,4 +1,6 @@
Space.flux.BlazeComponent.extend(Donations, 'OrgRegistrationForm', {
+
+ ENTER: 13,
dependencies: {
store: 'Donations.OrgRegistrationsStore'
@@ -20,7 +22,10 @@
}];
},
- _onInputChange() {
+ _onInputChange(event) {
+ if(event.keyCode === this.ENTER) {
+ this._onSubmit(event)
+ }
this.publish(new Donations.OrgRegistrationInputsChanged({
orgName: this.$('.org-name').val(),
orgCountry: this.$('.org-country option:selected').val(), |
b6d9b41f4d31008f8bafdc1b03f7abb00a1b0f32 | scripts/lib/hbs2html.js | scripts/lib/hbs2html.js | const CleanCss = require(`clean-css`);
const Handlebars = require(`handlebars`);
const htmlclean = require(`htmlclean`);
const path = require(`path`);
const uncss = require(`uncss`);
const fixPreIdentation = require(`./fix-pre-identation.js`);
const handlebarsRegisterPartials = require(`./handlebars-register-partials.js`);
const writeFile = require(`./write-file.js`);
const viewsDirectory = path.join(process.cwd(), `resources`, `views`);
handlebarsRegisterPartials(Handlebars, viewsDirectory);
module.exports = (template, data, outputFile) => {
let html = htmlclean(Handlebars.compile(template)(data));
const minify = process.argv.includes(`--minify`);
if (minify) {
uncss(html, { htmlroot: `dist` }, (error, output) => {
const minifiedCss = new CleanCss().minify(output).styles;
// eslint-disable-next-line no-param-reassign
data.css = `<style>${minifiedCss}</style>`;
html = htmlclean(Handlebars.compile(template)(data));
writeFile(outputFile, fixPreIdentation(html));
});
} else {
writeFile(outputFile, fixPreIdentation(html));
}
};
| const CleanCss = require(`clean-css`);
const Handlebars = require(`handlebars`);
const htmlclean = require(`htmlclean`);
const path = require(`path`);
const uncss = require(`uncss`);
const fixPreIdentation = require(`./fix-pre-identation.js`);
const handlebarsRegisterPartials = require(`./handlebars-register-partials.js`);
const writeFile = require(`./write-file.js`);
const viewsDirectory = path.join(process.cwd(), `resources`, `views`);
handlebarsRegisterPartials(Handlebars, viewsDirectory);
module.exports = (template, data, outputFile) => {
let html = htmlclean(Handlebars.compile(template)(data));
const minify = process.argv.includes(`--minify`);
if (minify) {
uncss(html, { htmlroot: `dist` }, (error, output) => {
const minifiedCss = new CleanCss({
semanticMerging: true
}).minify(output).styles;
// eslint-disable-next-line no-param-reassign
data.css = `<style>${minifiedCss}</style>`;
html = htmlclean(Handlebars.compile(template)(data));
writeFile(outputFile, fixPreIdentation(html));
});
} else {
writeFile(outputFile, fixPreIdentation(html));
}
};
| Enable semantic merging for clean css | Enable semantic merging for clean css
| JavaScript | mit | avalanchesass/avalanche-website,avalanchesass/avalanche-website | ---
+++
@@ -17,7 +17,9 @@
if (minify) {
uncss(html, { htmlroot: `dist` }, (error, output) => {
- const minifiedCss = new CleanCss().minify(output).styles;
+ const minifiedCss = new CleanCss({
+ semanticMerging: true
+ }).minify(output).styles;
// eslint-disable-next-line no-param-reassign
data.css = `<style>${minifiedCss}</style>`;
html = htmlclean(Handlebars.compile(template)(data)); |
e2821b56fb7cc4f3917e6c124f0e025c60a234a2 | integration_tests/setupStore.js | integration_tests/setupStore.js | // @flow
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { routerReducer, routerMiddleware } from 'react-router-redux'
import { createMemoryHistory } from 'history'
import { createReducer } from 'redux-orm'
import createSagaMiddleware from 'redux-saga'
import sinon from 'sinon'
import orm from '../src/models/orm'
import * as reducers from '../src/reducers'
import sagas from './setupSagas'
export const history = createMemoryHistory()
export const dispatchSpy = sinon.spy()
const spyReducer = (state = {}, action) => {
dispatchSpy(action)
return state
}
export default function createStoreWithMiddleware() {
const reducer = combineReducers({
spyReducer,
orm: createReducer(orm),
...reducers,
router: routerReducer
})
const sagaMiddleware = createSagaMiddleware()
const middleware = [routerMiddleware(history), sagaMiddleware]
let store = createStore(reducer, applyMiddleware(...middleware))
sagaMiddleware.run(sagas)
return store
}
| // @flow
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { routerReducer, routerMiddleware } from 'react-router-redux'
import { createMemoryHistory } from 'history'
import { createReducer } from 'redux-orm'
import createSagaMiddleware from 'redux-saga'
import sinon from 'sinon'
import orm from '../src/models/orm'
import * as reducers from '../src/reducers'
import sagas from './setupSagas'
export const history = createMemoryHistory()
export const dispatchSpy = sinon.spy()
const spyReducer = (state = {}, action) => {
dispatchSpy(action)
return state
}
export default function createStoreWithMiddleware() {
const reducer = combineReducers({
spyReducer,
orm: createReducer(orm),
...reducers,
router: routerReducer
})
const sagaMiddleware = createSagaMiddleware()
const middleware = [routerMiddleware(history), sagaMiddleware]
// $FlowFixMe: This is erroring for some reason
let store = createStore(reducer, applyMiddleware(...middleware))
sagaMiddleware.run(sagas)
return store
}
| Fix flow error in test store setup. | fix(flow): Fix flow error in test store setup.
| JavaScript | mit | jsonnull/aleamancer,jsonnull/aleamancer | ---
+++
@@ -29,6 +29,7 @@
const sagaMiddleware = createSagaMiddleware()
const middleware = [routerMiddleware(history), sagaMiddleware]
+ // $FlowFixMe: This is erroring for some reason
let store = createStore(reducer, applyMiddleware(...middleware))
sagaMiddleware.run(sagas) |
7982778a48bbc37bfb2ec2faccdde9ba7185d772 | server/config/routes.js | server/config/routes.js | 'use strict';
const passport = require('passport');
const main = require('../app/controllers/main');
const api = require('../app/controllers/api');
const auth = require('../app/controllers/auth');
/**
* Expose routes
*/
module.exports = function applyRoutes(app) {
app.get('/', main.index);
app.post('/auth/token', auth.token);
app.post('/auth/google-oauth2', auth.google.callback);
app.get('/:type(orders|accounts|portions|vendors)', passport.authenticate('jwt'), api);
app.get('/:type(orders|accounts|portions|vendors)/:id', passport.authenticate('jwt'), api);
app.patch('/:type(orders|portions)/:id', passport.authenticate('jwt'), api);
app.post('/:type(orders|portions|vendors)', passport.authenticate('jwt'), api);
app.post('/:type(accounts)', api);
app.patch('/:type(accounts)/:id', passport.authenticate('jwt'), api);
};
| 'use strict';
const passport = require('passport');
const main = require('../app/controllers/main');
const api = require('../app/controllers/api');
const auth = require('../app/controllers/auth');
/**
* Expose routes
*/
module.exports = function applyRoutes(app) {
app.get('/', main.index);
app.post('/auth/token', auth.token);
app.post('/auth/google-oauth2', auth.google.callback);
app.get('/:type(orders|accounts|portions|vendors)', passport.authenticate('jwt'), api);
app.get('/:type(orders|accounts|portions|vendors)/:id', passport.authenticate('jwt'), api);
app.patch('/:type(orders|portions)/:id', passport.authenticate('jwt'), api);
app.delete('/:type(portions)/:id', passport.authenticate('jwt'), api);
app.post('/:type(orders|portions|vendors)', passport.authenticate('jwt'), api);
app.post('/:type(accounts)', api);
app.patch('/:type(accounts)/:id', passport.authenticate('jwt'), api);
};
| Add api endpoint to delete portion | Add api endpoint to delete portion
| JavaScript | mit | yandex-shri-minsk-2016/yummy-time,yandex-shri-minsk-2016/yummy-time,yandex-shri-minsk-2016/yummy-time | ---
+++
@@ -18,6 +18,7 @@
app.get('/:type(orders|accounts|portions|vendors)', passport.authenticate('jwt'), api);
app.get('/:type(orders|accounts|portions|vendors)/:id', passport.authenticate('jwt'), api);
app.patch('/:type(orders|portions)/:id', passport.authenticate('jwt'), api);
+ app.delete('/:type(portions)/:id', passport.authenticate('jwt'), api);
app.post('/:type(orders|portions|vendors)', passport.authenticate('jwt'), api);
app.post('/:type(accounts)', api);
app.patch('/:type(accounts)/:id', passport.authenticate('jwt'), api); |
3306cc641858b74932cc80de9ff3fc69bf54d6f1 | run_tests.js | run_tests.js | #!/usr/bin/env node
try {
const reporter = require('nodeunit').reporters.default;
}
catch(e) {
console.log("Cannot find nodeunit module.");
console.log("Make sure to run 'npm install nodeunit'");
process.exit();
}
process.chdir(__dirname);
reporter.run(['test/'], null, function(failure) {
process.exit(failure ? 1 : 0)
});
| #!/usr/bin/env node
let reporter;
try {
reporter = require('nodeunit').reporters.default;
}
catch(e) {
console.log("Cannot find nodeunit module.");
console.log("Make sure to run 'npm install nodeunit'");
process.exit();
}
process.chdir(__dirname);
reporter.run(['test/'], null, function(failure) {
process.exit(failure ? 1 : 0)
});
| Correct reporter decleration in test runner | Correct reporter decleration in test runner
| JavaScript | mit | etsy/statsd,etsy/statsd,etsy/statsd | ---
+++
@@ -1,6 +1,7 @@
#!/usr/bin/env node
+let reporter;
try {
- const reporter = require('nodeunit').reporters.default;
+ reporter = require('nodeunit').reporters.default;
}
catch(e) {
console.log("Cannot find nodeunit module."); |
d4a3b8492abef145294e5cb86e0e467b6777af1b | extension/js/insert.js | extension/js/insert.js | helloTest();
function helloTest() {
var elems = document.getElementsByTagName('input');
for(var i=0; i< elems.length; i++) {
console.log(elems[i].id);
}
var amazonBox = document.getElementById("twotabsearchtextbox");
amazonBox.value="Hello";
} | helloTest();
function helloTest() {
var elems = document.getElementsByTagName('input');
for(var i=0; i< elems.length; i++) {
console.log(elems[i].id);
}
var amazonBox = document.getElementById("gcpromoinput");
amazonBox.value="Hello";
} | Insert 'hello' into the amazon voucher code box. | Insert 'hello' into the amazon voucher code box.
| JavaScript | mit | npentrel/couper,npentrel/couper,npentrel/couper | ---
+++
@@ -6,6 +6,6 @@
console.log(elems[i].id);
}
- var amazonBox = document.getElementById("twotabsearchtextbox");
+ var amazonBox = document.getElementById("gcpromoinput");
amazonBox.value="Hello";
} |
19255e40dbd9c234be4b87d199a1a1bae49392f0 | packages/base/resources/js/main_page.js | packages/base/resources/js/main_page.js | function generate_board_page(that, board_id){
var bp_node = that.nodeById('board_page');
}
| function generate_board_page(that, board_id){
/* Generate the board page */
// Gets the node of board page
var bp_node = that.nodeById('board_page');
// Make a serverCall to gets lists and cards related
// to the board.
var result = genro.serverCall(
'get_lists_cards',
{board_id: board_id}
);
// sets the return result to the board datapath
that.setRelativeData('board', result);
}
| Make a serverCall and set returned values to the datapath | Make a serverCall and set returned values to the datapath
| JavaScript | mit | mkshid/genrello,mkshid/genrello,mkshid/genrello | ---
+++
@@ -1,4 +1,17 @@
function generate_board_page(that, board_id){
+ /* Generate the board page */
+
+ // Gets the node of board page
var bp_node = that.nodeById('board_page');
-
+
+ // Make a serverCall to gets lists and cards related
+ // to the board.
+ var result = genro.serverCall(
+ 'get_lists_cards',
+ {board_id: board_id}
+ );
+
+ // sets the return result to the board datapath
+ that.setRelativeData('board', result);
+
} |
9a48444a052443c72b57a5ca57f54635d900d5e7 | commands/reload.js | commands/reload.js | exports.names = ['reload'];
exports.hidden = true;
exports.enabled = true;
exports.cdAll = 60;
exports.cdUser = 60;
exports.cdStaff = 60;
exports.minRole = PERMISSIONS.MANAGER;
exports.handler = function (data) {
loadCommands();
loadResponses();
};
| exports.names = ['reload'];
exports.hidden = true;
exports.enabled = true;
exports.cdAll = 60;
exports.cdUser = 60;
exports.cdStaff = 60;
exports.minRole = PERMISSIONS.MANAGER;
exports.handler = function (data) {
config = require(dpath.resolve(__dirname, 'config.json'));
loadEvents(bot);
loadCommands(bot);
loadExtensions(bot);
};
| Fix lookup for username to try to use the db value | Fix lookup for username to try to use the db value
| JavaScript | mit | avatarkava/beavisbot-dubtrack-fm,avatarkava/beavisbot-dubtrack-fm,avatarkava/BeavisBot,avatarkava/BeavisBot | ---
+++
@@ -6,7 +6,11 @@
exports.cdStaff = 60;
exports.minRole = PERMISSIONS.MANAGER;
exports.handler = function (data) {
- loadCommands();
- loadResponses();
+
+ config = require(dpath.resolve(__dirname, 'config.json'));
+
+ loadEvents(bot);
+ loadCommands(bot);
+ loadExtensions(bot);
};
|
42ecee42a196d3e336ae6c0ac5c8a15c33ed51cc | js/lib/utils/patchMithril.js | js/lib/utils/patchMithril.js | import Component from '../Component';
export default function patchMithril(global) {
const mo = global.m;
const m = function(comp, ...args) {
if (comp.prototype && comp.prototype instanceof Component) {
return comp.component(...args);
}
const node = mo.apply(this, arguments);
if (node.attrs.bidi) {
m.bidi(node, node.attrs.bidi);
}
if (node.attrs.route) {
node.attrs.href = node.attrs.route;
node.attrs.config = m.route;
delete node.attrs.route;
}
return node;
};
Object.keys(mo).forEach(key => m[key] = mo[key]);
/**
* Redraw only if not in the middle of a computation (e.g. a route change).
*
* @return {void}
*/
m.lazyRedraw = function() {
m.startComputation();
m.endComputation();
};
global.m = m;
}
| import Component from '../Component';
export default function patchMithril(global) {
const mo = global.m;
const m = function(comp, ...args) {
if (comp.prototype && comp.prototype instanceof Component) {
return comp.component(args[0], args.slice(1));
}
const node = mo.apply(this, arguments);
if (node.attrs.bidi) {
m.bidi(node, node.attrs.bidi);
}
if (node.attrs.route) {
node.attrs.href = node.attrs.route;
node.attrs.config = m.route;
delete node.attrs.route;
}
return node;
};
Object.keys(mo).forEach(key => m[key] = mo[key]);
/**
* Redraw only if not in the middle of a computation (e.g. a route change).
*
* @return {void}
*/
m.lazyRedraw = function() {
m.startComputation();
m.endComputation();
};
global.m = m;
}
| Make sure components receive all children properly | Make sure components receive all children properly
| JavaScript | mit | flarum/core,malayladu/core,malayladu/core,datitisev/core,datitisev/core,Luceos/core,Luceos/core,flarum/core,malayladu/core,Luceos/core,flarum/core,datitisev/core,malayladu/core,datitisev/core,Luceos/core | ---
+++
@@ -5,7 +5,7 @@
const m = function(comp, ...args) {
if (comp.prototype && comp.prototype instanceof Component) {
- return comp.component(...args);
+ return comp.component(args[0], args.slice(1));
}
const node = mo.apply(this, arguments); |
0180745e31241aa17938edc84ae7708b88940bf3 | documentation/.eslintrc.js | documentation/.eslintrc.js | module.exports = {
root: false,
plugins: ['markdown'],
globals: {
expect: false
},
rules: {
'no-unused-vars': 0,
'no-undef': 0
}
};
| module.exports = {
root: false,
plugins: ['markdown'],
globals: {
expect: false
},
rules: {
'no-unused-vars': 0,
'no-undef': 0
},
parser: 'esprima',
parserOptions: {
tolerant: true
}
};
| Switch to esprima and parse in tolerant mode to allow global return | Switch to esprima and parse in tolerant mode to allow global return
| JavaScript | mit | unexpectedjs/unexpected | ---
+++
@@ -7,5 +7,9 @@
rules: {
'no-unused-vars': 0,
'no-undef': 0
+ },
+ parser: 'esprima',
+ parserOptions: {
+ tolerant: true
}
}; |
c6364cdec25535a69fc835f7f448870f81e9d698 | src/app/directives/passwordInput.directive.js | src/app/directives/passwordInput.directive.js | import nem from "nem-sdk";
function PasswordInput() {
'ngInject';
return {
restrict:'E',
scope: {
common: '='
},
template: '<ng-include src="templatePasswordInput"/>',
link: (scope) => {
scope.templatePasswordInput = 'layout/partials/passwordInput.html';
}
};
}
export default PasswordInput; | import nem from "nem-sdk";
function PasswordInput(Wallet) {
'ngInject';
return {
restrict:'E',
scope: {
common: '='
},
template: '<ng-include src="templatePasswordInput"/>',
link: (scope) => {
scope.Wallet = Wallet;
scope.templatePasswordInput = 'layout/partials/passwordInput.html';
}
};
}
export default PasswordInput; | Fix password input showing in trezor | Fix password input showing in trezor
| JavaScript | mit | mizunashi/NanoWallet,mizunashi/NanoWallet | ---
+++
@@ -1,6 +1,6 @@
import nem from "nem-sdk";
-function PasswordInput() {
+function PasswordInput(Wallet) {
'ngInject';
return {
@@ -10,6 +10,7 @@
},
template: '<ng-include src="templatePasswordInput"/>',
link: (scope) => {
+ scope.Wallet = Wallet;
scope.templatePasswordInput = 'layout/partials/passwordInput.html';
}
|
3fc461c7427b9a883e4c2bb0230648fc2a77f425 | server/modules/generate-wishlist.js | server/modules/generate-wishlist.js | const _generate_wishlist = (max) => {
let wishlist = [];
for (let i=0; i<max; i++) {
wishlist.push(faker.lorem.sentence());
}
return wishlist;
};
Modules.server.generateWishlist = _generate_wishlist;
Meteor.methods({
generateWishlist(max) {
check(max, Number);
return Modules.server.generateWishlist(max);
}
});
| const _generate_wishlist = (max) => {
let wishlist = [];
for (let i=0; i<max; i++) {
wishlist.push( {title: faker.lorem.sentence()} );
}
return wishlist;
};
Modules.server.generateWishlist = _generate_wishlist;
Meteor.methods({
generateWishlist(max) {
check(max, Number);
return Modules.server.generateWishlist(max);
}
});
| Return faked wishlist as object array. | Return faked wishlist as object array.
| JavaScript | mit | lnwKodeDotCom/WeWish,lnwKodeDotCom/WeWish | ---
+++
@@ -1,7 +1,7 @@
const _generate_wishlist = (max) => {
let wishlist = [];
for (let i=0; i<max; i++) {
- wishlist.push(faker.lorem.sentence());
+ wishlist.push( {title: faker.lorem.sentence()} );
}
return wishlist;
}; |
e494ed7ba855be36cca325d398635e38f5bb7e0e | src/String.js | src/String.js | /**
* Has Vowels
*
* hasVowel tests if the String calling the function has a vowels
*
* @param {void}
* @return {Boolean} returns true or false indicating if the string
* has a vowel or not
*/
String.prototype.hasVowels = function() {
var inputString = this;
return /[aeiou]/gi.test(inputString);
};
/**
* To Upper
*
* toUpper converts its calling string to all uppercase characters
*
* @param {void}
* @return {String} returns an upperCase version of the calling string
*/
String.prototype.toUpper = function() {
// the 'this' keyword represents the string calling the function
return this.replace(/[a-z]/g, function(item, position, string) {
return String.fromCharCode(string.charCodeAt(position)-32);
});
};
String.prototype.toLower = function() {
// the 'this' keyword represents the string calling the function
return this.replace(/[A-Z]/g, function(item, position, string) {
return String.fromCharCode(string.charCodeAt(position)+32);
});
};
/**
* Uc First
*
* ucFirst capitalises the first character of its calling string
*
* @param {void}
* @return {String} returns the calling string with the first character
* capitalised
*/
String.prototype.ucFirst = function() {
return this.replace(/^[a-z]/g, function(item, position, string) {
return item.toUpper();
});
}; | /**
* Has Vowels
*
* hasVowel tests if the String calling the function has a vowels
*
* @param {void}
* @return {Boolean} returns true or false indicating if the string
* has a vowel or not
*/
String.prototype.hasVowels = function() {
var inputString = this;
return /[aeiou]/gi.test(inputString);
};
/**
* To Upper
*
* toUpper converts its calling string to all uppercase characters
*
* @param {void}
* @return {String} returns an upperCase version of the calling string
*/
String.prototype.toUpper = function() {
// the 'this' keyword represents the string calling the function
return this.replace(/[a-z]/g, function(item, position, string) {
return String.fromCharCode(string.charCodeAt(position)-32);
});
};
String.prototype.toLower = function() {
// the 'this' keyword represents the string calling the function
return this.replace(/[A-Z]/g, function(item, position, string) {
return String.fromCharCode(string.charCodeAt(position)+32);
});
};
/**
* Uc First
*
* ucFirst capitalises the first character of its calling string
*
* @param {void}
* @return {String} returns the calling string with the first character
* capitalised
*/
String.prototype.ucFirst = function() {
// get the first character
return this.replace(/^[a-z]/g, function(item, position, string) {
return item.toUpper();
});
}; | Fix a tab/space issue coming up on github | Fix a tab/space issue coming up on github
| JavaScript | mit | andela-oolutola/string-class,andela-oolutola/string-class | ---
+++
@@ -44,7 +44,8 @@
* capitalised
*/
String.prototype.ucFirst = function() {
- return this.replace(/^[a-z]/g, function(item, position, string) {
+ // get the first character
+ return this.replace(/^[a-z]/g, function(item, position, string) {
return item.toUpper();
});
}; |
67eb5244817c1475a7f4832932cc59ae8daceded | src/javascript/binary_japan/knowledge_test.js | src/javascript/binary_japan/knowledge_test.js | pjax_config_page_require_auth("account/knowledgetest", function(){
return {
onLoad: function() {
KnowledgeTest.init();
}
};
});
| pjax_config_page_require_auth("account/knowledgetest", function(){
// TODO: show meaningful msg
var cannotTakeKnowledgeTest = function() {
window.location.href = page.url.url_for('user/my_accountws');
};
return {
onLoad: function() {
BinarySocket.init({
onmessage: function(msg) {
var response = JSON.parse(msg.data);
var type = response.msg_type;
var passthrough = response.echo_req.passthrough;
if (type === 'get_account_status') {
var accountStatus = response.get_account_status;
if (accountStatus === 'jp_knowledge_test_pending' && passthrough === 'knowledgetest') {
KnowledgeTest.init();
} else if (accountStatus === 'jp_knowledge_test_fail') {
BinarySocket.send({get_settings: 1, passthrough: 'knowledgetest'});
} else {
cannotTakeKnowledgeTest();
}
} else if (type === 'get_settings') {
if (response.get_settings === 'knowledge_test_allowed' && passthrough === 'knowledgetest') {
KnowledgeTest.init();
} else {
cannotTakeKnowledgeTest();
}
} else {
cannotTakeKnowledgeTest();
}
}
});
BinarySocket.send({get_account_status: 1, passthrough: 'knowledgetest'});
}
};
});
| Integrate with backend for status checking | Integrate with backend for status checking
| JavaScript | apache-2.0 | junbon/binary-static-www2,junbon/binary-static-www2 | ---
+++
@@ -1,7 +1,41 @@
pjax_config_page_require_auth("account/knowledgetest", function(){
+
+ // TODO: show meaningful msg
+ var cannotTakeKnowledgeTest = function() {
+ window.location.href = page.url.url_for('user/my_accountws');
+ };
+
return {
onLoad: function() {
- KnowledgeTest.init();
+ BinarySocket.init({
+ onmessage: function(msg) {
+ var response = JSON.parse(msg.data);
+ var type = response.msg_type;
+
+ var passthrough = response.echo_req.passthrough;
+
+ if (type === 'get_account_status') {
+ var accountStatus = response.get_account_status;
+ if (accountStatus === 'jp_knowledge_test_pending' && passthrough === 'knowledgetest') {
+ KnowledgeTest.init();
+ } else if (accountStatus === 'jp_knowledge_test_fail') {
+ BinarySocket.send({get_settings: 1, passthrough: 'knowledgetest'});
+ } else {
+ cannotTakeKnowledgeTest();
+ }
+ } else if (type === 'get_settings') {
+ if (response.get_settings === 'knowledge_test_allowed' && passthrough === 'knowledgetest') {
+ KnowledgeTest.init();
+ } else {
+ cannotTakeKnowledgeTest();
+ }
+ } else {
+ cannotTakeKnowledgeTest();
+ }
+ }
+ });
+
+ BinarySocket.send({get_account_status: 1, passthrough: 'knowledgetest'});
}
};
}); |
abf757a2ee1b6f2c196627bd9b1c8f1374b04e3d | initializers/_project.js | initializers/_project.js | exports._project = function(api, next){
var mongoose = require('mongoose');
var uri = process.env.MONGOLAB_URI
|| 'mongodb://localhost/forest';
var orgSchema = {
name: String,
printers: [ mongoose.Schema.Types.ObjectId ],
users: [ mongoose.Schema.Types.ObjectId ],
public: Boolean
};
var printerSchema = {
name: String,
location: String,
ipAddress: String,
statuses: [ {
timeStamp: Date,
status: String,
pageCount: Number,
tonerLevel: Number
} ],
manufacturer: String,
model: String
};
var userSchema = {
name: String,
email: String,
password: String,
admin: Boolean
};
var appSchema = {
name: String,
description: String,
user: mongoose.Schema.Types.ObjectId,
key: String
}
mongoose.connect(uri);
mongoose.model('Organization', orgSchema);
mongoose.model('Printer', printerSchema);
mongoose.model('User', userSchema);
mongoose.model('App', appSchema);
api.mongoose = mongoose;
next();
};
| exports._project = function(api, next){
var mongoose = require('mongoose');
var uri = process.env.MONGOLAB_URI
|| 'mongodb://localhost/forest';
var orgSchema = {
name: String,
printers: [ mongoose.Schema.Types.ObjectId ],
users: [ mongoose.Schema.Types.ObjectId ],
public: Boolean
};
var printerSchema = {
name: String,
location: String,
ipAddress: String,
statuses: [ {
timeStamp: Date,
status: String,
pageCount: Number,
tonerLevel: Number
} ],
manufacturer: String,
model: String
};
var userSchema = {
name: String,
email: String,
password: String,
admin: Boolean
};
var appSchema = {
name: String,
description: String,
user: mongoose.Schema.Types.ObjectId,
key: String
}
mongoose.connect(uri);
mongoose.model('Organization', orgSchema);
mongoose.model('Printer', printerSchema);
mongoose.model('User', userSchema);
mongoose.model('App', appSchema);
api.mongoose = mongoose;
api.ObjectId = mongoose.Types.ObjectId;
next();
};
| Add ObjectId to api for more concise code | Add ObjectId to api for more concise code
| JavaScript | mit | printerSystemCSI210/api-server | ---
+++
@@ -49,6 +49,7 @@
mongoose.model('App', appSchema);
api.mongoose = mongoose;
+ api.ObjectId = mongoose.Types.ObjectId;
next();
}; |
644ec4e541f1db7f8b229148e5d19c495a5ff4c5 | ode/public/js/browser.js | ode/public/js/browser.js | $(document).ready(function() {
$('.rule-item').on('mouseenter', function() {
$(this).addClass('highlighted');
var controls = $('<span>').addClass('pull-right controls');
controls.append($.editButton($(this).attr('id')));
controls.append($.removeButton($(this).attr('id')));
$(this).find('h2').append(controls);
$('.edit-button').on('click', function(e) {
var ruleID = $(e.currentTarget).parents('.rule-item').attr('id');
window.location.href =
document.URL + '/' + ruleID + '/input';
});
});
$('.rule-item').on('mouseleave', function() {
$(this).removeClass('highlighted');
$(this).find('.controls').remove();
});
});
| var Rule = Backbone.Model.extend({
initialize: function() {
this.urlRoot = '/rules';
},
});
$(document).ready(function() {
$('.rule-item').on('mouseenter', function() {
$(this).addClass('highlighted');
var controls = $('<span>').addClass('pull-right controls');
controls.append($.editButton($(this).attr('id')));
controls.append($.removeButton($(this).attr('id')));
$(this).find('h2').append(controls);
$('.edit-button').on('click', function(e) {
var ruleID = $(e.currentTarget).parents('.rule-item').attr('id');
window.location.href =
document.URL + '/' + ruleID + '/input';
});
$('.remove-button').on('click', function(e) {
var ruleID = $(e.currentTarget).parents('.rule-item').attr('id')
.substring(1);
var rule = new Rule({ id: ruleID });
rule.destroy();
});
});
$('.rule-item').on('mouseleave', function() {
$(this).removeClass('highlighted');
$(this).find('.controls').remove();
});
});
| Delete feature when clicking its `.remove-button` in Rule Browser. | Delete feature when clicking its `.remove-button` in Rule Browser.
| JavaScript | agpl-3.0 | itsjeyd/ODE,itsjeyd/ODE,itsjeyd/ODE,itsjeyd/ODE | ---
+++
@@ -1,3 +1,11 @@
+var Rule = Backbone.Model.extend({
+
+ initialize: function() {
+ this.urlRoot = '/rules';
+ },
+
+});
+
$(document).ready(function() {
$('.rule-item').on('mouseenter', function() {
@@ -11,7 +19,12 @@
window.location.href =
document.URL + '/' + ruleID + '/input';
});
-
+ $('.remove-button').on('click', function(e) {
+ var ruleID = $(e.currentTarget).parents('.rule-item').attr('id')
+ .substring(1);
+ var rule = new Rule({ id: ruleID });
+ rule.destroy();
+ });
});
$('.rule-item').on('mouseleave', function() { |
41f3e20cdd44942a0783739f31e7e261622d5113 | templates/app/_gulpfile.config.js | templates/app/_gulpfile.config.js | module.exports = function () {
var outputPath = "./<%= outFolder %>/";
var src = "./<%= srcFolder %>/";
var config = {
vendor: {
destPath: outputPath + "js",
src: []
},
templates: src + "**/*.tpl.html",
scss: {
entry: src + "styles/<%= appName %>.scss",
src: [src + "**/*.scss"],
destPath: outputPath + "css"
},
ts: {
src: [src + "**/*.ts"],
dest: outputPath + "js"
},
html: {
src: [src + "**/**.html"],
dest: outputPath + "js"
}
};
return config;
}; | module.exports = function () {
var outputPath = "./<%= outFolder %>/";
var src = "./<%= srcFolder %>/";
var config = {
vendor: {
destPath: outputPath + "js",
src: []
},
templates: src + "**/*.tpl.html",
scss: {
entry: src + "styles/<%= hAppName %>.scss",
src: [src + "**/*.scss"],
destPath: outputPath + "css"
},
ts: {
src: [src + "**/*.ts"],
dest: outputPath + "js"
},
html: {
src: [src + "**/**.html"],
dest: outputPath + "js"
}
};
return config;
}; | Fix an error causing the css not being generated | Fix an error causing the css not being generated
| JavaScript | mit | Kurtz1993/ngts-cli,Kurtz1993/ngts-cli,Kurtz1993/ngts-cli | ---
+++
@@ -9,7 +9,7 @@
},
templates: src + "**/*.tpl.html",
scss: {
- entry: src + "styles/<%= appName %>.scss",
+ entry: src + "styles/<%= hAppName %>.scss",
src: [src + "**/*.scss"],
destPath: outputPath + "css"
}, |
2e150a8214e181730cce297b2e0fcf3a7965cec0 | app/components/search.js | app/components/search.js | const React = require('react')
const Search = React.createClass({
propTypes: {
value: React.PropTypes.string.isRequired,
handleQueryChange: React.PropTypes.func.isRequired,
},
getInitialState () {
return {
input: null,
}
},
focus () {
this.state.input && this.state.input.focus()
},
componentDidMount () {
this.focus()
},
componentDidUpdate () {
if (this.props.value === '') {
this.focus()
}
},
handleKeyPress (event) {
if (event.keyCode === 13 && event.keyCode === 27) {
return false
}
},
handleQueryChange (event) {
const query = event.target.value
this.props.handleQueryChange(query)
},
setReference (input) {
this.setState({
input,
})
},
render () {
const { value } = this.props
return (
<input
title='Search Zazu'
className='mousetrap'
ref={this.setReference}
type='text'
onKeyPress={this.handleKeyPress}
onChange={this.handleQueryChange}
value={value}/>
)
},
})
module.exports = Search
| const React = require('react')
const Search = React.createClass({
propTypes: {
value: React.PropTypes.string.isRequired,
handleQueryChange: React.PropTypes.func.isRequired,
},
getInitialState () {
return {
input: null,
}
},
focus () {
this.state.input && this.state.input.focus()
},
componentDidMount () {
this.focus()
},
componentDidUpdate () {
if (this.props.value === '') {
this.focus()
}
},
handleQueryChange (event) {
const query = event.target.value
this.props.handleQueryChange(query)
},
setReference (input) {
this.setState({
input,
})
},
render () {
const { value } = this.props
return (
<input
title='Search Zazu'
className='mousetrap'
ref={this.setReference}
type='text'
onChange={this.handleQueryChange}
value={value}/>
)
},
})
module.exports = Search
| Revert "Fix alert beep on osx" | Revert "Fix alert beep on osx"
| JavaScript | mit | tinytacoteam/zazu,tinytacoteam/zazu | ---
+++
@@ -26,12 +26,6 @@
}
},
- handleKeyPress (event) {
- if (event.keyCode === 13 && event.keyCode === 27) {
- return false
- }
- },
-
handleQueryChange (event) {
const query = event.target.value
this.props.handleQueryChange(query)
@@ -52,7 +46,6 @@
className='mousetrap'
ref={this.setReference}
type='text'
- onKeyPress={this.handleKeyPress}
onChange={this.handleQueryChange}
value={value}/>
) |
bb3f72f192c02522a36b1797c5a2b0677add8086 | client/app/scripts/controllers/login.js | client/app/scripts/controllers/login.js | 'use strict';
GLClient.controller('LoginCtrl', ['$scope', '$location',
'$routeParams', 'Authentication', 'Receivers',
function($scope, $location, $routeParams, Authentication, Receivers) {
var src = $routeParams['src'];
$scope.loginUsername = "";
$scope.loginPassword = "";
$scope.loginRole = "receiver";
Receivers.query(function (receivers) {
$scope.receivers = receivers;
});
if (src && src.indexOf("/admin") != -1) {
$scope.loginUsername = "admin";
$scope.loginRole = "admin";
};
$scope.$watch("loginUsername", function(){
if ($scope.loginUsername == "admin") {
$scope.loginRole = "admin";
} else if ($scope.loginUsername == "wb") {
$scope.loginRole = "wb";
} else {
$scope.loginRole = "receiver";
}
});
}]);
| 'use strict';
GLClient.controller('LoginCtrl', ['$scope', '$location',
'$routeParams', 'Authentication', 'Receivers',
function($scope, $location, $routeParams, Authentication) {
var src = $routeParams['src'];
$scope.loginUsername = "";
$scope.loginPassword = "";
$scope.loginRole = "receiver";
if (src && src.indexOf("/admin") != -1) {
$scope.loginUsername = "admin";
$scope.loginRole = "admin";
};
$scope.$watch("loginUsername", function(){
if ($scope.loginUsername == "admin") {
$scope.loginRole = "admin";
} else if ($scope.loginUsername == "wb") {
$scope.loginRole = "wb";
} else {
$scope.loginRole = "receiver";
}
});
}]);
| Remove unused resource fetching of receivers | Remove unused resource fetching of receivers
| JavaScript | agpl-3.0 | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks | ---
+++
@@ -2,16 +2,12 @@
GLClient.controller('LoginCtrl', ['$scope', '$location',
'$routeParams', 'Authentication', 'Receivers',
- function($scope, $location, $routeParams, Authentication, Receivers) {
+ function($scope, $location, $routeParams, Authentication) {
var src = $routeParams['src'];
$scope.loginUsername = "";
$scope.loginPassword = "";
$scope.loginRole = "receiver";
-
- Receivers.query(function (receivers) {
- $scope.receivers = receivers;
- });
if (src && src.indexOf("/admin") != -1) {
$scope.loginUsername = "admin"; |
e2eadee1d412885a701f2f7b25222d3762f696e2 | packages/less/package.js | packages/less/package.js | Package.describe({
summary: "The dynamic stylesheet language."
});
var less = require('less');
var fs = require('fs');
Package.register_extension(
"less", function (bundle, source_path, serve_path, where) {
serve_path = serve_path + '.css';
var contents = fs.readFileSync(source_path);
try {
less.render(contents.toString('utf8'), function (err, css) {
// XXX why is this a callback? it's not async.
if (err) {
bundle.error(source_path + ": Less compiler error: " + err.message);
return;
}
bundle.add_resource({
type: "css",
path: serve_path,
data: new Buffer(css),
where: where
});
});
} catch (e) {
// less.render() is supposed to report any errors via its
// callback. But sometimes, it throws them instead. This is
// probably a bug in less. Be prepared for either behavior.
bundle.error(source_path + ": Less compiler error: " + err.message);
}
}
);
| Package.describe({
summary: "The dynamic stylesheet language."
});
var less = require('less');
var fs = require('fs');
Package.register_extension(
"less", function (bundle, source_path, serve_path, where) {
serve_path = serve_path + '.css';
var contents = fs.readFileSync(source_path);
try {
less.render(contents.toString('utf8'), function (err, css) {
// XXX why is this a callback? it's not async.
if (err) {
bundle.error(source_path + ": Less compiler error: " + err.message);
return;
}
bundle.add_resource({
type: "css",
path: serve_path,
data: new Buffer(css),
where: where
});
});
} catch (e) {
// less.render() is supposed to report any errors via its
// callback. But sometimes, it throws them instead. This is
// probably a bug in less. Be prepared for either behavior.
bundle.error(source_path + ": Less compiler error: " + e.message);
}
}
);
| Use correct variable name when logging a less error | Use correct variable name when logging a less error
| JavaScript | mit | sclausen/meteor,qscripter/meteor,zdd910/meteor,zdd910/meteor,benstoltz/meteor,planet-training/meteor,framewr/meteor,benstoltz/meteor,kengchau/meteor,LWHTarena/meteor,johnthepink/meteor,judsonbsilva/meteor,somallg/meteor,chmac/meteor,lassombra/meteor,TribeMedia/meteor,Ken-Liu/meteor,sitexa/meteor,nuvipannu/meteor,shrop/meteor,evilemon/meteor,jirengu/meteor,planet-training/meteor,vacjaliu/meteor,akintoey/meteor,neotim/meteor,youprofit/meteor,allanalexandre/meteor,IveWong/meteor,lpinto93/meteor,lassombra/meteor,brdtrpp/meteor,yyx990803/meteor,williambr/meteor,Profab/meteor,arunoda/meteor,framewr/meteor,yonglehou/meteor,PatrickMcGuinness/meteor,yyx990803/meteor,brettle/meteor,IveWong/meteor,yanisIk/meteor,chiefninew/meteor,elkingtonmcb/meteor,brettle/meteor,Theviajerock/meteor,codedogfish/meteor,alphanso/meteor,luohuazju/meteor,modulexcite/meteor,TechplexEngineer/meteor,oceanzou123/meteor,oceanzou123/meteor,pandeysoni/meteor,ndarilek/meteor,saisai/meteor,yanisIk/meteor,rabbyalone/meteor,devgrok/meteor,aramk/meteor,Jeremy017/meteor,eluck/meteor,ericterpstra/meteor,iman-mafi/meteor,Ken-Liu/meteor,eluck/meteor,yalexx/meteor,mjmasn/meteor,jdivy/meteor,chasertech/meteor,Profab/meteor,Profab/meteor,judsonbsilva/meteor,kidaa/meteor,Urigo/meteor,mubassirhayat/meteor,juansgaitan/meteor,alphanso/meteor,hristaki/meteor,ljack/meteor,aldeed/meteor,nuvipannu/meteor,Eynaliyev/meteor,shmiko/meteor,emmerge/meteor,codingang/meteor,benjamn/meteor,jeblister/meteor,arunoda/meteor,steedos/meteor,stevenliuit/meteor,yalexx/meteor,lassombra/meteor,colinligertwood/meteor,imanmafi/meteor,jg3526/meteor,l0rd0fwar/meteor,jenalgit/meteor,vacjaliu/meteor,lorensr/meteor,tdamsma/meteor,aldeed/meteor,deanius/meteor,katopz/meteor,AnthonyAstige/meteor,mjmasn/meteor,SeanOceanHu/meteor,HugoRLopes/meteor,karlito40/meteor,AlexR1712/meteor,lassombra/meteor,yyx990803/meteor,alexbeletsky/meteor,pandeysoni/meteor,shrop/meteor,yonas/meteor-freebsd,colinligertwood/meteor,AlexR1712/meteor,neotim/meteor,rabbyalone/meteor,ashwathgovind/meteor,AnjirHossain/meteor,Theviajerock/meteor,Urigo/meteor,D1no/meteor,dev-bobsong/meteor,yinhe007/meteor,ericterpstra/meteor,dboyliao/meteor,l0rd0fwar/meteor,Profab/meteor,papimomi/meteor,calvintychan/meteor,GrimDerp/meteor,planet-training/meteor,guazipi/meteor,judsonbsilva/meteor,sdeveloper/meteor,johnthepink/meteor,yalexx/meteor,jdivy/meteor,h200863057/meteor,meonkeys/meteor,jdivy/meteor,joannekoong/meteor,chinasb/meteor,esteedqueen/meteor,papimomi/meteor,lorensr/meteor,cherbst/meteor,dboyliao/meteor,shrop/meteor,hristaki/meteor,williambr/meteor,chmac/meteor,D1no/meteor,paul-barry-kenzan/meteor,Paulyoufu/meteor-1,queso/meteor,AnthonyAstige/meteor,codingang/meteor,meteor-velocity/meteor,sitexa/meteor,brettle/meteor,SeanOceanHu/meteor,AlexR1712/meteor,EduShareOntario/meteor,jrudio/meteor,yinhe007/meteor,brettle/meteor,karlito40/meteor,stevenliuit/meteor,calvintychan/meteor,pjump/meteor,udhayam/meteor,chasertech/meteor,shrop/meteor,brdtrpp/meteor,chasertech/meteor,AlexR1712/meteor,tdamsma/meteor,LWHTarena/meteor,msavin/meteor,yalexx/meteor,saisai/meteor,stevenliuit/meteor,aldeed/meteor,bhargav175/meteor,imanmafi/meteor,dandv/meteor,IveWong/meteor,paul-barry-kenzan/meteor,daslicht/meteor,dfischer/meteor,Jonekee/meteor,alphanso/meteor,emmerge/meteor,henrypan/meteor,AnjirHossain/meteor,jeblister/meteor,colinligertwood/meteor,Eynaliyev/meteor,yiliaofan/meteor,baysao/meteor,Urigo/meteor,iman-mafi/meteor,servel333/meteor,Hansoft/meteor,juansgaitan/meteor,dev-bobsong/meteor,dandv/meteor,codingang/meteor,zdd910/meteor,wmkcc/meteor,Eynaliyev/meteor,lpinto93/meteor,allanalexandre/meteor,TechplexEngineer/meteor,jg3526/meteor,ericterpstra/meteor,baysao/meteor,vjau/meteor,msavin/meteor,modulexcite/meteor,IveWong/meteor,HugoRLopes/meteor,bhargav175/meteor,yonglehou/meteor,michielvanoeffelen/meteor,esteedqueen/meteor,EduShareOntario/meteor,DCKT/meteor,DCKT/meteor,jg3526/meteor,luohuazju/meteor,h200863057/meteor,yanisIk/meteor,shmiko/meteor,Jonekee/meteor,TribeMedia/meteor,stevenliuit/meteor,chmac/meteor,4commerce-technologies-AG/meteor,dev-bobsong/meteor,Prithvi-A/meteor,h200863057/meteor,jenalgit/meteor,TribeMedia/meteor,saisai/meteor,queso/meteor,baiyunping333/meteor,cherbst/meteor,udhayam/meteor,benjamn/meteor,jdivy/meteor,Eynaliyev/meteor,dfischer/meteor,steedos/meteor,chasertech/meteor,D1no/meteor,queso/meteor,chmac/meteor,pjump/meteor,yiliaofan/meteor,Hansoft/meteor,sunny-g/meteor,luohuazju/meteor,neotim/meteor,tdamsma/meteor,EduShareOntario/meteor,cog-64/meteor,meonkeys/meteor,DAB0mB/meteor,meonkeys/meteor,sunny-g/meteor,msavin/meteor,wmkcc/meteor,esteedqueen/meteor,joannekoong/meteor,Paulyoufu/meteor-1,yyx990803/meteor,chmac/meteor,calvintychan/meteor,nuvipannu/meteor,judsonbsilva/meteor,ljack/meteor,JesseQin/meteor,IveWong/meteor,justintung/meteor,Eynaliyev/meteor,evilemon/meteor,tdamsma/meteor,mauricionr/meteor,queso/meteor,tdamsma/meteor,hristaki/meteor,fashionsun/meteor,AnjirHossain/meteor,jeblister/meteor,benstoltz/meteor,justintung/meteor,alphanso/meteor,rozzzly/meteor,henrypan/meteor,yinhe007/meteor,devgrok/meteor,cherbst/meteor,sdeveloper/meteor,pandeysoni/meteor,4commerce-technologies-AG/meteor,ndarilek/meteor,dboyliao/meteor,mjmasn/meteor,justintung/meteor,elkingtonmcb/meteor,akintoey/meteor,skarekrow/meteor,steedos/meteor,4commerce-technologies-AG/meteor,aleclarson/meteor,JesseQin/meteor,Theviajerock/meteor,imanmafi/meteor,h200863057/meteor,yyx990803/meteor,whip112/meteor,somallg/meteor,evilemon/meteor,paul-barry-kenzan/meteor,AnthonyAstige/meteor,dfischer/meteor,bhargav175/meteor,benstoltz/meteor,Jeremy017/meteor,pandeysoni/meteor,lpinto93/meteor,henrypan/meteor,Ken-Liu/meteor,chiefninew/meteor,Jeremy017/meteor,Quicksteve/meteor,shadedprofit/meteor,rozzzly/meteor,stevenliuit/meteor,deanius/meteor,baiyunping333/meteor,katopz/meteor,yonas/meteor-freebsd,meonkeys/meteor,daslicht/meteor,johnthepink/meteor,IveWong/meteor,deanius/meteor,Puena/meteor,lieuwex/meteor,h200863057/meteor,chmac/meteor,Puena/meteor,mubassirhayat/meteor,Quicksteve/meteor,neotim/meteor,baiyunping333/meteor,dfischer/meteor,mirstan/meteor,shadedprofit/meteor,lawrenceAIO/meteor,Theviajerock/meteor,dboyliao/meteor,LWHTarena/meteor,lawrenceAIO/meteor,eluck/meteor,lieuwex/meteor,yalexx/meteor,TechplexEngineer/meteor,alphanso/meteor,emmerge/meteor,Paulyoufu/meteor-1,queso/meteor,karlito40/meteor,steedos/meteor,baiyunping333/meteor,jrudio/meteor,sclausen/meteor,udhayam/meteor,servel333/meteor,mjmasn/meteor,katopz/meteor,kengchau/meteor,cherbst/meteor,vacjaliu/meteor,kencheung/meteor,AnthonyAstige/meteor,brettle/meteor,arunoda/meteor,servel333/meteor,allanalexandre/meteor,youprofit/meteor,meteor-velocity/meteor,nuvipannu/meteor,imanmafi/meteor,vjau/meteor,zdd910/meteor,rabbyalone/meteor,judsonbsilva/meteor,neotim/meteor,baiyunping333/meteor,guazipi/meteor,msavin/meteor,aramk/meteor,cog-64/meteor,udhayam/meteor,mauricionr/meteor,benjamn/meteor,shmiko/meteor,codingang/meteor,iman-mafi/meteor,Prithvi-A/meteor,meonkeys/meteor,bhargav175/meteor,yonglehou/meteor,JesseQin/meteor,D1no/meteor,AnthonyAstige/meteor,brettle/meteor,ljack/meteor,benjamn/meteor,sdeveloper/meteor,chengxiaole/meteor,yonglehou/meteor,cherbst/meteor,baysao/meteor,DAB0mB/meteor,dboyliao/meteor,baysao/meteor,lieuwex/meteor,Hansoft/meteor,Profab/meteor,GrimDerp/meteor,mirstan/meteor,kidaa/meteor,benstoltz/meteor,joannekoong/meteor,tdamsma/meteor,lorensr/meteor,pandeysoni/meteor,lorensr/meteor,mubassirhayat/meteor,jenalgit/meteor,henrypan/meteor,DCKT/meteor,meteor-velocity/meteor,newswim/meteor,TribeMedia/meteor,arunoda/meteor,GrimDerp/meteor,JesseQin/meteor,imanmafi/meteor,michielvanoeffelen/meteor,paul-barry-kenzan/meteor,eluck/meteor,colinligertwood/meteor,lpinto93/meteor,eluck/meteor,rabbyalone/meteor,jeblister/meteor,Hansoft/meteor,somallg/meteor,sclausen/meteor,mirstan/meteor,evilemon/meteor,deanius/meteor,aleclarson/meteor,yinhe007/meteor,PatrickMcGuinness/meteor,whip112/meteor,Eynaliyev/meteor,saisai/meteor,daltonrenaldo/meteor,LWHTarena/meteor,DCKT/meteor,daslicht/meteor,mauricionr/meteor,sunny-g/meteor,kidaa/meteor,ericterpstra/meteor,lpinto93/meteor,qscripter/meteor,l0rd0fwar/meteor,sunny-g/meteor,Jeremy017/meteor,Paulyoufu/meteor-1,dboyliao/meteor,jg3526/meteor,DCKT/meteor,ljack/meteor,yinhe007/meteor,elkingtonmcb/meteor,benjamn/meteor,HugoRLopes/meteor,alexbeletsky/meteor,chinasb/meteor,paul-barry-kenzan/meteor,aramk/meteor,AnjirHossain/meteor,jg3526/meteor,guazipi/meteor,servel333/meteor,D1no/meteor,kencheung/meteor,whip112/meteor,rozzzly/meteor,LWHTarena/meteor,qscripter/meteor,Jeremy017/meteor,colinligertwood/meteor,akintoey/meteor,EduShareOntario/meteor,chasertech/meteor,DAB0mB/meteor,yonglehou/meteor,karlito40/meteor,paul-barry-kenzan/meteor,Jonekee/meteor,D1no/meteor,bhargav175/meteor,katopz/meteor,jrudio/meteor,chinasb/meteor,colinligertwood/meteor,brettle/meteor,DAB0mB/meteor,4commerce-technologies-AG/meteor,cbonami/meteor,eluck/meteor,alexbeletsky/meteor,vjau/meteor,shadedprofit/meteor,SeanOceanHu/meteor,modulexcite/meteor,ashwathgovind/meteor,brdtrpp/meteor,sdeveloper/meteor,lawrenceAIO/meteor,Jeremy017/meteor,jg3526/meteor,skarekrow/meteor,benstoltz/meteor,alexbeletsky/meteor,chiefninew/meteor,michielvanoeffelen/meteor,yanisIk/meteor,vacjaliu/meteor,michielvanoeffelen/meteor,arunoda/meteor,sitexa/meteor,skarekrow/meteor,vacjaliu/meteor,AlexR1712/meteor,nuvipannu/meteor,yonglehou/meteor,calvintychan/meteor,Theviajerock/meteor,sdeveloper/meteor,papimomi/meteor,chinasb/meteor,kengchau/meteor,benjamn/meteor,lorensr/meteor,Jonekee/meteor,lpinto93/meteor,fashionsun/meteor,daslicht/meteor,jagi/meteor,henrypan/meteor,steedos/meteor,lawrenceAIO/meteor,esteedqueen/meteor,dandv/meteor,vjau/meteor,Paulyoufu/meteor-1,SeanOceanHu/meteor,TechplexEngineer/meteor,dev-bobsong/meteor,yonas/meteor-freebsd,hristaki/meteor,calvintychan/meteor,Ken-Liu/meteor,eluck/meteor,jirengu/meteor,AnjirHossain/meteor,juansgaitan/meteor,codedogfish/meteor,Profab/meteor,yinhe007/meteor,henrypan/meteor,codingang/meteor,jenalgit/meteor,namho102/meteor,PatrickMcGuinness/meteor,brdtrpp/meteor,fashionsun/meteor,mubassirhayat/meteor,wmkcc/meteor,jagi/meteor,whip112/meteor,Hansoft/meteor,iman-mafi/meteor,imanmafi/meteor,joannekoong/meteor,iman-mafi/meteor,youprofit/meteor,kengchau/meteor,ashwathgovind/meteor,kidaa/meteor,lassombra/meteor,l0rd0fwar/meteor,neotim/meteor,shadedprofit/meteor,AlexR1712/meteor,emmerge/meteor,TechplexEngineer/meteor,allanalexandre/meteor,mubassirhayat/meteor,cog-64/meteor,ndarilek/meteor,Puena/meteor,chiefninew/meteor,stevenliuit/meteor,GrimDerp/meteor,skarekrow/meteor,JesseQin/meteor,D1no/meteor,emmerge/meteor,yonas/meteor-freebsd,codedogfish/meteor,daslicht/meteor,dboyliao/meteor,elkingtonmcb/meteor,lawrenceAIO/meteor,aramk/meteor,Prithvi-A/meteor,framewr/meteor,yinhe007/meteor,williambr/meteor,cog-64/meteor,pandeysoni/meteor,guazipi/meteor,evilemon/meteor,rozzzly/meteor,mirstan/meteor,mubassirhayat/meteor,yanisIk/meteor,jirengu/meteor,Profab/meteor,youprofit/meteor,chinasb/meteor,Jonekee/meteor,yalexx/meteor,dandv/meteor,joannekoong/meteor,yanisIk/meteor,mirstan/meteor,luohuazju/meteor,SeanOceanHu/meteor,chengxiaole/meteor,oceanzou123/meteor,fashionsun/meteor,sclausen/meteor,johnthepink/meteor,iman-mafi/meteor,Prithvi-A/meteor,AnjirHossain/meteor,nuvipannu/meteor,h200863057/meteor,alexbeletsky/meteor,Eynaliyev/meteor,sclausen/meteor,evilemon/meteor,allanalexandre/meteor,deanius/meteor,jg3526/meteor,TribeMedia/meteor,ljack/meteor,ashwathgovind/meteor,katopz/meteor,servel333/meteor,PatrickMcGuinness/meteor,HugoRLopes/meteor,dandv/meteor,meonkeys/meteor,zdd910/meteor,ndarilek/meteor,meteor-velocity/meteor,mauricionr/meteor,youprofit/meteor,newswim/meteor,newswim/meteor,somallg/meteor,planet-training/meteor,nuvipannu/meteor,Puena/meteor,mirstan/meteor,pjump/meteor,daltonrenaldo/meteor,jagi/meteor,namho102/meteor,Prithvi-A/meteor,somallg/meteor,yiliaofan/meteor,imanmafi/meteor,juansgaitan/meteor,baiyunping333/meteor,mauricionr/meteor,AnjirHossain/meteor,ashwathgovind/meteor,pjump/meteor,oceanzou123/meteor,sdeveloper/meteor,EduShareOntario/meteor,namho102/meteor,whip112/meteor,Quicksteve/meteor,namho102/meteor,queso/meteor,devgrok/meteor,dev-bobsong/meteor,dev-bobsong/meteor,brdtrpp/meteor,l0rd0fwar/meteor,jagi/meteor,katopz/meteor,dandv/meteor,calvintychan/meteor,dfischer/meteor,dboyliao/meteor,jagi/meteor,daltonrenaldo/meteor,kencheung/meteor,yonas/meteor-freebsd,chasertech/meteor,jenalgit/meteor,aldeed/meteor,lpinto93/meteor,papimomi/meteor,aldeed/meteor,benstoltz/meteor,lorensr/meteor,saisai/meteor,daltonrenaldo/meteor,luohuazju/meteor,AlexR1712/meteor,Theviajerock/meteor,cbonami/meteor,arunoda/meteor,lieuwex/meteor,planet-training/meteor,shmiko/meteor,youprofit/meteor,guazipi/meteor,Prithvi-A/meteor,chasertech/meteor,tdamsma/meteor,GrimDerp/meteor,allanalexandre/meteor,D1no/meteor,brdtrpp/meteor,luohuazju/meteor,cherbst/meteor,devgrok/meteor,chengxiaole/meteor,williambr/meteor,joannekoong/meteor,jirengu/meteor,henrypan/meteor,oceanzou123/meteor,JesseQin/meteor,ndarilek/meteor,TribeMedia/meteor,queso/meteor,msavin/meteor,williambr/meteor,whip112/meteor,rabbyalone/meteor,emmerge/meteor,akintoey/meteor,qscripter/meteor,ndarilek/meteor,fashionsun/meteor,meteor-velocity/meteor,yanisIk/meteor,lieuwex/meteor,shmiko/meteor,papimomi/meteor,msavin/meteor,Hansoft/meteor,tdamsma/meteor,akintoey/meteor,DAB0mB/meteor,ericterpstra/meteor,karlito40/meteor,emmerge/meteor,newswim/meteor,Theviajerock/meteor,Puena/meteor,fashionsun/meteor,lorensr/meteor,planet-training/meteor,framewr/meteor,yiliaofan/meteor,LWHTarena/meteor,HugoRLopes/meteor,allanalexandre/meteor,PatrickMcGuinness/meteor,planet-training/meteor,mjmasn/meteor,pjump/meteor,bhargav175/meteor,yanisIk/meteor,EduShareOntario/meteor,dfischer/meteor,planet-training/meteor,sunny-g/meteor,mauricionr/meteor,AnthonyAstige/meteor,qscripter/meteor,SeanOceanHu/meteor,msavin/meteor,jagi/meteor,codingang/meteor,GrimDerp/meteor,daltonrenaldo/meteor,guazipi/meteor,saisai/meteor,wmkcc/meteor,lassombra/meteor,servel333/meteor,jdivy/meteor,newswim/meteor,kengchau/meteor,rabbyalone/meteor,pjump/meteor,Quicksteve/meteor,lawrenceAIO/meteor,qscripter/meteor,h200863057/meteor,rabbyalone/meteor,aramk/meteor,elkingtonmcb/meteor,kidaa/meteor,mjmasn/meteor,jagi/meteor,justintung/meteor,baiyunping333/meteor,SeanOceanHu/meteor,cbonami/meteor,zdd910/meteor,vjau/meteor,elkingtonmcb/meteor,yyx990803/meteor,calvintychan/meteor,GrimDerp/meteor,chengxiaole/meteor,jrudio/meteor,yiliaofan/meteor,skarekrow/meteor,justintung/meteor,Quicksteve/meteor,mubassirhayat/meteor,HugoRLopes/meteor,vjau/meteor,williambr/meteor,Jonekee/meteor,oceanzou123/meteor,michielvanoeffelen/meteor,udhayam/meteor,ndarilek/meteor,brdtrpp/meteor,cbonami/meteor,jenalgit/meteor,ndarilek/meteor,paul-barry-kenzan/meteor,zdd910/meteor,kengchau/meteor,johnthepink/meteor,Ken-Liu/meteor,chengxiaole/meteor,Eynaliyev/meteor,jeblister/meteor,sdeveloper/meteor,alexbeletsky/meteor,sunny-g/meteor,DCKT/meteor,dandv/meteor,juansgaitan/meteor,steedos/meteor,justintung/meteor,shadedprofit/meteor,jenalgit/meteor,youprofit/meteor,dev-bobsong/meteor,juansgaitan/meteor,sitexa/meteor,fashionsun/meteor,Urigo/meteor,PatrickMcGuinness/meteor,shadedprofit/meteor,alphanso/meteor,Jeremy017/meteor,aldeed/meteor,chiefninew/meteor,eluck/meteor,framewr/meteor,Puena/meteor,servel333/meteor,evilemon/meteor,pjump/meteor,cbonami/meteor,papimomi/meteor,Quicksteve/meteor,ljack/meteor,vacjaliu/meteor,PatrickMcGuinness/meteor,l0rd0fwar/meteor,karlito40/meteor,udhayam/meteor,colinligertwood/meteor,cog-64/meteor,karlito40/meteor,vjau/meteor,qscripter/meteor,vacjaliu/meteor,shmiko/meteor,yonas/meteor-freebsd,kidaa/meteor,baysao/meteor,kencheung/meteor,newswim/meteor,wmkcc/meteor,chiefninew/meteor,shrop/meteor,hristaki/meteor,Ken-Liu/meteor,sclausen/meteor,deanius/meteor,somallg/meteor,namho102/meteor,saisai/meteor,newswim/meteor,karlito40/meteor,guazipi/meteor,aramk/meteor,stevenliuit/meteor,alexbeletsky/meteor,jirengu/meteor,sunny-g/meteor,SeanOceanHu/meteor,rozzzly/meteor,Ken-Liu/meteor,oceanzou123/meteor,TribeMedia/meteor,chengxiaole/meteor,deanius/meteor,johnthepink/meteor,justintung/meteor,Urigo/meteor,daltonrenaldo/meteor,skarekrow/meteor,mauricionr/meteor,baysao/meteor,codedogfish/meteor,michielvanoeffelen/meteor,4commerce-technologies-AG/meteor,meteor-velocity/meteor,papimomi/meteor,michielvanoeffelen/meteor,yiliaofan/meteor,devgrok/meteor,lawrenceAIO/meteor,somallg/meteor,codedogfish/meteor,alphanso/meteor,namho102/meteor,shrop/meteor,kencheung/meteor,steedos/meteor,yalexx/meteor,iman-mafi/meteor,mubassirhayat/meteor,johnthepink/meteor,juansgaitan/meteor,TechplexEngineer/meteor,AnthonyAstige/meteor,kencheung/meteor,sunny-g/meteor,daslicht/meteor,mirstan/meteor,jdivy/meteor,cog-64/meteor,framewr/meteor,modulexcite/meteor,williambr/meteor,esteedqueen/meteor,JesseQin/meteor,HugoRLopes/meteor,lieuwex/meteor,bhargav175/meteor,HugoRLopes/meteor,yiliaofan/meteor,ericterpstra/meteor,jdivy/meteor,meteor-velocity/meteor,esteedqueen/meteor,l0rd0fwar/meteor,DAB0mB/meteor,codedogfish/meteor,benjamn/meteor,Jonekee/meteor,cherbst/meteor,IveWong/meteor,modulexcite/meteor,brdtrpp/meteor,chengxiaole/meteor,yyx990803/meteor,aldeed/meteor,aramk/meteor,framewr/meteor,judsonbsilva/meteor,jirengu/meteor,ericterpstra/meteor,jirengu/meteor,wmkcc/meteor,ashwathgovind/meteor,dfischer/meteor,Puena/meteor,Hansoft/meteor,joannekoong/meteor,lieuwex/meteor,modulexcite/meteor,devgrok/meteor,shmiko/meteor,chinasb/meteor,ljack/meteor,skarekrow/meteor,Urigo/meteor,jrudio/meteor,yonas/meteor-freebsd,TechplexEngineer/meteor,Quicksteve/meteor,chinasb/meteor,ljack/meteor,modulexcite/meteor,akintoey/meteor,ashwathgovind/meteor,arunoda/meteor,daltonrenaldo/meteor,rozzzly/meteor,kencheung/meteor,neotim/meteor,kengchau/meteor,4commerce-technologies-AG/meteor,luohuazju/meteor,mjmasn/meteor,yonglehou/meteor,lassombra/meteor,katopz/meteor,chiefninew/meteor,daltonrenaldo/meteor,wmkcc/meteor,baysao/meteor,Paulyoufu/meteor-1,jeblister/meteor,chiefninew/meteor,shadedprofit/meteor,Urigo/meteor,codingang/meteor,shrop/meteor,sitexa/meteor,cbonami/meteor,alexbeletsky/meteor,EduShareOntario/meteor,DAB0mB/meteor,akintoey/meteor,kidaa/meteor,somallg/meteor,elkingtonmcb/meteor,AnthonyAstige/meteor,daslicht/meteor,cbonami/meteor,codedogfish/meteor,4commerce-technologies-AG/meteor,LWHTarena/meteor,udhayam/meteor,servel333/meteor,whip112/meteor,chmac/meteor,sitexa/meteor,hristaki/meteor,esteedqueen/meteor,sitexa/meteor,namho102/meteor,judsonbsilva/meteor,cog-64/meteor,allanalexandre/meteor,sclausen/meteor,Prithvi-A/meteor,aleclarson/meteor,pandeysoni/meteor,jrudio/meteor,Paulyoufu/meteor-1,devgrok/meteor,DCKT/meteor,rozzzly/meteor,hristaki/meteor,meonkeys/meteor,jeblister/meteor | ---
+++
@@ -30,7 +30,7 @@
// less.render() is supposed to report any errors via its
// callback. But sometimes, it throws them instead. This is
// probably a bug in less. Be prepared for either behavior.
- bundle.error(source_path + ": Less compiler error: " + err.message);
+ bundle.error(source_path + ": Less compiler error: " + e.message);
}
}
); |
420127e99561a75e87e6ef77805063c514aaa039 | pages/home/QuickStart.js | pages/home/QuickStart.js | import React from 'react';
import './QuickStart.scss';
const QuickStart = () => (
<div className="quick-start">
<h1>Documentation</h1>
<p className="quick-start-hint">New to Skygear?</p>
<p>
<form action="/guides/get-started/ios/">
<button className="quick-start-button">Quick Start</button>
</form>
</p>
</div>
);
export default QuickStart;
| import React from 'react';
import './QuickStart.scss';
const QuickStart = () => (
<div className="quick-start">
<h1>Documentation</h1>
<p className="quick-start-hint">New to Skygear?</p>
<p>
<form action="/guides/quickstart/ios/">
<button className="quick-start-button">Quick Start</button>
</form>
</p>
</div>
);
export default QuickStart;
| Update Quickstart button at index to new Quick start guide | Update Quickstart button at index to new Quick start guide
| JavaScript | mit | ben181231/skygear-doc,ben181231/skygear-doc,ben181231/skygear-doc | ---
+++
@@ -6,7 +6,7 @@
<h1>Documentation</h1>
<p className="quick-start-hint">New to Skygear?</p>
<p>
- <form action="/guides/get-started/ios/">
+ <form action="/guides/quickstart/ios/">
<button className="quick-start-button">Quick Start</button>
</form>
</p> |
c30f509fe6de4b9a3c10327cf675e22b49ca2cc5 | app/routes/post_login.js | app/routes/post_login.js | import Ember from 'ember';
import preloadDataMixin from '../mixins/preload_data';
export default Ember.Route.extend(preloadDataMixin, {
cordova: Ember.inject.service(),
beforeModel() {
Ember.run(() => this.controllerFor('application').send('logMeIn'));
return this.preloadData().catch(error => {
if (error.status === 0) {
this.transitionTo("offline");
} else {
throw error;
}
}).finally(() => this.get("cordova").appLoad());
},
afterModel() {
if (this.get("session.isAdminApp")) {
this.loadStaticData().catch(error => {
if (error.status === 0) {
this.transitionTo("offline");
} else {
throw error;
}
});
}
// After everthying has been loaded, redirect user to requested url
var attemptedTransition = this.controllerFor('login').get('attemptedTransition');
if (attemptedTransition) {
attemptedTransition.retry();
this.set('attemptedTransition', null);
} else {
var currentUser = this.get('session.currentUser');
if (this.get('session.isAdminApp')) {
this.transitionTo('dashboard');
} else {
this.transitionTo('/offers');
}
}
}
});
| import Ember from 'ember';
import preloadDataMixin from '../mixins/preload_data';
export default Ember.Route.extend(preloadDataMixin, {
cordova: Ember.inject.service(),
beforeModel() {
Ember.run(() => this.controllerFor('application').send('logMeIn'));
return this.preloadData().catch(error => {
if (error.status === 0) {
this.transitionTo("offline");
} else {
throw error;
}
}).finally(() => this.get("cordova").appLoad());
},
afterModel() {
if (this.get("session.isAdminApp")) {
this.loadStaticData().catch(error => {
if (error.status === 0) {
this.transitionTo("offline");
} else {
throw error;
}
});
}
// After everthying has been loaded, redirect user to requested url
var attemptedTransition = this.controllerFor('login').get('attemptedTransition');
if (attemptedTransition) {
attemptedTransition.retry();
this.set('attemptedTransition', null);
} else {
var currentUser = this.get('session.currentUser');
if (this.get('session.isAdminApp')) {
var myOffers = this.store.peekAll('offer').filterBy('reviewedBy.id', currentUser.get('id'));
if (myOffers.get('length') > 0) {
this.transitionTo('my_list');
} else {
this.transitionTo('offers');
}
} else {
this.transitionTo('/offers');
}
}
}
});
| Revert "GCW- 2473- Replace Admin Offers UI with Dashboard and Search Filters" | Revert "GCW- 2473- Replace Admin Offers UI with Dashboard and Search Filters"
| JavaScript | mit | crossroads/shared.goodcity,crossroads/shared.goodcity | ---
+++
@@ -35,7 +35,12 @@
} else {
var currentUser = this.get('session.currentUser');
if (this.get('session.isAdminApp')) {
- this.transitionTo('dashboard');
+ var myOffers = this.store.peekAll('offer').filterBy('reviewedBy.id', currentUser.get('id'));
+ if (myOffers.get('length') > 0) {
+ this.transitionTo('my_list');
+ } else {
+ this.transitionTo('offers');
+ }
} else {
this.transitionTo('/offers');
} |
4166b2fdd2b701b67b7cad78eb1de9b7a1e52555 | components/prism-python.js | components/prism-python.js | Prism.languages.python= {
'comment': {
pattern: /(^|[^\\])#.*?(\r?\n|$)/g,
lookbehind: true
},
'string': /"""[\s\S]+?"""|("|')(\\?.)*?\1/g,
'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/g,
'boolean' : /\b(True|False)\b/g,
'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/g,
'operator' : /[-+]{1,2}|=?<|=?>|!|={1,2}|(&){1,2}|(&){1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/g,
'ignore' : /&(lt|gt|amp);/gi,
'punctuation' : /[{}[\];(),.:]/g
};
| Prism.languages.python= {
'comment': {
pattern: /(^|[^\\])#.*?(\r?\n|$)/g,
lookbehind: true
},
'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/g,
'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/g,
'boolean' : /\b(True|False)\b/g,
'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/g,
'operator' : /[-+]{1,2}|=?<|=?>|!|={1,2}|(&){1,2}|(&){1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/g,
'ignore' : /&(lt|gt|amp);/gi,
'punctuation' : /[{}[\];(),.:]/g
};
| Add support for single quoted multi-line strings in Python | Add support for single quoted multi-line strings in Python
| JavaScript | mit | Conaclos/prism,murtaugh/prism,codedogfish/prism,Golmote/prism,iwatakeshi/prism,iwatakeshi/prism,UnityTech/prism,MakeNowJust/prism,1st1/prism,RobLoach/prism,mcanthony/prism,desertjim/prism,danielberkompas/prism,UnityTech/prism,Golmote/prism,markcarver/prism,desertjim/prism,PrismJS/prism,mooreInteractive/prism,lgiraudel/prism,byverdu/prism,danielberkompas/prism,JustinBeckwith/prism,mooreInteractive/prism,chaosshen/prism,desertjim/prism,alex-zhang/prism,kwangkim/prism,MakeNowJust/prism,gibsjose/prism,nauzilus/prism,mAAdhaTTah/prism,mAAdhaTTah/prism,byverdu/prism,markcarver/prism,CupOfTea696/prism,mcanthony/prism,byverdu/prism,iamsowmyan/prism,danielberkompas/prism,PrismJS/prism,nauzilus/prism,chaosshen/prism,mcanthony/prism,nauzilus/prism,mAAdhaTTah/prism,alex-zhang/prism,alex-zhang/prism,nauzilus/prism,lgiraudel/prism,codedogfish/prism,danielberkompas/prism,PrismJS/prism,aviaryan/prism,PrismJS/prism,JustinBeckwith/prism,zeitgeist87/prism,zeitgeist87/prism,CupOfTea696/prism,kwangkim/prism,RobLoach/prism,EpicTimoZz/prism,iamsowmyan/prism,codedogfish/prism,westonganger/prism,markcarver/prism,chaosshen/prism,mAAdhaTTah/prism,valorkin/prism,iamsowmyan/prism,PrismJS/prism,murtaugh/prism,desertjim/prism,MakeNowJust/prism,aviaryan/prism,aviaryan/prism,byverdu/prism,Golmote/prism,Golmote/prism,jalleyne/prism,jalleyne/prism,valorkin/prism,MakeNowJust/prism,MakeNowJust/prism,codedogfish/prism,nauzilus/prism,Golmote/prism,mAAdhaTTah/prism,EpicTimoZz/prism,manfer/prism,mcanthony/prism,alex-zhang/prism,valorkin/prism,CupOfTea696/prism,manfer/prism,iamsowmyan/prism,CupOfTea696/prism,jcsesecuneta/prism,jcsesecuneta/prism,chaosshen/prism,iwatakeshi/prism,zeitgeist87/prism,iwatakeshi/prism,jalleyne/prism,alex-zhang/prism,zeitgeist87/prism,codedogfish/prism,markcarver/prism,UnityTech/prism,byverdu/prism,CupOfTea696/prism,aviaryan/prism,iamsowmyan/prism,mcanthony/prism,chaosshen/prism,EpicTimoZz/prism,1st1/prism,gibsjose/prism,jalleyne/prism,markcarver/prism,westonganger/prism,desertjim/prism,danielberkompas/prism,zeitgeist87/prism,jalleyne/prism,iwatakeshi/prism,aviaryan/prism | ---
+++
@@ -3,7 +3,7 @@
pattern: /(^|[^\\])#.*?(\r?\n|$)/g,
lookbehind: true
},
- 'string': /"""[\s\S]+?"""|("|')(\\?.)*?\1/g,
+ 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/g,
'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/g,
'boolean' : /\b(True|False)\b/g,
'number' : /\b-?(0x)?\d*\.?[\da-f]+\b/g, |
92ea30a750cc604cf72df36d8a18a95eb52946e6 | src/app/core/constants/constants.js | src/app/core/constants/constants.js | 'use strict';
angular.module('koastAdminApp.core.constants', [])
.factory('constants', function() {
return {
adminPath: 'http://localhost:3000/admin',
// TODO make this a server side configuration option and add endpoints to
// facilitate selection
awsBucket: 'rvaiya-development'
};
});
| 'use strict';
angular.module('koastAdminApp.core.constants', [])
.factory('constants', function () {
return {
adminPath: 'http://localhost:3000/admin',
// TODO make this a server side configuration option and add endpoints to
// facilitate selection
awsBucket: 'test-koast'
};
}); | Update aws-bucket to use koast test | Update aws-bucket to use koast test
| JavaScript | mit | rangle/koast-admin-app | ---
+++
@@ -1,11 +1,11 @@
'use strict';
angular.module('koastAdminApp.core.constants', [])
- .factory('constants', function() {
+ .factory('constants', function () {
return {
adminPath: 'http://localhost:3000/admin',
// TODO make this a server side configuration option and add endpoints to
// facilitate selection
- awsBucket: 'rvaiya-development'
+ awsBucket: 'test-koast'
};
}); |
5593f17adeb3e8e0e8342aa807c97593ad87884c | src/angular-humanize.js | src/angular-humanize.js | (function( angular ) {
'use strict';
angular.module('angular-humanize', []).
filter('humanizeFilesize', function () {
return function ( input, decimals, decPoint, thousandsSep ) {
if ( isNaN(parseInt(input)) ) { return input; }
return humanize.filesize(parseInt(input, decimals || 2, decPoint || '.', thousandsSep || ','));
};
}).
filter('humanizeOrdinal', function () {
return function ( input ) {
if ( parseInt(input) !== input ) { return input; }
return humanize.ordinal(input);
};
}).
filter('humanizeNaturalDay', function () {
return function ( input ) {
if ( parseInt(input) !== input ) { return input; }
return humanize.naturalDay(input);
};
}).
filter('humanizeRelativeTime', function () {
return function ( input ) {
if ( parseInt(input) !== input ) { return input; }
return humanize.relativeTime(input);
};
});
}( angular ));
| (function( angular ) {
'use strict';
angular.module('angular-humanize', []).
filter('humanizeFilesize', function () {
return function ( input, kilo, decimals, decPoint, thousandsSep ) {
if ( isNaN(parseInt(input)) ) { return input; }
return humanize.filesize(parseInt(input, kilo || undefined, decimals || undefined, decPoint || undefined, thousandsSep || undefined));
};
}).
filter('humanizeOrdinal', function () {
return function ( input ) {
if ( parseInt(input) !== input ) { return input; }
return humanize.ordinal(input);
};
}).
filter('humanizeNaturalDay', function () {
return function ( input ) {
if ( parseInt(input) !== input ) { return input; }
return humanize.naturalDay(input);
};
}).
filter('humanizeRelativeTime', function () {
return function ( input ) {
if ( parseInt(input) !== input ) { return input; }
return humanize.relativeTime(input);
};
});
}( angular ));
| Fix 'kilo' arg was missing' | Fix 'kilo' arg was missing'
| JavaScript | mit | sirap-group/angularjs-humanize,rbecheras/angularjs-humanize,rbecheras/angularjs-humanize,sirap-group/angularjs-humanize | ---
+++
@@ -3,9 +3,9 @@
angular.module('angular-humanize', []).
filter('humanizeFilesize', function () {
- return function ( input, decimals, decPoint, thousandsSep ) {
+ return function ( input, kilo, decimals, decPoint, thousandsSep ) {
if ( isNaN(parseInt(input)) ) { return input; }
- return humanize.filesize(parseInt(input, decimals || 2, decPoint || '.', thousandsSep || ','));
+ return humanize.filesize(parseInt(input, kilo || undefined, decimals || undefined, decPoint || undefined, thousandsSep || undefined));
};
}).
filter('humanizeOrdinal', function () { |
6d75199c8a7c31556b6c08d66775ee2f875b8868 | lib/plugins/renderer/swig.js | lib/plugins/renderer/swig.js | var swig = require('swig');
swig.setDefaults({
cache: false
});
module.exports = function(data, locals){
return swig.render(data.text, {
locals: locals,
filename: data.path
});
}; | var swig = require('swig'),
forTag = require('swig/lib/tags/for');
swig.setDefaults({
cache: false
});
// Hack: Override for tag of Swig
swig.setTag('for', forTag.parse, function(compiler, args, content, parents, options, blockName){
var compile = forTag.compile.apply(this, arguments).split('\n');
compile.splice(3, 0, ' if (!Array.isArray(__l) && typeof __l.toArray === "function") { __l = __l.toArray(); }');
return compile.join('\n');
}, forTag.ends, true);
module.exports = function(data, locals){
return swig.render(data.text, {
locals: locals,
filename: data.path
});
}; | Make Swig capable for Warehouse query instance | Make Swig capable for Warehouse query instance
| JavaScript | mit | G-g-beringei/hexo,delkyd/hexo,luodengxiong/hexo,elegantwww/hexo,DevinLow/DevinLow.github.io,ppker/hexo,SaiNadh001/hexo,zhangg/hexo,r4-keisuke/hexo,zongkelong/hexo,liuhongjiang/hexo,hugoxia/hexo,maominghui/hexo,fuchao2012/hexo,JasonMPE/hexo,aulphar/hexo,wangjordy/wangjordy.github.io,wenzhucjy/hexo,kennethlyn/hexo,zhi1ong/hexo,leikegeek/hexo,nextexit/hexo,k2byew/hexo,jp1017/hexo,biezhihua/hexo,ChaofengZhou/hexo,Richardphp/hexo,iamprasad88/hexo,xcatliu/hexo,allengaller/hexo,beni55/hexo,zhipengyan/hexo,wyfyyy818818/hexo,hexojs/hexo,liukaijv/hexo,gaojinhua/hexo,littledogboy/hexo,Carbs0126/hexo,BruceChao/hexo,registercosmo/hexo,DanielHit/hexo,oomusou/hexo,luinnx/hexo,xiaoliuzi/hexo,tzq668766/hexo,will-zhangweilin/myhexo,sundyxfan/hexo,sailtoy/hexo,noikiy/hexo,imjerrybao/hexo,viethang/hexo,tibic/hexo,Regis25489/hexo,hexojs/hexo,zhoulingjun/hexo,HiWong/hexo,xushuwei202/hexo,meaverick/hexo,lknny/hexo,chenbojian/hexo,amobiz/hexo,ppker/hexo,Bob1993/hexo,znanl/znanl,lukw00/hexo,glabcn/hexo,HcySunYang/hexo,haoyuchen1992/hexo,DevinLow/DevinLow.github.io,GGuang/hexo,memezilla/hexo,hanhailong/hexo,hackjustu/hexo,jollylulu/hexo,wangjordy/wangjordy.github.io,logonmy/hexo,noname007/hexo-1,leelynd/tapohuck,wwff/hexo,initiumlab/hexo,jonesgithub/hexo,kywk/hexi,zhipengyan/hexo,wflmax/hexo,magicdawn/hexo,dreamren/hexo,kywk/hexi,keeleys/hexo,crystalwm/hexo,dieface/hexo,runlevelsix/hexo,SampleLiao/hexo,lookii/looki,Gtskk/hexo,zoubin/hexo,XGHeaven/hexo,Jeremy017/hexo,karenpeng/hexo,chenzaichun/hexo | ---
+++
@@ -1,8 +1,18 @@
-var swig = require('swig');
+var swig = require('swig'),
+ forTag = require('swig/lib/tags/for');
swig.setDefaults({
cache: false
});
+
+// Hack: Override for tag of Swig
+swig.setTag('for', forTag.parse, function(compiler, args, content, parents, options, blockName){
+ var compile = forTag.compile.apply(this, arguments).split('\n');
+
+ compile.splice(3, 0, ' if (!Array.isArray(__l) && typeof __l.toArray === "function") { __l = __l.toArray(); }');
+
+ return compile.join('\n');
+}, forTag.ends, true);
module.exports = function(data, locals){
return swig.render(data.text, { |
99a504052b88d736944dd507d36fa8e6b822660c | content.js | content.js | // Obtain ALL anchors on the page.
var links = document.links;
// The previous/next urls if they exist.
var previous = findHref("prev");
var next = findHref("next");
/**
* Find the href for a given name.
* @param {String} The name of the anchor to search for.
* @return {String} The href for a given tag, otherwise an empty string.
*/
function findHref(name) {
for (var index = 0; index < links.length; ++index) {
// The complete anchor HTML element (<a>).
var anchor = links[index];
// Not all anchors have text, rels or classes defined.
var rel = (anchor.rel !== undefined) ? anchor.rel : '';
var text = (anchor.text !== undefined) ? anchor.text.toLowerCase() : '';
var class_name = (anchor.className !== undefined) ? anchor.className : '';
if (rel.indexOf(name) > -1 || text.indexOf(name) > -1 || class_name.indexOf(name) > -1) {
return anchor.href;
}
}
}
// Go to the next/previous pages using the arrow keys.
document.addEventListener('keydown', function(event) {
if(event.keyCode == 37) {
if (previous) chrome.extension.sendMessage({redirect: previous});
}
else if(event.keyCode == 39) {
if (next) chrome.extension.sendMessage({redirect: next});
}
});
| // Obtain ALL anchors on the page.
var links = document.links;
// The previous/next urls if they exist.
var prev = findHref("prev");
var next = findHref("next");
/**
* Find the href for a given name.
* @param {String} The name of the anchor to search for.
* @return {String} The href for a given tag, otherwise an empty string.
*/
function findHref(name) {
for (var index = 0; index < links.length; ++index) {
// The complete anchor HTML element (<a>).
var anchor = links[index];
// Not all anchors have text, rels or classes defined.
var rel = (anchor.rel !== undefined) ? anchor.rel : '';
var text = (anchor.text !== undefined) ? anchor.text.toLowerCase() : '';
var class_name = (anchor.className !== undefined) ? anchor.className : '';
if (rel.indexOf(name) > -1 || text.indexOf(name) > -1 || class_name.indexOf(name) > -1) {
return anchor.href;
}
}
}
// Go to the next/previous pages using the arrow keys.
document.addEventListener('keydown', function(event) {
if(event.keyCode == 37) {
if (prev) chrome.extension.sendMessage({redirect: prev});
}
else if(event.keyCode == 39) {
if (next) chrome.extension.sendMessage({redirect: next});
}
});
| Rename previous to prev for consistency. | Rename previous to prev for consistency.
| JavaScript | mit | jawrainey/leftyrighty | ---
+++
@@ -2,7 +2,7 @@
var links = document.links;
// The previous/next urls if they exist.
-var previous = findHref("prev");
+var prev = findHref("prev");
var next = findHref("next");
/**
@@ -27,7 +27,7 @@
// Go to the next/previous pages using the arrow keys.
document.addEventListener('keydown', function(event) {
if(event.keyCode == 37) {
- if (previous) chrome.extension.sendMessage({redirect: previous});
+ if (prev) chrome.extension.sendMessage({redirect: prev});
}
else if(event.keyCode == 39) {
if (next) chrome.extension.sendMessage({redirect: next}); |
7b3d58e1a8f357954a131fcc313a1e11888fe849 | src/index.js | src/index.js | // Loaded ready states
const loadedStates = ['interactive', 'complete'];
// Return Promise
module.exports = (cb, doc) => new Promise(resolve => {
// Allow doc to be passed in as the lone first param
if (cb && typeof cb !== 'function') {
doc = cb;
cb = null;
}
// Use global document if we don't have one
doc = doc || window.document;
// Handle DOM load
const done = () => resolve(cb && cb());
// Resolve now if DOM has already loaded
// Otherwise wait for DOMContentLoaded
if (loadedStates.includes(doc.readyState)) {
done();
} else {
doc.addEventListener('DOMContentLoaded', done);
}
});
| // Loaded ready states
const loadedStates = ['interactive', 'complete'];
// Return Promise
const domLoaded = (cb, doc) => new Promise(resolve => {
// Allow doc to be passed in as the lone first param
if (cb && typeof cb !== 'function') {
doc = cb;
cb = null;
}
// Use global document if we don't have one
doc = doc || window.document;
// Handle DOM load
const done = () => resolve(cb && cb());
// Resolve now if DOM has already loaded
// Otherwise wait for DOMContentLoaded
if (loadedStates.includes(doc.readyState)) {
done();
} else {
doc.addEventListener('DOMContentLoaded', done);
}
});
// Promise chain helper
domLoaded.wait = doc => data => domLoaded(doc).then(() => data);
module.exports = domLoaded;
| Add Promise chain helper method | Add Promise chain helper method
| JavaScript | mit | lukechilds/when-dom-ready | ---
+++
@@ -2,7 +2,7 @@
const loadedStates = ['interactive', 'complete'];
// Return Promise
-module.exports = (cb, doc) => new Promise(resolve => {
+const domLoaded = (cb, doc) => new Promise(resolve => {
// Allow doc to be passed in as the lone first param
if (cb && typeof cb !== 'function') {
doc = cb;
@@ -23,3 +23,8 @@
doc.addEventListener('DOMContentLoaded', done);
}
});
+
+// Promise chain helper
+domLoaded.wait = doc => data => domLoaded(doc).then(() => data);
+
+module.exports = domLoaded; |
5ca3f353dabbd9f0d44277f8ecba6a895a4a4468 | src/index.js | src/index.js | module.exports = function mutableProxyFactory(defaultTarget) {
let mutableHandler;
let mutableTarget;
function setTarget(target) {
if (!(target instanceof Object)) {
throw new Error(`Target "${target}" is not an object`);
}
mutableTarget = target;
}
function setHandler(handler) {
Object.keys(handler).forEach(key => {
const value = handler[key];
if (typeof value !== 'function') {
throw new Error(`Trap "${key}: ${value}" is not a function`);
}
if (!Reflect[key]) {
throw new Error(`Trap "${key}: ${value}" is not a valid trap`);
}
});
mutableHandler = handler;
}
if (defaultTarget) {
setTarget(defaultTarget);
}
setHandler(Reflect);
// Dynamically forward all the traps to the associated methods on the mutable handler
const handler = new Proxy({}, {
get(target, property) {
return (...args) => mutableHandler[property].apply(null, [mutableTarget, ...args.slice(1)]);
}
});
return {
setTarget,
setHandler,
getTarget() {
return mutableTarget;
},
getHandler() {
return mutableHandler;
},
proxy: new Proxy(() => {}, handler)
};
};
| module.exports = function mutableProxyFactory(defaultTarget) {
let mutableHandler;
let mutableTarget;
function setTarget(target) {
if (!(target instanceof Object)) {
throw new Error(`Target "${target}" is not an object`);
}
mutableTarget = target;
}
function setHandler(handler) {
Object.keys(handler).forEach(key => {
const value = handler[key];
if (typeof value !== 'function') {
throw new Error(`Trap "${key}: ${value}" is not a function`);
}
if (!Reflect[key]) {
throw new Error(`Trap "${key}: ${value}" is not a valid trap`);
}
});
mutableHandler = handler;
}
setTarget(() => {});
if (defaultTarget) {
setTarget(defaultTarget);
}
setHandler(Reflect);
// Dynamically forward all the traps to the associated methods on the mutable handler
const handler = new Proxy({}, {
get(target, property) {
return (...args) => mutableHandler[property].apply(null, [mutableTarget, ...args.slice(1)]);
}
});
return {
setTarget,
setHandler,
getTarget() {
return mutableTarget;
},
getHandler() {
return mutableHandler;
},
proxy: new Proxy(mutableTarget, handler)
};
};
| Revert to setting target with noOp | Revert to setting target with noOp
| JavaScript | mit | Griffingj/mutable-proxy | ---
+++
@@ -23,6 +23,7 @@
});
mutableHandler = handler;
}
+ setTarget(() => {});
if (defaultTarget) {
setTarget(defaultTarget);
@@ -46,6 +47,6 @@
getHandler() {
return mutableHandler;
},
- proxy: new Proxy(() => {}, handler)
+ proxy: new Proxy(mutableTarget, handler)
};
}; |
acbd27582dd9c9ff1572fe06d37d740452a6631d | src/index.js | src/index.js | 'use strict';
import assign from 'lodash.assign';
import ResultList from './result-list';
const requiredDefaults = {
page: 1,
per_page: 20,
};
const pixabayjs = {
_auth: {},
_makeConfig: function(url, opts) {
const urlObj = { url };
return assign({}, requiredDefaults, urlObj, this.defaults, this._auth,
opts);
},
defaults: {},
authenticate: function(key) {
this._auth.key = key;
},
imageResultList: function(search, opts, onSuccess, onFailure) {
const url = 'https://pixabay.com/api';
const conf = this._makeConfig(url, opts);
return new ResultList(search, conf, onSuccess, onFailure);
},
videoResultList: function(search, opts, onSuccess, onFailure) {
const url = 'https://pixabay.com/api/videos';
const conf = this._makeConfig(url, opts);
return new ResultList(search, conf, onSuccess, onFailure);
}
};
export default pixabayjs;
module.exports = pixabayjs;
| 'use strict';
import assign from 'lodash.assign';
import path from 'path';
import url from 'url';
import ResultList from './result-list';
const requiredDefaults = {
page: 1,
per_page: 20,
url: 'https://pixabay.com/api'
};
const pixabayjs = {
_auth: {},
_makeConfig: function(endpoint, opts) {
const conf = assign({}, requiredDefaults, this.defaults, this._auth, opts);
const urlObj = url.parse(conf.url);
urlObj.pathname = path.join(urlObj.pathname, endpoint, '/');
conf.url = url.format(urlObj);
return conf;
},
defaults: {},
authenticate: function(key) {
this._auth.key = key;
},
imageResultList: function(search, opts, onSuccess, onFailure) {
const conf = this._makeConfig('', opts);
return new ResultList(search, conf, onSuccess, onFailure);
},
videoResultList: function(search, opts, onSuccess, onFailure) {
const conf = this._makeConfig('videos', opts);
return new ResultList(search, conf, onSuccess, onFailure);
}
};
export default pixabayjs;
module.exports = pixabayjs;
| Enable overriding of the default url | Enable overriding of the default url
| JavaScript | mit | yola/pixabayjs | ---
+++
@@ -1,20 +1,28 @@
'use strict';
import assign from 'lodash.assign';
+import path from 'path';
+import url from 'url';
+
import ResultList from './result-list';
const requiredDefaults = {
page: 1,
per_page: 20,
+ url: 'https://pixabay.com/api'
};
const pixabayjs = {
_auth: {},
- _makeConfig: function(url, opts) {
- const urlObj = { url };
- return assign({}, requiredDefaults, urlObj, this.defaults, this._auth,
- opts);
+ _makeConfig: function(endpoint, opts) {
+ const conf = assign({}, requiredDefaults, this.defaults, this._auth, opts);
+ const urlObj = url.parse(conf.url);
+
+ urlObj.pathname = path.join(urlObj.pathname, endpoint, '/');
+ conf.url = url.format(urlObj);
+
+ return conf;
},
defaults: {},
@@ -24,14 +32,12 @@
},
imageResultList: function(search, opts, onSuccess, onFailure) {
- const url = 'https://pixabay.com/api';
- const conf = this._makeConfig(url, opts);
+ const conf = this._makeConfig('', opts);
return new ResultList(search, conf, onSuccess, onFailure);
},
videoResultList: function(search, opts, onSuccess, onFailure) {
- const url = 'https://pixabay.com/api/videos';
- const conf = this._makeConfig(url, opts);
+ const conf = this._makeConfig('videos', opts);
return new ResultList(search, conf, onSuccess, onFailure);
}
}; |
5804f9be7d4fbe5a5347cd65c15d4d66dfef6cfd | src/index.js | src/index.js | import postcss from 'postcss';
import Core from 'css-modules-loader-core';
import Parser from 'css-modules-loader-core/lib/parser';
import FileSystemLoader from 'css-modules-loader-core/lib/file-system-loader';
import generateScopedName from './generateScopedName';
import saveJSON from './saveJSON';
module.exports = postcss.plugin('postcss-modules', (opts = {}) => {
Core.scope.generateScopedName = opts.generateScopedName || generateScopedName;
const getJSON = opts.getJSON || saveJSON;
return (css, result) => {
const resultPlugins = result.processor.plugins
.filter(plugin => plugin.postcssPlugin !== 'postcss-modules');
const plugins = [
Core.values,
Core.localByDefault,
Core.extractImports,
Core.scope,
...resultPlugins,
];
const loader = new FileSystemLoader('/', plugins);
const parser = new Parser(loader.fetch.bind(loader));
const promise = new Promise(resolve => {
postcss([...plugins, parser.plugin])
.process(css, { from: css.source.input.file })
.then(() => {
Object.keys(loader.sources).forEach(key => {
css.prepend(loader.sources[key]);
});
getJSON(css.source.input.file, parser.exportTokens);
resolve();
});
});
return promise;
};
});
| import postcss from 'postcss';
import Core from 'css-modules-loader-core';
import Parser from 'css-modules-loader-core/lib/parser';
import FileSystemLoader from 'css-modules-loader-core/lib/file-system-loader';
import generateScopedName from './generateScopedName';
import saveJSON from './saveJSON';
module.exports = postcss.plugin('postcss-modules', (opts = {}) => {
Core.scope.generateScopedName = opts.generateScopedName || generateScopedName;
const getJSON = opts.getJSON || saveJSON;
return (css, result) => {
const resultPlugins = result.processor.plugins
.filter(plugin => plugin.postcssPlugin !== 'postcss-modules');
const plugins = [
Core.values,
Core.localByDefault,
Core.extractImports,
Core.scope,
...resultPlugins,
];
const loader = typeof opts.Loader === 'function' ?
new opts.Loader('/', plugins) :
new FileSystemLoader('/', plugins);
const parser = new Parser(loader.fetch.bind(loader));
const promise = new Promise(resolve => {
postcss([...plugins, parser.plugin])
.process(css, { from: css.source.input.file })
.then(() => {
Object.keys(loader.sources).forEach(key => {
css.prepend(loader.sources[key]);
});
getJSON(css.source.input.file, parser.exportTokens);
resolve();
});
});
return promise;
};
});
| Add support for custom `Loader` via `opts` | Add support for custom `Loader` via `opts`
Allow for a custom `Loader` implementation to be passed in via `opts`.
| JavaScript | mit | css-modules/postcss-modules,outpunk/postcss-modules | ---
+++
@@ -22,7 +22,10 @@
...resultPlugins,
];
- const loader = new FileSystemLoader('/', plugins);
+ const loader = typeof opts.Loader === 'function' ?
+ new opts.Loader('/', plugins) :
+ new FileSystemLoader('/', plugins);
+
const parser = new Parser(loader.fetch.bind(loader));
const promise = new Promise(resolve => { |
1a596251f5d13bdf38b010a010b02a3fcaefd053 | resources/assets/components/Users/UserInformation.js | resources/assets/components/Users/UserInformation.js | import React from 'react';
import { map } from 'lodash';
import { displayUserInfo, displayCityState } from '../../helpers';
const UserInformation = (props) => (
<div>
{props.user.length ?
<div className="container -padded">
{props.linkSignup ?
<h2 className="heading"><a href={`/signups/${props.linkSignup}`}>{displayUserInfo(props.user.first_name, props.user.last_name, props.user.birthdate)}</a></h2>
:
<h2 className="heading">{displayUserInfo(props.user.first_name, props.user.last_name, props.user.birthdate)}</h2>
}
<p>
{props.user.email ? <span>{props.user.email}<br/></span>: null}
{props.user.mobile ? <span>{props.user.mobile}<br/></span> : null }
{displayCityState(props.user.addr_city, props.user.addr_state) ? <span>{displayCityState(props.user.addr_city, props.user.addr_state) }<br/></span> : null }
</p>
</div>
:
<h2 className="heading">User Not Found</h2>
}
{props.children}
</div>
);
export default UserInformation;
| import React from 'react';
import { map, isEmpty } from 'lodash';
import { displayUserInfo, displayCityState } from '../../helpers';
const UserInformation = (props) => (
<div>
{!isEmpty(props.user) ?
<div className="container -padded">
{props.linkSignup ?
<h2 className="heading"><a href={`/signups/${props.linkSignup}`}>{displayUserInfo(props.user.first_name, props.user.last_name, props.user.birthdate)}</a></h2>
:
<h2 className="heading">{displayUserInfo(props.user.first_name, props.user.last_name, props.user.birthdate)}</h2>
}
<p>
{props.user.email ? <span>{props.user.email}<br/></span>: null}
{props.user.mobile ? <span>{props.user.mobile}<br/></span> : null }
{displayCityState(props.user.addr_city, props.user.addr_state) ? <span>{displayCityState(props.user.addr_city, props.user.addr_state) }<br/></span> : null }
</p>
</div>
:
<h2 className="heading">User Not Found</h2>
}
{props.children}
</div>
);
export default UserInformation;
| Check for empty user properly | Check for empty user properly
| JavaScript | mit | DoSomething/rogue,DoSomething/rogue,DoSomething/rogue | ---
+++
@@ -1,10 +1,10 @@
import React from 'react';
-import { map } from 'lodash';
+import { map, isEmpty } from 'lodash';
import { displayUserInfo, displayCityState } from '../../helpers';
const UserInformation = (props) => (
<div>
- {props.user.length ?
+ {!isEmpty(props.user) ?
<div className="container -padded">
{props.linkSignup ?
<h2 className="heading"><a href={`/signups/${props.linkSignup}`}>{displayUserInfo(props.user.first_name, props.user.last_name, props.user.birthdate)}</a></h2> |
617fe4c293901b24ccade140ca18cc246fec7fe6 | saiku-bi-platform-plugin-p5/src/main/plugin/components/saikuWidget/SaikuWidgetComponent.js | saiku-bi-platform-plugin-p5/src/main/plugin/components/saikuWidget/SaikuWidgetComponent.js | var saikuWidgetComponent = BaseComponent.extend({
update : function() {
var myself=this;
var htmlId = "#" + myself.htmlObject;
if (myself.saikuFilePath.substr(0,1) == "/") {
myself.saikuFilePath = myself.saikuFilePath.substr(1,myself.saikuFilePath.length - 1 );
}
var parameters = {};
if (myself.parameters) {
_.each(myself.parameters, function(parameter) {
var k = parameter[0];
var v = parameter[1];
if (window.hasOwnProperty(v)) {
v = window[v];
}
parameters[k] = v;
});
}
if (myself.width) {
$(htmlId).width(myself.width);
}
if (myself.width) {
$(htmlId).height(myself.height);
}
if ("table" == myself.renderMode) {
$(htmlId).addClass('workspace_results');
var t = $("<div></div>");
$(htmlId).html(t);
htmlId = t;
}
var myClient = new SaikuClient({
server: "../../../plugin/saiku/api",
path: "/cde-component"
});
myClient.execute({
file: myself.saikuFilePath,
htmlObject: htmlId,
render: myself.renderMode,
mode: myself.renderType,
zoom: true,
params: parameters
});
}
});
| var saikuWidgetComponent = BaseComponent.extend({
update : function() {
var myself=this;
var htmlId = "#" + myself.htmlObject;
if (myself.saikuFilePath.substr(0,1) == "/") {
myself.saikuFilePath = myself.saikuFilePath.substr(1,myself.saikuFilePath.length - 1 );
}
var parameters = {};
if (myself.parameters) {
_.each(myself.parameters, function(parameter) {
var k = parameter[0];
var v = parameter[1];
if (window.hasOwnProperty(v)) {
v = window[v];
}
parameters[k] = v;
});
}
if (myself.width) {
$(htmlId).width(myself.width);
}
if (myself.width) {
$(htmlId).height(myself.height);
}
if ("table" == myself.renderMode) {
$(htmlId).addClass('workspace_results');
var t = $("<div></div>");
$(htmlId).html(t);
htmlId = t;
}
var myClient = new SaikuClient({
server: "/pentaho/plugin/saiku/api",
path: "/cde-component"
});
myClient.execute({
file: myself.saikuFilePath,
htmlObject: htmlId,
render: myself.renderMode,
mode: myself.renderType,
zoom: true,
params: parameters
});
}
});
| Use full path to api in stead of relatieve path | Use full path to api in stead of relatieve path
At this moment a relative path is used (../../../), for the cde saikuWidget. But the preview of the dashboard and the 'normal' view are on a different directory level, so one of them needs an extra ../ Fixed by using the full path /pentaho/plugin/saiku/api But this won't work if somebody use a different 'directory' for pentaho. But I guess that is not a big problem... | JavaScript | apache-2.0 | hengyuan/saiku,newenter/saiku,hengyuan/saiku,hengyuan/saiku,OSBI/saiku,qixiaobo/saiku-self,customme/saiku,customme/saiku,hengyuan/saiku,OSBI/saiku,qixiaobo/saiku-self,OSBI/saiku,qixiaobo/saiku-self,newenter/saiku,customme/saiku,OSBI/saiku,newenter/saiku,newenter/saiku,qixiaobo/saiku-self,customme/saiku,OSBI/saiku | ---
+++
@@ -32,7 +32,7 @@
htmlId = t;
}
var myClient = new SaikuClient({
- server: "../../../plugin/saiku/api",
+ server: "/pentaho/plugin/saiku/api",
path: "/cde-component"
});
|
770088f5505b3e26347373909f03c000a63e6374 | lib/jsdom/browser/utils.js | lib/jsdom/browser/utils.js | "use strict";
exports.NOT_IMPLEMENTED = function (target, nameForErrorMessage) {
return function () {
var raise = target ? target.raise : this.raise;
raise.call(this, "error", "NOT IMPLEMENTED" + (nameForErrorMessage ? ": " + nameForErrorMessage : ""));
};
};
| "use strict";
exports.NOT_IMPLEMENTED = function (target, nameForErrorMessage) {
return function () {
var raise;
var message = "Called NOT_IMPLEMENTED without an element to raise on" +
(nameForErrorMessage ? ": " + nameForErrorMessage : "");
target = target || this;
if (target) {
raise = target.raise;
} else {
if (typeof console !== "undefined" && console.log) {
console.log(new Error(message));
}
return;
}
raise.call(this, "error", message);
};
};
| Fix NOT_IMPLEMENTED to not crash user-code if no target is given | Fix NOT_IMPLEMENTED to not crash user-code if no target is given
| JavaScript | mit | janusnic/jsdom,Ye-Yong-Chi/jsdom,mbostock/jsdom,AshCoolman/jsdom,selam/jsdom,mzgol/jsdom,nicolashenry/jsdom,kevinold/jsdom,nicolashenry/jsdom,sebmck/jsdom,susaing/jsdom,evanlucas/jsdom,snuggs/jsdom,mzgol/jsdom,Joris-van-der-Wel/jsdom,beni55/jsdom,kevinold/jsdom,cpojer/jsdom,aduyng/jsdom,evdevgit/jsdom,aduyng/jsdom,tmpvar/jsdom,danieljoppi/jsdom,lcstore/jsdom,szarouski/jsdom,Joris-van-der-Wel/jsdom,evdevgit/jsdom,susaing/jsdom,AshCoolman/jsdom,vestineo/jsdom,sirbrillig/jsdom,evdevgit/jsdom,medikoo/jsdom,darobin/jsdom,nicolashenry/jsdom,mbostock/jsdom,kesla/jsdom,sebmck/jsdom,kesla/jsdom,vestineo/jsdom,darobin/jsdom,AshCoolman/jsdom,Zirro/jsdom,fiftin/jsdom,Zirro/jsdom,tmpvar/jsdom,Sebmaster/jsdom,zaucy/jsdom,sirbrillig/jsdom,sebmck/jsdom,szarouski/jsdom,zaucy/jsdom,lcstore/jsdom,vestineo/jsdom,Joris-van-der-Wel/jsdom,janusnic/jsdom,evanlucas/jsdom,medikoo/jsdom,robertknight/jsdom,kittens/jsdom,robertknight/jsdom,kittens/jsdom,cpojer/jsdom,jeffcarp/jsdom,Ye-Yong-Chi/jsdom,susaing/jsdom,mzgol/jsdom,medikoo/jsdom,snuggs/jsdom,evanlucas/jsdom,lcstore/jsdom,robertknight/jsdom,fiftin/jsdom,kittens/jsdom,zaucy/jsdom,Ye-Yong-Chi/jsdom,janusnic/jsdom,kesla/jsdom,danieljoppi/jsdom,fiftin/jsdom,mbostock/jsdom,szarouski/jsdom,Sebmaster/jsdom,kevinold/jsdom,darobin/jsdom,selam/jsdom,Sebmaster/jsdom,beni55/jsdom,selam/jsdom,aduyng/jsdom,danieljoppi/jsdom,beni55/jsdom,sirbrillig/jsdom,cpojer/jsdom,jeffcarp/jsdom,jeffcarp/jsdom | ---
+++
@@ -2,7 +2,22 @@
exports.NOT_IMPLEMENTED = function (target, nameForErrorMessage) {
return function () {
- var raise = target ? target.raise : this.raise;
- raise.call(this, "error", "NOT IMPLEMENTED" + (nameForErrorMessage ? ": " + nameForErrorMessage : ""));
+ var raise;
+
+ var message = "Called NOT_IMPLEMENTED without an element to raise on" +
+ (nameForErrorMessage ? ": " + nameForErrorMessage : "");
+
+ target = target || this;
+ if (target) {
+ raise = target.raise;
+ } else {
+ if (typeof console !== "undefined" && console.log) {
+ console.log(new Error(message));
+ }
+
+ return;
+ }
+
+ raise.call(this, "error", message);
};
}; |
95ee51ea2400d8a30b61adce05b0288652235ec7 | localization/jquery-ui-timepicker-pl.js | localization/jquery-ui-timepicker-pl.js | /* German translation for the jQuery Timepicker Addon */
/* Written by Michał Pena */
(function($) {
$.timepicker.regional['pl'] = {
timeOnlyTitle: 'Wybierz godzinę',
timeText: 'Czas',
hourText: 'Godzina',
minuteText: 'Minuta',
secondText: 'Sekunda',
millisecText: 'Milisekunda',
timezoneText: 'Strefa czasowa',
currentText: 'Teraz',
closeText: 'Gotowe',
timeFormat: 'hh:mm tt',
ampm: false
};
$.timepicker.setDefaults($.timepicker.regional['pl']);
})(jQuery);
| /* Polish translation for the jQuery Timepicker Addon */
/* Written by Michał Pena */
(function($) {
$.timepicker.regional['pl'] = {
timeOnlyTitle: 'Wybierz godzinę',
timeText: 'Czas',
hourText: 'Godzina',
minuteText: 'Minuta',
secondText: 'Sekunda',
millisecText: 'Milisekunda',
timezoneText: 'Strefa czasowa',
currentText: 'Teraz',
closeText: 'Gotowe',
timeFormat: 'hh:mm tt',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
ampm: false
};
$.timepicker.setDefaults($.timepicker.regional['pl']);
})(jQuery);
| Add `amNames`/`pmNames` for Polish translation. | Add `amNames`/`pmNames` for Polish translation.
| JavaScript | mit | Jaspersoft/jQuery-Timepicker-Addon,Youraiseme/jQuery-Timepicker-Addon,Jaspersoft/jQuery-Timepicker-Addon,pyonnuka/jQuery-Timepicker-Addon,gaissa/jQuery-Timepicker-Addon,brenosilver/jQuery-Timepicker-Addon,pyonnuka/jQuery-Timepicker-Addon,ssyang0102/jQuery-Timepicker-Addon,brenosilver/jQuery-Timepicker-Addon,trentrichardson/jQuery-Timepicker-Addon,Youraiseme/jQuery-Timepicker-Addon,nicofrand/jQuery-Timepicker-Addon,ssyang0102/jQuery-Timepicker-Addon,gaissa/jQuery-Timepicker-Addon,trentrichardson/jQuery-Timepicker-Addon,nicofrand/jQuery-Timepicker-Addon,ristovskiv/jQuery-Timepicker-Addon,ristovskiv/jQuery-Timepicker-Addon | ---
+++
@@ -1,4 +1,4 @@
-/* German translation for the jQuery Timepicker Addon */
+/* Polish translation for the jQuery Timepicker Addon */
/* Written by Michał Pena */
(function($) {
$.timepicker.regional['pl'] = {
@@ -12,6 +12,8 @@
currentText: 'Teraz',
closeText: 'Gotowe',
timeFormat: 'hh:mm tt',
+ amNames: ['AM', 'A'],
+ pmNames: ['PM', 'P'],
ampm: false
};
$.timepicker.setDefaults($.timepicker.regional['pl']); |
06fa595c5552c3584815d86175663a12d6ead5fa | test/index.js | test/index.js | require('babel/register')({
ignore: false,
only: /.+(?:(?:\.es6\.js)|(?:.jsx))$/,
extensions: ['.js', '.es6.js', '.jsx' ],
sourceMap: true,
});
// lib
require('./lib/titleCase');
require('./lib/formatDifference');
// Even with shallow rendering react currently looks for document when setState is used.
// see https://github.com/facebook/react/issues/4019
global.document = {};
// components
require('./views/components/Modal');
//Layouts
require('./views/layouts/BodyLayout');
// pages
require('./views/pages/Index');
require('./views/pages/userSaved');
| require('babel/register')({
ignore: false,
only: /.+(?:(?:\.es6\.js)|(?:.jsx))$/,
extensions: ['.js', '.es6.js', '.jsx' ],
sourceMap: true,
stage: 0
});
// lib
require('./lib/titleCase');
require('./lib/formatDifference');
// Even with shallow rendering react currently looks for document when setState is used.
// see https://github.com/facebook/react/issues/4019
global.document = {};
// components
require('./views/components/Modal');
//Layouts
require('./views/layouts/BodyLayout');
// pages
require('./views/pages/Index');
require('./views/pages/userSaved');
| Use stage 0 for tests like everything else | Use stage 0 for tests like everything else
| JavaScript | mit | uzi/reddit-mobile,curioussavage/reddit-mobile,madbook/reddit-mobile,DogPawHat/reddit-mobile,uzi/reddit-mobile,uzi/reddit-mobile,DogPawHat/reddit-mobile,madbook/reddit-mobile,curioussavage/reddit-mobile,madbook/reddit-mobile | ---
+++
@@ -3,6 +3,7 @@
only: /.+(?:(?:\.es6\.js)|(?:.jsx))$/,
extensions: ['.js', '.es6.js', '.jsx' ],
sourceMap: true,
+ stage: 0
});
// lib |
e3c9a45adf6d1d339dee4f370752b3271117bc53 | test/index.js | test/index.js | import { join } from 'path'
import assert from 'yeoman-assert'
import helpers from 'yeoman-test'
import pify from 'pify'
import test from 'ava'
test('generates expected files', async t => {
await pify(helpers.testDirectory)(join(__dirname, '..', 'temp'))
const generator = helpers.createGenerator(
'wyze-nm:app', [ '../app' ], null, { skipInstall: true }
)
helpers.mockPrompt(generator, {
module: 'test',
description: 'test',
github: 'test',
url: 'test.com',
})
await pify(generator.run.bind(generator))()
assert.file([
'src/index.js',
'test/index.js',
'.editorconfig',
'.git',
'.gitattributes',
'.gitignore',
'.travis.yml',
'license',
'package.json',
'readme.md',
])
t.pass()
})
| import { join } from 'path'
import assert from 'yeoman-assert'
import helpers from 'yeoman-test'
import pify from 'pify'
import test from 'ava'
test('generates expected files', async t => {
await pify(helpers.testDirectory)(join(__dirname, '..', 'temp'))
const generator = helpers.createGenerator(
'wyze-nm:app', [ '../app' ], null, { skipInstall: true }
)
helpers.mockPrompt(generator, {
module: 'test',
description: 'test',
github: 'test',
url: 'test.com',
// Pass in git name/email for Travis
name: 'travis',
email: 'travis@travis-ci.org',
})
await pify(generator.run.bind(generator))()
assert.file([
'src/index.js',
'test/index.js',
'.editorconfig',
'.git',
'.gitattributes',
'.gitignore',
'.travis.yml',
'license',
'package.json',
'readme.md',
])
t.pass()
})
| Update test to pass in git name/email for Travis | Update test to pass in git name/email for Travis
| JavaScript | mit | wyze/generator-wyze-nm | ---
+++
@@ -16,6 +16,9 @@
description: 'test',
github: 'test',
url: 'test.com',
+ // Pass in git name/email for Travis
+ name: 'travis',
+ email: 'travis@travis-ci.org',
})
await pify(generator.run.bind(generator))() |
e2e0ca3f0585ab245bae91c7a48178454fe96a44 | lib/plugins/__tests__/resolveVersion.js | lib/plugins/__tests__/resolveVersion.js | var PluginDependency = require('../../models/pluginDependency');
var resolveVersion = require('../resolveVersion');
describe('resolveVersion', function() {
it('must skip resolving and return non-semver versions', function(done) {
var plugin = PluginDependency.createFromString('plugin-ga@git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
resolveVersion(plugin)
.then(function(version) {
expect(version).toBe('git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
done();
});
});
});
| var PluginDependency = require('../../models/pluginDependency');
var resolveVersion = require('../resolveVersion');
describe('resolveVersion', function() {
it('must skip resolving and return non-semver versions', function() {
var plugin = PluginDependency.createFromString('ga@git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
return resolveVersion(plugin)
.then(function(version) {
expect(version).toBe('git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
});
});
it('must resolve a normal plugin dependency', function() {
var plugin = PluginDependency.createFromString('ga@>0.9.0 < 1.0.1');
return resolveVersion(plugin)
.then(function(version) {
expect(version).toBe('1.0.0');
});
});
});
| Add test for plugin version resolution | Add test for plugin version resolution
| JavaScript | apache-2.0 | strawluffy/gitbook,GitbookIO/gitbook,gencer/gitbook,gencer/gitbook,tshoper/gitbook,tshoper/gitbook | ---
+++
@@ -2,13 +2,21 @@
var resolveVersion = require('../resolveVersion');
describe('resolveVersion', function() {
- it('must skip resolving and return non-semver versions', function(done) {
- var plugin = PluginDependency.createFromString('plugin-ga@git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
+ it('must skip resolving and return non-semver versions', function() {
+ var plugin = PluginDependency.createFromString('ga@git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
- resolveVersion(plugin)
+ return resolveVersion(plugin)
.then(function(version) {
expect(version).toBe('git+ssh://samy@github.com/GitbookIO/plugin-ga.git');
- done();
+ });
+ });
+
+ it('must resolve a normal plugin dependency', function() {
+ var plugin = PluginDependency.createFromString('ga@>0.9.0 < 1.0.1');
+
+ return resolveVersion(plugin)
+ .then(function(version) {
+ expect(version).toBe('1.0.0');
});
});
}); |
80a66fe8bc8faf3a556486c212d0b7a7beae55fd | workshop/www/js/ClickListeners.js | workshop/www/js/ClickListeners.js | var getRecipeEvent = function(apiRequest){
$('.container').on('click', '.recipe-container', function(event) {
var $target = $(event.target);
var recipeId = $target.closest('.recipe-container')[0].dataset.recipeid;
apiRequest(recipeId);
});
}; | var getRecipeEvent = function(apiRequest){
$('.container').on('click', '.recipe-container', function(event) {
var $target = $(event.target);
var recipeId = $target.closest('.recipe-container')[0].dataset.recipeid;
apiRequest(recipeId);
});
};
var getSignUpFormEvent = function(){
$('.container').on('click', '.signup-link', function(event) {
event.preventDefault();
var loginTemplate = Mustache.render($('#sign-up-template').html());
$('.navbar-collapse').collapse('toggle')
$('.content-container').html(loginTemplate);
});
}; | Add getSignUpFormEvent function to clickListeners.js | Add getSignUpFormEvent function to clickListeners.js
| JavaScript | mit | danasselin/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook | ---
+++
@@ -5,3 +5,12 @@
apiRequest(recipeId);
});
};
+
+var getSignUpFormEvent = function(){
+ $('.container').on('click', '.signup-link', function(event) {
+ event.preventDefault();
+ var loginTemplate = Mustache.render($('#sign-up-template').html());
+ $('.navbar-collapse').collapse('toggle')
+ $('.content-container').html(loginTemplate);
+ });
+}; |
f1ff39a9ddc93b1c24c080b536e608c75dad0d32 | test/server/middleware/correlation-id.spec.js | test/server/middleware/correlation-id.spec.js | /*
* Copyright (c) 2015-2017 Steven Soloff
*
* This is free software: you can redistribute it and/or modify it under the
* terms of the MIT License (https://opensource.org/licenses/MIT).
* This software comes with ABSOLUTELY NO WARRANTY.
*/
'use strict'
const correlationId = require('../../../src/server/middleware/correlation-id')
describe('correlationId', () => {
describe('correlator', () => {
let correlator
let next
let req
let res
beforeEach(() => {
correlator = correlationId()
next = jasmine.createSpy('next')
req = {
get: jasmine.createSpy('get')
}
res = {
set: jasmine.createSpy('set')
}
})
it('should invoke the next middleware in the chain', () => {
correlator(req, res, next)
expect(next).toHaveBeenCalled()
})
describe('when the request contains a request ID', () => {
it('should echo the request ID as the correlation ID in the response', () => {
const requestId = 'the-request-id'
req.get.and.returnValue(requestId)
correlator(req, res, next)
expect(req.get).toHaveBeenCalledWith('X-Request-ID')
expect(res.set).toHaveBeenCalledWith('X-Correlation-ID', requestId)
})
})
describe('when the request does not contain a request ID', () => {
it('should not modify the response', () => {
correlator(req, res, next)
expect(res.set).not.toHaveBeenCalled()
})
})
})
})
| /*
* Copyright (c) 2015-2017 Steven Soloff
*
* This is free software: you can redistribute it and/or modify it under the
* terms of the MIT License (https://opensource.org/licenses/MIT).
* This software comes with ABSOLUTELY NO WARRANTY.
*/
'use strict'
const middleware = require('../../../src/server/middleware')
describe('correlationId', () => {
describe('correlator', () => {
let correlator
let next
let req
let res
beforeEach(() => {
correlator = middleware.correlationId()
next = jasmine.createSpy('next')
req = {
get: jasmine.createSpy('get')
}
res = {
set: jasmine.createSpy('set')
}
})
it('should invoke the next middleware in the chain', () => {
correlator(req, res, next)
expect(next).toHaveBeenCalled()
})
describe('when the request contains a request ID', () => {
it('should echo the request ID as the correlation ID in the response', () => {
const requestId = 'the-request-id'
req.get.and.returnValue(requestId)
correlator(req, res, next)
expect(req.get).toHaveBeenCalledWith('X-Request-ID')
expect(res.set).toHaveBeenCalledWith('X-Correlation-ID', requestId)
})
})
describe('when the request does not contain a request ID', () => {
it('should not modify the response', () => {
correlator(req, res, next)
expect(res.set).not.toHaveBeenCalled()
})
})
})
})
| Access individual middleware through aggregating module | Access individual middleware through aggregating module
| JavaScript | mit | ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js | ---
+++
@@ -8,7 +8,7 @@
'use strict'
-const correlationId = require('../../../src/server/middleware/correlation-id')
+const middleware = require('../../../src/server/middleware')
describe('correlationId', () => {
describe('correlator', () => {
@@ -18,7 +18,7 @@
let res
beforeEach(() => {
- correlator = correlationId()
+ correlator = middleware.correlationId()
next = jasmine.createSpy('next')
req = {
get: jasmine.createSpy('get') |
b501809dc65e10454c15a871301b9791ac53202d | Gulpfile.js | Gulpfile.js | var Gulp = require('gulp'),
Linoleum = require('linoleum');
var $jsFiles = Linoleum.jsFiles;
Linoleum.jsFiles = function() {
return $jsFiles().concat('tasks/*.js', 'index.js');
};
require('./index');
Gulp.task('build', ['clean', 'lint'], function(done) {
Linoleum.runTask('babel', done);
});
Gulp.task('test', ['build'], function(done) {
Linoleum.runTask('test:mocha', done);
});
Gulp.task('cover', ['build'], function(done) {
Linoleum.runTask(['cover:mocha', 'cover:report'], done);
});
Linoleum.watch(Linoleum.jsFiles(), 'cover');
Gulp.task('travis', function(done) {
// These need to be run in series to prevent issues with error tracking
Linoleum.runTask(['cover', 'test'], done);
});
Gulp.task('default', ['cover']);
| var Gulp = require('gulp'),
Linoleum = require('linoleum');
require('./index');
Gulp.task('build', ['clean', 'lint'], function(done) {
Linoleum.runTask('babel', done);
});
Gulp.task('test', ['build'], function(done) {
Linoleum.runTask('test:mocha', done);
});
Gulp.task('cover', ['build'], function(done) {
Linoleum.runTask(['cover:mocha', 'cover:report'], done);
});
Linoleum.watch(Linoleum.jsFiles(), 'cover');
Gulp.task('travis', function(done) {
// These need to be run in series to prevent issues with error tracking
Linoleum.runTask(['cover', 'test'], done);
});
Gulp.task('default', ['cover']);
require('linoleum/Gulpfile.local');
| Use gulp local for self test | Use gulp local for self test | JavaScript | mit | kpdecker/linoleum-node | ---
+++
@@ -1,11 +1,6 @@
var Gulp = require('gulp'),
Linoleum = require('linoleum');
-
-var $jsFiles = Linoleum.jsFiles;
-Linoleum.jsFiles = function() {
- return $jsFiles().concat('tasks/*.js', 'index.js');
-};
require('./index');
@@ -27,3 +22,4 @@
});
Gulp.task('default', ['cover']);
+require('linoleum/Gulpfile.local'); |
c4affba6c1794ac80bf5b88bb84001c96d94470c | graphql/utils/redis.js | graphql/utils/redis.js | // FIXME: debugging only.
/* eslint-disable */
// import fetch from 'node-fetch'
const callRedis = async data => {
try {
console.log(
'===== Calling Redis service =====',
process.env.redisServiceEndpoint
)
} catch (e) {
console.log('Error calling Redis service', e)
}
}
export default callRedis
| // FIXME: debugging only.
/* eslint-disable */
import fetch from 'node-fetch'
const callRedis = async data => {
let responseData
try {
console.log(
'===== Calling Redis service =====',
process.env.redisServiceEndpoint
)
const response = await fetch(process.env.redisServiceEndpoint, {
method: 'POST',
})
responseData = response.json()
} catch (e) {
console.log('Error calling Redis service', e)
}
console.log('===== Redis service response data =====', responseData)
}
export default callRedis
| Add test request to Redis service | Add test request to Redis service
| JavaScript | mpl-2.0 | gladly-team/tab,gladly-team/tab,gladly-team/tab | ---
+++
@@ -1,16 +1,22 @@
// FIXME: debugging only.
/* eslint-disable */
-// import fetch from 'node-fetch'
+import fetch from 'node-fetch'
const callRedis = async data => {
+ let responseData
try {
console.log(
'===== Calling Redis service =====',
process.env.redisServiceEndpoint
)
+ const response = await fetch(process.env.redisServiceEndpoint, {
+ method: 'POST',
+ })
+ responseData = response.json()
} catch (e) {
console.log('Error calling Redis service', e)
}
+ console.log('===== Redis service response data =====', responseData)
}
export default callRedis |
b980aa73e21676414e9ac75d7138483d1de922a6 | app/static/main.js | app/static/main.js | // Main Module for searchthedocs demo
define(function (require) {
var _ = require('underscore'),
$ = require('jquery'),
SearchTheDocsView = require('searchthedocs/src/searchthedocs');
var searchthedocs_main = function() {
window.searchtd = new SearchTheDocsView({
el: '#searchthedocs',
});
};
return searchthedocs_main;
});
| // Main Module for searchthedocs demo
define(function (require) {
var _ = require('underscore'),
$ = require('jquery'),
SearchTheDocsView = require('searchthedocs/src/searchthedocs');
var searchthedocs_main = function() {
window.searchtd = new SearchTheDocsView({
el: '#searchthedocs',
brand: 'searchthedocs',
brand_href: '#'
});
};
return searchthedocs_main;
});
| Send brand and brand_href into SearchTheDocsView | Send brand and brand_href into SearchTheDocsView
| JavaScript | mit | searchthedocs/searchthedocs-rtd,searchthedocs/searchthedocs-rtd | ---
+++
@@ -8,6 +8,8 @@
window.searchtd = new SearchTheDocsView({
el: '#searchthedocs',
+ brand: 'searchthedocs',
+ brand_href: '#'
});
}; |
b05662b9ef789d58867ce62de041ce59434107c7 | addon/adapters/user.js | addon/adapters/user.js | import OsfAdapter from './osf-adapter';
import Ember from 'ember';
export default OsfAdapter.extend({
findHasMany(store, snapshot, url, relationship) {
var id = snapshot.id;
var type = snapshot.modelName;
url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));
// If fetching user nodes, will embed root and parent. (@hmoco 12-27-17: why?)
if (relationship.type === 'node') {
url += '?embed=parent&embed=root';
// TODO: revisit this, we shouldnt hard code any embeds
if (snapshot.record.get('__' + relationship.key + 'QueryParams')) {
url += '&' + Ember.$.param(snapshot.record.get('__' + relationship.key + 'QueryParams'));
}
} else if (snapshot.record.get('query-params')) {
url += '?' + Ember.$.param(snapshot.record.get('query-params'));
}
return this.ajax(url, 'GET');
}
});
| import OsfAdapter from './osf-adapter';
import Ember from 'ember';
export default OsfAdapter.extend({
});
| Remove unused findHasMany method on osfadapter | Remove unused findHasMany method on osfadapter
| JavaScript | apache-2.0 | baylee-d/ember-osf,CenterForOpenScience/ember-osf,baylee-d/ember-osf,jamescdavis/ember-osf,binoculars/ember-osf,CenterForOpenScience/ember-osf,jamescdavis/ember-osf,binoculars/ember-osf | ---
+++
@@ -2,22 +2,4 @@
import Ember from 'ember';
export default OsfAdapter.extend({
- findHasMany(store, snapshot, url, relationship) {
- var id = snapshot.id;
- var type = snapshot.modelName;
-
- url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));
-
- // If fetching user nodes, will embed root and parent. (@hmoco 12-27-17: why?)
- if (relationship.type === 'node') {
- url += '?embed=parent&embed=root';
- // TODO: revisit this, we shouldnt hard code any embeds
- if (snapshot.record.get('__' + relationship.key + 'QueryParams')) {
- url += '&' + Ember.$.param(snapshot.record.get('__' + relationship.key + 'QueryParams'));
- }
- } else if (snapshot.record.get('query-params')) {
- url += '?' + Ember.$.param(snapshot.record.get('query-params'));
- }
- return this.ajax(url, 'GET');
- }
}); |
95e83e97d10964c5463dcded647d096bbdb5acbf | test/vendor/scripts/test-helper.js | test/vendor/scripts/test-helper.js | // Create `window.describe` etc. for our BDD-like tests.
mocha.setup({ui: 'bdd'});
mocha.reporter('html');
// Create another global variable for simpler syntax.
window.expect = chai.expect;
| // Create `window.describe` etc. for our BDD-like tests.
mocha.setup({ui: 'bdd'})
mocha.reporter('html')
// initialize chai.should (@see http://chaijs.com/guide/styles/#should)
window.should = chai.should()
// Create another global variable for simpler syntax.
window.expect = chai.expect
| Add chai.should to tests and remove semicolons | Add chai.should to tests and remove semicolons
| JavaScript | apache-2.0 | despairblue/scegratoo | ---
+++
@@ -1,6 +1,9 @@
// Create `window.describe` etc. for our BDD-like tests.
-mocha.setup({ui: 'bdd'});
-mocha.reporter('html');
+mocha.setup({ui: 'bdd'})
+mocha.reporter('html')
+
+// initialize chai.should (@see http://chaijs.com/guide/styles/#should)
+window.should = chai.should()
// Create another global variable for simpler syntax.
-window.expect = chai.expect;
+window.expect = chai.expect |
cf31e8f9186e51ff5f3256ba9c0dcb0afb844a7f | packages/vulcan-lib/lib/modules/intl.js | packages/vulcan-lib/lib/modules/intl.js | import SimpleSchema from 'simpl-schema';
/*
Look for type name in a few different places
Note: look into simplifying this
*/
export const isIntlField = fieldSchema => {
const typeProperty = fieldSchema.type;
let type;
if (Array.isArray(typeProperty)) {
type = typeProperty[0].type;
} else {
type = typeProperty.singleType ? typeProperty.singleType : typeProperty.definitions[0].type;
}
return type.name === 'IntlString';
}
/*
Generate custom IntlString SimpleSchema type
TODO: WIP (languages hardcoded)
*/
const schema = {};
['en', 'ja'].forEach(locale => {
schema[locale] = {
type: String,
optional: true,
};
});
export const IntlString = new SimpleSchema(schema);
IntlString.name = 'IntlString';
| import SimpleSchema from 'simpl-schema';
import { Strings } from './strings';
/*
Look for type name in a few different places
Note: look into simplifying this
*/
export const isIntlField = fieldSchema => {
const typeProperty = fieldSchema.type;
let type;
if (Array.isArray(typeProperty)) {
type = typeProperty[0].type;
} else {
type = typeProperty.singleType ? typeProperty.singleType : typeProperty.definitions[0].type;
}
return type.name === 'IntlString';
}
/*
Generate custom IntlString SimpleSchema type
*/
export const getIntlString = () => {
const schema = {};
Object.keys(Strings).forEach(locale => {
schema[locale] = {
type: String,
optional: true,
};
});
const IntlString = new SimpleSchema(schema);
IntlString.name = 'IntlString';
return IntlString;
}
| Use function to get IntlString type | Use function to get IntlString type
| JavaScript | mit | VulcanJS/Vulcan,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,VulcanJS/Vulcan,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2 | ---
+++
@@ -1,4 +1,5 @@
import SimpleSchema from 'simpl-schema';
+import { Strings } from './strings';
/*
@@ -20,17 +21,20 @@
/*
Generate custom IntlString SimpleSchema type
-TODO: WIP (languages hardcoded)
*/
-const schema = {};
+export const getIntlString = () => {
+
+ const schema = {};
-['en', 'ja'].forEach(locale => {
- schema[locale] = {
- type: String,
- optional: true,
- };
-});
+ Object.keys(Strings).forEach(locale => {
+ schema[locale] = {
+ type: String,
+ optional: true,
+ };
+ });
-export const IntlString = new SimpleSchema(schema);
-IntlString.name = 'IntlString';
+ const IntlString = new SimpleSchema(schema);
+ IntlString.name = 'IntlString';
+ return IntlString;
+} |
a1c9b93751265f56e22dd32537763ea79486a05f | kboard/static/js/main.js | kboard/static/js/main.js | $(document).ready(function() {
$(".delete-comment").click(function(){
var form = $(this).parent().find('form');
form.submit();
});
$(".redirection-button").click(function(){
var path = $(this).attr('path');
location.href = path;
});
$('.comment-iframe').on('load', function () {
var height = this.contentWindow.document.body.offsetHeight;
$(this).height(height);
});
});
| $(document).ready(function() {
$(".delete-comment").click(function(){
var form = $(this).parent().find('form');
form.submit();
});
$(".redirection-button").click(function(){
var path = $(this).attr('path');
location.href = path;
});
$('.comment-iframe').on('load', function () {
var height = this.contentWindow.document.body.offsetHeight;
$(this).height(height);
});
$('#id_content_iframe').on('load', function () {
var height = this.contentWindow.document.body.offsetHeight;
$(this).height(height);
$(this).attr('scrolling', 'no');
});
});
| Set summernote iframe body height | Set summernote iframe body height
| JavaScript | mit | kboard/kboard,cjh5414/kboard,hyesun03/k-board,guswnsxodlf/k-board,cjh5414/kboard,kboard/kboard,hyesun03/k-board,guswnsxodlf/k-board,kboard/kboard,cjh5414/kboard,guswnsxodlf/k-board,hyesun03/k-board,darjeeling/k-board | ---
+++
@@ -13,4 +13,10 @@
var height = this.contentWindow.document.body.offsetHeight;
$(this).height(height);
});
+
+ $('#id_content_iframe').on('load', function () {
+ var height = this.contentWindow.document.body.offsetHeight;
+ $(this).height(height);
+ $(this).attr('scrolling', 'no');
+ });
}); |
fe85f9e66d9dcf5a05a5eb989e10740c4aea254e | lib/extract/extractViewBox.js | lib/extract/extractViewBox.js | const meetOrSliceTypes = {
meet: 0,
slice: 1,
none: 2,
};
const alignEnum = [
"xMinYMin",
"xMidYMin",
"xMaxYMin",
"xMinYMid",
"xMidYMid",
"xMaxYMid",
"xMinYMax",
"xMidYMax",
"xMaxYMax",
"none",
].reduce((prev, name) => {
prev[name] = name;
return prev;
}, {});
const spacesRegExp = /\s+/;
export default function(props) {
const { viewBox, preserveAspectRatio } = props;
if (!viewBox) {
return null;
}
const params = viewBox
.trim()
.split(spacesRegExp)
.map(Number);
if (params.length === 4 && params.some(isNaN)) {
console.warn("Invalid `viewBox` prop:" + viewBox);
return null;
}
const modes = preserveAspectRatio
? preserveAspectRatio.trim().split(spacesRegExp)
: [];
const meetOrSlice = meetOrSliceTypes[modes[1]] || 0;
const align = alignEnum[modes[0]] || "xMidYMid";
const [minX, minY, vbWidth, vbHeight] = params;
return {
minX,
minY,
vbWidth,
vbHeight,
align,
meetOrSlice,
};
}
export { meetOrSliceTypes, alignEnum };
| const meetOrSliceTypes = {
meet: 0,
slice: 1,
none: 2,
};
const alignEnum = [
"xMinYMin",
"xMidYMin",
"xMaxYMin",
"xMinYMid",
"xMidYMid",
"xMaxYMid",
"xMinYMax",
"xMidYMax",
"xMaxYMax",
"none",
].reduce((prev, name) => {
prev[name] = name;
return prev;
}, {});
const spacesRegExp = /\s+/;
export default function(props) {
const { viewBox, preserveAspectRatio } = props;
if (!viewBox) {
return null;
}
const params = viewBox
.trim()
.split(spacesRegExp)
.map(Number);
if (params.length !== 4 || params.some(isNaN)) {
console.warn("Invalid `viewBox` prop:" + viewBox);
return null;
}
const modes = preserveAspectRatio
? preserveAspectRatio.trim().split(spacesRegExp)
: [];
const meetOrSlice = meetOrSliceTypes[modes[1]] || 0;
const align = alignEnum[modes[0]] || "xMidYMid";
const [minX, minY, vbWidth, vbHeight] = params;
return {
minX,
minY,
vbWidth,
vbHeight,
align,
meetOrSlice,
};
}
export { meetOrSliceTypes, alignEnum };
| Fix viewBox pre condition warning | Fix viewBox pre condition warning
| JavaScript | mit | magicismight/react-native-svg,magicismight/react-native-svg,react-native-community/react-native-svg,react-native-community/react-native-svg,msand/react-native-svg,react-native-community/react-native-svg,magicismight/react-native-svg,magicismight/react-native-svg,msand/react-native-svg,magicismight/react-native-svg,magicismight/react-native-art-svg,magicismight/react-native-art-svg,msand/react-native-svg,react-native-community/react-native-svg,react-native-community/react-native-svg,msand/react-native-svg | ---
+++
@@ -34,7 +34,7 @@
.split(spacesRegExp)
.map(Number);
- if (params.length === 4 && params.some(isNaN)) {
+ if (params.length !== 4 || params.some(isNaN)) {
console.warn("Invalid `viewBox` prop:" + viewBox);
return null;
} |
42ace408bcf62cb0c3bb873f9ab00323f923c21e | sashimi-webapp/test/unit/karma.conf.js | sashimi-webapp/test/unit/karma.conf.js | // This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
var webpackConfig = require('../../build/webpack.test.conf');
module.exports = function (config) {
config.set({
// to run in additional browsers:
// 1. install corresponding karma launcher
// http://karma-runner.github.io/0.13/config/browsers.html
// 2. add it to the `browsers` array below.
browsers: ['PhantomJS'],
frameworks: ['mocha', 'sinon-chai'],
reporters: ['spec', 'coverage'],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
},
coverageReporter: {
dir: './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' },
]
},
});
};
| // This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
let webpackConfig = require('../../build/webpack.test.conf');
module.exports = function(config) {
config.set({
// to run in additional browsers:
// 1. install corresponding karma launcher
// http://karma-runner.github.io/0.13/config/browsers.html
// 2. add it to the `browsers` array below.
browsers: ['PhantomJS'],
browserNoActivityTimeout: 24000,
frameworks: ['mocha', 'sinon-chai'],
reporters: ['spec', 'coverage'],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
},
coverageReporter: {
dir: './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' },
]
},
});
};
| Add additional timeout for travis | Add additional timeout for travis
| JavaScript | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note | ---
+++
@@ -3,15 +3,16 @@
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
-var webpackConfig = require('../../build/webpack.test.conf');
+let webpackConfig = require('../../build/webpack.test.conf');
-module.exports = function (config) {
+module.exports = function(config) {
config.set({
// to run in additional browsers:
// 1. install corresponding karma launcher
// http://karma-runner.github.io/0.13/config/browsers.html
// 2. add it to the `browsers` array below.
browsers: ['PhantomJS'],
+ browserNoActivityTimeout: 24000,
frameworks: ['mocha', 'sinon-chai'],
reporters: ['spec', 'coverage'],
files: ['./index.js'], |
692a9dfa1c13cfae5c7e93866339fb5c88e65a47 | camera_barcode_reader.js | camera_barcode_reader.js | var dbr = require('./build/Release/dbr');
var v4l2camera = require("v4l2camera");
var barcodeTypes = 0x3FF | 0x2000000 | 0x8000000 | 0x4000000; // 1D, QRCODE, PDF417, DataMatrix
var cam = new v4l2camera.Camera("/dev/video0");
// list all supported formats
console.log(cam.formats);
// set frame format as YUYV
var format = cam.formats[0];
cam.configSet(format);
if (cam.configGet().formatName !== "YUYV") {
console.log("YUYV camera required");
process.exit(1);
}
cam.start();
function capture() {
cam.capture(function(success) {
var frame = cam.frameRaw();
dbr.decodeYUYVAsync(frame, format.width, format.height, barcodeTypes,
function(msg) {
var result = null;
for (index in msg) {
result = msg[index]
console.log("Format: " + result['format']);
console.log("Value : " + result['value']);
console.log("##################");
}
setTimeout(capture, 0);
});
});
}
setTimeout(capture, 0);
| var dbr = require('./build/Release/dbr');
var v4l2camera = require("v4l2camera");
var barcodeTypes = 0x3FF | 0x2000000 | 0x8000000 | 0x4000000; // 1D, QRCODE, PDF417, DataMatrix
var cam = new v4l2camera.Camera("/dev/video0");
// list all supported formats
console.log(cam.formats);
// set frame format as YUYV
var format = cam.formats[0];
cam.configSet(format);
if (cam.configGet().formatName !== "YUYV") {
console.log("YUYV camera required");
process.exit(1);
}
dbr.initLicense("BE3F70D6536894C4E7758E43934C92A6"); // This is trial license. To use full license, please contact support@dynamsoft.com
cam.start();
function capture() {
cam.capture(function(success) {
var frame = cam.frameRaw();
dbr.decodeYUYVAsync(frame, format.width, format.height, barcodeTypes,
function(msg) {
var result = null;
for (index in msg) {
result = msg[index]
console.log("Format: " + result['format']);
console.log("Value : " + result['value']);
console.log("##################");
}
setTimeout(capture, 0);
});
});
}
setTimeout(capture, 0);
| Initialize DBR license before using camera preview | Initialize DBR license before using camera preview
| JavaScript | mit | dynamsoftlabs/raspberry-pi-nodejs-barcode-reader-,dynamsoftlabs/raspberry-pi-nodejs-barcode-reader-,dynamsoftlabs/raspberry-pi-nodejs-barcode-reader-,dynamsoftlabs/raspberry-pi-nodejs-barcode-reader- | ---
+++
@@ -15,6 +15,8 @@
console.log("YUYV camera required");
process.exit(1);
}
+
+dbr.initLicense("BE3F70D6536894C4E7758E43934C92A6"); // This is trial license. To use full license, please contact support@dynamsoft.com
cam.start();
|
6f608f696783634589b6e610ab95ef0b885dfa6e | imports/server/seed-data/seed-posts.js | imports/server/seed-data/seed-posts.js | import moment from 'moment';
import { Posts } from '../../api/collections';
const seedPosts = () => {
const post = Posts.findOne();
if (!post) {
for (let i = 0; i < 50; i++) {
Posts.insert({
userId: 'QBgyG7MsqswQmvm7J',
username: 'evancorl',
createdAt: moment().utc().toDate(),
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' +
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ' +
'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.',
media: {
type: 'Video',
source: 'YouTube',
thumbnail: '/images/feeds.jpg',
url: 'https://www.meteor.com/',
},
likeCount: 14,
commentCount: 3,
});
Posts.insert({
userId: 'QBgyG7MsqswQmvm7J',
username: 'evancorl',
createdAt: moment().utc().toDate(),
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' +
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ' +
'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.',
media: {
type: 'Photo',
thumbnail: '/images/feeds-2.jpg',
url: 'https://www.meteor.com/',
},
likeCount: 14,
commentCount: 3,
});
}
}
};
export default seedPosts;
| import moment from 'moment';
import { Posts } from '../../api/collections';
const seedPosts = () => {
const post = Posts.findOne();
if (!post) {
for (let i = 0; i < 50; i++) {
Posts.insert({
userId: 'QBgyG7MsqswQmvm7J',
username: 'evancorl',
avatar: '/images/avatar.jpg',
createdAt: moment().utc().toDate(),
type: 'Video',
title: 'This is a sample title',
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' +
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ' +
'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.',
media: {
source: 'YouTube',
thumbnail: '/images/feeds.jpg',
url: 'https://www.meteor.com/',
},
likeCount: 14,
commentCount: 3,
});
Posts.insert({
userId: 'QBgyG7MsqswQmvm7J',
username: 'evancorl',
avatar: '/images/avatar.jpg',
createdAt: moment().utc().toDate(),
type: 'Photo',
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' +
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ' +
'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.',
media: {
thumbnail: '/images/feeds-2.jpg',
url: 'https://www.meteor.com/',
},
likeCount: 14,
commentCount: 3,
});
}
}
};
export default seedPosts;
| Restructure fields in post seed data | Restructure fields in post seed data
| JavaScript | apache-2.0 | evancorl/portfolio,evancorl/skate-scenes,evancorl/skate-scenes,evancorl/portfolio,evancorl/portfolio,evancorl/skate-scenes | ---
+++
@@ -10,12 +10,14 @@
Posts.insert({
userId: 'QBgyG7MsqswQmvm7J',
username: 'evancorl',
+ avatar: '/images/avatar.jpg',
createdAt: moment().utc().toDate(),
+ type: 'Video',
+ title: 'This is a sample title',
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' +
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ' +
'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.',
media: {
- type: 'Video',
source: 'YouTube',
thumbnail: '/images/feeds.jpg',
url: 'https://www.meteor.com/',
@@ -27,12 +29,13 @@
Posts.insert({
userId: 'QBgyG7MsqswQmvm7J',
username: 'evancorl',
+ avatar: '/images/avatar.jpg',
createdAt: moment().utc().toDate(),
+ type: 'Photo',
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' +
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ' +
'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.',
media: {
- type: 'Photo',
thumbnail: '/images/feeds-2.jpg',
url: 'https://www.meteor.com/',
}, |
a351adb9a02fd9979e5785af2d5caf48065a2eff | lib/ssh/connection-handler.js | lib/ssh/connection-handler.js | const authHandler = require('./auth-handler'),
sessionHandler = require('./session-handler');
function connectionHandler(client, clientInfo){
let user = {};
user.keys = [];
client.on('authentication', (context) => {
authHandler(context, clientInfo, user);
});
client.on('ready', () => {
client.once('session', (accept, reject) => {
sessionHandler(accept, reject, user);
});
});
client.on('end', () => {
console.log("Client disconnected");
});
client.on('error', () => {
// what's an error?
});
}
module.exports = connectionHandler;
| const authHandler = require('./auth-handler'),
sessionHandler = require('./session-handler');
function connectionHandler(client, clientInfo){
let user = {};
user.keys = [];
client.on('authentication', (context) => {
authHandler(context, clientInfo, user);
});
client.on('ready', () => {
client.once('session', (accept, reject) => {
sessionHandler(accept, reject, user);
});
});
client.on('end', () => {
console.log("Client disconnected");
});
client.on('error', (err) => {
// what's an error?
});
}
module.exports = connectionHandler;
| Fix a reversion caused by cleanup | Fix a reversion caused by cleanup
| JavaScript | isc | hashbang/new.hashbang.sh,hashbang/new.hashbang.sh | ---
+++
@@ -19,7 +19,7 @@
console.log("Client disconnected");
});
- client.on('error', () => {
+ client.on('error', (err) => {
// what's an error?
});
|
4222aea93590baa17473526144b09a85ec1ed4e7 | src/App.js | src/App.js | import React from 'react'
import { createStore, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import createSagaMiddleware from 'redux-saga'
import 'tachyons/css/tachyons.min.css'
import { ShellContainer } from './containers'
import { rootReducer } from './reducers'
import { saga } from './sagas/saga'
import github from './assets/github.svg'
const sagaMiddleware = createSagaMiddleware()
const store = createStore(rootReducer, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(saga)
export class App extends React.PureComponent {
render() {
return (
<div className='flex flex-column w-80 mw8 vh-100 center pv4'>
<div className='flex flex-auto flex-column'>
<Provider store={store}>
<ShellContainer />
</Provider>
</div>
<div className='self-center'>
<a href='https://github.com/joelgeorgev/file-hash-verifier'>
<img src={github} alt='GitHub' />
</a>
</div>
</div>
)
}
} | import React from 'react'
import { createStore, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import createSagaMiddleware from 'redux-saga'
import 'tachyons/css/tachyons.min.css'
import { ShellContainer } from './containers'
import { rootReducer } from './reducers'
import { saga } from './sagas'
import github from './assets/github.svg'
const sagaMiddleware = createSagaMiddleware()
const store = createStore(rootReducer, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(saga)
export class App extends React.PureComponent {
render() {
return (
<div className='flex flex-column w-80 mw8 vh-100 center pv4'>
<div className='flex flex-auto flex-column'>
<Provider store={store}>
<ShellContainer />
</Provider>
</div>
<div className='self-center'>
<a href='https://github.com/joelgeorgev/file-hash-verifier'>
<img src={github} alt='GitHub' />
</a>
</div>
</div>
)
}
} | Fix import of root saga | Fix import of root saga
| JavaScript | mit | joelgeorgev/file-hash-verifier,joelgeorgev/file-hash-verifier | ---
+++
@@ -6,7 +6,7 @@
import { ShellContainer } from './containers'
import { rootReducer } from './reducers'
-import { saga } from './sagas/saga'
+import { saga } from './sagas'
import github from './assets/github.svg'
const sagaMiddleware = createSagaMiddleware() |
5650e40da0f98008a86ab01d69325ad36882e539 | lib/en/sentence-start.js | lib/en/sentence-start.js | // Sentences should be preceded by a space
var tokenize = require("../tokenize");
var levels = require("../levels");
var english = require("tokenize-english")(tokenize);
module.exports = tokenize.check(
// Tokenize as sentences
english.sentences(),
// Output
tokenize.define(function(sentence, current, prev) {
if (!prev || sentence[0] == ' ') return null;
return {
index: 0,
offset: 1,
message: "sentence should be preceded by a space"
};
})
);
module.exports.level = levels.ERROR;
| // Sentences should be preceded by a space
var tokenize = require("../tokenize");
var levels = require("../levels");
var english = require("tokenize-english")(tokenize);
module.exports = tokenize.check(
// Tokenize as sentences
english.sentences(),
// Output
tokenize.define(function(sentence, current, prev) {
if (!prev || (prev.index + prev.offset) < current.index || sentence[0] == ' ') return null;
return {
index: 0,
offset: 1,
message: "sentence should be preceded by a space"
};
})
);
module.exports.level = levels.ERROR;
| Fix sentence:start warning when preceded by a line | Fix sentence:start warning when preceded by a line
| JavaScript | apache-2.0 | GitbookIO/rousseau | ---
+++
@@ -10,7 +10,7 @@
// Output
tokenize.define(function(sentence, current, prev) {
- if (!prev || sentence[0] == ' ') return null;
+ if (!prev || (prev.index + prev.offset) < current.index || sentence[0] == ' ') return null;
return {
index: 0, |
46b38f990afb4d6af0d45b5467f2f089b556eedf | lib/experiments/index.js | lib/experiments/index.js | 'use strict';
const symbol = require('../utilities/symbol');
let experiments = {
MODULE_UNIFICATION: symbol('module-unification'),
};
Object.freeze(experiments);
module.exports = experiments;
| 'use strict';
let experiments = {};
Object.freeze(experiments);
module.exports = experiments;
| Disable in-progress experiments for beta. | Disable in-progress experiments for beta.
| JavaScript | mit | balinterdi/ember-cli,ember-cli/ember-cli,sivakumar-kailasam/ember-cli,raycohen/ember-cli,mike-north/ember-cli,kellyselden/ember-cli,HeroicEric/ember-cli,mike-north/ember-cli,fpauser/ember-cli,patocallaghan/ember-cli,Turbo87/ember-cli,HeroicEric/ember-cli,Turbo87/ember-cli,patocallaghan/ember-cli,jrjohnson/ember-cli,gfvcastro/ember-cli,Turbo87/ember-cli,thoov/ember-cli,jgwhite/ember-cli,gfvcastro/ember-cli,raycohen/ember-cli,ember-cli/ember-cli,cibernox/ember-cli,kanongil/ember-cli,kellyselden/ember-cli,kanongil/ember-cli,jrjohnson/ember-cli,thoov/ember-cli,mike-north/ember-cli,sivakumar-kailasam/ember-cli,buschtoens/ember-cli,thoov/ember-cli,balinterdi/ember-cli,mike-north/ember-cli,elwayman02/ember-cli,cibernox/ember-cli,buschtoens/ember-cli,patocallaghan/ember-cli,asakusuma/ember-cli,ef4/ember-cli,kanongil/ember-cli,ef4/ember-cli,twokul/ember-cli,kanongil/ember-cli,gfvcastro/ember-cli,jgwhite/ember-cli,kellyselden/ember-cli,Turbo87/ember-cli,twokul/ember-cli,gfvcastro/ember-cli,HeroicEric/ember-cli,elwayman02/ember-cli,fpauser/ember-cli,thoov/ember-cli,sivakumar-kailasam/ember-cli,asakusuma/ember-cli,jgwhite/ember-cli,cibernox/ember-cli,fpauser/ember-cli,kategengler/ember-cli,twokul/ember-cli,ember-cli/ember-cli,kategengler/ember-cli,ef4/ember-cli,sivakumar-kailasam/ember-cli,cibernox/ember-cli,kellyselden/ember-cli,fpauser/ember-cli,ef4/ember-cli,jgwhite/ember-cli,patocallaghan/ember-cli,HeroicEric/ember-cli,twokul/ember-cli | ---
+++
@@ -1,9 +1,6 @@
'use strict';
-const symbol = require('../utilities/symbol');
-let experiments = {
- MODULE_UNIFICATION: symbol('module-unification'),
-};
+let experiments = {};
Object.freeze(experiments);
|
709a282e95f0bbe4fe45616780e8f7032a5fb83f | res/WebGL.js | res/WebGL.js | /**
* @fileoverview WebGL.js - Set up WebGL context
* @author Ben Brooks (beb12@aber.ac.uk)
* @version 1.0
*/
/**
* Initialise the WebGL context and return it
* @params canvas - HTML5 Canvas element
*/
function initWebGL(canvas) {
glContext = canvas.getContext("webgl") ||
canvas.getContext("experimental-webgl");
if (!glContext) {
alert("Unable to initialise WebGL. Your browser may not support it.");
}
return glContext;
}
| /**
* @fileoverview WebGL.js - Set up WebGL context
* @author Ben Brooks (beb12@aber.ac.uk)
* @version 1.0
*/
/**
* Initialise the WebGL context and return it
* @params canvas - HTML5 Canvas element
*/
function initWebGL(canvas) {
var devicePixelRatio = window.devicePixelRatio || 1;
var width = canvas.clientWidth;
var height = canvas.clientHeight;
// set the display size of the canvas.
canvas.style.width = width + "px";
canvas.style.height = height + "px";
// set the size of the drawingBuffer
canvas.width = width * devicePixelRatio;
canvas.height = height * devicePixelRatio;
glContext = canvas.getContext("webgl") ||
canvas.getContext("experimental-webgl");
if (!glContext) {
alert("Unable to initialise WebGL. Your browser may not support it.");
}
return glContext;
}
| Add retina support for canvas | Add retina support for canvas
| JavaScript | mit | bbrks/webgl-orrery,bbrks/webgl-orrery | ---
+++
@@ -10,6 +10,18 @@
*/
function initWebGL(canvas) {
+ var devicePixelRatio = window.devicePixelRatio || 1;
+ var width = canvas.clientWidth;
+ var height = canvas.clientHeight;
+
+ // set the display size of the canvas.
+ canvas.style.width = width + "px";
+ canvas.style.height = height + "px";
+
+ // set the size of the drawingBuffer
+ canvas.width = width * devicePixelRatio;
+ canvas.height = height * devicePixelRatio;
+
glContext = canvas.getContext("webgl") ||
canvas.getContext("experimental-webgl");
|
0a9db3c329175d3db9ad75553f0c07e6d2fecf9e | client/app/components/dnt-hytteadmin-editor-section-kontakt.js | client/app/components/dnt-hytteadmin-editor-section-kontakt.js | import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setKontaktinfoGruppeById: function (id) {
var model = this.get('model');
if (Ember.typeOf(model.setKontaktinfoGruppeById) === 'function') {
model.setKontaktinfoGruppeById(id);
}
}
}
});
| import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setKontaktinfoGruppeById: function (id) {
var model = this.get('model');
if (Ember.typeOf(model.setKontaktinfoGruppeById) === 'function') {
model.setKontaktinfoGruppeById(id);
}
}
},
init: function (e) {
this._super(...arguments);
const kontaktinfoGruppeId = this.get('model.kontaktinfo_gruppe.gruppe_id');
if (kontaktinfoGruppeId) {
this.send('setKontaktinfoGruppeById', kontaktinfoGruppeId);
}
}
});
| Call setKontaktinfoGruppeById on kontaktinfo component init, to get latest kontaktinfo from Turbasen | Call setKontaktinfoGruppeById on kontaktinfo component init, to get latest kontaktinfo from Turbasen
| JavaScript | mit | Turistforeningen/Hytteadmin,Turistforeningen/Hytteadmin | ---
+++
@@ -8,6 +8,15 @@
model.setKontaktinfoGruppeById(id);
}
}
+ },
+
+ init: function (e) {
+ this._super(...arguments);
+ const kontaktinfoGruppeId = this.get('model.kontaktinfo_gruppe.gruppe_id');
+
+ if (kontaktinfoGruppeId) {
+ this.send('setKontaktinfoGruppeById', kontaktinfoGruppeId);
+ }
}
}); |
4f3e6ab6c46b4332bab3d61f6fa75cda3c5579fa | lib/shared/user-utils.js | lib/shared/user-utils.js | // @flow
import type { RelativeUserInfo } from '../types/user-types';
import type { RelativeMemberInfo } from '../types/thread-types';
import ashoat from '../facts/ashoat';
import friends from '../facts/friends';
function stringForUser(user: RelativeUserInfo | RelativeMemberInfo): string {
if (user.isViewer) {
return "you";
} else if (user.username) {
return user.username;
} else {
return "anonymous";
}
}
function isStaff(userID: string) {
return userID === ashoat.id;
}
function hasWebChat(userID: string) {
return isStaff(userID) || userID === friends.larry;
}
export {
stringForUser,
isStaff,
hasWebChat,
};
| // @flow
import type { RelativeUserInfo } from '../types/user-types';
import type { RelativeMemberInfo } from '../types/thread-types';
import ashoat from '../facts/ashoat';
import friends from '../facts/friends';
import bots from '../facts/bots';
function stringForUser(user: RelativeUserInfo | RelativeMemberInfo): string {
if (user.isViewer) {
return "you";
} else if (user.username) {
return user.username;
} else {
return "anonymous";
}
}
function isStaff(userID: string) {
if (userID === ashoat.id) {
return true;
}
for (let key in bots) {
const bot = bots[key];
if (userID === bot.userID) {
return true;
}
}
return false;
}
function hasWebChat(userID: string) {
return isStaff(userID) || userID === friends.larry;
}
export {
stringForUser,
isStaff,
hasWebChat,
};
| Include all bots in isStaff | [lib] Include all bots in isStaff
| JavaScript | bsd-3-clause | Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal | ---
+++
@@ -5,6 +5,7 @@
import ashoat from '../facts/ashoat';
import friends from '../facts/friends';
+import bots from '../facts/bots';
function stringForUser(user: RelativeUserInfo | RelativeMemberInfo): string {
if (user.isViewer) {
@@ -17,7 +18,16 @@
}
function isStaff(userID: string) {
- return userID === ashoat.id;
+ if (userID === ashoat.id) {
+ return true;
+ }
+ for (let key in bots) {
+ const bot = bots[key];
+ if (userID === bot.userID) {
+ return true;
+ }
+ }
+ return false;
}
function hasWebChat(userID: string) { |
f0d80b076312e97f2233816ee6767df8ca7a434a | Jakefile.js | Jakefile.js | var build = require('./build/build.js'),
version = require('./src/polarmap.js').version;
desc('Combine and compress PolarMap source files');
task('build', {async: true}, function (compsBase32, buildName) {
var v;
jake.exec('git log -1 --pretty=format:"%h"', {breakOnError: false}, function () {
build.build(complete, v, compsBase32, buildName);
}).on('stdout', function (data) {
v = version + ' (' + data.toString() + ')';
}).on('error', function () {
v = version;
});
});
task('default', ['build']);
jake.addListener('complete', function () {
process.exit();
});
| var build = require('./build/build.js'),
version = require('./src/polarmap.js').version;
desc('Combine and compress PolarMap source files');
task('build', {async: true}, function (compsBase32, buildName) {
var v;
jake.exec('git log -1 --pretty=format:"%h"', {breakOnError: false}, function () {
build.build(complete, v, compsBase32, buildName);
}).on('stdout', function (data) {
v = version + ' (' + data.toString() + ')';
}).on('error', function () {
v = version;
});
});
watchTask(['build'], function () {
this.watchFiles.include([
'./src/**/*.js'
]);
});
task('default', ['build']);
| Add support for auto-build on file change | Add support for auto-build on file change
Use `jake watch` command
| JavaScript | bsd-2-clause | GeoSensorWebLab/polarmap.js,GeoSensorWebLab/polarmap.js,johan--/polarmap.js,johan--/polarmap.js | ---
+++
@@ -15,8 +15,10 @@
});
});
+watchTask(['build'], function () {
+ this.watchFiles.include([
+ './src/**/*.js'
+ ]);
+});
+
task('default', ['build']);
-
-jake.addListener('complete', function () {
- process.exit();
-}); |
9eeffb7b18e741e58a73c2abd011fd4bfa846029 | ui/src/dashboards/actions/index.js | ui/src/dashboards/actions/index.js | import {
getDashboards as getDashboardsAJAX,
updateDashboard as updateDashboardAJAX,
} from 'src/dashboards/apis'
export function loadDashboards(dashboards, dashboardID) {
return {
type: 'LOAD_DASHBOARDS',
payload: {
dashboards,
dashboardID,
},
}
}
export function setDashboard(dashboardID) {
return {
type: 'SET_DASHBOARD',
payload: {
dashboardID,
},
}
}
export function setTimeRange(timeRange) {
return {
type: 'SET_DASHBOARD_TIME_RANGE',
payload: {
timeRange,
},
}
}
export function setEditMode(isEditMode) {
return {
type: 'SET_EDIT_MODE',
payload: {
isEditMode,
},
}
}
export function getDashboards(dashboardID) {
return (dispatch) => {
getDashboardsAJAX().then(({data: {dashboards}}) => {
dispatch(loadDashboards(dashboards, dashboardID))
});
}
}
export function putDashboard(dashboard) {
return (dispatch) => {
updateDashboardAJAX(dashboard).then(({data}) => {
dispatch(updateDashboard(data))
})
}
}
export function updateDashboard(dashboard) {
return {
type: 'UPDATE_DASHBOARD',
payload: {
dashboard,
},
}
}
| import {
getDashboards as getDashboardsAJAX,
updateDashboard as updateDashboardAJAX,
} from 'src/dashboards/apis'
export const loadDashboards = (dashboards, dashboardID) => ({
type: 'LOAD_DASHBOARDS',
payload: {
dashboards,
dashboardID,
},
})
export const setDashboard = (dashboardID) => ({
type: 'SET_DASHBOARD',
payload: {
dashboardID,
},
})
export const setTimeRange = (timeRange) => ({
type: 'SET_DASHBOARD_TIME_RANGE',
payload: {
timeRange,
},
})
export const setEditMode = (isEditMode) => ({
type: 'SET_EDIT_MODE',
payload: {
isEditMode,
},
})
export const updateDashboard = (dashboard) => ({
type: 'UPDATE_DASHBOARD',
payload: {
dashboard,
},
})
// Async Action Creators
export const getDashboards = (dashboardID) => (dispatch) => {
getDashboardsAJAX().then(({data: {dashboards}}) => {
dispatch(loadDashboards(dashboards, dashboardID))
})
}
export const putDashboard = (dashboard) => (dispatch) => {
updateDashboardAJAX(dashboard).then(({data}) => {
dispatch(updateDashboard(data))
})
}
| Use implicit returns for dashboard action creators | Use implicit returns for dashboard action creators
Implicit returns are more concise here, and considered more idiomatic.
Also, async action creators have been collected together and moved
towards the end of the file for ease of navigation.
| JavaScript | mit | influxdb/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,nooproblem/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdb/influxdb,influxdata/influxdb,influxdata/influxdb,li-ang/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb | ---
+++
@@ -3,64 +3,53 @@
updateDashboard as updateDashboardAJAX,
} from 'src/dashboards/apis'
-export function loadDashboards(dashboards, dashboardID) {
- return {
- type: 'LOAD_DASHBOARDS',
- payload: {
- dashboards,
- dashboardID,
- },
- }
+export const loadDashboards = (dashboards, dashboardID) => ({
+ type: 'LOAD_DASHBOARDS',
+ payload: {
+ dashboards,
+ dashboardID,
+ },
+})
+
+export const setDashboard = (dashboardID) => ({
+ type: 'SET_DASHBOARD',
+ payload: {
+ dashboardID,
+ },
+})
+
+export const setTimeRange = (timeRange) => ({
+ type: 'SET_DASHBOARD_TIME_RANGE',
+ payload: {
+ timeRange,
+ },
+})
+
+export const setEditMode = (isEditMode) => ({
+ type: 'SET_EDIT_MODE',
+ payload: {
+ isEditMode,
+ },
+})
+
+export const updateDashboard = (dashboard) => ({
+ type: 'UPDATE_DASHBOARD',
+ payload: {
+ dashboard,
+ },
+})
+
+
+// Async Action Creators
+
+export const getDashboards = (dashboardID) => (dispatch) => {
+ getDashboardsAJAX().then(({data: {dashboards}}) => {
+ dispatch(loadDashboards(dashboards, dashboardID))
+ })
}
-export function setDashboard(dashboardID) {
- return {
- type: 'SET_DASHBOARD',
- payload: {
- dashboardID,
- },
- }
+export const putDashboard = (dashboard) => (dispatch) => {
+ updateDashboardAJAX(dashboard).then(({data}) => {
+ dispatch(updateDashboard(data))
+ })
}
-
-export function setTimeRange(timeRange) {
- return {
- type: 'SET_DASHBOARD_TIME_RANGE',
- payload: {
- timeRange,
- },
- }
-}
-
-export function setEditMode(isEditMode) {
- return {
- type: 'SET_EDIT_MODE',
- payload: {
- isEditMode,
- },
- }
-}
-
-export function getDashboards(dashboardID) {
- return (dispatch) => {
- getDashboardsAJAX().then(({data: {dashboards}}) => {
- dispatch(loadDashboards(dashboards, dashboardID))
- });
- }
-}
-
-export function putDashboard(dashboard) {
- return (dispatch) => {
- updateDashboardAJAX(dashboard).then(({data}) => {
- dispatch(updateDashboard(data))
- })
- }
-}
-
-export function updateDashboard(dashboard) {
- return {
- type: 'UPDATE_DASHBOARD',
- payload: {
- dashboard,
- },
- }
-} |
611eb17e6d61dd98c3864652e4543c5c76d697aa | js/bespin/tree/init.js | js/bespin/tree/init.js | jQuery(document).ready( function($) {
function resizeTree() {
$('#fileTree').height($(window).height());
// window.top.console.debug('resize', $(window).width(), $(window).height());
}
function onFileClick(path) {
bespin.get("editor").openFile(bespin.get('editSession').project, path, {});
// bespin.publish("ui:escape", {});
}
$('#fileTree').fileTree({ root: '.', script: 'cmd/php/ls/' }, onFileClick);
$(window).bind('resize', resizeTree);
resizeTree();
});
| jQuery(document).ready( function($) {
function resizeTree() {
$('#fileTree').height($(window).height());
}
function onFileClick(path) {
bespin.get("editor").openFile(bespin.get('editSession').project, path, {});
}
$('#fileTree').fileTree({ root: '.', script: 'cmd/php/ls/' }, onFileClick);
$(window).bind('resize', resizeTree);
resizeTree();
});
| Remove commented lines of code | Remove commented lines of code
| JavaScript | mit | marcuswestin/alderaan,marcuswestin/alderaan | ---
+++
@@ -2,12 +2,10 @@
function resizeTree() {
$('#fileTree').height($(window).height());
- // window.top.console.debug('resize', $(window).width(), $(window).height());
}
function onFileClick(path) {
bespin.get("editor").openFile(bespin.get('editSession').project, path, {});
- // bespin.publish("ui:escape", {});
}
$('#fileTree').fileTree({ root: '.', script: 'cmd/php/ls/' }, onFileClick); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.