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 |
|---|---|---|---|---|---|---|---|---|---|---|
cb0c64af73d5b4902b84aecb9a27416429ec1d7a | app/import.js | app/import.js | #!/usr/bin/env node
/**
* Parse and insert all log lines in a path.
*/
'use strict';
var program = require('commander');
// Support all attributes normally defined by config.js.
program
.option('-p, --parser <name>', 'Ex. nginx_access')
.option('-P, --path <file>', 'Ex. /var/log/nginx/access.log')
.option('... | #!/usr/bin/env node
/**
* Parse and insert all log lines in a path.
*/
'use strict';
var program = require('commander');
var splitCsv = function(list) {
return list.split(',');
}
// Support all attributes normally defined by config.js.
program
.option('-p, --parser <name>', 'Ex. nginx_access')
.option('-P,... | Allow comma-separated values for --previewAttr. | Allow comma-separated values for --previewAttr.
| JavaScript | mit | codeactual/mainevent | ---
+++
@@ -8,13 +8,17 @@
var program = require('commander');
+var splitCsv = function(list) {
+ return list.split(',');
+}
+
// Support all attributes normally defined by config.js.
program
.option('-p, --parser <name>', 'Ex. nginx_access')
.option('-P, --path <file>', 'Ex. /var/log/nginx/access.log')
... |
e8e00d643a4c124e87887dfdeb2596ac88285a07 | src/helpers/buildProps.js | src/helpers/buildProps.js | import {Map} from 'immutable';
export default function buildProps(propsDefinition, allProps = false) {
const props = {}
Map(propsDefinition).map((data, prop) => {
if (data.defaultValue)
props[prop] = data.defaultValue.computed
? data.defaultValue.value
: eval(`(${data.defaultValue.value}... | import {Map} from 'immutable';
export default function buildProps(propsDefinition, allProps = false) {
const props = {}
Map(propsDefinition).map((data, prop) => {
if (data.defaultValue)
props[prop] = data.defaultValue.computed
? data.defaultValue.value
: eval(`(${data.defaultValue.value}... | Add some defaults for prop types | Add some defaults for prop types
| JavaScript | mit | blueberryapps/react-bluekit,blueberryapps/react-bluekit,blueberryapps/react-bluekit,kjg531/react-bluekit,kjg531/react-bluekit | ---
+++
@@ -17,11 +17,13 @@
function calculateProp(type, prop) {
switch (type.name) {
- case 'any': return 'Default ANY'
- case 'node': return 'Default NODE'
- case 'string': return `Default string ${prop}`
+ case 'any': return `ANY ${prop}`
+ case 'node': return `NODE ${prop}`
+ cas... |
2c7c6eb77676ce869d788cba91147ba40af45745 | WebApp/controllers/index.js | WebApp/controllers/index.js | 'use strict';
var passport = require('passport');
module.exports = function (router) {
router.get('/', function (req, res) {
res.render('index');
});
router.post('/signup', passport.authenticate('local', {
successRedirect : '/home', // redirect to the secure profile se... | 'use strict';
var passport = require('passport');
module.exports = function (router) {
router.get('/', function (req, res) {
res.render('index');
});
router.post('/signup', passport.authenticate('local', {
successRedirect : '/home', // redirect to the secure home section
... | Add logout rout logic and 404 catch route. | Add logout rout logic and 404 catch route.
| JavaScript | mit | uahengojr/NCA-Web-App,uahengojr/NCA-Web-App | ---
+++
@@ -10,21 +10,27 @@
});
-
-
router.post('/signup', passport.authenticate('local', {
- successRedirect : '/home', // redirect to the secure profile section
+ successRedirect : '/home', // redirect to the secure home section
failureRedirect : '/', // redirect back to ... |
4eff36df241f9de8abca1bf5bc5871625b204d48 | src/forwarded.js | src/forwarded.js | import { Namespace as NS } from 'xmpp-constants';
export default function (JXT) {
let Forwarded = JXT.define({
name: 'forwarded',
namespace: NS.FORWARD_0,
element: 'forwarded'
});
JXT.extendIQ(Forwarded);
JXT.extendPresence(Forwarded);
JXT.withMessage(function (Message)... | import { Namespace as NS } from 'xmpp-constants';
export default function (JXT) {
let Forwarded = JXT.define({
name: 'forwarded',
namespace: NS.FORWARD_0,
element: 'forwarded'
});
JXT.withMessage(function (Message) {
JXT.extend(Message, Forwarded);
JXT.extend(Fo... | Allow presence and iq stanzas in forwards | Allow presence and iq stanzas in forwards
| JavaScript | mit | otalk/jxt-xmpp | ---
+++
@@ -10,13 +10,22 @@
});
- JXT.extendIQ(Forwarded);
- JXT.extendPresence(Forwarded);
-
JXT.withMessage(function (Message) {
JXT.extend(Message, Forwarded);
JXT.extend(Forwarded, Message);
+ });
+
+ JXT.withPresence(function (Presence) {
+
+ JXT.extend(Presen... |
ed4aee982efbe639586bb894a7a2a0b06f221c20 | routes/login.js | routes/login.js | var express = require('express');
var router = express.Router();
const passport = require('passport')
const FacebookStrategy = require('passport-facebook').Strategy
passport.use(new FacebookStrategy({
clientID: 'fsddf',
clientSecret: 'FACEBOOK_APP_SECRET',
callbackURL: "https://age-guess-api.herokuapp.co... | var express = require('express');
var router = express.Router();
require('dotenv').config()
const passport = require('passport')
const FacebookStrategy = require('passport-facebook').Strategy
passport.use(new FacebookStrategy({
clientID: process.env.APP_ID,
clientSecret: process.env.APP_SECRET,
callbackU... | Add routing for facebook auth | Add routing for facebook auth
| JavaScript | mit | michael-lowe-nz/ageGuessAPI,michael-lowe-nz/ageGuessAPI | ---
+++
@@ -1,12 +1,13 @@
var express = require('express');
var router = express.Router();
+require('dotenv').config()
const passport = require('passport')
const FacebookStrategy = require('passport-facebook').Strategy
passport.use(new FacebookStrategy({
- clientID: 'fsddf',
- clientSecret: 'FACEBOOK_... |
8523b2a9d123b77d5003434e42fa877b718a9b3c | api/policies/isGuacamole.js | api/policies/isGuacamole.js | /**
* Nanocloud turns any traditional software into a cloud solution, without
* changing or redeveloping existing source code.
*
* Copyright (C) 2016 Nanocloud Software
*
* This file is part of Nanocloud.
*
* Nanocloud is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affe... | /**
* Nanocloud turns any traditional software into a cloud solution, without
* changing or redeveloping existing source code.
*
* Copyright (C) 2016 Nanocloud Software
*
* This file is part of Nanocloud.
*
* Nanocloud is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affe... | Fix history and scale down not working in production mode | Fix history and scale down not working in production mode
In dev mode guacamole-client targets localhost:1337 for the backend
In production mode guacamole-client targets backend:1337 for the backend
Update isGuacamole policy to take the production setup into account
| JavaScript | agpl-3.0 | romain-ortega/nanocloud,Gentux/nanocloud,corentindrouet/nanocloud,corentindrouet/nanocloud,dynamiccast/nanocloud,Leblantoine/nanocloud,dynamiccast/nanocloud,romain-ortega/nanocloud,Nanocloud/nanocloud,Nanocloud/nanocloud,romain-ortega/nanocloud,Leblantoine/nanocloud,Nanocloud/nanocloud,Leblantoine/nanocloud,Gentux/nano... | ---
+++
@@ -23,12 +23,14 @@
/*
* Pass to next middleware only if incoming request comes from Guacamole
* For now we consider a request to originate from Guacamole if req.host is set to
- * "localhost:1337" which is the case for guacamole because it directly targets
+ * "localhost:1337" or "backend:1337" which is... |
67b587bd6fd5d91c6bb3930cdcdb288a2c4fd073 | packages/core/strapi/lib/commands/routes/list.js | packages/core/strapi/lib/commands/routes/list.js | 'use strict';
const CLITable = require('cli-table3');
const chalk = require('chalk');
const { toUpper } = require('lodash/fp');
const strapi = require('../../index');
module.exports = async function() {
const app = await strapi().load();
const list = app.server.listRoutes();
const infoTable = new CLITable({
... | 'use strict';
const CLITable = require('cli-table3');
const chalk = require('chalk');
const { toUpper } = require('lodash/fp');
const strapi = require('../../index');
module.exports = async function() {
const app = await strapi().load();
const list = app.server.listRoutes();
const infoTable = new CLITable({
... | Make right column width flexible | Make right column width flexible
| JavaScript | mit | wistityhq/strapi,wistityhq/strapi | ---
+++
@@ -13,7 +13,7 @@
const infoTable = new CLITable({
head: [chalk.blue('Method'), chalk.blue('Path')],
- colWidths: [20, 80],
+ colWidths: [20],
});
list |
8a9ea980ca9e18c2b7760f7927836dd265a3a07f | lib/collections/checkID.js | lib/collections/checkID.js | Meteor.methods({
checkHKID: function (hkid) {
var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/; // HKID format = 1 or 2 letters followed by 6 numbers and 1 checksum digit.
var matchArray = hkid.match(hkidPat);
if(matchArray == null){idError()}
var checkSum = 0;
var charPart =... | Meteor.methods({
checkHKID: function (hkid) {
var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/; // HKID format = 1 or 2 letters followed by 6 numbers and 1 checksum digit.
var matchArray = hkid.match(hkidPat);
if(matchArray == null){idError()}
var checkSum = 0;
var charPart =... | Fix minor error with HKID verification | Fix minor error with HKID verification
| JavaScript | agpl-3.0 | gazhayes/Popvote-HK,gazhayes/Popvote-HK | ---
+++
@@ -21,6 +21,7 @@
var remaining = checkSum % 11;
var checkNumber = 11 - remaining;
if(checkDigit == checkNumber) {return("valid")}
+ else {idError()}
function idError () {
throw new Meteor.Error('invalid', 'The HKID entered is invalid')
} |
959840f4da79f68cc67b4a994c1b0fed5e5fc217 | spec/gateway-spec.js | spec/gateway-spec.js | "use babel";
import gateway from "../lib/gateway";
describe("Gateway", () => {
describe("packagePath", () => {
it("returns path of package installation", () => {
expect(gateway.packagePath()).toContain("exfmt-atom");
});
});
describe("shouldUseLocalExfmt", () => {
it("returns true when exfmtD... | "use babel";
import gateway from "../lib/gateway";
import path from "path";
import process from "child_process";
describe("Gateway", () => {
describe("packagePath", () => {
it("returns path of package installation", () => {
expect(gateway.packagePath()).toContain("exfmt-atom");
});
});
describe("... | Add spec tests for gateway run functions | Add spec tests for gateway run functions
| JavaScript | mit | rgreenjr/exfmt-atom | ---
+++
@@ -1,11 +1,41 @@
"use babel";
import gateway from "../lib/gateway";
+import path from "path";
+import process from "child_process";
describe("Gateway", () => {
describe("packagePath", () => {
it("returns path of package installation", () => {
expect(gateway.packagePath()).toContain("exf... |
32dd109b7df05ee3b687baed65381fe1c64da1c2 | js/home-nav.js | js/home-nav.js | var navOffset = function () {
$('#content.container').css('margin-top', $('#nav').height() * 0.25);
};
var collapsedMenus = function() {
$('#nav button.navbar-toggle').on('click', function() {
if ($(this).hasClass('collapsed')) {
var collapsedMenuHeight = 323.5;
collapseOffset('#nav', collapsedMenuHei... | var navOffset = function () {
$('#content.container').css('margin-top', $('#nav').height() * 0.25);
};
var collapsedMenus = function() {
$('#nav button.navbar-toggle').on('click', function() {
if ($(this).hasClass('collapsed') &&
!$($(this).data('target')).hasClass('collapsing')) {
var collapsedMenuHe... | Fix wrong auto-scrolling when opening the menu. | Fix wrong auto-scrolling when opening the menu.
Fixed page scrolling down when main menu is closing.
Fixed incorrect logic for scrolling on submenu ("More") scrolling.
JQuery.not() is a filter/selector, not a class detector.
| JavaScript | mit | HackNC/fall2015,newmane/PearlHacks17,HackNC/fall2015,newmane/PearlHacks17,madipfaff/PearlHacks16,madipfaff/PearlHacks16 | ---
+++
@@ -4,14 +4,15 @@
var collapsedMenus = function() {
$('#nav button.navbar-toggle').on('click', function() {
- if ($(this).hasClass('collapsed')) {
+ if ($(this).hasClass('collapsed') &&
+ !$($(this).data('target')).hasClass('collapsing')) {
var collapsedMenuHeight = 323.5;
collapseOf... |
2dc52dbbc4f0e01c6f6cd898b2f57f09430675c8 | js/sideshow.js | js/sideshow.js | var sideshow = function () {
function hasClass (elem, cls) {
var names = elem.className.split(" ");
for (var i = 0; i < names; i++) {
if (cls == names[i])
return true;
}
return false;
}
function addClass (elem, cls) {
if (!hasClass(elem, c... | var sideshow = function () {
function hasClass (elem, cls) {
var names = elem.className.split(" ");
for (var i = 0; i < names; i++) {
if (cls == names[i])
return true;
}
return false;
}
function addClass (elem, cls) {
var names = elem.clas... | Make addClass implementation symmetric with removeClass. | Make addClass implementation symmetric with removeClass.
| JavaScript | isc | whilp/sideshow | ---
+++
@@ -9,8 +9,13 @@
}
function addClass (elem, cls) {
- if (!hasClass(elem, cls))
- elem.className += " " + cls;
+ var names = elem.className.split(" ");
+ for (var i = 0; i < names.length; i++) {
+ if (names[i] == cls)
+ return;
+ }
+ ... |
057829f108dc1fe04369feeb95deb794adbf154a | Cloudy/cloudy.js | Cloudy/cloudy.js | var Cloudy = {
isPlayerPage: function() {
return $("#audioplayer").length == 1;
},
sendEpisodeToCloudy: function() {
var episodeTitle = $(".titlestack .title").text();
var showTitle = $(".titlestack .caption2").text();
var details = {
"show_title": showTitle,
... | var Cloudy = {
isPlayerPage: function() {
return $("#audioplayer").length == 1;
},
sendEpisodeToCloudy: function() {
var episodeTitle = $(".titlestack .title").text();
var showTitle = $(".titlestack .caption2").text();
var details = {
"show_title": showTitle,
... | Use JavaScript to intercept space bar event. | Use JavaScript to intercept space bar event. | JavaScript | mit | calebd/cloudy,calebd/cloudy | ---
+++
@@ -36,12 +36,22 @@
togglePlaybackState: function() {
var player = $("#audioplayer")[0];
player.paused ? player.play() : player.pause();
+ },
+
+ installSpaceHandler: function() {
+ $(window).keypress(function(event) {
+ if (event.keyCode == 32) {
+ ... |
e009e13d0175d933542f2230c220067e2f29f093 | lib/handlers/tar-stream.js | lib/handlers/tar-stream.js | /*
* tar-stream.js: Checkout adapter for a tar stream.
*
* (C) 2012 Bradley Meck.
* MIT LICENSE
*
*/
var tar = require('tar');
//
// ### function download (source, callback)
// #### @source {Object} Source checkout options
// #### @callback {function} Continuation to respond to.
// Downloads the tar stream to t... | /*
* tar-stream.js: Checkout adapter for a tar stream.
*
* (C) 2012 Bradley Meck.
* MIT LICENSE
*
*/
var zlib = require('zlib'),
tar = require('tar');
//
// ### function download (source, callback)
// #### @source {Object} Source checkout options
// #### @callback {function} Continuation to respond to.
// D... | Allow for optional gzip encoding. | [api] Allow for optional gzip encoding.
| JavaScript | mit | indexzero/node-checkout | ---
+++
@@ -6,7 +6,8 @@
*
*/
-var tar = require('tar');
+var zlib = require('zlib'),
+ tar = require('tar');
//
// ### function download (source, callback)
@@ -27,6 +28,12 @@
}
}
+ if (source.gzip) {
+ source.stream = source.stream
+ .on('error', finish)
+ .pipe(zlib.createGunzip(... |
cb27231417aac868e459ed8bc4792ac69f51220f | lib/helpers/prepareView.js | lib/helpers/prepareView.js | /*jslint node: true, nomen: true, white: true, unparam: true, todo: true*/
/*!
* Sitegear3
* Copyright(c) 2014 Ben New, Sitegear.org
* MIT Licensed
*/
(function (_, path, fs) {
"use strict";
module.exports = function (app, dirname) {
dirname = dirname || path.join(__dirname, '..', 'viewHelpers');
return fun... | /*jslint node: true, nomen: true, white: true, unparam: true, todo: true*/
/*!
* Sitegear3
* Copyright(c) 2014 Ben New, Sitegear.org
* MIT Licensed
*/
(function (_, path, fs) {
"use strict";
module.exports = function (app, dirname) {
dirname = dirname || path.join(__dirname, '..', 'viewHelpers');
return fun... | Handle error in readdir() callback. | Handle error in readdir() callback.
| JavaScript | mit | sitegear/sitegear3 | ---
+++
@@ -16,14 +16,13 @@
app.locals.now = new Date();
fs.readdir(dirname, function (error, filenames) {
- // TODO Handle error
_.each(filenames, function (filename) {
if (/\.js$/.test(filename)) {
var name = path.basename(filename, '.js');
app.locals[name] = require('../viewHe... |
6289c7bf271efb6f418904de6fbd46a646e7d86e | vendor/ember-cli-qunit/qunit-configuration.js | vendor/ember-cli-qunit/qunit-configuration.js | /* globals jQuery,QUnit */
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
QUnit.config.urlConfig.push({ id: 'nojshint', label: 'Disable JSHint'});
QUnit.config.urlConfig.push({ id: 'doccontainer', label: 'Doc test pane'});
QUnit.config.testTimeout = 60000; //Default Test Timeout 60 Seconds... | /* globals jQuery,QUnit */
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
QUnit.config.urlConfig.push({ id: 'nojshint', label: 'Disable JSHint'});
QUnit.config.urlConfig.push({ id: 'doccontainer', label: 'Dock test pane'});
QUnit.config.testTimeout = 60000; //Default Test Timeout 60 Second... | Correct "Doc test pane" to "Dock test pane" | Correct "Doc test pane" to "Dock test pane"
This PR so far only changes the string displayed in the UI. The rest of the code still refers to this option as `doccontainer`. Should all these instances also be changed to `dockcontainer`?
As an aside, it seems to be called a container in one option ("Hide container") b... | JavaScript | mit | blimmer/ember-cli-qunit,nathanhammond/ember-cli-qunit,ember-cli/ember-cli-qunit,ember-cli/ember-cli-qunit,nathanhammond/ember-cli-qunit,zenefits/ember-cli-qunit,blimmer/ember-cli-qunit,zenefits/ember-cli-qunit | ---
+++
@@ -2,7 +2,7 @@
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
QUnit.config.urlConfig.push({ id: 'nojshint', label: 'Disable JSHint'});
-QUnit.config.urlConfig.push({ id: 'doccontainer', label: 'Doc test pane'});
+QUnit.config.urlConfig.push({ id: 'doccontainer', label: 'Dock ... |
fbbf41efcba79d61feadb9307f1a4a35c65c405b | ecplurkbot.js | ecplurkbot.js | var log4js = require('log4js');
var PlurkClient = require('plurk').PlurkClient;
var nconf = require('nconf');
nconf.file('config', __dirname + '/config/config.json')
.file('keywords', __dirname + '/config/keywords.json');
var logging = nconf.get('log').logging;
var log_path = nconf.get('log').log_path;
if (logging)... | var log4js = require('log4js');
var PlurkClient = require('plurk').PlurkClient;
var nconf = require('nconf');
nconf.file('config', __dirname + '/config/config.json')
.file('keywords', __dirname + '/config/keywords.json');
var logging = nconf.get('log').logging;
var log_path = nconf.get('log').log_path;
if (logging) ... | Rewrite with using startComet function of plurk modules | Rewrite with using startComet function of plurk modules
| JavaScript | apache-2.0 | dollars0427/ecplurkbot | ---
+++
@@ -1,7 +1,6 @@
var log4js = require('log4js');
var PlurkClient = require('plurk').PlurkClient;
var nconf = require('nconf');
-
nconf.file('config', __dirname + '/config/config.json')
.file('keywords', __dirname + '/config/keywords.json');
@@ -14,8 +13,22 @@
log4js.addAppender(log4js.appenders.file(... |
021d3d985bb6a9965bd69a81897b0bc712578f36 | src/app/api/utils.js | src/app/api/utils.js | import notp from 'notp'
import b32 from 'thirty-two'
export function cleanKey (key) {
return key.replace(/[^a-z2-7]+/g, '').slice(0, 32)
}
export function isValidKey (key) {
return /^[a-z2-7]{32}$/.test(cleanKey(key))
}
export function getCode (key) {
return notp.totp.gen(b32.decode(cleanKey(key)), {})
}
| import notp from 'notp'
import b32 from 'thirty-two'
export function cleanKey (key) {
return key.replace(/[^a-z2-7]+/ig, '').toLowerCase()
}
export function isValidKey (key) {
return /^[a-z2-7]+$/.test(cleanKey(key))
}
export function getCode (key) {
return notp.totp.gen(b32.decode(cleanKey(key)), {})
}
| Support for larger kind of key | fix: Support for larger kind of key
| JavaScript | mit | nodys/basicotp,nodys/basicotp,nodys/basicotp | ---
+++
@@ -2,11 +2,11 @@
import b32 from 'thirty-two'
export function cleanKey (key) {
- return key.replace(/[^a-z2-7]+/g, '').slice(0, 32)
+ return key.replace(/[^a-z2-7]+/ig, '').toLowerCase()
}
export function isValidKey (key) {
- return /^[a-z2-7]{32}$/.test(cleanKey(key))
+ return /^[a-z2-7]+$/.test... |
ae4e515cffdb87ca856a50f15c7a01b5605b93e4 | migrations/20200422122956_multi_homefeeds.js | migrations/20200422122956_multi_homefeeds.js | export async function up(knex) {
await knex.schema
.raw('alter table feeds add column title text')
.raw('alter table feeds add column ord integer')
.raw(`alter table feeds drop constraint feeds_unique_feed_names`)
// Only RiverOfNews feeds can have non-NULL ord or title
.raw(`alter table feeds add... | export const up = (knex) => knex.schema.raw(`do $$begin
-- FEEDS TABLE
alter table feeds add column title text;
alter table feeds add column ord integer;
alter table feeds drop constraint feeds_unique_feed_names;
-- Only RiverOfNews feeds can have non-NULL ord or title
alter table feeds add constraint feed... | Add a homefeed_subscriptions database table | Add a homefeed_subscriptions database table
| JavaScript | mit | FreeFeed/freefeed-server,FreeFeed/freefeed-server | ---
+++
@@ -1,23 +1,45 @@
-export async function up(knex) {
- await knex.schema
- .raw('alter table feeds add column title text')
- .raw('alter table feeds add column ord integer')
- .raw(`alter table feeds drop constraint feeds_unique_feed_names`)
- // Only RiverOfNews feeds can have non-NULL ord or tit... |
e4912f3076fda14ebfe50250e2061447db1b6281 | lib/bggCollectionParser.js | lib/bggCollectionParser.js | module.exports = {
"parseResults": function(result) {
var xmlItems = result.items && result.items.item;
var items = [];
if (xmlItems) {
for (var i = 0; i < xmlItems.length; i++) {
var game = xmlItems[i];
items.push({
"subtype": game.$.subtype,
"objectid": game.$.... | module.exports = {
"parseResults": function(result) {
var xmlItems = result.items && result.items.item;
var items = [];
if (xmlItems) {
for (var i = 0; i < xmlItems.length; i++) {
var game = xmlItems[i];
items.push({
"subtype": game.$.subtype,
"objectid": game.$.... | Fix bad error checking - caused name/image/thumbnail to be arrays | Fix bad error checking - caused name/image/thumbnail to be arrays
| JavaScript | apache-2.0 | thealah/bgg,thealah/bgg | ---
+++
@@ -10,9 +10,9 @@
"subtype": game.$.subtype,
"objectid": game.$.objectid,
"collid": game.$.collid,
- "name": game.name || game.name[0]._,
- "image": game.image || game.image[0],
- "thumbnail": game.thumbnail || game.thumbnail[0]
+ "name": ga... |
895a59456addea4b43cf283ab9668747a615e392 | test/data-structures/testDoublyLinkedList.js | test/data-structures/testDoublyLinkedList.js | /* eslint-env mocha */
const DoublyLinkedList = require('../../src').DataStructures.DoublyLinkedList;
const assert = require('assert');
describe('DoublyLinkedList', () => {
it('should be empty when initialized', () => {
const inst = new DoublyLinkedList();
assert(inst.isEmpty());
assert.equal(inst.length... | /* eslint-env mocha */
const DoublyLinkedList = require('../../src').DataStructures.DoublyLinkedList;
const assert = require('assert');
describe('DoublyLinkedList', () => {
it('should be empty when initialized', () => {
const inst = new DoublyLinkedList();
assert(inst.isEmpty());
assert.equal(inst.length... | Test push to the front of the list | DoublyLinkedList: Test push to the front of the list
| JavaScript | mit | ManrajGrover/algorithms-js | ---
+++
@@ -8,4 +8,17 @@
assert(inst.isEmpty());
assert.equal(inst.length, 0);
});
+
+ it('should push node to the front', () => {
+ const inst = new DoublyLinkedList();
+ assert(inst.isEmpty());
+
+ inst.push(1);
+ assert.equal(inst.length, 1);
+
+ inst.push(2);
+ assert.equal(inst.le... |
7aa46cae7e352fb1bfb6b2453a66e2f58c4f93aa | assets/page/___page___/js/script.___page___.js | assets/page/___page___/js/script.___page___.js | 'use strict';
/*
* Use for Async operations before displaying page
*
module.exports.prepare = function() {
this.done({});
};
*/
/*
* Compute Vue parameters
*
module.exports.vue = function() {
return {};
};
*/
/*
* Use as page starting point
*
module.exports.start = function() {
};
*/
| 'use strict';
/*
* Use for Async operations before displaying page
*
module.exports.prepare = function() {
this.done({});
};
*/
/*
* Compute Vue parameters
*
module.exports.vue = function() {
return {};
};
* or
module.exports.vue = {
};
*/
/*
* Use as page starting point
*
module.exports.start = function... | Update Layout assets to latest specifications | feat: Update Layout assets to latest specifications
| JavaScript | mit | quasarframework/quasar-cli,rstoenescu/quasar-cli | ---
+++
@@ -14,6 +14,9 @@
module.exports.vue = function() {
return {};
};
+ * or
+module.exports.vue = {
+};
*/
/* |
7a13ef409b8251619771bd1f61a941da522d8830 | assets/js/components/SpinnerButton.stories.js | assets/js/components/SpinnerButton.stories.js | /**
* Site Kit by Google, Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | /**
* Site Kit by Google, Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | Fix vrt scenario script issue. | Fix vrt scenario script issue.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | ---
+++
@@ -25,9 +25,7 @@
DefaultButton.storyName = 'Default Button';
DefaultButton.args = {
children: 'Default Button',
- onClick() {
- return new Promise( ( resolve ) => setTimeout( resolve, 5000 ) );
- },
+ onClick: () => new Promise( ( resolve ) => setTimeout( resolve, 5000 ) ),
};
export default { |
f55caf4ed86b4c23e4cb4b5c1f789ac6db28ab64 | rollup/rollup.umd.config.js | rollup/rollup.umd.config.js | import babel from 'rollup-plugin-babel';
import mergeBaseConfig from './rollup.merge-base-config.js';
const cjsConfig = {
format: 'umd',
moduleName: 'knockoutStore',
plugins: [
babel({
exclude: 'node_modules/**'
})
],
dest: 'dist/knockout-store.js'
};
const finalConfig ... | import babel from 'rollup-plugin-babel';
import mergeBaseConfig from './rollup.merge-base-config.js';
const cjsConfig = {
format: 'umd',
moduleName: 'ko.store',
plugins: [
babel({
exclude: 'node_modules/**'
})
],
dest: 'dist/knockout-store.js'
};
const finalConfig = mer... | Change umd module name to ko.store. | Change umd module name to ko.store.
| JavaScript | mit | Spreetail/knockout-store | ---
+++
@@ -3,7 +3,7 @@
const cjsConfig = {
format: 'umd',
- moduleName: 'knockoutStore',
+ moduleName: 'ko.store',
plugins: [
babel({
exclude: 'node_modules/**' |
86ce4f25d552c9b3538339c53b61abaf1faf860f | test/specs/elements/Segment/Segments-test.js | test/specs/elements/Segment/Segments-test.js | import React from 'react';
import {Segment, Segments} from 'stardust';
describe('Segments', () => {
it('should render children', () => {
const [segmentOne, segmentTwo] = render(
<Segments>
<Segment>Top</Segment>
<Segment>Bottom</Segment>
</Segments>
).scryClass('sd-segment');
... | import React from 'react';
import {Segment, Segments} from 'stardust';
describe('Segments', () => {
it('should render children', () => {
const [segmentOne, segmentTwo] = render(
<Segments>
<Segment>Top</Segment>
<Segment>Bottom</Segment>
</Segments>
).scryClass('sd-segment');
... | Make use of chai's lengthOf assertion and simplify test | Make use of chai's lengthOf assertion and simplify test
| JavaScript | mit | Semantic-Org/Semantic-UI-React,jamiehill/stardust,vageeshb/Semantic-UI-React,Semantic-Org/Semantic-UI-React,jcarbo/stardust,ben174/Semantic-UI-React,mohammed88/Semantic-UI-React,clemensw/stardust,koenvg/Semantic-UI-React,aabustamante/Semantic-UI-React,ben174/Semantic-UI-React,Rohanhacker/Semantic-UI-React,koenvg/Semant... | ---
+++
@@ -19,16 +19,14 @@
});
it('renders expected number of children', () => {
- const [component] = render(
+ render(
<Segments>
<Segment>Top</Segment>
<Segment>Middle</Segment>
<Segment>Bottom</Segment>
</Segments>
- ).scryClass('sd-segments');
-
- exp... |
da023a20791530444e6475e905349881c2267972 | app/js/arethusa.context_menu/directives/plugin_context_menu.js | app/js/arethusa.context_menu/directives/plugin_context_menu.js | 'use strict';
angular.module('arethusa.contextMenu').directive('pluginContextMenu', function () {
return {
restrict: 'E',
scope: true,
replace: true,
link: function (scope, element, attrs) {
scope.plugin = scope.$eval(attrs.name);
},
template: ' <div id="{{ plugin.name }}-context-me... | 'use strict';
angular.module('arethusa.contextMenu').directive('pluginContextMenu', function () {
return {
restrict: 'E',
scope: true,
replace: true,
link: function (scope, element, attrs) {
scope.plugin = scope.$eval(attrs.name);
},
template: '\
<div id="{{ plugin.name }}-context-... | Fix multiline string in pluginContextMenu template | Fix multiline string in pluginContextMenu template
| JavaScript | mit | PonteIneptique/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,latin-language-toolkit/arethusa,Masoumeh/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa | ---
+++
@@ -7,6 +7,10 @@
link: function (scope, element, attrs) {
scope.plugin = scope.$eval(attrs.name);
},
- template: ' <div id="{{ plugin.name }}-context-menu" ng-include="plugin.contextMenuTemplate"> </div> '
+ template: '\
+ <div id="{{ plugin.name }}-context-men... |
3fcff5769179d8b784f10206d8de1c7184843a11 | background.js | background.js | (function() {
'use strict';
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
innerBounds: {
width: 960,
height: 600
},
state: 'maximized'
});
});
}());
| (function() {
'use strict';
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
innerBounds: {
width: 960,
height: 600,
minWidth: 960,
minHeight: 600
},
state: 'maximized'
});
});
}());
| Add minWidth/Height to Chrome app | Add minWidth/Height to Chrome app
| JavaScript | mit | nathan/pixie,nathan/pixie,videophonegeek/pixie,videophonegeek/pixie | ---
+++
@@ -5,7 +5,9 @@
chrome.app.window.create('index.html', {
innerBounds: {
width: 960,
- height: 600
+ height: 600,
+ minWidth: 960,
+ minHeight: 600
},
state: 'maximized'
}); |
113b5c54802d572ed6d72d7380f5c28dc58760b3 | background.js | background.js | (function(window){
window.ITCheck = window.ITCheck || {};
// Get things rolling
chrome.alarms.onAlarm.addListener(ITCheck.getUnreadThreadCount);
chrome.runtime.onStartup.addListener(function () {
chrome.alarms.create("updater", { "periodInMinutes": 1 });
});
chrome.runtime.onInstalled.addListener(function(deta... | (function(window){
window.ITCheck = window.ITCheck || {};
// Get things rolling
chrome.alarms.onAlarm.addListener(ITCheck.getUnreadThreadCount);
chrome.runtime.onStartup.addListener(function () {
chrome.alarms.create("updater", { "periodInMinutes": 1 });
});
chrome.runtime.onInstalled.addListener(function(deta... | Fix error with navigating to new page | Fix error with navigating to new page
| JavaScript | mit | CodyJung/itcheck,CodyJung/itcheck | ---
+++
@@ -12,6 +12,6 @@
// Update number on navigate to a new thread
chrome.webNavigation.onCompleted.addListener(function (details) {
- getUnreadThreads(null);
+ ITCheck.getUnreadThreadCount(null);
},{url: [{hostSuffix: 'ivorytower.com', pathPrefix: '/IvoryTower/ForumThread.aspx'}]});
})(window); |
36313a2f3350a8af341ca8b427b851b7697d1657 | models/core/AbuseReport.js | models/core/AbuseReport.js | // Abuse reports
//
'use strict';
const Mongoose = require('mongoose');
const Schema = Mongoose.Schema;
module.exports = function (N, collectionName) {
let AbuseReport = new Schema({
// _id of reported content
src_id: Schema.ObjectId,
// Content type (FORUM_POST, BLOG_ENTRY, ...)
type... | // Abuse reports
//
'use strict';
const Mongoose = require('mongoose');
const Schema = Mongoose.Schema;
module.exports = function (N, collectionName) {
let AbuseReport = new Schema({
// _id of reported content
src_id: Schema.ObjectId,
// Content type (FORUM_POST, BLOG_ENTRY, ...)
type... | Add parser options to abuse reports | Add parser options to abuse reports
| JavaScript | mit | nodeca/nodeca.core,nodeca/nodeca.core | ---
+++
@@ -20,6 +20,9 @@
// Report text
text: String,
+ // Parser options
+ params_ref: Schema.ObjectId,
+
// User _id
from: Schema.ObjectId
}, |
b14b5c49a76a81fc92c36ba3e2ca0c7c59274cb3 | modules/components/View.js | modules/components/View.js | import { createComponent } from 'react-fela'
const View = props => ({
display: props.hidden && 'none',
zIndex: props.zIndex,
position: 'fixed',
top: 0,
left: 0,
bottom: 0,
right: 0
})
export default createComponent(View)
| import { createComponent } from 'react-fela'
const View = props => ({
display: props.hidden ? 'none' : 'flex',
zIndex: props.zIndex,
position: 'fixed',
top: 0,
left: 0,
bottom: 0,
right: 0
})
export default createComponent(View)
| Add flex display to view by default | Add flex display to view by default | JavaScript | mit | rofrischmann/kilvin | ---
+++
@@ -1,7 +1,7 @@
import { createComponent } from 'react-fela'
const View = props => ({
- display: props.hidden && 'none',
+ display: props.hidden ? 'none' : 'flex',
zIndex: props.zIndex,
position: 'fixed',
top: 0, |
98070f6292954c7190f7aaa52c3f5c86a88fe039 | src/constants.es6.js | src/constants.es6.js | export default {
TOGGLE_OVER_18: 'toggleOver18',
SIDE_NAV_TOGGLE: 'sideNavToggle',
TOP_NAV_HAMBURGER_CLICK: 'topNavHamburgerClick',
VOTE: 'vote',
DROPDOWN_OPEN: 'dropdownOpen',
COMPACT_TOGGLE: 'compactToggle',
TOP_NAV_HEIGHT: 45,
RESIZE: 'resize',
SCROLL: 'scroll',
ICON_SHRUNK_SIZE: 16,
CACHEABLE_... | export default {
TOGGLE_OVER_18: 'toggleOver18',
SIDE_NAV_TOGGLE: 'sideNavToggle',
TOP_NAV_HAMBURGER_CLICK: 'topNavHamburgerClick',
VOTE: 'vote',
DROPDOWN_OPEN: 'dropdownOpen',
COMPACT_TOGGLE: 'compactToggle',
TOP_NAV_HEIGHT: 45,
RESIZE: 'resize',
SCROLL: 'scroll',
ICON_SHRUNK_SIZE: 16,
CACHEABLE_... | Increase API timeout to 10s | Increase API timeout to 10s
Accomodate slow/whoalaned requests, like the google crawler. It was set
to 5s previously when we thought that api requests were causing the
request queue to back up, which does not appear to be the case.
| JavaScript | mit | uzi/reddit-mobile,madbook/reddit-mobile,uzi/reddit-mobile,DogPawHat/reddit-mobile,DogPawHat/reddit-mobile,curioussavage/reddit-mobile,curioussavage/reddit-mobile,madbook/reddit-mobile,madbook/reddit-mobile,uzi/reddit-mobile | ---
+++
@@ -10,5 +10,5 @@
SCROLL: 'scroll',
ICON_SHRUNK_SIZE: 16,
CACHEABLE_COOKIES: ['compact'],
- DEFAULT_API_TIMEOUT: 5000,
+ DEFAULT_API_TIMEOUT: 10000,
}; |
55d795f8fbb1d51c9b91c9d56a352fd56becf529 | index.js | index.js | module.exports = function stringReplaceAsync(
string,
searchValue,
replaceValue
) {
try {
if (typeof replaceValue === "function") {
// Step 1: Call native `replace` one time to acquire arguments for
// `replaceValue` function
// Step 2: Collect all return values in an array
// Step 3... | module.exports = function stringReplaceAsync(
string,
searchValue,
replaceValue
) {
try {
if (typeof replaceValue === "function") {
// 1. Run fake pass of `replace`, collect values from `replaceValue` calls
// 2. Resolve them with `Promise.all`
// 3. Run `replace` with resolved values
... | Clarify the code a bit | Clarify the code a bit
| JavaScript | mit | dsblv/string-replace-async | ---
+++
@@ -5,20 +5,17 @@
) {
try {
if (typeof replaceValue === "function") {
- // Step 1: Call native `replace` one time to acquire arguments for
- // `replaceValue` function
- // Step 2: Collect all return values in an array
- // Step 3: Run `Promise.all` on collected values to resolve ... |
b634cda9d411859bcce4d15b9c9a55143ecc7265 | src/Reporter.js | src/Reporter.js | // cavy-cli reporter class.
export default class CavyReporter {
// Internal: Creates a websocket connection to the cavy-cli server.
onStart() {
const url = 'ws://127.0.0.1:8082/';
this.ws = new WebSocket(url);
}
// Internal: Send report to cavy-cli over the websocket connection.
onFinish(report) {
... | // Internal: CavyReporter is responsible for sending the test results to
// the CLI.
export default class CavyReporter {
// Internal: Creates a websocket connection to the cavy-cli server.
onStart() {
const url = 'ws://127.0.0.1:8082/';
this.ws = new WebSocket(url);
}
// Internal: Send report to cavy-c... | Improve top level class description | Improve top level class description
| JavaScript | mit | pixielabs/cavy | ---
+++
@@ -1,4 +1,5 @@
-// cavy-cli reporter class.
+// Internal: CavyReporter is responsible for sending the test results to
+// the CLI.
export default class CavyReporter {
// Internal: Creates a websocket connection to the cavy-cli server.
onStart() { |
71083a50a6cc900edb272dded2c3578ee5065d2d | index.js | index.js | require('./lib/metro-transit')
// Create the handler that responds to the Alexa Request.
exports.handler = function (event, context) {
// Create an instance of the MetroTransit skill.
var dcMetro = new MetroTransit();
dcMetro.execute(event, context);
};
| var MetroTransit = require('./lib/metro-transit');
// Create the handler that responds to the Alexa Request.
exports.handler = function (event, context) {
MetroTransit.execute(event, context);
};
| Update driver file for new module interfaces | Update driver file for new module interfaces
| JavaScript | mit | pmyers88/dc-metro-echo | ---
+++
@@ -1,8 +1,6 @@
-require('./lib/metro-transit')
+var MetroTransit = require('./lib/metro-transit');
// Create the handler that responds to the Alexa Request.
exports.handler = function (event, context) {
- // Create an instance of the MetroTransit skill.
- var dcMetro = new MetroTransit();
- dcMe... |
27e8daf7bf9ab4363314a5af41d9eb5ea4de9fdb | src/atoms/TextComponent/index.js | src/atoms/TextComponent/index.js | import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import styles from './text_component.module.scss';
function setWeight( { semibold, light } ) {
if ( semibold ) return styles.semibold;
if ( light ) return styles.light;
return styles.regular;
}
function TextComp... | import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import styles from './text_component.module.scss';
function setWeight( { semibold, light } ) {
if ( semibold ) return styles.semibold;
if ( light ) return styles.light;
return styles.regular;
}
function TextComp... | Update Text Component to allow React components to render as child | Update Text Component to allow React components to render as child
| JavaScript | mit | policygenius/athenaeum,policygenius/athenaeum,policygenius/athenaeum | ---
+++
@@ -18,6 +18,8 @@
className,
} = props;
+ const kids = typeof(children.type) === "function" ? children.type( children.props ) : [ ...children ];
+
return React.createElement(
tag,
{ className: classnames(
@@ -25,7 +27,7 @@
setWeight( props ),
className
) },
- [ ..... |
4077314ce800a011121a04828df4da2163604a81 | index.js | index.js | 'use strict';
var R = require('ramda');
var isEmptyObj = R.pipe(R.keys, R.isEmpty);
function ModelRenderer(model) {
this.modelName = model.modelName;
this.attrs = model.attrs;
}
function attrToString(key, value) {
var output = '- ' + key;
if (R.has('primaryKey', value)) {
output += ' (primaryKey)';
}
... | 'use strict';
var R = require('ramda');
var isEmptyObj = R.pipe(R.keys, R.isEmpty);
function ModelRenderer(model) {
this.modelName = model.modelName;
this.attrs = model.attrs;
}
function attrToString(key, value) {
var output = '- ' + key;
if (R.has('primaryKey', value)) {
output += ' (primaryKey)';
}
... | Create plain object in toJSON method | Create plain object in toJSON method
Standard deep equality doesn't seem to fail because it doesn't check for
types (i.e. constructor). However, the deep equality that chai uses
takes that into account and seems like a good idea to remove the
prototype in the object to be used for JSON output.
| JavaScript | mit | jcollado/modella-render-docs | ---
+++
@@ -17,7 +17,7 @@
}
ModelRenderer.prototype.toJSON = function toJSON() {
- return this;
+ return R.mapObj(R.identity, this);
};
ModelRenderer.prototype.toString = function toString() { |
c1a83e68a97eb797d81e900271262840631b5467 | index.js | index.js | var app = require('./server/routes');
var server = app.listen(3000, function() {
console.log('Listening on port %d', server.address().port);
});
| process.title = 'Feedback-App';
var app = require('./server/routes');
var server = app.listen(3000, function() {
console.log('Listening on port %d', server.address().port);
});
/**
* Shutdown the server process
*
* @param {String} signal Signal to send, such as 'SIGINT' or 'SIGHUP'
*/
var close = function(... | Add shutdown notification and process title | Add shutdown notification and process title
| JavaScript | mit | maskedcoder/feedback-app,maskedcoder/feedback-app | ---
+++
@@ -1,5 +1,32 @@
+process.title = 'Feedback-App';
+
var app = require('./server/routes');
var server = app.listen(3000, function() {
console.log('Listening on port %d', server.address().port);
});
+
+/**
+ * Shutdown the server process
+ *
+ * @param {String} signal Signal to send, such as 'SIGINT... |
eeb6e25ba97d0dae3fb1c8ab6a8aec892da25ad3 | js/util.js | js/util.js | /**
* Searches the first loaded style sheet for an @keyframes animation by name.
* FYI: If you use "to" or "from" they'll get converted to percentage values, so use them for manipulating rules.
* Source (Optimized for flapper): http://jsfiddle.net/russelluresti/RHhBz/3/.
**/
function findKeyframesRule(name) {
var... | /**
* Searches the first loaded style sheet for an @keyframes animation by name.
* FYI: If you use "to" or "from" they'll get converted to percentage values, so use them for manipulating rules.
* Source (Optimized for flapper): http://jsfiddle.net/russelluresti/RHhBz/3/.
**/
function findKeyframesRule(name) {
for... | Fix uBlock Origin breaking flapper by injecting CSS stylesheet | Fix uBlock Origin breaking flapper by injecting CSS stylesheet
| JavaScript | mpl-2.0 | ryanwarsaw/flapper,ryanwarsaw/flapper | ---
+++
@@ -4,10 +4,14 @@
* Source (Optimized for flapper): http://jsfiddle.net/russelluresti/RHhBz/3/.
**/
function findKeyframesRule(name) {
- var stylesheet = document.styleSheets[0];
- for (var i = 0; i < stylesheet.cssRules.length; i++) {
- var cssRule = stylesheet.cssRules[i];
- if (cssRule.name ==... |
b91384ff9e6adb7d00afb166bb18e1a55e4d7286 | index.js | index.js | 'use strict';
const semver = require('semver');
const fetch = require('node-fetch');
const url = require('url');
module.exports = pkg => {
if (typeof pkg === 'string') {
pkg = {
name: pkg
}
}
if (!pkg || !pkg.name) {
throw new Error('You must provide a package name');
}
pkg.version = p... | 'use strict';
const semver = require('semver');
const fetch = require('node-fetch');
const url = require('url');
module.exports = pkg => {
if (typeof pkg === 'string') {
pkg = {
name: pkg
}
}
if (!pkg || !pkg.name) {
throw new Error('You must provide a package name');
}
pkg.version = pkg... | Add 'full' option to get all package details not just version number. | Add 'full' option to get all package details not just version number.
| JavaScript | mit | sillero/registry-resolve | ---
+++
@@ -14,17 +14,20 @@
if (!pkg || !pkg.name) {
throw new Error('You must provide a package name');
}
-
+
pkg.version = pkg.version || '*';
-
+
if (!semver.validRange(pkg.version)) {
throw new Error('That is not a valid package version range');
- }
-
- pkg.registry = pkg.registry |... |
9fe321c8a3f4da36196ac115987c4e7db6642f75 | index.js | index.js | var _ = require('underscore');
var utils = require('./lib/utils');
var middleware = require('./lib/middleware');
var fixture = require('./lib/fixture');
var service = require('./lib/service');
var transform = require('./lib/transform');
var view = require('./lib/view');
/**
* Reads in route and service definitions fro... | require('es6-promise').polyfill();
var _ = require('lodash');
var utils = require('./lib/utils');
/**
* Reads in route and service definitions from JSON and configures
* express routes with the appropriate middleware for each.
* @module router
* @param {object} app - an Express instance
* @param {object} routes ... | Update reducto module to work with new config schema. | Update reducto module to work with new config schema.
| JavaScript | mit | michaelleeallen/reducto | ---
+++
@@ -1,26 +1,20 @@
-var _ = require('underscore');
+require('es6-promise').polyfill();
+
+var _ = require('lodash');
var utils = require('./lib/utils');
-var middleware = require('./lib/middleware');
-var fixture = require('./lib/fixture');
-var service = require('./lib/service');
-var transform = require('./... |
f0c62f3c90f96a29736d5715dc4fdb8f15549ed6 | lib/react/loading-progress.js | lib/react/loading-progress.js | 'use babel'
import {React} from 'react-for-atom'
export default React.createClass({
propTypes: {
readyCount: React.PropTypes.number,
totalCount: React.PropTypes.number
},
render () {
if (isNaN(this.props.readyCount) || isNaN(this.props.totalCount)) {
return <span />
} else {
return... | 'use babel'
import {React} from 'react-for-atom'
export default React.createClass({
propTypes: {
readyCount: React.PropTypes.number,
totalCount: React.PropTypes.number
},
render () {
if (isNaN(this.props.readyCount) || isNaN(this.props.totalCount)) {
return <span />
} else {
return... | Move tooltip to only show on hovering info-icon | :art: Move tooltip to only show on hovering info-icon
| JavaScript | mit | viddo/atom-textual-velocity,viddo/atom-textual-velocity,onezoomin/atom-textual-velocity | ---
+++
@@ -14,11 +14,11 @@
return <span />
} else {
return (
- <div className='tv-loading-progress' ref='tooltip' onMouseOver={this._onHover}>
+ <div className='tv-loading-progress'>
<span className='inline-block text-smaller text-subtle'>
Reading {this.props.... |
69a4e2ba1022b3215255d13b15d5b35063f46386 | index.js | index.js | const request = require('request');
const fs = require('fs');
const thenify = require('thenify').withCallback;
const download = (url, file, callback) => {
const stream = fs.createWriteStream(file);
stream.on('finish', () => {
callback(null, file);
});
stream.on('error', error => {
callback(error);
})... | const request = require('request');
const fs = require('fs');
const thenify = require('thenify').withCallback;
const download = (url, file, callback) => {
const stream = fs.createWriteStream(file);
stream.on('finish', () => {
callback(null, file);
});
stream.on('error', error => {
callback(error);
})... | Handle errors that occure during request | Handle errors that occure during request | JavaScript | mit | demohi/co-download | ---
+++
@@ -12,6 +12,9 @@
});
request
.get(url)
+ .on('error', error => {
+ callback(error);
+ })
.pipe(stream);
};
|
1e55d5399e6c6a34f49fa992982fb3b79ad3f9e7 | index.js | index.js | module.exports = function (protocol) {
protocol = protocol || 'http';
var url = 'http://vicopo.selfbuild.fr/search/';
switch (protocol) {
case 'https':
url = 'https://www.selfbuild.fr/vicopo/search/';
break;
case 'http':
break;
default:
throw new Error(protocol + ' protocol not supported');
}
var... | module.exports = function (protocol) {
protocol = protocol || 'http';
var url = 'http://vicopo.selfbuild.fr/search/';
switch (protocol) {
case 'https':
url = 'https://www.selfbuild.fr/vicopo/search/';
break;
case 'http':
break;
default:
throw new Error(protocol + ' protocol not supported');
}
var... | Make it compatible with older node.js | Make it compatible with older node.js | JavaScript | mit | kylekatarnls/vicopo,kylekatarnls/vicopo,kylekatarnls/vicopo,kylekatarnls/vicopo,kylekatarnls/vicopo | ---
+++
@@ -15,13 +15,13 @@
transport.get(url + encodeURIComponent(search), function (res) {
var data = '';
res.setEncoding('utf8');
- res.on('data', (chunk) => {
- data += chunk;
- });
- res.on('end', () => {
+ res.on('data', function (chunk) {
+ data += chunk;
+ });
+ res.on('end',... |
60689993d75db32701e99f7eb9110ce8eff54610 | index.js | index.js | "use strict";
// modified from https://github.com/es-shims/es6-shim
var keys = require('object-keys');
var isObject = function (obj) {
return typeof obj !== 'undefined' && obj !== null;
};
var assignShim = function assign(target, source) {
var s, i, props;
if (!isObject(target)) { throw new TypeError('target must ... | "use strict";
// modified from https://github.com/es-shims/es6-shim
var keys = Object.keys || require('object-keys');
var isObject = function (obj) {
return typeof obj !== 'undefined' && obj !== null;
};
var assignShim = function assign(target, source) {
var s, i, props;
if (!isObject(target)) { throw new TypeErro... | Use the native Object.keys if it's available. | Use the native Object.keys if it's available. | JavaScript | mit | ljharb/object.assign,es-shims/object.assign,reggi/object.assign | ---
+++
@@ -1,7 +1,7 @@
"use strict";
// modified from https://github.com/es-shims/es6-shim
-var keys = require('object-keys');
+var keys = Object.keys || require('object-keys');
var isObject = function (obj) {
return typeof obj !== 'undefined' && obj !== null;
}; |
45bd22346dbd3cfeaedea1a3061ff5cc50b3e9a0 | index.js | index.js | "use strict";
module.exports = {
rules: {
"sort-object-props": function(context) {
var ignoreCase = context.options[0].ignoreCase;
var ignoreMethods = context.options[0].ignoreMethods;
var MSG = "Property names in object literals should be sorted";
return {
... | "use strict";
module.exports = {
rules: {
"sort-object-props": function(context) {
var caseSensitive = context.options[0].caseSensitive;
var ignoreMethods = context.options[0].ignoreMethods;
var MSG = "Property names in object literals should be sorted";
retu... | Rename option to caseSensitive to avoid double negation | Rename option to caseSensitive to avoid double negation
| JavaScript | mit | shane-tomlinson/eslint-plugin-sorting,jacobrask/eslint-plugin-sorting | ---
+++
@@ -3,7 +3,7 @@
module.exports = {
rules: {
"sort-object-props": function(context) {
- var ignoreCase = context.options[0].ignoreCase;
+ var caseSensitive = context.options[0].caseSensitive;
var ignoreMethods = context.options[0].ignoreMethods;
va... |
b99f91a8f9259cf867cd522f4164aed4a83c2e72 | index.js | index.js | 'use strict';
var Q = require('q');
var request = Q.denodeify(require('request'));
var chromecastHomeURL = 'https://clients3.google.com/cast/chromecast/home/v/c9541b08';
var initJSONStateRegex = /(JSON\.parse\(.+'\))/;
var parseChromecastHome = function(htmlString) {
var JSONParse = htmlString.match(initJSONStat... | 'use strict';
var Q = require('q');
var request = Q.denodeify(require('request'));
var chromecastHomeURL = 'https://clients3.google.com/cast/chromecast/home/v/c9541b08';
var initJSONStateRegex = /(JSON\.parse\(.+'\))/;
var parseChromecastHome = function(htmlString) {
var JSONParse = htmlString.match(initJSONStat... | Fix parsing of initState JSON as noticed by @aawc | Fix parsing of initState JSON as noticed by @aawc
| JavaScript | mit | apeddinti/chromecast-backgrounds,dconnolly/chromecast-backgrounds,DKbyo/chromecast-windows-theme,adz/chromecast-backgrounds,Wiseup/chromecast-backgrounds | ---
+++
@@ -10,10 +10,10 @@
var JSONParse = htmlString.match(initJSONStateRegex)[1];
var initState = eval(JSONParse); // I don't know why this is ok but JSON.parse fails.
var parsedBackgrounds = [];
- for (var i in initState[1]) {
+ for (var i in initState[0]) {
var backgroundEntry = {
-... |
b2414317832618de90a46fa0115e0903a749b4de | index.js | index.js | // Enable promise error logging
require('promise/lib/rejection-tracking').enable();
var express = require('express');
var app = express();
var certificate = require('./src/certificate')
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
app.set('views', __dirname + '/views'... | // Enable promise error logging
require('promise/lib/rejection-tracking').enable();
var express = require('express');
var app = express();
var certificate = require('./src/certificate')
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
app.set('views', __dirname + '/views'... | Remove redundant call to getCertificationData() | Remove redundant call to getCertificationData()
This was fetching certificate info from every site twice.
| JavaScript | mit | JensDebergh/certificate-dashboard,JensDebergh/certificate-dashboard,JensDebergh/certificate-dashboard | ---
+++
@@ -13,8 +13,6 @@
app.set('view engine', 'ejs');
app.get('/', function(request, response) {
- var promise = certificate.getCertificationData();
-
certificate.getCertificationData().then(function(data) {
responseData = {
certInfo: JSON.stringify(data), |
9260ae76dba730555f71ea839d4c42cfe9d5393e | index.js | index.js | var express = require("express"),
mongoose = require("mongoose"),
app = express();
mongoose.connect("mongodb://localhost/test", function (err) {
if (!err) {
console.log("Connected to MongoDB");
} else {
console.error(err);
}
});
app.get("/", function (req, res) {
res.send("Hey buddy!");
});
v... | var express = require("express"),
mongoose = require("mongoose"),
app = express();
mongoose.connect("mongodb://localhost/test", function (err) {
if (!err) {
console.log("Connected to MongoDB");
} else {
console.error(err);
}
});
app.get("/", function (req, res) {
res.send("Hey buddy!");
});
v... | Use callbacks to ensure save is completed before returning a result | Use callbacks to ensure save is completed before returning a result
| JavaScript | mit | shippableSamples/sample_node_mongo,pranaypareek/sample_node_mongo,samples-org-read/sample_node_mongo,a-murphy/sample_node_mongo,navneetjo/sample_node_mongo,buildsample/sample_node_mongo,a-murphy/sample_node_mongo,vidyar/sample_node_mongo | ---
+++
@@ -21,8 +21,13 @@
if (t.length < 1) {
var thing = new Thing();
thing.name = req.params.name;
- thing.save();
- res.send("Created a new thing with name " + thing.name);
+ thing.save(function(err) {
+ if (err) {
+ res.send(500);
+ } else {
+ res... |
5203a7c14acab3253aff2494f4bbacaa945ff3c3 | src/controllers/post-controller.js | src/controllers/post-controller.js | import BlogPost from '../database/models/blog-post';
import log from '../log';
const PUBLIC_API_ATTRIBUTES = [
'id',
'title',
'link',
'description',
'date_updated',
'date_published'
];
const DEFAULT_ORDER = [
['date_published', 'DESC']
];
export function getAll() {
return new Promise((resolve, reject... | import BlogPost from '../database/models/blog-post';
import log from '../log';
const PUBLIC_API_ATTRIBUTES = [
'id',
'title',
'link',
'description',
'date_updated',
'date_published',
'author_id'
];
const DEFAULT_ORDER = [
['date_published', 'DESC']
];
export function getAll() {
return new Promise((... | Allow author_id on public API | Allow author_id on public API
| JavaScript | mit | csblogs/api-server,csblogs/api-server | ---
+++
@@ -7,7 +7,8 @@
'link',
'description',
'date_updated',
- 'date_published'
+ 'date_published',
+ 'author_id'
];
const DEFAULT_ORDER = [ |
244745bf47320a759e403beea0ecb71f178509c6 | spec/specs.js | spec/specs.js | describe('pingPong', function() {
it("is true for a number that is divisible by 3", function() {
expect(pingPong(6)).to.equal(true);
});
it("is true for a number that is divisible by 5", function() {
expect(pingPong(10)).to.equal(True)
}
});
| describe('pingPong', function() {
it("is true for a number that is divisible by 3", function() {
expect(pingPong(6)).to.equal(true);
});
it("is true for a number that is divisible by 5", function() {
expect(pingPong(10)).to.equal(True)
});
});
| Fix syntax error on previous commit | Fix syntax error on previous commit
| JavaScript | mit | kcmdouglas/pingpong,kcmdouglas/pingpong | ---
+++
@@ -5,6 +5,6 @@
it("is true for a number that is divisible by 5", function() {
expect(pingPong(10)).to.equal(True)
- }
+ });
}); |
24792e355734a207bd1c51a43b557867da459cce | src/js/directives/participate.js | src/js/directives/participate.js | 'use strict';
angular.module('Teem')
.directive('participate', function() {
return {
controller: [
'$scope', '$element', '$attrs', 'SessionSvc', '$timeout', 'CommunitiesSvc',
function($scope, $element, $attrs, SessionSvc, $timeout, CommunitiesSvc) {
$scope.participateCopyOn = $attrs.pa... | 'use strict';
angular.module('Teem')
.directive('participate', function() {
return {
controller: [
'$scope', '$element', '$attrs', 'SessionSvc', '$timeout', 'CommunitiesSvc',
function($scope, $element, $attrs, SessionSvc, $timeout, CommunitiesSvc) {
$scope.participateCopyOn = $attrs.pa... | Copy only the participants list instead of using .extend() | Copy only the participants list instead of using .extend()
| JavaScript | agpl-3.0 | P2Pvalue/teem,P2Pvalue/teem,Grasia/teem,Grasia/teem,Grasia/teem,P2Pvalue/pear2pear,P2Pvalue/pear2pear,P2Pvalue/teem | ---
+++
@@ -19,7 +19,7 @@
CommunitiesSvc.find($scope.community.id).then(function(community) {
$timeout(function() {
community.toggleParticipant();
- angular.extend($scope.community, community);
+ $scope.community.participants = commu... |
ad7a8ebb6994ad425c8429a052ef0abc91365ada | index.js | index.js | var path = require('path');
var fs = require('fs');
var mime = require('mime');
var pattern = function (file, included) {
return {pattern: file, included: included, served: true, watched: false};
};
var framework = function (files) {
files.push(pattern(path.join(__dirname, 'framework.js'), false));
files.... | var path = require('path');
var fs = require('fs');
var mime = require('mime');
var pattern = function (file, included) {
return {pattern: file, included: included, served: true, watched: false};
};
var framework = function (files) {
files.push(pattern(path.join(__dirname, 'framework.js'), false));
files.... | Fix proxy incorrectly proxying requests for files a level deeper than intended | Fix proxy incorrectly proxying requests for files a level deeper than intended
| JavaScript | mit | jimsimon/karma-web-components,jimsimon/karma-web-components | ---
+++
@@ -13,17 +13,21 @@
var createProxyForDirectory = function (directory) {
return function (request, response, next) {
- var filePath = path.join(directory, request.url.replace('/base/', ''));
- fs.exists(filePath, function (exists) {
- if (exists) {
- response.wr... |
e5ffafb53bdce4fdfca12680175adb6858dacd75 | index.js | index.js | var Xray = require('x-ray'),
fs = require('fs')
var x = Xray()
var baseURLPrefix = "http://www.thaischool.in.th/sitemap.php?school_area=&province_id=",
baseURLSuffix = "&schooltype_id=&txtsearch=",
provinces = require('./provinces.json')
function appendObject(obj){
var resultFile = fs.readFileSync('./r... | var Xray = require('x-ray'),
fs = require('fs')
var x = Xray()
var baseURLPrefix = "http://www.thaischool.in.th/sitemap.php?school_area=&province_id=",
baseURLSuffix = "&schooltype_id=&txtsearch=",
provinces = require('./provinces.json')
function appendObject(obj){
var resultFile = fs.readFileSync('./r... | Save result as array of school name only | Save result as array of school name only
| JavaScript | isc | lukyth/thailand-school-collector | ---
+++
@@ -15,6 +15,14 @@
fs.writeFileSync('./result/result.json', resultJSON)
}
+function appendArray(arr){
+ var resultFile = fs.readFileSync('./result/schools.json')
+ var result = JSON.parse(resultFile)
+ Array.prototype.push.apply(result, obj);
+ var resultJSON = JSON.stringify(result)
+ fs.writeFile... |
b4f454f3701fd304e9775affc51234847d376918 | src/Plugin.js | src/Plugin.js | /**
* Initialize Pattern builder plugin.
*/
;(function ($) {
var pluginName = 'patternMaker',
pluginDefaults = {
palette: []
};
/**
* Constructor.
*
* @param {dom} element Drawing board
* @param {object} options Plugin options
*/
function... | /**
* Initialize Pattern builder plugin.
*/
;(function () {
var pluginName = 'patternMaker',
pluginDefaults = {
palette: []
};
/**
* Constructor.
*
* @param {dom} element Drawing board
* @param {object} options Plugin options
*/
function ... | Use jQuery directly instead of $ in plugin | Use jQuery directly instead of $ in plugin
| JavaScript | mit | ivannpaz/PatternMaker | ---
+++
@@ -1,7 +1,7 @@
/**
* Initialize Pattern builder plugin.
*/
-;(function ($) {
+;(function () {
var pluginName = 'patternMaker',
pluginDefaults = {
@@ -35,13 +35,13 @@
*
* @param {object} options Initialization options
*/
- $.fn[pluginName] = function(options)... |
f9bb15454fe3d0ec86893fbda7f08d0860cffe6b | gulp/watch.js | gulp/watch.js | 'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
gulp.task('browser-sync', function () {
browserSync({
server: {
baseDir: './dist'
}
});
});
gulp.task('watch', ['build', 'browser-sync'], function () {
gulp.watch('./app/**/*.html', ['html']);
gulp.watch('./app... | 'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
gulp.task('watch', ['build', 'serve'], function () {
gulp.watch('./app/**/*.html', ['html']);
gulp.watch('./app/**/*.js', ['js']);
gulp.watch('./dist/**/*').on('change', function () {
browserSync.reload();
});
});
gulp.... | Rename browser-sync task to serve. | Rename browser-sync task to serve.
| JavaScript | mpl-2.0 | learnfwd/learnfwd.com,learnfwd/learnfwd.com,learnfwd/learnfwd.com | ---
+++
@@ -3,15 +3,7 @@
var gulp = require('gulp');
var browserSync = require('browser-sync');
-gulp.task('browser-sync', function () {
- browserSync({
- server: {
- baseDir: './dist'
- }
- });
-});
-
-gulp.task('watch', ['build', 'browser-sync'], function () {
+gulp.task('watch', ['build', 'serve']... |
bc6673cefccf4db6b83742eaafe338d22b2d7310 | cla_frontend/assets-src/javascripts/modules/moj.Conditional.js | cla_frontend/assets-src/javascripts/modules/moj.Conditional.js | (function () {
'use strict';
moj.Modules.Conditional = {
el: '.js-Conditional',
init: function () {
var _this = this;
this.cacheEls();
this.bindEvents();
this.$conditionals.each(function () {
_this.toggleEl($(this));
});
},
bindEvents: function () {
v... | /* globals _ */
(function () {
'use strict';
moj.Modules.Conditional = {
el: '.js-Conditional',
init: function () {
_.bindAll(this, 'render');
this.cacheEls();
this.bindEvents();
},
bindEvents: function () {
this.$conditionals.on('change deselect', this.toggle);
moj... | Add module for conditional content | Add module for conditional content
| JavaScript | mit | ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend | ---
+++
@@ -1,3 +1,5 @@
+/* globals _ */
+
(function () {
'use strict';
@@ -5,43 +7,38 @@
el: '.js-Conditional',
init: function () {
- var _this = this;
-
+ _.bindAll(this, 'render');
this.cacheEls();
this.bindEvents();
-
- this.$conditionals.each(function () {
- ... |
3c357c4c8043c7867e1abc0a2397735e6a8e6089 | src/reducers/general.js | src/reducers/general.js | import * as types from "../actions/types";
import { chooseDisplayComponentFromURL } from "../actions/navigation";
import { hasExtension, getExtension } from "../util/extensions";
/* the store for cross-cutting state -- that is, state
not limited to <App>
*/
const getFirstPageToDisplay = () => {
if (hasExtension("en... | import * as types from "../actions/types";
import { chooseDisplayComponentFromURL } from "../actions/navigation";
import { hasExtension, getExtension } from "../util/extensions";
/* the store for cross-cutting state -- that is, state
not limited to <App>
*/
const getFirstPageToDisplay = () => {
if (hasExtension("en... | Fix bugs in redux state of pathname | Fix bugs in redux state of pathname
We were getting bugs due to the redux state of `general.pathname` set to `undefined` when it shouldn't be as a result of `PAGE_CHANGE` actions with no `action.path` data. This resulted in incorrect API requests and the display of results which didn't match the URL. | JavaScript | agpl-3.0 | nextstrain/auspice,nextstrain/auspice,nextstrain/auspice | ---
+++
@@ -20,11 +20,14 @@
}, action) => {
switch (action.type) {
case types.PAGE_CHANGE:
- return Object.assign({}, state, {
- pathname: action.path,
+ const stateUpdate = {
displayComponent: action.displayComponent,
errorMessage: action.errorMessage
- });
+ };
... |
5d4ce6182c59c0c15aed5646809c39e4d67c839e | enums.spec.js | enums.spec.js | var enums = require("./enum.js");
describe("Enum", function() {
it("can have symbols with custom properties", function() {
var color = new enums.Enum({
red: { de: "rot" },
green: { de: "grün" },
blue: { de: "blau" },
});
function translate(c) {
... | var enums = require("./enums.js");
describe("Enum", function() {
it("can have symbols with custom properties", function() {
var color = new enums.Enum({
red: { de: "rot" },
green: { de: "grün" },
blue: { de: "blau" },
});
function translate(c) {
... | Use correct file name to require enums.js | Use correct file name to require enums.js
| JavaScript | mit | rauschma/enums | ---
+++
@@ -1,4 +1,4 @@
-var enums = require("./enum.js");
+var enums = require("./enums.js");
describe("Enum", function() {
it("can have symbols with custom properties", function() { |
80cfc47a1c60e66836fdd7660c944f64c5d4c0c4 | src/time-segments.js | src/time-segments.js | var TimeSegments = {
// Segment an array of events by scale
segment(events, scale, options) {
scale = scale || 'weeks';
options = options || {};
_.defaults(options, {
startAttribute: 'start',
endAttribute: 'end'
});
events = _.chain(events).clone().sortBy(options.startAttribute).val... | var TimeSegments = {
// Segment an array of events by scale
segment(events, scale, options) {
scale = scale || 'weeks';
options = options || {};
_.defaults(options, {
startAttribute: 'start',
endAttribute: 'end'
});
events = _.chain(events).clone().sortBy(options.startAttribute).val... | Refactor source to use more ES6 syntax. | Refactor source to use more ES6 syntax.
| JavaScript | mit | jmeas/time-segments.js | ---
+++
@@ -14,7 +14,7 @@
// Clone our events so that we're not modifying the original
// objects. Loop through them, inserting the events into the
// corresponding segments
- _.each(_.clone(events), function(e) {
+ _.each(_.clone(events), e => {
// Calculate the duration of the ev... |
6ee08bdbccec11791f9946d692174739176ffa8e | src/common.js | src/common.js | export const formatURL = (url) => (
url.length ? url.replace(/^https?:\/\//, '') : ''
)
export const getTitle = (data) => (
data.about && data.about.name
? data.about.name
: data.totalItems + " Entries"
)
export default {
getTitle, formatURL
}
| export const formatURL = (url) => (
url.length ? url.replace(/^https?:\/\//, '') : ''
)
export const getTitle = (data) => (
data.about && (data.about.name || data.about['@id'])
? data.about.name || data.about['@id']
: data.totalItems + " Entries"
)
export default {
getTitle, formatURL
}
| Fix title of resources without name | Fix title of resources without name
| JavaScript | apache-2.0 | literarymachine/crg-ui | ---
+++
@@ -3,8 +3,8 @@
)
export const getTitle = (data) => (
- data.about && data.about.name
- ? data.about.name
+ data.about && (data.about.name || data.about['@id'])
+ ? data.about.name || data.about['@id']
: data.totalItems + " Entries"
)
|
089247c62a36e4a2e0c149001bd06ccf562ebc4e | src/config.js | src/config.js | export let baseUrl = 'http://rosettastack.com';
export let sites = [{
name: 'Programmers',
slug: 'programmers',
seUrl: 'http://programmers.stackexchange.com/',
langs: ['en', 'fr'],
db: 'localhost/programmers',
}, {
name: 'Coffee',
slug: 'coffee',
seUrl: 'http://coffee.stackexchange.com/',
langs: ['en'... | export let baseUrl = 'http://rosettastack.com';
export let sites = [{
name: 'Programmers',
slug: 'programmers',
seUrl: 'http://programmers.stackexchange.com/',
langs: ['en', 'fr'],
db: 'localhost/programmers',
}, {
name: 'Coffee',
slug: 'coffee',
seUrl: 'http://coffee.stackexchange.com/',
langs: ['en'... | Fix db ref for SO | Fix db ref for SO
| JavaScript | mpl-2.0 | bbondy/stack-view,bbondy/stack-view,bbondy/stack-view | ---
+++
@@ -28,7 +28,7 @@
slug: 'stackoverflow',
seUrl: 'http://stackoverflow.com/',
langs: ['en', 'fr'],
- db: 'localhost/programmers',
+ db: 'localhost/stackoverflow',
}, {
name: 'Android',
slug: 'android', |
34f2f7d42346f564e4846435fb35ba19d3b5f8f8 | src/Native/Spruce.js | src/Native/Spruce.js | // make is a function that takes an instance of the
// elm runtime
// returns an object where:
// keys are names to be accessed in pure Elm
// values are either functions or values
function make(elm) {
// If Native isn't already bound on elm, bind it!
elm.Native = elm.Native || {}
// then ... | var _binary_koan$elm_spruce$Native_Spruce = function() {
function listen(address, program) {
console.log(address)
return program
}
return {
toHtml: F2(listen)
}
}()
| Update native module to 0.18 style | Update native module to 0.18 style
| JavaScript | mit | binary-koan/elm-spruce | ---
+++
@@ -1,31 +1,13 @@
-// make is a function that takes an instance of the
-// elm runtime
-// returns an object where:
-// keys are names to be accessed in pure Elm
-// values are either functions or values
-function make(elm) {
- // If Native isn't already bound on elm, bind it!
- elm.Native = e... |
3769ce9f09658a3748209193b6dc29e68c9160dd | src/getter.js | src/getter.js | "use strict";
var
// redis = require("redis"),
// client = redis.createClient(),
_ = require("underscore"),
Fetcher = require("l2b-price-fetchers");
module.exports.getBookDetails = function (isbn, cb) {
var f = new Fetcher();
f.fetch(
{vendor: "foyles", isbn: isbn },
function (e... | "use strict";
var
// redis = require("redis"),
// client = redis.createClient(),
_ = require("underscore"),
Fetcher = require("l2b-price-fetchers");
function getBookDetails (isbn, cb) {
fetchFromScrapers(
{vendor: "foyles", isbn: isbn },
function (err, results) {
if (err) { r... | Split up the book detail fetching into smaller chunks | Split up the book detail fetching into smaller chunks
| JavaScript | agpl-3.0 | OpenBookPrices/openbookprices-api | ---
+++
@@ -7,15 +7,29 @@
Fetcher = require("l2b-price-fetchers");
-module.exports.getBookDetails = function (isbn, cb) {
-
- var f = new Fetcher();
- f.fetch(
+function getBookDetails (isbn, cb) {
+ fetchFromScrapers(
{vendor: "foyles", isbn: isbn },
- function (err, data) {
+ function (err, r... |
1daccbf90de27ae2b3a6ac29d448cd78664a0f87 | src/server.js | src/server.js | 'use strict'
let fs = require('fs')
let dotenv = require('dotenv')
let express = require('express')
let session = require('express-session')
let cookieParser = require('cookie-parser')
let bodyParser = require('body-parser')
let morgan = require('morgan')
let routes = require('./api/routes')
dotenv.config({silent: tr... | 'use strict'
let fs = require('fs')
let dotenv = require('dotenv')
let express = require('express')
let session = require('express-session')
let cookieParser = require('cookie-parser')
let bodyParser = require('body-parser')
let morgan = require('morgan')
let routes = require('./api/routes')
let extensions = require('... | Load extensions into express app | Load extensions into express app
| JavaScript | mit | shrunyan/mc-core,shrunyan/mc-core,andyfleming/mc-core,andyfleming/mc-core | ---
+++
@@ -8,6 +8,7 @@
let bodyParser = require('body-parser')
let morgan = require('morgan')
let routes = require('./api/routes')
+let extensions = require('./extensions/registry')
dotenv.config({silent: true})
@@ -22,12 +23,15 @@
extended: true
}))
+app.locals.ext = extensions.load()
+
// Load route... |
a0f35993688c09fdb7fa49ec67070384e4a79ee2 | test/brushModes-test.js | test/brushModes-test.js | var vows = require('vows'),
assert = require('assert'),
events = require('events'),
load = require('./load'),
suite = vows.describe('brushModes');
function d3Parcoords() {
var promise = new(events.EventEmitter);
load(function(d3) {
promise.emit('success', d3.parcoords());
});
return promise... | var vows = require('vows'),
assert = require('assert'),
events = require('events'),
load = require('./load'),
suite = vows.describe('brushModes');
function d3Parcoords() {
var promise = new(events.EventEmitter);
load(function(d3) {
promise.emit('success', d3.parcoords());
});
return promise... | Add angular brush mode to test | Add angular brush mode to test
| JavaScript | bsd-3-clause | bbroeksema/parallel-coordinates,julianheinrich/parallel-coordinates,julianheinrich/parallel-coordinates,bbroeksema/parallel-coordinates | ---
+++
@@ -16,8 +16,8 @@
'd3.parcoords': {
'has by default': {
topic: d3Parcoords(),
- 'three brush modes': function(pc) {
- assert.strictEqual(pc.brushModes().length, 3);
+ 'four brush modes': function(pc) {
+ assert.strictEqual(pc.brushModes().length, 4);
},
... |
4ec97ddac5fcc131705e5047f4e6057c2abc5cdc | package.js | package.js | Package.describe({
summary: "Login service for VKontakte accounts (https://vk.com)",
version: "0.1.4",
git: "https://github.com/alexpods/meteor-accounts-vk",
name: "mrt:accounts-vk"
});
Package.on_use(function(api) {
api.versionsFrom('METEOR@0.9.0');
api.use('accounts-base', ['client', 'server'... | Package.describe({
summary: "Login service for VKontakte accounts (https://vk.com)",
version: "0.2.0",
git: "https://github.com/alexpods/meteor-accounts-vk",
name: "mrt:accounts-vk"
});
Package.on_use(function(api) {
api.versionsFrom('METEOR@0.9.0');
api.use('accounts-base', ['client', 'server'... | Add 'imply' service-configuration. Increment version number to 0.2.0 | UPD: Add 'imply' service-configuration. Increment version number to 0.2.0 | JavaScript | mit | newsiberian/meteor-accounts-vk,newsiberian/meteor-accounts-vk,alexpods/meteor-accounts-vk,alexpods/meteor-accounts-vk | ---
+++
@@ -1,6 +1,6 @@
Package.describe({
summary: "Login service for VKontakte accounts (https://vk.com)",
- version: "0.1.4",
+ version: "0.2.0",
git: "https://github.com/alexpods/meteor-accounts-vk",
name: "mrt:accounts-vk"
});
@@ -11,13 +11,14 @@
api.imply('accounts-base', ['client', ... |
4462762d313e3f7e3535101c576488e2e2ae2374 | package.js | package.js | Package.describe({
summary: "Reactive bootstrap modals for meteor",
version: "1.0.5",
git: "https://github.com/jchristman/reactive-modal.git",
name: "jchristman:reactive-modal"
});
Package.on_use(function (api) {
if(api.versionsFrom){
api.versionsFrom('METEOR@1.0');
}
api.use(['underscore', 'jquery',... | Package.describe({
summary: "Reactive bootstrap modals for meteor",
version: "1.0.5",
git: "https://github.com/jchristman/reactive-modal.git",
name: "jchristman:reactive-modal"
});
Package.on_use(function (api) {
if(api.versionsFrom){
api.versionsFrom('METEOR@1.0');
}
api.use(['underscore', 'jquery',... | Update depedencies and version number | Update depedencies and version number
| JavaScript | mit | jchristman/reactive-modal,jchristman/reactive-modal | ---
+++
@@ -9,7 +9,7 @@
if(api.versionsFrom){
api.versionsFrom('METEOR@1.0');
}
- api.use(['underscore', 'jquery','templating', 'reactive-var@1.0.6'], 'client');
+ api.use(['underscore', 'jquery','templating', 'reactive-var@1.0.5'], 'client');
api.add_files(['lib/reactive-modal.html', 'lib/reactive-mo... |
b64a51e136a4bcce3d0c2d5292c53d85c2d0e7de | test/data/testrunner.js | test/data/testrunner.js | jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
| jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
// load testswarm agent
(function() {
var url = window.location.search;
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
if ( !url || url.indexOf("http") !== 0 ) {
return;
}
document.write("<scr" + "ipt src='http://... | Handle auto-running of the TestSwarm injection script in the test suite. | Handle auto-running of the TestSwarm injection script in the test suite.
| JavaScript | mit | hoorayimhelping/jquery,eburgos/jquery,isaacs/jquery,gnarf/jquery,mislav/jquery,diracdeltas/jquery,sancao2/jquery,RubyLouvre/jquery,kpozin/jquery-nodom,chitranshi/jquery,hoorayimhelping/jquery,Karyotyper/jquery,demetr84/Jquery,demetr84/Jquery,dtjm/jquery,Karyotyper/jquery,jquery/jquery,npmcomponent/component-jquery,sanc... | ---
+++
@@ -1 +1,11 @@
jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
+
+// load testswarm agent
+(function() {
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( !url || url.indexOf("http") !== 0 ) {
+ return;
+ }
+ docume... |
2cded40e931866ecf95915ba49719609d1c591e9 | test/middleware.spec.js | test/middleware.spec.js | import { createAuthMiddleware } from '../src'
describe('auth middleware', () => {
const middleware = createAuthMiddleware()
const nextHandler = middleware({})
const actionHandler = nextHandler()
test('it returns a function that handles store', () => {
expect(middleware).toBeInstanceOf(Function)
expect... | import { createAuthMiddleware } from '../src'
describe('auth middleware', () => {
const middleware = createAuthMiddleware()
it('returns a function that handles {getState, dispatch}', () => {
expect(middleware).toBeInstanceOf(Function)
expect(middleware.length).toBe(1)
})
describe('store handler', () ... | Use it instead of test. Small structure change | Use it instead of test. Small structure change
| JavaScript | mit | jerelmiller/redux-simple-auth | ---
+++
@@ -2,21 +2,28 @@
describe('auth middleware', () => {
const middleware = createAuthMiddleware()
- const nextHandler = middleware({})
- const actionHandler = nextHandler()
- test('it returns a function that handles store', () => {
+ it('returns a function that handles {getState, dispatch}', () => {... |
ea146316b0f0d854a750ecb913b95df2705d1257 | autoformat.js | autoformat.js | #!/usr/bin/env nodejs
// Autoformatter for Turing
const fs = require('fs'),
argv = require('minimist')(process.argv.slice(2), {boolean:true});
var files = argv._;
// Check for flags, and process them
var flags = argv.flags || null;
var format = require('./format.js')(flags);
console.log(argv)
/**
* Main p... | #!/usr/bin/env nodejs
// Autoformatter for Turing
const fs = require('fs'),
argv = require('minimist')(process.argv.slice(2), {boolean:true});
var files = argv._;
// Check for flags, and process them
var flags = argv.flags || null;
var format = require('./format.js')(flags);
/**
* Main procedure
*/
files.... | Change default output behaviour to output to STDIO | Change default output behaviour to output to STDIO
| JavaScript | mit | tyxchen/turing-autoformat,tyxchen/turing-autoformat | ---
+++
@@ -12,8 +12,6 @@
var format = require('./format.js')(flags);
-console.log(argv)
-
/**
* Main procedure
*/
@@ -26,13 +24,13 @@
data = format.format(data);
- if (argv.s || argv.stdio) {
- console.log(data);
- } else {
+ if ((argv.e || argv.extension) || (a... |
d8d45721bd463e59645470604f18e82d5e98e636 | src/Portal/Portal.js | src/Portal/Portal.js | import React, {PropTypes} from 'react';
import ReactDOM from 'react-dom';
class Portal extends React.Component {
componentDidMount() {
this.nodeEl = document.createElement('div');
document.body.appendChild(this.nodeEl);
this.renderChildren(this.props);
}
componentWillUnmount() {
ReactDOM.unmount... | import React, {PropTypes} from 'react';
import ReactDOM from 'react-dom';
class Portal extends React.Component {
componentDidMount() {
this.nodeEl = document.createElement('div');
document.body.appendChild(this.nodeEl);
this.renderChildren(this.props);
}
componentWillUnmount() {
ReactDOM.unmount... | Remove default rendered child element | Remove default rendered child element
| JavaScript | apache-2.0 | mesosphere/reactjs-components,mesosphere/reactjs-components | ---
+++
@@ -18,13 +18,7 @@
}
renderChildren(props) {
- let {children} = props;
-
- if (children == null) {
- children = <div />;
- }
-
- ReactDOM.render(children, this.nodeEl, this.props.onRender);
+ ReactDOM.render(props.children, this.nodeEl, props.onRender);
}
render() {
@@ -33,... |
1039b0472ae8427539f1b1034b59596415e981fb | src/views/picker-views/base-picker-view.js | src/views/picker-views/base-picker-view.js | 'use strict';
var BaseView = require('../base-view');
function BasePickerView() {
BaseView.apply(this, arguments);
this._initialize();
}
BasePickerView.prototype = Object.create(BaseView.prototype);
BasePickerView.prototype.constructor = BasePickerView;
BasePickerView.prototype._initialize = function () {
th... | 'use strict';
var BaseView = require('../base-view');
function BasePickerView() {
BaseView.apply(this, arguments);
this._initialize();
}
BasePickerView.prototype = Object.create(BaseView.prototype);
BasePickerView.prototype.constructor = BasePickerView;
BasePickerView.prototype._initialize = function () {
th... | Remove _onSelect noop from BasePickerView | Remove _onSelect noop from BasePickerView
| JavaScript | mit | braintree/braintree-web-drop-in,braintree/braintree-web-drop-in,braintree/braintree-web-drop-in | ---
+++
@@ -23,6 +23,4 @@
}.bind(this));
};
-BasePickerView.prototype._onSelect = function () {};
-
module.exports = BasePickerView; |
7c9ec3264fcc0f6815028d793b8156d8af216ad0 | test/helpers/file_helper_test.js | test/helpers/file_helper_test.js | import { expect } from '../spec_helper'
import jsdom from 'jsdom'
import {
getRestrictedSize,
// orientImage,
} from '../../src/helpers/file_helper'
function getDOMString() {
// 1x1 transparent gif
const src = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='
const landsca... | import { expect } from '../spec_helper'
import { getRestrictedSize } from '../../src/helpers/file_helper'
describe('file helpers', () => {
context('#getRestrictedSize', () => {
it('does not restrict the width and height', () => {
const { width, height } = getRestrictedSize(800, 600, 2560, 1440)
expec... | Remove tests around canvas objects | Remove tests around canvas objects
[jsdom doesn’t really handle the canvas element very well](https://github.com/tmpvar/jsdom#canvas). It just treats it just like a div. We can add the canvas package, but that requires a whole slew of other things to do deal with (namely Cairo) which seems like a maintenance nightmare... | JavaScript | mit | ello/webapp,ello/webapp,ello/webapp | ---
+++
@@ -1,17 +1,5 @@
import { expect } from '../spec_helper'
-import jsdom from 'jsdom'
-import {
- getRestrictedSize,
- // orientImage,
-} from '../../src/helpers/file_helper'
-
-
-function getDOMString() {
- // 1x1 transparent gif
- const src = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAA... |
142b39b54eb529386ff917c2a6e80ec74abece11 | js/plugins.js | js/plugins.js | // http://unheap.com
$(function() {
$('.browsehappy').on('click', function() {
$(this).slideUp('fast');
});
});
| // http://unheap.com
$(function() {
$('.browsehappy').click(function() {
$(this).slideUp();
});
});
| Make browse happy slide up cleaner | Make browse happy slide up cleaner | JavaScript | mit | kennethwang14/VerticalRhythmDemo,kennethwang14/LostGridExample,kennethwang14/LostGridExample,kennethwang14/TypographyHandbook,kennethwang14/TypographyHandbook,corysimmons/boy,kennethwang14/VerticalRhythmDemo | ---
+++
@@ -1,7 +1,7 @@
// http://unheap.com
$(function() {
- $('.browsehappy').on('click', function() {
- $(this).slideUp('fast');
+ $('.browsehappy').click(function() {
+ $(this).slideUp();
});
}); |
da6b3fc1a9a3ba60dc02310f68d6e58fc109d1b9 | generators/app/templates/app/scripts/main.js | generators/app/templates/app/scripts/main.js | import App from './app';
import 'babel-polyfill';
common.app = new App(common);
common.app.start();
| import App from './app';
common.app = new App(common);
common.app.start();
| Remove babel-polyfill import in man.js | Remove babel-polyfill import in man.js
| JavaScript | mit | snphq/generator-sp,snphq/generator-sp,i-suhar/generator-sp,i-suhar/generator-sp,snphq/generator-sp,i-suhar/generator-sp | ---
+++
@@ -1,4 +1,3 @@
import App from './app';
-import 'babel-polyfill';
common.app = new App(common);
common.app.start(); |
112b74dcbde73c4f35426c24ab51bb10287b9c63 | karma.conf.js | karma.conf.js | // Karma configuration
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
// testing frameworks to use
frameworks: ['mocha', 'chai', 'sinon'],
// list of files / patterns to load in the browser. order ma... | // Karma configuration
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
// testing frameworks to use
frameworks: ['mocha', 'chai', 'sinon'],
// list of files / patterns to load in the browser. order ma... | Remove untested files from karma | Remove untested files from karma
| JavaScript | mit | gm758/Bolt,gm758/Bolt,elliotaplant/Bolt,thomasRhoffmann/Bolt,boisterousSplash/Bolt,thomasRhoffmann/Bolt,boisterousSplash/Bolt,elliotaplant/Bolt | ---
+++
@@ -21,9 +21,6 @@
// our spec files - in order of the README
'specs/client/authControllerSpec.js',
- 'specs/client/servicesSpec.js',
- 'specs/client/linksControllerSpec.js',
- 'specs/client/shortenControllerSpec.js',
'specs/client/routingSpec.js'
],
|
466e870fc742981be4b178015042285717cdee12 | test/index.js | test/index.js | var ACME = require( '..' )
var assert = require( 'assert' )
var nock = require( 'nock' )
suite( 'ACME', function() {
var client = new ACME({
baseUrl: 'https://api.example.com',
})
test( 'throws an error if baseUrl is not a string', function() {
assert.throws( function() { new ACME.Client({ baseUrl: 42 ... | var ACME = require( '..' )
var assert = require( 'assert' )
var nock = require( 'nock' )
var ACME_API_BASE_URL = 'https://api.example.com'
suite( 'ACME', function() {
var client = new ACME.Client({
baseUrl: ACME_API_BASE_URL,
})
test( 'throws an error if baseUrl is not a string', function() {
assert.t... | Update test: Add `ACME_API_BASE_URL` constant | Update test: Add `ACME_API_BASE_URL` constant
| JavaScript | mit | jhermsmeier/node-acme-protocol | ---
+++
@@ -2,10 +2,12 @@
var assert = require( 'assert' )
var nock = require( 'nock' )
+var ACME_API_BASE_URL = 'https://api.example.com'
+
suite( 'ACME', function() {
- var client = new ACME({
- baseUrl: 'https://api.example.com',
+ var client = new ACME.Client({
+ baseUrl: ACME_API_BASE_URL,
})
... |
a544b1ae597692ebb60175cf0572376f7d609d90 | test/index.js | test/index.js | var chai = require('chai');
var expect = chai.expect;
// var sinon = require('sinon');
var requestToContext = require('../src/requestToContext');
describe('requestToContext', function () {
it('Convert the req to the correct contect', function (done) {
console.log(requestToContext)
done();
});
});
| 'use strict';
var chai = require('chai');
var expect = chai.expect;
var requestToContext = require('../src/requestToContext');
describe('requestToContext', function () {
describe('Converts the request to the correct context', function () {
it('For get requests', function (done) {
var result = requestToCon... | Add tests around requestToContext for get and post requests | Add tests around requestToContext for get and post requests
| JavaScript | apache-2.0 | krolow/falcor-express,jmnarloch/falcor-express,jontewks/falcor-express,Netflix/falcor-express | ---
+++
@@ -1,11 +1,49 @@
+'use strict';
+
var chai = require('chai');
var expect = chai.expect;
-// var sinon = require('sinon');
var requestToContext = require('../src/requestToContext');
describe('requestToContext', function () {
- it('Convert the req to the correct contect', function (done) {
- console.... |
ad49b5c4e7e355fc7533a62b232bcdb94e3ec152 | lib/client.js | lib/client.js | /**
* Module dependencies.
*/
var redis = require('redis');
exports = module.exports = function(settings, logger) {
var config = settings.toObject();
if (!config.host) { throw new Error('Redis host not set in config'); }
var host = config.host;
var port = config.port || 6379;
var client = redis.createClient(... | /**
* Module dependencies.
*/
var redis = require('redis');
exports = module.exports = function(settings, logger) {
var config = settings.toObject();
if (!config.host) { throw new Error('Redis host not set in config'); }
var host = config.host;
var port = config.port || 6379;
var db = config.db;
var cl... | Add option to select database by index. | Add option to select database by index.
| JavaScript | mit | bixbyjs/bixby-redis | ---
+++
@@ -5,12 +5,17 @@
exports = module.exports = function(settings, logger) {
- var config = settings.toObject();
- if (!config.host) { throw new Error('Redis host not set in config'); }
- var host = config.host;
- var port = config.port || 6379;
+ var config = settings.toObject();
+ if (!config.host) { th... |
b5169369bea5ccdde34b214641f0c8eec09f64dd | lib/events.js | lib/events.js | /**
* Setup the user (DOM) event flow.
*
* @private
* @param {object} The moule instnace.
*/
module.exports = function (instance, template, options, dom, data) {
for (var event in template.events) {
for (var i = 0, l = template.events[event].length; i < l; ++i) {
handleEvent(instance, templa... | /**
* Setup the user (DOM) event flow.
*
* @private
* @param {object} The moule instnace.
*/
module.exports = function (instance, template, options, dom, data) {
for (var event in template.events) {
for (var i = 0, l = template.events[event].length; i < l; ++i) {
handleEvent(instance, templa... | Append domItem to event data. | Append domItem to event data.
| JavaScript | mit | adioo/view | ---
+++
@@ -31,6 +31,8 @@
domEvent.preventDefault();
}
+ domEvent.domItem = elm;
+
instance.flow(event)[listener.end ? 'end' : 'write'](listener.noDomData ? {} : domEvent);
});
}); |
5583da7b0961b3f3d94ff08faf606fa5fbaab5f9 | tests.js | tests.js | var logit = require('./main');
var logger = logit({
prefix: 'my app',
date: true
});
logger.info("Test 1");
logger.debug("Test 2");
logger.warn("Test 3");
logger.error("Test 4");
logger = logit({
prefix: 'my app',
date: false
});
logger.error("Test 5");
logger = logit({
prefix: 'my new app',
date: false... | var logit = require('./main');
var logger = logit({
prefix: 'my app',
date: true
});
logger.info("Test 1");
logger.debug("Test 2");
logger.warn("Test 3");
logger.error("Test 4");
logger = logit({
prefix: 'my app',
date: false
});
logger.error("Test 5");
logger = logit({
prefix: 'my new app',
date: false... | Add a test for lineBreak command | Add a test for lineBreak command
| JavaScript | mit | cozy/printit,nono/printit | ---
+++
@@ -32,6 +32,7 @@
logger.info(tab);
logger.info('arg1', 'arg2');
+logger.lineBreak();
fs = require('fs');
|
50714f6b030bddce42d1e3f69be83cb4c9da4188 | src/notebook/components/transforms/index.js | src/notebook/components/transforms/index.js | import { displayOrder, transforms } from 'transformime-react';
/**
* Thus begins our path for custom mimetypes and future extensions
*/
import PlotlyTransform from './plotly';
import GeoJSONTransform from './geojson';
const defaultDisplayOrder = displayOrder
.insert(0, PlotlyTransform.MIMETYPE)
.insert(0, Geo... | import { displayOrder, transforms } from 'transformime-react';
/**
* Thus begins our path for custom mimetypes and future extensions
*/
import PlotlyTransform from './plotly';
import GeoJSONTransform from './geojson';
// Register custom transforms
const defaultTransforms = transforms
.set(PlotlyTransform.MIMETYP... | Comment on custom transform registration | Comment on custom transform registration | JavaScript | bsd-3-clause | jdetle/nteract,0u812/nteract,jdetle/nteract,nteract/composition,captainsafia/nteract,rgbkrk/nteract,0u812/nteract,jdfreder/nteract,captainsafia/nteract,nteract/nteract,rgbkrk/nteract,nteract/nteract,temogen/nteract,temogen/nteract,temogen/nteract,jdfreder/nteract,jdetle/nteract,nteract/composition,nteract/nteract,rgbkr... | ---
+++
@@ -7,13 +7,14 @@
import PlotlyTransform from './plotly';
import GeoJSONTransform from './geojson';
+// Register custom transforms
+const defaultTransforms = transforms
+ .set(PlotlyTransform.MIMETYPE, PlotlyTransform)
+ .set(GeoJSONTransform.MIMETYPE, GeoJSONTransform);
+// Register our custom transf... |
245e9614db9218ddd4f982ba4b007665ba3627b3 | applications/desktop/src/main/auto-updater.js | applications/desktop/src/main/auto-updater.js | /* @flow strict */
import { autoUpdater } from "electron-updater";
export function initAutoUpdater() {
const log = require("electron-log");
log.transports.file.level = "info";
autoUpdater.logger = log;
autoUpdater.checkForUpdatesAndNotify();
}
| /* @flow strict */
import { autoUpdater } from "electron-updater";
export function initAutoUpdater() {
if (process.env.NTERACT_DESKTOP_DISABLE_AUTO_UPDATE !== "1") {
const log = require("electron-log");
log.transports.file.level = "info";
autoUpdater.logger = log;
autoUpdater.checkForUpdatesAndNotify... | Allow environment variable NTERACT_DESKTOP_DISABLE_AUTO_UPDATE to disable auto-update. | Allow environment variable NTERACT_DESKTOP_DISABLE_AUTO_UPDATE to disable auto-update.
Fixes #3517
| JavaScript | bsd-3-clause | rgbkrk/nteract,nteract/nteract,nteract/nteract,rgbkrk/nteract,nteract/nteract,rgbkrk/nteract,nteract/composition,nteract/nteract,rgbkrk/nteract,nteract/composition,nteract/composition,rgbkrk/nteract,nteract/nteract | ---
+++
@@ -2,8 +2,10 @@
import { autoUpdater } from "electron-updater";
export function initAutoUpdater() {
- const log = require("electron-log");
- log.transports.file.level = "info";
- autoUpdater.logger = log;
- autoUpdater.checkForUpdatesAndNotify();
+ if (process.env.NTERACT_DESKTOP_DISABLE_AUTO_UPDATE... |
3096c29162a5acbf3b98ae1f699e6039976caf19 | c2cgeoportal/scaffolds/update/+package+/static/mobile/app/model/Query.js | c2cgeoportal/scaffolds/update/+package+/static/mobile/app/model/Query.js | Ext.define('App.model.Query', {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'detail',
mapping: 'properties',
convert: function(value, record) {
var detail = [],
attributes = record.raw.attr... | Ext.define('App.model.Query', {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'detail',
mapping: 'properties',
convert: function(value, record) {
var detail = [],
attributes = record.raw.attr... | Allow using subst variables in layer attributes | Allow using subst variables in layer attributes
| JavaScript | bsd-2-clause | tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal | ---
+++
@@ -18,7 +18,7 @@
OpenLayers.i18n(k),
'</th>',
'<td>',
- attributes[k],
+ OpenLayers.String.format(attributes[k], App),
... |
60b6dce28eaaa22987acb0000977a7646066cce0 | web-test-runner.config.js | web-test-runner.config.js | const {playwrightLauncher} = require('@web/test-runner-playwright');
const defaultBrowsers = [
playwrightLauncher({product: 'chromium'}),
playwrightLauncher({product: 'webkit'}),
playwrightLauncher({product: 'firefox', concurrency: 1}),
];
const envBrowsers =
process.env.BROWSERS &&
process.env.BROWSERS.spl... | const {playwrightLauncher} = require('@web/test-runner-playwright');
const defaultBrowsers = [
playwrightLauncher({product: 'chromium'}),
playwrightLauncher({product: 'webkit'}),
playwrightLauncher({product: 'firefox', concurrency: 1}),
];
const envBrowsers =
process.env.BROWSERS &&
process.env.BROWSERS.spl... | Fix new JS for old node | Fix new JS for old node
| JavaScript | bsd-3-clause | webcomponents/polyfills,webcomponents/polyfills,webcomponents/polyfills | ---
+++
@@ -12,7 +12,7 @@
playwrightLauncher({product})
);
-const browsers = envBrowsers ?? defaultBrowsers;
+const browsers = envBrowsers || defaultBrowsers;
module.exports = {
files: `packages/scoped-custom-element-registry/test/**/*.test.(js|html)`, |
5650dbb2c03ff9d045782cbb9175403b40d24985 | lib/hooks/init/setting_usergroups_fetcher.js | lib/hooks/init/setting_usergroups_fetcher.js | // Register 'usergroups' special setting values fetcher.
// Allows to use `values: usergroups` in setting definitions.
'use strict';
var _ = require('lodash');
module.exports = function (N) {
N.wire.before('init:settings', function (sandbox) {
sandbox.selectionListFetchers['usergroups'] = function fetchUs... | // Register 'usergroups' special setting values fetcher.
// Allows to use `values: usergroups` in setting definitions.
'use strict';
var _ = require('lodash');
module.exports = function (N) {
N.wire.before('init:__settings', function (sandbox) {
sandbox.selectionListFetchers['usergroups'] = function fetch... | Rename "init:settings" event to "init:__settings". | Rename "init:settings" event to "init:__settings".
| JavaScript | mit | nodeca/nodeca.users | ---
+++
@@ -10,7 +10,7 @@
module.exports = function (N) {
- N.wire.before('init:settings', function (sandbox) {
+ N.wire.before('init:__settings', function (sandbox) {
sandbox.selectionListFetchers['usergroups'] = function fetchUserGroups(callback) {
N.models.users.UserGroup |
d2e1ba9dbe878690d33c82025bb12e4e9efd8f65 | js/scripts.js | js/scripts.js | var pingPong = function(i) {
if ((i % 3 === 0) || (i % 5 === 0)) {
return true;
} else {
return false;
}
};
$(function() {
$("#game").submit(function(event) {
$('#outputList').empty();
var number = parseInt($("#userNumber").val());
for (var i = 1; i <= number; i += 1) {
if (i % 15 =... | var pingPong = function(i) {
if ((i % 3 === 0) && (i % 5 != 0)) {
return "ping";
} else if ((i % 5 === 0) && (i % 6 != 0)) {
return "pong";
} else if ((i % 3 === 0) && (i % 5 === 0)) {
return "ping pong";
} else {
return false;
}
};
$(function() {
$("#game").submit(function(event) {
$('... | Change spec test code away from true/false; provides ping, pong, and ping pong returns instead | Change spec test code away from true/false; provides ping, pong, and ping pong returns instead
| JavaScript | mit | kcmdouglas/pingpong,kcmdouglas/pingpong | ---
+++
@@ -1,6 +1,10 @@
var pingPong = function(i) {
- if ((i % 3 === 0) || (i % 5 === 0)) {
- return true;
+ if ((i % 3 === 0) && (i % 5 != 0)) {
+ return "ping";
+ } else if ((i % 5 === 0) && (i % 6 != 0)) {
+ return "pong";
+ } else if ((i % 3 === 0) && (i % 5 === 0)) {
+ return "ping pong";
}... |
7e15fe61c4300ac591adc7a153b32d060a3feff6 | karma.conf.js | karma.conf.js | var webpack = require('webpack');
// TODO: use BowerWebpackPlugin
// var BowerWebpackPlugin = require('bower-webpack-plugin');
var webpackCommon = require('./webpack.common.config.js');
// Put in separate file?
var webpackTestConfig = {
devtool: 'inline-source-map',
plugins: [
new webpack.ResolverPlugin... | var webpack = require('webpack');
// TODO: use BowerWebpackPlugin
// var BowerWebpackPlugin = require('bower-webpack-plugin');
var webpackCommon = require('./webpack.common.config.js');
// Put in separate file?
var webpackTestConfig = {
devtool: 'inline-source-map',
plugins: [
new webpack.ResolverPlugin... | Allow karma to load plugins automatically | Allow karma to load plugins automatically
| JavaScript | apache-2.0 | samchrisinger/osf.io,cosenal/osf.io,lyndsysimon/osf.io,alexschiller/osf.io,arpitar/osf.io,mluo613/osf.io,crcresearch/osf.io,felliott/osf.io,TomBaxter/osf.io,leb2dg/osf.io,monikagrabowska/osf.io,adlius/osf.io,jeffreyliu3230/osf.io,jeffreyliu3230/osf.io,ticklemepierce/osf.io,Nesiehr/osf.io,zkraime/osf.io,jeffreyliu3230/o... | ---
+++
@@ -21,6 +21,7 @@
resolve: webpackCommon.resolve,
module: {
loaders: [
+ // Assume test files are ES6
{test: /\.test\.js$/, loader: 'babel-loader'},
]
}
@@ -45,14 +46,6 @@
webpack: webpackTestConfig,
webpackServer: {
noInf... |
06595b1ea4a93825e22a1221e6c44846e7bde1f8 | test/e2e/e2e.spec.js | test/e2e/e2e.spec.js | import { Application } from 'spectron'
import electronPath from 'electron'
import path from 'path'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000
const delay = time => new Promise(resolve => setTimeout(resolve, time))
describe('main window', function spec() {
beforeAll(async () => {
this.app = new Application({
... | import { Application } from 'spectron'
import electronPath from 'electron'
import path from 'path'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000
const delay = time => new Promise(resolve => setTimeout(resolve, time))
describe('main window', function spec() {
beforeAll(async () => {
this.app = new Application({
... | Drop pessimistic printing of logs that shouldn't be there | enhance(test): Drop pessimistic printing of logs that shouldn't be there
This test code is unnecessary in the common case and can be revived if the test
fails.
| JavaScript | mit | LN-Zap/zap-desktop,LN-Zap/zap-desktop,LN-Zap/zap-desktop | ---
+++
@@ -30,12 +30,6 @@
it('should haven\'t any logs in console of main window', async () => {
const { client } = this.app
const logs = await client.getRenderProcessLogs()
- // Print renderer process logs
- logs.forEach((log) => {
- console.log(log.message)
- console.log(log.source)
- ... |
e03b40541d8e0843c4585489a2a711ee4183e222 | cities_light/static/cities_light/autocomplete_light.js | cities_light/static/cities_light/autocomplete_light.js | $(document).ready(function() {
// autocomplete widget javascript initialization for bootstrap=countrycity
$('.autocomplete_light_widget[data-bootstrap=countrycity]').each(function() {
var country_wrapper = $(this).prev();
var city_wrapper = $(this);
function setup() {
// get... | $(document).ready(function() {
// autocomplete widget javascript initialization for bootstrap=countrycity
$('.autocomplete_light_widget[data-bootstrap=countrycity]').each(function() {
var country_wrapper = $(this).prev();
var city_wrapper = $(this);
function setup() {
// get... | Clear the city autocomplete when unselecting the country in countrycity widget | Clear the city autocomplete when unselecting the country in countrycity widget
| JavaScript | mit | max-arnold/django-cities-light,yourlabs/django-cities-light,affan2/django-cities-light,eevol/django-cities-light,gpichot/django-cities-light,eevol/django-cities-light,KevinGrahamFoster/django-cities-light,affan2/django-cities-light,greenday2/django-cities-light,max-arnold/django-cities-light,gpichot/django-cities-light | ---
+++
@@ -19,7 +19,17 @@
// set country_pk in city autocomplete data when a country is selected
country_select.bind('change', function() {
- city_deck.input.yourlabs_autocomplete().data['country__pk'] = $(this).val();
+ console.log($(this).val());
+ ... |
1030f20315b0f661993c7aca33bb3f6fb9753503 | src/components/InputArea.js | src/components/InputArea.js | import React, { Component } from 'react';
import TextField from 'material-ui/TextField';
import Card, { CardActions, CardContent } from 'material-ui/Card';
import Button from 'material-ui/Button';
import TaxCalculator from '../libs/TaxCalculator';
class TextFields extends Component {
state = {
income: 0,
ex... | import React, { Component } from 'react';
import TextField from 'material-ui/TextField';
import Card, { CardActions, CardContent } from 'material-ui/Card';
import Button from 'material-ui/Button';
import TaxCalculator from '../libs/TaxCalculator';
class TextFields extends Component {
handleSubmit(event) {
event... | Delete state and add form. | Delete state and add form.
| JavaScript | apache-2.0 | migutw42/jp-tax-calculator,migutw42/jp-tax-calculator | ---
+++
@@ -6,48 +6,49 @@
import TaxCalculator from '../libs/TaxCalculator';
class TextFields extends Component {
- state = {
- income: 0,
- expenses: 0
- };
+ handleSubmit(event) {
+ event.preventDefault();
- calculate() {
- const { income, expenses } = this.state;
- const taxInfo = TaxCalcu... |
f0c712adc291219c08ea9c1b680e258f6636cddc | lib/controllers/catalogs.js | lib/controllers/catalogs.js | const mongoose = require('mongoose');
const { omit } = require('lodash');
const Catalog = mongoose.model('Catalog');
function formatCatalog(catalog) {
return omit(catalog.toObject({ virtuals: true }), '_metrics');
}
function fetch(req, res, next, id) {
Catalog
.findById(id)
.populate('service', 'location... | const mongoose = require('mongoose');
const { omit } = require('lodash');
const Catalog = mongoose.model('Catalog');
function formatCatalog(catalog) {
return omit(catalog.toObject({ virtuals: true, minimize: false }), '_metrics');
}
function fetch(req, res, next, id) {
Catalog
.findById(id)
.populate('se... | Disable minimize for Catalog serialization | Disable minimize for Catalog serialization
| JavaScript | agpl-3.0 | inspireteam/geogw,jdesboeufs/geogw | ---
+++
@@ -4,7 +4,7 @@
const Catalog = mongoose.model('Catalog');
function formatCatalog(catalog) {
- return omit(catalog.toObject({ virtuals: true }), '_metrics');
+ return omit(catalog.toObject({ virtuals: true, minimize: false }), '_metrics');
}
function fetch(req, res, next, id) { |
69aa8d49b5a2082d2870d453521194a39a215001 | lib/append.js | lib/append.js | /**
* Insert content, specified by the parameter, to the end of each
* element in the set of matched elements.
*/
function append(el) {
var l = this.length, clone = false;
// wrap content
el = this.air(el);
// matched parent elements (targets)
this.each(function(node, index) {
//console.log(index);
... | /**
* Insert content, specified by the parameter, to the end of each
* element in the set of matched elements.
*/
function append() {
var i, l = this.length, el, args = Array.prototype.slice.call(arguments);
for(i = 0;i < args.length;i++) {
el = args[i];
// wrap content
el = this.air(el);
// ma... | Append supports multiple content args. | Append supports multiple content args.
| JavaScript | mit | socialally/air,tmpfs/air,tmpfs/air,socialally/air | ---
+++
@@ -2,23 +2,23 @@
* Insert content, specified by the parameter, to the end of each
* element in the set of matched elements.
*/
-function append(el) {
- var l = this.length, clone = false;
- // wrap content
- el = this.air(el);
- // matched parent elements (targets)
- this.each(function(node, ind... |
04bbd69917a604457ce3a3df860f3f5cb1d21c65 | app/transmute.js | app/transmute.js | #!/usr/bin/env node
'use strict';
// Load base requirements
const program = require('commander'),
dotenv = require('dotenv').config(),
path = require('path');
// Load our libraries
const utils = require('./libs/utils'),
logger = require('./libs/log'),
i18n = require('./libs/locale'),
que... | #!/usr/bin/env node
'use strict';
// Load base requirements
const program = require('commander'),
dotenv = require('dotenv').config(),
path = require('path');
// Load our libraries
const utils = require('./libs/utils'),
logger = require('./libs/log'),
i18n = require('./libs/locale'),
que... | Update entry point to use queue | Update entry point to use queue
| JavaScript | apache-2.0 | transmutejs/core | ---
+++
@@ -27,16 +27,7 @@
}
}
}).then((data) => {
-
- console.log('Task Object:');
- console.log(data);
-
- console.log('\n\n');
-
- console.log('Job Object:');
- console.log(data.jobs[0]);
-
- process.exit(0);
+ return queue.add(data);
}).catch((err) => {
console.log(err); |
7f0176380ad5ade420384d1ae4ea14a5180f05e8 | tasks/doxdox.js | tasks/doxdox.js | var doxdox = require('doxdox'),
utils = require('doxdox/lib/utils'),
fs = require('fs'),
path = require('path'),
extend = require('extend');
module.exports = function (grunt) {
grunt.registerMultiTask('doxdox', 'Generate documentation with doxdox.', function () {
var done = this.async(),
... | var doxdox = require('doxdox'),
utils = require('doxdox/lib/utils'),
fs = require('fs'),
path = require('path'),
extend = require('extend');
module.exports = function (grunt) {
grunt.registerMultiTask('doxdox', 'Generate documentation with doxdox.', function () {
var done = this.async(),
... | Use Grunt API to write file | Use Grunt API to write file
This way it guarantees that all the intermediate directories are created. | JavaScript | mit | mmarcon/grunt-doxdox,neogeek/grunt-doxdox | ---
+++
@@ -64,7 +64,7 @@
config.package
).then(function (content) {
- fs.writeFileSync(output, content, 'utf8');
+ grunt.file.write(output, content, {encoding: 'utf8'});
done();
|
b54ae8bc91ae77569048be8af229be058e81d0f8 | lib/plugins/tag/jsfiddle.js | lib/plugins/tag/jsfiddle.js | 'use strict';
/**
* jsFiddle tag
*
* Syntax:
* {% jsfiddle shorttag [tabs] [skin] [height] [width] %}
*/
function jsfiddleTag(args, content){
var id = args[0];
var tabs = args[1] && args[1] !== 'default' ? args[1] : 'js,resources,html,css,result';
var skin = args[2] && args[2] !== 'default' ? args[2] : 'light... | 'use strict';
/**
* jsFiddle tag
*
* Syntax:
* {% jsfiddle shorttag [tabs] [skin] [height] [width] %}
*/
function jsfiddleTag(args, content){
var id = args[0];
var tabs = args[1] && args[1] !== 'default' ? args[1] : 'js,resources,html,css,result';
var skin = args[2] && args[2] !== 'default' ? args[2] : 'light... | Set scrolling="no" to make iframe responsive | Set scrolling="no" to make iframe responsive
the fiddle iframe is not responsive in iOS safari and Chrome. By setting `scrolling="no"` makes it possible to fix this issue, by setting `width=1px; min-width=100%` in CSS. [See StackOverflow](http://stackoverflow.com/questions/23083462/how-to-get-an-iframe-to-be-responsiv... | JavaScript | mit | amobiz/hexo,hexojs/hexo,zhipengyan/hexo,wangjordy/wangjordy.github.io,wangjordy/wangjordy.github.io,leelynd/tapohuck,noikiy/hexo,kywk/hexi,DevinLow/DevinLow.github.io,hexojs/hexo,DevinLow/DevinLow.github.io,zhipengyan/hexo,ppker/hexo,ppker/hexo,aulphar/hexo,kywk/hexi | ---
+++
@@ -13,8 +13,8 @@
var skin = args[2] && args[2] !== 'default' ? args[2] : 'light';
var width = args[3] && args[3] !== 'default' ? args[3] : '100%';
var height = args[4] && args[4] !== 'default' ? args[4] : '300';
-
- return '<iframe width="' + width + '" height="' + height + '" src="http://jsfiddle.... |
2a774a58d510bc23eb7216543f0b4f83a5b8b481 | src/js/components/services-by-gsbpm-phase.js | src/js/components/services-by-gsbpm-phase.js | import React from 'react'
import { sparqlConnect } from '../sparql/configure-sparql'
import { LOADED } from 'sparql-connect'
import ServiceList from './service-list'
function ServicesByGSBPMPhase({ loaded, services }) {
if(loaded !== LOADED) return <span>loading......</span>
return <ServiceList
services={servi... | import React from 'react'
import { sparqlConnect } from '../sparql/configure-sparql'
import { LOADED } from 'sparql-connect'
import ServiceList from './service-list'
function ServicesByGSBPMPhase({ loaded, services }) {
return <ServiceList
services={services}
msg="No service implements this GSBPM phase"
... | Remove useless check on `loaded` | Remove useless check on `loaded`
| JavaScript | mit | UNECE/Model-Explorer,UNECE/Model-Explorer | ---
+++
@@ -4,7 +4,6 @@
import ServiceList from './service-list'
function ServicesByGSBPMPhase({ loaded, services }) {
- if(loaded !== LOADED) return <span>loading......</span>
return <ServiceList
services={services}
msg="No service implements this GSBPM phase" |
91cd5e4293ad2f85c19de4ffe69127b6936fd8ab | lib/router.js | lib/router.js | Router.configure({
layoutTemplate: 'layout'
});
Router.route('/', {
name: 'home',
waitOn: function () {
return Meteor.subscribe('verifiedUsersCount');
},
onBeforeAction: function () {
if (Meteor.user()) {
Router.go('ridesList');
} else {
this.next();
}
}
});
Router.route('/caro... | Router.configure({
layoutTemplate: 'layout'
});
Router.route('/', {
name: 'home',
waitOn: function () {
return Meteor.subscribe('verifiedUsersCount');
},
onBeforeAction: function () {
if (Meteor.user()) {
Router.go('ridesList');
} else {
this.next();
}
}
});
Router.route('/caro... | Make findOne reactive for ride owners subscription. | Make findOne reactive for ride owners subscription.
fix #9
| JavaScript | mit | obvio171/rideboard,obvio171/rideboard | ---
+++
@@ -27,10 +27,13 @@
},
waitOn: function () {
var userIds = [];
+ var subscriptions = [];
+ subscriptions.push(Meteor.subscribe('rides'));
Tracker.autorun(function () {
userIds = _(Rides.find({}, { userId: 1 }).fetch()).pluck('userId');
+ subscriptions.push(Meteor.subscribe('u... |
270c333096dbeb495571baed81c5f9debdf7d967 | lib/server.js | lib/server.js | 'use strict';
const fs = require('fs');
const express = require('express');
const send = require('send');
const morgan = require('morgan');
const errorHandler = require('errorhandler');
const compression = require('compression');
const expressLogStream = fs.createWriteStream('./logs/express.log', { flags: 'a' });
e... | 'use strict';
const fs = require('fs');
const path = require('path');
const express = require('express');
const send = require('send');
const morgan = require('morgan');
const errorHandler = require('errorhandler');
const compression = require('compression');
exports.start = function start(config) {
var statsDB =... | Create logs for each environment | Create logs for each environment
| JavaScript | mit | pfleidi/podslurp | ---
+++
@@ -1,6 +1,7 @@
'use strict';
const fs = require('fs');
+const path = require('path');
const express = require('express');
const send = require('send');
@@ -8,7 +9,6 @@
const errorHandler = require('errorhandler');
const compression = require('compression');
-const expressLogStream = fs.createWrit... |
ac6ffeea337475579d93bb0608f75197e3495b7a | gulp/config.js | gulp/config.js | var dest = './public/dist';
var src = './client';
var bowerComponents = './bower_components';
module.exports = {
adminAssets: {
src: src + '/admin/**',
dest: dest + '/admin/assets'
},
bower: {
dest: dest + '/',
filename: 'libs.min.js',
libs: [
bowerComponents + '/modernizr/modernizr.js'... | var dest = './public/dist';
var src = './client';
var bowerComponents = './bower_components';
module.exports = {
adminAssets: {
src: src + '/admin/**',
dest: dest + '/admin/assets'
},
bower: {
dest: dest + '/',
filename: 'libs.min.js',
libs: [
bowerComponents + '/modernizr/modernizr.js'... | Fix gulp live reload for less | Fix gulp live reload for less
| JavaScript | mit | risq/dihh,risq/dihh | ---
+++
@@ -32,7 +32,7 @@
},
less: {
entry: src + '/less/style.less',
- src: src + '/styles/*.css',
+ src: src + '/less/**',
dest: dest + '/'
},
images: { |
cb17adbc69f22307c2d3c4e64adec64c6f200511 | src/image-gallery.js | src/image-gallery.js |
(function () {
var addImageGallery = function(post) {
if(post.length && !post.hasClass('smi-img-gallery')) {
console.log('POST: ', post);
post.addClass('smi-img-gallery');
post.find('img').each(function(){
var img = $(this);
var link = img.attr('src');
if(!link || ... |
(function () {
var addImageGallery = function(post) {
if(post.length && !post.hasClass('smi-img-gallery')) {
console.log('POST: ', post);
post.addClass('smi-img-gallery');
post.find('img').each(function(){
var img = $(this);
var link = img.attr('src');
if(!link || ... | Fix galley close on esc | Fix galley close on esc
| JavaScript | mit | armandocat/steemit-more-info,armandocat/steemit-more-info | ---
+++
@@ -20,8 +20,15 @@
a.append(img);
});
- post.find('a.smi-post-img').fancybox({
- loop: true
+ var fb = post.find('a.smi-post-img').fancybox({
+ loop: true,
+
+ beforeClose: function(instance, current, event){
+ if(event && event.stopPropagation){
+ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.