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 |
|---|---|---|---|---|---|---|---|---|---|---|
727239815c501fb0e13dc11cb3435b8dd9fcdad4 | webpack.config.js | webpack.config.js | "use strict";
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: "./js/main.js",
devtool: "source-map",
output: {
path: path.join(__dirname, "build"),
filename: "bundle.js"
},
resolve: {
alias: {
"devtools": "ff-devtool... | "use strict";
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
let environment;
try {
environment = require("./environment");
} catch (e) {
environment = {};
}
let config = {
entry: "./js/main.js",
devtool: "source-map",
output: {
path: path.join(__dirname... | Fix chrome param destructuring bug | Fix chrome param destructuring bug
| JavaScript | mpl-2.0 | rrandom/debugger.html,bomsy/debugger.html,helenvholmes/debugger.html,bomsy/debugger.html,wldcordeiro/debugger.html,kdzwinel/debugger.html,tommai78101/debugger.html,bomsy/debugger.html,darkwing/debugger.html,darkwing/debugger.html,amitzur/debugger.html,ruturajv/debugger.html,borian/debugger.html,jbhoosreddy/debugger.htm... | ---
+++
@@ -3,7 +3,14 @@
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
-module.exports = {
+let environment;
+try {
+ environment = require("./environment");
+} catch (e) {
+ environment = {};
+}
+
+let config = {
entry: "./js/main.js",
devtool: "source-ma... |
62069a4d22832d7b53e24b1fb2b920898428b6b3 | lib/command_push.js | lib/command_push.js | 'use strict';
var async = require('grunt').util.async;
var grunt = require('grunt');
var ArgUtil = require('flopmang');
module.exports = function (task, exec, done) {
var argUtil = new ArgUtil(task, [
{
option: 'all',
defaultValue: false,
useAsFlag: true,
us... | 'use strict';
var async = require('grunt').util.async;
var grunt = require('grunt');
var ArgUtil = require('flopmang');
module.exports = function (task, exec, done) {
var argUtil = new ArgUtil(task, [
{
option: 'all',
defaultValue: false,
useAsFlag: true,
us... | Add support for git push --no-verify | Add support for git push --no-verify
| JavaScript | mit | rubenv/grunt-git | ---
+++
@@ -32,6 +32,12 @@
useValue: false
},
{
+ option: 'noVerify',
+ defaultValue: false,
+ useAsFlag: true,
+ useValue: false
+ },
+ {
option: 'remote',
defaultValue: 'origin',
useAsFlag... |
a15560670541d1837e3d94b28749c10d9193aba4 | examples/peep-peep/js/peep-peep.js | examples/peep-peep/js/peep-peep.js | 'use strict';
$('#message').keyup(function(e) {
if ((e.keyCode || e.which) == 13) {
if (!e.srcElement.value) return;
// enter was pressed
$state.at('chat').push({
from: $('#username').val(),
message: e.srcElement.value
});
$(e.srcElement).val(null);
... | 'use strict';
$('#message').keyup(function(e) {
if ((e.keyCode || e.which) == 13) {
if (!e.srcElement.value) return;
// enter was pressed
$state.at('chat').push({
from: $('#username').val(),
message: e.srcElement.value
});
$(e.srcElement).val(null);
}
})
function addPost(m) {
va... | Standardize indent to 2 characters rather than beautify-js's standard 4. | Standardize indent to 2 characters rather than beautify-js's standard 4.
| JavaScript | mit | kustomzone/ShareJS,Nzaga/ShareJS,share/ShareJS,modulexcite/ShareJS,gdseller/ShareJS,dialoghq/ShareJS,dialoghq/ShareJS,dialoghq/ShareJS,rasata/ShareJS,rchrd2/ShareJS,playcanvas/ShareJS,igmcdowell/ShareJS,gdseller/ShareJS,mcanthony/ShareJS,igmcdowell/ShareJS,luto/ShareJS,kantele/k-share,matthewbauer/ShareJS,freewind/Shar... | ---
+++
@@ -1,49 +1,49 @@
'use strict';
$('#message').keyup(function(e) {
- if ((e.keyCode || e.which) == 13) {
- if (!e.srcElement.value) return;
- // enter was pressed
- $state.at('chat').push({
- from: $('#username').val(),
- message: e.srcElement.value
- })... |
0b2c154372847a072b3bffe68b8c575145d623f0 | version/gen.js | version/gen.js | 'use strict';
const fs = require('fs');
const path = require('path');
module.exports = function generate(overrides) {
const branchPath = path.join(__dirname, 'branch');
const branchContent = fs.readFileSync(branchPath, 'utf8').trim();
const branch = branchContent.match(/BRANCH=(.*)/)[1];
const buildtime = Dat... | 'use strict';
const fs = require('fs');
const path = require('path');
module.exports = function generate(overrides) {
const branchPath = path.join(__dirname, 'branch');
const branchContent = fs.readFileSync(branchPath, 'utf8').trim();
const branch = branchContent.match(/BRANCH=(.*)/)[1];
const buildtime = Dat... | Use non-empty value for sha | Use non-empty value for sha
| JavaScript | mit | silklabs/silk,silklabs/silk,silklabs/silk,silklabs/silk,silklabs/silk,silklabs/silk | ---
+++
@@ -15,7 +15,7 @@
buildtime,
official: false,
semver,
- sha: '',
+ sha: 'HEAD',
}, overrides);
let string = version.branch + ' ' + version.semver; |
818c6e9613f39b12452936a5879c08cbe4889bf1 | js/agent.js | js/agent.js | (function() {
// wait for polyfill to be loaded
if (document.readyState == "complete") {
init();
} else {
window.addEventListener('load', init);
}
var loggedIn = false;
function init() {
if (!navigator.id)
return;
sendToContent({ type: "init" });
window.addEventListener('browser... | (function() {
// wait for polyfill to be loaded
if (document.readyState == "complete") {
init();
} else {
window.addEventListener('load', init);
}
var loggedIn = false;
function init() {
// just quit if no navigator observer API available
if (!navigator.id || !navigator.id.watch)
ret... | Check for navigator.id.watch when initializing | Check for navigator.id.watch when initializing
| JavaScript | mit | sickill/chrome-browserid | ---
+++
@@ -9,7 +9,8 @@
var loggedIn = false;
function init() {
- if (!navigator.id)
+ // just quit if no navigator observer API available
+ if (!navigator.id || !navigator.id.watch)
return;
sendToContent({ type: "init" }); |
a3f2cc9bcfe2bb04d60c7b94a1f1e9799d8f3d05 | test/rules/enum_values_sorted_alphabetically.js | test/rules/enum_values_sorted_alphabetically.js | import assert from 'assert';
import { parse } from 'graphql';
import { validate } from 'graphql/validation';
import { buildASTSchema } from 'graphql/utilities/buildASTSchema';
import { EnumValuesSortedAlphabetically } from '../../src/rules/enum_values_sorted_alphabetically';
describe('EnumValuesSortedAlphabetically r... | import { EnumValuesSortedAlphabetically } from '../../src/rules/enum_values_sorted_alphabetically';
import { expectFailsRule, expectPassesRule } from '../assertions';
describe('EnumValuesSortedAlphabetically rule', () => {
it('catches enums that are not sorted alphabetically', () => {
expectFailsRule(
Enum... | Use test helpers in EnumValuesSortedAlphabetically tests | Use test helpers in EnumValuesSortedAlphabetically tests
| JavaScript | mit | cjoudrey/graphql-schema-linter | ---
+++
@@ -1,57 +1,42 @@
-import assert from 'assert';
-import { parse } from 'graphql';
-import { validate } from 'graphql/validation';
-import { buildASTSchema } from 'graphql/utilities/buildASTSchema';
-
import { EnumValuesSortedAlphabetically } from '../../src/rules/enum_values_sorted_alphabetically';
+import {... |
c7b9dad1e635a60ce0d866c7de295a55df050001 | lib/range-finder.js | lib/range-finder.js | const {Range} = require('atom')
module.exports =
class RangeFinder {
// Public
static rangesFor (editor) {
return new RangeFinder(editor).ranges()
}
// Public
constructor (editor) {
this.editor = editor
}
// Public
ranges () {
const selectionRanges = this.selectionRanges()
if (selecti... | const {Range} = require('atom')
module.exports =
class RangeFinder {
// Public
static rangesFor (editor) {
return new RangeFinder(editor).ranges()
}
// Public
constructor (editor) {
this.editor = editor
}
// Public
ranges () {
const selectionRanges = this.selectionRanges()
if (selecti... | Move function outside of class | :art: Move function outside of class
Since the endRowForSelectionRange method doesn't use any of the class's
internal state, make it a function that lives outside the class.
| JavaScript | mit | atom/sort-lines,garethbjohnson/sort-css | ---
+++
@@ -38,21 +38,20 @@
sortableRangeFrom (selectionRange) {
const startRow = selectionRange.start.row
const startCol = 0
- const endRow = this.endRowForSelectionRange(selectionRange)
+ const endRow = endRowForSelectionRange(selectionRange)
const endCol = this.editor.lineTextForBufferRow(e... |
2d1227344a8452a64277290330e838220b5a2995 | js/basic.js | js/basic.js |
function sendRequest(action, data, callback) {
$.ajax({
type: 'post',
url: 'foler.php?action='+action,
data: data,
error: function() {
alert('Connection lost');
},
success: function(response) {
if(callback !=... |
function sendRequest(action, data, callback) {
$.ajax({
type: 'post',
url: 'foler.php?action='+action,
data: data,
error: function() {
alert('Connection lost');
},
success: function(response) {
if(callback !=... | Fix response var for callback after ajax | Fix response var for callback after ajax
| JavaScript | mit | serkin/foler,serkin/foler,serkin/foler | ---
+++
@@ -12,7 +12,7 @@
},
success: function(response) {
if(callback !== "undefined"){
- callback(response.response);
+ callback(response);
}
}
}); |
35ff337b8c6d97f8386ab020a28ae906688f2c40 | lib/tumblr/theme.js | lib/tumblr/theme.js | var Request = require('./request')
, Browser = require('./browser');
var Theme = function (session, blog, html) {
this.session = session;
this.blog = blog;
this.html = html;
}
Theme.prototype = {
save: function () {
return this.session.create()
.with(this)
.then(this.get_customize_form)
... | var Request = require('./request')
, Browser = require('./browser');
var Theme = function (session, blog, html) {
this.session = session;
this.blog = blog;
this.html = html;
}
Theme.prototype = {
save: function () {
return this.session.create()
.with(this)
.then(this.get_customize_form)
... | Repair check for correct status code on deploy. | Repair check for correct status code on deploy.
| JavaScript | mit | nporteschaikin/peak | ---
+++
@@ -39,11 +39,11 @@
},
handle_response: function (response) {
- if (response.code !== 200) {
+ if (response.statusCode !== 200) {
throw new Error('There was an error deploying your theme. '
+ 'Please try again later.');
}
-
+
return response;
}
|
7d0d2bda421730ed3512f839c5bb8dae6c7893b5 | src/languages/applescript.js | src/languages/applescript.js | /*
Language: AppleScript
*/
function(hljs) {
return {
defaultMode: {
keywords: {
keyword:
'about above after against and around as at back before beginning ' +
'behind below beneath beside between but by considering contain ' +
'contain contains continue copy div does ... | /*
Language: AppleScript
Authors: Nathan Grigg <nathan@nathanamy.org>
Dr. Drang <drdrang@gmail.com>
*/
function(hljs) {
var STRINGS = [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
];
var TITLE = {
className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
};
var PARAMS = {
className: 'par... | Add strings and function definitions, attributions. | Add strings and function definitions, attributions.
| JavaScript | bsd-3-clause | iominh/highlight.js,yxxme/highlight.js,adjohnson916/highlight.js,1st1/highlight.js,christoffer/highlight.js,Sannis/highlight.js,axter/highlight.js,iOctocat/highlight.js,J2TeaM/highlight.js,CausalityLtd/highlight.js,daimor/highlight.js,alex-zhang/highlight.js,STRML/highlight.js,axter/highlight.js,bogachev-pa/highlight.j... | ---
+++
@@ -1,8 +1,23 @@
/*
Language: AppleScript
+Authors: Nathan Grigg <nathan@nathanamy.org>
+ Dr. Drang <drdrang@gmail.com>
*/
function(hljs) {
+ var STRINGS = [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE
+ ];
+ var TITLE = {
+ className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
+... |
939753530b37807f8106c66da9b958c8db65b648 | lib/exec.js | lib/exec.js | const { exec } = require('child_process');
function run(fullCmd) {
return new Promise((resolve, reject) => {
console.log(`Executing command: ${ fullCmd }`);
exec(fullCmd, (error, stdout, stderr) => { // eslint-disable-line no-unused-vars
if (stderr || error) {
reject(stderr || error);
}
... | const { exec } = require('child_process');
function run(fullCmd) {
return new Promise((resolve, reject) => {
console.log(`Executing command: ${ fullCmd }`);
exec(fullCmd, (error, stdout, stderr) => { // eslint-disable-line no-unused-vars
if (stderr || error) {
reject(stderr || error);
}
... | Add validation to params object | Add validation to params object
| JavaScript | mit | stetsmando/pi-camera | ---
+++
@@ -13,6 +13,10 @@
}
function cmd(base, params) {
+ if (params.constructor !== Array) {
+ throw new Error('params must be an Array');
+ }
+
return base + ' ' + params.join(' ');
}
|
334c908b5f29617b24df14c9c1c11b76a2648d5a | src/electron/Settings.js | src/electron/Settings.js | import { observable, toJS } from 'mobx';
import { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra';
import { SETTINGS_PATH, DEFAULT_APP_SETTINGS } from '../config';
const debug = require('debug')('Settings');
export default class Settings {
@observable store = DEFAULT_APP_SETTINGS;
constructor() {... | import { observable, toJS } from 'mobx';
import { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra';
import { SETTINGS_PATH, DEFAULT_APP_SETTINGS } from '../config';
const debug = require('debug')('Settings');
export default class Settings {
@observable store = DEFAULT_APP_SETTINGS;
constructor() {... | Fix issue when hydrating settings with missing default keys | Fix issue when hydrating settings with missing default keys
| JavaScript | apache-2.0 | meetfranz/franz,GustavoKatel/franz,meetfranz/franz,GustavoKatel/franz,meetfranz/franz | ---
+++
@@ -17,7 +17,7 @@
}
set(settings) {
- this.store = Object.assign(this.store, settings);
+ this.store = this._merge(this.store, settings);
this._writeFile();
}
@@ -30,8 +30,12 @@
return this.store[key];
}
+ _merge(settings) {
+ return Object.assign(DEFAULT_APP_SETTINGS, se... |
073dafd5af2af77e303981066b2e1339b5358948 | core/ModelDAO.js | core/ModelDAO.js | /**
* @license
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | /**
* @license
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | Fix acalc not running when not build. | Fix acalc not running when not build.
| JavaScript | apache-2.0 | mdittmer/foam,osric-the-knight/foam,jacksonic/foam,foam-framework/foam,osric-the-knight/foam,osric-the-knight/foam,jlhughes/foam,foam-framework/foam,foam-framework/foam,jacksonic/foam,foam-framework/foam,jlhughes/foam,mdittmer/foam,mdittmer/foam,foam-framework/foam,jlhughes/foam,jlhughes/foam,mdittmer/foam,jacksonic/fo... | ---
+++
@@ -27,7 +27,10 @@
json.model_ = 'Model';
if ( document && document.currentScript )
json.sourcePath = document.currentScript.src;
- document.currentScript.callback(json, oldClass);
+ if ( document.currentScript.callback )
+ document.currentScript.callback(json, oldClass);
+ else... |
1190e7bd1dcbe1c943aa7ea3c7617291acc07f71 | lib/create-store.js | lib/create-store.js | 'use strict'
var assign = require('object-assign')
var EventEmitter = require('eventemitter3')
var objEql = require('obj-eql')
function createStore(obj) {
return assign(Object.create(EventEmitter.prototype), {
state: {},
setState: function(change) {
this.replaceState(assign({}, this.state, change))
... | 'use strict'
var assign = require('object-assign')
var EventEmitter = require('eventemitter3')
var objEql = require('obj-eql')
function createStore(obj) {
return assign(Object.create(EventEmitter.prototype), {
state: {},
setState: function(change) {
this.replaceState(assign({}, this.state, change))
... | Add a circular reference from the store state back to the store. | Add a circular reference from the store state back to the store.
Useful if store state is used as a prop, allows access back to store methods
| JavaScript | mit | uniflow/uniflow | ---
+++
@@ -12,6 +12,7 @@
},
replaceState: function(newState) {
if (!objEql(newState, this.state)) {
+ newState.store = this
this.state = newState
this.emit('change')
} |
a489e41da4a5efe8e6770bdaaa4f5bcc66d94bfd | www/MBTilesPlugin.js | www/MBTilesPlugin.js | var MBTilesPlugin = function()
{
};
MBTilesPlugin.prototype.open = function(params, onSuccess, onError)
{
return cordova.exec(onSuccess, onError, "MBTilesPlugin", "open", [params]);
};
MBTilesPlugin.prototype.getMetadata = function(onSuccess, onError)
{
return cordova.exec(onSuccess, onError, "MBTilesPlugin", "get_... | var MBTilesPlugin = function()
{
};
MBTilesPlugin.prototype.open = function(params, onSuccess, onError)
{
return cordova.exec(onSuccess, onError, "MBTilesPlugin", "open", [params]);
};
MBTilesPlugin.prototype.getMetadata = function(onSuccess, onError)
{
return cordova.exec(onSuccess, onError, "MBTilesPlugin", "get_... | Add new function js execute_statment | Add new function js execute_statment
| JavaScript | apache-2.0 | andreacimino/cordova-plugin-mbtiles,ffournier/cordova-plugin-mbtiles,andreacimino/cordova-plugin-mbtiles,ffournier/cordova-plugin-mbtiles,andreacimino/cordova-plugin-mbtiles,ffournier/cordova-plugin-mbtiles,andreacimino/cordova-plugin-mbtiles,ffournier/cordova-plugin-mbtiles,ffournier/cordova-plugin-mbtiles,andreacimin... | ---
+++
@@ -26,5 +26,10 @@
{
return cordova.exec(onSuccess, onError, "MBTilesPlugin", "get_tile", [params]);
};
+
+MBTilesPlugin.prototype.getTile = function(params, onSuccess, onError)
+{
+ return cordova.exec(onSuccess, onError, "MBTilesPlugin", "execute_statment", [params]);
+};
module.exports = MBTilesPlu... |
ec59c2f8017985005c1d36e1d857276a231ea220 | lib/methods/save.js | lib/methods/save.js | const getModel = require( './model.js' );
module.exports = function ( modelName, item, cb ) {
return new Promise( ( resolve ) => {
getModel( modelName )
.then( ( model, b ) => {
if ( ! item.id && item.id !== 0 )
return resolve( model.create( item, cb ) );
... | const getModel = require( './model.js' );
module.exports = function ( modelName, item, cb ) {
if (cb === undefined) cb = ()=>{};
return new Promise( ( resolve ) => {
getModel( modelName )
.then( ( model, b ) => {
if ( ! item.id && item.id !== 0 )
retu... | Add dummy cb when none given | Add dummy cb when none given
| JavaScript | mit | Appliary/Poetry | ---
+++
@@ -1,6 +1,8 @@
const getModel = require( './model.js' );
module.exports = function ( modelName, item, cb ) {
+
+ if (cb === undefined) cb = ()=>{};
return new Promise( ( resolve ) => {
|
02fc833bded2184b57625150307bd7740f5b4f61 | Lesson9/http/js/app.js | Lesson9/http/js/app.js | angular.module('app', []).controller('AppCtrl', function ($scope, $http) {
$scope.results = [];
$scope.loadUsers = function() {
$http.get('/elements')
.success(function(data) {
$scope.results = data;
})
.error(function(err) {
$scope.results = err;
});
}
$scope.clickElement = function (elemen... | angular.module('app', []).controller('AppCtrl', function ($scope, $http) {
$scope.results = [];
$scope.loadUsers = function() {
$http.get('/elements')
.success(function(data) {
$scope.results = data;
})
.error(function(err) {
$scope.results = err;
});
}
$scope.clickElement = function (elemen... | Refactor put method for elements | Refactor put method for elements
| JavaScript | mit | dajvido/NAJ-homework,dajvido/NAJ-homework | ---
+++
@@ -12,9 +12,9 @@
}
$scope.clickElement = function (element) {
- var promiseElement = $http.put('/elements/' + element.id, {count: element.count + 1})
- promiseElement.success(function(elem) {
- element.count = elem.count;
- })
+ $http.put('/elements/' + element.id, {count: element.count + 1})
+ ... |
37971507cc9a5c9ad7c9bad59ecd7f2e4a7f0db1 | test/defineFields.js | test/defineFields.js | var assert = require('assert')
var ethUtil = require('../index.js')
describe('define', function () {
const fields = [{
word: true,
default: new Buffer([])
}, {
name: 'empty',
allowZero: true,
length: 20,
default: new Buffer([])
}, {
name: 'value',
default: new Buffer([])
}, {
... | var assert = require('assert')
var ethUtil = require('../index.js')
describe('define', function () {
const fields = [{
word: true,
default: new Buffer([])
}, {
name: 'empty',
allowZero: true,
length: 20,
default: new Buffer([])
}, {
name: 'cannotBeZero',
allowZero: false,
defa... | Add two more tests for defaultFields | Add two more tests for defaultFields
| JavaScript | mpl-2.0 | ethereum/ethereumjs-vm,ethereumjs/ethereumjs-util,ethereumjs/ethereumjs-util,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm | ---
+++
@@ -10,6 +10,10 @@
allowZero: true,
length: 20,
default: new Buffer([])
+ }, {
+ name: 'cannotBeZero',
+ allowZero: false,
+ default: new Buffer([ 0 ])
}, {
name: 'value',
default: new Buffer([])
@@ -30,4 +34,15 @@
someOb.r = new Buffer([0, 0, 0, 0, 4])
assert.e... |
c19d5ed608e558674f8e304c53dfac83487e7554 | src/service/generator/game_generator.test.js | src/service/generator/game_generator.test.js | import { generateGame } from "./";
import PlayerModel from "../../model/player_model";
describe(`generator:: Game`, () => {
describe(`::generate`, () => {
[0, 1, 2, 10].forEach((v) => {
it(`expected ${v} battlefields`, () => {
const model = generateGame(v, 0);
e... | import { generateGame } from "./";
import PlayerModel from "../../model/player_model";
describe(`generator:: Game`, () => {
describe(`::generate`, () => {
[0, 1, 2, 10].forEach((v) => {
it(`expected ${v} battlefields`, () => {
const model = generateGame(v, 0);
e... | Revert "rollback change after [byte_sequence -> byteSeq]" | Revert "rollback change after [byte_sequence -> byteSeq]"
| JavaScript | mit | eugene-matvejev/battleship-game-gui-react-js,eugene-matvejev/battleship-game-gui-react-js | ---
+++
@@ -18,7 +18,7 @@
model.getBattlefields().forEach((bf, index) => {
const expectedSeq = index === (v - 1) ? PlayerModel.getHumanFlag() : 0;
- expect(bf.getPlayer().byte_sequence).toBe(expectedSeq);
+ expect(bf.getPlayer().byteSeq).to... |
3507f961cd6921cbb54fa34589686074334064b1 | model/contractor.js | model/contractor.js | module.exports =
class Contractor {
constructor(firstName, lastName, isResident, privateEmail) {
this.firstName = firstName;
this.lastName = lastName;
this.isResident = isResident;
this.privateEmail = privateEmail;
}
getFullName() {
return this.firstName + ' ' + this.lastName;
}
getEma... | var crypto = require('crypto');
module.exports =
class Contractor {
constructor(firstName, lastName, isResident, privateEmail) {
this.firstName = firstName;
this.lastName = lastName;
this.isResident = isResident;
this.privateEmail = privateEmail;
}
getFullName() {
return this.firstName + '... | Add getPassword to Contractor class for hashing temp password | Add getPassword to Contractor class for hashing temp password
| JavaScript | mit | 7hci/surfboard,7hci/surfboard,7hci/surfboard | ---
+++
@@ -1,3 +1,5 @@
+var crypto = require('crypto');
+
module.exports =
class Contractor {
constructor(firstName, lastName, isResident, privateEmail) {
@@ -18,4 +20,8 @@
return sanitizedFirst + '.' + sanitizedLast + '@7hci.com';
}
+
+ getPassword() {
+ return crypto.createHash('md5').update(t... |
6a84d83b3546edfbf3b11454bdcce605bf45fb27 | server/servlets/exec-servlet.js | server/servlets/exec-servlet.js | /*******************************************************************************
* @license
* Copyright (c) 2012 VMware, Inc. All Rights Reserved.
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEP... | /*******************************************************************************
* @license
* Copyright (c) 2012 VMware, Inc. All Rights Reserved.
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEP... | Allow exec 'env' to inherit from 'process.env' | Allow exec 'env' to inherit from 'process.env'
When executing a command Node uses `process.env` by default. If the 'env'
option is specified, Node assumes that the complete environment is
provided.
As Scripted exec configurations are declarative, and it's practically
impossible to correctly configure an environment d... | JavaScript | epl-1.0 | sirspock/scripted_token,scripted-editor/scripted,scripted-editor/scripted,sirspock/scripted_token,kyawzinsoe/scripted,scripted-editor/scripted,kyawzinsoe/scripted,kyawzinsoe/scripted | ---
+++
@@ -10,7 +10,7 @@
* Contributors:
* Kris De Volder - initial API and implementation
******************************************************************************/
-
+
/*global console require*/
var servlets = require('../servlets');
@@ -26,6 +26,15 @@
var options = cmd;
cmd = cmd.cmd;
+ ... |
7ca406952744a3e80ee11f200174c477512994d0 | addon/utils/serialize-and-push.js | addon/utils/serialize-and-push.js | import { isArray } from '@ember/array';
export default function(options, response) {
let modelName = this.constructor.modelName || this.constructor.typeKey;
let modelClass = this.store.modelFor(modelName);
let serializer = this.store.serializerFor(modelName);
let normalized = isArray(response.data) ? serialize... | import { isArray } from '@ember/array';
import { _getModelClass, _getModelName, _getStoreFromRecord } from './build-url';
export default function serializeAndPush(options, response) {
const recordClass = _getModelClass(this);
const modelName = _getModelName(recordClass);
const store = _getStoreFromRecord(this)... | Use buildUrl helpers in serializer-and-push | chore: Use buildUrl helpers in serializer-and-push
| JavaScript | mit | truenorth/ember-api-actions,mike-north/ember-api-actions,truenorth/ember-api-actions,mike-north/ember-api-actions,mike-north/ember-api-actions,mike-north/ember-api-actions | ---
+++
@@ -1,10 +1,12 @@
import { isArray } from '@ember/array';
+import { _getModelClass, _getModelName, _getStoreFromRecord } from './build-url';
-export default function(options, response) {
- let modelName = this.constructor.modelName || this.constructor.typeKey;
- let modelClass = this.store.modelFor(model... |
3dd65a362a889027c208a43b69d093deeecfc3de | app/client/views/team/teamCtrl.js | app/client/views/team/teamCtrl.js | angular.module('reg')
.controller('TeamCtrl', [
'$scope',
'currentUser',
'settings',
'Utils',
'UserService',
'TEAM',
function($scope, currentUser, settings, Utils, UserService, TEAM){
// Get the current user's most recent data.
var Settings = settings.data;
$scope.regIsO... | angular.module('reg')
.controller('TeamCtrl', [
'$scope',
'currentUser',
'settings',
'Utils',
'UserService',
'TEAM',
function($scope, currentUser, settings, Utils, UserService, TEAM){
// Get the current user's most recent data.
var Settings = settings.data;
$scope.regIsO... | Update the team view when a team is joined | Update the team view when a team is joined
| JavaScript | agpl-3.0 | techx/quill,techx/quill | ---
+++
@@ -16,13 +16,17 @@
$scope.TEAM = TEAM;
- if ($scope.user.teamCode){
+ function _populateTeammates() {
UserService
.getMyTeammates()
.success(function(users){
$scope.error = null;
$scope.teammates = users;
});
+ }
+
... |
5ef3a7e995eb33eeee53b2fbb05f9e3836c52196 | app/components/spendings-meter.js | app/components/spendings-meter.js | import Ember from 'ember';
export default Ember.Component.extend({
userSettings: Ember.inject.service('user-settings'),
didReceiveAttrs () {
const currency = this.get('userSettings').currency();
this.set('currency', currency);
}
});
| import Ember from 'ember';
import moment from 'npm:moment';
export default Ember.Component.extend({
userSettings: Ember.inject.service('user-settings'),
didReceiveAttrs () {
const currency = this.get('userSettings').currency();
this.set('currency', currency);
this.set('todaysDate', moment().format('DD... | Add today`s date to spendings summary part of the page | feat: Add today`s date to spendings summary part of the page
| JavaScript | mit | pe1te3son/spendings-tracker,pe1te3son/spendings-tracker | ---
+++
@@ -1,4 +1,5 @@
import Ember from 'ember';
+import moment from 'npm:moment';
export default Ember.Component.extend({
userSettings: Ember.inject.service('user-settings'),
@@ -6,5 +7,6 @@
didReceiveAttrs () {
const currency = this.get('userSettings').currency();
this.set('currency', currency... |
812facbc2e46837896c4e6064f9d57eec358662c | webpack.config.app.js | webpack.config.app.js | /*---------------------------------------------------------------------------------------------
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const path = ... | /*---------------------------------------------------------------------------------------------
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const path = ... | Exclude docbook converter from webpack | Exclude docbook converter from webpack
| JavaScript | mit | joaompinto/asciidoctor-vscode,joaompinto/asciidoctor-vscode,joaompinto/asciidoctor-vscode | ---
+++
@@ -21,6 +21,7 @@
vscode: 'commonjs vscode', // the vscode-module is created on-the-fly and must be excluded.
'asciidoctor-opal-runtime': 'asciidoctor-opal-runtime',
'@asciidoctor/core': '@asciidoctor/core',
+ '@asciidoctor/docbook-converter': '@asciidoctor/docbook-converter',
},
res... |
dcccf28a67c44c4b864fbda6360b382a190f180f | src/components/Sidebar/index.js | src/components/Sidebar/index.js | import React from 'react';
import LazyLoad from 'react-lazyload';
import './index.scss';
const Sidebar = ({ post = false }) => (
<header className={`
intro-header
col-lg-2
col-xs-12
order-lg-1
${post === true ? 'order-md-10 order-10' : 'order-1'}
`}
>
<div className="site-heading text-... | import React from 'react';
import LazyLoad from 'react-lazyload';
import PropTypes from 'prop-types';
import './index.scss';
const Sidebar = ({ post }) => (
<header className={`intro-header col-lg-2 col-xs-12 order-lg-1 ${post === true ? 'order-md-10 order-10' : 'order-1'}`} >
<div className="site-heading text... | Fix sidebar classname multi-line problem | Fix sidebar classname multi-line problem
| JavaScript | mit | calpa/blog | ---
+++
@@ -1,17 +1,12 @@
import React from 'react';
import LazyLoad from 'react-lazyload';
+import PropTypes from 'prop-types';
+
import './index.scss';
-const Sidebar = ({ post = false }) => (
- <header className={`
- intro-header
- col-lg-2
- col-xs-12
- order-lg-1
- ${post === true ? 'order... |
a28398835f182b28f44e811a15cf25d28c7a316e | app/js/script.js | app/js/script.js | // Vanilla Javascript please
document.addEventListener('DOMContentLoaded', function (event) {
var canvas = document.querySelector('#canvas')
// Canvas size
var canvasHeight = 300
canvas.width = window.innerWidth
canvas.height = canvasHeight
// set context of the canvas 2d or webGL
var c = canvas.getCont... | // Vanilla Javascript please
document.addEventListener('DOMContentLoaded', function (event) {
var canvas = document.querySelector('#canvas')
// Canvas size
var canvasHeight = 300
canvas.width = window.innerWidth
canvas.height = canvasHeight
// set context of the canvas 2d or webGL
var c = canvas.getCont... | Create as much squares as possible within the canvas width | :skull: Create as much squares as possible within the canvas width
| JavaScript | mit | SkullMasher/skullmasher.io-canvas,SkullMasher/skullmasher.io-canvas | ---
+++
@@ -26,9 +26,16 @@
c.fillRect((spacing * 4) + (squareD * 3), 50, squareD, squareD)
c.fillStyle = rectMainColor
- for (var i = 1; i < 50; i++) {
- var x = (spacing * i) + (squareD * (i - 1))
- var y = spacing
+ // Create a line of squares
+ var i = 1
+ var x = 0
+ var y = spacing
+ while (x... |
b01940ff00cb9eec5e5e7da9caecba8940b851ec | frontend/modules/faq/js/faq.js | frontend/modules/faq/js/faq.js | /**
* Interaction for the faq module
*
* @author Annelies Van Extergem <annelies@netlash.com>
* @author Jelmer Snoeck <jelmer.snoeck@netlash.com>
* @author Thomas Deceuninck <thomas@fronto.be>
*/
jsFrontend.faq =
{
// init, something like a constructor
init: function()
{
if($('#faqFeedbackForm').length > 0) ... | /**
* Interaction for the faq module
*
* @author Annelies Van Extergem <annelies@netlash.com>
* @author Jelmer Snoeck <jelmer.snoeck@netlash.com>
* @author Thomas Deceuninck <thomas@fronto.be>
*/
jsFrontend.faq =
{
// init, something like a constructor
init: function()
{
if($('#faqFeedbackForm').length > 0) ... | Add the required-attribute when no is selected. | FAQ: Add the required-attribute when no is selected.
| JavaScript | mit | bartdc/forkcms,jacob-v-dam/forkcms,matthiasmullie/forkcms,sumocoders/forkcms,vytenizs/forkcms,jessedobbelaere/forkcms,ocpyosep78/forkcms,jonasdekeukelaere/forkcms,jeroendesloovere/forkcms,sumocoders/forkcms,Thijzer/forkcms,vytsci/forkcms,ikoene/forkcms,Katrienvh/forkcms,WouterSioen/forkcms,jonasgoderis/jonaz,jeroendesl... | ---
+++
@@ -26,8 +26,16 @@
var useful = ($('#usefulY').attr('checked') ? true : false);
// show or hide the form
- if(useful) { $('form#feedback').submit(); }
- else { $('#feedbackNoInfo').show(); }
+ if(useful)
+ {
+ $('#message').prop('required', false);
+ $('form#feedback').submit();
+ }
... |
12eca6c52d32c42276be8b7ee6d4240e44d1a35c | lib/tests/dashboards/content.js | lib/tests/dashboards/content.js |
var Mocha = require('mocha'),
_ = require('underscore');
module.exports = function (browser, dashboard, suite /*, config*/) {
var tests = {
'has a breadcrumb': function () {
return browser
.$('#global-breadcrumb ol').isDisplayed()
.should.eventually.be.ok
.$('#global-breadcrumb... |
var Mocha = require('mocha'),
_ = require('underscore');
module.exports = function (browser, dashboard, suite /*, config*/) {
var tests = {
'has a breadcrumb': function () {
return browser
.$('#global-breadcrumb ol').isDisplayed()
.should.eventually.be.ok
.$('#global-breadcrumb... | Fix substringing of long breadcrumb items | Fix substringing of long breadcrumb items
| JavaScript | mit | alphagov/cheapseats | ---
+++
@@ -20,7 +20,7 @@
if (dashboard.slug !== 'site-activity') {
return browser
.$('#global-breadcrumb ol li:nth-child(3)').text()
- .should.eventually.equal(dashboard.title);
+ .should.eventually.contain(dashboard.title.substr(0, 32));
... |
c394eb191cd889cf96a0367cecfe02c7a2db2146 | listProcessing/listProcessor.js | listProcessing/listProcessor.js | function listProcessor(input) {
let string = input.shift();
console.log(string);
for (let command of input) {
let tokens = command.split(/\s+/g);
let commandProperties = tokens.slice(1);
processCommand(tokens[0], commandProperties);
}
function processCommand(command, token... | function listProcessor(input) {
let list = input.shift().split(" ");
console.log(list.join(" "));
for (let command of input) {
let tokens = command.split(/\s+/g);
processCommand(tokens[0], tokens);
}
function processCommand(command, tokens) {
let index;
switch (com... | Add insert, delete and roll left functions. | Add insert, delete and roll left functions.
| JavaScript | mit | TeamWorkProject-ManagementBoards/List-Processing | ---
+++
@@ -1,32 +1,71 @@
function listProcessor(input) {
- let string = input.shift();
- console.log(string);
+ let list = input.shift().split(" ");
+ console.log(list.join(" "));
for (let command of input) {
let tokens = command.split(/\s+/g);
- let commandProperties = tokens.sli... |
def2531e1413f9efbd482e67df024abcae0848db | app.js | app.js | const express = require('express'),
app = express(),
bodyParser = require('body-parser'),
methodOverride = require('method-override'),
mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/mojibox');
app.set('view engine', 'pug');
app.use(express.static(__dirname + '/public'));
... | const express = require('express'),
app = express(),
bodyParser = require('body-parser'),
methodOverride = require('method-override'),
mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/mojibox');
app.set('view engine', 'pug');
app.use(express.static(__dirname + '/public'));
... | Modify schema to include a category for each emoticon | Modify schema to include a category for each emoticon
| JavaScript | mit | tymeart/mojibox,tymeart/mojibox | ---
+++
@@ -21,7 +21,8 @@
}
const emoticonSchema = new mongoose.Schema({
- content: String
+ content: String,
+ category: String
});
const Emoticon = mongoose.model('Emoticon', emoticonSchema); |
6a46bdc932c69f90f5f2580d5ddda224d62a0bfa | app.js | app.js | const express = require('express');
const app = express();
const path = require('path');
const routes = require('./myRoutes.js');
app.get('/', function(req, res) {
res.send('something');
});
app.get(routes.login, function(req, res) {
res.send('Login page');
});
app.get(routes.register, function(req, res) {
re... | const express = require('express');
const app = express();
const path = require('path');
const routes = require('./myRoutes.js');
app.get('/', function(req, res) {
res.send('something');
});
app.get(routes.login, function(req, res) {
res.send('Login page');
});
app.get(routes.register, function(req, res) {
re... | Add feature to send task.html on get to \task\ | Add feature to send task.html on get to \task\
| JavaScript | mit | geekskool/taskMaster,geekskool/taskMaster | ---
+++
@@ -25,7 +25,11 @@
});
app.get(routes.task, function(req, res) {
- res.send('Ind Task Page'+ req.params.id);
+// res.sendFile('Ind Task Page'+ req.params.id);
+
+ res.sendFile('static/html/task.html', {root: __dirname} )
+
+
});
app.get(routes.socketenter, function(req, res) { |
c3a3930a8a5efb073521063209ba8b5d9e6fb415 | app/Config/routes.js | app/Config/routes.js | module.exports = function(Config, XIBLE, EXPRESS_APP) {
EXPRESS_APP.get('/api/config', (req, res) => {
res.json(Config.getAll());
});
EXPRESS_APP.put('/api/config/value', (req, res) => {
let path = req.body.path;
let value = req.body.value;
if (typeof path !== 'string' || typeof value === 'undefined') {
... | module.exports = function(Config, XIBLE, EXPRESS_APP) {
EXPRESS_APP.get('/api/config', (req, res) => {
res.json(Config.getAll());
});
EXPRESS_APP.put('/api/config/value', (req, res) => {
let path = req.body.path;
let value = req.body.value;
if (typeof path !== 'string' || typeof value === 'undefined') {
... | PUT and DELETE return altered config | PUT and DELETE return altered config
| JavaScript | mit | SpectrumBroad/xible,SpectrumBroad/xible | ---
+++
@@ -13,7 +13,7 @@
}
Config.setValue(path, value);
- res.end();
+ res.json(Config.getAll());
});
@@ -25,7 +25,7 @@
}
Config.deleteValue(path);
- res.end();
+ res.json(Config.getAll());
});
|
78226c94a839fc351010cff197763634695c2f0b | cli.js | cli.js | #!/usr/bin/env node
var JSONStream = require('JSONStream')
var sra = require('./')
var args = process.argv.slice(2)
var command = args[0]
var srcFile = args[1]
var destDir = args[2]
var sraStream = sra(command)
sraStream([srcFile, destDir]).pipe(JSONStream.stringify(false)).pipe(process.stdout) | #!/usr/bin/env node
var JSONStream = require('JSONStream')
var sra = require('./')
var args = process.argv.slice(2)
var command = args[0]
var srcFile = args[1]
var destDir = args[2] || '.'
var sraStream = sra(command)
sraStream([srcFile, destDir]).pipe(JSONStream.stringify(false)).pipe(process.stdout) | Fix CLI for when no ouput folder is specified | Fix CLI for when no ouput folder is specified
| JavaScript | mit | bionode/bionode-sra | ---
+++
@@ -6,7 +6,7 @@
var command = args[0]
var srcFile = args[1]
-var destDir = args[2]
+var destDir = args[2] || '.'
var sraStream = sra(command) |
2a351a8ea174e50448c6ea39cb1674a33710b08e | app/js/app/services.js | app/js/app/services.js | 'use strict';
define(["angular", "app/services/LoginChecker", "app/services/FileLoader", "app/services/FigureUploader", "app/services/SnippetLoader", "app/services/TagLoader", "app/services/IdLoader"], function() {
/* Services */
angular.module('scooter.services', [])
.constant('Repo', {
owner: "ucam-cl-dtg",
... | 'use strict';
define(["angular", "app/services/LoginChecker", "app/services/FileLoader", "app/services/FigureUploader", "app/services/SnippetLoader", "app/services/TagLoader", "app/services/IdLoader"], function() {
/* Services */
angular.module('scooter.services', [])
.constant('Repo', {
owner: "isaacphysics",... | Migrate content repo to @isaacphysics | Migrate content repo to @isaacphysics
| JavaScript | mit | ucam-cl-dtg/scooter,ucam-cl-dtg/scooter | ---
+++
@@ -7,7 +7,7 @@
angular.module('scooter.services', [])
.constant('Repo', {
- owner: "ucam-cl-dtg",
+ owner: "isaacphysics",
name: "rutherford-content"
})
|
1e69df3472ec6536599f0ee00b2cc3d2a0853efc | HelloCoreClrApp.Ui/karma.conf.js | HelloCoreClrApp.Ui/karma.conf.js | module.exports = function (config) {
'use strict'
config.set({
frameworks: ['mocha', 'chai', 'sinon'],
files: [
{pattern: 'bower_components/jquery/dist/jquery.js', instrument: false},
{pattern: 'bower_components/toastr/toastr.js', instrument: false},
{pattern: 'bower_components/angular/an... | module.exports = function (config) {
'use strict'
config.set({
frameworks: ['mocha', 'chai', 'sinon'],
files: [
{pattern: 'bower_components/jquery/dist/jquery.js', instrument: false},
{pattern: 'bower_components/toastr/toastr.js', instrument: false},
{pattern: 'bower_components/angular/an... | Increase the delay time to avoid failing tests due to removed javascript files when starting the build process. | Increase the delay time to avoid failing tests due to removed javascript files when starting the build process.
| JavaScript | mit | jp7677/hellocoreclr,jp7677/hellocoreclr,jp7677/hellocoreclr,jp7677/hellocoreclr | ---
+++
@@ -13,6 +13,7 @@
'test/**/*.spec.js'
],
+ autoWatchBatchDelay: 10000,
singleRun: true,
browsers: ['PhantomJS']
}) |
fd9b688d1e416b53fb0a20b322d485f39c744d86 | Resources/helpers/LoginHelper.js | Resources/helpers/LoginHelper.js |
var LoginHelper = {
loggedIn : function() {
var cookie = Ti.App.Properties.getString('auth_cookie');
if (!cookie)
return false;
return true;
},
logout : function() {
var createConfirmDialog = function() {
var confirmDialog = Ti.UI.createAlertDialog({
title : "Logout",
... |
var LoginHelper = {
loggedIn : function() {
var cookie = Ti.App.Properties.getString('auth_cookie');
var cookieCreatedAt = Ti.App.Properties.getString('auth_cookie_created_at');
if (!cookie)
return false;
if(new Date() - new Date(cookieCreatedAt) > 3600000) { //Expire the cookie aft... | Expire the session (cookie) in one hour after login. | Expire the session (cookie) in one hour after login.
| JavaScript | mit | nilenso/ashoka-survey-mobile,nilenso/ashoka-survey-mobile | ---
+++
@@ -2,12 +2,21 @@
var LoginHelper = {
loggedIn : function() {
var cookie = Ti.App.Properties.getString('auth_cookie');
+ var cookieCreatedAt = Ti.App.Properties.getString('auth_cookie_created_at');
+
if (!cookie)
return false;
+
+ if(new Date() - new Date(cookieCreatedAt) ... |
68a8ab008a00a3dd062ae89d1b9aeef699686608 | sb/partition_nisheviz.js | sb/partition_nisheviz.js | require.config({
paths: {
'd3': '../node_modules/d3/d3',
'nishe': '../node_modules/nishe/nishe',
'nisheviz': '../nisheviz'
}
});
require(['d3', 'nishe', 'nisheviz'], function(d3, nishe, nisheviz) {
'use strict';
var svg = d3.select('svg');
var group = svg.append('g');
var p = new nishe.Partition... | require.config({
paths: {
'd3': '../node_modules/d3/d3',
'nishe': '../node_modules/nishe/nishe',
'nisheviz': '../nisheviz'
}
});
require(['d3', 'nishe', 'nisheviz'], function(d3, nishe, nisheviz) {
'use strict';
var svg = d3.select('svg');
var group = svg.append('g');
var p = new nishe.Partition... | Add an example of how to change the partition on keydown | Add an example of how to change the partition on keydown
| JavaScript | mit | b0ri5/nisheviz,b0ri5/nisheviz,b0ri5/nisheviz | ---
+++
@@ -14,4 +14,11 @@
var dims = nisheviz.partitionBlockDimensions(p.domain(), svg);
var rendered = nisheviz.renderPartition(p, dims.width, dims.height, group);
rendered.transitionToPartition(['c', 'b', 'a'], [1]);
+ d3.select("body").on("keydown", function() {
+ if (d3.event.keyIdentifier == "Left"... |
e8081ee5d7ecafeb9ca34560fc0129bbf55efa6a | app/src/index.js | app/src/index.js | require('babelify/polyfill');
const config = require('./config');
const SculptureApp = require('./app');
const DEFAULT_CLIENT_CONNECTION_OPTIONS = {
protocol: "ws",
username: "anyware",
password: "anyware",
host: "broker.shiftr.io"
};
const app = new SculptureApp(config);
const connectionOptions = Object.a... | require('babelify/polyfill');
const config = require('./config');
const SculptureApp = require('./app');
const DEFAULT_CLIENT_CONNECTION_OPTIONS = {
protocol: "ws",
username: "sculpture0",
password: "7f24a3e73b91dc9f51f15861d75c888b",
host: "broker.shiftr.io"
};
const app = new SculptureApp(config);
const ... | Connect as sculpture0 for now, until we have config in local storage | Connect as sculpture0 for now, until we have config in local storage
| JavaScript | mit | anyWareSculpture/sculpture-client,anyWareSculpture/sculpture-client,anyWareSculpture/sculpture-client | ---
+++
@@ -6,8 +6,8 @@
const DEFAULT_CLIENT_CONNECTION_OPTIONS = {
protocol: "ws",
- username: "anyware",
- password: "anyware",
+ username: "sculpture0",
+ password: "7f24a3e73b91dc9f51f15861d75c888b",
host: "broker.shiftr.io"
};
|
f37d79f6a9a90901a8cdfc11e5044750c3e0565d | SegmentedControl.ios.js | SegmentedControl.ios.js | 'use strict';
var React = require('react-native');
var {
Component,
SegmentedControlIOS
} = React;
class SegmentedControl extends Component {
render() {
return (
<SegmentedControlIOS
values={this.props.values}
selectedIndex={this.props.selectedIndex}
onChange={this.props.onChan... | 'use strict';
var React = require('react-native');
var {
Component,
SegmentedControlIOS
} = React;
class SegmentedControl extends Component {
render() {
return (
<SegmentedControlIOS
values={this.props.values}
selectedIndex={this.props.selectedIndex}
onChange={event => {
... | Fix iOS crash when switching performance filter selection by extracting index correctly | Fix iOS crash when switching performance filter selection by extracting index correctly
| JavaScript | mit | richeterre/jumu-nordost-react-native,richeterre/jumu-nordost-react-native,richeterre/jumu-nordost-react-native,richeterre/jumu-nordost-react-native | ---
+++
@@ -12,7 +12,10 @@
<SegmentedControlIOS
values={this.props.values}
selectedIndex={this.props.selectedIndex}
- onChange={this.props.onChange}
+ onChange={event => {
+ const index = event.nativeEvent.selectedSegmentIndex
+ this.props.onChange(index)
+ ... |
d37dda981abad79d255c7d0584a1dd0cbbc374e9 | database/queries.js | database/queries.js | 'use strict';
const fs = require('fs');
const escape = require('pg-escape');
const hasDBAvailable = Boolean(process.env.DB);
if (!hasDBAvailable) {
module.exports = {};
return;
}
const pgConfig = {
host: 'localhost',
user: process.env.PGUSER || 'hmbserver',
password: process.env.PGPASSWORD || fs.readFileS... | 'use strict';
const fs = require('fs');
const path = require('path');
const escape = require('pg-escape');
const hasDBAvailable = Boolean(process.env.DB);
if (!hasDBAvailable) {
module.exports = {};
return;
}
const pgPass = fs.readFileSync(path.join(__dirname, 'db-password'), {encoding: 'utf8'});
const pgConfig... | Fix path handling for db-password | Fix path handling for db-password
| JavaScript | mit | vampiman/Hold-My-Beer,vampiman/Hold-My-Beer | ---
+++
@@ -1,6 +1,7 @@
'use strict';
const fs = require('fs');
+const path = require('path');
const escape = require('pg-escape');
const hasDBAvailable = Boolean(process.env.DB);
@@ -10,10 +11,11 @@
return;
}
+const pgPass = fs.readFileSync(path.join(__dirname, 'db-password'), {encoding: 'utf8'});
con... |
d79d2a1e458ea7b878085b053b9d06b1beb948bb | views/apps/index.js | views/apps/index.js | var xhr = require('xhr');
var storage = require('localforage');
module.exports = {
id: 'apps',
components: {
tabBar: require('../../components/tabBar'),
navigationBar: require('../../components/navigationBar'),
appCell: require('../../components/appCell')
},
template: require('.... | var storage = require('localforage');
module.exports = {
id: 'apps',
components: {
tabBar: require('../../components/tabBar'),
navigationBar: require('../../components/navigationBar'),
appCell: require('../../components/appCell')
},
template: require('./index.html'),
data: r... | Remove XHR require from views | Remove XHR require from views
| JavaScript | mpl-2.0 | j796160836/webmaker-android,mozilla/webmaker-android,alanmoo/webmaker-android,rodmoreno/webmaker-android,vazquez/webmaker-android,cadecairos/webmaker-android,rodmoreno/webmaker-android,k88hudson/webmaker-android,thejdeep/webmaker-app,gvn/webmaker-android,codex8/webmaker-app,alicoding/webmaker-android,vazquez/webmaker-a... | ---
+++
@@ -1,4 +1,3 @@
-var xhr = require('xhr');
var storage = require('localforage');
module.exports = { |
d202393c105989d1d6cab52c572ebd51479572d6 | js/tests/Views_Attachments_Spec.js | js/tests/Views_Attachments_Spec.js | /**
* Mail
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @copyright Christoph Wurst 2015
*/
define(['views/attachments', 'handlebars'], function(AttachmentView, Handlebars) {
describe(... | /**
* Mail
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @copyright Christoph Wurst 2015
*/
define(['views/attachments', 'views/helper'], function(AttachmentView) {
describe('Attachmen... | Remove the Handlebars Helper for translaton and use the helper view | Remove the Handlebars Helper for translaton and use the helper view
| JavaScript | agpl-3.0 | ChristophWurst/mail,ChristophWurst/mail,kingjan1999/mail,kingjan1999/mail,kingjan1999/mail,ChristophWurst/mail | ---
+++
@@ -8,15 +8,11 @@
* @copyright Christoph Wurst 2015
*/
-define(['views/attachments', 'handlebars'], function(AttachmentView, Handlebars) {
+define(['views/attachments', 'views/helper'], function(AttachmentView) {
describe('AttachmentsView test', function() {
beforeEach(function() {
- Handleba... |
49f4aa9e57144c70f64184656fa8abb69ccf22bc | js/require_config.js | js/require_config.js | /* global requirejs */
/**
* Mail
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @copyright Christoph Wurst 2015, 2016
*/
(function() {
'use strict';
requirejs.config({
baseUrl: './... | /* global requirejs */
/**
* Mail
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @copyright Christoph Wurst 2015, 2016
*/
(function() {
'use strict';
requirejs.config({
baseUrl: './... | Fix requirejs for other locations than apps/ | Fix requirejs for other locations than apps/
| JavaScript | agpl-3.0 | ChristophWurst/mail,ChristophWurst/mail,kingjan1999/mail,ChristophWurst/mail,kingjan1999/mail,kingjan1999/mail | ---
+++
@@ -39,6 +39,10 @@
}
}
});
+ // avoid optimization errors
+ requirejs.config({
+ baseUrl: OC.linkTo('mail', 'js')
+ });
require([
'app', |
0e04a1cf050e6f34d5f19f489c7d0695b66d614c | add_aws_region_to_title.user.js | add_aws_region_to_title.user.js | // ==UserScript==
// @name Add AWS region to title
// @namespace curipha
// @description Help to know where I am now
// @include https://console.aws.amazon.com/*
// @include https://*.console.aws.amazon.com/*
// @version 0.0.2
// @grant none
// @noframes
// ==/UserScript==
(function() {
'u... | // ==UserScript==
// @name Add AWS region to title
// @namespace curipha
// @description Help to know where I am now
// @match https://console.aws.amazon.com/*
// @match https://*.console.aws.amazon.com/*
// @version 0.0.2
// @grant none
// @noframes
// ==/UserScript==
(function() {
'u... | Use @match directive for safely host pattern matching | Use @match directive for safely host pattern matching
| JavaScript | unlicense | curipha/userscripts,curipha/userscripts | ---
+++
@@ -2,8 +2,8 @@
// @name Add AWS region to title
// @namespace curipha
// @description Help to know where I am now
-// @include https://console.aws.amazon.com/*
-// @include https://*.console.aws.amazon.com/*
+// @match https://console.aws.amazon.com/*
+// @match https://*.cons... |
9dd5048cb1a681ac3aab0b803a2e7a9b86703944 | tests/acceptance/root-test.js | tests/acceptance/root-test.js | import Ember from 'ember';
import { test } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
import DocsController from 'dummy/docs/controller';
moduleForAcceptance('Acceptance | root');
test('visiting /', function(assert) {
visit('/');
andThen(function() {
assert.eq... | import Ember from 'ember';
import { test } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
import DocsController from 'dummy/docs/controller';
moduleForAcceptance('Acceptance | root');
test('visiting /', function(assert) {
visit('/');
andThen(function() {
assert.eq... | Fix tests now that "lifetimes" is commented out | Fix tests now that "lifetimes" is commented out | JavaScript | mit | machty/ember-concurrency,machty/ember-concurrency,jeradg/ember-concurrency,jeradg/ember-concurrency,jeradg/ember-concurrency,machty/ember-concurrency,jeradg/ember-concurrency,machty/ember-concurrency | ---
+++
@@ -17,7 +17,7 @@
test('visiting all docs', function(assert) {
visit('/');
- assert.expect(16);
+ assert.expect(15);
let contents = DocsController.proto().get('flatContents');
let i = 0; |
4fc5d2be8b17245533a250e370300174ba9f11f9 | app/scripts/directives/block.js | app/scripts/directives/block.js | 'use strict';
angular.module('confRegistrationWebApp')
.directive('block', function () {
return {
templateUrl: 'views/blockDirective.html',
restrict: 'E',
scope: {
'block': '=',
'prefillAnswer': '=answer'
},
controller: function ($scope) {
$scope.answer = {};... | 'use strict';
angular.module('confRegistrationWebApp')
.directive('block', function () {
return {
templateUrl: 'views/blockDirective.html',
restrict: 'E',
scope: {
'block': '=',
'prefillAnswer': '=answer'
},
controller: function ($scope) {
$scope.answer = ang... | Load answers from directive parameters | Load answers from directive parameters
| JavaScript | mit | CruGlobal/conf-registration-web,CruGlobal/conf-registration-web,CruGlobal/conf-registration-web,CruGlobal/conf-registration-web | ---
+++
@@ -10,7 +10,7 @@
'prefillAnswer': '=answer'
},
controller: function ($scope) {
- $scope.answer = {};
+ $scope.answer = angular.copy($scope.prefillAnswer) || {};
$scope.updateAnswer = function () {
// $scope.answer.$save(); |
dca82948f4cea4dc38d0f5da8ba75f062800ab4f | app/models/prescription.server.model.js | app/models/prescription.server.model.js | 'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Eye Schema
*/
var EyeSchema = new Schema({
cylinder: {
type: Number
},
sphere: {
type: Number
},
axis: {
type: Number
},
position: {
type: St... | 'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Eye Schema
*/
var EyeSchema = new Schema({
cylinder: {
type: Number
},
sphere: {
type: Number
},
axis: {
type: Number
},
position: {
type: St... | Add frame and lens fields | Add frame and lens fields
| JavaScript | mit | CodeHubGit/HopeSearch,CodeHubGit/HopeSearch | ---
+++
@@ -32,6 +32,14 @@
number:{
type: Number
},
+ frame:{
+ type: String,
+ default: ""
+ },
+ lens:{
+ type: String,
+ default: ""
+ },
user: {
type: Schema.ObjectId,
ref: 'User' |
10b0407de96ef5d40e97ec2db1a0a4ae6a9b72ba | src/app/reducers/main.js | src/app/reducers/main.js | 'use strict';
import * as types from '../actions/actionTypes';
import config from '../config';
window.navigator.userAgent = "react-native";
const initialState = {
isFetching: true,
question: '',
latest: ''
};
export default function main(state = initialState, action = {}) {
switch (action.type) {
... | 'use strict';
import * as types from '../actions/actionTypes';
import config from '../config';
const initialState = {
isFetching: true,
question: '',
latest: ''
};
export default function main(state = initialState, action = {}) {
switch (action.type) {
case types.GET_LATEST:
r... | Remove navigator user agent as it causes the app to break | Remove navigator user agent as it causes the app to break
| JavaScript | mit | benox3/react-native-socket,benox3/react-native-socket | ---
+++
@@ -2,8 +2,6 @@
import * as types from '../actions/actionTypes';
import config from '../config';
-
-window.navigator.userAgent = "react-native";
const initialState = {
isFetching: true,
@@ -11,7 +9,7 @@
latest: ''
};
-export default function main(state = initialState, action = {}) {
+ e... |
d59317c34ac8bb10c8d8d760089d68c01ebdeca4 | src/analyse-file.js | src/analyse-file.js | "use strict";
const vscode = require("vscode");
const analyser = require("./complexity-analyzer");
const reporter = require("./report-builder.js");
const config = require("./config");
const Output = require("./output-channel");
function getFileRelativePath(document) {
const fileUri = document.fileName;
... | "use strict";
const vscode = require("vscode");
const analyser = require("./complexity-analyzer");
const reporter = require("./report-builder.js");
const config = require("./config");
const Output = require("./output-channel");
function buildReport(document) {
const channel = new Output();
const filePa... | Use build in relative path method | Use build in relative path method
| JavaScript | mit | tomi/vscode-js-complexity-analysis | ---
+++
@@ -6,17 +6,10 @@
const config = require("./config");
const Output = require("./output-channel");
-function getFileRelativePath(document) {
- const fileUri = document.fileName;
- const projectPath = vscode.workspace.rootPath;
-
- return projectPath ? fileUri.replace(projectPath, "") : fileUri... |
e97435408a8fa349ec68e82c1b1e53d1299e47f2 | hw5/src/reducers.js | hw5/src/reducers.js | const Reducer = (state = {
}, action) => {
switch(action.type) {
// case 'ADD_TODO':
// return { ...state, nextId: state.nextId + 1,
// todoItems: [ ...state.todoItems,
// {id:state.nextId, text: action.text, done: false}]
// }
default:
... | const Reducer = (state = {
nextPage: 'LandingPage'
}, action) => {
switch(action.type) {
case 'navigate':
return Object.assign({}, state, {
nextPage: action.text
})
default:
return state
}
}
export default Reducer | Add a reducer for navigation. | Add a reducer for navigation.
| JavaScript | mit | yusong-shen/comp531-web-development,yusong-shen/comp531-web-development,yusong-shen/comp531-web-development,yusong-shen/comp531-web-development | ---
+++
@@ -1,12 +1,11 @@
const Reducer = (state = {
-
+ nextPage: 'LandingPage'
}, action) => {
switch(action.type) {
- // case 'ADD_TODO':
- // return { ...state, nextId: state.nextId + 1,
- // todoItems: [ ...state.todoItems,
- // {id:state.nextId, tex... |
f36fee125c86937281bddd1dc9ee239160742e74 | test/webworker_sandbox_tests.js | test/webworker_sandbox_tests.js | import Oasis from "oasis";
import webworkerAdapter from "oasis/webworker_adapter";
module('Webworker Sandboxes', {
setup: function() {
Oasis.reset();
}
});
test("throws an error if the sandbox type is html", function() {
raises(function() {
Oasis.createSandbox({
url: "fixtures/html_sandbox.html",
... | import Oasis from "oasis";
import webworkerAdapter from "oasis/webworker_adapter";
if( this.Worker ) {
module('Webworker Sandboxes', {
setup: function() {
Oasis.reset();
}
});
test("throws an error if the sandbox type is html", function() {
raises(function() {
Oasis.createSandbox({
... | Test web workers only when supported by the browser | Test web workers only when supported by the browser
| JavaScript | mit | ef4/oasis.js,ef4/oasis.js,yapplabs/oasis.js,tildeio/oasis.js | ---
+++
@@ -1,46 +1,48 @@
import Oasis from "oasis";
import webworkerAdapter from "oasis/webworker_adapter";
-module('Webworker Sandboxes', {
- setup: function() {
- Oasis.reset();
- }
-});
-
-test("throws an error if the sandbox type is html", function() {
- raises(function() {
- Oasis.createSandbox({
-... |
c526ecb88ff5b0f545b13f4baa4d67a1b6eb580f | test/www/jxcore/UnitTest_app.js | test/www/jxcore/UnitTest_app.js | /*
* This file needs to be renamed as app.js when we want to run unit tests
* in order this to get loaded by the jxcore ready event.
* This effectively acts as main entry point to the unit test app
*/
"use strict";
var test = require('tape');
//var express = require('express');
var net = require('net');
var testU... | /*
* This file needs to be renamed as app.js when we want to run unit tests
* in order this to get loaded by the jxcore ready event.
* This effectively acts as main entry point to the unit test app
*/
"use strict";
var net = require('net');
var test = require('tape');
var testUtils = require("./lib/testUtils");
... | Remove cruft from unit test app | Remove cruft from unit test app
| JavaScript | mit | thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin | ---
+++
@@ -6,24 +6,14 @@
"use strict";
+var net = require('net');
var test = require('tape');
-//var express = require('express');
-var net = require('net');
var testUtils = require("./lib/testUtils");
testUtils.toggleRadios(true);
-//var app = express();
-//app.disable('x-powered-by');
-
var myName = "... |
9bc79f3e6d50cf80b683864d3b86f812fda4904a | demo/js/demo.js | demo/js/demo.js | window.onload = function () {
"use strict";
var undoManager,
circleDrawer,
btnUndo,
btnRedo,
btnClear;
undoManager = new UndoManager();
circleDrawer = new CircleDrawer("view", undoManager);
ctrlLimit = document.getElementById("ctrlLimit");
btnUndo = documen... | window.onload = function () {
"use strict";
var undoManager,
ctrlLimit,
circleDrawer,
btnUndo,
btnRedo,
btnClear;
undoManager = new UndoManager();
circleDrawer = new CircleDrawer("view", undoManager);
ctrlLimit = document.getElementById("ctrlLimit");
... | Fix ctrlLimit undefined in Demo | Fix ctrlLimit undefined in Demo
Probably been broken for months... | JavaScript | mit | squallyan/Javascript-Undo-Manager,ArthurClemens/Javascript-Undo-Manager,ArthurClemens/Javascript-Undo-Manager,squallyan/Javascript-Undo-Manager | ---
+++
@@ -2,6 +2,7 @@
"use strict";
var undoManager,
+ ctrlLimit,
circleDrawer,
btnUndo,
btnRedo, |
c52e8110adda71f5bc4e45a3fa671c56971f8ab8 | desktop/main.js | desktop/main.js | const electron = require('electron');
const { app } = electron;
const { ipcMain: ipc } = electron;
const { dialog } = electron;
const { BrowserWindow } = electron;
// const sass = require('node-sass')
const fs = require('fs');
var win;
// function compileSass() {
// sass.render({
// file: 'assets/css/main.scss'... | const electron = require('electron');
const { app } = electron;
const { ipcMain: ipc } = electron;
const { dialog } = electron;
const { BrowserWindow } = electron;
// const sass = require('node-sass')
// const fs = require('fs');
let win;
// function compileSass() {
// sass.render({
// file: 'assets/css/main.sc... | Fix eslint errors - 1 | Fix eslint errors - 1
| JavaScript | mit | mkermani144/wanna,mkermani144/wanna | ---
+++
@@ -4,9 +4,9 @@
const { dialog } = electron;
const { BrowserWindow } = electron;
// const sass = require('node-sass')
-const fs = require('fs');
+// const fs = require('fs');
-var win;
+let win;
// function compileSass() {
// sass.render({
@@ -23,7 +23,7 @@
function createWindow() {
win = new B... |
556f8e7b7a81d25a5787ddc5d0e766876162e5da | workflows/createDeployment.js | workflows/createDeployment.js | 'use strict';
// workflows/createDeployment
var Joi = require('joi');
module.exports = {
schema: Joi.object({
deployerId: Joi.string().required(),
name: Joi.string().min(1).required(),
}).required().unknown(true),
version: '1.0',
decider: function(args) {
return {
createDeploymentDo... | 'use strict';
// workflows/createDeployment
var Joi = require('joi');
module.exports = {
schema: Joi.object({
deployerId: Joi.string().required(),
name: Joi.string().min(1).required(),
}).required().unknown(true),
version: '1.0',
decider: function(args) {
return {
createDeploymentDo... | Fix example test env reference | Fix example test env reference
| JavaScript | mit | f5itc/swf-graph,f5itc/swf-graph,f5itc/swf-graph | ---
+++
@@ -28,7 +28,9 @@
setDeploymentStateCreated: {
dependsOn: ['startNewDeployment'],
- input: (env) => ({ state: 'Running', id: env.deploymentId }),
+ input: (env) => {
+ return { state: 'Running', id: env.theId };
+ },
activity: 'setDeploymentDoc... |
6817d548fcc4c24196560fc478860d0383156908 | scripts/generate.js | scripts/generate.js |
/*
* broccoli-replace
* http://gruntjs.com/
*
* Copyright (c) 2014 outaTiME
* Licensed under the MIT license.
* https://github.com/outaTiME/broccoli-replace/blob/master/LICENSE-MIT
*/
var fs = require('fs');
var filename = 'node_modules/pattern-replace/README.md';
var readme = fs.readFileSync(filename, 'utf8')... |
/*
* broccoli-replace
*
* Copyright (c) 2014 outaTiME
* Licensed under the MIT license.
* https://github.com/outaTiME/broccoli-replace/blob/master/LICENSE-MIT
*/
var fs = require('fs');
var filename = 'node_modules/pattern-replace/README.md';
var readme = fs.readFileSync(filename, 'utf8');
// initialize section... | Remove unused code from readme generator. | Remove unused code from readme generator.
| JavaScript | mit | outaTiME/broccoli-replace,outaTiME/broccoli-replace,alexeagle/broccoli-replace,alexeagle/broccoli-replace | ---
+++
@@ -1,7 +1,6 @@
/*
* broccoli-replace
- * http://gruntjs.com/
*
* Copyright (c) 2014 outaTiME
* Licensed under the MIT license.
@@ -26,12 +25,6 @@
sections[section] = contents;
}
-// took contents from readme section
-
-var getSectionContents = function (name) {
-
-};
-
// write readme
va... |
c9ef14a1d3346ac6d4db00cbab09df0d6a5a97c4 | tests/setup/globals.js | tests/setup/globals.js | var chai = require('chai'),
sinon = require('sinon'),
sinonChai = require('sinon-chai'),
path = require('path'),
React = require('react');
global.expect = chai.expect;
chai.use(sinonChai);
beforeEach(function() {
/**
* Prepare a container to mount the component before each test.
*/
this... | var chai = require('chai'),
sinon = require('sinon'),
sinonChai = require('sinon-chai'),
path = require('path'),
React = require('react');
global.expect = chai.expect;
chai.use(sinonChai);
beforeEach(function() {
/**
* Prepare stuff that you might need in tests.
*
* Create a simple div ... | Create a sandbox before each test and clean it up afterwards | Create a sandbox before each test and clean it up afterwards
| JavaScript | mit | NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet | ---
+++
@@ -13,18 +13,29 @@
beforeEach(function() {
/**
- * Prepare a container to mount the component before each test.
+ * Prepare stuff that you might need in tests.
+ *
+ * Create a simple div container in which you can mount your component. If you
+ * mount it in that container, it will automatic... |
e475c04eaa956c3a5910de4a332c113135c8b8c1 | spec/suites/map/MapSpec.js | spec/suites/map/MapSpec.js | describe("Map", function () {
describe("#whenReady", function () {
describe("when the map has not yet been loaded", function () {
it("calls the callback when the map is loaded", function () {
var map = L.map(document.createElement('div')),
spy = jasmine.createSpy();
map.whenReady(spy);
expect(sp... | describe("Map", function () {
describe("#whenReady", function () {
describe("when the map has not yet been loaded", function () {
it("calls the callback when the map is loaded", function () {
var map = L.map(document.createElement('div')),
spy = jasmine.createSpy();
map.whenReady(spy);
expect(sp... | Add a missing semi colon and make one line < 80 chars | Add a missing semi colon and make one line < 80 chars
| JavaScript | bsd-2-clause | Neorth/Leaflet,iOffice/Leaflet,Neorth/Leaflet,Fil/Leaflet,scaddenp/Leaflet,AP-whitehat/Leaflet,hyperknot/Leaflet,prashen/Leaflet,jasonoverland/Leaflet,Jakobud/Leaflet,twoubt/Leaflet,Andrey-Pavlov/Leaflet,hyperknot/Leaflet,gabrielpconceicao/frontend-asset-leaflet,srdavis/leaflet-template,pzdz/Leaflet,sisou/Leaflet,twoub... | ---
+++
@@ -10,7 +10,7 @@
map.setView([0, 0], 1);
expect(spy).toHaveBeenCalled();
- })
+ });
});
describe("when the map has already been loaded", function () {
@@ -27,7 +27,8 @@
});
describe("#getBounds", function () {
- it("is safe to call from within a moveend callback during initial ... |
579bf2cb2d6f894fed689b6ac87b7d8a9b00b162 | src/sagasBuilder.js | src/sagasBuilder.js | import { takeEvery } from 'redux-saga';
import { call, put } from 'redux-saga/effects';
export default function sagasBuilder(request, REQUEST, actions) {
function* makeRequest({ payload, meta }) {
let data;
let error;
try {
yield put(actions.pending());
data = yield call(request, payload, m... | import { takeEvery } from 'redux-saga';
import { call, put } from 'redux-saga/effects';
export default function sagasBuilder(request, REQUEST, actions, { throwErrors }) {
function* makeRequest({ payload, meta }) {
let data;
let error;
try {
yield put(actions.pending());
data = yield call(re... | Add option to throw errors | sagaBuilder: Add option to throw errors
| JavaScript | mit | rockingskier/redux-request-utils | ---
+++
@@ -2,7 +2,7 @@
import { call, put } from 'redux-saga/effects';
-export default function sagasBuilder(request, REQUEST, actions) {
+export default function sagasBuilder(request, REQUEST, actions, { throwErrors }) {
function* makeRequest({ payload, meta }) {
let data;
let error;
@@ -14,6 +14,... |
a2ccd51b855487c5ea8bbee8a99e15668a715926 | lib/create-store.js | lib/create-store.js | 'use strict'
var assign = require('object-assign')
var EventEmitter = require('eventemitter3')
var objEql = require('obj-eql')
function createStore(obj) {
var store = assign(Object.create(EventEmitter.prototype), {
state: {},
setState: function(change) {
var newState = Object.freeze(assign({}, this.st... | 'use strict'
var assign = require('object-assign')
var EventEmitter = require('eventemitter3')
var objEql = require('obj-eql')
function createStore(obj) {
var store = assign(Object.create(EventEmitter.prototype), {
state: {},
setState: function(change) {
this.replaceState(assign({}, this.state, change... | Refactor replaceState to handle all state updates | Refactor replaceState to handle all state updates
| JavaScript | mit | uniflow/uniflow | ---
+++
@@ -8,23 +8,17 @@
var store = assign(Object.create(EventEmitter.prototype), {
state: {},
setState: function(change) {
- var newState = Object.freeze(assign({}, this.state, change))
- updateState(this, newState)
+ this.replaceState(assign({}, this.state, change))
},
replac... |
ada17c157da83ec6d34552a47d7e4767289fd376 | fixParagraphStructure.js | fixParagraphStructure.js | const fs = require('fs');
const flat = require('flat');
function fixParagraphStructure(originalJSONPath, translatedJSONPath) {
const originalJSONFile = fs.readFileSync(originalJSONPath);
const originalJSON = flat.flatten(JSON.parse(originalJSONFile));
const translJSONFile = fs.readFileSync(translatedJSONPath);
... | const fs = require('fs');
const flat = require('flat');
function fixParagraphStructure(originalJSONPath, translatedJSONPath) {
const originalJSONFile = fs.readFileSync(originalJSONPath);
const originalJSON = flat.flatten(JSON.parse(originalJSONFile), {
delimiter: '/'
});
const translJSONFile = fs.readFileS... | Change delimiter in flatten function | Change delimiter in flatten function
| JavaScript | mit | processing/p5.js-website,processing/p5.js-website | ---
+++
@@ -3,9 +3,13 @@
function fixParagraphStructure(originalJSONPath, translatedJSONPath) {
const originalJSONFile = fs.readFileSync(originalJSONPath);
- const originalJSON = flat.flatten(JSON.parse(originalJSONFile));
+ const originalJSON = flat.flatten(JSON.parse(originalJSONFile), {
+ delimiter: '/'... |
567e1420eca9d0d64b9309ed9482c0842c8c7d2b | src/shared/prop-types.js | src/shared/prop-types.js | import { PropTypes } from 'react';
const CardPropTypes = {
id: PropTypes.number,
name: PropTypes.string,
type: PropTypes.string,
colour: PropTypes.string,
manaCost: PropTypes.string,
numberCopies: PropTypes.number,
rarity: PropTypes.string,
};
export {
CardPropTypes,
};
| import { PropTypes } from 'react';
const CardPropTypes = {
id: PropTypes.number,
name: PropTypes.string,
types: PropTypes.arrayOf(PropTypes.string),
colour: PropTypes.string,
manaCost: PropTypes.string,
numberCopies: PropTypes.number,
rarity: PropTypes.string,
};
export {
CardPropTypes,
};
| Change Card proptypes accordingly to backend data | Change Card proptypes accordingly to backend data
| JavaScript | agpl-3.0 | Narxem/crispy-magic-front,Narxem/crispy-magic-front | ---
+++
@@ -3,7 +3,7 @@
const CardPropTypes = {
id: PropTypes.number,
name: PropTypes.string,
- type: PropTypes.string,
+ types: PropTypes.arrayOf(PropTypes.string),
colour: PropTypes.string,
manaCost: PropTypes.string,
numberCopies: PropTypes.number, |
86fc28a1acd2bea5d731ac76311960422092749a | src/angular-knob.js | src/angular-knob.js | angular.module('ui.knob', [])
.directive('knob', function () {
return {
restrict: 'EACM',
template: function(elem, attrs){
return '<input value="{{ knob }}">';
},
replace: true,
scope: true,
link: function (scope, elem, attrs) {
scope.knob = scope.$eval(attrs... | angular.module('ui.knob', [])
.directive('knob', function () {
return {
restrict: 'EACM',
template: function(elem, attrs){
return '<input value="{{ knob }}">';
},
replace: true,
scope: true,
link: function (scope, elem, attrs) {
scope.knob = scope.$eval(attrs... | Fix for refreshing the max amount of the knob when the max value its bound to is changed | Fix for refreshing the max amount of the knob when the max value its bound to is changed
| JavaScript | mit | Bunni/angular-knob,Bunni/angular-knob | ---
+++
@@ -38,8 +38,19 @@
};
+ var updateMax = function updateMax() {
+ var max = scope.$eval(attrs.knobMax);
+ $elem.trigger('configure', {
+ 'max': max
+ }).trigger('change');
+ }
+
scope.$watch(attrs.knobData, function () {
rend... |
d02264b0f96c31288ca3d2c1884f833986cee298 | src/util/expand-group.js | src/util/expand-group.js | // Returns array with group states
export default function expandGroup(groupState, entityMap) {
return groupState.attributes.entity_id.map(
entityId => entityMap.get(entityId));
}
| // Returns Immutable list with group states.
// Entities that can't be found will be skipped.
import { toImmutable } from 'nuclear-js';
export default function expandGroup(groupState, entityMap) {
return toImmutable(groupState.attributes.entity_id.map(
entityId => entityMap.get(entityId)).filter(ent => !!ent));
... | Expand group filters out not found states | Expand group filters out not found states
| JavaScript | mit | balloob/home-assistant-js | ---
+++
@@ -1,5 +1,8 @@
-// Returns array with group states
+// Returns Immutable list with group states.
+// Entities that can't be found will be skipped.
+import { toImmutable } from 'nuclear-js';
+
export default function expandGroup(groupState, entityMap) {
- return groupState.attributes.entity_id.map(
- ent... |
94fe2e82ebae76a7a7066b973cfc40ba473b82dc | test/mock.js | test/mock.js | import path from 'path';
import dotenv from 'dotenv';
import popura from '../src';
import generateAuthToken from '../src/utils/generate-auth-token';
dotenv.config({
silent: false,
path: path.join(__dirname, '../.env'),
});
export const instance = popura(
process.env.MAL_USER,
process.env.MAL_PASS
);
export con... | import path from 'path';
import dotenv from 'dotenv';
import popura from '../src';
import generateAuthToken from '../src/utils/generate-auth-token';
dotenv.config({
silent: true,
path: path.join(__dirname, '../.env'),
});
export const instance = popura(
process.env.MAL_USER,
process.env.MAL_PASS
);
export cons... | Add `silent` flag so dotenv doesn't fail CI tests | Add `silent` flag so dotenv doesn't fail CI tests
| JavaScript | mit | lubien/popura | ---
+++
@@ -4,7 +4,7 @@
import generateAuthToken from '../src/utils/generate-auth-token';
dotenv.config({
- silent: false,
+ silent: true,
path: path.join(__dirname, '../.env'),
});
|
c00c0347e6e795ecddc439eee4b3f20b8508d18b | client/app/components/App.js | client/app/components/App.js | import React from 'react';
import { Link } from 'react-router';
class App extends React.Component {
render() {
return (
<div className="app">
<h1>Welcome to KIM!</h1>
<ul className="navbar">
<li><Link to={'/jewelry'}>Jewelry Products</Link></li>
<li><Link to={'/materials... | import React from 'react';
import { Link, IndexLink } from 'react-router';
class App extends React.Component {
render() {
return (
<div className="app">
<div className="logo-wrapper">
<img className="logo" src="../../assets/WebsiteHeader.png" alt="Kristin Miller Jewelry"/>
</div>
... | Add header logo, index route, and navbar classes | Add header logo, index route, and navbar classes
| JavaScript | mit | jfanderson/KIM,jfanderson/KIM | ---
+++
@@ -1,20 +1,22 @@
import React from 'react';
-import { Link } from 'react-router';
+import { Link, IndexLink } from 'react-router';
class App extends React.Component {
render() {
return (
<div className="app">
- <h1>Welcome to KIM!</h1>
- <ul className="navbar">
- <li... |
3fd62d301884be561d47019ca8841af86093aedc | background.js | background.js | // Copyright (c) 2015 Narwhal Software s.r.l.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
// Global accessor that the popup uses.
var pattern = /^(https?:\/\/)((doc-snapshots.qt.io)|(doc.qt.io))\/([^\/]+)\/(.*)/
chrome.runtime.onInstalled.addListener(functi... | // Copyright (c) 2015 Narwhal Software s.r.l.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
// Global accessor that the popup uses.
var pattern = /^(https?:\/\/)((doc-snapshots.qt.io)|(doc.qt.io))\/([^\/]+)\/(.*)/
chrome.runtime.onInstalled.addListener(functi... | Make sure the new url filename is lower case | Make sure the new url filename is lower case
Apparently doc.qt.io does case insensitive file matching,
doc-snapshot.qt.io doesn't.
| JavaScript | mit | narwhal/QtLatestDocs-chrome | ---
+++
@@ -22,6 +22,6 @@
chrome.pageAction.onClicked.addListener(function(tab) {
var match = pattern.exec(tab.url);
- var newUrl = match[1] + "doc-snapshots.qt.io/qt5-dev/" + match[6];
+ var newUrl = match[1] + "doc-snapshots.qt.io/qt5-dev/" + match[6].toLowerCase();
chrome.tabs.update(tab.id, {ur... |
766034fec7d671d4901b1258269e97ae3358d265 | test/lib/prepare-spec.js | test/lib/prepare-spec.js | var expect = require('chai').expect;
var sinon = require('sinon');
var prepare = require('../../lib/prepare');
var fs = require('fs');
describe('lib/prepare', function () {
it('removes data.textPath and place the content of its file to data.text', function () {
sinon.stub(fs, 'readFileSync');
prepare({textP... | var expect = require('chai').expect;
var sinon = require('sinon');
var prepare = require('../../lib/prepare');
var fs = require('fs');
describe('lib/prepare', function () {
it('removes data.textPath and place the content of its file to data.text', function () {
var data = {
textPath: 'textPath'
};
... | Update test: check lib/prepare's file reading | Update test: check lib/prepare's file reading
| JavaScript | mit | arrowrowe/mailgun-util | ---
+++
@@ -5,10 +5,16 @@
var fs = require('fs');
describe('lib/prepare', function () {
+
it('removes data.textPath and place the content of its file to data.text', function () {
- sinon.stub(fs, 'readFileSync');
- prepare({textPath: 'textPath'});
+ var data = {
+ textPath: 'textPath'
+ };
+ ... |
38793f2f444d22a40bd844ac59d42b7634b3ada0 | init-dev-account.js | init-dev-account.js | 'use strict'
const cozy = require('./cozyclient')
const fs = require('fs')
const path = require('path')
// account id path is mandatory in the cli
let accountIdPath = process.argv[2]
if (accountIdPath) {
accountIdPath = path.resolve(accountIdPath)
} else {
console.log(`Account id file not found : ${accountIdPath}... | 'use strict'
const cozy = require('./cozyclient')
const fs = require('fs')
const path = require('path')
// account id path is mandatory in the cli
let accountIdPath = process.argv[2]
if (accountIdPath) {
accountIdPath = path.resolve(accountIdPath)
} else {
console.log(`Account id file not found : ${accountIdPath}... | Check the existence of env_fields.json file | Check the existence of env_fields.json file
| JavaScript | mit | doubleface/cozy-konnector-libs | ---
+++
@@ -10,15 +10,22 @@
accountIdPath = path.resolve(accountIdPath)
} else {
console.log(`Account id file not found : ${accountIdPath}`)
- process.exit(1)
+ process.exit(0)
}
let fieldsFilePath = process.argv[3]
if (fieldsFilePath) {
fieldsFilePath = path.resolve(fieldsFilePath)
} else {
- cons... |
6ef08643c91f18dc92bed0b1d8c99b410c730add | src/lift.js | src/lift.js | import React from 'react'
class Observable extends React.Component {
constructor (props) {
super(props)
this.state = {value: null}
}
componentWillMount () {
this.unsubscribe = this.props.stream(value => this.setState({value}))
}
componentWillUnMount () {
this.unsubscribe()
}
render ()... | import React from 'react'
class Observable extends React.Component {
constructor (props) {
super(props)
this.state = {value: null}
}
componentWillMount () {
this.unsubscribe = this.props.stream(value => this.setState({value}))
}
componentWillUnmount () {
this.unsubscribe()
}
render ()... | Fix typo that caused streams not to unsub | Fix typo that caused streams not to unsub
| JavaScript | mit | juhohei/slope | ---
+++
@@ -11,7 +11,7 @@
this.unsubscribe = this.props.stream(value => this.setState({value}))
}
- componentWillUnMount () {
+ componentWillUnmount () {
this.unsubscribe()
}
|
4dbb3dc59e525598972bab51c6b44ab61cb673cc | src/main.js | src/main.js | const { ipcRenderer, remote } = require("electron");
const { app, BrowserWindow } = require("electron");
const fs = require("fs");
window.onload = () => {
}
| const { ipcRenderer } = require("electron");
const remote = require("electron").remote;
const { app, BrowserWindow } = require("electron");
const fs = require("fs");
window.onload = () => {
var win = remote.getCurrentWindow();
win.setResizable(true);
}
| Allow window to be resized | Allow window to be resized
| JavaScript | apache-2.0 | EpticMC/Commander-IDE,EpticMC/Commander-IDE | ---
+++
@@ -1,7 +1,9 @@
-const { ipcRenderer, remote } = require("electron");
+const { ipcRenderer } = require("electron");
+const remote = require("electron").remote;
const { app, BrowserWindow } = require("electron");
const fs = require("fs");
window.onload = () => {
-
+ var win = remote.getCurrentWindow()... |
9b31abb8533ccf889a8a2356808375a794938af3 | src/main.js | src/main.js | var classes = require("./classes");
var gRex = require("./grex");
var grex = function(options, callback){
try {
if(typeof options === 'function'){
callback = options;
options = undefined;
}
var db = new gRex(options);
connect = db.connect().then().nodeify(cal... | var classes = require("./classes");
var gRex = require("./grex");
var grex = function(options, callback){
try {
if(typeof options === 'function'){
callback = options;
options = undefined;
}
var db = new gRex(options);
connect = db.connect().then().nodeify(cal... | Fix warnings in build task | Fix warnings in build task
| JavaScript | mit | jbmusso/grex | ---
+++
@@ -10,8 +10,8 @@
var db = new gRex(options);
connect = db.connect().then().nodeify(callback);
} catch(error) {
+ console.error(error);
return callback(error);
- console.error(error);
}
return connect;
@@ -23,7 +23,7 @@
"Contains": classes.Contain... |
f9066c99c2a52c5807c0f3f1491c69ce1afc21b5 | src/methods/statistics/index.js | src/methods/statistics/index.js | import connection from '../../config/database';
module.exports.register = (server, options, next) => {
async function getStats(next) {
try {
const divisions = await connection
.table('employees')
.filter(doc => doc('div').ne(''))('div')
.distinct()
.count();
const dir... | import connection from '../../config/database';
module.exports.register = (server, options, next) => {
async function getStats(next) {
try {
const groups = await connection
.table('employees')
.filter(doc => doc('grp').ne(''))('grp')
.distinct()
.count();
const divisi... | Update Census statistics method to get groups, sections and teams | Update Census statistics method to get groups, sections and teams
| JavaScript | mit | ocean/higgins,ocean/higgins | ---
+++
@@ -3,6 +3,12 @@
module.exports.register = (server, options, next) => {
async function getStats(next) {
try {
+ const groups = await connection
+ .table('employees')
+ .filter(doc => doc('grp').ne(''))('grp')
+ .distinct()
+ .count();
+
const divisions = await ... |
ee72d9510414cef2decd3f0db5e36ec4eab70127 | test/issues/0123.js | test/issues/0123.js | 'use strict';
var assert = require('assert');
var yaml = require('../../');
test('RegExps should be properly closed', function () {
assert.throws(function () { yaml.load('!!js/regexp /fo'); });
assert.throws(function () { yaml.load('!!js/regexp /fo/q'); });
assert.throws(function () { yaml.load('!!js/regexp... | 'use strict';
var assert = require('assert');
var yaml = require('../../');
test('RegExps should be properly closed', function () {
assert.throws(function () { yaml.load('!!js/regexp /fo'); });
assert.throws(function () { yaml.load('!!js/regexp /fo/q'); });
assert.throws(function () { yaml.load('!!js/regexp... | Support new (correct) RegExp.toString behavior | Support new (correct) RegExp.toString behavior
Just a fix to the test to remove spurious failure.
Fix #172
| JavaScript | mit | denji/js-yaml,isaacs/js-yaml,bjlxj2008/js-yaml,jonnor/js-yaml,joshball/js-yaml,isaacs/js-yaml,isaacs/js-yaml,minj/js-yaml,doowb/js-yaml,jonnor/js-yaml,crissdev/js-yaml,vogelsgesang/js-yaml,deltreey/js-yaml,deltreey/js-yaml,pombredanne/js-yaml,vogelsgesang/js-yaml,bjlxj2008/js-yaml,joshball/js-yaml,pombredanne/js-yaml,j... | ---
+++
@@ -10,5 +10,15 @@
assert.throws(function () { yaml.load('!!js/regexp /fo/q'); });
assert.throws(function () { yaml.load('!!js/regexp /fo/giii'); });
- assert.equal(yaml.load('!!js/regexp /fo/g/g'), '/fo/g/g');
+ // https://github.com/nodeca/js-yaml/issues/172
+ var regexp = yaml.load('!!js/regexp ... |
c326be92e077ae1d5f94227e4039b1590c012d91 | test/setup/setup.js | test/setup/setup.js | module.exports = function() {
global.expect = global.chai.expect;
global.THREE = require('three');
// Mock 'document.createElement()' to return a fake canvas.
// This is a bit more convenient rather than requiring both the canvas
// and jsdom node modules to be installed as well.
const context = {
cle... | module.exports = function() {
global.expect = global.chai.expect;
global.THREE = require('three');
// Mock 'document.createElement()' to return a fake canvas.
// This is a bit more convenient rather than requiring both the canvas
// and jsdom node modules to be installed as well.
const context = {
cle... | Add missing canvas context methods | Add missing canvas context methods
| JavaScript | mit | Leeft/three-sprite-texture-atlas-manager,Leeft/three-sprite-texture-atlas-manager | ---
+++
@@ -16,6 +16,9 @@
measureText: function( text ) { return { width: text.length } },
translate: function() {},
strokeRect: function() {},
+ scale: function() {},
+ fillText: function() {},
+ strokeText: function() {},
};
global.document = {
'createElement': function( name ) { |
ea92f597db06879e471e9d76cae85b822d3cf976 | tests/integration/components/provider-carousel-test.js | tests/integration/components/provider-carousel-test.js | import {moduleForComponent, skip} from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
moduleForComponent('provider-carousel', 'Integration | Component | provider carousel', {
integration: true
});
skip('it renders', function (assert) {
// Set any properties with this.s... | import {moduleForComponent, test} from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
moduleForComponent('provider-carousel', 'Integration | Component | provider carousel', {
integration: true
});
test('it renders', function (assert) {
// Set any properties with this.s... | Make provider-carousel test account for whitespace | Make provider-carousel test account for whitespace
| JavaScript | apache-2.0 | CenterForOpenScience/ember-preprints,baylee-d/ember-preprints,CenterForOpenScience/ember-preprints,baylee-d/ember-preprints | ---
+++
@@ -1,4 +1,4 @@
-import {moduleForComponent, skip} from 'ember-qunit';
+import {moduleForComponent, test} from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
@@ -6,7 +6,7 @@
integration: true
});
-skip('it renders', function (assert) {
+test('it renders', f... |
435462ea2d0f0545ddd930a73d0168fff0fa6c1c | tests/karma.conf.js | tests/karma.conf.js | // This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
var webpackConfig = require('../build/webpack.test.conf')
module.exports = function (config) {
config.s... | // This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
var webpackConfig = require('../build/webpack.test.conf')
var path = require('path');
module.exports = fu... | Fix coverage output directory so it works with `karma-coveralls` | Fix coverage output directory so it works with `karma-coveralls`
| JavaScript | mit | AlbinoDrought/cachios,AlbinoDrought/cachios | ---
+++
@@ -4,6 +4,7 @@
// https://github.com/webpack/karma-webpack
var webpackConfig = require('../build/webpack.test.conf')
+var path = require('path');
module.exports = function (config) {
config.set({
@@ -18,6 +19,7 @@
'../node_modules/babel-polyfill/dist/polyfill.js',
'./index.js'
... |
5825573d2d6f907df67ca44698cb5eecc689d4f6 | src/emoji/emojiSelectors.js | src/emoji/emojiSelectors.js | /* @flow */
import { createSelector } from 'reselect';
import { getRawRealmEmoji } from '../directSelectors';
import { getAuth } from '../account/accountSelectors';
import { getFullUrl } from '../utils/url';
export const getAllRealmEmojiById = createSelector(getAuth, getRawRealmEmoji, (auth, emojis) =>
Object.keys(e... | /* @flow */
import { createSelector } from 'reselect';
import type { Selector, RealmEmojiState } from '../types';
import { getRawRealmEmoji } from '../directSelectors';
import { getAuth } from '../account/accountSelectors';
import { getFullUrl } from '../utils/url';
export const getAllRealmEmojiById: Selector<RealmEmo... | Add type annotations to selectors. | emoji: Add type annotations to selectors.
This fully covers this (small) file with types.
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile | ---
+++
@@ -1,21 +1,27 @@
/* @flow */
import { createSelector } from 'reselect';
+import type { Selector, RealmEmojiState } from '../types';
import { getRawRealmEmoji } from '../directSelectors';
import { getAuth } from '../account/accountSelectors';
import { getFullUrl } from '../utils/url';
-export const get... |
226ad96842c45597f33dc0f9c4d341caa3ffa90b | app/controller.js | app/controller.js | 'use strict';
const matchPublic = /^\s*public\s*(\S*)$/;
class Controller {
constructor() {
this.commands = [];
}
addCommand( name ) {
const Command = require( './command/' + name );
const instance = new Command( this );
this.commands.push( instance );
}
handleRequest( request ) {
const values = mat... | 'use strict';
const matchPublic = /^\s*public\s*(.*)$/;
class Controller {
constructor() {
this.commands = [];
}
addCommand( name ) {
const Command = require( './command/' + name );
const instance = new Command( this );
this.commands.push( instance );
}
handleRequest( request ) {
const values = matc... | Update public keyword regular expression. | Update public keyword regular expression.
| JavaScript | mit | pjasiun/fuma,pjasiun/fuma | ---
+++
@@ -1,6 +1,6 @@
'use strict';
-const matchPublic = /^\s*public\s*(\S*)$/;
+const matchPublic = /^\s*public\s*(.*)$/;
class Controller {
constructor() { |
a28122842e4c7c454813c81bbca1c3645dfc70e9 | jest.config.base.js | jest.config.base.js | const { defaults } = require("jest-config");
module.exports = {
testEnvironment: "node",
setupFiles: [
"<rootDir>/../apollo-server-env/dist/index.js"
],
preset: "ts-jest",
testMatch: null,
testRegex: "/__tests__/.*\\.test\\.(js|ts)$",
testPathIgnorePatterns: [
"/node_modules/",
... | const { defaults } = require("jest-config");
module.exports = {
testEnvironment: "node",
setupFiles: [
"<rootDir>/../apollo-server-env/dist/index.js"
],
preset: "ts-jest",
testMatch: null,
testRegex: "/__tests__/.*\\.test\\.(js|ts)$",
testPathIgnorePatterns: [
"/node_modules/",
... | Add comments to `moduleNameMapper` option in Jest config | Add comments to `moduleNameMapper` option in Jest config
| JavaScript | mit | apollostack/apollo-server | ---
+++
@@ -15,6 +15,12 @@
moduleFileExtensions: [...defaults.moduleFileExtensions, "ts", "tsx"],
moduleNameMapper: {
'^__mocks__/(.*)$': '<rootDir>/../../__mocks__/$1',
+ // This regex should match the packages that we want compiled from source
+ // through `ts-jest`, as opposed to loaded ... |
d7e63e83c3c8f9979d72358d445ae661e6e006f5 | jquery.ziptastic.js | jquery.ziptastic.js | (function( $ ) {
var requests = {};
var zipValid = {
us: /[0-9]{5}(-[0-9]{4})?/
};
$.ziptastic = function(zip, callback){
// Only make unique requests
if(!requests[zip]) {
requests[zip] = $.getJSON('http://zip.elevenbasetwo.com?zip=' + zip);
}
// Bind to the finished request
requests[zip].done(func... | (function( $ ) {
var requests = {};
var zipValid = {
us: /[0-9]{5}(-[0-9]{4})?/
};
$.ziptastic = function(zip, callback){
// Only make unique requests
if(!requests[zip]) {
requests[zip] = $.getJSON('http://zip.elevenbasetwo.com/v2/US/' + zip);
}
// Bind to the finished request
requests[zip].done(fu... | Update to use v2 of API | Update to use v2 of API | JavaScript | mit | daspecster/ziptastic-jquery-plugin,daspecster/ziptastic-jquery-plugin,Ziptastic/ziptastic-jquery-plugin,Ziptastic/ziptastic-jquery-plugin | ---
+++
@@ -7,7 +7,7 @@
$.ziptastic = function(zip, callback){
// Only make unique requests
if(!requests[zip]) {
- requests[zip] = $.getJSON('http://zip.elevenbasetwo.com?zip=' + zip);
+ requests[zip] = $.getJSON('http://zip.elevenbasetwo.com/v2/US/' + zip);
}
// Bind to the finished request |
351d0c628b12356f741db48de27d3e9a5909c638 | test/ec2_elasticache_test.js | test/ec2_elasticache_test.js | 'use strict';
/**
* Attempt to create a template containing an ec2 and elasticache instance.
**/
var Template = require('../lib/Template.js');
var Validator = require('../lib/Validator.js');
exports.testJustEC2 = function(test){
// Set up the template
var t = new Template();
var filePath = '/tmp/minimum... | 'use strict';
/**
* Attempt to create a template containing an elasticache instance.
**/
var Template = require('../lib/Template.js');
var Validator = require('../lib/Validator.js');
exports.testJustEC2 = function(test){
// Create the template
var t = new Template();
var filePath = '/tmp/elasticache_tes... | Remove EC2 instance from the elasticache test | Remove EC2 instance from the elasticache test
| JavaScript | apache-2.0 | owap/scenery,OpenWhere/scenery,OpenWhere/scenery | ---
+++
@@ -1,20 +1,15 @@
'use strict';
/**
- * Attempt to create a template containing an ec2 and elasticache instance.
+ * Attempt to create a template containing an elasticache instance.
**/
var Template = require('../lib/Template.js');
var Validator = require('../lib/Validator.js');
exports.testJustEC2... |
c0237299ffd8ffc3e2b9f7291bf5a490c8bbdf13 | plugins/flipkart.js | plugins/flipkart.js | var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'Flipkart',
prepareImgLinks:function (callback) {
var res = [];
hoverZoom.urlReplace(res,
'img[src*="rukminim1.flixcart.com"]',
/image\/\d+\/\d+/,
'image/500/500'
);
ca... | var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'Flipkart',
version:'2.0',
prepareImgLinks:function (callback) {
var res = [];
/*hoverZoom.urlReplace(res,
'img[src*="rukminim1.flixcart.com"]',
/image\/\d+\/\d+/,
'image/500/500'... | Fix for plug-in : Flipkart | Fix for plug-in : Flipkart
| JavaScript | mit | extesy/hoverzoom,extesy/hoverzoom | ---
+++
@@ -1,13 +1,43 @@
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'Flipkart',
+ version:'2.0',
prepareImgLinks:function (callback) {
var res = [];
- hoverZoom.urlReplace(res,
+
+ /*hoverZoom.urlReplace(res,
'img[src*="rukminim1.fli... |
e8621452fbd78722b480d59fd840fa9f6cd58d7e | test/wwwdude-contentdelivery.js | test/wwwdude-contentdelivery.js | /*!
* unit asserts to ensure delivery of payload within
* HTTP POST/PUT requests works
*
* @author pfleidi
*/
var assert = require('assert');
var Helper = require('./test_helper');
var HttpClient = require('../index');
var client = HttpClient.createClient();
function _assertWithPayload(beforeExit, verb, payload... | /*!
* unit asserts to ensure delivery of payload within
* HTTP POST/PUT requests works
*
* @author pfleidi
*/
var assert = require('assert');
var Helper = require('./test_helper');
var HttpClient = require('../index');
var client = HttpClient.createClient({
parseContent: JSON.parse
});
function _assertWi... | Add test for content parser | Add test for content parser
| JavaScript | mit | pfleidi/node-wwwdude | ---
+++
@@ -9,7 +9,10 @@
var assert = require('assert');
var Helper = require('./test_helper');
var HttpClient = require('../index');
-var client = HttpClient.createClient();
+
+var client = HttpClient.createClient({
+ parseContent: JSON.parse
+ });
function _assertWithPayload(beforeExit, verb, payload) {
... |
ede3d9243edf048a887d0a26472c6b0584fdb45c | src/js/directives/widget-header.js | src/js/directives/widget-header.js | /**
* Widget Header Directive
*/
angular
.module('RDash')
.directive('rdWidgetHeader', rdWidgetTitle);
function rdWidgetTitle() {
var directive = {
requires: '^rdWidget',
scope: {
title: '@',
icon: '@'
},
transclude: true,
template: '<div c... | /**
* Widget Header Directive
*/
angular
.module('RDash')
.directive('rdWidgetHeader', rdWidgetTitle);
function rdWidgetTitle() {
var directive = {
requires: '^rdWidget',
scope: {
title: '@',
icon: '@'
},
transclude: true,
template: '<div c... | Fix Search Box CSS is not Responsive | Fix Search Box CSS is not Responsive
| JavaScript | mit | jasonmelgoza/Responsive-Dashboard,RickyDan/rdash-angular,Shim2k/rdash-angular,saulosaires/fitcook-site,armand1m/wizard-finder-client,jkarpilo/Responsive-Dashboard,zidom/rdash-angular,PsyGik/rdash-angular,cesarmarinhorj/rdash-angular,jvkops/rdash-angular,tbaker0815/upwork_project,boyofgreen/BankOfContoso,ctuwuzida/rdash... | ---
+++
@@ -14,7 +14,7 @@
icon: '@'
},
transclude: true,
- template: '<div class="widget-header"><i class="fa" ng-class="icon"></i> {{title}} <div class="pull-right" ng-transclude></div></div>',
+ template: '<div class="widget-header"><div class="row"><div class="pull-left... |
a62d7ba04262f803afc281e77b938a370fc3964a | src/util/request.js | src/util/request.js | 'use strict';
const http = require('http');
let request = {};
request.get = function(url) {
return new Promise((resolve, reject) => {
let req = http.get(url, (res) => {
if ([400, 401, 03, 404].includes(res.statusCode)) {
reject(new Error(`GET request to ${url} failed, status: ${res.statusCode}`))... | 'use strict';
const http = require('http');
let request = {};
request.get = function(url) {
return new Promise((resolve, reject) => {
let req = http.get(url, (res) => {
if ([400, 401, 403, 404].includes(res.statusCode)) {
reject(new Error(`GET request to ${url} failed, status: ${res.statusCode}`)... | Fix type in client error codes | Fix type in client error codes
| JavaScript | mit | FTLam11/Audio-Station-Scrobbler,FTLam11/Audio-Station-Scrobbler | ---
+++
@@ -7,7 +7,7 @@
request.get = function(url) {
return new Promise((resolve, reject) => {
let req = http.get(url, (res) => {
- if ([400, 401, 03, 404].includes(res.statusCode)) {
+ if ([400, 401, 403, 404].includes(res.statusCode)) {
reject(new Error(`GET request to ${url} failed, st... |
01ea92a0f0bfc53c3fd840ef74e3936442f115be | web/src/reducers/UserReducer.js | web/src/reducers/UserReducer.js | import * as ActionTypes from '../actions/ActionTypes'
function UserReducer(state = [], action) {
switch (action.type) {
case ActionTypes.CREATE_USER_SUCCESS:
return [
...state,
Object.assign({}, action.user),
]
default:
return state
}
}
export default UserReducer
| import * as ActionTypes from '../actions/ActionTypes'
function UserReducer(state = {}, action) {
switch (action.type) {
case ActionTypes.CREATE_USER_SUCCESS:
return {
...state,
...action.user,
}
default:
return state
}
}
export default UserReducer
| Store single user instead of array | Store single user instead of array
| JavaScript | mit | RailsRoading/wissle,RailsRoading/wissle,RailsRoading/wissle | ---
+++
@@ -1,12 +1,12 @@
import * as ActionTypes from '../actions/ActionTypes'
-function UserReducer(state = [], action) {
+function UserReducer(state = {}, action) {
switch (action.type) {
case ActionTypes.CREATE_USER_SUCCESS:
- return [
+ return {
...state,
- Object.assign({}, ... |
758b309a525dbe6952ed7966bd7f8b1af0ba29e0 | app/assets/javascripts/core.js | app/assets/javascripts/core.js | $(document).ready(function() {
$('.print-link a').attr('target', '_blank');
var $searchFocus = $('.js-search-focus');
$searchFocus.each(function(i, el){
if($(el).val() !== ''){
$(el).addClass('focus');
}
});
$searchFocus.on('focus', function(e){
$(e.target).addClass('focus');
});
$searc... | $(document).ready(function() {
$('.print-link a').attr('target', '_blank');
var $searchFocus = $('.js-search-focus');
$searchFocus.each(function(i, el){
if($(el).val() !== ''){
$(el).addClass('focus');
}
});
$searchFocus.on('focus', function(e){
$(e.target).addClass('focus');
});
$searc... | Use SelectionButtons live selector, for JS/AJAX content | Use SelectionButtons live selector, for JS/AJAX content
Some GOV.UK pages, like Smart Answers, load content via JS, including
radio buttons or checkboxes. These will be added to the DOM after the
selector is run and the resulting elements are passed to SelectionButtons
SelectionButtons can also take a string selector... | JavaScript | mit | tadast/static,robinwhittleton/static,robinwhittleton/static,kalleth/static,alphagov/static,tadast/static,robinwhittleton/static,kalleth/static,kalleth/static,tadast/static,tadast/static,alphagov/static,alphagov/static,kalleth/static,robinwhittleton/static | ---
+++
@@ -36,8 +36,8 @@
}
// for radio buttons and checkboxes
- var $buttons = $("label.selectable input[type='radio'], label.selectable input[type='checkbox']");
- new GOVUK.SelectionButtons($buttons);
+ var buttonsSelector = "label.selectable input[type='radio'], label.selectable input[type='checkbox']... |
0e86b9ddde0847b61c9d308eb2eff767954ba646 | app/utils/messageMiddleware.js | app/utils/messageMiddleware.js | import { get } from 'lodash';
import Raven from 'raven-js';
export default function createMessageMiddleware(actionToDispatch) {
return store => next => action => {
const success = action.success && get(action, ['meta', 'successMessage']);
const error = action.error && get(action, ['meta', 'errorMessage']);
... | import { get } from 'lodash';
import Raven from 'raven-js';
const reportToSentry = action =>
__CLIENT__ && Raven.captureException(action.payload);
export default function createMessageMiddleware(actionToDispatch) {
return store => next => action => {
const success = action.success && get(action, ['meta', 'suc... | Fix sentry reporting in SSR | Fix sentry reporting in SSR
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp | ---
+++
@@ -1,5 +1,8 @@
import { get } from 'lodash';
import Raven from 'raven-js';
+
+const reportToSentry = action =>
+ __CLIENT__ && Raven.captureException(action.payload);
export default function createMessageMiddleware(actionToDispatch) {
return store => next => action => {
@@ -11,8 +14,8 @@
let me... |
8c7e9ea3b0871989f9b7592cabf7b57b9e9f5bf6 | test/mpayrollAPI.js | test/mpayrollAPI.js | var chakram = require('chakram'),
expect = chakram.expect;
describe("mPayroll API", function() {
const empRec = {
"name": 'Harry Hourly',
"type": 'H',
"rate": '10.00'
};
it("should have POST employees endpoint", function () {
this.timeout(4000);
expect(chakram.p... | var chakram = require('chakram'),
expect = chakram.expect;
describe("mPayroll API", function() {
const empRec = {
"name": 'Harry Hourly',
"type": 'H',
"rate": '10.00'
};
it("should have POST employees endpoint", function () {
this.timeout(4000);
expect(chakram.p... | ADD - TDD for POST employees endpoint without employee data | ADD - TDD for POST employees endpoint without employee data
| JavaScript | mit | Bill-A/Correctness-DrivenDevelopment | |
85ba445f607735859b4d229ddd4894fe0493d84b | lib/modules/view.js | lib/modules/view.js | export default (shower) => {
const { container } = shower;
const { fullModeClass, listModeClass } = shower.options;
if (container.classList.contains(fullModeClass)) {
shower.enterFullMode();
} else {
container.classList.add(listModeClass);
}
const getScale = () => {
con... | export default (shower) => {
const { container } = shower;
const { fullModeClass, listModeClass } = shower.options;
if (container.classList.contains(fullModeClass)) {
shower.enterFullMode();
} else {
container.classList.add(listModeClass);
}
const getScale = () => {
con... | Remove now unnecessary "load" event listener | Remove now unnecessary "load" event listener
| JavaScript | mit | shower/core | ---
+++
@@ -50,5 +50,4 @@
});
window.addEventListener('resize', updateScale);
- window.addEventListener('load', updateScale);
}; |
882b86ecb23c206d2d772a4249a767b962be4be6 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
... | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
... | Increase coverage base to 100% | Increase coverage base to 100%
| JavaScript | apache-2.0 | xmpp-ftw/xmpp-ftw-http | ---
+++
@@ -24,8 +24,8 @@
coverage: true,
legend: true,
check: {
- lines: 98,
- statements: 99
+ lines: 100,
+ statements: 100
},
... |
909b301ab3ba677210ed6cc0dfc030abad4ecda7 | rootaccountfwd.js | rootaccountfwd.js | // Replace the normal jQuery getScript function with one that supports
// debugging and which references the script files as external resources
// rather than inline.
jQuery.extend({
getScript: function(url, callback) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('... | // Replace the normal jQuery getScript function with one that supports
// debugging and which references the script files as external resources
// rather than inline.
jQuery.extend({
getScript: function(url, callback) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('... | Fix root account forward to correct js file name. | Fix root account forward to correct js file name.
| JavaScript | mit | matematikk-mooc/frontend,matematikk-mooc/frontend | ---
+++
@@ -36,5 +36,5 @@
});
jQuery(document).ready(function($) {
- $.getScript('http://localhost:9000/rootaccount.js');
+ $.getScript('http://localhost:9000/rootaccount-localhost.js');
}); |
a6aa91b0c13bc1c08d0d25224cccddc149dcb677 | routes/ratings.js | routes/ratings.js | var express = require('express');
var router = express.Router();
var ratings = [
{text: 'Good UI! Many alert choices.', stars: 5},
{text: 'Running Great! No crashes', stars: 5}
];
/* GET ratings listing. */
router.get('/', function(req, res, next) {
res.json({
ratings: ratings
});
});
router.post('/', fu... | var express = require('express');
var router = express.Router();
var ratings = [
{text: 'Good UI! Many alert choices.', stars: 5},
{text: 'Running Great! No crashes', stars: 5}
];
/* GET ratings listing. */
router.get('/', function(req, res, next) {
res.json({
ratings: ratings
});
});
router.post('/', fu... | Fix rating route to return proper result and save stars as ints | Fix rating route to return proper result and save stars as ints
| JavaScript | mit | mbuechmann/brownbag-reactjs,mbuechmann/brownbag-reactjs | ---
+++
@@ -16,9 +16,10 @@
router.post('/', function(req, res, next) {
ratings.push({
text: req.body.text,
- stars: req.body.stars
+ stars: parseInt(req.body.stars)
});
- res.sendStatus(201);
+ res.statusCode = 201;
+ res.json({success: true});
});
module.exports = router; |
5967a6e22ec524e477fb8c47463fab64e3a67f0c | lib/smoochApiBot.js | lib/smoochApiBot.js | 'use strict';
const Bot = require('./bot');
class SmoochApiBot extends Bot {
constructor(options) {
super(options);
this.name = options.name;
this.avatarUrl = options.avatarUrl;
}
say(text) {
const api = this.store.getApi();
let message = Object.assign({
... | 'use strict';
const Bot = require('./bot');
class SmoochApiBot extends Bot {
constructor(options) {
super(options);
this.name = options.name;
this.avatarUrl = options.avatarUrl;
}
say(text, actions) {
const api = this.store.getApi();
let message = Object.assign({
... | Add actions argument to say function | Add actions argument to say function
| JavaScript | mit | alavers/smooch-bot | ---
+++
@@ -10,10 +10,11 @@
this.avatarUrl = options.avatarUrl;
}
- say(text) {
+ say(text, actions) {
const api = this.store.getApi();
let message = Object.assign({
text,
+ actions: actions,
role: 'appMaker'
}, {
name:... |
a252c7d19a9149b8c1d9bc0ec4788ae1bb3c6b22 | downloads/updates/version.js | downloads/updates/version.js | {
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"de... | {
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"de... | Enable v1.3.0 on the development channel | Enable v1.3.0 on the development channel | JavaScript | mit | ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io | ---
+++
@@ -12,10 +12,10 @@
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"development": {
- "CSIDE_version": "1.2.1",
+ "CSIDE_version": "1.3.0",
"nw_version": "0.21.4",
- "desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
- "targ... |
721b8290dec1c57c64eed67a9bc7b7a59121fbd3 | JavaScript/object-literals.js | JavaScript/object-literals.js | var Pet = {
init: function (options) {
this.name = options.name
this.born = options.born
this.died = options.died
}
}
var Dog = {
init: function (breed, options) {
Pet.init.call(this, options)
this.breed = breed
},
age: function () {
return (this.died || new Date().getFullYear()) - th... | var Pet = {
init: function (options) {
this.name = options.name
this.born = options.born
this.died = options.died
},
age: function () {
return (this.died || new Date().getFullYear()) - this.born
}
}
var Dog = Object.create(Pet, {
init: {
value: function (breed, options) {
Pet.init.c... | Add object literals in JavaScript | Add object literals in JavaScript
| JavaScript | mit | jsstrn/kata,jsstrn/HackerRank,jsstrn/HackerRank,jsstrn/kata,jsstrn/kata,jsstrn/kata | ---
+++
@@ -3,18 +3,20 @@
this.name = options.name
this.born = options.born
this.died = options.died
- }
-}
-
-var Dog = {
- init: function (breed, options) {
- Pet.init.call(this, options)
- this.breed = breed
},
age: function () {
return (this.died || new Date().getFullYear()) - th... |
999027f424c8ad4c51b5f648fa3f1128f41220dd | static/script/user/view.js | static/script/user/view.js | $( document ).ready( function() {
function showUploadedImage( source ) {
$( "#userImage" ).attr( "src", source );
}
$( "#image-form" ).submit( function() {
var image = document.getElementById( "image" ).files[ 0 ];
var token = $( "input[type=hidden]" ).val();
var formdata = n... | $( document ).ready( function() {
function showUploadedImage( source ) {
$( "#userImage" ).attr( "src", source );
}
$( "#image-form" ).submit( function() {
var image = document.getElementById( "image" ).files[ 0 ];
if ( !image ) {
$( '#image-form' ).prepend( "<div class='... | Check if it is not an image | Check if it is not an image
| JavaScript | mit | VitSalis/endofcodes,dionyziz/endofcodes,dionyziz/endofcodes,VitSalis/endofcodes,VitSalis/endofcodes,dionyziz/endofcodes,VitSalis/endofcodes | ---
+++
@@ -4,6 +4,10 @@
}
$( "#image-form" ).submit( function() {
var image = document.getElementById( "image" ).files[ 0 ];
+ if ( !image ) {
+ $( '#image-form' ).prepend( "<div class='alert alert-danger'>This isn't an image</div>" )
+ return false;
+ }
... |
e04b74c6201a02b09ee2cfc86fe3cbb2bad500bb | examples/react/stories/index.js | examples/react/stories/index.js | import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button, Welcome } from '@storybook/react/demo';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button... | import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button, Welcome } from '@storybook/react/demo';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button... | Revert react button story to English | Revert react button story to English
| JavaScript | mit | oblador/loki,oblador/loki,oblador/loki | ---
+++
@@ -9,5 +9,5 @@
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);
storiesOf('Button', module)
- .add('with text', () => <Button onClick={action('clicked')}>Hej Button</Button>)
+ .add('with text', () => <Button onClick={action('clicked')}>Hello Button</Butto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.