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 |
|---|---|---|---|---|---|---|---|---|---|---|
ef5a0a25ba4cd62820838f2cdae2db8cf50bd3cc | app/stores/SettingsStore.js | app/stores/SettingsStore.js | // @flow
import { observable, computed } from 'mobx';
import BigNumber from 'bignumber.js';
import Store from './lib/Store';
import CachedRequest from './lib/CachedRequest';
export default class SettingsStore extends Store {
@observable termsOfUseRequest = new CachedRequest(this.api, 'getTermsOfUse');
@observabl... | // @flow
import { observable, computed } from 'mobx';
import BigNumber from 'bignumber.js';
import Store from './lib/Store';
import CachedRequest from './lib/CachedRequest';
export default class SettingsStore extends Store {
@observable termsOfUseRequest = new CachedRequest(this.api, 'getTermsOfUse');
@observabl... | Fix big number format configuration | Fix big number format configuration
| JavaScript | apache-2.0 | input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus | ---
+++
@@ -10,7 +10,7 @@
@observable bigNumberDecimalFormat = {
decimalSeparator: '.',
- groupSeparator: ' ',
+ groupSeparator: ',',
groupSize: 3,
secondaryGroupSize: 0,
fractionGroupSeparator: ' ', |
6468e300b31dc2b1bf87e35f11a77952825a9e75 | karma.conf.js | karma.conf.js | const base = require('skatejs-build/karma.conf');
module.exports = function (config) {
base(config);
// Remove all explicit IE definitions.
config.browsers = config.browsers.filter(name => !/^internet_explorer/.test(name));
// Only test IE latest.
config.browsers.push('internet_explorer_latest');
// Shim... | const base = require('skatejs-build/karma.conf');
module.exports = function (config) {
base(config);
// Remove all explicit IE definitions.
config.browsers = config.browsers.filter(name => !/^internet_explorer/.test(name));
// Only test IE latest.
config.browsers.push('internet_explorer_11');
// Shims fo... | Add browser spec for ie11. Doesn't seem that internet_explorer_latest works. | test(ie11): Add browser spec for ie11. Doesn't seem that internet_explorer_latest works.
| JavaScript | mit | skatejs/skatejs,skatejs/skatejs,chrisdarroch/skatejs,skatejs/skatejs,chrisdarroch/skatejs | ---
+++
@@ -6,7 +6,7 @@
config.browsers = config.browsers.filter(name => !/^internet_explorer/.test(name));
// Only test IE latest.
- config.browsers.push('internet_explorer_latest');
+ config.browsers.push('internet_explorer_11');
// Shims for testing.
config.files = [ |
0d8e1060b97b42c3937267de07a4a9587ebdba1b | karma.conf.js | karma.conf.js | module.exports = function (config) {
config.set({
frameworks: ['jasmine', 'browserify'],
preprocessors: {
'dist/lion.js': ['browserify', 'coverage'],
'test/**/*.js': ['browserify']
},
reporters: ['progress', 'junit', 'coverage'],
junitReporter: {
outputFile: 'test-results.xml',
... | module.exports = function (config) {
config.set({
frameworks: ['jasmine', 'browserify'],
preprocessors: {
'dist/lion.js': ['browserify', 'coverage'],
'test/**/*.js': ['browserify']
},
reporters: ['progress', 'junit', 'coverage'],
junitReporter: {
outputFile: path.join(process.env... | Add test output to Karma | Add test output to Karma
| JavaScript | mit | asilluron/lionjs | ---
+++
@@ -7,8 +7,8 @@
},
reporters: ['progress', 'junit', 'coverage'],
junitReporter: {
- outputFile: 'test-results.xml',
- suite: ''
+ outputFile: path.join(process.env.CIRCLE_TEST_REPORTS || '.', "karma", "junit.xml"),
+ suite: 'karma'
},
coverageReporter: {
typ... |
cf285d9197c1e6c65d0d99583d588b09b264110f | test-main.js | test-main.js | if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var ... | // PhantomJS doesn't support Function.prototype.bind
if (!Function.prototype.bind) {
var slice = Array.prototype.slice;
Function.prototype.bind = function(context) {
var func = this;
var args = slice.call(arguments, 1);
function bound() {
var calledAsConstructor = func.prototype && (this instance... | Fix Function.bind polyfill to work properly on PhantomJS. | Fix Function.bind polyfill to work properly on PhantomJS.
| JavaScript | mit | OneJSToolkit/onejs,OneJSToolkit/onejs | ---
+++
@@ -1,25 +1,22 @@
+// PhantomJS doesn't support Function.prototype.bind
if (!Function.prototype.bind) {
- Function.prototype.bind = function(oThis) {
- if (typeof this !== 'function') {
- // closest thing possible to the ECMAScript 5
- // internal IsCallable function
- throw new TypeError(... |
ac903898478d239b507afa29a4bf10614cdc8976 | data/maps/caveCombat.js | data/maps/caveCombat.js | eburp.registerMap("caveCombat",{
name: "Cave Combat",
width: 9,
height: 9,
map: "\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
"
}); | eburp.registerMap("caveCombat",{
name: "Cave Combat",
width: 9,
height: 9,
map: "\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
C'''''''C\
"
}); | Fix cave combat to reflect new battle sizes. 9x9 | Fix cave combat to reflect new battle sizes. 9x9
| JavaScript | apache-2.0 | justindujardin/pow2,justindujardin/pow2,justindujardin/pow2 | ---
+++
@@ -11,5 +11,6 @@
C'''''''C\
C'''''''C\
C'''''''C\
+C'''''''C\
"
}); |
e0976a86e8ea6145337ac4962a861638ca6d0488 | models/Game.js | models/Game.js | /**
* Module dependencies.
*/
const Score = require('./score');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
// create a schema
const gameSchema = new Schema({
started_at: Date,
ended_at: Date,
teams: [Schema.Types.ObjectId],
score: [Score.schema]
});
// create a model using... | /**
* Module dependencies.
*/
const Score = require('./score');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
// create a schema
const gameSchema = new Schema({
started_at: Date,
ended_at: Date,
teams: [Schema.Types.ObjectId],
score: [Score.schema]
});
gameSchema.methods.star... | Replace pre function with start game function | Replace pre function with start game function
| JavaScript | mit | lostatseajoshua/Challenger | ---
+++
@@ -13,16 +13,11 @@
score: [Score.schema]
});
-// create a model using schema
-const Game = mongoose.model('Game', gameSchema);
-
-// on every save, add the date
-gameSchema.pre('save', (next) => {
- if (!this.created_at) {
- this.created_at = new Date();
+gameSchema.methods.start = function start... |
c5fd2290ef4ab86998fcb2ee887043920aa52e31 | packages/github-oauth/package.js | packages/github-oauth/package.js | Package.describe({
summary: 'GitHub OAuth flow',
version: '1.2.0'
});
Package.onUse(function (api) {
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('underscore', 'server');
api.use('random', 'client');
api.use('service-configuration... | Package.describe({
summary: 'GitHub OAuth flow',
version: '1.2.1'
});
Package.onUse(function (api) {
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('underscore', ['client', 'server']);
api.use('random', 'client');
api.use('service-c... | Use underscore on client in github-oauth | Use underscore on client in github-oauth
`_` is being used in github_client.js, but not specified in the package
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | ---
+++
@@ -1,13 +1,13 @@
Package.describe({
summary: 'GitHub OAuth flow',
- version: '1.2.0'
+ version: '1.2.1'
});
Package.onUse(function (api) {
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
- api.use('underscore', 'server');
+ ap... |
b7dd1f5adf6eeb229805dece644ac90f0625f4d7 | models/user.js | models/user.js | module.exports = function(sequelize, DataTypes) {
var User = sequelize.define('User', {
username: {type: DataTypes.STRING, unique: true},
password: DataTypes.STRING,
email: DataTypes.STRING
});
return User;
};
| module.exports = function(sequelize, DataTypes) {
var User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
password: {
type: DataTypes.STRING,
allowNull: false
},
em... | Add experience and non-null constraints to User model. | Add experience and non-null constraints to User model.
| JavaScript | mit | kevinwang/questkey | ---
+++
@@ -1,8 +1,23 @@
module.exports = function(sequelize, DataTypes) {
var User = sequelize.define('User', {
- username: {type: DataTypes.STRING, unique: true},
- password: DataTypes.STRING,
- email: DataTypes.STRING
+ username: {
+ type: DataTypes.STRING,
+ ... |
fba33f2eb3ad86f45d733cf349c6b13a7ebb6ee5 | addon/locales/ru/components/flexberry-maplayer.js | addon/locales/ru/components/flexberry-maplayer.js | export default {
'opacity-label': {
'tooltip': 'Видимость слоя'
},
'attributes-button': {
'tooltip': 'Показать панель атрибутов слоя'
},
'bounds-button': {
'tooltip': 'Приблизить к границам слоя'
},
'add-button': {
'tooltip': 'Добавить новй дочерний слой'
},
'copy-button': {
'toolt... | export default {
'opacity-label': {
'tooltip': 'Видимость слоя'
},
'attributes-button': {
'tooltip': 'Показать панель атрибутов слоя'
},
'bounds-button': {
'tooltip': 'Приблизить к границам слоя'
},
'add-button': {
'tooltip': 'Добавить новый дочерний слой'
},
'copy-button': {
'tool... | Fix typo on add new layer button | Fix typo on add new layer button
| JavaScript | mit | Flexberry/ember-flexberry-gis,Flexberry/ember-flexberry-gis,Flexberry/ember-flexberry-gis | ---
+++
@@ -9,7 +9,7 @@
'tooltip': 'Приблизить к границам слоя'
},
'add-button': {
- 'tooltip': 'Добавить новй дочерний слой'
+ 'tooltip': 'Добавить новый дочерний слой'
},
'copy-button': {
'tooltip': 'Создать копию слоя' |
a9d782a0953b13a18487883ae727b821813a98ef | assets/javascripts/color.js | assets/javascripts/color.js | (function(){
var app = angular.module('color', []);
app.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}]);
app.controller('ColorController', [ '$http', function($http) {
var color = thi... | (function(){
angular.module('color', [])
.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}])
.controller('ColorController', [ '$http', function($http) {
var color = this;
color.sta... | Remove the app variable for styling | Remove the app variable for styling
| JavaScript | mit | cbachich/color_divider-fe | ---
+++
@@ -1,12 +1,13 @@
(function(){
- var app = angular.module('color', []);
- app.config(['$httpProvider', function($httpProvider) {
+ angular.module('color', [])
+
+ .config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.header... |
cd32d405c9f9bc703e5fd4b12c883846b17bdf90 | gulp/build.js | gulp/build.js | 'use strict';
var gulp = require('gulp');
var config = require('./_config.js');
var paths = config.paths;
var $ = config.plugins;
var istanbul = require('browserify-istanbul');
gulp.task('clean', function () {
return gulp.src(paths.tmp, {read: true})
.pipe($.rimraf());
});
gulp.task('build', ['index.html', '... | 'use strict';
var gulp = require('gulp');
var config = require('./_config.js');
var paths = config.paths;
var $ = config.plugins;
var istanbul = require('browserify-istanbul');
gulp.task('clean', function () {
return gulp.src(paths.tmp, {read: true})
.pipe($.rimraf());
});
gulp.task('build', ['index.html', '... | Switch browserify back to debugging mode. | Switch browserify back to debugging mode.
| JavaScript | mpl-2.0 | learnfwd/learnfwd.com,learnfwd/learnfwd.com,learnfwd/learnfwd.com | ---
+++
@@ -32,7 +32,7 @@
return gulp.src(paths.app + '/js/main.js', { read: false })
.pipe($.browserify({
transform: [istanbul],
- debug: false
+ debug: true
}))
.pipe(gulp.dest(paths.tmp + '/js'));
}); |
2750c4c4c08dc452e7dedea70f15e28e25e0f334 | app/components/Avatar/index.js | app/components/Avatar/index.js | // @flow
import React from 'react';
import { Image, View } from 'react-native';
import theme from '../../theme';
type Props = {
size?: number,
source: string,
style?: Object,
};
export default function Avatar({ size = 44, source, style, ...props }: Props) {
const styles = {
wrapper: {
backgroundCol... | // @flow
import React from 'react';
import { Image, Platform, View } from 'react-native';
import theme from '../../theme';
type Props = {
size?: number,
source: string,
style?: Object,
};
export default function Avatar({ size = 44, source, style, ...props }: Props) {
const styles = {
wrapper: {
bac... | Fix for double attempt at circle on iOS. | Fix for double attempt at circle on iOS.
| JavaScript | mit | Thinkmill/react-conf-app,Thinkmill/react-conf-app,brentvatne/react-conf-app,Thinkmill/react-conf-app | ---
+++
@@ -1,6 +1,6 @@
// @flow
import React from 'react';
-import { Image, View } from 'react-native';
+import { Image, Platform, View } from 'react-native';
import theme from '../../theme';
@@ -20,7 +20,7 @@
width: size,
},
image: {
- borderRadius: size,
+ borderRadius: Platform.O... |
ca3bfdc68e01285f1118496906799f4a4cef0eb1 | app/routes/events/components/RegisteredSummary.js | app/routes/events/components/RegisteredSummary.js | import React from 'react';
import { Link } from 'react-router';
import Tooltip from 'app/components/Tooltip';
import { FlexRow, FlexColumn, FlexItem } from 'app/components/FlexBox';
const Reg = ({ user }) => (
<Tooltip content={user.fullName}>
<Link to={`/users/${user.username}`} style={{ color: 'white' }}>
... | import React from 'react';
import { Link } from 'react-router';
import Tooltip from 'app/components/Tooltip';
import { FlexRow, FlexColumn, FlexItem } from 'app/components/FlexBox';
const Registration = ({ user }) => (
<Tooltip content={user.fullName}>
<Link to={`/users/${user.username}`} style={{ color: 'white'... | Fix naming and remove unnecessary | Fix naming and remove unnecessary []
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp | ---
+++
@@ -3,7 +3,7 @@
import Tooltip from 'app/components/Tooltip';
import { FlexRow, FlexColumn, FlexItem } from 'app/components/FlexBox';
-const Reg = ({ user }) => (
+const Registration = ({ user }) => (
<Tooltip content={user.fullName}>
<Link to={`/users/${user.username}`} style={{ color: 'white' }}... |
096e398fbc89bf0dd3751ad012e6f944e4093949 | assets/js/components/adminbar/AdminBarZeroData.js | assets/js/components/adminbar/AdminBarZeroData.js | /**
* Admin Bar Clicks component.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.... | /**
* Admin Bar Clicks component.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.... | Update zero data column width on desktop. | Update zero data column width on desktop.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | ---
+++
@@ -1,7 +1,7 @@
/**
* Admin Bar Clicks component.
*
- * Site Kit by Google, Copyright 2020 Google LLC
+ * Site Kit by Google, Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,10 +1... |
abb3d6440881e4aac491eae0bb90817f469637b2 | controllers/artist-controller.js | controllers/artist-controller.js | var request = require('request');
var model = require('../models/index');
/* Sets a like in the Like table for a given artist and user (by Facebook ID number) */
exports.likeArtist = function(req, res) {
if (isNaN(req.params.id)) {
return res.status(400).send('Bad input: ' + req.params.id);
}
else {
if (... | var model = require('../models/index');
/* Sets a like in the Like table for a given artist and user (by Facebook ID number) */
exports.likeArtist = function(req, res) {
return res.status(200).send('Success');
}
/* Retrieves the artist recommendations for the user */
exports.getArtistRecommendations = function(req,... | Move code to the job queue implementation | Move code to the job queue implementation
| JavaScript | mit | kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender | ---
+++
@@ -1,49 +1,8 @@
-var request = require('request');
var model = require('../models/index');
/* Sets a like in the Like table for a given artist and user (by Facebook ID number) */
exports.likeArtist = function(req, res) {
- if (isNaN(req.params.id)) {
- return res.status(400).send('Bad input: ' + req... |
15c1b77326ce093c3b2e9be837fdc2d914a10aee | app/views/DiscussionDetails.js | app/views/DiscussionDetails.js | import React from "react-native";
import PeopleListContainer from "../containers/PeopleListContainer";
import Card from "./Card";
import CardTitle from "./CardTitle";
import DiscussionSummary from "./DiscussionSummary";
import CardAuthor from "./CardAuthor";
import ListHeader from "./ListHeader";
const {
ScrollView,
... | import React from "react-native";
import PeopleListContainer from "../containers/PeopleListContainer";
import Card from "./Card";
import CardTitle from "./CardTitle";
import DiscussionSummary from "./DiscussionSummary";
import CardAuthor from "./CardAuthor";
import ListHeader from "./ListHeader";
const {
ScrollView,
... | Remove vertical padding from details card | Remove vertical padding from details card
| JavaScript | unknown | wesley1001/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods | ---
+++
@@ -8,13 +8,13 @@
const {
ScrollView,
- View,
StyleSheet
} = React;
const styles = StyleSheet.create({
details: {
- paddingVertical: 12
+ paddingVertical: 12,
+ marginVertical: 0
},
title: { |
6be99d06a66f2e339e8f58453829bf2f4b2b6470 | static/main_site/index.js | static/main_site/index.js | $(function () {
$('.frilinks .fri').each(function (n, e) {
e = $(e);
var hr = e.find('a').attr('href');
if (!hr)
return;
e.css({cursor: 'pointer'});
e.click(function (e) {
window.open(hr);
e.preventDefault();
});
});
var hea... | $(function () {
$('.frilinks .fri').each(function (n, e) {
e = $(e);
var hr = e.find('a').attr('href');
if (!hr)
return;
e.css({cursor: 'pointer'});
e.click(function (e) {
window.open(hr);
e.preventDefault();
});
});
var hea... | Use jQuery.scrollTop to support IE. | Use jQuery.scrollTop to support IE.
| JavaScript | mit | micromaomao/maowtm.org,micromaomao/maowtm.org | ---
+++
@@ -23,7 +23,7 @@
function am () {
requestAnimationFrame(am);
find_bhch();
- var t = Math.min(window.scrollY / tsy, 1);
+ var t = Math.min($(window).scrollTop() / tsy, 1);
headbg.css({opacity: 1 - t});
if (bhch > 0) {
bhc.css({height: (bhch *... |
970c1663a035f57133359a84d7cabf2d2ebc68ac | unify/framework/source/class/unify/core/Init.js | unify/framework/source/class/unify/core/Init.js | (function() {
var app;
var getApplication = function() {
return app;
};
var shutDown = function() {
lowland.ObjectManager.dispose();
};
var startUp = function() {
var Application = core.Class.getByName(core.Env.getValue("application") + ".Application");
var init = new Application()... | (function() {
var app;
var getApplication = function() {
return app;
};
var shutDown = function() {
lowland.ObjectManager.dispose();
};
var startUp = function() {
var Application = core.Class.getByName(core.Env.getValue("application") + ".Application");
var init = new Application()... | Remove unload objects as this leads to errors | Remove unload objects as this leads to errors
| JavaScript | mit | unify/unify,unify/unify,unify/unify,unify/unify,unify/unify,unify/unify | ---
+++
@@ -20,7 +20,7 @@
init.finalize();
//lowland.bom.Events.listen(window, "shutdown", shutDown);
- lowland.bom.Events.listen(window, "beforeunload", shutDown);
+ //lowland.bom.Events.listen(window, "beforeunload", shutDown);
};
|
45659acb2978512fa873234a2017ace6e68c5be3 | client/datamodel/datamodel.js | client/datamodel/datamodel.js | xcomponents.appVersion = '0.1';
xcomponents.menuOptions = [
{ label : 'Data objects', url : '/', icon : 'fa-dashboard' }
];
xcomponents.models['dataObject'] = {
name : 'Data object',
fields : [
{ label : 'Name' , field: 'name', required: true},
{ label : 'Scope/module', field : 'scope', typ... | xcomponents.appVersion = '0.1';
xcomponents.menuOptions = [
{ label : 'Data objects', url : '/', icon : 'fa-dashboard' }
];
xcomponents.models['dataObject'] = {
name : 'Data object',
fields : [
{ label : 'Name' , field: 'name', required: true},
{ label : 'Scope/module', field : 'scope', typ... | Document library renamed to Document Wiki | Document library renamed to Document Wiki
| JavaScript | agpl-3.0 | SteveFortune/isometrica-app,SteveFortune/isometrica-app,SteveFortune/isometrica-app | ---
+++
@@ -9,7 +9,7 @@
name : 'Data object',
fields : [
{ label : 'Name' , field: 'name', required: true},
- { label : 'Scope/module', field : 'scope', type : 'select', options : ['System', 'Overview module', 'Dashboard module', 'Document Library module', 'Workbook module']},
+ { label : 'Scope/modu... |
7852d101c6c1e5a1081e38c89923a5de16317c71 | rhaptos2/repo/static/authortools_aloha_settings.js | rhaptos2/repo/static/authortools_aloha_settings.js | /**
* Used to initialize the Aloha settings for this application.
*
* Author: Michael Mulich
* Copyright (c) 2012 Rice University
*
* This software is subject to the provisions of the GNU Lesser General
* Public License Version 2.1 (LGPL). See LICENSE.txt for details.
*/
Aloha = window.Aloha || {};
Aloha.set... | /**
* Used to initialize the Aloha settings for this application.
*
* Author: Michael Mulich
* Copyright (c) 2012 Rice University
*
* This software is subject to the provisions of the GNU Lesser General
* Public License Version 2.1 (LGPL). See LICENSE.txt for details.
*/
Aloha = window.Aloha || {};
Aloha.set... | Use the oerpub image plugin instead. | Use the oerpub image plugin instead.
| JavaScript | lgpl-2.1 | philschatz/rhaptos2.repo,philschatz/rhaptos2.repo,philschatz/rhaptos2.repo | ---
+++
@@ -15,22 +15,9 @@
// logLevels: {'error': true, 'warn': true, 'info': false, 'debug': false},
// errorhandling : true,
plugins: {
- draganddropfiles: {
- upload: {
- config: {
- method: "POST",
- url: function() {
- ... |
cc1092a5c94b102448090429f0d7ee14ed26e19d | server/model/content_code/schema.js | server/model/content_code/schema.js | 'use strict';
const _ = require('lodash');
const Bluebird = require('bluebird');
const mongoose = require('mongoose');
const mongooseDelete = require('mongoose-delete');
const ShortId = require('mongoose-shortid-nodeps');
const Settings = require('../../settings');
const Content ... | 'use strict';
const _ = require('lodash');
const Bluebird = require('bluebird');
const mongoose = require('mongoose');
const mongooseDelete = require('mongoose-delete');
const ShortId = require('mongoose-shortid-nodeps');
const Settings = require('../../settings');
const Content ... | Sort content items by DEC _id | Sort content items by DEC _id
| JavaScript | mit | jedbangers/exclusive-content-web,jedbangers/exclusive-content-web | ---
+++
@@ -23,7 +23,15 @@
schema.plugin(mongooseDelete, { overrideMethods: 'all' });
function transform(doc, ret) {
- return _.pick(ret, Settings.ContentCode.paths);
+ let result = _.cloneDeep(ret);
+ result = _.pick(ret, Settings.ContentCode.paths);
+
+ // Sort by created date. It would be better to add a c... |
dfcf1531726ad89afbec3054b666fc6b84a2093a | scripts/embedQA.js | scripts/embedQA.js | /* global $ */
$(() => {
"use strict";
var $qanda = $(".js-q-and-a");
var url = "http://localhost:8000/5614e8bded37eded3f16a9e6";
fetch(url).then((response) => {
response.json().then((resp) => {
if (!resp._embedded || !resp._embedded["hack:questions"] || !resp._embedded["hack:questions"].length) {
... | /* global $ */
$(() => {
"use strict";
var $qanda = $(".js-q-and-a");
var url = "http://localhost:8000/5614e8bded37eded3f16a9e6";
fetch(url).then((response) => {
response.json().then((resp) => {
if (!resp._embedded || !resp._embedded["hack:questions"] || !resp._embedded["hack:questions"].length) {
... | Add styling classes to the embedded product page script | Add styling classes to the embedded product page script
| JavaScript | mit | roelbaka/hyperquaid,eturan/hyperquaid,epallerols/hyperquaid,peej/hyperquaid | ---
+++
@@ -13,7 +13,7 @@
}
let questions = resp._embedded["hack:questions"];
-
+ console.log(resp._embedded["hack:questions"])
$qanda.html("");
questions.forEach((q) => {
@@ -21,9 +21,20 @@
return; // skip, no answers yet for this question
}
- q._embe... |
b79362a07eaa527f27f2e28b8e6f4f5ebf37af30 | app/src/index.js | app/src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import './index.css';
import App from './App';
import Immutable from 'immutable'
import rootReducer from './rootReducer'
import registerServiceWorker from './registerServiceWorker';
im... | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import './index.css';
import App from './components/App';
import Immutable from 'immutable'
import rootReducer from './rootReducer'
import registerServiceWorker from './registerService... | Fix App import pointing to old place | Fix App import pointing to old place
| JavaScript | mit | kheldysh/discursor,kheldysh/discursor | ---
+++
@@ -3,7 +3,7 @@
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import './index.css';
-import App from './App';
+import App from './components/App';
import Immutable from 'immutable'
import rootReducer from './rootReducer'
import registerServiceWorker from './registerServiceWo... |
6ca919bb4d7d42ef8dd1aa284a07bf3500a2d2a5 | examples/express/api.js | examples/express/api.js | const bugsnag = require("./bugsnag");
function attemptLogin(username, password) {
return new Promise((resolve, reject) => {
if (username === "crash") {
// Obviously you wouldn't expect to see this in your production app, but here is an example of what
// you might have underlying your database abstra... | const bugsnag = require("./bugsnag");
function attemptLogin(username, password) {
return new Promise((resolve, reject) => {
if (username === "crash") {
// Obviously you wouldn't expect to see this in your production app, but here is an example of what
// you might have underlying your database abstra... | Check for request data prior to setting user | chore(examples): Check for request data prior to setting user
If outside of request scope (or the process domain is otherwise null,
then skip setting request data) | JavaScript | mit | bugsnag/bugsnag-node | ---
+++
@@ -22,11 +22,13 @@
function loadSession(req, res, next) {
// We may not always be reporting errors manually. What happens if there's an error we didn't anticipate?
// In that case we can attach some user data to the request, so we know which user was affected by the error.
- bugsnag.requestData.user ... |
04ca961a6b19d7bfc2d2962a6f9c6e9f876b333d | client/app/config/config.js | client/app/config/config.js | module.exports = {
notice: {
'logFile': './logs/ark-desktop.log',
'level': 1,
'defaultHideDelay': 5000
}
}; | module.exports = {
notice: {
'logFile': null,
'level': 1,
'defaultHideDelay': 5000
}
}; | Disable logging to file by default | Disable logging to file by default
| JavaScript | mit | krau612/ark-desktop,krau612/ark-desktop,krau612/ark-desktop | ---
+++
@@ -1,6 +1,6 @@
module.exports = {
notice: {
- 'logFile': './logs/ark-desktop.log',
+ 'logFile': null,
'level': 1,
'defaultHideDelay': 5000
} |
e66ec1691a3ba9bf445a166ac3ebdb84efe37df9 | src/DeepNgRoot/Frontend/js/app/module/ng-config.js | src/DeepNgRoot/Frontend/js/app/module/ng-config.js | 'use strict';
'format es6';
export class Config {
/**
*
* @param {Boolean} isLocalhost
* @param {String} ngRewrite
* @param {Object} $locationProvider
*/
constructor(isLocalhost, ngRewrite, $locationProvider) {
if (!isLocalhost && ngRewrite === '/') {
$locationProvider.html5Mode(true);
... | 'use strict';
'format es6';
export class Config {
/**
*
* @param {Boolean} isLocalhost
* @param {String} ngRewrite
* @param {Object} $locationProvider
*/
constructor(isLocalhost, ngRewrite, $locationProvider) {
let isAwsWebsite = /\.amazonaws\.com$/i.test(window.location.hostname);
if (!isAw... | Disable html5Mode if hostname is s3-website | Disable html5Mode if hostname is s3-website
| JavaScript | mit | MitocGroup/deep-microservices-root-angularjs,MitocGroup/deep-microservices-root-angularjs,MitocGroup/deep-microservices-root-angularjs | ---
+++
@@ -9,7 +9,8 @@
* @param {Object} $locationProvider
*/
constructor(isLocalhost, ngRewrite, $locationProvider) {
- if (!isLocalhost && ngRewrite === '/') {
+ let isAwsWebsite = /\.amazonaws\.com$/i.test(window.location.hostname);
+ if (!isAwsWebsite && !isLocalhost && ngRewrite === '/') {
... |
9f946527929d65607c0d42d33733d370fee27f83 | spec/api-system-preferences-spec.js | spec/api-system-preferences-spec.js | const assert = require('assert')
const {remote} = require('electron')
const {systemPreferences} = remote
describe('systemPreferences module', function () {
if (process.platform !== 'darwin') {
return
}
describe('systemPreferences.getUserDefault(key, type)', function () {
it('returns values for known use... | const assert = require('assert')
const {remote} = require('electron')
const {systemPreferences} = remote
describe('systemPreferences module', function () {
describe('systemPreferences.getAccentColor', function () {
if (process.platform !== 'win32') {
return
}
it('should return a non-empty string',... | Add basic spec for getAccentColor | Add basic spec for getAccentColor
| JavaScript | mit | shiftkey/electron,renaesop/electron,brenca/electron,wan-qy/electron,electron/electron,miniak/electron,seanchas116/electron,seanchas116/electron,aliib/electron,aliib/electron,the-ress/electron,gabriel/electron,the-ress/electron,electron/electron,dongjoon-hyun/electron,biblerule/UMCTelnetHub,tonyganch/electron,dongjoon-h... | ---
+++
@@ -3,11 +3,23 @@
const {systemPreferences} = remote
describe('systemPreferences module', function () {
- if (process.platform !== 'darwin') {
- return
- }
+ describe('systemPreferences.getAccentColor', function () {
+ if (process.platform !== 'win32') {
+ return
+ }
+
+ it('should ret... |
0798ad99e384fb91233ff0ba9c7ab8f439d1cb85 | public/js/report.js | public/js/report.js | /* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name + '-' + mode
var e = document.getElementById(id)
var ej = $(e)
e.style.display = e.style.display == 'table-row' ? 'none' : 'table-row'
$('#' + id + '-btn').tog... | /* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name.replace(/\./g, '\\.') + '-' + mode
, e = $('#' + id)
if (e.css('display') === 'none') var activating = 1
else var activating = 0
... | Fix dot escaping for jQuery and use $()[0] | Fix dot escaping for jQuery and use $()[0]
| JavaScript | mit | TimothyGu/fateserver-node,TimothyGu/fateserver-node | ---
+++
@@ -1,26 +1,27 @@
/* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
- var id = name + '-' + mode
- var e = document.getElementById(id)
- var ej = $(e)
- e.style.display = e.style.display == 'table-row' ? 'none' : 'ta... |
013aea55f73a9cdf4063be8efb6689ae6fd6f985 | services/ui/src/components/LogViewer/index.js | services/ui/src/components/LogViewer/index.js | import React from 'react';
import { bp } from 'lib/variables';
const LogViewer = ({ logs }) => (
<React.Fragment>
<div className="logs">
<div className="log-viewer">{logs || 'Logs are not available.'}</div>
</div>
<style jsx>{`
.logs {
padding: 0 calc(100vw / 16) 48px;
width: ... | import React from 'react';
import { bp } from 'lib/variables';
const LogViewer = ({ logs }) => (
<React.Fragment>
<div className="logs">
<div className="log-viewer">{logs || 'Logs are not available.'}</div>
</div>
<style jsx>{`
.logs {
padding: 0 calc(100vw / 16) 48px;
width: ... | Allow log container to be full height | Allow log container to be full height
When viewing deployment logs in the dashboard, the logs are typically very long, but the log window is limited to 600px heigh. Given there is nothing else on the deployment page other than the logs, would be good if the height wasn't limited.
There's a few benefits to this:
... | JavaScript | apache-2.0 | amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon,amazeeio/lagoon | ---
+++
@@ -16,7 +16,6 @@
font-family: 'Monaco', monospace;
font-size: 12px;
font-weight: 400;
- height: 600px;
margin: 0;
overflow-wrap: break-word;
overflow-x: scroll; |
3ea4eebf2ed5dc409460b86a148b8fb0cdb2f9d7 | components/counter/Counter.js | components/counter/Counter.js | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import omit from 'lodash.omit';
import theme from './theme.css';
class Counter extends PureComponent {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
color: PropType... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import omit from 'lodash.omit';
import { Monospaced } from '../typography';
import theme from './theme.css';
class Counter extends PureComponent {
static propTypes = {
children: PropTypes.node,
clas... | Use our own Monospaced component instead of applying monospace class from ui-typography | Use our own Monospaced component instead of applying monospace class from ui-typography
| JavaScript | mit | teamleadercrm/teamleader-ui | ---
+++
@@ -2,6 +2,7 @@
import PropTypes from 'prop-types';
import cx from 'classnames';
import omit from 'lodash.omit';
+import { Monospaced } from '../typography';
import theme from './theme.css';
class Counter extends PureComponent {
@@ -28,7 +29,6 @@
const classes = cx(
theme.counter,
- ... |
6c0ed962b38457d9b95e9318a711ffbf0cf838c3 | backend/models/users.js | backend/models/users.js | (function () {
var User = require('../database/mongodb').Users,
jwt = require('jwt-simple'),
async = require('async'),
crypto = require('crypto');
function _getUserInfo(userId, callback) {
User.findById(userId, function (err, resp) {
callback(err, resp);
})
... | (function () {
var User = require('../database/mongodb').Users,
jwt = require('jwt-simple'),
async = require('async'),
crypto = require('crypto');
function _getUserInfo(userId, callback) {
User.findById(userId, function (err, resp) {
callback(err, resp);
})
... | Update function help interact with User | Update function help interact with User
| JavaScript | mit | thinhit/Buzz | ---
+++
@@ -46,5 +46,11 @@
callback(err, resp);
})
}
+ return {
+ getUserInfo : _getUserInfo,
+ updateUserInfo: _updateUserInfo,
+ register: _registerUser,
+ login: _login
+ }
})(); |
65a6f25c4523a2844ef7c0bc8dc1dbb2b0edc347 | app/components/code-snippet.js | app/components/code-snippet.js | import Ember from "ember";
import Snippets from "../snippets";
/* global require */
var Highlight = require('highlight.js');
export default Ember.Component.extend({
tagName: 'pre',
classNameBindings: ['language'],
unindent: true,
_unindent: function(src) {
if (!this.get('unindent')) {
return src;
... | import Ember from "ember";
import Snippets from "../snippets";
/* global require */
var Highlight = require('highlight.js');
export default Ember.Component.extend({
tagName: 'pre',
classNameBindings: ['language'],
unindent: true,
_unindent: function(src) {
if (!this.get('unindent')) {
return src;
... | Remove reliance on function prototype extension. | Remove reliance on function prototype extension.
| JavaScript | mit | greyhwndz/ember-code-snippet,mike-north/ember-code-snippet,ef4/ember-code-snippet,ef4/ember-code-snippet | ---
+++
@@ -26,19 +26,19 @@
return src;
},
- source: function(){
+ source: Ember.computed('name', function(){
return this._unindent(
(Snippets[this.get('name')] || "")
.replace(/^(\s*\n)*/, '')
.replace(/\s*$/, '')
);
- }.property('name'),
+ }),
didInsertElement: ... |
4279d160bdd741ff40b6f1d0b87eccea9b16bf18 | lib/commands/help.js | lib/commands/help.js | 'use strict';
var Command = require('../models/command');
var lookupCommand = require('../cli/lookup-command');
var string = require('../utilities/string');
module.exports = Command.extend({
name: 'help',
works: 'everywhere',
description: 'Outputs the usage instructions for all commands or the provided command'... | 'use strict';
var Command = require('../models/command');
var lookupCommand = require('../cli/lookup-command');
var string = require('../utilities/string');
module.exports = Command.extend({
name: 'help',
works: 'everywhere',
description: 'Outputs the usage instructions for all commands or the provided command'... | Remove var command declaration (failing jshint test) | Remove var command declaration (failing jshint test)
| JavaScript | mit | eliotsykes/ember-cli,szines/ember-cli,beatle/ember-cli,xiujunma/ember-cli,code0100fun/ember-cli,ServiceTo/ember-cli,typeoneerror/ember-cli,taras/ember-cli,mixonic/ember-cli,williamsbdev/ember-cli,romulomachado/ember-cli,ef4/ember-cli,quaertym/ember-cli,coderly/ember-cli,nruth/ember-cli,kriswill/ember-cli,seawatts/ember... | ---
+++
@@ -14,7 +14,7 @@
_displayHelpForCommand: function(commandName) {
var Command = this.commands[string.classify(commandName)] || lookupCommand(this.commands, commandName);
- var command = new Command({
+ new Command({
ui: this.ui,
project: this.project,
commands: this.comman... |
d9e767bc15f62a28bba34b139e98876fb3ad9f03 | lib/commands/help.js | lib/commands/help.js | 'use strict';
var fs = require('fs');
var path = require('path');
module.exports = function() {
var content = fs.readFileSync(path.resolve(__dirname, '../templates/help.txt'), 'utf8');
console.log(content);
};
| 'use strict';
var fs = require('fs');
var path = require('path');
module.exports = function() {
var content = fs.readFileSync(
path.resolve(__dirname, '../templates/help.txt'), 'utf8');
console.log(content);
};
| Break line to avoid having a line that's too long. | Break line to avoid having a line that's too long.
| JavaScript | mit | stillesjo/buh | ---
+++
@@ -4,6 +4,7 @@
var path = require('path');
module.exports = function() {
- var content = fs.readFileSync(path.resolve(__dirname, '../templates/help.txt'), 'utf8');
+ var content = fs.readFileSync(
+ path.resolve(__dirname, '../templates/help.txt'), 'utf8');
console.log(content);
}; |
913c4f65c986da00961221356cc74c17ac270553 | js/app.js | js/app.js | App = Ember.Application.create({});
App.IndexRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', ['red', 'yellow', 'blue']);
}
}); | App = Ember.Application.create();
App.Router.map(function() {
// put your routes here
});
App.IndexRoute = Ember.Route.extend({
model: function() {
return ['red', 'yellow', 'blue'];
}
});
| Add router stub and clean up IndexRoute | Add router stub and clean up IndexRoute | JavaScript | mit | miguelcoba/ember-intro-code,miguelcoba/ember-intro-code | ---
+++
@@ -1,7 +1,11 @@
-App = Ember.Application.create({});
+App = Ember.Application.create();
+
+App.Router.map(function() {
+ // put your routes here
+});
App.IndexRoute = Ember.Route.extend({
- setupController: function(controller) {
- controller.set('content', ['red', 'yellow', 'blue']);
+ model: funct... |
1ffc1f60cb159cf47152c5d778505bd04ec71f0e | js/rts.js | js/rts.js | // Runtime
////////////////////////////////////////////////////////////////////////////////
// Thunks
// A thunk object
function $(value)
{
this.forced = false;
this.value = value;
}
// Force the thunk object
$.prototype.force = function(nocache)
{
return nocache ?
this.value() :
(this.forced ?
th... | // Runtime
////////////////////////////////////////////////////////////////////////////////
// Thunks
// A thunk object
function $(value)
{
this.forced = false;
this.value = value;
}
// Force the thunk object
$.prototype.force = function()
{
return this.forced ?
this.value :
(this.value = this.value(),... | Speed up by having separate thunk forcings | Speed up by having separate thunk forcings
| JavaScript | bsd-3-clause | chrisdone/fore | ---
+++
@@ -11,26 +11,26 @@
}
// Force the thunk object
-$.prototype.force = function(nocache)
+$.prototype.force = function()
{
- return nocache ?
- this.value() :
- (this.forced ?
- this.value :
- (this.value = this.value(), this.forced = true, this.value));
+ return this.forced ?
+ this.val... |
d80b1ea4db12bc7f09f57b1ce9986a0eab9aa327 | src/html.js | src/html.js | import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { ServerStyleSheet } from 'styled-components';
const HTML = props => {
const head = Helmet.rewind();
const sheet = new ServerStyleSheet();
const main = sheet.collectStyles(<div id="___gatsby" dangerouslySet... | import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { ServerStyleSheet } from 'styled-components';
const HTML = props => {
const head = Helmet.rewind();
const sheet = new ServerStyleSheet();
const main = sheet.collectStyles(<div id="___gatsby" dangerouslySet... | Fix PropTypes for local dev server | Fix PropTypes for local dev server
| JavaScript | mit | iiroj/iiro.fi,iiroj/iiro.fi,iiroj/iiro.fi | ---
+++
@@ -34,9 +34,9 @@
};
HTML.propTypes = {
- body: PropTypes.object.isRequired,
- headComponents: PropTypes.object.isRequired,
- postBodyComponents: PropTypes.object.isRequired,
+ body: PropTypes.oneOfType([PropTypes.object, PropTypes.string]).isRequired,
+ headComponents: PropTypes.oneOfType([PropTypes... |
c4158a6e6b11915fc09336bc58376089f4fcd7d1 | src/main.js | src/main.js | import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
Vue.use(VueRouter);
const Main = Vue.extend({});
const router = new VueRouter();
router.map({
'/': { component: App },
});
router.start(Main, 'body');
| import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
Vue.use(VueRouter);
const Main = Vue.extend({});
const router = new VueRouter({ history: true });
router.map({
'/': { component: App },
});
router.start(Main, 'body');
| Use history option for vue-router | Use history option for vue-router
| JavaScript | mit | noraesae/soramaru,noraesae/soramaru | ---
+++
@@ -5,7 +5,7 @@
Vue.use(VueRouter);
const Main = Vue.extend({});
-const router = new VueRouter();
+const router = new VueRouter({ history: true });
router.map({
'/': { component: App }, |
98889b08d5dc039c5a58c522e5b2c9def1081a2d | src/util.js | src/util.js | const moment = require("moment");
let ctx;
try {
const chalk = require("chalk");
ctx = new chalk.constructor({enabled:true});
} catch (err) {
// silent
}
function getTime() {
const curHour = new Date().getHours() % 12 || 12;
return (curHour < 10 ? " " : "") + moment().format("LTS");
}
module.e... | const moment = require("moment");
let ctx;
try {
const chalk = require("chalk");
ctx = new chalk.constructor({enabled:true});
} catch (err) {
// silent
}
function getTime() {
return (" " + moment().format("LTS")).slice(-11);
}
module.exports = {
log(...args) {
if (ctx) console.log(getTi... | Improve time generation for logging | Improve time generation for logging
| JavaScript | mit | EPICZEUS/simple-discord.js | ---
+++
@@ -11,9 +11,7 @@
}
function getTime() {
- const curHour = new Date().getHours() % 12 || 12;
-
- return (curHour < 10 ? " " : "") + moment().format("LTS");
+ return (" " + moment().format("LTS")).slice(-11);
}
module.exports = { |
c7812c809faab6ff14d7125edcce9b0bb2e58abc | react-pure-function/app/index.js | react-pure-function/app/index.js | var React = require('react');
var ReactDOM = require('react-dom');
var ProfilePic = React.createClass({
render: function() {
return (
<img src={'https://photo.fb.com/' + this.props.username}></img>
);
}
});
var ProfileLink = React.createClass({
render: function() {
retu... | var React = require('react');
var ReactDOM = require('react-dom');
var ProfilePic = function(props) {
return <img src={'https://twitter.com/' + this.props.username + '/profile_image?size=original'}></img>
}
// var ProfilePic = React.createClass({
// render: function() {
// return (
// <img... | Create component using statelless component | Create component using statelless component
| JavaScript | mit | kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidchenko/playground,kidch... | ---
+++
@@ -1,33 +1,54 @@
var React = require('react');
var ReactDOM = require('react-dom');
-var ProfilePic = React.createClass({
- render: function() {
- return (
- <img src={'https://photo.fb.com/' + this.props.username}></img>
- );
- }
-});
+var ProfilePic = function(props) {
+ ... |
1cf5a0fe163a7769a83abc3cf5b14b91089a5f28 | lib/s3.js | lib/s3.js | var assert = require('assert')
var AWS = require('aws-sdk')
/**
* Create s3 client
* @param {Object} config AWS configuration
* @returns {Object} s3 client and helpers
*/
module.exports = function s3Loader (config) {
assert(config, 's3Loader requires config')
var client = new AWS.S3(config)
client.endpoint ... | const assert = require('assert')
const AWS = require('aws-sdk')
/**
* Create s3 client
* @param {Object} config AWS configuration
* @returns {Object} s3 client and helpers
*/
module.exports = function s3Loader (config) {
assert(config, 's3Loader requires config')
const client = new AWS.S3(config)
return {
... | Use const and remove useless lines | Use const and remove useless lines
| JavaScript | apache-2.0 | cesarandreu/bshed,cesarandreu/bshed | ---
+++
@@ -1,5 +1,5 @@
-var assert = require('assert')
-var AWS = require('aws-sdk')
+const assert = require('assert')
+const AWS = require('aws-sdk')
/**
* Create s3 client
@@ -8,9 +8,7 @@
*/
module.exports = function s3Loader (config) {
assert(config, 's3Loader requires config')
- var client = new AWS.... |
94564b672b27eeb8229e03aa324f73d8f0339bc2 | js/outputs.js | js/outputs.js | 'use strict';
var OutputManager = (function () {
var outputs = [];
var active = [];
var display = undefined;
var addOutput = function(o) {
outputs.push(o);
};
var activateOutput = function(o) {
active.push(o);
};
var deactivateOutput = function(o) {
var i = active.indexOf(o);
active... | 'use strict';
var OutputManager = (function() {
var outputs = [];
var active = [];
var display = undefined;
var addOutput = function(o) {
outputs.push(o);
};
var activateOutput = function(o) {
active.push(o);
};
var deactivateOutput = function(o) {
var i = active.indexOf(o);
active.... | Fix up gjshint errors in output manager | Fix up gjshint errors in output manager
| JavaScript | bsd-3-clause | qdot/giftic,qdot/giftic,qdot/giftic | ---
+++
@@ -1,6 +1,6 @@
'use strict';
-var OutputManager = (function () {
+var OutputManager = (function() {
var outputs = [];
var active = [];
@@ -21,7 +21,7 @@
};
var updateActiveOutputs = function(speed, direction) {
- for(var o in active) {
+ for (var o in active) {
o.update(speed,... |
7cf0ff5e0bcf845638d5c4bdbae06811bfc5614b | app/assets/javascripts/teikei.js | app/assets/javascripts/teikei.js | // Overwriting Backbone.Marionette.Renderer to use JST
Backbone.Marionette.Renderer.render = function(template, data) {
if (!JST[template]) throw "Template '" + template + "' not found!";
return JST[template](data);
};
// Extend and configure backbone-forms editors
var editors = Backbone.Form.editors;
editors.Ye... | // Overwriting Backbone.Marionette.Renderer to use JST
Backbone.Marionette.Renderer.render = function(template, data) {
if (!JST[template]) throw "Template '" + template + "' not found!";
return JST[template](data);
};
// Extend and configure backbone-forms editors
var editors = Backbone.Form.editors;
editors.Ye... | Set German month names for date editor. | Set German month names for date editor.
| JavaScript | agpl-3.0 | sjockers/teikei,teikei/teikei,sjockers/teikei,sjockers/teikei,teikei/teikei,teikei/teikei | ---
+++
@@ -16,6 +16,8 @@
editors.Checkbox.prototype.setValue.call(this, value === "yes");
}
});
+
+editors.Date.monthNames =["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
Teikei = new Backbone.Marionette.Application(); |
458ab503f8d0f6a7cc05ec735efac7cf15f46e67 | app/assets/scripts/views/home.js | app/assets/scripts/views/home.js | 'use strict';
import React from 'react';
import { Link } from 'react-router';
var Home = React.createClass({
displayName: 'Home',
render: function () {
return (
<section>
<header className='page__header--landing'>
<div className='page__headline--landing'>
<h1 className='pag... | 'use strict';
import React from 'react';
import { Link } from 'react-router';
var Home = React.createClass({
displayName: 'Home',
render: function () {
return (
<section>
<header className='page__header--landing'>
<div className='page__headline--landing'>
<h1 className='pag... | Replace Lorem Ipsum with intro text | Replace Lorem Ipsum with intro text
| JavaScript | bsd-2-clause | orma/openroads-vn-analytics,orma/openroads-vn-analytics,orma/openroads-vn-analytics | ---
+++
@@ -18,9 +18,8 @@
<div className='page__body--landing'>
<div className='inner'>
<h2>Access and improve Road Networks</h2>
- <p className='description'>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam molestiae
- deserunt temporibus volupt... |
5be6cac6e0fa7d206a47329c0cbabf484b203317 | src/request/repository/user-repository-internal.js | src/request/repository/user-repository-internal.js | 'use strict';
var _ = require('lodash');
var glimpse = require('glimpse');
// store Found Summary
(function () {
function processFoundSummary(requestRepositoryPayload) {
// TODO: need to update to deal with the fact that requests aren't distinct
var messages = requestRepositoryPayload.new... | 'use strict';
var _ = require('lodash');
var glimpse = require('glimpse');
// store Found Summary
(function () {
function processFoundSummary(requestRepositoryPayload) {
// TODO: need to update to deal with the fact that requests aren't distinct
var messages = requestRepositoryPayload.new... | Update user to only include requests that match root filter set | Update user to only include requests that match root filter set
| JavaScript | unknown | Glimpse/Glimpse.Client.Prototype,avanderhoorn/Glimpse.Client.Prototype,avanderhoorn/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype,Glimpse/Glimpse.Client.Prototype | ---
+++
@@ -14,9 +14,16 @@
var matchedData = [];
_.forEach(requestRepositoryPayload.affectedRequests, function(request) {
- var message = messageIndex[request.id];
- if (message) {
- matchedData.push({ request: request, user: mes... |
61212b63fb10e5a75ac5f87685823cd1f24dab2a | app/models/coordinator.js | app/models/coordinator.js | import EmberObject from '@ember/object';
import Evented from '@ember/object/evented';
import { computed } from '@ember/object';
import ObjHash from './obj-hash';
import { unwrapper } from 'ember-drag-drop/utils/proxy-unproxy-objects';
export default EmberObject.extend(Evented, {
objectMap: computed(function() {
... | import EmberObject from '@ember/object';
import Evented from '@ember/object/evented';
import { computed } from '@ember/object';
import ObjHash from './obj-hash';
import { unwrapper } from 'ember-drag-drop/utils/proxy-unproxy-objects';
export default EmberObject.extend(Evented, {
objectMap: computed(function() {
... | Use send instead of sendAction | Use send instead of sendAction
| JavaScript | mit | mharris717/ember-drag-drop,mharris717/ember-drag-drop | ---
+++
@@ -14,11 +14,11 @@
var payload = this.get('objectMap').getObj(id);
if (payload.ops.source && !payload.ops.source.isDestroying && !payload.ops.source.isDestroyed) {
- payload.ops.source.sendAction('action',payload.obj);
+ payload.ops.source.send('action', payload.obj);
}
if (... |
7fbf23d3569563524f9defa413b9e59da123b04a | styleguide/devServer.js | styleguide/devServer.js | var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack-dev.config');
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true
}).listen(8181, 'localhost', function(err) {
if (err) {
con... | var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack-dev.config');
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true
}).listen(8080, 'localhost', function(err) {
if (err) {
con... | Change dev server port so less confusing | Change dev server port so less confusing
| JavaScript | mit | scott-riley/loggins,PactCoffee/loggins,iest/loggins,tomgatzgates/loggins,tomgatzgates/loggins,PactCoffee/loggins,chrisspang/loggins,chrisspang/loggins,rdjpalmer/loggins,rdjpalmer/loggins,iest/loggins,scott-riley/loggins | ---
+++
@@ -6,10 +6,10 @@
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true
-}).listen(8181, 'localhost', function(err) {
+}).listen(8080, 'localhost', function(err) {
if (err) {
console.log(err);
}
- console.log('Listening at localhost:8181');
+ console.log('Listening ... |
23e751b09f927e2826a6a4083868f7f864fbc94c | helpers.js | helpers.js | console.log("Loading helpers.js");
window.snip$ = (function() {
var path = require("path");
function currEd() { return lt.objs.editor.pool.last_active.call(null); }
function currPath() { return lt.objs.tabs.__GT_path(currEd()); }
function hasSelection() { return lt.objs.editor.selection_QMARK_.call(null, c... | console.log("Loading helpers.js");
window.snip$ = (function() {
var path = require("path");
function currEd() { return lt.objs.editor.pool.last_active.call(null); }
function currPath() { return lt.objs.tabs.__GT_path(currEd()); }
function currFileName() {
var p = currPath();
return p ? path.basena... | Allow wrapping around current line even though not selected | Allow wrapping around current line even though not selected
| JavaScript | mit | rundis/lt-snippets,weaver-viii/lt-snippets | ---
+++
@@ -8,9 +8,31 @@
function currPath() { return lt.objs.tabs.__GT_path(currEd()); }
+ function currFileName() {
+ var p = currPath();
+ return p ? path.basename(p) : null;
+ }
+
+ function currFileNameSansExt() {
+ var f = currFileName();
+ return f ? f.replace(path.extname(f), "") : null... |
9a0198e14d43498ff563db56fec0747cb5419489 | main/constants/ui.js | main/constants/ui.js | // Height of main input
export const INPUT_HEIGHT = 45;
// Heigth of default result line
export const RESULT_HEIGHT = 45;
// Heigth of default result line
export const RESULT_WIDTH = 250;
// Width of main window
export const WINDOW_WIDTH = 600;
// Maximum results that would be rendered
export const MAX_RESULTS = 25... | // Height of main input
export const INPUT_HEIGHT = 45;
// Heigth of default result line
export const RESULT_HEIGHT = 45;
// Heigth of default result line
export const RESULT_WIDTH = 250;
// Width of main window
export const WINDOW_WIDTH = 650;
// Maximum results that would be rendered
export const MAX_RESULTS = 25... | Increase width of main input to 650px | Increase width of main input to 650px
| JavaScript | mit | KELiON/cerebro,KELiON/cerebro | ---
+++
@@ -8,7 +8,7 @@
export const RESULT_WIDTH = 250;
// Width of main window
-export const WINDOW_WIDTH = 600;
+export const WINDOW_WIDTH = 650;
// Maximum results that would be rendered
export const MAX_RESULTS = 25; |
a1e304bb328a6b4ea8b136414e496929df2085a1 | contrib/rethinkdb-co/index.js | contrib/rethinkdb-co/index.js | var _ = require('lodash');
var RethinkDB = require(__dirname + '/../rethinkdb');
var connex = require(__dirname + '/../../lib');
var RethinkDBCo = module.exports = function(options) {
if(!(this instanceof RethinkDBCo)) {
return new RethinkDBCo(options);
}
return RethinkDB.apply(this, arguments);
};
requir... | var _ = require('lodash');
var RethinkDB = require(__dirname + '/../rethinkdb');
var connex = require(__dirname + '/../../lib');
var RethinkDBCo = module.exports = function(options) {
if(!(this instanceof RethinkDBCo)) {
return new RethinkDBCo(options);
}
return RethinkDB.apply(this, arguments);
};
requir... | Add possibility to pass options to rethinkdb-co run | Add possibility to pass options to rethinkdb-co run
| JavaScript | mit | tedeh/connex | ---
+++
@@ -21,9 +21,10 @@
conn: handle,
- run: function(query) {
+ run: function(query, options) {
var conn = handle;
- return function(done) { return query.run(conn, done); };
+ options = options || {};
+ return function(done) { return query.run(conn, options, done); };
},
... |
1039beba35e4eb474cb35ce300aa8f0b437a7ea0 | lib/config.js | lib/config.js | 'use strict';
var cc = require('config-chain');
var autoconfig = function(overrides) {
var config = cc(overrides).add({
IP: process.env.OPENSHIFT_NODEJS_IP || '0.0.0.0',
PORT: process.env.FH_PORT || process.env.OPENSHIFT_NODEJS_PORT || 8001,
dataTopicPrefix: ':cloud:data',
persistentStore: process.e... | 'use strict';
var cc = require('config-chain');
/**
* The sync frequency to be passed to fh-wfm-sync.
* Sync frequency is set individually for the client and the server.
* * On the client the setting is named `sync_frequency`.
* * On the server the setting is named `syncFrequency`.
* It is recommended that these... | Update server `syncFrequency` value to match client `sync_frequency` | Update server `syncFrequency` value to match client `sync_frequency`
Currently the server-side dataset sync frequencies are set to 10 seconds
whereas the client-side dataset sync frequencies are set to 5 seconds.
Having differing sync frequencies can cause unnecessary load on the
server, causing a full sync to be per... | JavaScript | mit | feedhenry-raincatcher/raincatcher-demo-cloud | ---
+++
@@ -1,6 +1,15 @@
'use strict';
var cc = require('config-chain');
+
+/**
+ * The sync frequency to be passed to fh-wfm-sync.
+ * Sync frequency is set individually for the client and the server.
+ * * On the client the setting is named `sync_frequency`.
+ * * On the server the setting is named `syncFrequen... |
51cf6e6bc5fab543b18c23a7698eccaf006a9ca9 | generators/app/templates/_gulpfile.js | generators/app/templates/_gulpfile.js | var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
gulp.task('tslint', 'Lints all TypeScript source files', function(){
return gulp.src('src/**/*.ts')
.pipe(tslint())
.p... | var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
var tsFilesGlob = (function(c) {
return c.filesGlob || c.files || '**/*.ts';
})(require('./tsconfig.json'));
gulp.task('t... | Use filesGlob from tsconfig in gulp file | Use filesGlob from tsconfig in gulp file
| JavaScript | mit | ospatil/generator-node-typescript,ospatil/generator-node-typescript | ---
+++
@@ -4,8 +4,12 @@
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
+var tsFilesGlob = (function(c) {
+ return c.filesGlob || c.files || '**/*.ts';
+})(require('./tsconfig.json'));
+
gulp.task('tslint', 'Lints all TypeScript source files', function(){
- return gulp.src('sr... |
5a5565b39d96ce64767089bab8911ed891f44374 | isaac_math.js | isaac_math.js | // Math Library for ISAAC Physics.
// addVector function.
// Takes in two vectors, returns a new vector made by adding
// the inputs together. If the two input vectors don't have the same
// length, the first input vector will be returned.
function addVector (vectorA, vectorB) {
if(vectorA.length === vectorB.length) ... | // Math Library for ISAAC Physics.
// addVector function.
// Takes in two vectors, returns a new vector made by adding
// the inputs together. If the two input vectors don't have the same
// length, the first input vector will be returned.
function addVector (vectorA, vectorB) {
if(vectorA.length === vectorB.length) ... | Add dot product function to math module. | Add dot product function to math module.
| JavaScript | mit | isaacjs/ISAAC | ---
+++
@@ -34,3 +34,18 @@
function subtractVector (vectorA, vectorB) {
return addVector(vectorA, scaleVector(vectorB, -1));
}
+
+// dotProduct function.
+// Takes in two vectors, returns the dot product of the two. If the two input vectors
+// don't have the same length, -1 will be returned.
+function dotProduct... |
77e033f68bc06a8b522ab1d13c43473cc22e6911 | build/build.js | build/build.js | const rollup = require('rollup').rollup;
const babel = require('rollup-plugin-babel');
rollup({
entry: './src/index.js',
external: [
'babel-runtime/core-js/json/stringify',
'babel-runtime/core-js/object/assign',
'babel-runtime/helpers/asyncToGenerator',
'babel-runtime/regenerato... | const rollup = require('rollup').rollup;
const babel = require('rollup-plugin-babel');
rollup({
entry: './src/index.js',
external: [
'babel-runtime/core-js/json/stringify',
'babel-runtime/core-js/object/assign',
'babel-runtime/helpers/asyncToGenerator',
'babel-runtime/regenerato... | Remove arrow func compatible with old version node | Remove arrow func compatible with old version node
| JavaScript | mit | differui/rollup-plugin-sass,differui/rollup-plugin-sass | ---
+++
@@ -19,7 +19,7 @@
runtimeHelpers: true
})
]
-}).then((bundle) => {
+}).then(function (bundle) {
bundle.write({
dest: 'dist/rollup-plugin-sass.cjs.js',
format: 'cjs' |
bc629f18472ae90a87e4966a73e0cce6f0b250bf | lib/current.js | lib/current.js | // Date object that always reflects current time (with one second resolution)
'use strict';
var curry = require('es5-ext/lib/Function/prototype/curry')
, update;
update = function () {
this.setTime(Date.now());
};
module.exports = function () {
var date = new Date();
date.clear = curry.call(clearInterval, set... | // Date object that always reflects current time (with one second resolution)
'use strict';
var partial = require('es5-ext/lib/Function/prototype/partial')
, update;
update = function () {
this.setTime(Date.now());
};
module.exports = function () {
var date = new Date();
date.clear = partial.call(clearInterva... | Update up to changes in es5-ext | Update up to changes in es5-ext
| JavaScript | mit | medikoo/clock | ---
+++
@@ -2,7 +2,7 @@
'use strict';
-var curry = require('es5-ext/lib/Function/prototype/curry')
+var partial = require('es5-ext/lib/Function/prototype/partial')
, update;
@@ -12,6 +12,7 @@
module.exports = function () {
var date = new Date();
- date.clear = curry.call(clearInterval, setInterval(up... |
134d89a3d6379df9cbdf2a2194a229cd2980a0f5 | modules/DTMF/DTMF.js | modules/DTMF/DTMF.js | /* global APP */
/**
* A module for sending DTMF tones.
*/
var DTMFSender;
var initDtmfSender = function() {
// TODO: This needs to reset this if the peerconnection changes
// (e.g. the call is re-made)
if (DTMFSender)
return;
var localAudio = APP.RTC.localAudio;
if (localAudio && localA... | /* global APP */
/**
* A module for sending DTMF tones.
*/
var DTMFSender;
var initDtmfSender = function() {
// TODO: This needs to reset this if the peerconnection changes
// (e.g. the call is re-made)
if (DTMFSender)
return;
var localAudio = APP.RTC.localAudio;
if (localAudio && localA... | Fix a problem with accessing peerconnection, use duration and pause in the API. | Fix a problem with accessing peerconnection, use duration and pause in the API.
| JavaScript | apache-2.0 | dyweb/jitsi-meet,gerges/jitsi-meet,JiYou/jitsi-meet,IpexCloud/jitsi-meet,gpolitis/jitsi-meet,jitsi/jitsi-meet,gpolitis/jitsi-meet,kosmosby/jitsi-meet,jitsi/jitsi-meet,NxTec/jitsi-meet,gpolitis/jitsi-meet,jitsi/jitsi-meet,bgrozev/jitsi-meet,jitsi/jitsi-meet,bgrozev/jitsi-meet,buzzyboy/jitsi-meet,procandi/jitsi-meet,proc... | ---
+++
@@ -13,11 +13,12 @@
var localAudio = APP.RTC.localAudio;
if (localAudio && localAudio.getTracks().length > 0)
{
- var peerconnection =
- APP.xmpp.getConnection().jingle.activecall.peerconnection.peerconnection;
+ var peerconnection
+ = APP.xmpp.getConnection(... |
32828677d21b5de37859289632f91485ec20a2a1 | lib/router.js | lib/router.js | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allOwnedMangas', Meteor.userId());
},
fastRender: true
});
Router.route('/mi... | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return subscriptions.subscribe('allOwnedMangas', Meteor.userId());
},
fastRender: ... | Add a new subcription for the tomeDetails route | Add a new subcription for the tomeDetails route
| JavaScript | mit | dexterneo/mangas,dexterneo/mangas,dexterneo/mangatek,dexterneo/mangatek | ---
+++
@@ -1,32 +1,32 @@
var subscriptions = new SubsManager();
Router.configure({
- layoutTemplate: 'layout',
- loadingTemplate: 'loading',
- notFoundTemplate: 'notFound'
+ layoutTemplate: 'layout',
+ loadingTemplate: 'loading',
+ notFoundTemplate: 'notFound'
});
Router.route('/', {
- name: 'home',... |
6e185f1b5f34fe3416ee95a00aeeb5c5d0273fc9 | lib/config.js | lib/config.js | 'use strict';
var fs = require('fs');
var path = require('path');
exports.getApiConfig = function() {
return Object.freeze({
port: process.env.SERVER_PORT || 4002,
heartbeat: process.env.HEARTBEAT === 'true',
logLevel: process.env.LOG_LEVEL || 'info',
api: Object.freeze({
apiURL: process.env.A... | 'use strict';
var fs = require('fs');
var path = require('path');
exports.getApiConfig = function() {
return Object.freeze({
port: process.env.SERVER_PORT || 4002,
heartbeat: process.env.HEARTBEAT === 'true',
logLevel: process.env.LOG_LEVEL || 'info',
api: Object.freeze({
apiURL: process.env.A... | Change apiURL default from docker to localhost | Change apiURL default from docker to localhost
As this is a public repository, we can't assume everybody will be using docker
and have the same container name.
MOM-554
| JavaScript | mpl-2.0 | jembi/openhim-mediator-file-queue,jembi/openhim-mediator-file-queue | ---
+++
@@ -9,7 +9,7 @@
heartbeat: process.env.HEARTBEAT === 'true',
logLevel: process.env.LOG_LEVEL || 'info',
api: Object.freeze({
- apiURL: process.env.API_URL || 'https://openhim-core:8080',
+ apiURL: process.env.API_URL || 'https://localhost:8080',
username: process.env.API_USERNA... |
1d158c46020f6b9d42d5043a6f84c551032003fc | lib/config.js | lib/config.js | /*****************************************************************************
* utils.js
* Includes various utility functions
*/
var path = require('path');
var fs = require('fs');
var nconf = require('nconf');
var internals = {};
internals.configInited = false;
internals.Config = {}
internals.Config.load = f... | /*****************************************************************************
* utils.js
* Includes various utility functions
*/
var path = require('path');
var fs = require('fs');
var nconf = require('nconf');
var internals = {};
internals.configInited = false;
internals.Config = {}
/**
* Loads the config f... | Return default value on undefined only | Return default value on undefined only
| JavaScript | mit | altenia/ecofyjs-config | ---
+++
@@ -14,6 +14,10 @@
internals.Config = {}
+/**
+ * Loads the config from specific file if specified
+ * @param {string} configFilePath
+ */
internals.Config.load = function(configFilePath)
{
if (!configFilePath) {
@@ -34,13 +38,22 @@
internals.configInited = true;
};
+/**
+ * Retrieves a pr... |
9adb2f964716f4766765a566428ea101773fb878 | helper/DiskDataStore.js | helper/DiskDataStore.js | var fs = require('fs');
var Settings = require('./Settings');
var DiskDataStore = {};
DiskDataStore.init = function (){
this._CACHE_PATH = Settings.get('cache_path');
fs.mkdirSync(this._CACHE_PATH);
};
DiskDataStore.deleteEntry = function (key){
var fileName = this._CACHE_PATH + '/' + key;
fs.unlink(fileName... | var fs = require('fs');
var Settings = require('./Settings');
var DiskDataStore = {};
var fs = require('fs');
var deleteFolderRecursive = function(path) {
if( fs.existsSync(path) ) {
fs.readdirSync(path).forEach(function(file,index){
var curPath = path + '/' + file;
if(fs.lstatSync(curPath).isDirect... | Remove the cache folder before initializing data cache. | Remove the cache folder before initializing data cache.
| JavaScript | apache-2.0 | weilonge/unidisk,weilonge/unidisk,weilonge/unidisk | ---
+++
@@ -3,8 +3,24 @@
var DiskDataStore = {};
+var fs = require('fs');
+var deleteFolderRecursive = function(path) {
+ if( fs.existsSync(path) ) {
+ fs.readdirSync(path).forEach(function(file,index){
+ var curPath = path + '/' + file;
+ if(fs.lstatSync(curPath).isDirectory()) { // recurse
+ ... |
92d2afce8ed638f0b8673c52ce14af955423a25c | lib/router.js | lib/router.js | Router.configure({
layoutTemplate: 'layout',
waitOn: function() {
return Meteor.subscribe('projects');
}
});
Router.route('/', {
});
| Router.configure({
layoutTemplate: 'layout'
});
Router.route('/', {
name: 'projectsList'
});
| Add routes for layout and projects list | Add routes for layout and projects list
| JavaScript | mit | PUMATeam/puma,PUMATeam/puma | ---
+++
@@ -1,10 +1,7 @@
Router.configure({
- layoutTemplate: 'layout',
- waitOn: function() {
- return Meteor.subscribe('projects');
- }
+ layoutTemplate: 'layout'
});
Router.route('/', {
-
+ name: 'projectsList'
}); |
2d815e46d2cde87c660f38af6ec39843470359ed | grunt/mkdir.js | grunt/mkdir.js | module.exports = {
mklibdir: {
options: {
mode: 0644,
create: ['lib/fonts', 'lib/css', 'lib/font','lib/lang', 'dist', 'dist/font','dist/lang']
}
}
};
| module.exports = {
mklibdir: {
options: {
mode: 0755,
create: ['lib/fonts', 'lib/css', 'lib/font','lib/lang', 'dist', 'dist/font','dist/lang']
}
}
};
| Change folder access right to 0755 | Change folder access right to 0755
| JavaScript | mit | stevennick/videojs-ad-scheduler,stevennick/ott-ad-scheduler,stevennick/videojs-ad-scheduler,stevennick/ott-ad-scheduler | ---
+++
@@ -2,7 +2,7 @@
mklibdir: {
options: {
- mode: 0644,
+ mode: 0755,
create: ['lib/fonts', 'lib/css', 'lib/font','lib/lang', 'dist', 'dist/font','dist/lang']
}
} |
1135366b62530ffa4ecb8e2c9505f73d79e94d7a | gulp-config.js | gulp-config.js | module.exports = {
folder: {
tasks: 'tasks',
src: 'src',
build: 'assets',
prod: 'production'
},
task: {
htmlHint: 'html-hint',
jsHint: 'js-hint',
buildCustomJs: 'build-custom-js',
buildJsVendors: 'build-js-vendors',
buildSass: 'build-sass',
buildSassProd: 'build-sass-produc... | module.exports = {
folder: {
tasks: 'tasks',
src: 'src',
build: 'assets',
prod: 'production'
},
task: {
htmlHint: 'html-hint',
jsHint: 'js-hint',
buildCustomJs: 'build-custom-js',
buildJsVendors: 'build-js-vendors',
buildSass: 'build-sass',
buildSassProd: 'build-sass-produc... | Add more files to ignore for production task | Add more files to ignore for production task
| JavaScript | mit | KirillPd/web-starter-kit,KirillPd/web-starter-kit,justcoded/web-starter-kit,vodnycheck/justcoded,justcoded/web-starter-kit,vodnycheck/justcoded | ---
+++
@@ -25,6 +25,8 @@
},
ignore: function() {
return [
+ `!${this.folder.src}/`,
+ `!${this.folder.src}/**/*`,
'!bower/',
'!bower/**/*',
'!node_modules/**/*',
@@ -42,7 +44,9 @@
'!CONTRIBUTING.md',
'!gulp-config.js',
'!docs/',
- '!docs/**/*'
+ ... |
3c85a294c6173604793faa68ed829a10122efc7d | examples/babel/webpack.config.js | examples/babel/webpack.config.js | // Note: this example requires babel-loader
// npm install babel-loader
var path = require('path');
module.exports = {
context: __dirname,
entry: './file-to-annotate',
output: {
path: __dirname + '/dist',
filename: 'build.js'
},
resolveLoader: {
fallback: path.resolve(__dirname, '.... | // Note: this example babel and equires babel-loader
// npm install babel babel-loader
var path = require('path');
module.exports = {
context: __dirname,
entry: './file-to-annotate',
output: {
path: __dirname + '/dist',
filename: 'build.js'
},
resolveLoader: {
fallback: path.resolv... | Update babel example to take peer dependency to babel into account. | Update babel example to take peer dependency to babel into account.
Since npm 3 peer dependencies will not be installed automatically
(which was the default in npm 2.x). For this reason, running
npm install babel-loader
in examples/babel will throw an error when running with npm 3.
This change simply updates the com... | JavaScript | mit | huston007/ng-annotate-loader,huston007/ng-annotate-loader | ---
+++
@@ -1,5 +1,5 @@
-// Note: this example requires babel-loader
-// npm install babel-loader
+// Note: this example babel and equires babel-loader
+// npm install babel babel-loader
var path = require('path');
|
2f4d3ee03667fffb105fa2080abbcefe73a10e94 | src/file_seacher.js | src/file_seacher.js | /* @flow */
import _ from 'lodash'
import type { OrderedMap } from 'immutable';
import type MediaFile from './media_file';
export default class FileSeacher {
files: OrderedMap<number, MediaFile>;
constructor(files: OrderedMap<number, MediaFile>) {
this.files = files;
}
search(searchKeyword: string): Ord... | /* @flow */
import _ from 'lodash'
import type { OrderedMap } from 'immutable';
import type MediaFile from './media_file';
export default class FileSeacher {
files: OrderedMap<number, MediaFile>;
constructor(files: OrderedMap<number, MediaFile>) {
this.files = files;
}
search(searchKeyword: string): Ord... | Implement smartcase matching with search keyword | Implement smartcase matching with search keyword
| JavaScript | mit | joker1007/blackalbum,joker1007/blackalbum | ---
+++
@@ -18,7 +18,7 @@
const queries = searchKeyword.split(/ +/).map(word => word.split(":"));
const result = _.reduce(queries, (files, q) => {
if (q.length == 1)
- return files.filter(f => this.isIncludeProperty(f, "basename", q));
+ return files.filter(f => this.isIncludeProperty(f... |
3c77d4e89dc8f097810ce84608b74ba158a8deb7 | src/util/compose.js | src/util/compose.js | const compose = (...functions) => {
return (...initial) => {
let count = functions.length;
return (function accum(arg) {
return count ? (count--, accum(functions[count].call(functions[count], arg))) : arg;
}).apply(functions[count - 1], initial);
};
};
export default compose;
| const compose = (...functions) => {
return (...initial) => {
let count = functions.length;
return (function accumulator(arg) {
return count ? (count--, accumulator(functions[count].call(functions[count], arg))) : arg;
}).apply(functions[count - 1], initial);
};
};
export default compose;
| Refactor to use a consistent name across functions | Refactor to use a consistent name across functions
| JavaScript | mit | restrung/restrung-js | ---
+++
@@ -2,8 +2,8 @@
return (...initial) => {
let count = functions.length;
- return (function accum(arg) {
- return count ? (count--, accum(functions[count].call(functions[count], arg))) : arg;
+ return (function accumulator(arg) {
+ return count ? (count--, accumulator(functions[count].... |
3625063c9b71d3d45bede0bd83af2152d83cd5ee | imports/ui/components/header/drawer-navigation.js | imports/ui/components/header/drawer-navigation.js | import React from 'react';
import Drawer from 'material-ui/Drawer';
import DrawerMenuItems from '../../containers/drawer-menu-items';
import * as ImagesHelper from '../../../util/images';
export default class DrawerNavigation extends React.Component {
componentDidMount() {
// iubenda Privacy Policy
(functio... | import React from 'react';
import Drawer from 'material-ui/Drawer';
import DrawerMenuItems from '../../containers/drawer-menu-items';
import * as ImagesHelper from '../../../util/images';
export default class DrawerNavigation extends React.Component {
componentDidMount() {
// iubenda Privacy Policy
(functio... | Set overflow:hidden to hide default windows scrollbars on drawer | Set overflow:hidden to hide default windows scrollbars on drawer
| JavaScript | mit | irvinlim/free4all,irvinlim/free4all | ---
+++
@@ -27,7 +27,7 @@
render() {
return (
- <Drawer docked={ false } width={ 250 } open={ this.props.isOpen } onRequestChange={ isOpen => this.props.setDrawerOpen(isOpen) }>
+ <Drawer docked={ false } width={ 250 } open={ this.props.isOpen } onRequestChange={ isOpen => this.props.setDrawerOpen... |
184ffcd99116c9053e7956a3db5f5acc152fc971 | js/src/forum/components/DiscussionsUserPage.js | js/src/forum/components/DiscussionsUserPage.js | import UserPage from './UserPage';
import DiscussionList from './DiscussionList';
/**
* The `DiscussionsUserPage` component shows a discussion list inside of a user
* page.
*/
export default class DiscussionsUserPage extends UserPage {
init() {
super.init();
this.loadUser(m.route.param('username'));
}
... | import UserPage from './UserPage';
import DiscussionList from './DiscussionList';
/**
* The `DiscussionsUserPage` component shows a discussion list inside of a user
* page.
*/
export default class DiscussionsUserPage extends UserPage {
init() {
super.init();
this.loadUser(m.route.param('username'));
}
... | Sort user discussion list properly | Sort user discussion list properly
| JavaScript | mit | datitisev/core,datitisev/core,flarum/core,malayladu/core,datitisev/core,flarum/core,datitisev/core,malayladu/core,malayladu/core,flarum/core,malayladu/core | ---
+++
@@ -17,7 +17,8 @@
<div className="DiscussionsUserPage">
{DiscussionList.component({
params: {
- q: 'author:' + this.user.username()
+ q: 'author:' + this.user.username(),
+ sort: 'newest'
}
})}
</div> |
c8e673124e479dfc25a8ae0992c1e449d1d1362d | plugins/embed/gui-themes/themes/zeit-amp.js | plugins/embed/gui-themes/themes/zeit-amp.js | define([
'plugins/post-hash',
'plugins/status',
'plugins/predefined-types',
'theme/scripts/js/plugins/ampify',
'theme/scripts/js/plugins/button-pagination',
'theme/scripts/js/plugins/social-share',
'css!theme/liveblog',
'tmpl!theme/container',
'tmpl!theme/posts-list',
'tmpl!theme... | define([
'plugins/post-hash',
'plugins/status',
'plugins/predefined-types',
'theme/scripts/js/plugins/ampify',
'theme/scripts/js/plugins/button-pagination',
'theme/scripts/js/plugins/social-share',
// 'css!theme/liveblog',
'tmpl!theme/container',
'tmpl!theme/posts-list',
'tmpl!th... | Disable CSS for ZEIT AMP theme | Disable CSS for ZEIT AMP theme
| JavaScript | agpl-3.0 | superdesk/Live-Blog,superdesk/Live-Blog,superdesk/Live-Blog,superdesk/Live-Blog | ---
+++
@@ -5,7 +5,7 @@
'theme/scripts/js/plugins/ampify',
'theme/scripts/js/plugins/button-pagination',
'theme/scripts/js/plugins/social-share',
- 'css!theme/liveblog',
+ // 'css!theme/liveblog',
'tmpl!theme/container',
'tmpl!theme/posts-list',
'tmpl!theme/item/base', |
dc6833e9115f7cb61de753b928781c30b2937958 | source/assets/javascripts/all.js | source/assets/javascripts/all.js | document.addEventListener("DOMContentLoaded", function(){
var select = document.querySelector('.locales select');
select.addEventListener('change', function(event){
origin = window.location.origin;
languageCode = event.currentTarget.selectedOptions[0].value
window.location.replace(origin + "/" + languag... | document.addEventListener("DOMContentLoaded", function(){
var select = document.querySelector('.locales select');
select.addEventListener('change', function(event){
origin = window.location.origin;
languageCode = event.currentTarget.selectedOptions[0].value
window.location.replace(origin + "/" + languag... | Fix JS bug in FAQ | Fix JS bug in FAQ
| JavaScript | mit | olivierlacan/keep-a-changelog,olivierlacan/keep-a-changelog | ---
+++
@@ -21,7 +21,7 @@
paragraphs = [];
paragraphs.push(lastParagraph);
- while (lastParagraph.nextElementSibling.tagName == "P") {
+ while (lastParagraph.nextElementSibling && lastParagraph.nextElementSibling.tagName == "P") {
lastParagraph = lastParagraph.nextElementSibling;
parag... |
316855e8230f114bdf409b59809c86bed2dd27bc | build/wrapper.template.js | build/wrapper.template.js | (function(){var g={};
(function(window){%output%}.bind(g,this))();
if (typeof(module)!="undefined"&&module.exports)module.exports=g.shaka;
else if (typeof(define)!="undefined")define(function(){return g.shaka});
else this.shaka=g.shaka;
})();
| (function(){var g={};
(function(window){%output%}.bind(g,this))();
if (typeof(module)!="undefined"&&module.exports)module.exports=g.shaka;
else if (typeof(define)!="undefined" && define.amd)define(function(){return g.shaka});
else this.shaka=g.shaka;
})();
| Check for define.amd along with typeof(define) | Check for define.amd along with typeof(define)
To prevent crashing with other module loaders that support `define`, but are not full AMD module loaders, check for `define.amd` as well before defining the AMD module. | JavaScript | apache-2.0 | brightcove/shaka-player,priyajeet/shaka-player,priyajeet/shaka-player,baconz/shaka-player,cmgrecu/shaka-player,sanbornhnewyyz/shaka-player,Afrostream/shaka-player,treejames/shaka-player,baconz/shaka-player,vimond/shaka-player,treejames/shaka-player,tvoli/shaka-player,ustudio/shaka-player,TheModMaker/shaka-player,samdut... | ---
+++
@@ -1,6 +1,6 @@
(function(){var g={};
(function(window){%output%}.bind(g,this))();
if (typeof(module)!="undefined"&&module.exports)module.exports=g.shaka;
-else if (typeof(define)!="undefined")define(function(){return g.shaka});
+else if (typeof(define)!="undefined" && define.amd)define(function(){return g... |
cea824e63e4db6953c05ac67a1c9923f1f48abfc | test/129026_cog_sog_rapid_update.js | test/129026_cog_sog_rapid_update.js | var chai = require("chai");
chai.Should();
chai.use(require('chai-things'));
describe('129026 COG & SOG, Rapid Update', function () {
it('complete sentence converts', function () {
var tree = require("../n2kMapper.js").toNested(
JSON.parse('{"timestamp":"2014-08-15-18:00:10.005","prio":"2","src":"160","ds... | var chai = require("chai");
chai.Should();
chai.use(require('chai-things'));
chai.use(require('signalk-schema').chaiModule);
describe('129026 COG & SOG, Rapid Update', function () {
it('complete sentence converts', function () {
var tree = require("../n2kMapper.js").toNested(
JSON.parse('{"timestamp":"20... | Fix 129026 COG & SOG | Fix 129026 COG & SOG
| JavaScript | apache-2.0 | SignalK/n2k-signalk | ---
+++
@@ -1,6 +1,8 @@
var chai = require("chai");
chai.Should();
chai.use(require('chai-things'));
+chai.use(require('signalk-schema').chaiModule);
+
describe('129026 COG & SOG, Rapid Update', function () {
@@ -11,6 +13,7 @@
tree.should.have.deep.property('navigation.courseOverGroundTrue.value', 206.1)... |
7624bbab290982806204b03df05d23e8932a11a7 | test/feature/Scope/BlockBinding6.js | test/feature/Scope/BlockBinding6.js | function testBlock() {
// Test function expressions.
{
var x = function g() { return 'g'; } || function h() { return 'h'; };
return x;
}
}
// ----------------------------------------------------------------------------
var result = testBlock();
assertEquals('g', result());
assertEquals('g', result.name)... | function testBlock() {
// Test function expressions.
{
var x = function g() { return 'g'; } || function h() { return 'h'; };
return x;
}
}
// ----------------------------------------------------------------------------
var result = testBlock();
assertEquals('g', result());
| Remove test that tests function instance name since that is non standard | Remove test that tests function instance name since that is non standard
| JavaScript | apache-2.0 | ide/traceur,ide/traceur,ide/traceur | ---
+++
@@ -10,4 +10,3 @@
var result = testBlock();
assertEquals('g', result());
-assertEquals('g', result.name); |
49253300460d315b475feca48a0727ad50d6dd13 | test/monkeyPatchSinonStackFrames.js | test/monkeyPatchSinonStackFrames.js | // Monkey-patch sinon.create to patch all created spyCall instances
// so that the top stack frame is a predictable string.
// Prevents every test from failing when the test suite is updated.
module.exports = function (sinon) {
// Copied from test/monkeyPatchSinonStackFrames.js
function patchCall(call) {
... | // Monkey-patch sinon.create to patch all created spyCall instances
// so that the top stack frame is a predictable string.
// Prevents every test from failing when the test suite is updated.
module.exports = function (sinon) {
function isSpy(value) {
return value && typeof value.id === 'string' &&
... | Test suite: Fix overeager monkey-patching of the sinon.stub return value that made sinon.createStubInstance() return an object with getCall and getCalls methods. | Test suite: Fix overeager monkey-patching of the sinon.stub return value that made sinon.createStubInstance() return an object with getCall and getCalls methods.
| JavaScript | mit | unexpectedjs/unexpected-sinon,unexpectedjs/unexpected-sinon | ---
+++
@@ -2,7 +2,11 @@
// so that the top stack frame is a predictable string.
// Prevents every test from failing when the test suite is updated.
module.exports = function (sinon) {
- // Copied from test/monkeyPatchSinonStackFrames.js
+ function isSpy(value) {
+ return value && typeof value.id === ... |
84945daecb84911f27dbe4c6911f4cba4c994e78 | test/specs/simulation.drone.spec.js | test/specs/simulation.drone.spec.js | const { generateRandom } = require('../../server/simulation/drone');
describe('generateRandom()', () => {
const sampleArguments = {coords: {lat: 1, long: 1}, distance: 1000 };
test('returns an object', () => {
expect(
typeof generateRandom(sampleArguments)
).toBe('object');
});
test('returns a... | const { generateRandom } = require('../../server/simulation/drone');
describe('generateRandom()', () => {
const sampleArguments = {coords: {lat: 1, long: 1}, distance: 1000 };
test('returns an object', () => {
expect(
typeof generateRandom(sampleArguments)
).toBe('object');
});
test('returns a... | Add tests to check missions_completed attribute in random drone generator | Add tests to check missions_completed attribute in random drone generator
| JavaScript | mit | DAVFoundation/missioncontrol,DAVFoundation/missioncontrol,DAVFoundation/missioncontrol | ---
+++
@@ -40,6 +40,12 @@
).toHaveProperty('rating');
});
+ test('returns an object with a missions_completed attribute', () => {
+ expect(
+ generateRandom(sampleArguments)
+ ).toHaveProperty('missions_completed');
+ });
+
test('returns an object with a missions_completed_7_days attribute'... |
7c2213c67cbc670a7a4aecd5dbdab47013dca4ed | test/testServer.js | test/testServer.js | /**
* Created by Omnius on 18/07/2016.
*/
'use strict';
const Hapi = require('hapi');
const HapiAuthBasic = require('hapi-auth-basic');
const HapiAuthHawk = require('hapi-auth-hawk');
const Inert = require('inert');
module.exports = function () {
const server = new Hapi.Server();
server.connection({
... | /**
* Created by Omnius on 18/07/2016.
*/
'use strict';
const Hapi = require('hapi');
const HapiAuthBasic = require('hapi-auth-basic');
const HapiAuthHawk = require('hapi-auth-hawk');
const Inert = require('inert');
const Handlebars = require('handlebars');
const Vision = require('vision');
const Visionary = require... | Add view manager on test server | Add view manager on test server
| JavaScript | mit | identityclash/hapi-login-test,identityclash/hapi-login-test | ---
+++
@@ -7,6 +7,9 @@
const HapiAuthBasic = require('hapi-auth-basic');
const HapiAuthHawk = require('hapi-auth-hawk');
const Inert = require('inert');
+const Handlebars = require('handlebars');
+const Vision = require('vision');
+const Visionary = require('visionary');
module.exports = function () {
@@ -28... |
a11e9cbf5006c81826fdc1d8a79680c3b5097f2e | tests/view.spec.js | tests/view.spec.js |
// http://mochajs.org/
// @see http://chaijs.com/api/bdd/
describe('View', function() {
var App;
var View;
var testView;
beforeEach(function() {
App = window.App;
View = App.View;
});
afterEach(function() {
testView = undefined;
App = null;
View = null;
});
it('should set templa... |
// http://mochajs.org/
// @see http://chaijs.com/api/bdd/
describe('View', function() {
var App;
var View;
var testView;
beforeEach(function() {
App = window.App;
View = App.View;
});
afterEach(function() {
testView = undefined;
App = null;
View = null;
});
it('should set templa... | Add render template with js instructions | Add render template with js instructions
| JavaScript | mit | easy-deep-learning/mvc-pure-js,easy-deep-learning/mvc-pure-js | ---
+++
@@ -24,6 +24,7 @@
expect(typeof testView.template).to.equal('function');
});
+
it('should render simple template', function() {
testView = new View('<div><%= name %></div>');
@@ -34,4 +35,17 @@
expect(result).to.equal(reference);
});
+
+ it('should set tempalte (with JS code) ',... |
0e5134d71da887d125b228ee773a47935b528c8a | config/adapters.js | config/adapters.js | /**
* Global adapter config
*
* The `adapters` configuration object lets you create different global "saved settings"
* that you can mix and match in your models. The `default` option indicates which
* "saved setting" should be used if a model doesn't have an adapter specified.
*
* Keep in mind that options y... | /**
* Global adapter config
*
* The `adapters` configuration object lets you create different global "saved settings"
* that you can mix and match in your models. The `default` option indicates which
* "saved setting" should be used if a model doesn't have an adapter specified.
*
* Keep in mind that options y... | Change db config to use postgres. Use secret config file to load connection settings. | Change db config to use postgres. Use secret config file to load connection settings.
| JavaScript | mit | thomaslangston/sailsnode | ---
+++
@@ -12,11 +12,13 @@
* http://sailsjs.org/#documentation
*/
+var secrets = require('../secrets');
+
module.exports.adapters = {
// If you leave the adapter config unspecified
// in a model definition, 'default' will be used.
- 'default': 'disk',
+ 'default': 'postgres',
// Persistent ada... |
62e63833c58b5ac8068199bb34897569654448e2 | reviewboard/static/rb/js/utils/consoleUtils.js | reviewboard/static/rb/js/utils/consoleUtils.js | var _origAssert = console.assert;
if (typeof window.console === 'undefined') {
window.console = {};
}
if (typeof console.log === 'undefined') {
console.log = function() {}
}
/*
* console.assert may not behave as we'd hope on all implementations.
* On Chrome, for instance, it doesn't raise an exception. So... | var _origAssert;
if (typeof window.console === 'undefined') {
window.console = {};
}
_origAssert = console.assert;
if (typeof console.log === 'undefined') {
console.log = function() {}
}
/*
* console.assert may not behave as we'd hope on all implementations.
* On Chrome, for instance, it doesn't raise an ... | Fix the console fallbacks to not break older browsers. | Fix the console fallbacks to not break older browsers.
The console fallbacks were designed to work if no console API was
defined, but it still ended up accessing stuff inside of console. It
also had some unused code at the end. This has been fixed and should
restore compatibility with Firefox 3.x and IE.
Fixes bug #2... | JavaScript | mit | custode/reviewboard,chipx86/reviewboard,sgallagher/reviewboard,davidt/reviewboard,custode/reviewboard,davidt/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,1tush/reviewboard,beol/reviewboard,1tush/reviewboard,brennie/reviewboard,beol/reviewboard,custode/reviewboard,beol/reviewboard,custode/reviewboard,chip... | ---
+++
@@ -1,9 +1,10 @@
-var _origAssert = console.assert;
-
+var _origAssert;
if (typeof window.console === 'undefined') {
window.console = {};
}
+
+_origAssert = console.assert;
if (typeof console.log === 'undefined') {
console.log = function() {}
@@ -24,7 +25,3 @@
throw Error(msg);
... |
d7253c7ddde991aa57eb607e8888758ff6fc27b8 | client/views/home/home.js | client/views/home/home.js | Template.home.rendered = function () {
initInfiniteScroll.call(this, 'topics');
};
Template.home.destroyed = function () {
stopInfiniteScroll.call(this);
};
Template.home.helpers({
topics: function() {
return Topics.find();
},
moreTopics: function () {
return Topics.find().count() > Session.get('topicsLimi... | Template.home.rendered = function () {
initInfiniteScroll.call(this, 'topics');
};
Template.home.destroyed = function () {
stopInfiniteScroll.call(this);
};
Template.home.helpers({
topics: function() {
return Topics.find();
},
moreTopics: function () {
return Topics.find().count() === Session.get('itemsLim... | Fix infinite scroll loading helper | Fix infinite scroll loading helper
| JavaScript | mit | erasaur/binary,erasaur/binary,erasaur/binary | ---
+++
@@ -11,6 +11,6 @@
return Topics.find();
},
moreTopics: function () {
- return Topics.find().count() > Session.get('topicsLimit');
+ return Topics.find().count() === Session.get('itemsLimit');
}
}); |
f3c665de8dc05b474e8b7ec993b1354cf028505c | src/filters.js | src/filters.js | (function() {
'use strict';
var app = angular.module('bonito-filters', []);
/**
* Print large number using prefixes (k, M, G, etc.) to
* keep their size short and to be friendlier to the poor non-robots.
* Adapted from: https://gist.github.com/thomseddon/3511330
*/
app.filter('humanNumber', functi... | (function() {
'use strict';
var app = angular.module('bonito-filters', []);
/**
* Print large number using prefixes (k, M, G, etc.) to
* keep their size short and to be friendlier to the poor non-robots.
* Adapted from: https://gist.github.com/thomseddon/3511330
*/
app.filter('humanNumber', functi... | Fix NaN when input is 0 | Fix NaN when input is 0
| JavaScript | apache-2.0 | tsg/bonito,tsg/bonito | ---
+++
@@ -14,6 +14,9 @@
if (isNaN(input) || !isFinite(input)) {
return '-';
}
+ if (input === 0) {
+ return '0';
+ }
var negativeSign = '';
if (input < 0) {
input = -input; |
2075a9bb23763def637f025c551e7cb1044312a8 | config/mongoose.js | config/mongoose.js | const config = require('config');
const mongooseOptions = {
useNewUrlParser: true,
useFindAndModify: false,
useCreateIndex: true,
useUnifiedTopology: true,
readPreference: 'secondaryPreferred', // Has MongoDB prefer secondary servers for read operations.
appname: 'subscriptions', // Displays th... | const config = require('config');
const mongooseOptions = {
useNewUrlParser: true,
useFindAndModify: false,
useCreateIndex: true,
useUnifiedTopology: false,
readPreference: 'secondaryPreferred', // Has MongoDB prefer secondary servers for read operations.
appname: 'subscriptions', // Displays t... | Disable mongo unified topology, see what happens... | Disable mongo unified topology, see what happens...
| JavaScript | mit | gfw-api/gfw-subscription-api,gfw-api/gfw-subscription-api,gfw-api/gfw-subscription-api | ---
+++
@@ -4,7 +4,7 @@
useNewUrlParser: true,
useFindAndModify: false,
useCreateIndex: true,
- useUnifiedTopology: true,
+ useUnifiedTopology: false,
readPreference: 'secondaryPreferred', // Has MongoDB prefer secondary servers for read operations.
appname: 'subscriptions', // Displays... |
59040c2d68bae66da58e4abe8c54ab0ec9142823 | website/addons/googledrive/static/node-cfg.js | website/addons/googledrive/static/node-cfg.js | 'use strict';
var ko = require('knockout');
var AddonNodeConfig = require('js/addonNodeConfig').AddonNodeConfig;
var url = window.contextVars.node.urls.api + 'googledrive/config/';
new AddonNodeConfig('Google Drive', '#googledriveScope', url, '#googledriveGrid',
{
decodeFolder: (function(folder_name) {
... | 'use strict';
var AddonNodeConfig = require('js/addonNodeConfig').AddonNodeConfig;
var url = window.contextVars.node.urls.api + 'googledrive/config/';
new AddonNodeConfig('Google Drive', '#googledriveScope', url, '#googledriveGrid',
{
decodeFolder: (function(folder_name) {
return decodeURIComp... | Remove knockout requirement, as it is not used by the custom functions | Remove knockout requirement, as it is not used by the custom functions
| JavaScript | apache-2.0 | dplorimer/osf,laurenrevere/osf.io,njantrania/osf.io,hmoco/osf.io,Johnetordoff/osf.io,icereval/osf.io,barbour-em/osf.io,jolene-esposito/osf.io,caneruguz/osf.io,mattclark/osf.io,binoculars/osf.io,fabianvf/osf.io,KAsante95/osf.io,caneruguz/osf.io,HalcyonChimera/osf.io,caneruguz/osf.io,asanfilippo7/osf.io,CenterForOpenScie... | ---
+++
@@ -1,5 +1,5 @@
'use strict';
-var ko = require('knockout');
+
var AddonNodeConfig = require('js/addonNodeConfig').AddonNodeConfig;
var url = window.contextVars.node.urls.api + 'googledrive/config/'; |
1d23855155e98688fc1c8b85612e5532c52cc3a3 | lib/client.js | lib/client.js | var _ = require('lodash');
var Client = module.exports = function(config) {
if (! config) {
config = {};
}
this.version = config.version || '1';
this._apiSetup();
};
Client.prototype._apiSetup = function() {
var api = require('./v' + this.version + '/api.js');
// Extend the Client object with the a... | var _ = require('lodash');
var Client = module.exports = function(config) {
if (! config) {
config = {};
}
this.version = config.version || '3';
this._apiSetup();
};
Client.prototype._apiSetup = function() {
var api = require('./v' + this.version + '/api.js');
// Extend the Client object with the a... | Change default API version to v3 | Change default API version to v3
| JavaScript | mit | sungwoncho/node-ufc-api | ---
+++
@@ -5,7 +5,7 @@
config = {};
}
- this.version = config.version || '1';
+ this.version = config.version || '3';
this._apiSetup();
}; |
89755b9c7da113508ccc5715d7d62a8ee44a809a | config/dependency-lint.js | config/dependency-lint.js | /* eslint-env node */
'use strict';
module.exports = {
allowedVersions: {
'ember-getowner-polyfill': '^1.0.0 || ^2.0.0',
'ember-inflector': '^1.0.0 || ^2.0.0',
'ember-runtime-enumerable-includes-polyfill': '^1.0.0 || ^2.0.0',
'ember-require-module': '^0.1',
}
};
| /* eslint-env node */
'use strict';
module.exports = {
allowedVersions: {
'ember-cli-string-helpers': '^1.4.0', //temporary workaround for conflict with ember-light-table
'ember-getowner-polyfill': '^1.0.0 || ^2.0.0',
'ember-inflector': '^1.0.0 || ^2.0.0',
'ember-runtime-enumerable-includes-polyfill'... | Allow multiple versions of ember-cli-string-helpers | Allow multiple versions of ember-cli-string-helpers
This is a temporary workaround for a conflict with ember-light-table
| JavaScript | mit | thecoolestguy/frontend,thecoolestguy/frontend,ilios/frontend,djvoa12/frontend,dartajax/frontend,ilios/frontend,jrjohnson/frontend,dartajax/frontend,jrjohnson/frontend,djvoa12/frontend | ---
+++
@@ -3,6 +3,7 @@
module.exports = {
allowedVersions: {
+ 'ember-cli-string-helpers': '^1.4.0', //temporary workaround for conflict with ember-light-table
'ember-getowner-polyfill': '^1.0.0 || ^2.0.0',
'ember-inflector': '^1.0.0 || ^2.0.0',
'ember-runtime-enumerable-includes-polyfill': '... |
88b360cc27fb12df1d683b3221535a0fdd36a570 | web/src/js/lib/models/LayerModel.js | web/src/js/lib/models/LayerModel.js | cinema.models.LayerModel = Backbone.Model.extend({
constructor: function (defaults, options) {
Backbone.Model.call(this, {}, options);
if (typeof defaults === 'string') {
this.setFromString(defaults);
} else if (defaults) {
this.set('state', defaults);
}
... | cinema.models.LayerModel = Backbone.Model.extend({
constructor: function (defaults, options) {
Backbone.Model.call(this, {}, options);
if (typeof defaults === 'string') {
this.setFromString(defaults);
} else if (defaults) {
this.set('state', defaults);
}
... | Fix layer model serialize method to use new organization | Fix layer model serialize method to use new organization
| JavaScript | bsd-3-clause | Kitware/cinema,Kitware/cinema,Kitware/cinema,Kitware/cinema | ---
+++
@@ -16,7 +16,7 @@
serialize: function () {
var query = '';
- _.each(this.attributes, function (v, k) {
+ _.each(this.get('state'), function (v, k) {
query += k + v;
});
|
676117cba78bb0269ce1b8d46d760fe779e2b09e | migrations/20170329060832-rename_allowence_to_allowance.js | migrations/20170329060832-rename_allowence_to_allowance.js | 'use strict';
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.renameColumn('Departments', 'allowence', 'allowance');
},
down: function (queryInterface, Sequelize) {
return queryInterface.renameColumn('Departments', 'allowance', 'allowence');
}
};
| 'use strict';
var models = require('../lib/model/db');
module.exports = {
up: function (queryInterface, Sequelize) {
if ('sqlite' === queryInterface.sequelize.getDialect()) {
console.log('Going into SQLIite case');
return queryInterface
// Create Temp Departments based on current model de... | Add SQLite specific logic for recent migration. | Add SQLite specific logic for recent migration.
It appeared that out of box renameColumn looses some meta inforamtion
for subject column.
| JavaScript | mit | YulioTech/timeoff,YulioTech/timeoff,timeoff-management/application,timeoff-management/application | ---
+++
@@ -1,8 +1,55 @@
'use strict';
+
+var models = require('../lib/model/db');
module.exports = {
up: function (queryInterface, Sequelize) {
- return queryInterface.renameColumn('Departments', 'allowence', 'allowance');
+
+ if ('sqlite' === queryInterface.sequelize.getDialect()) {
+
+ console.lo... |
45d0b315423946df17853708bf0d48005b92544b | webroot/js/responsive/app.module.js | webroot/js/responsive/app.module.js | (function() {
'use strict';
angular
.module('app', ['ngMaterial', 'ngMessages', 'ngCookies', 'ngSanitize'])
.config(['$mdThemingProvider', '$mdIconProvider', '$httpProvider', function($mdThemingProvider, $mdIconProvider, $httpProvider) {
$mdThemingProvider.theme('default')
... | (function() {
'use strict';
angular
.module('app', ['ngMaterial', 'ngMessages', 'ngCookies', 'ngSanitize'])
.config(['$mdThemingProvider', '$mdIconProvider', '$httpProvider', '$cookiesProvider', function(
$mdThemingProvider, $mdIconProvider, $httpProvider, $cookiesProvider
)... | Set global path and +1 month expiration date in angular cookies | Set global path and +1 month expiration date in angular cookies
| JavaScript | agpl-3.0 | Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2 | ---
+++
@@ -3,7 +3,9 @@
angular
.module('app', ['ngMaterial', 'ngMessages', 'ngCookies', 'ngSanitize'])
- .config(['$mdThemingProvider', '$mdIconProvider', '$httpProvider', function($mdThemingProvider, $mdIconProvider, $httpProvider) {
+ .config(['$mdThemingProvider', '$mdIconProvider', ... |
5bf9c027fa2896d8cb41750904a2631c3391b508 | example/backend/passport.js | example/backend/passport.js | 'use strict';
var passport = require('passport'),
BitbucketTokenStrategy = require('../../lib/index'),
User = require('mongoose').model('User');
module.exports = function () {
passport.use(new BitbucketTokenStrategy({
clientID: 'app-id',
clientSecret: 'client-secret'
apiVersion: '1.0',
... | 'use strict';
var passport = require('passport'),
BitbucketTokenStrategy = require('../../lib/index'),
User = require('mongoose').model('User');
module.exports = function () {
passport.use(new BitbucketTokenStrategy({
clientID: 'app-id',
clientSecret: 'client-secret',
apiVersion: '1.0',
... | Fix type in backend example | Fix type in backend example
| JavaScript | mit | GenFirst/passport-bitbucket-token | ---
+++
@@ -8,7 +8,7 @@
passport.use(new BitbucketTokenStrategy({
clientID: 'app-id',
- clientSecret: 'client-secret'
+ clientSecret: 'client-secret',
apiVersion: '1.0',
profileWithEmail: true
}, |
6ca34a9c9c51ea5bc8d4abd99a78952834e04385 | examples/Basic/index.ios.js | examples/Basic/index.ios.js | import React from 'react-native';
const {
AppRegistry,
Component,
Text,
View
} = React;
import NavigationBar from 'react-native-navbar';
class Basic extends Component {
render() {
return (
<View style={{ flex: 1, backgroundColor: '#ff9900' }}>
<NavigationBar
title={{ title: 'Title... | import React from 'react-native';
const {
AppRegistry,
Component,
Text,
View
} = React;
import NavigationBar from 'react-native-navbar/ios';
class Basic extends Component {
render() {
return (
<View style={{ flex: 1, backgroundColor: '#ff9900' }}>
<NavigationBar
title={{ title: 'T... | Use iOS version of nabar | Use iOS version of nabar
| JavaScript | mit | Kureev/react-native-navbar,react-native-fellowship/react-native-navbar | ---
+++
@@ -5,7 +5,7 @@
Text,
View
} = React;
-import NavigationBar from 'react-native-navbar';
+import NavigationBar from 'react-native-navbar/ios';
class Basic extends Component {
render() { |
08c8816c5a5267257cbd72b1ab292adcd219373e | backend/server/db/model/files.js | backend/server/db/model/files.js | /**
* @fileOverview
* @name files.js
* @author V. Glenn Tarcea <glenn.tarcea@gmail.com>
* @license
*/
module.exports = function(r) {
'use strict';
return {
countInProject: countInProject
};
function *countInProject(ids, projectID) {
let rql = r.table('datafiles').getAll.apply(this... | /**
* @fileOverview
* @name files.js
* @author V. Glenn Tarcea <glenn.tarcea@gmail.com>
* @license
*/
module.exports = function(r) {
'use strict';
return {
countInProject: countInProject
};
function *countInProject(ids, projectID) {
let rql = r.table('datafiles').getAll(r.args(ids... | Update how we call getAll to properly parse out an array of keys using r.args() rather than doing getAll.apply(this, items) (which doesn't work). | Update how we call getAll to properly parse out an array of keys using
r.args() rather than doing getAll.apply(this, items) (which doesn't work).
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | ---
+++
@@ -12,7 +12,7 @@
};
function *countInProject(ids, projectID) {
- let rql = r.table('datafiles').getAll.apply(this, ids);
+ let rql = r.table('datafiles').getAll(r.args(ids));
let count = yield rql.filter({project_id: projectID}).count();
return count;
} |
2d40e0c1366e403ab50be6c9aaa603a67825a4c8 | packages/ember-data/lib/transforms/base.js | packages/ember-data/lib/transforms/base.js | /**
The `DS.Transform` class is used to serialize and deserialize model
attributes when they are saved or loaded from an
adapter. Subclassing `DS.Transform` is useful for creating custom
attributes. All subclasses of `DS.Transform` must implement a
`serialize` and a `deserialize` method.
Example
```java... | /**
The `DS.Transform` class is used to serialize and deserialize model
attributes when they are saved or loaded from an
adapter. Subclassing `DS.Transform` is useful for creating custom
attributes. All subclasses of `DS.Transform` must implement a
`serialize` and a `deserialize` method.
Example
```java... | Add a better transform example | Add a better transform example
| JavaScript | mit | fsmanuel/data,wecc/data,lostinpatterns/data,pdud/data,hibariya/data,ryanpatrickcook/data,sammcgrail/data,eriktrom/data,swarmbox/data,duggiefresh/data,mphasize/data,bf4/data,rtablada/data,PrecisionNutrition/data,bf4/data,davidpett/data,martndemus/data,rtablada/data,swarmbox/data,heathharrelson/data,fpauser/data,funtusov... | ---
+++
@@ -8,12 +8,13 @@
Example
```javascript
- App.RawTransform = DS.Transform.extend({
+ // Converts centigrade in the JSON to fahrenheit in the app
+ App.TemperatureTransform = DS.Transform.extend({
deserialize: function(serialized) {
- return serialized;
+ return (serialized * 1.8) + ... |
784943c1278e479382c7f26f1f65aa53bb28517d | test/config.js | test/config.js | module.exports = {
appKey : 'mgb7ka1nbs3wg',
appSecret : 'm1Rv2MHHND',
token : {
userId : '0001',
name : 'TestUser',
portraitUri : 'http://rongcloud.cn/images/logo.png'
},
message : {
fromUserId : '546eb521c613156d331e91bb',
toUserId : '5460603c1002a6e311f89e7f',
textMsg : 'Hello, world!'
}... | module.exports = {
appKey : 'mgb7ka1nbs3wg',
appSecret : 'm1Rv2MHHND',
token : {
userId : '0001',
name : 'TestUser',
portraitUri : 'http://rongcloud.cn/images/logo.png'
},
message : {
fromUserId : '546eb521c613156d331e91bb',
toUserId : '5460603c1002a6e311f89e7f',
textMsg : 'Hello, world!'
}... | Add more chat room infos. | Add more chat room infos.
| JavaScript | mit | rongcloud/server-sdk-nodejs,coocon/server-sdk-nodejs | ---
+++
@@ -14,5 +14,8 @@
group : {
userId : '5460603c1002a6e311f89e7f',
groupIdNamePairs : { 'ProgrammerGroup1' : '程序猿交流群1', 'DriverGroup1' : '赛车手爱好者2群' }
+ },
+ chatroom : {
+ chatroomIdNamePairs : { 'EatingFans' : '吃货大本营', 'ProCylcing' : '骑行专家', 'DriodGeek' : '手机极客', 'HackerHome' : '黑客之家' }
}
} |
443be4271f06692f65b00054c2ec725b02fc6b0b | client/app/components/todos-list/component.js | client/app/components/todos-list/component.js | import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'ul',
channel: Ember.inject.service(),
});
| import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'ul',
channel: Ember.inject.service(),
didInsertElement: function(){
var socket = this.get('channel').socket();
socket.connect();
var chan = socket.chan("todos:list", {});
chan.join().receive("ok", chan => {
consol... | Connect to our channel:topic as really basic test. | Connect to our channel:topic as really basic test.
| JavaScript | mit | cincinnati-elixir/todos_phoenix_ember_example,cincinnati-elixir/todos_phoenix_ember_example,cincinnati-elixir/todos_phoenix_ember_example | ---
+++
@@ -3,4 +3,13 @@
export default Ember.Component.extend({
tagName: 'ul',
channel: Ember.inject.service(),
+
+ didInsertElement: function(){
+ var socket = this.get('channel').socket();
+ socket.connect();
+ var chan = socket.chan("todos:list", {});
+ chan.join().receive("ok", chan => {
+ ... |
35a09e0e9d366e06a3eacea63b5aefe6b18c6cf4 | sample/testParser.js | sample/testParser.js | const AnnotationParser = require(__dirname+"/../").AnnotationParser;
const Request = require(__dirname+"/myannotations/Request");
AnnotationParser.parse(
__dirname+"/annotatedFile.js",
__dirname+"/myannotations/",
(err, annotatedElements) => {
if (err) {
console.log(err);
} else... | const AnnotationParser = require(__dirname+"/../").AnnotationParser;
const Request = require(__dirname+"/myannotations/Request");
try {
let annotatedElements = AnnotationParser.parse(__dirname+"/annotatedFile.js", __dirname+"/myannotations/");
for (let i in annotatedElements) {
if (typeof annotatedEle... | Update to support Synchronous Parsing | Update to support Synchronous Parsing
| JavaScript | mit | anupam-git/nodeannotations | ---
+++
@@ -1,26 +1,23 @@
const AnnotationParser = require(__dirname+"/../").AnnotationParser;
const Request = require(__dirname+"/myannotations/Request");
-AnnotationParser.parse(
- __dirname+"/annotatedFile.js",
- __dirname+"/myannotations/",
- (err, annotatedElements) => {
- if (err) {
- ... |
9652df246c011d31aa3b6d68ea5155d2d846dabc | src/db/user-queries.js | src/db/user-queries.js | const db = require('./db')
const pgp = require('pg-promise')()
const userQueries = {
createUser: (name, email, password) => {
return db.one(`
INSERT INTO users (name, email, password)
VALUES ($1, $2, $3)
RETURNING id`,
[name, email, password])
.then(pgp.end())
.catch((error) => {
... | const db = require('./db')
const pgp = require('pg-promise')()
// NOTE: remove pgp.end and .catch once they are handled elsewhere
const userQueries = {
createUser: (name, email, password) => {
return db.(`
INSERT INTO users (name, email, password)
VALUES ($1, $2, $3)
RETURNING id`,
[name,... | Add note for refactoring once other parts are built | Add note for refactoring once other parts are built
| JavaScript | mit | EmmaEm/Roam,EmmaEm/Roam | ---
+++
@@ -1,9 +1,10 @@
const db = require('./db')
const pgp = require('pg-promise')()
+// NOTE: remove pgp.end and .catch once they are handled elsewhere
const userQueries = {
createUser: (name, email, password) => {
- return db.one(`
+ return db.(`
INSERT INTO users (name, email, password)
... |
d4421c2a43112c2c1a702ddfd6ce9219967744c7 | tests/index.js | tests/index.js | var Jasmine = require("jasmine");
var jasmine = new Jasmine();
var config = {
spec_dir: "",
spec_files: ["tests/**/*.js", "app/**/tests/index.js", "app/**/tests.js"],
helpers: [],
stopSpecOnExpectationFailure: false,
random: false
};
// Pass in a custom test glob for running only specific tests
if (process.e... | var Jasmine = require("jasmine");
var jasmine = new Jasmine();
var config = {
spec_dir: "",
spec_files: ["tests/**/*.js", "app/**/tests/index.js", "app/**/tests.js"],
helpers: [],
stopSpecOnExpectationFailure: true,
random: false
};
// Pass in a custom test glob for running only specific tests
if (process.en... | Stop testing spec on failure | Stop testing spec on failure
| JavaScript | cc0-1.0 | davidmerfield/Blot,davidmerfield/Blot,davidmerfield/Blot,davidmerfield/Blot | ---
+++
@@ -4,7 +4,7 @@
spec_dir: "",
spec_files: ["tests/**/*.js", "app/**/tests/index.js", "app/**/tests.js"],
helpers: [],
- stopSpecOnExpectationFailure: false,
+ stopSpecOnExpectationFailure: true,
random: false
};
|
45fcea40fe53c784145d015d30f0846926cf01f9 | src/client/es6/controller/cart-blog-list.js | src/client/es6/controller/cart-blog-list.js | import CartBase from './base/cart-base.js';
class CartBlogListCtrl extends CartBase {
constructor($scope, ...args) {
super(...args);
this.logInit('CartBlogListCtrl');
this.$scope = $scope;
this.postList = [];
this.init();
}
init() {
if (!this.apiService.isDataInitialized()) {
/... | import CartBase from './base/cart-base.js';
class CartBlogListCtrl extends CartBase {
constructor($scope, $timeout, ...args) {
super(...args);
this.logInit('CartBlogListCtrl');
this.$scope = $scope;
this.$timeout = $timeout;
this.postList = [];
this.init();
}
init() {
if (!this.a... | Use $timeout to make $apply functions go to the next digest, to prevent "$digest already in progress". | Use $timeout to make $apply functions go to the next digest, to prevent "$digest already in progress".
| JavaScript | mit | agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart | ---
+++
@@ -1,11 +1,12 @@
import CartBase from './base/cart-base.js';
class CartBlogListCtrl extends CartBase {
- constructor($scope, ...args) {
+ constructor($scope, $timeout, ...args) {
super(...args);
this.logInit('CartBlogListCtrl');
this.$scope = $scope;
+ this.$timeout = $timeout;
... |
8cb0444c4ebd9d4ea42d92942eb02899c14e011b | src/components/providers/cdg/Prefs/Prefs.js | src/components/providers/cdg/Prefs/Prefs.js | import React from 'react'
export default class Prefs extends React.Component {
static propTypes = {
prefs: React.PropTypes.object.isRequired,
setPrefs: React.PropTypes.func.isRequired,
providerRefresh: React.PropTypes.func.isRequired,
}
toggleEnabled = this.toggleEnabled.bind(this)
handleRefresh =... | import React from 'react'
export default class Prefs extends React.Component {
static propTypes = {
prefs: React.PropTypes.object.isRequired,
setPrefs: React.PropTypes.func.isRequired,
providerRefresh: React.PropTypes.func.isRequired,
}
setEnabled = this.setEnabled.bind(this)
handleRefresh = this.... | FIx warning and remove use of preventDefault on checkbox | FIx warning and remove use of preventDefault on checkbox
| JavaScript | isc | bhj/karaoke-forever,bhj/karaoke-forever | ---
+++
@@ -7,13 +7,12 @@
providerRefresh: React.PropTypes.func.isRequired,
}
- toggleEnabled = this.toggleEnabled.bind(this)
+ setEnabled = this.setEnabled.bind(this)
handleRefresh = this.handleRefresh.bind(this)
- toggleEnabled(e) {
- e.preventDefault()
+ setEnabled(e) {
let prefs = Objec... |
dade414e6dad3bae1f358f6132f30858a6958c8e | src/githubpusher/frontend/static/install.js | src/githubpusher/frontend/static/install.js |
function register() {
navigator.serviceWorker.register("sw.js", {scope: '/'}).then(
function(serviceWorkerRegistration) {
serviceWorkerRegistration.pushManager.subscribe().then(
function(pushSubscription) {
console.log(pushSubscription.endpoint);
var data = new FormData();
... |
function register() {
navigator.serviceWorker.register("sw.js", {scope: '/'});
navigator.serviceWorker.ready.then(
function(swr) {
swr.pushManager.subscribe().then(
function(pushSubscription) {
var data = new FormData();
data.append('endpoint', pushSubscription.endpoint);
... | Use serviceWorker.ready.then before calling subscribe | Use serviceWorker.ready.then before calling subscribe
| JavaScript | apache-2.0 | dougt/githubwebpush,dougt/githubwebpush,dougt/githubwebpush | ---
+++
@@ -1,22 +1,25 @@
function register() {
- navigator.serviceWorker.register("sw.js", {scope: '/'}).then(
- function(serviceWorkerRegistration) {
- serviceWorkerRegistration.pushManager.subscribe().then(
+ navigator.serviceWorker.register("sw.js", {scope: '/'});
+
+ navigator.serviceWorker.ready.t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.