commit
stringlengths 40
40
| old_file
stringlengths 4
236
| new_file
stringlengths 4
236
| old_contents
stringlengths 1
3.26k
| new_contents
stringlengths 16
4.43k
| subject
stringlengths 16
624
| message
stringlengths 17
3.29k
| lang
stringclasses 5
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
|
|---|---|---|---|---|---|---|---|---|---|
429317e11c1c9f4394b3fc27de0b5da23bdbb0d5
|
app/js/arethusa.relation/directives/nested_menu_collection.js
|
app/js/arethusa.relation/directives/nested_menu_collection.js
|
"use strict";
angular.module('arethusa.relation').directive('nestedMenuCollection', function() {
return {
restrict: 'A',
replace: 'true',
scope: {
current: '=',
all: '=',
property: '=',
ancestors: '=',
emptyVal: '@',
labelAs: "=",
change: "&"
},
link: function(scope, element, attrs) {
scope.emptyLabel = "";
scope.emptyObj = {};
scope.$watch('current[property]', function(newVal, oldVal) {
if (newVal !== oldVal) {
scope.change({ obj: scope.current });
}
});
scope.labelView = function(labelObj) {
if (scope.labelAs) {
return labelObj[scope.labelAs];
} else {
return labelObj.short;
}
};
},
template: '\
<ul>\
<li ng-if="emptyVal"\
nested-menu\
property="property"\
rel-obj="current"\
ancestors="ancestors"\
change="change"\
label="emptyLabel"\
label-obj="emptyObj">\
</li>\
<li\
ng-repeat="label in all | keys"\
nested-menu\
property="property"\
rel-obj="current"\
ancestors="ancestors"\
label="labelView(all[label])"\
label-as="labelAs"\
label-obj="all[label]">\
</li>\
</ul>\
'
};
});
|
"use strict";
angular.module('arethusa.relation').directive('nestedMenuCollection', function() {
return {
restrict: 'A',
replace: 'true',
scope: {
current: '=',
all: '=',
property: '=',
ancestors: '=',
emptyVal: '@',
labelAs: "=",
},
link: function(scope, element, attrs) {
scope.emptyLabel = "";
scope.emptyObj = {};
scope.labelView = function(labelObj) {
if (scope.labelAs) {
return labelObj[scope.labelAs];
} else {
return labelObj.short;
}
};
},
template: '\
<ul>\
<li ng-if="emptyVal"\
nested-menu\
property="property"\
rel-obj="current"\
ancestors="ancestors"\
label="emptyLabel"\
label-obj="emptyObj">\
</li>\
<li\
ng-repeat="label in all | keys"\
nested-menu\
property="property"\
rel-obj="current"\
ancestors="ancestors"\
label="labelView(all[label])"\
label-as="labelAs"\
label-obj="all[label]">\
</li>\
</ul>\
'
};
});
|
Remove change fn from nestedMenuCollection
|
Remove change fn from nestedMenuCollection
|
JavaScript
|
mit
|
Masoumeh/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,PonteIneptique/arethusa
|
b740bdf7394e7325e174d7d4ccab1e1c185240f7
|
app/scripts/components/issues/comments/issue-comments-form.js
|
app/scripts/components/issues/comments/issue-comments-form.js
|
import template from './issue-comments-form.html';
class IssueCommentsFormController {
// @ngInject
constructor($rootScope, issueCommentsService) {
this.$rootScope = $rootScope;
this.issueCommentsService = issueCommentsService;
}
submit() {
var form = this.issueCommentsService.$create(this.issue.url + 'comment/');
form.description = this.description;
this.submitting = true;
return form.$save().then(() => {
this.description = '';
this.$rootScope.$emit('refreshCommentsList');
}).finally(() => {
this.submitting = false;
});
}
}
const issueCommentsForm = {
template,
controller: IssueCommentsFormController,
bindings: {
issue: '<',
},
};
export default issueCommentsForm;
|
import template from './issue-comments-form.html';
class IssueCommentsFormController {
// @ngInject
constructor($rootScope, issueCommentsService, ncUtilsFlash) {
this.$rootScope = $rootScope;
this.issueCommentsService = issueCommentsService;
this.ncUtilsFlash = ncUtilsFlash;
}
submit() {
var form = this.issueCommentsService.$create(this.issue.url + 'comment/');
form.description = this.description;
this.submitting = true;
return form.$save().then(() => {
this.description = '';
this.$rootScope.$emit('refreshCommentsList');
this.ncUtilsFlash.success(gettext('Comment has been added.'));
})
.catch(() => {
this.ncUtilsFlash.error(gettext('Unable to add comment.'));
})
.finally(() => {
this.submitting = false;
});
}
}
const issueCommentsForm = {
template,
controller: IssueCommentsFormController,
bindings: {
issue: '<',
},
};
export default issueCommentsForm;
|
Add notifications for comment create processing [WAL-1036].
|
Add notifications for comment create processing [WAL-1036].
|
JavaScript
|
mit
|
opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport
|
8b321a6c8a960f222477682e447e405971c4548e
|
website/addons/figshare/static/figshareFangornConfig.js
|
website/addons/figshare/static/figshareFangornConfig.js
|
var m = require('mithril');
var Fangorn = require('fangorn');
// Although this is empty it should stay here. Fangorn is going to look for figshare in it's config file.
Fangorn.config.figshare = {
};
|
var m = require('mithril');
var Fangorn = require('fangorn');
// Define Fangorn Button Actions
function _fangornActionColumn (item, col) {
var self = this;
var buttons = [];
if (item.kind === 'folder') {
buttons.push(
{
'name' : '',
'tooltip' : 'Upload files',
'icon' : 'icon-upload-alt',
'css' : 'fangorn-clickable btn btn-default btn-xs',
'onclick' : Fangorn.ButtonEvents._uploadEvent
}
);
}
if (item.kind === 'file' && item.data.extra && item.data.extra.status === 'public') {
buttons.push({
'name' : '',
'tooltip' : 'Download file',
'icon' : 'icon-download-alt',
'css' : 'btn btn-info btn-xs',
'onclick' : Fangorn.ButtonEvents._downloadEvent
});
}
if (item.kind === 'file' && item.data.extra && item.data.extra.status !== 'public') {
buttons.push({
'name' : '',
'icon' : 'icon-remove',
'tooltip' : 'Delete',
'css' : 'm-l-lg text-danger fg-hover-hide',
'style' : 'display:none',
'onclick' : Fangorn.ButtonEvents._removeEvent
});
}
return buttons.map(function(btn) {
return m('span', { 'data-col' : item.id }, [ m('i',{
'class' : btn.css,
style : btn.style,
'data-toggle' : 'tooltip', title : btn.tooltip, 'data-placement': 'bottom',
'onclick' : function(event){ btn.onclick.call(self, event, item, col); }
},
[ m('span', { 'class' : btn.icon}, btn.name) ])
]);
});
}
Fangorn.config.figshare = {
// Fangorn options are called if functions, so return a thunk that returns the column builder
resolveActionColumn: function() {return _fangornActionColumn;}
};
|
Repair removed figshare checks for action buttons
|
Repair removed figshare checks for action buttons
|
JavaScript
|
apache-2.0
|
hmoco/osf.io,cldershem/osf.io,barbour-em/osf.io,binoculars/osf.io,bdyetton/prettychart,sbt9uc/osf.io,SSJohns/osf.io,brandonPurvis/osf.io,samchrisinger/osf.io,bdyetton/prettychart,mfraezz/osf.io,baylee-d/osf.io,asanfilippo7/osf.io,felliott/osf.io,binoculars/osf.io,brandonPurvis/osf.io,wearpants/osf.io,monikagrabowska/osf.io,mluo613/osf.io,zamattiac/osf.io,RomanZWang/osf.io,Johnetordoff/osf.io,GageGaskins/osf.io,pattisdr/osf.io,ckc6cz/osf.io,zkraime/osf.io,jinluyuan/osf.io,zachjanicki/osf.io,arpitar/osf.io,billyhunt/osf.io,jmcarp/osf.io,cldershem/osf.io,petermalcolm/osf.io,chennan47/osf.io,samanehsan/osf.io,ticklemepierce/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,Ghalko/osf.io,mattclark/osf.io,caneruguz/osf.io,mluo613/osf.io,saradbowman/osf.io,dplorimer/osf,Ghalko/osf.io,chennan47/osf.io,mluke93/osf.io,lyndsysimon/osf.io,kwierman/osf.io,jnayak1/osf.io,caseyrygt/osf.io,ZobairAlijan/osf.io,samchrisinger/osf.io,doublebits/osf.io,TomBaxter/osf.io,cslzchen/osf.io,ZobairAlijan/osf.io,sloria/osf.io,aaxelb/osf.io,ZobairAlijan/osf.io,KAsante95/osf.io,HalcyonChimera/osf.io,zamattiac/osf.io,alexschiller/osf.io,GageGaskins/osf.io,jinluyuan/osf.io,leb2dg/osf.io,petermalcolm/osf.io,bdyetton/prettychart,DanielSBrown/osf.io,icereval/osf.io,samanehsan/osf.io,Nesiehr/osf.io,cosenal/osf.io,kushG/osf.io,fabianvf/osf.io,cldershem/osf.io,barbour-em/osf.io,kwierman/osf.io,brianjgeiger/osf.io,zkraime/osf.io,mluo613/osf.io,GageGaskins/osf.io,cslzchen/osf.io,emetsger/osf.io,asanfilippo7/osf.io,mfraezz/osf.io,samchrisinger/osf.io,RomanZWang/osf.io,mluo613/osf.io,doublebits/osf.io,RomanZWang/osf.io,danielneis/osf.io,ckc6cz/osf.io,laurenrevere/osf.io,TomHeatwole/osf.io,samanehsan/osf.io,mattclark/osf.io,jeffreyliu3230/osf.io,DanielSBrown/osf.io,rdhyee/osf.io,erinspace/osf.io,TomHeatwole/osf.io,himanshuo/osf.io,acshi/osf.io,wearpants/osf.io,zachjanicki/osf.io,chennan47/osf.io,HalcyonChimera/osf.io,revanthkolli/osf.io,amyshi188/osf.io,amyshi188/osf.io,Johnetordoff/osf.io,lamdnhan/osf.io,KAsante95/osf.io,zachjanicki/osf.io,baylee-d/osf.io,himanshuo/osf.io,kch8qx/osf.io,arpitar/osf.io,kushG/osf.io,dplorimer/osf,arpitar/osf.io,caneruguz/osf.io,jolene-esposito/osf.io,jinluyuan/osf.io,ticklemepierce/osf.io,sbt9uc/osf.io,kch8qx/osf.io,jinluyuan/osf.io,reinaH/osf.io,TomHeatwole/osf.io,aaxelb/osf.io,cosenal/osf.io,danielneis/osf.io,lyndsysimon/osf.io,asanfilippo7/osf.io,jmcarp/osf.io,lamdnhan/osf.io,icereval/osf.io,reinaH/osf.io,asanfilippo7/osf.io,mluke93/osf.io,cwisecarver/osf.io,ZobairAlijan/osf.io,TomBaxter/osf.io,ckc6cz/osf.io,fabianvf/osf.io,leb2dg/osf.io,doublebits/osf.io,dplorimer/osf,alexschiller/osf.io,Nesiehr/osf.io,caseyrollins/osf.io,brandonPurvis/osf.io,danielneis/osf.io,samchrisinger/osf.io,sloria/osf.io,DanielSBrown/osf.io,chrisseto/osf.io,binoculars/osf.io,wearpants/osf.io,billyhunt/osf.io,arpitar/osf.io,baylee-d/osf.io,brianjgeiger/osf.io,hmoco/osf.io,bdyetton/prettychart,sbt9uc/osf.io,zachjanicki/osf.io,zamattiac/osf.io,MerlinZhang/osf.io,chrisseto/osf.io,crcresearch/osf.io,brianjgeiger/osf.io,MerlinZhang/osf.io,rdhyee/osf.io,hmoco/osf.io,danielneis/osf.io,petermalcolm/osf.io,HarryRybacki/osf.io,abought/osf.io,kushG/osf.io,monikagrabowska/osf.io,ticklemepierce/osf.io,mfraezz/osf.io,reinaH/osf.io,njantrania/osf.io,MerlinZhang/osf.io,acshi/osf.io,leb2dg/osf.io,CenterForOpenScience/osf.io,icereval/osf.io,KAsante95/osf.io,adlius/osf.io,dplorimer/osf,alexschiller/osf.io,doublebits/osf.io,cosenal/osf.io,jnayak1/osf.io,revanthkolli/osf.io,KAsante95/osf.io,aaxelb/osf.io,mfraezz/osf.io,kwierman/osf.io,amyshi188/osf.io,sloria/osf.io,billyhunt/osf.io,GageGaskins/osf.io,adlius/osf.io,haoyuchen1992/osf.io,njantrania/osf.io,emetsger/osf.io,CenterForOpenScience/osf.io,caneruguz/osf.io,kushG/osf.io,mluke93/osf.io,himanshuo/osf.io,pattisdr/osf.io,monikagrabowska/osf.io,brandonPurvis/osf.io,caseyrollins/osf.io,Ghalko/osf.io,wearpants/osf.io,jolene-esposito/osf.io,jmcarp/osf.io,mattclark/osf.io,crcresearch/osf.io,erinspace/osf.io,revanthkolli/osf.io,Johnetordoff/osf.io,crcresearch/osf.io,jeffreyliu3230/osf.io,acshi/osf.io,barbour-em/osf.io,kwierman/osf.io,HalcyonChimera/osf.io,mluo613/osf.io,SSJohns/osf.io,Nesiehr/osf.io,jolene-esposito/osf.io,chrisseto/osf.io,amyshi188/osf.io,jmcarp/osf.io,adlius/osf.io,RomanZWang/osf.io,cslzchen/osf.io,chrisseto/osf.io,HarryRybacki/osf.io,haoyuchen1992/osf.io,jnayak1/osf.io,lyndsysimon/osf.io,kch8qx/osf.io,caseyrygt/osf.io,Nesiehr/osf.io,njantrania/osf.io,adlius/osf.io,abought/osf.io,ckc6cz/osf.io,sbt9uc/osf.io,fabianvf/osf.io,jolene-esposito/osf.io,haoyuchen1992/osf.io,HalcyonChimera/osf.io,cwisecarver/osf.io,DanielSBrown/osf.io,SSJohns/osf.io,reinaH/osf.io,samanehsan/osf.io,MerlinZhang/osf.io,emetsger/osf.io,jnayak1/osf.io,zkraime/osf.io,RomanZWang/osf.io,saradbowman/osf.io,SSJohns/osf.io,GaryKriebel/osf.io,fabianvf/osf.io,GaryKriebel/osf.io,abought/osf.io,njantrania/osf.io,KAsante95/osf.io,rdhyee/osf.io,zamattiac/osf.io,felliott/osf.io,GaryKriebel/osf.io,TomHeatwole/osf.io,acshi/osf.io,cslzchen/osf.io,Ghalko/osf.io,monikagrabowska/osf.io,barbour-em/osf.io,cwisecarver/osf.io,cosenal/osf.io,billyhunt/osf.io,jeffreyliu3230/osf.io,cldershem/osf.io,laurenrevere/osf.io,lamdnhan/osf.io,GaryKriebel/osf.io,ticklemepierce/osf.io,monikagrabowska/osf.io,pattisdr/osf.io,mluke93/osf.io,cwisecarver/osf.io,acshi/osf.io,TomBaxter/osf.io,leb2dg/osf.io,lamdnhan/osf.io,abought/osf.io,felliott/osf.io,zkraime/osf.io,caseyrollins/osf.io,aaxelb/osf.io,felliott/osf.io,caseyrygt/osf.io,erinspace/osf.io,rdhyee/osf.io,HarryRybacki/osf.io,brianjgeiger/osf.io,emetsger/osf.io,hmoco/osf.io,lyndsysimon/osf.io,laurenrevere/osf.io,CenterForOpenScience/osf.io,caseyrygt/osf.io,doublebits/osf.io,GageGaskins/osf.io,caneruguz/osf.io,kch8qx/osf.io,jeffreyliu3230/osf.io,haoyuchen1992/osf.io,revanthkolli/osf.io,billyhunt/osf.io,himanshuo/osf.io,kch8qx/osf.io,HarryRybacki/osf.io,petermalcolm/osf.io,alexschiller/osf.io,alexschiller/osf.io,brandonPurvis/osf.io
|
05eb13e445bd7adb0a7ca0d0fbb44968093a3f9f
|
lib/query/query.server.js
|
lib/query/query.server.js
|
import createGraph from './lib/createGraph.js';
import prepareForProcess from './lib/prepareForProcess.js';
import hypernova from './hypernova/hypernova.js';
import Base from './query.base';
export default class Query extends Base {
/**
* Retrieves the data.
* @param context
* @returns {*}
*/
fetch(context = {}) {
const node = createGraph(
this.collection,
prepareForProcess(this.body, this.params)
);
return hypernova(node, context.userId, {params: this.params});
}
/**
* @param args
* @returns {*}
*/
fetchOne(...args) {
return _.first(this.fetch(...args));
}
/**
* Gets the count of matching elements.
* @returns {integer}
*/
getCount() {
return this.collection.find(this.body.$filters || {}, {}).count();
}
}
|
import createGraph from './lib/createGraph.js';
import prepareForProcess from './lib/prepareForProcess.js';
import hypernova from './hypernova/hypernova.js';
import Base from './query.base';
export default class Query extends Base {
/**
* Retrieves the data.
* @param context
* @returns {*}
*/
fetch(context = {}) {
const node = createGraph(
this.collection,
prepareForProcess(this.body, this.params)
);
return hypernova(node, context.userId, {params: this.params});
}
/**
* @param context
* @returns {*}
*/
fetchOne(context = {}) {
context.$options = context.$options || {};
context.$options.limit = 1;
return this.fetch(context);
}
/**
* Gets the count of matching elements.
* @returns {integer}
*/
getCount() {
return this.collection.find(this.body.$filters || {}, {}).count();
}
}
|
Improve fetchOne to only return 1 result
|
Improve fetchOne to only return 1 result
Inspired by meteor's findOne
|
JavaScript
|
mit
|
cult-of-coders/grapher
|
6215189a16e91c771ed0d4a2f1a83493625480ee
|
api/server/boot/install.js
|
api/server/boot/install.js
|
'use strict';
var installed=true;
module.exports = function (app) {
if (!installed) {
var User = app.models.User;
var Role = app.models.Role;
var RoleMapping = app.models.RoleMapping;
var cb = function (m) {
console.log(m)
};
User.create([
{username: 'admin', email: 'admin@contact.com', password: 'admin'}
], function (err, users) {
if (err) return cb(err);
//create the admin role
Role.create({
name: 'administrator'
}, function (err, role) {
if (err) cb(err);
//make bob an admin
role.principals.create({
principalType: RoleMapping.USER,
principalId: users[0].id
}, function (err, principal) {
cb(err);
});
});
});
}
};
|
'use strict';
var installed=true;
module.exports = function (app) {
if (!installed) {
var Account = app.models.Account;
var Role = app.models.Role;
var RoleMapping = app.models.RoleMapping;
var cb = function (m) {
console.log(m)
};
Account.create([
{username: 'admin', email: 'admin@contact.com', password: 'admin', firstName: "Super", lastName: "Admin"}
], function (err, Accounts) {
if (err) return cb(err);
//create the admin role
Role.create({
name: 'administrator'
}, function (err, role) {
if (err) cb(err);
//make bob an admin
role.principals.create({
principalType: RoleMapping.Account,
principalId: Accounts[0].id
}, function (err, principal) {
cb(err);
});
});
});
}
};
|
Use new Account model to create admin user
|
Use new Account model to create admin user
|
JavaScript
|
mpl-2.0
|
enimiste/ng4-loopback-blog-tutorial,enimiste/ng4-loopback-blog-tutorial,enimiste/ng4-loopback-blog-tutorial
|
deff306984bfb46dec7d5ac494a7f2bcb18cfc53
|
app/resonant-reference-app/views/widgets/MappingView/index.js
|
app/resonant-reference-app/views/widgets/MappingView/index.js
|
import Backbone from 'backbone';
import myTemplate from './index.jade';
let MappingView = Backbone.View.extend({
initialize: function () {
},
render: function () {
this.$el.html(myTemplate());
}
});
export default MappingView;
|
import Backbone from 'backbone';
import myTemplate from './index.jade';
import candela from '../../../../../src';
let MappingView = Backbone.View.extend({
initialize: function () {
},
render: function () {
const spec = candela.components.Scatter.options;
const fields = spec.filter((opt) => opt.selector && opt.selector[0] === 'field');
console.log(fields);
this.$el.html(myTemplate());
}
});
export default MappingView;
|
Gather some information about field selectors
|
Gather some information about field selectors
|
JavaScript
|
apache-2.0
|
Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela,Kitware/candela
|
7e9b2abdd8fb3fbd799f8300a4b22269643831f0
|
client/components/Location/Entriex/Creation/index.js
|
client/components/Location/Entriex/Creation/index.js
|
var ui = require('tresdb-ui');
var emitter = require('component-emitter');
var template = require('./template.ejs');
var FormView = require('../../../Entry/Form');
// Remember contents of unsubmitted forms during the session.
// Cases where necessary:
// - user fills the form but then exits to the map to search relevant info
// - user fills the form but cancels by accident or to continue later
//
var formMemory = {}; // locId -> entryData
module.exports = function (location) {
// Parameters:
// location
// location object
// NOTE only location id is needed but the view generalization in
// Location/Forms forces location argument
//
var self = this;
emitter(self);
var children = {};
var locationId = location._id;
var startFormMemory = function () {
formMemory[locationId] = {};
};
var getFormMemory = function () {
return formMemory[locationId];
};
var setFormMemory = function (entryData) {
if (entryData && locationId in formMemory) {
formMemory[locationId] = entryData;
}
};
var hasFormMemory = function () {
return (locationId in formMemory);
};
var stopFormMemory = function () {
delete formMemory[locationId];
};
self.bind = function ($mount) {
$mount.html(template({}));
if (hasFormMemory()) {
children.form = new FormView(locationId, getFormMemory());
} else {
children.form = new FormView(locationId);
startFormMemory();
}
children.form.bind($mount.find('.entry-form-container'));
children.form.once('exit', function () {
setFormMemory(children.form.getEntryData({ complete: true }));
self.emit('exit');
});
children.form.on('success', function () {
stopFormMemory();
self.emit('exit');
});
};
self.unbind = function () {
// Memorize form contents on sudden exit if memory not stopped.
if (children.form && hasFormMemory()) {
setFormMemory(children.form.getEntryData({ complete: true }));
}
// Unbind
ui.unbindAll(children);
};
};
|
var ui = require('tresdb-ui');
var emitter = require('component-emitter');
var template = require('./template.ejs');
var FormView = require('../../../Entry/Form');
module.exports = function (location) {
// Parameters:
// location
// location object
// NOTE only location id is needed but the view generalization in
// Location/Forms forces the full location argument
//
var self = this;
emitter(self);
var children = {};
var locationId = location._id;
self.bind = function ($mount) {
$mount.html(template({}));
children.form = new FormView(locationId);
children.form.bind($mount.find('.entry-form-container'));
children.form.once('exit', function () {
self.emit('exit');
});
children.form.once('success', function () {
self.emit('exit');
});
};
self.unbind = function () {
ui.unbindAll(children);
children = {};
};
};
|
Remove duplicate draft saving features at Location Entries Creation
|
Remove duplicate draft saving features at Location Entries Creation
|
JavaScript
|
mit
|
axelpale/tresdb,axelpale/tresdb
|
358406f12becb20701ad28ec28da3fd974fd4e95
|
test/reject-spec.js
|
test/reject-spec.js
|
import { expect } from 'chai';
import u from '../lib';
describe('u.reject', () => {
it('freezes the result', () => {
expect(Object.isFrozen(u.reject('a', []))).to.be.true;
});
});
|
import { expect } from 'chai';
import u from '../lib';
describe('u.reject', () => {
it('can reject by index', () => {
const result = u.reject((_, index) => index === 1, [3, 4, 5]);
expect(result).to.eql([3, 5]);
});
it('freezes the result', () => {
expect(Object.isFrozen(u.reject('a', []))).to.be.true;
});
});
|
Add spec for reject by index
|
Add spec for reject by index
|
JavaScript
|
mit
|
substantial/updeep,substantial/updeep
|
b0966f22c8ff90a61d87215f3f1e588f4171895c
|
jest.config.js
|
jest.config.js
|
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
module.exports = {
roots: ["<rootDir>/src/main/javascript"],
collectCoverage: false,
collectCoverageFrom: ["**/*.js", "!**/*.{test,spec}.js", "!**/__tests__/**", "!**/WEB-INF/**"],
coverageDirectory: "<rootDir>/target/js-coverage",
testURL: "http://localhost",
testEnvironment: "jsdom",
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/src/test/javascript/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/src/test/javascript/__mocks__/styleMock.js",
},
};
|
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
module.exports = {
roots: ["<rootDir>/src/main/javascript"],
collectCoverage: false,
collectCoverageFrom: ["**/*.js", "!**/*.{test,spec}.js", "!**/__tests__/**", "!**/WEB-INF/**"],
coverageDirectory: "<rootDir>/target/js-coverage",
testEnvironment: "jsdom",
testEnvironmentOptions: {
url: "http://localhost"
},
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/src/test/javascript/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/src/test/javascript/__mocks__/styleMock.js",
},
};
|
Migrate deprecated jest testUrl to testEnvironmentOptions.url
|
Migrate deprecated jest testUrl to testEnvironmentOptions.url
|
JavaScript
|
apache-2.0
|
synyx/urlaubsverwaltung,synyx/urlaubsverwaltung,synyx/urlaubsverwaltung,synyx/urlaubsverwaltung
|
1c99a4bcf99b3af5563bed97beedca61727ae3b7
|
js/src/util.js
|
js/src/util.js
|
const path = (props, obj) => {
let nested = obj;
const properties = typeof props === 'string' ? props.split('.') : props;
for (let i = 0; i < properties.length; i++) {
nested = nested[properties[i]];
if (nested === undefined) {
return nested;
}
}
return nested;
};
module.exports = {
path,
};
|
/** Wrap DOM selector methods:
* document.querySelector,
* document.getElementById,
* document.getElementsByClassName]
*/
const dom = {
query(...args) {
return document.querySelector(args);
},
id(...args) {
return document.getElementById(args);
},
class(...args) {
return document.getElementsByClassName(args);
},
};
/**
* Returns a (nested) propery from an object, or undefined if it doesn't exist
* @param {String | Array} props - An array of properties or a single property
* @param {Object | Array} obj
*/
const path = (props, obj) => {
let nested = obj;
const properties = typeof props === 'string' ? props.split('.') : props;
for (let i = 0; i < properties.length; i++) {
nested = nested[properties[i]];
if (nested === undefined) {
return nested;
}
}
return nested;
};
module.exports = {
dom,
path,
};
|
Update dom methods to avoid illegal invocation error.
|
Update dom methods to avoid illegal invocation error.
|
JavaScript
|
mit
|
adrice727/accelerator-core-js,opentok/accelerator-core-js,opentok/accelerator-core-js,adrice727/accelerator-core-js
|
b26979135e1d39a8294abd664b8bb23c8b135748
|
Gulpfile.js
|
Gulpfile.js
|
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var template = require('gulp-template');
var bower = require('./bower.json');
var dist_dir = './'
var dist_file = 'launchpad.js';
gulp.task('version', function(){
return gulp.src('template/version.js')
.pipe(template(bower))
.pipe(gulp.dest('src/'));
});
gulp.task('concat', ['version'], function(){
return gulp.src(['src/**.js'])
.pipe(concat(dist_file, { newLine: ';' }))
.pipe(gulp.dest(dist_dir));
});
gulp.task('compress', ['concat'], function(){
return gulp.src(dist_file)
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(dist_dir));
});
gulp.task('default', ['compress'], function(){
/* noting to do here */
});
|
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var template = require('gulp-template');
var KarmaServer = require('karma').Server;
var bower = require('./bower.json');
var dist_dir = './'
var dist_file = 'launchpad.js';
gulp.task('version', function(){
return gulp.src('template/version.js')
.pipe(template(bower))
.pipe(gulp.dest('src/'));
});
gulp.task('concat', ['version'], function(){
return gulp.src(['src/**.js'])
.pipe(concat(dist_file, { newLine: ';' }))
.pipe(gulp.dest(dist_dir));
});
gulp.task('compress', ['concat'], function(){
return gulp.src(dist_file)
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(dist_dir));
});
gulp.task('test', ['compress'], function(done){
new KarmaServer({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start()
});
gulp.task('default', ['compress'], function(){
/* noting to do here */
});
|
Create a gulp test target
|
Create a gulp test target
|
JavaScript
|
mit
|
dvberkel/LaunchpadJS
|
2e79e9b49dd49fb72923a45f44ced0608394c409
|
qml/js/logic/channelPageLogic.js
|
qml/js/logic/channelPageLogic.js
|
.import "../applicationShared.js" as Globals
function workerOnMessage(messageObject) {
if(messageObject.apiMethod === 'channels.history') {
addMessagesToModel(messageObject.data);
} else if(messageObject.apiMethod === 'channels.info') {
addChannelInfoToPage(messageObject.data);
} else {
console.log("Unknown api method");
}
}
function loadChannelInfo() {
var arguments = {
channel: channelPage.channelID,
count: 42
}
slackWorker.sendMessage({'apiMethod': "channels.info", 'token': Globals.slackToken, 'arguments': arguments });
}
function loadChannelHistory() {
slackWorker.sendMessage({'apiMethod': "channels.history", 'token': Globals.slackToken});
}
// private
function addMessagesToModel(data) {
for(var i=0; i<data.messages.length; i++) {
channelList.append(data.messages[i]);
}
}
function addChannelInfoToPage(data) {
channelPage.channelPurpose = data.channel.purpose.value;
}
|
.import "../applicationShared.js" as Globals
function workerOnMessage(messageObject) {
if(messageObject.apiMethod === 'channels.history') {
addMessagesToModel(messageObject.data);
} else if(messageObject.apiMethod === 'channels.info') {
addChannelInfoToPage(messageObject.data);
} else {
console.log("Unknown api method");
}
}
function loadChannelInfo() {
var arguments = {
channel: channelPage.channelID
}
slackWorker.sendMessage({'apiMethod': "channels.info", 'token': Globals.slackToken, 'arguments': arguments });
}
function loadChannelHistory() {
slackWorker.sendMessage({'apiMethod': "channels.history", 'token': Globals.slackToken});
}
// private
function addMessagesToModel(data) {
for(var i=0; i<data.messages.length; i++) {
channelList.append(data.messages[i]);
}
}
function addChannelInfoToPage(data) {
channelPage.channelPurpose = data.channel.purpose.value;
}
|
Remove invalid argument of channel.info method
|
Remove invalid argument of channel.info method
|
JavaScript
|
mit
|
neversun/Slackfish,neversun/Slackfish
|
1452ae94cec46f13e888a3e80e2ce54ee552bf3f
|
dist/babelify-config.js
|
dist/babelify-config.js
|
const babelifyConfig = {
presets: [
['@babel/preset-env', {
'useBuiltIns': 'entry',
}],
],
extensions: '.ts',
}
module.exports = babelifyConfig;
|
const babelifyConfig = {
presets: [
['@babel/preset-env', {
'useBuiltIns': 'entry',
'targets': {
'firefox': 50,
'chrome': 45,
'opera': 32,
'safari': 11,
},
}],
],
extensions: '.ts',
}
module.exports = babelifyConfig;
|
Use explicit targets for babel-preset-env
|
Use explicit targets for babel-preset-env
This reduces bundle size by 5 KiB.
|
JavaScript
|
agpl-3.0
|
threema-ch/threema-web,threema-ch/threema-web,threema-ch/threema-web,threema-ch/threema-web,threema-ch/threema-web
|
3a270f06122001df0204cce8dbd7697748659183
|
app/assets/javascripts/student_profile_v2/academic_summary.js
|
app/assets/javascripts/student_profile_v2/academic_summary.js
|
(function() {
window.shared || (window.shared = {});
var dom = window.shared.ReactHelpers.dom;
var createEl = window.shared.ReactHelpers.createEl;
var merge = window.shared.ReactHelpers.merge;
var PropTypes = window.shared.PropTypes;
var styles = {
caption: {
marginRight: 5
},
value: {
fontWeight: 'bold'
},
sparklineContainer: {
paddingLeft: 15,
paddingRight: 15
}
};
var AcademicSummary = window.shared.AcademicSummary = React.createClass({
displayName: 'AcademicSummary',
propTypes: {
caption: React.PropTypes.string.isRequired,
value: PropTypes.nullable(React.PropTypes.number.isRequired),
sparkline: React.PropTypes.element.isRequired
},
render: function() {
return dom.div({ className: 'AcademicSummary' },
dom.div({},
dom.span({ style: styles.caption }, this.props.caption + ':'),
dom.span({ style: styles.value }, (this.props.value === undefined) ? 'none' : this.props.value)
),
dom.div({ style: styles.sparklineContainer }, this.props.sparkline)
);
}
});
})();
|
(function() {
window.shared || (window.shared = {});
var dom = window.shared.ReactHelpers.dom;
var createEl = window.shared.ReactHelpers.createEl;
var merge = window.shared.ReactHelpers.merge;
var PropTypes = window.shared.PropTypes;
var styles = {
caption: {
marginRight: 5
},
value: {
fontWeight: 'bold'
},
sparklineContainer: {
paddingLeft: 15,
paddingRight: 15
},
textContainer: {
paddingBottom: 5
}
};
var AcademicSummary = window.shared.AcademicSummary = React.createClass({
displayName: 'AcademicSummary',
propTypes: {
caption: React.PropTypes.string.isRequired,
value: PropTypes.nullable(React.PropTypes.number.isRequired),
sparkline: React.PropTypes.element.isRequired
},
render: function() {
return dom.div({ className: 'AcademicSummary' },
dom.div({ style: styles.textContainer },
dom.span({ style: styles.caption }, this.props.caption + ':'),
dom.span({ style: styles.value }, (this.props.value === undefined) ? 'none' : this.props.value)
),
dom.div({ style: styles.sparklineContainer }, this.props.sparkline)
);
}
});
})();
|
Tweak padding on summary text
|
Tweak padding on summary text
|
JavaScript
|
mit
|
studentinsights/studentinsights,studentinsights/studentinsights,jhilde/studentinsights,erose/studentinsights,erose/studentinsights,jhilde/studentinsights,erose/studentinsights,studentinsights/studentinsights,erose/studentinsights,jhilde/studentinsights,jhilde/studentinsights,studentinsights/studentinsights
|
725c60ab2f75a085cde14843ad2f6a73eab8cb76
|
src/Oro/Bundle/FilterBundle/Resources/public/js/map-filter-module-name.js
|
src/Oro/Bundle/FilterBundle/Resources/public/js/map-filter-module-name.js
|
define(function() {
'use strict';
var moduleNameTemplate = 'oro/filter/{{type}}-filter';
var types = {
string: 'choice',
choice: 'select',
single_choice: 'select',
selectrow: 'select-row',
multichoice: 'multiselect',
boolean: 'select'
};
return function(type) {
return moduleNameTemplate.replace('{{type}}', types[type] || type);
};
});
|
define(function() {
'use strict';
var moduleNameTemplate = 'oro/filter/{{type}}-filter';
var types = {
string: 'choice',
choice: 'select',
single_choice: 'select',
selectrow: 'select-row',
multichoice: 'multiselect',
boolean: 'select',
dictionary: 'dictionary'
};
return function(type) {
return moduleNameTemplate.replace('{{type}}', types[type] || type);
};
});
|
Modify frontend component to load proper filters for both enum and dictionary types
|
BAP-8615: Modify frontend component to load proper filters for both enum and dictionary types
|
JavaScript
|
mit
|
geoffroycochard/platform,orocrm/platform,hugeval/platform,Djamy/platform,hugeval/platform,northdakota/platform,ramunasd/platform,trustify/oroplatform,trustify/oroplatform,2ndkauboy/platform,northdakota/platform,ramunasd/platform,orocrm/platform,trustify/oroplatform,Djamy/platform,geoffroycochard/platform,2ndkauboy/platform,ramunasd/platform,2ndkauboy/platform,hugeval/platform,Djamy/platform,orocrm/platform,northdakota/platform,geoffroycochard/platform
|
f0b4e3cc48e61b221fe2db7aa8be38d506dfd69e
|
lib/disproperty.js
|
lib/disproperty.js
|
/**
* Disproperty: Disposable properties.
* Copyright (c) 2015 Vladislav Zarakovsky
* MIT license https://github.com/vlazar/disproperty/blob/master/LICENSE
*/
(function(root) {
function disproperty(obj, prop, value) {
return Object.defineProperty(obj, prop, {
configurable: true,
get: function() {
delete this[prop];
return value;
},
set: function(newValue) {
value = newValue;
}
});
}
// Exports: AMD, CommonJS, <script> tag
if (typeof define === 'function' && define.amd) {
module.exports = disproperty;
} else if (typeof exports === 'object') {
define(function() { return disproperty });
} else {
root.disproperty = disproperty;
}
})(this);
|
/**
* Disproperty: Disposable properties.
* Copyright (c) 2015 Vladislav Zarakovsky
* MIT license https://github.com/vlazar/disproperty/blob/master/LICENSE
*/
(function(root) {
function disproperty(obj, prop, value) {
return Object.defineProperty(obj, prop, {
configurable: true,
get: function() {
delete this[prop];
return value;
},
set: function(newValue) {
value = newValue;
}
});
}
// Exports: AMD, CommonJS, <script> tag
if (typeof define === 'function' && define.amd) {
define(function() { return disproperty });
} else if (typeof exports === 'object') {
module.exports = disproperty;
} else {
root.disproperty = disproperty;
}
})(this);
|
Fix AMD and CommonJS were mixed up
|
Fix AMD and CommonJS were mixed up
|
JavaScript
|
mit
|
vlazar/disproperty
|
adc14a177ba3c37618b2f63f8f4ca272cdc94586
|
lib/updateModel.js
|
lib/updateModel.js
|
var
_ = require('underscore'),
async = require('async'),
curry = require('curry'),
Dependency = require('../models').Dependency,
compHelper = require('./componentHelper'),
compInstall = compHelper.install,
compBuild = compHelper.build;
module.exports = function updateModel (model, data, callback) {
_.each(data, function (val, prop) {
if (prop === 'dependencies') {
model.dependencies = [];
_.each(val, function (version, name) {
model.dependencies.push(new Dependency({
name : name,
version : version
}));
})
} else if (!_.isFunction(model[prop])) {
model[prop] = val;
}
});
model.updated = new Date();
model.type = data['web-audio'].type;
async.series([
curry([data], compInstall),
curry([data], compBuild),
function () {
model.save.apply(model, arguments);
}
], callback);
};
|
var
_ = require('underscore'),
async = require('async'),
curry = require('curry'),
Dependency = require('../models').Dependency,
compHelper = require('./componentHelper'),
compInstall = compHelper.install,
compBuild = compHelper.build;
module.exports = function updateModel (model, data, callback) {
_.each(data, function (val, prop) {
if (prop === 'dependencies') {
model.dependencies = [];
_.each(val, function (version, name) {
model.dependencies.push(new Dependency({
name : name,
version : version
}));
})
} else if (!_.isFunction(model[prop])) {
model[prop] = val;
}
});
model.updated = new Date();
model.type = data['web-audio'].type;
async.series([
curry([data], compInstall),
curry([data], compBuild),
function () {
model.save.apply(model, arguments);
}
], function (err) {
callback(err, model);
});
};
|
Return model when finishing updating model
|
Return model when finishing updating model
|
JavaScript
|
mit
|
web-audio-components/web-audio-components-service
|
347d62cc1eac9d5b58729000df03dc43313708cd
|
api/script-rules-rule.vm.js
|
api/script-rules-rule.vm.js
|
(function() {
var rule = data.rules[parseInt(request.param.num, 10)] || null;
if (rule === null) return response.error(404);
switch (request.method) {
case 'GET':
response.head(200);
response.end(JSON.stringify(rule, null, ' '));
return;
case 'PUT':
if (request.headers['content-type'].match(/^application\/json/)) {
var newRule = request.query;
if (newRule.isEnabled === false) {
newRule.isDisabled = true;
}
delete newRule.isEnabled;
data.rules.splice(data.rules.indexOf(rule), 1, newRule);
fs.writeFileSync(define.RULES_FILE, JSON.stringify(data.rules, null, ' '));
response.head(200);
response.end(JSON.stringify(newRule));
} else {
response.error(400);
}
return;
case 'DELETE':
child_process.exec('node app-cli.js -mode rule --remove -n ' + request.param.num, function(err, stdout, stderr) {
if (err) return response.error(500);
response.head(200);
response.end('{}');
});
return;
}
})();
|
(function() {
var num = parseInt(request.param.num, 10).toString(10);
var rule = data.rules[num] || null;
if (rule === null) return response.error(404);
switch (request.method) {
case 'GET':
response.head(200);
response.end(JSON.stringify(rule, null, ' '));
return;
case 'PUT':
if (request.headers['content-type'].match(/^application\/json/)) {
var newRule = request.query;
if (newRule.isEnabled === false) {
newRule.isDisabled = true;
}
delete newRule.isEnabled;
data.rules.splice(data.rules.indexOf(rule), 1, newRule);
fs.writeFileSync(define.RULES_FILE, JSON.stringify(data.rules, null, ' '));
response.head(200);
response.end(JSON.stringify(newRule));
} else {
response.error(400);
}
return;
case 'DELETE':
child_process.exec('node app-cli.js -mode rule --remove -n ' + num, function(err, stdout, stderr) {
if (err) return response.error(500);
response.head(200);
response.end('{}');
});
return;
}
})();
|
Fix rule number parameter check
|
Fix rule number parameter check
A parameter validation of rule number must be effective in preventing
OS command execution.
|
JavaScript
|
mit
|
polamjag/Chinachu,kanreisa/Chinachu,kounoike/Chinachu,wangjun/Chinachu,tdenc/Chinachu,wangjun/Chinachu,valda/Chinachu,upsilon/Chinachu,xtne6f/Chinachu,xtne6f/Chinachu,miyukki/Chinachu,kounoike/Chinachu,upsilon/Chinachu,wangjun/Chinachu,xtne6f/Chinachu,polamjag/Chinachu,tdenc/Chinachu,miyukki/Chinachu,valda/Chinachu,upsilon/Chinachu,tdenc/Chinachu,kanreisa/Chinachu,valda/Chinachu,kounoike/Chinachu,kanreisa/Chinachu,miyukki/Chinachu,polamjag/Chinachu
|
8ccebea0f071952a40efe56b55853df7b5e21246
|
app/models/sequence-item.js
|
app/models/sequence-item.js
|
import DS from "ember-data";
export default DS.Model.extend({
page: DS.belongsTo('page'),
section: DS.belongsTo('section'),
sequence: DS.belongsTo('sequence'),
title: DS.attr('string'),
commentary: DS.hasOneFragment('markdown')
});
|
import DS from "ember-data";
export default DS.Model.extend({
page: DS.belongsTo('page'),
section: DS.belongsTo('section', {async: true}),
sequence: DS.belongsTo('sequence'),
title: DS.attr('string'),
commentary: DS.hasOneFragment('markdown')
});
|
Allow async loading of sections
|
Allow async loading of sections
|
JavaScript
|
mit
|
artzte/fightbook-app
|
0c410708be0bd112391b0f6f34d0a1cfca39ea85
|
addon/engine.js
|
addon/engine.js
|
import Engine from 'ember-engines/engine';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
const { modulePrefix } = config;
const Eng = Engine.extend({
modulePrefix,
Resolver,
dependencies: {
services: [
'store',
'session'
]
}
});
loadInitializers(Eng, modulePrefix);
export default Eng;
|
import Engine from 'ember-engines/engine';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
const { modulePrefix } = config;
const Eng = Engine.extend({
modulePrefix,
Resolver
});
loadInitializers(Eng, modulePrefix);
export default Eng;
|
Revert "recieving store and sessions services"
|
Revert "recieving store and sessions services"
This reverts commit 185961492fca2d78bc8d8372c7d08aae08d2a166.
|
JavaScript
|
mit
|
scottharris86/external-admin,scottharris86/external-admin
|
fe04cf7da47cb7cec0f127d54dcaa3ad17a960bb
|
dev/app/components/main/reports/reports.controller.js
|
dev/app/components/main/reports/reports.controller.js
|
ReportsController.$inject = [ '$rootScope', 'TbUtils', 'reports' ];
function ReportsController ($rootScope, TbUtils, reports) {
var vm = this;
vm.reports = [
{ title: 'Reporte de Costos', url: 'http://fiasps.unitec.edu:8085/api/Reports/CostsReport/2015' },
{ title: 'Reporte de Horas de Estudiantes', url: 'http://fiasps.unitec.edu:8085/api/Reports/StudentsReport/2015' }
];
vm.selectedReport = 0;
vm.generateReport = generateReport;
function generateReport () {
window.open(vm.reports[vm.selectedReport].url);
}
}
module.exports = { name: 'ReportsController', ctrl: ReportsController };
|
ReportsController.$inject = [ '$rootScope', 'TbUtils', 'reports', '$state' ];
function ReportsController ($rootScope, TbUtils, reports, $state) {
if ($rootScope.Role !== 'Admin') $state.go('main.projects');
var vm = this;
vm.reports = [
{ title: 'Reporte de Costos', url: 'http://fiasps.unitec.edu:8085/api/Reports/CostsReport/2015' },
{ title: 'Reporte de Horas de Estudiantes', url: 'http://fiasps.unitec.edu:8085/api/Reports/StudentsReport/2015' }
];
vm.selectedReport = 0;
vm.generateReport = generateReport;
function generateReport () {
window.open(vm.reports[vm.selectedReport].url);
}
}
module.exports = { name: 'ReportsController', ctrl: ReportsController };
|
Fix who can access reports state
|
Fix who can access reports state
|
JavaScript
|
mit
|
Tribu-Anal/Vinculacion-Front-End,Tribu-Anal/Vinculacion-Front-End,Tribu-Anal/Manejo-Horas-de-Vinculacion-UNITEC,Tribu-Anal/Manejo-Horas-de-Vinculacion-UNITEC
|
e78f92680c92e0dcde41875741ea707ad1031172
|
addon/initializers/syncer.js
|
addon/initializers/syncer.js
|
import Syncer from '../syncer';
export function initialize(application) {
application.register('syncer:main', Syncer);
}
export default {
name: 'syncer',
before: 'store',
initialize
};
|
import Syncer from '../syncer';
export function initialize(application) {
//Register factory for Syncer.
application.register('syncer:main', Syncer);
}
export default {
name: 'syncer',
before: 'ember-data',
initialize
};
|
Fix using of `store` initializer
|
Fix using of `store` initializer
`store` initializer was added to keep backwards compatibility since
ember-data 2.5.0
|
JavaScript
|
mit
|
Flexberry/ember-flexberry-offline,Flexberry/ember-flexberry-offline
|
b1c0ed1868d8d1aabeb8d76f4fe8d6db10403516
|
logic/setting/campaign/writeCampaignSettingModelLogic.js
|
logic/setting/campaign/writeCampaignSettingModelLogic.js
|
var configuration = require('../../../config/configuration.json')
var utility = require('../../../public/method/utility')
module.exports = {
setCampaignSettingModel: function (redisClient, campaignHashID, payload, callback) {
}
}
|
var configuration = require('../../../config/configuration.json')
var utility = require('../../../public/method/utility')
module.exports = {
setCampaignSettingModel: function (redisClient, accountHashID, campaignHashID, payload, callback) {
var table
var score = utility.getUnixTimeStamp()
var multi = redisClient.multi()
var settingKeys = Object.keys(configuration.settingEnum)
var tableName = configuration.TableMACampaignModelSettingModel + campaignHashID
multi.hset(tableName, configuration.ConstantSMPriority, payload[configuration.ConstantSMPriority])
var finalCounter = 0
for (var i = 0; i < settingKeys.length; i++) {
if (settingKeys[i] === configuration.settingEnum.Priority)
continue
var key = settingKeys[i]
var scoreMemberArray = []
var keyValueArray = payload[key]
for (var j = 0; j < keyValueArray.length; j++) {
scoreMemberArray.push(score)
scoreMemberArray.push(keyValueArray[j])
}
var counter = 0
for (var j = 0; j < keyValueArray.length; j++) {
table = configuration.TableModel.general.CampaignModel + accountHashID
utility.stringReplace(table, '@', key)
redisClient.zrange(table, '0', '-1', function (err, replies) {
if (err) {
callback(err, null)
return
}
table = configuration.TableModel.general.CampaignModel + accountHashID
for (var k = 0; k < replies.length; k++) {
utility.stringReplace(table, '@', replies[k])
multi.zrem(table, campaignHashID)
}
/* Add to Model List */
table = configuration.TableModel.general.CampaignModel + accountHashID
utility.stringReplace(table, '@', keyValueArray[j])
multi.zadd(table, score, campaignHashID)
/* Add to Model Set */
table = configuration.TableModel.general.CampaignModel
utility.stringReplace(table, '@', keyValueArray[j])
multi.zadd(table, score, campaignHashID)
counter++
})
if (counter == keyValueArray.length) {
/* Model Set */
table = configuration.TableModel.general.CampaignModel + campaignHashID
utility.stringReplace(table, '@', key)
/* Remove from Model Set */
multi.zremrangebyrank(table, '0', '-1')
/* Add to Model Set */
scoreMemberArray.unshift(table)
multi.zadd(scoreMemberArray)
}
}
if (finalCounter == settingKeys.length) {
multi.exec(function (err, replies) {
if (err) {
callback(err, null)
return
}
callback(null, configuration.message.setting.campaign.set.successful)
})
}
}
}
}
|
Implement Create a Campaign Model Setting Dynamically
|
Implement Create a Campaign Model Setting Dynamically
|
JavaScript
|
mit
|
Flieral/Announcer-Service,Flieral/Announcer-Service
|
3b3d8b40a5b4dda16440a0262246aa6ff8da4332
|
gulp/watch.js
|
gulp/watch.js
|
import gulp from 'gulp';
import {build} from './build';
import {test} from './test';
import {makeParser, fixParser} from './parse';
const allSrcGlob = [
'src/**/*.js',
'!src/static/antlr4/parsers/**/*.js',
'test/**/*.js',
];
const allBuildGlob = [
'build/src/*.js',
'build/test/**/*.js',
];
const grammarGlob = [
'src/static/antlr4/grammars/**/*.g4',
'build/src/static/antlr4/Translator.js',
];
const dataGlob = [
'src/static/data/**/*.*',
];
export const watch = done => {
gulp.watch(allSrcGlob, build);
gulp.watch(allBuildGlob, test);
gulp.watch(grammarGlob, gulp.series(makeParser, fixParser));
gulp.watch(dataGlob, test);
done();
};
gulp.task('watch', watch);
|
import gulp from 'gulp';
import {build} from './build';
import {test} from './test';
import {makeParser, fixParser} from './parse';
const allSrcGlob = [
'src/**/*.js',
'!src/static/antlr4/parsers/**/*.js',
'test/**/*.js',
];
const allBuildGlob = [
'build/src/*.js',
'build/test/**/*.js',
];
const grammarGlob = [
'src/static/antlr4/grammars/**/*.g4',
'build/src/static/antlr4/Translator.js',
];
const dataGlob = [
'src/static/data/**/*.*',
'src/static/antlr4/parsers/TestudocParser.js',
];
export const watch = done => {
gulp.watch(allSrcGlob, build);
gulp.watch(allBuildGlob, test);
gulp.watch(grammarGlob, gulp.series(makeParser, fixParser));
gulp.watch(dataGlob, test);
done();
};
gulp.task('watch', watch);
|
Test again when TestudocParser is recreated
|
Test again when TestudocParser is recreated
|
JavaScript
|
mit
|
jlenoble/ecmascript-parser
|
cac5bc79f106a67c56c00448a8b4408c0f31f6f3
|
lib/request.js
|
lib/request.js
|
var api = require('../config/api.json');
var appId = process.env.APPLICATION_ID;
var https = require('https');
var querystring = require('querystring');
module.exports = function requestExports(config) {
return request.bind(null, api[config]);
};
function request(config, endpoint, body, callback) {
body.application_id = appId;
body = querystring.stringify(body);
var options = {
hostname: config.hostname,
path: config[endpoint].path,
method: config[endpoint].method,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': body.length
}
};
var req = https.request(options, function httpsRequestCb(response) {
var data = [];
response.setEncoding('utf8');
response.on('data', Array.prototype.push.bind(data));
response.on('end', function httpsRequestEndCb() {
var result = JSON.parse(data.join('') || '{}');
switch (result.status) {
case 'ok':
callback(null, result.data);
break;
case 'error':
callback(new Error(result.error.message));
break;
default:
callback(null, null);
break;
}
});
});
req.once('error', callback);
req.write(body);
req.end();
}
|
var api = require('../config/api.json');
var appId = process.env.APPLICATION_ID;
var https = require('https');
var querystring = require('querystring');
var util = require('util');
module.exports = function requestExports(config) {
return request.bind(null, api[config]);
};
function request(config, endpoint, body, callback) {
body.application_id = appId;
body = querystring.stringify(body);
var options = {
hostname: config.hostname,
path: config[endpoint].path,
method: config[endpoint].method,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': body.length
}
};
var req = https.request(options, function httpsRequestCb(response) {
var data = [];
response.setEncoding('utf8');
response.on('data', Array.prototype.push.bind(data));
response.on('end', function httpsRequestEndCb() {
var result = JSON.parse(data.join('') || '{}');
switch (result.status) {
case 'ok':
callback(null, result.data);
break;
case 'error':
var errorFormat = util.format(
'%d %s: %s=%j',
result.error.code,
result.error.message,
result.error.field,
result.error.value
);
callback(new Error(errorFormat));
break;
default:
callback(null, null);
break;
}
});
});
req.once('error', callback);
req.write(body);
req.end();
}
|
Include all the fields of a wargaming error.
|
Include all the fields of a wargaming error.
|
JavaScript
|
isc
|
CodeMan99/wotblitz.js
|
37dc947297bb6b630e3442cd93451ab2a88a791b
|
app/instance-initializers/ember-href-to.js
|
app/instance-initializers/ember-href-to.js
|
import Em from 'ember';
function _getNormalisedRootUrl(router) {
let rootURL = router.rootURL;
if(rootURL.charAt(rootURL.length - 1) !== '/') {
rootURL = rootURL + '/';
}
return rootURL;
}
export default {
name: 'ember-href-to',
initialize: function(applicationInstance) {
let router = applicationInstance.container.lookup('router:main');
let rootURL = _getNormalisedRootUrl(router);
let $body = Em.$(document.body);
$body.off('click.href-to', 'a');
$body.on('click.href-to', 'a', function(e) {
let $target = Em.$(e.currentTarget);
let handleClick = (e.which === 1 && !e.ctrlKey && !e.metaKey);
if(handleClick && !$target.hasClass('ember-view') && Em.isNone($target.attr('data-ember-action'))) {
let url = $target.attr('href');
if(url && url.indexOf(rootURL) === 0) {
url = url.substr(rootURL.length - 1);
if(router.router.recognizer.recognize(url)) {
router.handleURL(url);
router.router.updateURL(url);
return false;
}
}
}
return true;
});
}
};
|
import Em from 'ember';
function _getNormalisedRootUrl(router) {
let rootURL = router.rootURL;
if(rootURL.charAt(rootURL.length - 1) !== '/') {
rootURL = rootURL + '/';
}
return rootURL;
}
function _lookupRouter(applicationInstance) {
const container = 'lookup' in applicationInstance ? applicationInstance : applicationInstance.container;
return container.lookup('router:main');
}
export default {
name: 'ember-href-to',
initialize: function(applicationInstance) {
let router = _lookupRouter(applicationInstance);
let rootURL = _getNormalisedRootUrl(router);
let $body = Em.$(document.body);
$body.off('click.href-to', 'a');
$body.on('click.href-to', 'a', function(e) {
let $target = Em.$(e.currentTarget);
let handleClick = (e.which === 1 && !e.ctrlKey && !e.metaKey);
if(handleClick && !$target.hasClass('ember-view') && Em.isNone($target.attr('data-ember-action'))) {
let url = $target.attr('href');
if(url && url.indexOf(rootURL) === 0) {
url = url.substr(rootURL.length - 1);
if(router.router.recognizer.recognize(url)) {
router.handleURL(url);
router.router.updateURL(url);
return false;
}
}
}
return true;
});
}
};
|
Fix router lookup to avoid deprecations in ember >= 2
|
Fix router lookup to avoid deprecations in ember >= 2
|
JavaScript
|
apache-2.0
|
intercom/ember-href-to,intercom/ember-href-to
|
8a199d43edacae40ea7c1f6395dc861f196a59ba
|
app/GUI/Filter/activeTags.js
|
app/GUI/Filter/activeTags.js
|
import React, { Component, PropTypes } from 'react';
import { Button, ButtonGroup } from 'react-bootstrap';
export default class ActiveTags extends Component {
removeTag(tag) {
const { filterObject, position, setFilter } = this.props;
const temp = filterObject[position];
temp.delete(tag);
const newFilterObject =
Object.assign({}, filterObject, { [position]: temp });
setFilter(newFilterObject);
}
render() {
const { tags } = this.props;
const buttons = [];
Array.from(tags).sort().map((t, i) => {
buttons.push(
<Button bsSize={'xsmall'}
key={'tag' + i}
onClick={() => { this.removeTag(t); }}
>
× {t}
</Button>);
});
const content = [];
if (buttons.length) {
content.push(<ButtonGroup key={'bg'}>{buttons}</ButtonGroup>);
} else {
content.push(<p key={'p'}><small>No active tags.</small></p>);
}
return (<div>
{content}
</div>);
}
}
ActiveTags.propTypes = {
filterObject: PropTypes.object,
position: PropTypes.string,
setFilter: PropTypes.func,
tags: PropTypes.object,
};
|
import React, { Component, PropTypes } from 'react';
import { Button, ButtonGroup } from 'react-bootstrap';
export default class ActiveTags extends Component {
removeTag(tag) {
const { filterObject, position, setFilter } = this.props;
const temp = filterObject[position];
temp.delete(tag);
const newFilterObject =
Object.assign({}, filterObject, { [position]: temp });
setFilter(newFilterObject);
}
render() {
const { tags } = this.props;
const buttons = [];
Array.from(tags).sort().map((t, i) => {
buttons.push(
<Button bsSize={'xsmall'}
key={'tag' + i}
style={{ marginTop: '-1px', borderRadius: '0px' }}
onClick={() => { this.removeTag(t); }}
>
× {t}
</Button>);
});
const content = [];
if (buttons.length) {
content.push(<ButtonGroup key={'bg'}>{buttons}</ButtonGroup>);
} else {
content.push(<p key={'p'}><small>No active tags.</small></p>);
}
return (<div>
{content}
</div>);
}
}
ActiveTags.propTypes = {
filterObject: PropTypes.object,
position: PropTypes.string,
setFilter: PropTypes.func,
tags: PropTypes.object,
};
|
Change active tags button layout.
|
Change active tags button layout.
|
JavaScript
|
mit
|
bgrsquared/places,bgrsquared/places,bgrsquared/places
|
b3ee9cd866a0669bfe3776b66a2e2edc7f64931d
|
app/components/Views/Home.js
|
app/components/Views/Home.js
|
/**
* Poster v0.1.0
* A React webapp to list upcoming movies and maintain a watchlist, powered by TMDb
*
* Author: Kushal Pandya <kushalspandya@gmail.com> (https://doublslash.com)
* Date: 01 June, 2016
* License: MIT
*
* React App Main Layout Component
*/
import React from "react";
import Header from "./Header/Header";
import Jumbotron from "./Section/Jumbotron";
import Footer from "./Footer/Footer";
export default
class Home extends React.Component {
constructor() {
super();
}
render() {
return (
<div>
<Header/>
<section class="container poster-section">
<Jumbotron/>
{this.props.children}
</section>
<Footer/>
</div>
);
}
}
|
/**
* Poster v0.1.0
* A React webapp to list upcoming movies and maintain a watchlist, powered by TMDb
*
* Author: Kushal Pandya <kushalspandya@gmail.com> (https://doublslash.com)
* Date: 01 June, 2016
* License: MIT
*
* React App Main Layout Component
*/
import React from "react";
import Header from "./Header/Header";
import Jumbotron from "./Section/Jumbotron";
import Footer from "./Footer/Footer";
export default
class Home extends React.Component {
constructor() {
super();
}
render() {
return (
<div>
<Header/>
<section class="container poster-section">
<Jumbotron hide={this.props.params.movieId ? true : false}/>
{this.props.children}
</section>
<Footer/>
</div>
);
}
}
|
Hide Jumbotron on movie details page.
|
Hide Jumbotron on movie details page.
|
JavaScript
|
mit
|
kushalpandya/poster,kushalpandya/poster
|
d9504ba850c26c779bceae62ea5c903c8f505126
|
library/Denkmal/library/Denkmal/Component/MessageList/All.js
|
library/Denkmal/library/Denkmal/Component/MessageList/All.js
|
/**
* @class Denkmal_Component_MessageList_All
* @extends Denkmal_Component_MessageList_Abstract
*/
var Denkmal_Component_MessageList_All = Denkmal_Component_MessageList_Abstract.extend({
/** @type String */
_class: 'Denkmal_Component_MessageList_All',
ready: function() {
this.bindStream('global-internal', cm.model.types.CM_Model_StreamChannel_Message, 'message-create', function(message) {
this._addMessage(message);
});
},
/**
* @param {Object} message
*/
_addMessage: function(message) {
this.renderTemplate('template-message', {
id: message.id,
created: message.created,
venue: message.venue.name,
hasText: message.text !== null,
text: message.text,
hasImage: message.image !== null,
imageUrl: (message.image !== null) ? message.image['url-thumb'] : null
}).appendTo(this.$('.messageList'));
}
});
|
/**
* @class Denkmal_Component_MessageList_All
* @extends Denkmal_Component_MessageList_Abstract
*/
var Denkmal_Component_MessageList_All = Denkmal_Component_MessageList_Abstract.extend({
/** @type String */
_class: 'Denkmal_Component_MessageList_All',
ready: function() {
this.bindStream('global-internal', cm.model.types.CM_Model_StreamChannel_Message, 'message-create', function(message) {
this._addMessage(message);
});
},
/**
* @param {Object} message
*/
_addMessage: function(message) {
if (this.$('.messageList > .message[data-id="' + message.id + '"]').length > 0) {
return;
}
this.renderTemplate('template-message', {
id: message.id,
created: message.created,
venue: message.venue.name,
hasText: message.text !== null,
text: message.text,
hasImage: message.image !== null,
imageUrl: (message.image !== null) ? message.image['url-thumb'] : null
}).appendTo(this.$('.messageList'));
}
});
|
Add check to not add messages twice
|
Add check to not add messages twice
|
JavaScript
|
mit
|
njam/denkmal.org,njam/denkmal.org,denkmal/denkmal.org,njam/denkmal.org,fvovan/denkmal.org,fvovan/denkmal.org,denkmal/denkmal.org,njam/denkmal.org,fvovan/denkmal.org,fvovan/denkmal.org,denkmal/denkmal.org,denkmal/denkmal.org,fvovan/denkmal.org,njam/denkmal.org,denkmal/denkmal.org
|
979fc3418b738838ee7187a11cf28ac65371cfb6
|
app/components/validations-errors.js
|
app/components/validations-errors.js
|
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['error-messages'],
didInsertElement: function () {
this._super();
Ember.run.next(function(){
var errors = this.get('validationErrors')
, errorsKeys = Ember.keys(errors);
errorsKeys.forEach(function(property){
Ember.addObserver(errors, property, this, function(){
this.validationsErrorsChanged(property);
}, this);
}.bind(this));
}.bind(this));
},
validationsErrorsChanged: function(key){
if(this.setList(key)) {
this.$().fadeIn('fast');
} else {
this.$().fadeOut('fast');
}
},
setList: function (key){
var validationErrors = this.get('validationErrors');
var errList = this.get('errList');
if (!Ember.isArray(errList)){
errList = [];
this.set('errList', errList);
}
var error = errList.findBy('key', key);
if (error){
error.set('errors', validationErrors.get(key));
}
else{
errList.addObject(Ember.Object.create({key:key, errors: validationErrors.get(key)}));
}
return errList.any(function (error){
return error.get('errors').length > 0;
});
}
});
|
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['error-messages'],
didInsertElement: function () {
this._super();
Ember.run.next(function(){
var errors = this.get('validationErrors')
, errorsKeys = Ember.keys(errors);
errorsKeys.forEach(function(property){
Ember.addObserver(errors, property, this, function(){
Ember.run.debounce(this, function (){
this.validationsErrorsChanged(property);
}, 200);
}, this);
}.bind(this));
}.bind(this));
},
validationsErrorsChanged: function(key){
if(this.setList(key)) {
this.$().fadeIn('fast');
} else {
this.$().fadeOut('fast');
}
},
setList: function (key){
var validationErrors = this.get('validationErrors');
var errList = this.get('errList');
if (!Ember.isArray(errList)){
errList = [];
this.set('errList', errList);
}
var error = errList.findBy('key', key);
if (error){
error.set('errors', validationErrors.get(key));
}
else{
errList.addObject(Ember.Object.create({key:key, errors: validationErrors.get(key)}));
}
return errList.any(function (error){
return error.get('errors').length > 0;
});
}
});
|
Fix problem if it takes long to valdiate
|
Fix problem if it takes long to valdiate
|
JavaScript
|
mit
|
alexferreira/ember-cli-validations-errors
|
26cd6df2d95a4d81968d01b06144d6aeddcf5863
|
index.js
|
index.js
|
module.exports = compressible
compressible.specs =
compressible.specifications = require('./specifications.json')
compressible.regex =
compressible.regexp = /json|text|javascript|dart|ecmascript|xml/
compressible.get = get
function compressible(type) {
if (!type || typeof type !== "string") return false
var i = type.indexOf(';')
, spec = compressible.specs[i < 0 ? type : type.slice(0, i)]
return spec ? spec.compressible : compressible.regex.test(type)
}
function get(type) {
if (!type || typeof type !== "string") return {
compressible: false,
sources: [],
notes: "Invalid type."
}
var spec = compressible.specs[type.split(';')[0]]
return spec ? spec : {
compressible: compressible.regex.test(type),
sources: ["compressible.regex"],
notes: "Automatically generated via regex."
}
}
|
module.exports = compressible
compressible.specs =
compressible.specifications = require('./specifications.json')
compressible.regex =
compressible.regexp = /json|text|javascript|dart|ecmascript|xml/
compressible.get = get
function compressible(type) {
if (!type || typeof type !== "string") return false
var i = type.indexOf(';')
, spec = compressible.specs[~i ? type.slice(0, i) : type]
return spec ? spec.compressible : compressible.regex.test(type)
}
function get(type) {
if (!type || typeof type !== "string") return {
compressible: false,
sources: [],
notes: "Invalid type."
}
var spec = compressible.specs[type.split(';')[0]]
return spec ? spec : {
compressible: compressible.regex.test(type),
sources: ["compressible.regex"],
notes: "Automatically generated via regex."
}
}
|
Use ~ operator to check for -1
|
[minor] Use ~ operator to check for -1
This is mainly a style change as other expressjs modules use this.
Performance is mostly indifferent.
However, this tests specifically for -1.
|
JavaScript
|
mit
|
jshttp/compressible
|
67aaa90ac0564920d8a65db7129a0e32804bdaea
|
index.js
|
index.js
|
import express from 'express';
import http from 'http';
import {renderFile} from 'ejs';
import request from 'superagent';
var app = express();
var FRIGG_API = process.env.FRIGG_API || 'https://ci.frigg.io';
app.engine('html', renderFile);
app.set('view engine', 'html');
app.set('views', '' + __dirname);
app.use('/static', express.static(__dirname + '/public'));
app.get('/api/*', (req, res, next) => {
request(FRIGG_API + req.originalUrl)
.end((err, apiRes) => {
if (err) return next(err);
res.json(apiRes.body);
});
});
app.get('*', (req, res) => {
res.render('index', {});
});
var server = http.Server(app);
var port = process.env.PORT || 3000;
server.listen(port, () => {
console.log('listening on *:' + port);
});
|
import express from 'express';
import http from 'http';
import {renderFile} from 'ejs';
import request from 'superagent';
var app = express();
var FRIGG_API = process.env.FRIGG_API || 'https://ci.frigg.io';
app.engine('html', renderFile);
app.set('view engine', 'html');
app.set('views', '' + __dirname);
app.use('/static', express.static(__dirname + '/public'));
var responses = {};
app.get('/api/*', (req, res, next) => {
var url = req.originalUrl;
if (responses.hasOwnProperty(url)) {
return res.json(responses[url]);
}
request(FRIGG_API + url)
.end((err, apiRes) => {
if (err) return next(err);
responses[url] = apiRes.body;
res.json(apiRes.body);
});
});
app.get('*', (req, res) => {
res.render('index', {});
});
var server = http.Server(app);
var port = process.env.PORT || 3000;
server.listen(port, () => {
console.log('listening on *:' + port);
});
|
Add caching of proxy requests in dev server
|
Add caching of proxy requests in dev server
|
JavaScript
|
mit
|
frigg/frigg-hq-frontend,frigg/frigg-hq-frontend
|
c39d828243e5e00b997c703e6ed41912ea7da6c5
|
packages/@sanity/base/src/preview/PreviewMaterializer.js
|
packages/@sanity/base/src/preview/PreviewMaterializer.js
|
import React, {PropTypes} from 'react'
import observeForPreview from './observeForPreview'
import shallowEquals from 'shallow-equals'
export default class PreviewMaterializer extends React.PureComponent {
static propTypes = {
value: PropTypes.any.isRequired,
type: PropTypes.shape({
preview: PropTypes.shape({
select: PropTypes.object.isRequired,
prepare: PropTypes.func
}).isRequired
}),
children: PropTypes.func
};
state = {
loading: false,
error: null,
result: null
}
componentWillMount() {
const {type, value} = this.props
this.materialize(value, type)
}
componentWillUnmount() {
this.unsubscribe()
}
unsubscribe() {
if (this.subscription) {
this.subscription.unsubscribe()
}
}
componentWillReceiveProps(nextProps) {
if (!shallowEquals(nextProps.value, this.props.value)) {
this.materialize(nextProps.value, nextProps.type)
}
}
materialize(value, type) {
this.unsubscribe()
this.subscription = observeForPreview(value, type)
.subscribe(res => {
this.setState({result: res})
})
}
render() {
const {result, loading, error} = this.state
if (loading) {
return <div>Loading…</div>
}
if (error) {
return <div>Error: {error.message}</div>
}
if (!result) {
return <div />
}
return this.props.children(result)
}
}
|
import React, {PropTypes} from 'react'
import observeForPreview from './observeForPreview'
import shallowEquals from 'shallow-equals'
export default class PreviewMaterializer extends React.PureComponent {
static propTypes = {
value: PropTypes.any.isRequired,
type: PropTypes.shape({
preview: PropTypes.shape({
select: PropTypes.object.isRequired,
prepare: PropTypes.func
}).isRequired
}),
children: PropTypes.func
};
state = {
loading: false,
error: null,
result: null
}
componentWillMount() {
const {type, value} = this.props
this.materialize(value, type)
}
componentWillUnmount() {
this.unsubscribe()
}
unsubscribe() {
if (this.subscription) {
this.subscription.unsubscribe()
this.subscription = null
}
}
componentWillReceiveProps(nextProps) {
if (!shallowEquals(nextProps.value, this.props.value)) {
this.materialize(nextProps.value, nextProps.type)
}
}
materialize(value, type) {
this.unsubscribe()
this.subscription = observeForPreview(value, type)
.subscribe(res => {
this.setState({result: res})
})
}
render() {
const {result, loading, error} = this.state
if (loading) {
return <div>Loading…</div>
}
if (error) {
return <div>Error: {error.message}</div>
}
if (!result) {
return <div />
}
return this.props.children(result)
}
}
|
Set subscription to null after unsubscribe
|
[preview] Set subscription to null after unsubscribe
|
JavaScript
|
mit
|
sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity
|
8e7bfe3b0c136794de0be1802fdf9e8a90f7645d
|
embeds/buffer-tpc-check.js
|
embeds/buffer-tpc-check.js
|
/* globals self, bufferpm, chrome */
// buffer-tpc-check.js
// (c) 2013 Sunil Sadasivan
// Check if third party cookies are disabled
//
;(function () {
if (window !== window.top) return;
;(function check() {
if((self.port) || (xt && xt.options)) {
//if the 3rd party cookies check is disabled, store it
bufferpm.bind("buffer_3pc_disabled", function(){
if(xt && xt.options) {
xt.options['buffer.op.tpc-disabled'] = true;
}
self.port.emit('buffer_tpc_disabled');
return false;
});
var iframe = document.createElement('iframe');
iframe.id = 'buffer_tpc_check';
iframe.src = xt.data.get('data/shared/tpc-check.html');
iframe.style.display="none";
document.body.appendChild(iframe);
} else {
setTimeout(check, 50);
}
}());
}());
|
/* globals self, bufferpm, chrome */
// buffer-tpc-check.js
// (c) 2013 Sunil Sadasivan
// Check if third party cookies are disabled
//
;(function () {
if (window !== window.top) return;
;(function check() {
if((self.port) || (xt && xt.options)) {
//if the 3rd party cookies check is disabled, store it
bufferpm.bind("buffer_3pc_disabled", function(){
if(xt && xt.options) {
xt.options['buffer.op.tpc-disabled'] = true;
}
self.port.emit('buffer_tpc_disabled');
return false;
});
var iframe = document.createElement('iframe');
iframe.id = 'buffer_tpc_check';
iframe.src = xt.data.get('data/shared/tpc-check.html');
iframe.style.display="none";
iframe.setAttribute('data-info', 'The Buffer extension uses this iframe to automatically ' +
'detect the browser\'s third-party cookies settings and offer the best experience based on those');
document.body.appendChild(iframe);
} else {
setTimeout(check, 50);
}
}());
}());
|
Add info inside TPC check iframe attribute for curious eyes
|
Add info inside TPC check iframe attribute for curious eyes
|
JavaScript
|
mit
|
bufferapp/buffer-extension-shared,bufferapp/buffer-extension-shared
|
683ba6fcaf2072bfe7f7884b81bf04a3899c6d60
|
Response.js
|
Response.js
|
'use strict'
class Response {
constructor(messenger, msg) {
this.messenger = messenger
this.queue = msg.properties.replyTo
this.corr = msg.properties.correlationId
}
send (msg) {
if(this.queue){
this.messenger.publish(this.queue, msg)
}
}
ok (payload) {
this.send({
status: 'ok',
correlationId: this.corr,
content: payload
})
}
error (payload) {
this.send({
status: 'error',
correlationId: this.corr,
content: payload
})
}
}
module.exports = Response
|
'use strict'
class Response {
constructor(messenger, msg) {
this.messenger = messenger
this.queue = msg.properties.replyTo
this.corr = msg.properties.correlationId
}
send (msg) {
if(this.queue){
this.messenger.publish(this.queue, msg)
}
}
ok (payload) {
this.send({
status: 'ok',
correlationId: this.corr,
content: payload
})
}
notify (payload) {
this.send({
status: 'notify',
correlationId: this.corr,
content: payload
})
}
error (payload) {
this.send({
status: 'error',
correlationId: this.corr,
content: payload
})
}
}
module.exports = Response
|
Add notify to actor service
|
Add notify to actor service
|
JavaScript
|
mit
|
domino-logic/domino-actor-service
|
d01d51c6e3d8d7dcc7a72384277bee95db813474
|
client/app/components/dnt-hytteadmin-editor-section-kontakt.js
|
client/app/components/dnt-hytteadmin-editor-section-kontakt.js
|
import Ember from 'ember';
export default Ember.Component.extend({
});
|
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setKontaktinfoGruppeById: function (id) {
var model = this.get('model');
if (typeof model.setKontaktinfoGruppeById) {
model.setKontaktinfoGruppeById(id);
}
}
}
});
|
Add action for setting kontaktinfo by group id
|
Add action for setting kontaktinfo by group id
|
JavaScript
|
mit
|
Turistforeningen/Hytteadmin,Turistforeningen/Hytteadmin
|
9d576f6f805f5a6a72319fc1f690d9520abd215a
|
packages/redux-resource/src/action-types/action-types.js
|
packages/redux-resource/src/action-types/action-types.js
|
export default {
REQUEST_IDLE: 'REQUEST_IDLE',
REQUEST_PENDING: 'REQUEST_PENDING',
REQUEST_FAILED: 'REQUEST_FAILED',
REQUEST_SUCCEEDED: 'REQUEST_SUCCEEDED',
UPDATE_RESOURCES: 'UPDATE_RESOURCES',
};
|
export default {
REQUEST_IDLE: 'REQUEST_IDLE',
// These will be used in Redux Resource v3.1.0. For now,
// they are reserved action types.
// REQUEST_PENDING: 'REQUEST_PENDING',
// REQUEST_FAILED: 'REQUEST_FAILED',
// REQUEST_SUCCEEDED: 'REQUEST_SUCCEEDED',
// UPDATE_RESOURCES: 'UPDATE_RESOURCES',
};
|
Comment out reserved action types
|
Comment out reserved action types
|
JavaScript
|
mit
|
jmeas/resourceful-redux,jmeas/resourceful-redux
|
223b0dd3ba63184336d615150c945bb52941c17a
|
packages/create-universal-package/lib/config/build-shared.js
|
packages/create-universal-package/lib/config/build-shared.js
|
const template = ({env, format, esEdition}) => `${env}.${format}.${esEdition}.js`;
const formats = ['es', 'cjs'];
module.exports = {
template,
formats,
};
|
const template = ({env, format, esEdition}) => `${env}.${format}${esEdition ? `.${esEdition}` : ''}.js`;
const formats = ['es', 'cjs'];
module.exports = {
template,
formats,
};
|
Fix output filepath in non-ES2015 bundles
|
Fix output filepath in non-ES2015 bundles
|
JavaScript
|
mit
|
rtsao/create-universal-package,rtsao/create-universal-package
|
a392baf961f197b8268ec0666b898f82d33b35fa
|
app/assets/javascripts/les/profile_matrix_editor/template_updater/battery_template_updater.js
|
app/assets/javascripts/les/profile_matrix_editor/template_updater/battery_template_updater.js
|
var BatteryTemplateUpdater = (function () {
'use strict';
var defaultPercentage = 20.0,
batteryToggles = ".editable.profile",
batteries = [
"congestion_battery",
"households_flexibility_p2p_electricity"
],
sliderSettings = {
tooltip: 'hide',
formatter: function (value) {
return value + "%";
}
};
function setSlideStopValue() {
var sliderValue = $(this).val();
$(this).parents(".editable").find(".tick.value").text(sliderValue + "%");
}
BatteryTemplateUpdater.prototype = {
update: function () {
var isBattery = (batteries.indexOf(this.data.type) > -1),
isCongestionBattery = ("congestion_battery" === this.data.type),
batterySlider = this.template.find(".battery-slider"),
sliderInput = batterySlider.find("input");
this.template.find(batteryToggles).toggleClass("hidden", isBattery);
batterySlider.toggleClass("hidden", !isCongestionBattery);
if (isCongestionBattery) {
sliderInput.slider(sliderSettings)
.slider('setValue', defaultPercentage)
.on('slide', setSlideStopValue);
this.template.set(sliderInput.data('type'), defaultPercentage);
}
return this.template;
}
};
function BatteryTemplateUpdater(context) {
this.data = context.data;
this.template = context.template;
}
return BatteryTemplateUpdater;
}());
|
var BatteryTemplateUpdater = (function () {
'use strict';
var defaultPercentage = 20.0,
batteryToggles = ".editable.profile",
batteries = [
"congestion_battery",
"households_flexibility_p2p_electricity"
],
sliderSettings = {
tooltip: 'hide',
formatter: function (value) {
return value + "%";
}
};
function setSlideStopValue() {
var sliderValue = $(this).val();
$(this).parents(".editable").find(".tick.value").text(sliderValue + "%");
}
BatteryTemplateUpdater.prototype = {
update: function () {
var isBattery = (batteries.indexOf(this.data.type) > -1),
isCongestionBattery = ("congestion_battery" === this.data.type),
batterySlider = this.template.find(".battery-slider"),
sliderInput = batterySlider.find("input");
this.template.find(batteryToggles).toggleClass("hidden", isBattery);
batterySlider.toggleClass("hidden", !isCongestionBattery);
if (isCongestionBattery) {
sliderInput.slider(sliderSettings)
.slider('setValue', defaultPercentage)
.on('slide', setSlideStopValue)
.trigger('slide');
this.template.set(sliderInput.data('type'), defaultPercentage);
}
return this.template;
}
};
function BatteryTemplateUpdater(context) {
this.data = context.data;
this.template = context.template;
}
return BatteryTemplateUpdater;
}());
|
Set slider value when adding a new congestion battery
|
Set slider value when adding a new congestion battery
This would work when editing an existing battery, but without triggering
the event manually it would default to 0% when adding a new battery.
|
JavaScript
|
mit
|
quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses
|
cbb2235784307d250b6320ab8bb262da3c2fb686
|
client/app/scripts/services/application.js
|
client/app/scripts/services/application.js
|
angular.module('app').factory('applicationService', ['$http', 'MARLINAPI_CONFIG',
function($http, MARLINAPI_CONFIG) {
var url = MARLINAPI_CONFIG.base_url;
// create and expose service methods
var exports = {};
// get all items
exports.getAll = function() {
return $http.get(url + 'applications').then(function(response) {
return response.data;
});
};
// get one item by id
exports.getById = function(id) {
return $http.get(url + 'applications/' + id).then(function(response) {
return response.data;
});
};
// update one item by item
// @note we figure out id from item
exports.update = function(newItem) {
var id = newItem._id;
newItem = _.omit(newItem, '_id');
return $http.put(url + 'applications/' + id, newItem).then(function(response) {
return response.data;
});
};
// add a new item
exports.add = function(item) {
return $http.post(url + 'applications', item).then(function(response) {
return response.data;
});
};
// remove item by item
exports.remove = function(id) {
return $http({
method: 'DELETE',
url: url + 'applications/' + id
}).then(function(response) {
return response.data;
});
};
// --------
return exports;
}
]);
|
angular.module('app').factory('applicationService', ['$http', 'MARLINAPI_CONFIG',
function($http, MARLINAPI_CONFIG) {
var url = MARLINAPI_CONFIG.base_url;
// create and expose service methods
var exports = {};
// Generic find functionality
exports.find = function(query) {
query = JSON.stringify(query);
return $http.post(url + 'applications/find', {params: query}).then(function(response) {
return response.data;
});
};
// get all items
exports.getAll = function() {
return $http.get(url + 'applications').then(function(response) {
return response.data;
});
};
// get one item by id
exports.getById = function(id) {
return $http.get(url + 'applications/' + id).then(function(response) {
return response.data;
});
};
// update one item by item
// @note we figure out id from item
exports.update = function(newItem) {
var id = newItem._id;
newItem = _.omit(newItem, '_id');
return $http.put(url + 'applications/' + id, newItem).then(function(response) {
return response.data;
});
};
// add a new item
exports.add = function(item) {
return $http.post(url + 'applications', item).then(function(response) {
return response.data;
});
};
// remove item by item
exports.remove = function(id) {
return $http({
method: 'DELETE',
url: url + 'applications/' + id
}).then(function(response) {
return response.data;
});
};
// --------
return exports;
}
]);
|
Add flexible find Application service
|
Add flexible find Application service
|
JavaScript
|
mit
|
brettshollenberger/mrl001,brettshollenberger/mrl001
|
4758be5962095ad86055cd0083fa9f8961f11fb7
|
app/components/RecipeList.js
|
app/components/RecipeList.js
|
var React = require('react');
var Parse = require('parse');
var ParseReact = require('parse-react');
var RecipeList = new React.createClass({
mixins: [ParseReact.Mixin],
observe: function() {
return {
recipes: (new Parse.Query('Recipe')).equalTo("createdBy", Parse.User.current().id)
};
},
render: function() {
var content;
if (this.pendingQueries().length) {
content = "Loading";
} else {
debugger;
content = "Loaded";
}
return (
<div>
{content}
</div>
);
}
});
module.exports = RecipeList;
|
var React = require('react');
var Parse = require('parse');
var RecipeStore = require('../stores/RecipeStore');
var RecipeItem = require('./RecipeItem');
var RecipeList = new React.createClass({
getInitialState: function() {
return {
ownedRecipes: null
};
},
componentDidMount: function() {
RecipeStore.getOwned(Parse.User.current().id, this._getOwnedRecipes);
},
render: function() {
var ownedRecipes = this.state.ownedRecipes;
var recipes = [];
if (!ownedRecipes) {
recipes.push(<div>Loading</div>);
} else {
if (ownedRecipes.length == 0) {
recipes.push(<div>No recipes</div>);
}
for (var key in ownedRecipes) {
recipes.push(<RecipeItem recipe={ownedRecipes[key]} />);
}
}
return (
<div>
{recipes}
</div>
);
},
_getOwnedRecipes: function(recipes) {
this.setState({ownedRecipes:recipes});
}
});
module.exports = RecipeList;
|
Add recipe list to overview view
|
Add recipe list to overview view
|
JavaScript
|
mit
|
bspride/ModernCookbook,bspride/ModernCookbook,bspride/ModernCookbook
|
157db3722cc41586c41c115227be619ea62a0788
|
desktop/app/main-window.js
|
desktop/app/main-window.js
|
import Window from './window'
import {ipcMain} from 'electron'
import resolveRoot from '../resolve-root'
import hotPath from '../hot-path'
import flags from '../shared/util/feature-flags'
import {globalResizing} from '../shared/styles/style-guide'
export default function () {
const mainWindow = new Window(
resolveRoot(`renderer/index.html?src=${hotPath('index.bundle.js')}`), {
width: globalResizing.login.width,
height: globalResizing.login.height,
show: flags.login
}
)
ipcMain.on('showMain', () => {
mainWindow.show(true)
})
return mainWindow
}
|
import Window from './window'
import {ipcMain} from 'electron'
import resolveRoot from '../resolve-root'
import hotPath from '../hot-path'
import flags from '../shared/util/feature-flags'
import {globalResizing} from '../shared/styles/style-guide'
export default function () {
const mainWindow = new Window(
resolveRoot(`renderer/index.html?src=${hotPath('index.bundle.js')}`), {
useContentSize: true,
width: globalResizing.login.width,
height: globalResizing.login.height,
show: flags.login
}
)
ipcMain.on('showMain', () => {
mainWindow.show(true)
})
return mainWindow
}
|
Use content size when creating the main window
|
Use content size when creating the main window
|
JavaScript
|
bsd-3-clause
|
keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client
|
4709f623b41dffe1ad227908e3f92782987bbfa9
|
server/models/card/card.js
|
server/models/card/card.js
|
'use strict';
var mongoose = require('mongoose');
const WAITING_FOR_PRINT = 'WAITING_FOR_PRINT';
const PRINTED_WAITING_FOR_SEND = 'PRINTED_WAITING_FOR_SEND';
const SENT = 'SENT';
var statusKeys = [
WAITING_FOR_PRINT,
PRINTED_WAITING_FOR_SEND,
SENT
];
var cardSchema = mongoose.Schema({
message: String,
senderAddress: { type:String, required: true },
receiverAddress: { type:String, required: true },
createdOn: { type: Date, default: Date.now },
statusKey: {
type: String,
enum: statusKeys,
default: WAITING_FOR_PRINT,
required: true
}
});
var Card = mongoose.model('Card', cardSchema);
module.exports = Card;
|
'use strict';
var mongoose = require('mongoose');
const WAITING_FOR_PRINT = 'WAITING_FOR_PRINT';
const PRINTED_WAITING_FOR_SEND = 'PRINTED_WAITING_FOR_SEND';
const SENT = 'SENT';
var statusKeys = [
WAITING_FOR_PRINT,
PRINTED_WAITING_FOR_SEND,
SENT
];
var cardSchema = mongoose.Schema({
message: { type: String, required: true },
senderAddress: { type: String, required: true },
receiverAddress: { type: String, required: true },
createdOn: { type: Date, default: Date.now },
statusKey: {
type: String,
enum: statusKeys,
default: WAITING_FOR_PRINT,
required: true
}
});
var Card = mongoose.model('Card', cardSchema);
module.exports = Card;
|
Make message field as required
|
Make message field as required
|
JavaScript
|
mit
|
denisnarush/postcard,denisnarush/postcard
|
dfb7fd375cc6e073df2add406c9ca3e81fe211d0
|
js/scripts.js
|
js/scripts.js
|
// DOM Ready
$(function() {
// SVG fallback
// toddmotto.com/mastering-svg-use-for-a-retina-web-fallbacks-with-png-script#update
if (!Modernizr.svg) {
var imgs = document.getElementsByTagName('img');
for (var i = 0; i < imgs.length; i++) {
if (/.*\.svg$/.test(imgs[i].src)) {
imgs[i].src = imgs[i].src.slice(0, -3) + 'png';
}
}
}
});
|
// DOM Ready
jQuery(document).ready(function($) {
// SVG fallback
// toddmotto.com/mastering-svg-use-for-a-retina-web-fallbacks-with-png-script#update
if (!Modernizr.svg) {
var imgs = document.getElementsByTagName('img');
for (var i = 0; i < imgs.length; i++) {
if (/.*\.svg$/.test(imgs[i].src)) {
imgs[i].src = imgs[i].src.slice(0, -3) + 'png';
}
}
}
});
|
Handle jQuery in noConflict mode.
|
Handle jQuery in noConflict mode.
See: http://api.jquery.com/ready/
|
JavaScript
|
mit
|
martinleopold/prcs-website,martinleopold/prcs-website
|
a774ca427a200270c770dd278d55119cb31de65c
|
src/containers/Console.js
|
src/containers/Console.js
|
import {connect} from 'react-redux';
import Console from '../components/Console';
import {
getCurrentCompiledProjectKey,
getConsoleHistory,
getCurrentProjectKey,
getHiddenUIComponents,
getRequestedFocusedLine,
isCurrentProjectSyntacticallyValid,
isExperimental,
isTextSizeLarge,
} from '../selectors';
import {
evaluateConsoleEntry,
toggleComponent,
focusLine,
editorFocusedRequestedLine,
clearConsoleEntries,
} from '../actions';
function mapStateToProps(state) {
return {
currentCompiledProjectKey: getCurrentCompiledProjectKey(state),
currentProjectKey: getCurrentProjectKey(state),
history: getConsoleHistory(state),
isEnabled: isExperimental(state),
isOpen: !getHiddenUIComponents(state).includes('console'),
isTextSizeLarge: isTextSizeLarge(state),
requestedFocusedLine: getRequestedFocusedLine(state),
isHidden: !isCurrentProjectSyntacticallyValid(state),
};
}
function mapDispatchToProps(dispatch) {
return {
onClearConsoleEntries() {
dispatch(clearConsoleEntries());
},
onInput(input) {
dispatch(evaluateConsoleEntry(input));
},
onToggleVisible(projectKey) {
dispatch(toggleComponent(projectKey, 'console'));
},
onConsoleClicked() {
dispatch(focusLine('console', 0, 0));
},
onRequestedLineFocused() {
dispatch(editorFocusedRequestedLine());
},
};
}
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Console);
|
import {connect} from 'react-redux';
import Console from '../components/Console';
import {
getCurrentCompiledProjectKey,
getConsoleHistory,
getCurrentProjectKey,
getHiddenUIComponents,
getRequestedFocusedLine,
isCurrentProjectSyntacticallyValid,
isExperimental,
isTextSizeLarge,
} from '../selectors';
import {
evaluateConsoleEntry,
toggleComponent,
focusLine,
editorFocusedRequestedLine,
clearConsoleEntries,
} from '../actions';
function mapStateToProps(state) {
return {
currentCompiledProjectKey: getCurrentCompiledProjectKey(state),
currentProjectKey: getCurrentProjectKey(state),
history: getConsoleHistory(state),
isEnabled: isExperimental(state),
isOpen: !getHiddenUIComponents(state).includes('console'),
isTextSizeLarge: isTextSizeLarge(state),
requestedFocusedLine: getRequestedFocusedLine(state),
isHidden: !isCurrentProjectSyntacticallyValid(state),
};
}
function mapDispatchToProps(dispatch) {
return {
onClearConsoleEntries() {
dispatch(clearConsoleEntries());
dispatch(focusLine('console', 0, 0));
},
onInput(input) {
dispatch(evaluateConsoleEntry(input));
},
onToggleVisible(projectKey) {
dispatch(toggleComponent(projectKey, 'console'));
},
onConsoleClicked() {
dispatch(focusLine('console', 0, 0));
},
onRequestedLineFocused() {
dispatch(editorFocusedRequestedLine());
},
};
}
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Console);
|
Fix console input focus on clearing.
|
Fix console input focus on clearing.
|
JavaScript
|
mit
|
outoftime/learnpad,outoftime/learnpad,jwang1919/popcode,jwang1919/popcode,popcodeorg/popcode,jwang1919/popcode,popcodeorg/popcode,jwang1919/popcode,popcodeorg/popcode,popcodeorg/popcode
|
98216fdd8b2cbd8d62b2c04884939923e5719437
|
examples/src/controller.js
|
examples/src/controller.js
|
import inputData from './data.js';
import infiniteDivs from '../../lib/infinitedivs.js';
let rootElement = document.body;
function divGenerator(item) {
let div = document.createElement('div'),
img = document.createElement('img'),
span = document.createElement('span');
img.setAttribute('src', item.img);
img.setAttribute('style', 'vertical-align: middle; height: 50px; width: 50px; margin: 20px');
img.setAttribute('alt', 'avatar');
span.textContent = item.name;
span.setAttribute('style', 'text-decoration: underline');
div.appendChild(img);
div.appendChild(span);
return div;
}
let dataArray = inputData;
let config = {
bufferMultiplier: 2,
dataArray,
divGenerator,
divHeight: 90,
rootElement
};
let infinitedivs = new infiniteDivs(config);
function scrollListener() {
infinitedivs.viewDoctor();
};
document.addEventListener('scroll', scrollListener);
|
import inputData from './data.js';
import infiniteDivs from '../../lib/infinitedivs.js';
let rootElement = document.body;
function divGenerator(item) {
let div = document.createElement('div'),
img = document.createElement('img'),
span = document.createElement('span');
img.setAttribute('src', item.img);
img.setAttribute('style', 'vertical-align: middle; height: 50px; width: 50px; margin: 20px');
img.setAttribute('alt', 'avatar');
span.textContent = item.name;
span.setAttribute('style', 'text-decoration: underline');
div.setAttribute('style', 'border-bottom: 1px dotted');
div.appendChild(img);
div.appendChild(span);
return div;
}
let dataArray = inputData;
let config = {
bufferMultiplier: 2,
dataArray,
divGenerator,
divHeight: 90,
rootElement
};
let infinitedivs = new infiniteDivs(config);
function scrollListener() {
infinitedivs.viewDoctor();
};
document.addEventListener('scroll', scrollListener);
|
Add border bottom to divs.
|
Add border bottom to divs.
|
JavaScript
|
mit
|
supreetpal/infinite-divs,supreetpal/infinite-divs
|
68fd319b09b021742ad309255d6a444a655a6fee
|
babel.config.js
|
babel.config.js
|
module.exports = {
presets: ["es2015-node4", "stage-0", "react"],
plugins: [
"add-module-exports",
["transform-async-to-module-method", {
module: "bluebird",
method: "coroutine"
}]
],
ignore: false,
only: /.es$/
}
|
module.exports = {
presets: ["es2015-node4", "react"],
plugins: [
"add-module-exports",
["transform-async-to-module-method", {
module: "bluebird",
method: "coroutine"
}]
],
ignore: false,
only: /.es$/
}
|
Remove babel-stage-0 preset to prevent crash in Electron 1.x
|
Remove babel-stage-0 preset to prevent crash in Electron 1.x
|
JavaScript
|
mit
|
PHELiOX/poi,poooi/poi,syncsyncsynchalt/poi,yudachi/poi,syncsyncsynchalt/poi,KagamiChan/poi,poooi/poi,poooi/poi,poooi/poi,gnattu/poi,syncsyncsynchalt/poi,syncsyncsynchalt/poi,yudachi/poi,yudachi/poi,gnattu/poi,PHELiOX/poi,KagamiChan/poi,nagatoyk/poi,nagatoyk/poi
|
86b3ad30b978d227bd3b596d176c8d11b2a1995d
|
forum-web-app/src/ui.js
|
forum-web-app/src/ui.js
|
"use strict";
// src/ui.js
let ui = {
renderPosts(posts) {
console.log(posts);
}
};
export { ui };
|
"use strict";
// src/ui.js
let ui = {
renderPosts(posts) {
let elements = posts.map( (post) => {
let { title, lastReply } = post;
return articleTemplate(title, lastReply);
});
let target = document.querySelector(".container");
target.innerHTML = elements.join("");
}
};
function articleTemplate(title, lastReply) {
let template = `
<article class="post">
<h2 class="post-title">
${title}
</h2>
<p class="post-meta">
${lastReply}
</p>
</article>`;
return template;
}
export { ui };
|
Add articleTemplate method. Edit renderPosts
|
Add articleTemplate method. Edit renderPosts
|
JavaScript
|
mit
|
var-bin/reactjs-training,var-bin/reactjs-training,var-bin/reactjs-training
|
cf0cb38ea897541e667193ca2699ecf5e3caaacc
|
app/src/js/modules/events.js
|
app/src/js/modules/events.js
|
/**
* Events.
*
* @mixin
* @namespace Bolt.events
*
* @param {Object} bolt - The Bolt module.
*/
(function (bolt) {
'use strict';
/*
* Bolt.events mixin container.
*
* @private
* @type {Object}
*/
var events = {};
/*
* Event broker object.
*
* @private
* @type {Object}
*/
var broker = $({});
/**
* Fires an event.
*
* @static
* @function fire
* @memberof Bolt.events
*
* @param {string} event - Event type
* @param {object} [parameter] - Additional parameters to pass along to the event handler
*/
events.fire = function (event, parameter) {
broker.triggerHandler(event, parameter);
};
/**
* Attach an event handler.
*
* @static
* @function on
* @memberof Bolt.events
*
* @param {string} event - Event type
* @param {function} handler - Event handler
*/
events.on = function (event, handler) {
broker.on(event, handler);
};
// Apply mixin container
bolt.events = events;
})(Bolt || {});
|
/**
* Events.
*
* @mixin
* @namespace Bolt.events
*
* @param {Object} bolt - The Bolt module.
*/
(function (bolt) {
'use strict';
/*
* Bolt.events mixin container.
*
* @private
* @type {Object}
*/
var events = {};
/*
* Event broker object.
*
* @private
* @type {Object}
*/
var broker = $({});
/**
* Fires an event.
*
* @static
* @function fire
* @memberof Bolt.events
*
* @param {string} eventType - Event type
* @param {object} [parameter] - Additional parameters to pass along to the event handler
*/
events.fire = function (eventType, parameter) {
broker.triggerHandler(eventType, parameter);
};
/**
* Attach an event handler.
*
* @static
* @function on
* @memberof Bolt.events
*
* @param {string} eventType - Event type
* @param {function} handler - Event handler
*/
events.on = function (eventType, handler) {
broker.on(eventType, handler);
};
// Apply mixin container
bolt.events = events;
})(Bolt || {});
|
Use jQuery nomenclature (event => eventType)
|
Use jQuery nomenclature (event => eventType)
|
JavaScript
|
mit
|
GawainLynch/bolt,nikgo/bolt,rarila/bolt,CarsonF/bolt,lenvanessen/bolt,romulo1984/bolt,electrolinux/bolt,Intendit/bolt,bolt/bolt,rarila/bolt,lenvanessen/bolt,electrolinux/bolt,Raistlfiren/bolt,GawainLynch/bolt,romulo1984/bolt,Raistlfiren/bolt,GawainLynch/bolt,lenvanessen/bolt,Raistlfiren/bolt,HonzaMikula/masivnipostele,cdowdy/bolt,lenvanessen/bolt,electrolinux/bolt,CarsonF/bolt,romulo1984/bolt,HonzaMikula/masivnipostele,romulo1984/bolt,CarsonF/bolt,HonzaMikula/masivnipostele,rarila/bolt,Intendit/bolt,nikgo/bolt,nikgo/bolt,cdowdy/bolt,cdowdy/bolt,Intendit/bolt,electrolinux/bolt,HonzaMikula/masivnipostele,cdowdy/bolt,joshuan/bolt,bolt/bolt,joshuan/bolt,joshuan/bolt,joshuan/bolt,CarsonF/bolt,nikgo/bolt,bolt/bolt,rarila/bolt,bolt/bolt,Intendit/bolt,Raistlfiren/bolt,GawainLynch/bolt
|
7d84aa5b1d0c2af75abf70e556470cb67b79b19a
|
spec/filesize-view-spec.js
|
spec/filesize-view-spec.js
|
'use babel';
import filesizeView from '../lib/filesize-view';
describe('View', () => {
// Disable tooltip for these tests
atom.config.set('filesize.EnablePopupAppearance', false);
const workspaceView = atom.views.getView(atom.workspace);
const view = filesizeView(workspaceView);
describe('when refreshing the view', () => {
it('should display the human readable size', () => {
workspaceView.appendChild(view.container);
const filesizeElement = workspaceView.querySelector('.current-size');
view.refresh({ size: 5 });
expect(filesizeElement.innerHTML).toEqual('5 bytes');
});
});
describe('when cleaning the view', () => {
it('should wipe the filesize contents', () => {
view.clean();
const filesizeElement = workspaceView.querySelector('.current-size');
expect(filesizeElement.innerHTML).toEqual('');
});
});
describe('when destroying the view', () => {
it('should remove the file-size element', () => {
view.destroy();
const filesizeElement = workspaceView.querySelector('.file-size');
expect(filesizeElement).toEqual(null);
});
});
});
|
'use babel';
import filesizeView from '../lib/filesize-view';
describe('View', () => {
const workspaceView = atom.views.getView(atom.workspace);
const view = filesizeView(workspaceView);
describe('when refreshing the view', () => {
it('should display the human readable size', () => {
workspaceView.appendChild(view.container);
const filesizeElement = workspaceView.querySelector('.current-size');
view.refresh({ size: 5 });
expect(filesizeElement.innerHTML).toEqual('5 bytes');
});
it('should react to config changes', () => {
atom.config.set('filesize.KibibyteRepresentation', false);
const filesizeElement = workspaceView.querySelector('.current-size');
view.refresh({ size: 1024 });
expect(filesizeElement.innerHTML).toEqual('1.02 KB');
});
});
describe('Tooltip', () => {
it('should display on click', () => {
const filesizeLink = workspaceView.querySelector('.file-size-link');
filesizeLink.click();
waitsFor(() => workspaceView.querySelector('.tooltip'));
runs(() => expect(tooltip).not.toEqual(null));
});
});
describe('when cleaning the view', () => {
it('should wipe the filesize contents', () => {
view.clean();
const filesizeElement = workspaceView.querySelector('.current-size');
expect(filesizeElement.innerHTML).toEqual('');
});
});
describe('when destroying the view', () => {
it('should remove the file-size element', () => {
view.destroy();
const filesizeElement = workspaceView.querySelector('.file-size');
expect(filesizeElement).toEqual(null);
});
});
});
|
Add config change test to the View spec
|
Add config change test to the View spec
|
JavaScript
|
mit
|
mkautzmann/atom-filesize
|
05b14b3f817f0cffb06ade8f1ff82bfff177c6bd
|
starting-angular/starting-angular/cards/cards_usesStaticJSON_cleanestVersion/js/directives.js
|
starting-angular/starting-angular/cards/cards_usesStaticJSON_cleanestVersion/js/directives.js
|
/*global cardApp*/
/*jslint unparam: true */
(function () {
'use strict';
// Implements custom validation for card number.
var INTEGER_REGEXP = /^([aAkKjJQq23456789]{1}|(10){1})$/;
cardApp.directive('integer', function () {
return {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
ctrl.$parsers.unshift(function (viewValue) {
if (INTEGER_REGEXP.test(viewValue)) {
// it is valid
ctrl.$setValidity('integer', true);
return viewValue;
}
// it is invalid, return undefined (no model update)
ctrl.$setValidity('integer', false);
return undefined;
});
}
};
});
}());
|
/*global cardApp*/
/*jslint unparam: true */
cardApp.directive('integer', function () {
'use strict';
// Implements custom validation for card number.
var INTEGER_REGEXP = /^([aAkKjJQq23456789]{1}|(10){1})$/;
return {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
ctrl.$parsers.unshift(function (viewValue) {
if (INTEGER_REGEXP.test(viewValue)) {
// it is valid
ctrl.$setValidity('integer', true);
return viewValue;
}
// it is invalid, return undefined (no model update)
ctrl.$setValidity('integer', false);
return undefined;
});
}
};
});
|
Use the angular module pattern instead of using a closure.
|
Use the angular module pattern instead of using a closure.
|
JavaScript
|
unlicense
|
bigfont/DevTeach2013,bigfont/DevTeach2013
|
749b9d4b89c9e34808b4d4e8ce5600703ce16464
|
clientapp/views/pathway.js
|
clientapp/views/pathway.js
|
var HumanView = require('human-view');
var templates = require('../templates');
module.exports = HumanView.extend({
template: templates.pathway,
events: {
'dragstart .columns': 'drag',
'dragover .columns': 'over',
'dragenter .columns': 'enter',
'dragleave .columns': 'leave',
'drop .columns': 'drop'
},
render: function () {
this.renderAndBind({pathway: this.model});
this.model.once('move', this.render, this);
return this;
},
drag: function (e) {
var start = $(e.currentTarget).data('cell-coords');
e.originalEvent.dataTransfer.setData('text/plain', start);
},
over: function (e) {
e.originalEvent.dataTransfer.effectAllowed = 'move';
e.originalEvent.dataTransfer.dropEffect = 'move';
if (!$(e.currentTarget).find('.badge').length) {
e.preventDefault();
return false;
}
},
enter: function (e) {
if (!$(e.currentTarget).find('.badge').length) {
$(e.currentTarget).addClass('drop');
}
},
leave: function (e) {
$(e.currentTarget).removeClass('drop');
},
drop: function (e) {
var end = $(e.currentTarget).data('cell-coords');
var start = e.originalEvent.dataTransfer.getData('text/plain');
this.model.move(start, end);
e.preventDefault();
}
});
|
var HumanView = require('human-view');
var templates = require('../templates');
module.exports = HumanView.extend({
template: templates.pathway,
events: {
'dragstart .columns': 'drag',
'dragover .columns': 'over',
'dragenter .columns': 'enter',
'dragleave .columns': 'leave',
'drop .columns': 'drop'
},
render: function () {
this.renderAndBind({pathway: this.model});
this.model.once('move', this.render, this);
return this;
},
drag: function (e) {
var start = $(e.currentTarget).data('cell-coords');
e.originalEvent.dataTransfer.setData('Text', start);
},
over: function (e) {
e.originalEvent.dataTransfer.effectAllowed = 'move';
e.originalEvent.dataTransfer.dropEffect = 'move';
if (!$(e.currentTarget).find('.badge').length) {
e.preventDefault();
e.stopPropagation();
}
},
enter: function (e) {
if (!$(e.currentTarget).find('.badge').length) {
$(e.currentTarget).addClass('drop');
}
},
leave: function (e) {
$(e.currentTarget).removeClass('drop');
},
drop: function (e) {
var end = $(e.currentTarget).data('cell-coords');
var start = e.originalEvent.dataTransfer.getData('Text');
this.model.move(start, end);
e.preventDefault();
e.stopPropagation();
}
});
|
Make it work in IE10
|
Make it work in IE10
|
JavaScript
|
mpl-2.0
|
mozilla/openbadges-discovery
|
85168befaaab2563b91345867087d51789a88dff
|
client/app/common/global-events/global-events.factory.js
|
client/app/common/global-events/global-events.factory.js
|
let GlobalEvents = () => {
let events = {};
return {
off: (eventHandle) => {
let index = events[eventHandle.eventName].findIndex((singleEventHandler) => {
return singleEventHandler.id !== eventHandle.handlerId;
});
events[eventHandle.eventName].splice(index, 1);
},
on: (eventName, handlerCallback) => {
if (!events[eventName]) {
events[eventName] = [];
}
let handlers = events[eventName];
let newHandlerId = new Date().getTime();
handlers.push({
id: newHandlerId,
callback: handlerCallback
});
return {
id: newHandlerId,
eventName
};
},
trigger: (eventName, data) => {
events[eventName].forEach((singleHandler) => {
singleHandler.callback(data);
});
}
};
}
export default GlobalEvents;
|
let GlobalEvents = () => {
let events = {};
return {
off: (eventHandle) => {
let index = events[eventHandle.eventName].findIndex((singleEventHandler) => {
return singleEventHandler.id !== eventHandle.handlerId;
});
events[eventHandle.eventName].splice(index, 1);
},
on: (eventName, handlerCallback) => {
if (!events[eventName]) {
events[eventName] = [];
}
let handlers = events[eventName];
let newHandlerId = new Date().getTime();
handlers.push({
id: newHandlerId,
callback: handlerCallback
});
return {
id: newHandlerId,
eventName
};
},
trigger: (eventName, data) => {
if (events[eventName]) {
events[eventName].forEach((singleHandler) => {
singleHandler.callback(data);
});
}
}
};
}
export default GlobalEvents;
|
Fix trigger exception when no listeners specified
|
Fix trigger exception when no listeners specified
|
JavaScript
|
apache-2.0
|
zbicin/word-game,zbicin/word-game
|
2eeb2979a6d7dc1ce5f5559f7437b90b2246c72f
|
src/DynamicCodeRegistry.js
|
src/DynamicCodeRegistry.js
|
/*
Keep track of
*/
import Backbone from "backbone"
import _ from "underscore"
export default class DynamicCodeRegistry {
constructor(){
_.extend(this, Backbone.Events)
this._content = {};
this._origins = {}
}
register(filename, content, origin){
this._content[filename] = content
if (origin) {
this._origins[filename] = origin
}
this.trigger("register", {
[filename]: content
})
}
getContent(filename){
return this._content[filename]
}
getOrigin(filename){
return this._origins[filename]
}
fileIsDynamicCode(filename){
return this._content[filename] !== undefined
}
}
|
/*
Keep track of
*/
import Backbone from "backbone"
import _ from "underscore"
export default class DynamicCodeRegistry {
constructor(){
_.extend(this, Backbone.Events)
this._content = {};
this._origins = {}
}
register(filename, content, origin){
this._content[filename] = content
if (origin) {
this._origins[filename] = origin
}
this.trigger("register", {
[filename]: content
})
}
getContent(filename){
return this._content[filename]
}
getOrigin(filename){
return this._origins[filename]
}
fileIsDynamicCode(filename){
return filename.indexOf("DynamicFunction") !== -1;
}
}
|
Fix detecting if it's a dynamic files... script tags from the original html were previously incorrectly identified as dynamic files.
|
Fix detecting if it's a dynamic files... script tags from the original html were previously incorrectly identified as dynamic files.
|
JavaScript
|
mit
|
mattzeunert/FromJS,mattzeunert/FromJS,mattzeunert/FromJS,mattzeunert/FromJS
|
447241fc88b42a03b9091da7066e7e58a414e3a2
|
src/geojson.js
|
src/geojson.js
|
module.exports.point = justType('Point', 'POINT');
module.exports.line = justType('LineString', 'POLYLINE');
module.exports.polygon = justType('Polygon', 'POLYGON');
function justType(type, TYPE) {
return function(gj) {
var oftype = gj.features.filter(isType(type));
return {
geometries: oftype.map(justCoords),
properties: oftype.map(justProps),
type: TYPE
};
};
}
function justCoords(t) {
if (t.geometry.coordinates[0] !== undefined &&
t.geometry.coordinates[0][0] !== undefined &&
t.geometry.coordinates[0][0][0] !== undefined) {
return t.geometry.coordinates[0];
} else {
return t.geometry.coordinates;
}
}
function justProps(t) {
return t.properties;
}
function isType(t) {
return function(f) { return f.geometry.type === t; };
}
|
module.exports.point = justType('Point', 'POINT');
module.exports.line = justType('LineString', 'POLYLINE');
module.exports.polygon = justType('Polygon', 'POLYGON');
function justType(type, TYPE) {
return function(gj) {
var oftype = gj.features.filter(isType(type));
return {
geometries: (TYPE === 'POLYGON' || TYPE === 'POLYLINE') ? [oftype.map(justCoords)] : oftype.map(justCoords),
properties: oftype.map(justProps),
type: TYPE
};
};
}
function justCoords(t) {
if (t.geometry.coordinates[0] !== undefined &&
t.geometry.coordinates[0][0] !== undefined &&
t.geometry.coordinates[0][0][0] !== undefined) {
return t.geometry.coordinates[0];
} else {
return t.geometry.coordinates;
}
}
function justProps(t) {
return t.properties;
}
function isType(t) {
return function(f) { return f.geometry.type === t; };
}
|
Add type check for polygon and polyline arrays
|
fix(output): Add type check for polygon and polyline arrays
Added a type check to properly wrap polygon and polyline arrays
|
JavaScript
|
bsd-3-clause
|
mapbox/shp-write,mapbox/shp-write
|
0b7ec05717cf6c89e9cbe307bec611326c19ae43
|
js/metronome.js
|
js/metronome.js
|
function Metronome(tempo, beatsPerMeasure){
this.tempo = Number(tempo);
this.beatsPerMeasure = Number(beatsPerMeasure);
this.interval = null;
}
Metronome.prototype.start = function(){
var millisecondsToWait = this.tempoToMilliseconds(this.tempo);
this.interval = window.setInterval(soundAndCounter, millisecondsToWait, this);
}
Metronome.prototype.tempoToMilliseconds = function(tempo){
return (1000 * 60)/tempo;
}
soundAndCounter = function(metronome){
updateCounterView(metronome);
}
updateCounterView = function(metronome){
var counter = document.getElementById("metronome-counter");
var pastBeat = Number(counter.innerHTML);
if (pastBeat < metronome.beatsPerMeasure){
counter.innerHTML = pastBeat + 1;
} else {
counter.innerHTML = 1;
}
}
Metronome.prototype.stop = function(){
window.clearInterval(this.interval);
counter.innerHTML = "";
}
|
function Metronome(tempo, beatsPerMeasure){
this.tempo = Number(tempo);
this.beatsPerMeasure = Number(beatsPerMeasure);
this.interval = null;
}
Metronome.prototype.start = function(){
var millisecondsToWait = this.tempoToMilliseconds(this.tempo);
this.interval = window.setInterval(soundAndCounter, millisecondsToWait, this);
}
Metronome.prototype.tempoToMilliseconds = function(tempo){
return (1000 * 60)/tempo;
}
Metronome.prototype.stop = function(){
window.clearInterval(this.interval);
var counter = document.getElementById("metronome-counter");
counter.innerHTML = "";
}
soundAndCounter = function(metronome){
updateCounterView(metronome);
}
updateCounterView = function(metronome){
var counter = document.getElementById("metronome-counter");
var pastBeat = Number(counter.innerHTML);
if (pastBeat < metronome.beatsPerMeasure){
counter.innerHTML = pastBeat + 1;
} else {
counter.innerHTML = 1;
}
}
|
Add reference to counter in stop method
|
Add reference to counter in stop method
|
JavaScript
|
mit
|
dmilburn/beatrice,dmilburn/beatrice
|
ab53bc3e982b21a24fa7a0b36d43d98213ffbb7c
|
lib/winston-syslog-ain2.js
|
lib/winston-syslog-ain2.js
|
/*
* MIT LICENCE
*/
var util = require('util'),
winston = require('winston'),
SysLogger = require("ain2");
var ain;
var SyslogAin2 = exports.SyslogAin2 = function (options) {
winston.Transport.call(this, options);
options = options || {};
ain = new SysLogger(options);
};
util.inherits(SyslogAin2, winston.Transport);
SyslogAin2.prototype.name = 'SyslogAin2';
SyslogAin2.prototype.log = function (level, msg, meta, callback) {
ain[level](msg + (null!=meta ? ' '+util.inspect(meta) : ''));
callback();
};
|
/*
* MIT LICENCE
*/
var util = require('util'),
winston = require('winston'),
SysLogger = require("ain2");
var SyslogAin2 = exports.SyslogAin2 = function (options) {
winston.Transport.call(this, options);
options = options || {};
this.ain = new SysLogger(options);
};
util.inherits(SyslogAin2, winston.Transport);
SyslogAin2.prototype.name = 'SyslogAin2';
SyslogAin2.prototype.log = function (level, msg, meta, callback) {
this.ain[level](msg + (null!=meta ? ' '+util.inspect(meta) : ''));
callback();
};
|
Fix bug that the old settings of the ain2 is got replaced
|
Fix bug that the old settings of the ain2 is got replaced
|
JavaScript
|
mit
|
lamtha/winston-syslog-ain2
|
ec7c6848b01a3e6288b3d5326ca9df677052f7da
|
lib/action.js
|
lib/action.js
|
var _ = require('lodash-node');
var Action = function(name, two, three, four) {
var options, run, helpers;
// Syntax .extend('action#method', function() { ... }, {})
if ( typeof two == 'function' ) {
options = {};
run = two;
helpers = three;
}
// Syntax .extend('action#method', {}, function() { ... }, {})
if ( typeof three == 'function' ) {
options = two;
run = three;
helpers = four;
}
var presets = {
name: name,
description: name + ' description',
inputs: {
required: [],
optional: []
},
blockedConnectionTypes: [],
outputExample: {},
run: function(api, conn, next){
this.api = api;
this.next = function(success) {
next(conn, success);
};
this.json = conn.response;
this.params = conn.params;
this.req = conn.request;
run.apply(this, arguments);
}
};
return _.merge(presets, options, helpers);
};
module.exports = Action;
|
var _ = require('lodash-node');
var Action = function(name, two, three, four) {
var options, run, helpers;
// Syntax .extend('action#method', function() { ... }, {})
if ( typeof two == 'function' ) {
options = {};
run = two;
helpers = three;
}
// Syntax .extend('action#method', {}, function() { ... }, {})
if ( typeof three == 'function' ) {
options = two;
run = three;
helpers = four;
}
var presets = {
name: name,
description: name + ' description',
inputs: {
required: [],
optional: []
},
blockedConnectionTypes: [],
outputExample: {},
run: function(api, conn, next){
this.api = api;
this.connection = conn;
this.next = function(success) {
next(conn, success);
};
this.json = conn.response;
this.params = conn.params;
this.request = conn.request;
run.apply(this, arguments);
}
};
return _.merge(presets, options, helpers);
};
module.exports = Action;
|
Add connection parameter and change req to request
|
Add connection parameter and change req to request
|
JavaScript
|
mit
|
alexparker/actionpack
|
cd0341613c11d07d2c9990adb12635f4e7809dfc
|
list/source/package.js
|
list/source/package.js
|
enyo.depends(
"Selection.js",
"FlyweightRepeater.js",
"List.css",
"List.js",
"PulldownList.css",
"PulldownList.js"
);
|
enyo.depends(
"FlyweightRepeater.js",
"List.css",
"List.js",
"PulldownList.css",
"PulldownList.js"
);
|
Remove enyo.Selection from layout library, moved into enyo base-UI
|
Remove enyo.Selection from layout library, moved into enyo base-UI
|
JavaScript
|
apache-2.0
|
enyojs/layout
|
465e33e170a10ad39c3948cb9bcb852bd5705f91
|
src/ol/style/fillstyle.js
|
src/ol/style/fillstyle.js
|
goog.provide('ol.style.Fill');
goog.require('ol.color');
/**
* @constructor
* @param {olx.style.FillOptions} options Options.
*/
ol.style.Fill = function(options) {
/**
* @type {ol.Color|string}
*/
this.color = goog.isDef(options.color) ? options.color : null;
};
|
goog.provide('ol.style.Fill');
goog.require('ol.color');
/**
* @constructor
* @param {olx.style.FillOptions=} opt_options Options.
*/
ol.style.Fill = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
/**
* @type {ol.Color|string}
*/
this.color = goog.isDef(options.color) ? options.color : null;
};
|
Make options argument to ol.style.Fill optional
|
Make options argument to ol.style.Fill optional
|
JavaScript
|
bsd-2-clause
|
das-peter/ol3,adube/ol3,mzur/ol3,xiaoqqchen/ol3,Distem/ol3,gingerik/ol3,antonio83moura/ol3,gingerik/ol3,itayod/ol3,bjornharrtell/ol3,tsauerwein/ol3,Antreasgr/ol3,klokantech/ol3raster,pmlrsg/ol3,das-peter/ol3,landonb/ol3,t27/ol3,kkuunnddaannkk/ol3,freylis/ol3,fredj/ol3,Andrey-Pavlov/ol3,kjelderg/ol3,geonux/ol3,elemoine/ol3,thhomas/ol3,t27/ol3,klokantech/ol3,mechdrew/ol3,bogdanvaduva/ol3,klokantech/ol3,stweil/ol3,tschaub/ol3,bill-chadwick/ol3,landonb/ol3,stweil/ol3,stweil/ol3,antonio83moura/ol3,xiaoqqchen/ol3,Distem/ol3,mzur/ol3,geekdenz/openlayers,fredj/ol3,fblackburn/ol3,llambanna/ol3,freylis/ol3,thhomas/ol3,ahocevar/openlayers,alvinlindstam/ol3,hafenr/ol3,pmlrsg/ol3,NOAA-ORR-ERD/ol3,bill-chadwick/ol3,thomasmoelhave/ol3,thhomas/ol3,CandoImage/ol3,t27/ol3,NOAA-ORR-ERD/ol3,kjelderg/ol3,fblackburn/ol3,richstoner/ol3,xiaoqqchen/ol3,geonux/ol3,NOAA-ORR-ERD/ol3,ahocevar/ol3,tschaub/ol3,llambanna/ol3,gingerik/ol3,pmlrsg/ol3,oterral/ol3,Morgul/ol3,planetlabs/ol3,tamarmot/ol3,richstoner/ol3,tsauerwein/ol3,pmlrsg/ol3,jacmendt/ol3,geonux/ol3,jacmendt/ol3,Morgul/ol3,gingerik/ol3,antonio83moura/ol3,alvinlindstam/ol3,ahocevar/ol3,openlayers/openlayers,bjornharrtell/ol3,mechdrew/ol3,Distem/ol3,CandoImage/ol3,bjornharrtell/ol3,itayod/ol3,klokantech/ol3raster,elemoine/ol3,thomasmoelhave/ol3,stweil/openlayers,kkuunnddaannkk/ol3,denilsonsa/ol3,elemoine/ol3,klokantech/ol3,stweil/openlayers,Antreasgr/ol3,llambanna/ol3,mzur/ol3,wlerner/ol3,Andrey-Pavlov/ol3,alvinlindstam/ol3,tsauerwein/ol3,Morgul/ol3,t27/ol3,denilsonsa/ol3,NOAA-ORR-ERD/ol3,klokantech/ol3,fblackburn/ol3,tsauerwein/ol3,jacmendt/ol3,bartvde/ol3,itayod/ol3,richstoner/ol3,ahocevar/ol3,adube/ol3,aisaacs/ol3,planetlabs/ol3,jmiller-boundless/ol3,Andrey-Pavlov/ol3,thomasmoelhave/ol3,geekdenz/openlayers,geekdenz/ol3,Antreasgr/ol3,geekdenz/ol3,aisaacs/ol3,tamarmot/ol3,mechdrew/ol3,denilsonsa/ol3,hafenr/ol3,bill-chadwick/ol3,llambanna/ol3,freylis/ol3,jmiller-boundless/ol3,fperucic/ol3,jmiller-boundless/ol3,tschaub/ol3,ahocevar/openlayers,bartvde/ol3,wlerner/ol3,thhomas/ol3,Andrey-Pavlov/ol3,elemoine/ol3,ahocevar/ol3,jacmendt/ol3,itayod/ol3,kkuunnddaannkk/ol3,fperucic/ol3,klokantech/ol3raster,ahocevar/openlayers,adube/ol3,bill-chadwick/ol3,aisaacs/ol3,alexbrault/ol3,bogdanvaduva/ol3,wlerner/ol3,openlayers/openlayers,fredj/ol3,jmiller-boundless/ol3,geekdenz/ol3,fredj/ol3,stweil/openlayers,jmiller-boundless/ol3,tschaub/ol3,geekdenz/openlayers,oterral/ol3,landonb/ol3,alexbrault/ol3,kjelderg/ol3,oterral/ol3,tamarmot/ol3,wlerner/ol3,freylis/ol3,richstoner/ol3,bogdanvaduva/ol3,alvinlindstam/ol3,landonb/ol3,alexbrault/ol3,CandoImage/ol3,xiaoqqchen/ol3,das-peter/ol3,Distem/ol3,thomasmoelhave/ol3,bogdanvaduva/ol3,denilsonsa/ol3,planetlabs/ol3,openlayers/openlayers,CandoImage/ol3,mzur/ol3,epointal/ol3,bartvde/ol3,epointal/ol3,fperucic/ol3,hafenr/ol3,planetlabs/ol3,stweil/ol3,das-peter/ol3,antonio83moura/ol3,mechdrew/ol3,tamarmot/ol3,geonux/ol3,epointal/ol3,aisaacs/ol3,Antreasgr/ol3,epointal/ol3,fblackburn/ol3,kkuunnddaannkk/ol3,kjelderg/ol3,alexbrault/ol3,hafenr/ol3,bartvde/ol3,klokantech/ol3raster,geekdenz/ol3,fperucic/ol3,Morgul/ol3
|
4f2ecb38e7eed9706dd4709915a532bdb5a943f2
|
rcmet/src/main/ui/test/unit/services/RegionSelectParamsTest.js
|
rcmet/src/main/ui/test/unit/services/RegionSelectParamsTest.js
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http: *www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
**/
'use strict';
describe('OCW Services', function() {
beforeEach(module('ocw.services'));
describe('RegionSelectParams', function() {
it('should initialize the regionSelectParams service', function() {
inject(function(regionSelectParams) {
expect(regionSelectParams).not.toEqual(null);
});
});
});
});
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http: *www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
**/
'use strict';
describe('OCW Services', function() {
beforeEach(module('ocw.services'));
describe('RegionSelectParams', function() {
it('should initialize the regionSelectParams service', function() {
inject(function(regionSelectParams) {
expect(regionSelectParams).not.toEqual(null);
});
});
it('should provide the getParameters function', function() {
inject(function(regionSelectParams) {
expect(regionSelectParams.getParameters()).not.toEqual(null);
});
});
});
});
|
Resolve CLIMATE-147 - Add tests for regionSelectParams service
|
Resolve CLIMATE-147 - Add tests for regionSelectParams service
- Add getParameters test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/climate/trunk@1496037 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: 3d2be98562f344323a5532ca5757850d175ba25c
|
JavaScript
|
apache-2.0
|
jarifibrahim/climate,apache/climate,Omkar20895/climate,huikyole/climate,MJJoyce/climate,lewismc/climate,MJJoyce/climate,jarifibrahim/climate,kwhitehall/climate,pwcberry/climate,riverma/climate,MJJoyce/climate,agoodm/climate,riverma/climate,agoodm/climate,MBoustani/climate,MBoustani/climate,riverma/climate,lewismc/climate,pwcberry/climate,lewismc/climate,apache/climate,MBoustani/climate,agoodm/climate,huikyole/climate,huikyole/climate,lewismc/climate,apache/climate,MJJoyce/climate,kwhitehall/climate,lewismc/climate,Omkar20895/climate,pwcberry/climate,apache/climate,agoodm/climate,jarifibrahim/climate,Omkar20895/climate,MBoustani/climate,riverma/climate,huikyole/climate,kwhitehall/climate,pwcberry/climate,apache/climate,Omkar20895/climate,kwhitehall/climate,agoodm/climate,pwcberry/climate,jarifibrahim/climate,riverma/climate,MJJoyce/climate,Omkar20895/climate,jarifibrahim/climate,MBoustani/climate,huikyole/climate
|
9750b5683e1a545a66251e78e07ef6b362a8b6d8
|
browser/main.js
|
browser/main.js
|
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const Menu = electron.Menu;
var menu = require('./menu');
var argv = require('optimist').argv;
let mainWindow;
app.on('ready', function() {
mainWindow = new BrowserWindow({
center: true,
title: 'JBrowseDesktop',
width: 1024,
height: 768
});
var queryString = Object.keys(argv).map(key => key + '=' + argv[key]).join('&');
mainWindow.loadURL('file://' + require('path').resolve(__dirname, '../index.html?'+queryString));
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
mainWindow.on('closed', function () {
mainWindow = null;
});
});
// Quit when all windows are closed.
app.on('window-all-closed', function () {
app.quit();
});
|
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const Menu = electron.Menu;
var menu = require('./menu');
var argv = require('optimist').argv;
let mainWindow;
app.on('ready', function() {
mainWindow = new BrowserWindow({
center: true,
title: 'JBrowseDesktop',
width: 1024,
height: 768,
icon: require('path').resolve(__dirname, 'icons/jbrowse.png')
});
var queryString = Object.keys(argv).map(key => key + '=' + argv[key]).join('&');
mainWindow.loadURL('file://' + require('path').resolve(__dirname, '../index.html?'+queryString));
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
mainWindow.on('closed', function () {
mainWindow = null;
});
});
// Quit when all windows are closed.
app.on('window-all-closed', function () {
app.quit();
});
|
Add icon that works for linux apps also
|
Add icon that works for linux apps also
|
JavaScript
|
lgpl-2.1
|
GMOD/jbrowse,GMOD/jbrowse,GMOD/jbrowse,nathandunn/jbrowse,nathandunn/jbrowse,nathandunn/jbrowse,GMOD/jbrowse,GMOD/jbrowse,nathandunn/jbrowse,nathandunn/jbrowse
|
f5d144abff50c9044cbfeeec16c8169a361aec1c
|
packages/@sanity/server/src/configs/postcssPlugins.js
|
packages/@sanity/server/src/configs/postcssPlugins.js
|
import lost from 'lost'
import postcssUrl from 'postcss-url'
import postcssImport from 'postcss-import'
import postcssCssnext from 'postcss-cssnext'
import resolveStyleImport from '../util/resolveStyleImport'
export default options => {
const styleResolver = resolveStyleImport({from: options.basePath})
const importer = postcssImport({resolve: styleResolver})
return wp => {
return [
importer,
postcssCssnext,
postcssUrl({url: 'rebase'}),
lost
]
}
}
|
import path from 'path'
import lost from 'lost'
import postcssUrl from 'postcss-url'
import postcssImport from 'postcss-import'
import postcssCssnext from 'postcss-cssnext'
import resolveStyleImport from '../util/resolveStyleImport'
const absolute = /^(\/|\w+:\/\/)/
const isAbsolute = url => absolute.test(url)
export default options => {
const styleResolver = resolveStyleImport({from: options.basePath})
const importer = postcssImport({resolve: styleResolver})
const resolveUrl = (url, decl, from, dirname) => (
isAbsolute(url) ? url : path.resolve(dirname, url)
)
return wp => {
return [
importer,
postcssCssnext,
postcssUrl({url: resolveUrl}),
lost
]
}
}
|
Use custom way to resolve URLs for file assets that are relative
|
[server] Use custom way to resolve URLs for file assets that are relative
|
JavaScript
|
mit
|
sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity
|
f0d73e072691c7ae4ee848c7ef0868aebd6c8ce4
|
components/prism-docker.js
|
components/prism-docker.js
|
Prism.languages.docker = {
'keyword': {
pattern: /(^\s*)(?:ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|LABEL|ENTRYPOINT)(?=\s)/mi,
lookbehind: true
},
'string': /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,
'comment': /#.*/,
'punctuation': /---|\.\.\.|[:[\]{}\-,|>?]/
};
Prism.languages.dockerfile = Prism.languages.docker;
|
Prism.languages.docker = {
'keyword': {
pattern: /(^\s*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)/mi,
lookbehind: true
},
'string': /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,
'comment': /#.*/,
'punctuation': /---|\.\.\.|[:[\]{}\-,|>?]/
};
Prism.languages.dockerfile = Prism.languages.docker;
|
Update the list of keywords for dockerfiles
|
Update the list of keywords for dockerfiles
|
JavaScript
|
mit
|
PrismJS/prism,mAAdhaTTah/prism,PrismJS/prism,CupOfTea696/prism,mAAdhaTTah/prism,PrismJS/prism,byverdu/prism,PrismJS/prism,byverdu/prism,CupOfTea696/prism,mAAdhaTTah/prism,mAAdhaTTah/prism,mAAdhaTTah/prism,PrismJS/prism,CupOfTea696/prism,byverdu/prism,byverdu/prism,CupOfTea696/prism,CupOfTea696/prism,byverdu/prism
|
030b97c50a57e1487b8459f91ee4a220810a8a63
|
babel.config.js
|
babel.config.js
|
require("@babel/register")({
only: [
"src",
/node_modules\/alekhine/
]
})
module.exports = {
presets: [
"@babel/preset-env"
],
plugins: [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-object-rest-spread",
"add-filehash", [
"transform-imports",
{
vuetify: {
transform: "vuetify/src/components/${member}",
preventFullImport: false
}
}
]
],
env: {
development: {
"sourceMaps": "inline"
}
}
}
|
module.exports = {
presets: [
"@babel/preset-env"
],
plugins: [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-object-rest-spread",
"add-filehash", [
"transform-imports",
{
vuetify: {
transform: "vuetify/src/components/${member}",
preventFullImport: false
}
}
]
],
env: {
development: {
"sourceMaps": "inline"
}
}
}
|
Revert "compile alekhine as needed in development"
|
Revert "compile alekhine as needed in development"
This reverts commit 917d5d50fd6ef0bbf845efa0bf13a2adba2fe58a.
|
JavaScript
|
mit
|
sonnym/bughouse,sonnym/bughouse
|
27982b6392b8dcd2adc22fb0db7eb0aecab0f62a
|
test/algorithms/sorting/testHeapSort.js
|
test/algorithms/sorting/testHeapSort.js
|
/* eslint-env mocha */
const HeapSort = require('../../../src').algorithms.Sorting.HeapSort;
const assert = require('assert');
describe('HeapSort', () => {
it('should have no data when empty initialization', () => {
const inst = new HeapSort();
assert.equal(inst.size, 0);
assert.deepEqual(inst.unsortedList, []);
assert.deepEqual(inst.sortedList, []);
});
it('should sort the array', () => {
const inst = new HeapSort([2, 1, 3, 4]);
assert.equal(inst.size, 4);
assert.deepEqual(inst.unsortedList, [2, 1, 3, 4]);
assert.deepEqual(inst.sortedList, [1, 2, 3, 4]);
assert.equal(inst.toString(), '1, 2, 3, 4');
});
});
|
/* eslint-env mocha */
const HeapSort = require('../../../src').algorithms.Sorting.HeapSort;
const assert = require('assert');
describe('HeapSort', () => {
it('should have no data when empty initialization', () => {
const inst = new HeapSort();
assert.equal(inst.size, 0);
assert.deepEqual(inst.unsortedList, []);
assert.deepEqual(inst.sortedList, []);
});
it('should sort the array', () => {
const inst = new HeapSort([2, 1, 3, 4]);
assert.equal(inst.size, 4);
assert.deepEqual(inst.unsortedList, [2, 1, 3, 4]);
assert.deepEqual(inst.sortedList, [1, 2, 3, 4]);
assert.equal(inst.toString(), '1, 2, 3, 4');
});
it('should sort the array in ascending order with few equal vals', () => {
const inst = new HeapSort([2, 1, 3, 4, 2], (a, b) => a < b);
assert.equal(inst.size, 5);
assert.deepEqual(inst.unsortedList, [2, 1, 3, 4, 2]);
assert.deepEqual(inst.sortedList, [1, 2, 2, 3, 4]);
assert.equal(inst.toString(), '1, 2, 2, 3, 4');
});
});
|
Test Heap Sort: Sort array with equal vals
|
Test Heap Sort: Sort array with equal vals
|
JavaScript
|
mit
|
ManrajGrover/algorithms-js
|
6a408d16822f596bedeb524912471845ced74048
|
ckanext/ckanext-apicatalog_ui/ckanext/apicatalog_ui/fanstatic/cookieconsent/ckan-cookieconsent.js
|
ckanext/ckanext-apicatalog_ui/ckanext/apicatalog_ui/fanstatic/cookieconsent/ckan-cookieconsent.js
|
window.cookieconsent.initialise({
container: document.getElementById("cookie_consent"),
position: "top",
type: "opt-in",
static: false,
theme: "suomifi",
onInitialise: function (status){
let type = this.options.type;
let didConsent = this.hasConsented();
if (type === 'opt-in' && didConsent) {
console.log("enable cookies")
}
if (type === 'opt-out' && !didConsent) {
console.log("disable cookies")
}
},
onStatusChange: function(status, chosenBefore) {
let type = this.options.type;
let didConsent = this.hasConsented();
if (type === 'opt-in' && didConsent) {
console.log("enable cookies")
window.location.reload();
}
if (type === 'opt-in' && !didConsent) {
console.log("disable cookies")
window.location.reload();
}
}
})
|
ckan.module('cookie_consent', function (jQuery){
return {
initialize: function() {
window.cookieconsent.initialise({
container: document.getElementById("cookie_consent"),
position: "top",
type: "opt-in",
static: false,
theme: "suomifi",
content: {
policy: this._('Cookie Policy'),
message: this._('This website uses cookies to ensure you get the best experience on our website.'),
allow: this._('Allow cookies'),
deny: this._('Decline'),
link: this._('Learn more')
},
onStatusChange: function(status, chosenBefore) {
let type = this.options.type;
let didConsent = this.hasConsented();
if (type === 'opt-in' && didConsent) {
console.log("enable cookies")
window.location.reload();
}
if (type === 'opt-in' && !didConsent) {
console.log("disable cookies")
window.location.reload();
}
}
})
}
}
})
|
Add translations to cookie popup
|
LIKA-244: Add translations to cookie popup
|
JavaScript
|
mit
|
vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog
|
771e7c0d485a6a0e45d550d555beb500e256ebde
|
react/react-practice/src/actions/lifeCycleActions.js
|
react/react-practice/src/actions/lifeCycleActions.js
|
import {firebaseApp,firebaseAuth,firebaseDb, firebaseStorage, firebaseAuthInstance } from '../components/Firebase.js'
import { browserHistory } from 'react-router';
export function goToNextState() {
return function(dispatch) {
dispatch({type: "GET_SCHEDULE"})
}
}
export function testPromise() {
let response = new Promise()
return function(dispatch) {
dispatch({type: "TEST_PROMISE"})
}
}
|
import {firebaseApp,firebaseAuth,firebaseDb, firebaseStorage, firebaseAuthInstance } from '../components/Firebase.js'
import { browserHistory } from 'react-router';
export function goToNextState() {
return function(dispatch) {
dispatch({type: "GET_SCHEDULE"})
}
}
export function testPromise() {
let response = new Promise((resolve, reject) => {
function(dispatch) {
dispatch({type: "TEST_PROMISE"})
}
})
return function(dispatch) {
dispatch({type: "TEST_PROMISE"})
}
}
|
Test promise in the actions
|
Test promise in the actions
|
JavaScript
|
mit
|
jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm
|
b9ed588780e616228d133b91117b80930d658140
|
src/components/PlaybackCtrl/PlaybackCtrlContainer.js
|
src/components/PlaybackCtrl/PlaybackCtrlContainer.js
|
import { connect } from 'react-redux'
import PlaybackCtrl from './PlaybackCtrl'
import { requestPlay, requestPause, requestVolume, requestPlayNext } from 'store/modules/status'
// Object of action creators (can also be function that returns object).
const mapActionCreators = {
requestPlay,
requestPlayNext,
requestPause,
requestVolume,
}
const mapStateToProps = (state) => {
return {
isAdmin: state.user.isAdmin,
isInRoom: state.user.roomId !== null,
isPlaying: state.status.isPlaying,
isAtQueueEnd: state.status.isAtQueueEnd,
volume: state.status.volume,
}
}
export default connect(mapStateToProps, mapActionCreators)(PlaybackCtrl)
|
import { connect } from 'react-redux'
import PlaybackCtrl from './PlaybackCtrl'
import { requestPlay, requestPause, requestVolume, requestPlayNext } from 'store/modules/status'
// Object of action creators (can also be function that returns object).
const mapActionCreators = {
requestPlay,
requestPlayNext,
requestPause,
requestVolume,
}
const mapStateToProps = (state) => {
return {
isAdmin: state.user.isAdmin,
isInRoom: state.user.roomId !== null,
isPlaying: state.status.isPlaying,
isAtQueueEnd: state.status.isAtQueueEnd,
volume: state.status.volume,
isPlayerPresent: state.status.isPlayerPresent,
}
}
export default connect(mapStateToProps, mapActionCreators)(PlaybackCtrl)
|
Add missing status prop for PlaybackCtrl
|
Add missing status prop for PlaybackCtrl
|
JavaScript
|
isc
|
bhj/karaoke-forever,bhj/karaoke-forever
|
66b91190f513893efbe7eef9beba1925e32a44d5
|
lib/build-navigation/index.js
|
lib/build-navigation/index.js
|
'use strict';
const path = require('path');
const buildNavigation = function(styleguideArray) {
let options = this;
options.navigation = {};
styleguideArray.forEach((obj) => {
let fileName = (obj.writeName || obj.title).replace(/ /g, '_').toLowerCase() + '.html';
options.navigation[obj.title] = fileName;
});
return styleguideArray;
};
module.exports = buildNavigation;
|
'use strict';
const buildNavigation = function(styleguideArray) {
let options = this,
_nav = {};
options.navigation = {};
styleguideArray.forEach((obj) => {
let fileName = (obj.writeName || obj.title).replace(/ /g, '_').toLowerCase() + '.html';
_nav[obj.title] = fileName;
});
Object.keys(_nav)
.sort()
.forEach(function(v, i) {
options.navigation[v] = _nav[v];
});
return styleguideArray;
};
module.exports = buildNavigation;
|
Update navigation to be in alphabetical order
|
Update navigation to be in alphabetical order
|
JavaScript
|
mit
|
tbremer/live-guide,tbremer/live-guide
|
ac0c31a94428c1180ef7b309c79410bfc28ccdf0
|
config.js
|
config.js
|
var env = process.env.NODE_ENV || 'development';
var defaults = {
"static": {
port: 3003
},
"socket": {
options: {
origins: '*:*',
log: true,
heartbeats: false,
authorization: false,
transports: [
'websocket',
'flashsocket',
'htmlfile',
'xhr-polling',
'jsonp-polling'
],
'log level': 1,
'flash policy server': true,
'flash policy port': 3013,
'destroy upgrade': true,
'browser client': true,
'browser client minification': true,
'browser client etag': true,
'browser client gzip': false
}
},
"nohm": {
url: 'localhost',
port: 6379,
db: 2,
prefix: 'admin'
},
"redis": {
url: 'localhost',
port: 6379,
db: 2
},
"sessions": {
secret: "super secret cat",
db: 1
}
};
if (env === 'production' || env === 'staging') {
defaults["static"].port = 80;
}
if (env === 'staging') {
defaults['static'].port = 3004;
}
module.exports = defaults;
|
var env = process.env.NODE_ENV || 'development';
var defaults = {
"static": {
port: 3003
},
"socket": {
options: {
origins: '*:*',
log: true,
heartbeats: false,
authorization: false,
transports: [
'websocket',
'flashsocket',
'htmlfile',
'xhr-polling',
'jsonp-polling'
],
'log level': 1,
'flash policy server': true,
'flash policy port': 3013,
'destroy upgrade': true,
'browser client': true,
'browser client minification': true,
'browser client etag': true,
'browser client gzip': false
}
},
"nohm": {
url: 'localhost',
port: 6379,
db: 2,
prefix: 'admin'
},
"redis": {
url: 'localhost',
port: 6379,
db: 2
},
"sessions": {
secret: "super secret cat",
db: 1
}
};
module.exports = defaults;
|
Remove prod/staging ports so people don't get the idea to run this on these environments
|
Remove prod/staging ports so people don't get the idea to run this on these environments
|
JavaScript
|
mit
|
maritz/nohm-admin,maritz/nohm-admin
|
fb0993fb10b597884fb37f819743bce9d63accb0
|
src/main/webapp/resources/js/apis/galaxy/galaxy.js
|
src/main/webapp/resources/js/apis/galaxy/galaxy.js
|
import axios from "axios";
export const getGalaxyClientAuthentication = clientId =>
axios
.get(
`${window.TL.BASE_URL}ajax/galaxy-export/authorized?clientId=${clientId}`
)
.then(({ data }) => data);
export const getGalaxySamples = () =>
axios
.get(`${window.TL.BASE_URL}ajax/galaxy-export/samples`)
.then(({ data }) => data);
export const exportToGalaxy = (
email,
makepairedcollection,
oauthCode,
oauthRedirect,
samples
) => {
const name = `IRIDA-${Math.random()
.toString()
.slice(2, 14)}`;
const params = {
_embedded: {
library: { name },
user: { email },
addtohistory: true, // Default according to Phil Mabon
makepairedcollection,
oauth2: {
code: oauthCode,
redirect: oauthRedirect
},
samples
}
};
const form = document.forms["js-galaxy-form"];
if (typeof form === "undefined") {
throw new Error(`Expecting the galaxy form with name "js-galaxy-form"`);
} else {
const input = form.elements["js-query"];
input.value = JSON.stringify(params);
form.submit();
}
};
|
import axios from "axios";
export const getGalaxyClientAuthentication = clientId =>
axios
.get(
`${window.TL.BASE_URL}ajax/galaxy-export/authorized?clientId=${clientId}`
)
.then(({ data }) => data);
export const getGalaxySamples = () =>
axios
.get(`${window.TL.BASE_URL}ajax/galaxy-export/samples`)
.then(({ data }) => data);
export const exportToGalaxy = (
email,
makepairedcollection,
oauthCode,
oauthRedirect,
samples
) => {
const name = `IRIDA-${Date.now()}`;
/*
This structure is expected by galaxy.
*/
const params = {
_embedded: {
library: { name },
user: { email },
addtohistory: true, // Default according to Phil Mabon
makepairedcollection,
oauth2: {
code: oauthCode,
redirect: oauthRedirect
},
samples
}
};
const form = document.forms["js-galaxy-form"];
if (typeof form === "undefined") {
throw new Error(`Expecting the galaxy form with name "js-galaxy-form"`);
} else {
const input = form.elements["js-query"];
input.value = JSON.stringify(params);
form.submit();
}
};
|
Update library name to be a timestamp
|
Update library name to be a timestamp
Signed-off-by: Josh Adam <8493dc4643ddc08e2ef6b4cf76c12d4ffb7203d1@canada.ca>
|
JavaScript
|
apache-2.0
|
phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida
|
6c8ce552cf95452c35a9e5d4a322960bfdf94572
|
src/helpers/replacePath.js
|
src/helpers/replacePath.js
|
import resolveNode from "../helpers/resolveNode";
import match from "../helpers/matchRedirect";
import {relative, dirname} from "path";
export default function (t, originalPath, {opts: {root, extensions}, file: {opts: {filename}}}, regexps) {
const requiredFilename = resolveNode(dirname(filename), originalPath.node.value, extensions);
console.log("requiredFilename:", requiredFilename);
// console.log("Options:", {regexps, root});
const {redirect, redirected} = match(requiredFilename, regexps, root, extensions);
console.log("CALCULATED REDIRECT:", redirected);
// args[0] = t.stringLiteral("PPAth");
// path has a corresponing redirect
if(redirected !== null) {
// console.log("from:", dirname(filename));
// console.log("rel:", relative(dirname(filename), redirected));
// args[0] = t.stringLiteral(redirected);
if(redirected.includes("/node_modules/")) {
if(resolveNode(dirname(filename), redirect, extensions)) {
console.log("FINAL -- MODULE", redirect);
originalPath.replaceWith(t.stringLiteral(redirect));
return;
}
}
let relativeRedirect = relative(dirname(filename), redirected);
if(!relativeRedirect.startsWith(".")) relativeRedirect = "./" + relativeRedirect;
originalPath.replaceWith(t.stringLiteral(relativeRedirect));
}
}
|
import resolveNode from "../helpers/resolveNode";
import match from "../helpers/matchRedirect";
import {relative, dirname, extname} from "path";
export default function (t, originalPath, {opts: {root, extensions}, file: {opts: {filename}}}, regexps) {
const requiredFilename = resolveNode(dirname(filename), originalPath.node.value, extensions);
console.log("requiredFilename:", requiredFilename);
// console.log("Options:", {regexps, root});
const {redirect, redirected} = match(requiredFilename, regexps, root, extensions);
console.log("CALCULATED REDIRECT:", redirected);
// args[0] = t.stringLiteral("PPAth");
// path has a corresponing redirect
if(redirected !== null) {
// console.log("from:", dirname(filename));
// console.log("rel:", relative(dirname(filename), redirected));
// args[0] = t.stringLiteral(redirected);
if(redirected.includes("/node_modules/")) {
if(resolveNode(dirname(filename), redirect, extensions)) {
console.log("FINAL -- MODULE", redirect);
originalPath.replaceWith(t.stringLiteral(redirect));
return;
}
}
let relativeRedirect = relative(dirname(filename), redirected);
if(!relativeRedirect.startsWith(".")) relativeRedirect = "./" + relativeRedirect;
if(!extname(redirect)) {
const ext = extname(relativeRedirect);
if(ext) relativeRedirect = relativeRedirect.slice(0, -ext.length);
}
originalPath.replaceWith(t.stringLiteral(relativeRedirect));
}
}
|
Fix file extension added when redirect didn't have one
|
fix(replacement): Fix file extension added when redirect didn't have one
|
JavaScript
|
mit
|
Velenir/babel-plugin-import-redirect
|
3ba06c96a3181c46b2c52a1849bfc284f05e9596
|
experiments/GitHubGistUserCreator.js
|
experiments/GitHubGistUserCreator.js
|
const bcrypt = require('bcrypt');
const GitHub = require('github-api');
const crypto = require('crypto');
const { User } = require('../models');
const { email } = require('../utils');
const GITHUB_API_TOKEN = process.env.GITHUB_TOKEN;
const GITHUB_GIST_ID = process.env.GITHUB_GIST_ID;
// Authenticate using a GitHub Token
const ghClient = new GitHub({
token: GITHUB_API_TOKEN
});
const userGist = ghClient.getGist(GITHUB_GIST_ID);
userGist.read((err, gist) => {
if (err) {
console.error(err);
return;
}
JSON.parse(gist['files']['users.json']['content']).forEach((user) => { // eslint-disable-line dot-notation
const current_date = (new Date()).valueOf().toString();
const random = Math.random().toString();
const password = crypto.createHmac('sha1', current_date).update(random).digest('hex');
user.password = bcrypt.hashSync(password, bcrypt.genSaltSync(1)); // eslint-disable-line no-sync
return User.create(user.name, user.nameNumber, user.instrument, user.part, user.role, user.spotId, user.email, user.password)
.then(() => {
email.sendUserCreateEmail(user.email, user.nameNumber, password);
return;
})
.catch(console.error);
});
});
|
const bcrypt = require('bcrypt');
const GitHub = require('github-api');
const crypto = require('crypto');
const { Spot, User } = require('../models');
const { email } = require('../utils');
const GITHUB_API_TOKEN = process.env.GITHUB_TOKEN;
const GITHUB_GIST_ID = process.env.GITHUB_GIST_ID;
// Authenticate using a GitHub Token
const ghClient = new GitHub({
token: GITHUB_API_TOKEN
});
const userGist = ghClient.getGist(GITHUB_GIST_ID);
userGist.read((err, gist) => {
if (err) {
console.error(err);
return;
}
JSON.parse(gist['files']['users.json']['content']).forEach((user) => { // eslint-disable-line dot-notation
const current_date = (new Date()).valueOf().toString();
const random = Math.random().toString();
const password = crypto.createHmac('sha1', current_date).update(random).digest('hex');
user.password = bcrypt.hashSync(password, bcrypt.genSaltSync(1)); // eslint-disable-line no-sync
return Spot.create(user.spotId)
.then(() => User.create(user.name, user.nameNumber, user.instrument, user.part, user.role, user.spotId, user.email, user.password))
.then(() => {
email.sendUserCreateEmail(user.email, user.nameNumber, password);
return;
})
.catch((err) => {
console.error(err);
console.log(user);
});
});
});
|
Create spot along with user
|
Create spot along with user
|
JavaScript
|
mit
|
osumb/challenges,osumb/challenges,osumb/challenges,osumb/challenges
|
b4801f092fde031842c4858dda1794863ecaf2d9
|
app/assets/javascripts/replies.js
|
app/assets/javascripts/replies.js
|
jQuery(function() {
jQuery('a[href=#preview]').click(function(e) {
var form = jQuery('#new_reply');
jQuery.ajax({
url: form.attr('action'),
type: 'post',
data: {
reply: {
content: form.find('#reply_content').val()
}
},
success: function(data) {
var html = jQuery(data).find('#preview').html();
jQuery('#preview').html(html);
}
});
});
});
|
jQuery(function() {
jQuery('a[href=#preview]').click(function(e) {
var form = jQuery(this).parents('form');
jQuery.ajax({
url: '/previews/new',
type: 'get',
data: {
content: form.find('textarea').val(),
},
success: function(data) {
jQuery('#preview').html(data);
}
});
});
});
|
Switch to preview rendering in seperate controller
|
Switch to preview rendering in seperate controller
|
JavaScript
|
agpl-3.0
|
paradime/brimir,Gitlab11/brimir,johnsmithpoten/brimir,mbchandar/brimir,himeshp/brimir,viddypiddy/brimir,git-jls/brimir,hadifarnoud/brimir,ask4prasath/brimir_clone,Gitlab11/brimir,fiedl/brimir,johnsmithpoten/brimir,viddypiddy/brimir,fiedl/brimir,Gitlab11/brimir,ask4prasath/madGeeksAimWeb,paradime/brimir,mbchandar/brimir,ask4prasath/brimirclone,paradime/brimir,mbchandar/brimir,git-jls/brimir,viddypiddy/brimir,vartana/brimir,Gitlab11/brimir,ivaldi/brimir,fiedl/brimir,johnsmithpoten/brimir,vartana/brimir,ivaldi/brimir,hadifarnoud/brimir,ask4prasath/brimirclone,git-jls/brimir,mbchandar/brimir,fiedl/brimir,hadifarnoud/brimir,vartana/brimir,ivaldi/brimir,ivaldi/brimir,git-jls/brimir,himeshp/brimir,ask4prasath/madGeeksAimWeb,himeshp/brimir,vartana/brimir,ask4prasath/brimir_clone,himeshp/brimir,hadifarnoud/brimir,ask4prasath/brimir_clone,paradime/brimir,ask4prasath/madGeeksAimWeb,ask4prasath/brimirclone,viddypiddy/brimir
|
3c84d34e41b14f43b8229fadbce86312ac19f964
|
ast/call.js
|
ast/call.js
|
module.exports = class Call {
constructor(callee, args) {
this.callee = callee;
this.args = args;
}
analyze(context) {
this.callee.analyze(context);
context.assertIsFunction(this.callee.referent);
this.checkNumberOfArguments(this.callee.referent);
this.checkArgumentNamesAndPositionalRules(this.callee.referent);
}
checkNumberOfArguments(callee) {
const numArgs = this.args.length;
const numRequiredParams = callee.requiredParameterNames.size;
const numParams = callee.allParameterNames.size;
if (numArgs < numRequiredParams) {
// We have to at least cover all the required parameters
throw new Error(`Expected at least ${numRequiredParams} arguments but called with ${numArgs}`);
}
if (numArgs > numParams) {
// We can't pass more arguments than the total number of parameters
throw new Error(`Expected at most ${numParams} arguments but called with ${numArgs}`);
}
}
checkArgumentNamesAndPositionalRules(callee) {
let keywordArgumentSeen = false;
this.args.forEach((arg) => {
if (arg.id) {
// This is a keyword argument, record that fact and check that it's okay
keywordArgumentSeen = true;
if (!callee.allParameterNames.has(arg.id)) {
throw new Error(`Function does not have a parameter called ${arg.id}`);
}
} else if (keywordArgumentSeen) {
// This is a positional argument, but a prior one was a keyword one
throw new Error('Positional argument in call after keyword argument');
}
});
}
};
|
module.exports = class Call {
constructor(callee, args) {
this.callee = callee;
this.args = args;
}
analyze(context) {
this.callee.analyze(context);
context.assertIsFunction(this.callee.referent);
this.checkArgumentMatching(this.callee.referent);
}
checkArgumentMatching(callee) {
let keywordArgumentSeen = false;
const matchedParameterNames = new Set([]);
this.args.forEach((arg, index) => {
if (index >= callee.params.length) {
throw new Error('Too many arguments in call');
}
if (arg.id) {
keywordArgumentSeen = true;
} else if (keywordArgumentSeen) {
throw new Error('Positional argument in call after keyword argument');
}
const parameterName = arg.id ? arg.id : callee.params[index].id;
if (!callee.allParameterNames.has(parameterName)) {
throw new Error(`Function does not have a parameter called ${parameterName}`);
}
if (matchedParameterNames.has(parameterName)) {
throw new Error(`Multiple arguments for parameter ${parameterName}`);
}
matchedParameterNames.add(parameterName);
});
// Look for and report a required parameter that is not matched
const miss = [...callee.requiredParameterNames].find(name => !matchedParameterNames.has(name));
if (miss) {
throw new Error(`Required parameter ${miss} is not matched in call`);
}
}
};
|
Implement proper parameter matching rules
|
Implement proper parameter matching rules
|
JavaScript
|
mit
|
rtoal/plainscript
|
1d59470c25001556346e252ca344fa7f4d26c453
|
jquery.observe_field.js
|
jquery.observe_field.js
|
// jquery.observe_field.js
(function( $ ){
jQuery.fn.observe_field = function(frequency, callback) {
frequency = frequency * 1000; // translate to milliseconds
return this.each(function(){
var $this = $(this);
var prev = $this.val();
var check = function() {
var val = $this.val();
if(prev != val){
prev = val;
$this.map(callback); // invokes the callback on $this
}
};
var reset = function() {
if(ti){
clearInterval(ti);
ti = setInterval(check, frequency);
}
};
check();
var ti = setInterval(check, frequency); // invoke check periodically
// reset counter after user interaction
$this.bind('keyup click mousemove', reset); //mousemove is for selects
});
};
})( jQuery );
|
// jquery.observe_field.js
(function( $ ){
jQuery.fn.observe_field = function(frequency, callback) {
frequency = frequency * 1000; // translate to milliseconds
return this.each(function(){
var $this = $(this);
var prev = $this.val();
var check = function() {
if(removed()){ // if removed clear the interval and don't fire the callback
if(ti) clearInterval(ti);
return;
}
var val = $this.val();
if(prev != val){
prev = val;
$this.map(callback); // invokes the callback on $this
}
};
var removed = function() {
return $this.closest('html').length == 0
};
var reset = function() {
if(ti){
clearInterval(ti);
ti = setInterval(check, frequency);
}
};
check();
var ti = setInterval(check, frequency); // invoke check periodically
// reset counter after user interaction
$this.bind('keyup click mousemove', reset); //mousemove is for selects
});
};
})( jQuery );
|
Fix bug in IE9 when observed elements are removed from the DOM
|
Fix bug in IE9 when observed elements are removed from the DOM
|
JavaScript
|
mit
|
splendeo/jquery.observe_field,splendeo/jquery.observe_field
|
30a3ce599413db184f2ccc19ec362ea8d88f60e6
|
js/component-graphic.js
|
js/component-graphic.js
|
define([], function () {
'use strict';
var ComponentGraphic = function (options) {
this.color = options.color || "#dc322f";
};
ComponentGraphic.prototype.paint = function paint(gc) {
gc.fillStyle = this.color;
gc.fillRect(0, 0, 15, 15);
};
return ComponentGraphic;
});
|
define([], function () {
'use strict';
var ComponentGraphic = function (options) {
options = options || {};
this.color = options.color || "#dc322f";
};
ComponentGraphic.prototype.paint = function paint(gc) {
gc.fillStyle = this.color;
gc.fillRect(0, 0, 15, 15);
};
return ComponentGraphic;
});
|
Set default options for graphic component
|
Set default options for graphic component
|
JavaScript
|
mit
|
floriico/onyx,floriico/onyx
|
1e928e64d6ea914870e2240a12bf33b8b2cf09b0
|
src/openfisca-proptypes.js
|
src/openfisca-proptypes.js
|
import PropTypes from 'prop-types'
const valuesShape = PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.bool,
PropTypes.number,
PropTypes.string,
]))
export const parameterShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
normalizedDescription: PropTypes.string,
values: valuesShape,
brackets: PropTypes.objectOf(valuesShape),
})
export const variableShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
definitionPeriod: PropTypes.string,
entity: PropTypes.string,
formulas: PropTypes.object,
normalizedDescription: PropTypes.string,
source: PropTypes.string,
})
|
import PropTypes from 'prop-types'
const valuesShape = PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.bool,
PropTypes.number,
PropTypes.string,
]))
export const parameterShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
documentation: PropTypes.string,
normalizedDescription: PropTypes.string,
values: valuesShape,
brackets: PropTypes.objectOf(valuesShape),
})
export const variableShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
definitionPeriod: PropTypes.string,
documentation: PropTypes.string,
entity: PropTypes.string,
formulas: PropTypes.object,
normalizedDescription: PropTypes.string,
source: PropTypes.string,
})
|
Update parameters and variables shapes
|
Update parameters and variables shapes
|
JavaScript
|
agpl-3.0
|
openfisca/legislation-explorer
|
d0d13e5feea4aa2c3d7f35be31dcbd0299f9a4d3
|
client/components/App/App.js
|
client/components/App/App.js
|
// @flow
import React from 'react'
import 'normalize.css/normalize.css'
import Footer from 'components/Footer/Footer'
import Nav from '../Nav/Nav'
import MobileFooterToolbar from '../Nav/MobileFooterToolbar/MobileFooterToolbar'
import styles from './App.scss'
import '../../styles/global.scss'
import Content from 'react-mdc-web/lib/Content/Content'
const title = 'Reango'
type AppPropsType = {
viewer: Object,
children: Object
}
let App = (props: AppPropsType) =>
<div className={styles.root} >
<Nav
title={title}
viewer={props.viewer}
/>
<Content className={`${styles.wrap}`} >
<div className={styles.content} >
{props.children}
</div>
</Content>
{props.viewer.isAuthenticated ?
<div className={styles.mobile_footer_wrap} >
<MobileFooterToolbar />
</div> : null}
<div className={`${styles.footer_wrap} ${!props.viewer.isAuthenticated ? styles.hidden_mobile_footer_wrap: null}`} >
<div className={styles.footer} >
<Footer
title={title}
/>
</div>
</div>
</div>
export default App
|
// @flow
import React from 'react'
import 'normalize.css/normalize.css'
import Footer from 'components/Footer/Footer'
import Nav from '../Nav/Nav'
import MobileFooterToolbar from '../Nav/MobileFooterNav/MobileFooterNav'
import styles from './App.scss'
import '../../styles/global.scss'
import Content from 'react-mdc-web/lib/Content/Content'
const title = 'Reango'
type AppPropsType = {
viewer: Object,
children: Object
}
let App = (props: AppPropsType) =>
<div className={styles.root} >
<Nav
title={title}
viewer={props.viewer}
/>
<Content className={`${styles.wrap}`} >
<div className={styles.content} >
{props.children}
</div>
</Content>
{props.viewer.isAuthenticated ?
<div className={styles.mobile_footer_wrap} >
<MobileFooterToolbar />
</div> : null}
<div className={`${styles.footer_wrap} ${!props.viewer.isAuthenticated ? styles.hidden_mobile_footer_wrap: null}`} >
<div className={styles.footer} >
<Footer
title={title}
/>
</div>
</div>
</div>
export default App
|
Fix mobile footer toolbar import rename
|
Fix mobile footer toolbar import rename
|
JavaScript
|
mit
|
ncrmro/reango,ncrmro/ango,ncrmro/reango,ncrmro/ango,ncrmro/ango,ncrmro/reango
|
edd29b9bcb894ed1fd6511f2e748a87a14d792f3
|
assets/site.js
|
assets/site.js
|
(function(){
"use strict";
var d = document, inits = [];
window.initializers = inits;
// initializer to manipulate all hyperlinks
inits.push(function(){
var x, h = location.host;
for (var xs = d.links, i = xs.length; i--; ){
var x = xs[i], m = x.getAttribute('data-m');
if (m) {
// de-obfuscate e-mail hyperlink
m = m.replace(/[\/]/g, '@').replace(/,/g, '.');
x.href = 'mailto:' + m;
if ((x = x.firstChild) && x.nodeType == 3){
x.data = m;
}
} else if (x.host != h){
// set target to _blank for all external hyperlinks
x.target = '_blank';
}
}
});
// initializer to set current year in copyright footer
inits.push(function(){
if (d.querySelector){
var x = d.querySelector('body>footer>time');
if (x){
x.innerHTML = (new Date()).getFullYear();
}
}
});
function initPage(){
// call all initializers
for(var i = 0, n = inits.length; i < n; i++){
inits[i]();
}
}
initPage();
}())
|
(function(){
"use strict";
var d = document, inits = [];
window.initializers = inits;
// initializer to manipulate all hyperlinks
inits.push(function(){
var x, h = location.host;
for (var xs = d.links, i = xs.length; i--; ){
var x = xs[i], m = x.getAttribute('data-m');
if (m) {
// de-obfuscate e-mail hyperlink
m = m.replace(/[\/]/g, '@').replace(/,/g, '.');
x.href = 'mailto:' + m;
if ((x = x.firstChild) && x.nodeType == 3){
x.data = m;
}
} else if (x.host != h){
// set target to _blank for all external hyperlinks
x.target = '_blank';
}
}
});
// initializer to set active tab in page header
inits.push(function(){
if (d.querySelectorAll){
var xs = d.querySelectorAll('body>header>nav>a'), href = location.href;
for(var i = 1, n = xs.length; i < n; i++){
var x = xs[i];
if (href.startsWith(x.href)){
x.classList.add('active');
} else {
x.classList.remove('active');
}
}
}
});
// initializer to set current year in copyright footer
inits.push(function(){
if (d.querySelector){
var x = d.querySelector('body>footer>time');
if (x){
x.innerHTML = (new Date()).getFullYear();
}
}
});
function initPage(){
// call all initializers
for(var i = 0, n = inits.length; i < n; i++){
inits[i]();
}
}
initPage();
}())
|
Add initializer to set active tab in page header
|
Add initializer to set active tab in page header
|
JavaScript
|
mit
|
tommy-carlier/www.tcx.be,tommy-carlier/www.tcx.be,tommy-carlier/www.tcx.be
|
110e1871555cece764e2dcbfdf3ab7c14c7c164e
|
bin/gut-cli.js
|
bin/gut-cli.js
|
var gut = require('../');
if (process.argv.length > 2 && process.argv[2] === 'status') {
console.log("\n\tGut status: %s", gut.getStatus());
}
console.log('\nI think you meant "git"');
|
#!/usr/bin/env node
var gut = require('../');
if (process.argv.length > 2 && process.argv[2] === 'status') {
console.log("\n\tGut status: %s", gut.getStatus());
}
console.log('\nI think you meant "git"');
|
Add shabang to bin file
|
Add shabang to bin file
|
JavaScript
|
mit
|
itsananderson/gut-status
|
c025d9457aa000d0f23252e07ce6f2e2c3c5d971
|
releaf-core/app/assets/config/releaf_core_manifest.js
|
releaf-core/app/assets/config/releaf_core_manifest.js
|
//= link_tree ../images
//= link releaf/application.css
//= link releaf/application.js
|
//= link_tree ../images
//= link_tree ../javascripts/ckeditor
//= link releaf/application.css
//= link releaf/application.js
|
Fix releaf ckeditor assets copying
|
Fix releaf ckeditor assets copying
|
JavaScript
|
mit
|
cubesystems/releaf,cubesystems/releaf,cubesystems/releaf
|
7a3062a02c2e676704ecad75def38d322c45a5d0
|
lib/resources/console/scripts/content-editor/plaintext.js
|
lib/resources/console/scripts/content-editor/plaintext.js
|
pw.component.register('content-editor-plaintext', function (view, config) {
var self = this;
var mock = document.createElement('DIV');
mock.classList.add('console-content-plaintext-mock')
mock.style.position = 'absolute';
mock.style.top = '-100px';
mock.style.opacity = '0';
mock.style.width = view.node.clientWidth + 'px';
document.body.appendChild(mock);
view.node.addEventListener('keypress', function (evt) {
var value = this.value + String.fromCharCode(evt.keyCode);
if (evt.keyCode == 13) {
value += '<br>';
}
self.update(value);
});
view.node.addEventListener('keyup', function (evt) {
self.update(this.value);
});
view.node.addEventListener('blur', function () {
pw.component.broadcast('content-editor:changed');
});
this.update = function (value) {
value = value.replace(/\n/g, '<br>');
if (value.trim() == '') {
value = ' ';
}
// add an extra line break to push the content down
if (value.substring(value.length - 4, value.length) == '<br>') {
value += '<br>';
}
mock.innerHTML = value;
view.node.style.height = mock.offsetHeight + 'px';
};
});
|
pw.component.register('content-editor-plaintext', function (view, config) {
var self = this;
var mock = document.createElement('DIV');
mock.classList.add('console-content-plaintext-mock')
mock.style.position = 'absolute';
mock.style.top = '-100px';
mock.style.opacity = '0';
mock.style.width = view.node.clientWidth + 'px';
pw.node.after(view.node, mock);
view.node.addEventListener('keypress', function (evt) {
var value = this.value + String.fromCharCode(evt.keyCode);
if (evt.keyCode == 13) {
value += '<br>';
}
self.update(value);
});
view.node.addEventListener('keyup', function (evt) {
self.update(this.value);
});
view.node.addEventListener('blur', function () {
pw.component.broadcast('content-editor:changed');
});
this.update = function (value) {
value = value.replace(/\n/g, '<br>');
if (value.trim() == '') {
value = ' ';
}
// add an extra line break to push the content down
if (value.substring(value.length - 4, value.length) == '<br>') {
value += '<br>';
}
mock.innerHTML = value;
view.node.style.height = mock.offsetHeight + 'px';
};
});
|
Fix text editor wrapping when floating
|
Fix text editor wrapping when floating
|
JavaScript
|
mit
|
metabahn/console,metabahn/console,metabahn/console
|
a6d0373ea7ca897721d691089567af8e13bab61b
|
mac/filetypes/open_STAK.js
|
mac/filetypes/open_STAK.js
|
define(['itemObjectModel', 'mac/roman'], function(itemOM, macRoman) {
'use strict';
function open(item) {
function onBlock(item, byteSource) {
return byteSource.slice(0, 12).getBytes().then(function(headerBytes) {
var dv = new DataView(headerBytes.buffer, headerBytes.byteOffset, 4);
var length = dv.getUint32(0, false);
var name = macRoman(headerBytes, 4, 4);
var id = dv.getInt32(8, false);
var blockItem = itemOM.createItem(name + " " + id);
item.addItem(blockItem);
if (length > 8) {
blockItem.byteSource = byteSource.slice(12, length);
}
if (byteSource.byteLength >= (length + 12)) {
return onBlock(item, byteSource.slice(length));
}
});
}
return onBlock(item, item.byteSource);
}
return open;
});
|
define(['itemObjectModel', 'mac/roman'], function(itemOM, macRoman) {
'use strict';
function open(item) {
function onBlock(item, byteSource) {
return byteSource.slice(0, 12).getBytes().then(function(headerBytes) {
var dv = new DataView(
headerBytes.buffer, headerBytes.byteOffset, headerBytes.byteLength);
var length = dv.getUint32(0, false);
var name = macRoman(headerBytes, 4, 4);
var id = dv.getInt32(8, false);
var blockItem = itemOM.createItem(name + " " + id);
item.addItem(blockItem);
if (length > 8) {
blockItem.byteSource = byteSource.slice(12, length);
}
if (byteSource.byteLength >= (length + 12)) {
return onBlock(item, byteSource.slice(length));
}
});
}
return onBlock(item, item.byteSource);
}
return open;
});
|
Use right length of header
|
Use right length of header
|
JavaScript
|
mit
|
radishengine/drowsy,radishengine/drowsy
|
93bc928f2f19bba92ce178325f396c863f34c566
|
packages/client/.spinrc.js
|
packages/client/.spinrc.js
|
const url = require('url');
const config = {
builders: {
web: {
entry: './src/index.tsx',
stack: ['web'],
openBrowser: true,
dllExcludes: ['bootstrap'],
defines: {
__CLIENT__: true
},
// Wait for backend to start prior to letting webpack load frontend page
waitOn: ['tcp:localhost:8080'],
enabled: true
},
test: {
stack: ['server'],
roles: ['test'],
defines: {
__TEST__: true
}
}
},
options: {
stack: ['apollo', 'react', 'styled-components', 'css', 'sass', 'less', 'es6', 'ts', 'webpack', 'i18next'],
cache: '../../.cache',
ssr: true,
webpackDll: true,
reactHotLoader: false,
frontendRefreshOnBackendChange: true,
defines: {
__DEV__: process.env.NODE_ENV !== 'production',
__API_URL__: '"/graphql"'
},
webpackConfig: {
devServer: {
disableHostCheck: true
}
}
}
};
config.options.devProxy = config.options.ssr;
if (process.env.NODE_ENV === 'production') {
// Generating source maps for production will slowdown compilation for roughly 25%
config.options.sourceMap = false;
}
const extraDefines = {
__SSR__: config.options.ssr
};
config.options.defines = Object.assign(config.options.defines, extraDefines);
module.exports = config;
|
const url = require('url');
const config = {
builders: {
web: {
entry: './src/index.tsx',
stack: ['web'],
openBrowser: true,
dllExcludes: ['bootstrap'],
defines: {
__CLIENT__: true
},
// Wait for backend to start prior to letting webpack load frontend page
waitOn: ['tcp:localhost:8080'],
enabled: true
},
test: {
stack: ['server'],
roles: ['test'],
defines: {
__TEST__: true
}
}
},
options: {
stack: ['apollo', 'react', 'styled-components', 'css', 'sass', 'less', 'es6', 'ts', 'webpack', 'i18next'],
cache: '../../.cache',
ssr: true,
webpackDll: true,
reactHotLoader: false,
defines: {
__DEV__: process.env.NODE_ENV !== 'production',
__API_URL__: '"/graphql"'
},
webpackConfig: {
devServer: {
disableHostCheck: true
}
}
}
};
config.options.devProxy = config.options.ssr;
if (process.env.NODE_ENV === 'production') {
// Generating source maps for production will slowdown compilation for roughly 25%
config.options.sourceMap = false;
}
const extraDefines = {
__SSR__: config.options.ssr
};
config.options.defines = Object.assign(config.options.defines, extraDefines);
module.exports = config;
|
Remove unused option for client-side bundle
|
Remove unused option for client-side bundle
|
JavaScript
|
mit
|
sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit,sysgears/apollo-universal-starter-kit
|
4f2ba69c7a4c2e5906d949fae1d0fc902c6f12df
|
data/wp/wp-content/plugins/epfl/menus/epfl-menus-admin.js
|
data/wp/wp-content/plugins/epfl/menus/epfl-menus-admin.js
|
// It seems that not much documentation exists for the JQuery
// mini-Web-app that is the Wordpress admin menu editor. However,
// insofar as Polylang's business in that mini-Web-app is similar
// to ours, studying the js/nav-menu.js therefrom is helpful.
function initNavMenus ($) {
var $metabox = $('div.add-external-menu');
$('input.submit-add-to-menu', $metabox).click(function() {
console.log("click");
// For inspiration regarding wpNavMenu, look at wp-admin/js/nav-menu.js
wpNavMenu.addItemToMenu(
{'-1': {
'menu-item-type': 'external-menu',
'menu-item-url': 'https://example.com/restapi/menu?lang=en_JP'
}},
wpNavMenu.addMenuItemToBottom,
function() {
console.log('Added external menu to menu');
});
}); // submit button's .click()
}
function initExternalMenuList ($) {
$('a.page-title-action').remove();
$('h1.wp-heading-inline').after('<button class="page-title-action">' + wp.translations.refresh_button + '</button>');
var $button = $('h1.wp-heading-inline').next();
var spinning = false;
$button.click(function() {
if (spinning) return;
var $form = window.EPFLMenus.asWPAdminPostForm('refresh');
$form.submit();
var $spinner = $('<span class="ajax-spinner"></span>');
$button.append($spinner);
spinning = true;
});
}
jQuery( document ).ready(function($) {
if (window.wp.screen.base === 'nav-menus') {
initNavMenus($);
}
if (window.wp.screen.base === 'edit' && window.wp.screen.post_type === 'epfl-external-menu' ) {
initExternalMenuList($);
}
// If you see this, nothing threw or crashed (yet).
console.log('epfl-menus-admin.js is on duty.');
});
|
function initExternalMenuList ($) {
$('a.page-title-action').remove();
$('h1.wp-heading-inline').after('<button class="page-title-action">' + wp.translations.refresh_button + '</button>');
var $button = $('h1.wp-heading-inline').next();
var spinning = false;
$button.click(function() {
if (spinning) return;
var $form = window.EPFLMenus.asWPAdminPostForm('refresh');
$form.submit();
var $spinner = $('<span class="ajax-spinner"></span>');
$button.append($spinner);
spinning = true;
});
}
jQuery( document ).ready(function($) {
if (window.wp.screen.base === 'edit' && window.wp.screen.post_type === 'epfl-external-menu' ) {
initExternalMenuList($);
}
// If you see this, nothing threw or crashed (yet).
console.log('epfl-menus-admin.js is on duty.');
});
|
Remove dead code in the JS app
|
Remove dead code in the JS app
|
JavaScript
|
mit
|
epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp
|
87eebeaee3d2930e29f8b9aa7e3784f7f519f444
|
jquery.activeNavigation.js
|
jquery.activeNavigation.js
|
(function( $ ) {
$.fn.activeNavigation = function(selector) {
var pathname = window.location.pathname
var hrefs = []
$(selector).find("a").each(function(){
if (pathname.indexOf($(this).attr("href")) > -1)
hrefs.push($(this))
})
if (hrefs.length) {
hrefs.sort(function(a,b){
return b.attr("href").length - a.attr("href").length
})
hrefs[0].closest('li').addClass("active")
}
};
})(jQuery);
|
(function( $ ) {
$.fn.activeNavigation = function(selector) {
var pathname = window.location.pathname
var extension_position;
var href;
var hrefs = []
$(selector).find("a").each(function(){
// Remove href file extension
extension_position = $(this).attr("href").lastIndexOf('.');
href = (extension_position >= 0) ? $(this).attr("href").substr(0, extension_position) : $(this).attr("href");
if (pathname.indexOf(href) > -1) {
hrefs.push($(this));
}
})
if (hrefs.length) {
hrefs.sort(function(a,b){
return b.attr("href").length - a.attr("href").length
})
hrefs[0].closest('li').addClass("active")
}
};
})(jQuery);
|
Remove file extension from href's
|
Remove file extension from href's
|
JavaScript
|
mit
|
Vitaa/ActiveNavigation,Vitaa/ActiveNavigation
|
26d0c3815f5bdcc23b25709167c1bcf96a8d14c2
|
examples/worker-semaphore.js
|
examples/worker-semaphore.js
|
var {Worker} = require("ringo/worker")
var {Semaphore} = require("ringo/concurrent")
var {setInterval, clearInterval} = require("ringo/scheduler");
function main() {
// Create a new workers from this same module. Note that this will
// create a new instance of this module as workers are isolated.
var w = new Worker(module.id);
var s = new Semaphore();
w.onmessage = function(e) {
print("Got response from worker: " + e.data);
s.signal();
};
// Calling worker.postMessage with true as second argument causes
// callbacks from the worker to be executed synchronously in
// the worker's own thread instead of in our own event loop thread,
// allowing us to wait synchronously for replies.
w.postMessage(1, true);
// Wait until the semaphore gets 5 signals.
s.wait(5);
print("Got 5 responses, quitting.");
}
function onmessage(e) {
print("Worker got message: " + e.data);
var count = 1;
// Send 5 responses back to the caller.
var id = setInterval(function() {
e.source.postMessage(count);
if (count++ >= 5) clearInterval(id);
}, 500);
}
if (require.main === module) {
main();
}
|
var {Worker} = require("ringo/worker")
var {Semaphore} = require("ringo/concurrent")
var {setInterval, clearInterval} = require("ringo/scheduler");
function main() {
// Create a new workers from this same module. Note that this will
// create a new instance of this module as workers are isolated.
var w = new Worker(module.id);
var s = new Semaphore();
w.onmessage = function(e) {
print(" Response from worker: " + e.data);
s.signal();
};
// Calling worker.postMessage with true as second argument causes
// callbacks from the worker to be executed synchronously in
// the worker's own thread instead of in our own event loop thread,
// allowing us to wait synchronously for replies.
w.postMessage(1, true);
// Wait until the semaphore gets 3 signals.
s.wait(3);
print("Got 3 responses from worker.");
// Wait for 2 more responses.
s.wait(2);
print("Got 2 more responses, quitting.");
}
function onmessage(e) {
print("Worker got message: " + e.data);
var count = 1;
// Send 5 responses back to the caller.
var id = setInterval(function() {
e.source.postMessage(count);
if (count++ >= 5) clearInterval(id);
}, 500);
}
if (require.main === module) {
main();
}
|
Make single worker semaphore example slightly more interesting
|
Make single worker semaphore example slightly more interesting
|
JavaScript
|
apache-2.0
|
Transcordia/ringojs,ringo/ringojs,ringo/ringojs,oberhamsi/ringojs,Transcordia/ringojs,ringo/ringojs,oberhamsi/ringojs,ashwinrayaprolu1984/ringojs,Transcordia/ringojs,Transcordia/ringojs,oberhamsi/ringojs,ashwinrayaprolu1984/ringojs,ringo/ringojs,ashwinrayaprolu1984/ringojs,ashwinrayaprolu1984/ringojs
|
9bc7cfc00b0a0b96245af835995b39e8493f0a01
|
test_frontend/app/views/teacher/modules/assistance_request_list_module_spec.js
|
test_frontend/app/views/teacher/modules/assistance_request_list_module_spec.js
|
define((require) => {
describe('requester_module', () => {
beforeEach(() => {
require('app/views/teacher/modules/assistance_request_list_module');
});
define('>RetrieveAssistanceRequests', () => {
it('should be defined', () => {
expect(RetrieveAssistanceRequests).toBeDefined();
});
[[], ['a'], ['a', 'b', 'random_course_id_42']].forEach(selectedCourseList => {
it(`should request assistance requests for selected courses (${selectedCourseList})`, () => {
const mock_socket = {
emit: () => undefined
};
const spy_emit = spyOn(mock_socket, 'emit').and.callThrough();
const spy_getSelectedClassIds = jasmine.createSpy('getSelectedClassIds').and.returnValue(selectedCourseList);
selectedClassIds = spy_getSelectedClassIds;
expect(RetrieveAssistanceRequests()).toBeUndefined();
expect(spy_emit.calls.count()).toEqual(1);
expect(spy_emit.calls.argsFor(0)).toEqual([{cids: selectedCourseList, qty: 5}]);
expect(spy_getSelectedClassIds.calls.count()).toEqual(1);
expect(spy_emit.calls.argsFor(0)).toEqual([]);
});
});
});
});
});
|
define((require) => {
describe('requester_module', () => {
beforeEach(() => {
require('app/views/teacher/modules/assistance_request_list_module');
});
describe('>RetrieveAssistanceRequests', () => {
it('should be defined', () => {
expect(RetrieveAssistanceRequests).toBeDefined();
});
[[], ['a'], ['a', 'b', 'random_course_id_42']].forEach(selectedCourseList => {
it(`should request assistance requests for selected courses (${selectedCourseList})`, () => {
const mock_socket = {
emit: () => undefined
};
socket = mock_socket;
const spy_emit = spyOn(mock_socket, 'emit').and.callThrough();
const spy_getSelectedClassIds = jasmine.createSpy('getSelectedClassIds').and.returnValue(selectedCourseList);
getSelectedClassIds = spy_getSelectedClassIds;
expect(RetrieveAssistanceRequests()).toBeUndefined();
expect(spy_emit.calls.count()).toEqual(1);
expect(spy_emit.calls.argsFor(0)).toEqual(['Request_RetrieveAssistanceRequests', {cids: selectedCourseList, qty: 5}]);
expect(spy_getSelectedClassIds.calls.count()).toEqual(1);
expect(spy_getSelectedClassIds.calls.argsFor(0)).toEqual([]);
});
});
});
});
});
|
Fix AR list module test
|
Fix AR list module test
|
JavaScript
|
mit
|
samg2014/VirtualHand,samg2014/VirtualHand
|
1b77aa7ecddf446637e1bfd14bd92d8d588dcb6d
|
app/gui/task_view.js
|
app/gui/task_view.js
|
define([
'underscore',
'backbone'
], function(_, Backbone) {
var TaskView = Backbone.View.extend({
tagName: 'li',
className: 'task',
events: {
"dragstart" : "on_dragstart",
"dragover" : "on_dragover",
"drop" : "on_drop"
},
initialize: function() {
this.id = 'id-' + this.model.get('id');
this.$el.prop('draggable', true);
},
render: function() {
this.$el.html(this.model.get('name'));
return this;
},
on_dragstart: function(event) {
var id = this.model.get('id');
var list_id = this.model.get('list_id');
var payload = [id, list_id].join(':');
event.originalEvent.dataTransfer.setData("text/plain", payload);
},
on_dragover: function(event) {
event.preventDefault();
},
on_drop: function(event) {
event.preventDefault();
},
close: function() {
this.off();
this.remove();
}
});
return TaskView;
});
|
define([
'underscore',
'backbone'
], function(_, Backbone) {
var TaskView = Backbone.View.extend({
tagName: 'li',
className: 'task',
events: {
"dragstart" : "on_dragstart",
"dragover" : "on_dragover",
"drop" : "on_drop",
"click .delete" : "delete"
},
initialize: function() {
this.id = 'id-' + this.model.get('id');
this.$el.prop('draggable', true);
},
render: function() {
this.$el.html(this.model.get('name') + this.delete_link());
return this;
},
delete_link: function() {
return('<a href="#" class="delete">x</a>');
},
on_dragstart: function(event) {
var id = this.model.get('id');
var list_id = this.model.get('list_id');
var payload = [id, list_id].join(':');
event.originalEvent.dataTransfer.setData("text/plain", payload);
},
on_dragover: function(event) {
event.preventDefault();
},
on_drop: function(event) {
event.preventDefault();
},
delete: function(event) {
this.model.destroy();
},
close: function() {
this.off();
this.remove();
}
});
return TaskView;
});
|
Add ability to delete a task
|
Add ability to delete a task
|
JavaScript
|
mit
|
lorenzoplanas/tasks,lorenzoplanas/tasks
|
edede8b53d19f628c566edf52d426b81d69af306
|
client/src/Requests/PanelIssue.js
|
client/src/Requests/PanelIssue.js
|
import React from 'react'
import { Panel } from 'react-bootstrap'
import MarkdownBlock from '../shared/MarkdownBlock'
import { getCreator, getContent } from '../shared/requestUtils'
const Issue = props => {
return (
<Panel
header={`${props.issue.title} by ${getCreator(props.issue).name || getCreator(props.issue).login}`}
eventKey={props.issue.id}>
<MarkdownBlock body={getContent(props.issue)} />
</Panel>
)
}
export default Issue
|
import React from 'react'
import { Panel } from 'react-bootstrap'
import MarkdownBlock from '../shared/MarkdownBlock'
import { getCreator, getContent } from '../shared/requestUtils'
const Issue = props => {
if (!props.issue)
return null
return (
<Panel
header={`${props.issue.title} by ${getCreator(props.issue).name || getCreator(props.issue).login}`}
eventKey={props.issue.id}>
<MarkdownBlock body={getContent(props.issue)} />
</Panel>
)
}
export default Issue
|
Work around react router bug
|
Work around react router bug
<Miss /> sometimes renders even when it should not
|
JavaScript
|
mit
|
clembou/github-requests,clembou/github-requests,clembou/github-requests
|
d2d1d18134787a398511c60dccec4ee89f636edc
|
examples/cherry-pick/app/screens/application/index.js
|
examples/cherry-pick/app/screens/application/index.js
|
import './base.css';
import './application.css';
import 'suitcss-base';
import 'suitcss-utils-text';
import 'suitcss-components-arrange';
import React from 'react';
module.exports = React.createClass({
contextTypes: {
router: React.PropTypes.object.isRequired
},
link: function () {
var router = this.context.router;
return router.generate.apply(router, arguments);
},
getInitialState() {
var time = new Date().getTime();
// setInterval(this.updateTime, 1000);
return { time };
},
updateTime() {
var time = new Date().getTime();
this.setState({time});
},
render: function () {
return (
<div className='Application'>
<div className='Navbar'>
<div className='Navbar-header'>
<a className='Navbar-brand' href={this.link('index')}></a>
</div>
</div>
<div className='Application-content'>
{this.props.children}
</div>
<footer className='Footer'>
<p className='u-textCenter'>Cherrytree Demo. ·
<a href='github.com/QubitProducts/cherrytree'>Cherrytree Repo</a> ·
<a href='github.com/KidkArolis/cherrypick'>Demo Source Code</a>
</p>
</footer>
</div>
);
}
});
|
import './base.css';
import './application.css';
import 'suitcss-base';
import 'suitcss-utils-text';
import 'suitcss-components-arrange';
import React from 'react';
module.exports = React.createClass({
contextTypes: {
router: React.PropTypes.object.isRequired
},
link: function () {
var router = this.context.router;
return router.generate.apply(router, arguments);
},
getInitialState() {
var time = new Date().getTime();
// setInterval(this.updateTime, 1000);
return { time };
},
updateTime() {
var time = new Date().getTime();
this.setState({time});
},
render: function () {
return (
<div className='Application'>
<div className='Navbar'>
<div className='Navbar-header'>
<a className='Navbar-brand' href={this.link('index')}></a>
</div>
</div>
<div className='Application-content'>
{this.props.children}
</div>
<footer className='Footer'>
<p className='u-textCenter'>Cherrytree Demo. ·
<a href='https://github.com/QubitProducts/cherrytree'>Cherrytree Repo</a> ·
<a href='https://github.com/QubitProducts/cherrytree/tree/master/examples/cherry-pick'>Demo Source Code</a>
</p>
</footer>
</div>
);
}
});
|
Fix links in the cherry-pick demo
|
Fix links in the cherry-pick demo
|
JavaScript
|
mit
|
nathanboktae/cherrytree,QubitProducts/cherrytree,QubitProducts/cherrytree,nathanboktae/cherrytree
|
4a68f3869ab9af0c3b51bff223c36d49b58e5df3
|
app/views/wrapper.js
|
app/views/wrapper.js
|
module.exports = function (body) {
return `
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Minor WOT</title>
<link rel="stylesheet" href="/style.css" />
<script src="/app.js" defer></script>
${body}
`;
}
|
module.exports = function (body) {
return `
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Minor WOT</title>
<link rel="stylesheet" href="/style.css" />
<script src="/app.js" defer></script>
<div data-root>
${body}
</div>
`;
}
|
Add data-root div around main body for later use
|
Add data-root div around main body for later use
|
JavaScript
|
mit
|
rijkvanzanten/luaus
|
1f34969f216a7333a27fbd48b97293f3a22d0ec1
|
lib/Object/map-to-array.js
|
lib/Object/map-to-array.js
|
'use strict';
var callable = require('./valid-callable')
, forEach = require('./for-each')
, defaultCb = function (value, key) { return [key, value]; };
module.exports = function (obj, cb/*, thisArg*/) {
var a = [], thisArg = arguments[2];
cb = (cb == null) ? defaultCb : callable(cb);
forEach(obj, function (value, key) {
a.push(cb.call(thisArg, value, key, this));
}, obj, arguments[3]);
return a;
};
|
'use strict';
var callable = require('./valid-callable')
, forEach = require('./for-each')
, call = Function.prototype.call
, defaultCb = function (value, key) { return [key, value]; };
module.exports = function (obj, cb/*, thisArg*/) {
var a = [], thisArg = arguments[2];
cb = (cb == null) ? defaultCb : callable(cb);
forEach(obj, function (value, key) {
a.push(call.call(cb, thisArg, value, key, this));
}, obj, arguments[3]);
return a;
};
|
Support any callable object as callback
|
Support any callable object as callback
|
JavaScript
|
isc
|
medikoo/es5-ext
|
f28118fe786bf4fea5b899ff27e185df532e884d
|
StringManipulation/ConsecutiveString/consecutivestring.js
|
StringManipulation/ConsecutiveString/consecutivestring.js
|
var ConsecutiveString = function(){};
/*validate k and length of the array. If the array length is 0 of less than k of k is less thatn or equal to 0
return an empty string.
if k is 1, then return the longest string.
else, loop through the string, */
ConsecutiveString.prototype.longestConsec = function(starr, k){
var out = "", concat = "";
if((k <= 0 || starr.length == 0) || k > starr.length){
return out;
}
else if(k === 1){
var s = starr.sort(function(b, a){
return a - b;
});
out = s[s.length-1]
}else{
for(var x = 0; x <= k; x++){
var f3 = starr[x] + starr[x+1] + starr[x+2];
var n3 = starr[x+1] + starr[x+2] + starr[x+3];
if(n3.length > f3.length){
starr[x] = null;
}
}
}
return out;
};
module.exports = ConsecutiveString
|
var ConsecutiveString = function(){};
/*validate k and length of the array. If the array length is 0 of less than k of k is less thatn or equal to 0
return an empty string.
if k is 1, then return the longest string.
else, loop through the string, */
ConsecutiveString.prototype.longestConsec = function(starr, k){
var out = "", concat = "";
if((k <= 0 || starr.length == 0) || k > starr.length){
return out;
}
else if(k === 1){
var s = starr.sort(function(b, a){
return a - b;
});
out = s[s.length-1]
}else{
let lens = strarr.map( (_,i,arr) => arr.slice(i,i+k).join('').length ),
i = lens.indexOf( Math.max(...lens) );
out = strarr.slice(i,i+k).join('')
}
}
return out;
};
module.exports = ConsecutiveString
|
Add Consectutive String Description solution
|
Add Consectutive String Description solution
|
JavaScript
|
mit
|
BrianLusina/JS-Snippets
|
a4d85bb42cf25879f154fba5b647778f503984a4
|
docs/client/lib/navigate.js
|
docs/client/lib/navigate.js
|
navigate = function (hash) {
window.location.replace(Meteor.absoluteUrl(null, { secure: true }) + hash);
};
|
navigate = function (hash) {
window.location.replace(Meteor.absoluteUrl() + hash);
};
|
Remove extra option to absoluteUrl
|
Remove extra option to absoluteUrl
force-ssl already sets this option by default
|
JavaScript
|
mit
|
msavin/meteor,daslicht/meteor,dboyliao/meteor,colinligertwood/meteor,chinasb/meteor,yonglehou/meteor,sclausen/meteor,jdivy/meteor,ashwathgovind/meteor,cog-64/meteor,elkingtonmcb/meteor,l0rd0fwar/meteor,meteor-velocity/meteor,brettle/meteor,dfischer/meteor,HugoRLopes/meteor,kencheung/meteor,jdivy/meteor,chiefninew/meteor,sunny-g/meteor,Paulyoufu/meteor-1,AnthonyAstige/meteor,whip112/meteor,msavin/meteor,rozzzly/meteor,sclausen/meteor,luohuazju/meteor,joannekoong/meteor,dandv/meteor,Puena/meteor,yiliaofan/meteor,sitexa/meteor,jagi/meteor,saisai/meteor,4commerce-technologies-AG/meteor,williambr/meteor,GrimDerp/meteor,alexbeletsky/meteor,luohuazju/meteor,katopz/meteor,modulexcite/meteor,mauricionr/meteor,paul-barry-kenzan/meteor,stevenliuit/meteor,fashionsun/meteor,AnjirHossain/meteor,jdivy/meteor,Quicksteve/meteor,AnthonyAstige/meteor,vjau/meteor,yyx990803/meteor,sitexa/meteor,vacjaliu/meteor,cog-64/meteor,jirengu/meteor,baiyunping333/meteor,arunoda/meteor,sdeveloper/meteor,yanisIk/meteor,cog-64/meteor,ljack/meteor,eluck/meteor,jeblister/meteor,neotim/meteor,brdtrpp/meteor,mauricionr/meteor,youprofit/meteor,shadedprofit/meteor,yyx990803/meteor,joannekoong/meteor,AnjirHossain/meteor,lieuwex/meteor,benjamn/meteor,baiyunping333/meteor,katopz/meteor,rabbyalone/meteor,HugoRLopes/meteor,D1no/meteor,lassombra/meteor,pjump/meteor,DAB0mB/meteor,karlito40/meteor,shadedprofit/meteor,williambr/meteor,dboyliao/meteor,Theviajerock/meteor,chinasb/meteor,devgrok/meteor,lassombra/meteor,judsonbsilva/meteor,allanalexandre/meteor,saisai/meteor,justintung/meteor,Puena/meteor,benstoltz/meteor,chiefninew/meteor,Puena/meteor,sitexa/meteor,GrimDerp/meteor,benstoltz/meteor,modulexcite/meteor,aramk/meteor,jrudio/meteor,vjau/meteor,vacjaliu/meteor,benjamn/meteor,ljack/meteor,kengchau/meteor,lorensr/meteor,yalexx/meteor,meteor-velocity/meteor,Eynaliyev/meteor,HugoRLopes/meteor,johnthepink/meteor,alexbeletsky/meteor,ljack/meteor,codedogfish/meteor,stevenliuit/meteor,eluck/meteor,Ken-Liu/meteor,williambr/meteor,karlito40/meteor,henrypan/meteor,IveWong/meteor,queso/meteor,yinhe007/meteor,deanius/meteor,vacjaliu/meteor,HugoRLopes/meteor,zdd910/meteor,DCKT/meteor,benjamn/meteor,4commerce-technologies-AG/meteor,brdtrpp/meteor,newswim/meteor,framewr/meteor,lieuwex/meteor,lieuwex/meteor,udhayam/meteor,akintoey/meteor,rozzzly/meteor,ashwathgovind/meteor,judsonbsilva/meteor,mubassirhayat/meteor,TechplexEngineer/meteor,D1no/meteor,zdd910/meteor,ndarilek/meteor,evilemon/meteor,nuvipannu/meteor,youprofit/meteor,Hansoft/meteor,wmkcc/meteor,pandeysoni/meteor,chasertech/meteor,shrop/meteor,allanalexandre/meteor,namho102/meteor,DCKT/meteor,colinligertwood/meteor,imanmafi/meteor,jenalgit/meteor,PatrickMcGuinness/meteor,brdtrpp/meteor,chinasb/meteor,Jeremy017/meteor,DCKT/meteor,tdamsma/meteor,alphanso/meteor,lpinto93/meteor,devgrok/meteor,mubassirhayat/meteor,GrimDerp/meteor,modulexcite/meteor,TribeMedia/meteor,GrimDerp/meteor,planet-training/meteor,vacjaliu/meteor,allanalexandre/meteor,elkingtonmcb/meteor,Prithvi-A/meteor,kencheung/meteor,eluck/meteor,brdtrpp/meteor,mirstan/meteor,newswim/meteor,kengchau/meteor,katopz/meteor,benstoltz/meteor,Ken-Liu/meteor,deanius/meteor,tdamsma/meteor,colinligertwood/meteor,dfischer/meteor,brettle/meteor,bhargav175/meteor,skarekrow/meteor,jg3526/meteor,IveWong/meteor,skarekrow/meteor,shmiko/meteor,zdd910/meteor,joannekoong/meteor,LWHTarena/meteor,namho102/meteor,tdamsma/meteor,guazipi/meteor,Jonekee/meteor,guazipi/meteor,paul-barry-kenzan/meteor,michielvanoeffelen/meteor,dboyliao/meteor,cbonami/meteor,deanius/meteor,ericterpstra/meteor,hristaki/meteor,AlexR1712/meteor,meonkeys/meteor,jenalgit/meteor,jg3526/meteor,henrypan/meteor,benstoltz/meteor,emmerge/meteor,oceanzou123/meteor,Eynaliyev/meteor,sdeveloper/meteor,devgrok/meteor,akintoey/meteor,esteedqueen/meteor,meonkeys/meteor,Theviajerock/meteor,lorensr/meteor,somallg/meteor,elkingtonmcb/meteor,pjump/meteor,vjau/meteor,TechplexEngineer/meteor,yalexx/meteor,justintung/meteor,neotim/meteor,juansgaitan/meteor,Puena/meteor,neotim/meteor,Hansoft/meteor,mauricionr/meteor,HugoRLopes/meteor,D1no/meteor,DAB0mB/meteor,chengxiaole/meteor,IveWong/meteor,deanius/meteor,D1no/meteor,jenalgit/meteor,paul-barry-kenzan/meteor,DCKT/meteor,dfischer/meteor,newswim/meteor,Profab/meteor,Urigo/meteor,sunny-g/meteor,lieuwex/meteor,yalexx/meteor,qscripter/meteor,ericterpstra/meteor,johnthepink/meteor,guazipi/meteor,planet-training/meteor,allanalexandre/meteor,h200863057/meteor,modulexcite/meteor,lorensr/meteor,johnthepink/meteor,calvintychan/meteor,Ken-Liu/meteor,michielvanoeffelen/meteor,neotim/meteor,ndarilek/meteor,cog-64/meteor,daltonrenaldo/meteor,codingang/meteor,benjamn/meteor,Jonekee/meteor,shrop/meteor,baiyunping333/meteor,chasertech/meteor,mirstan/meteor,chinasb/meteor,chinasb/meteor,udhayam/meteor,cherbst/meteor,JesseQin/meteor,AnthonyAstige/meteor,AnjirHossain/meteor,alexbeletsky/meteor,Profab/meteor,evilemon/meteor,justintung/meteor,AlexR1712/meteor,AlexR1712/meteor,SeanOceanHu/meteor,deanius/meteor,mjmasn/meteor,PatrickMcGuinness/meteor,AlexR1712/meteor,newswim/meteor,aramk/meteor,iman-mafi/meteor,arunoda/meteor,jeblister/meteor,hristaki/meteor,dev-bobsong/meteor,arunoda/meteor,yiliaofan/meteor,steedos/meteor,yiliaofan/meteor,AnthonyAstige/meteor,pandeysoni/meteor,oceanzou123/meteor,aldeed/meteor,daltonrenaldo/meteor,chmac/meteor,chasertech/meteor,h200863057/meteor,PatrickMcGuinness/meteor,evilemon/meteor,baysao/meteor,ljack/meteor,alexbeletsky/meteor,qscripter/meteor,benjamn/meteor,mirstan/meteor,lassombra/meteor,Ken-Liu/meteor,rabbyalone/meteor,daslicht/meteor,DAB0mB/meteor,yonas/meteor-freebsd,whip112/meteor,kidaa/meteor,bhargav175/meteor,whip112/meteor,h200863057/meteor,planet-training/meteor,sunny-g/meteor,bhargav175/meteor,lawrenceAIO/meteor,rabbyalone/meteor,yanisIk/meteor,yonglehou/meteor,jagi/meteor,jeblister/meteor,akintoey/meteor,shmiko/meteor,colinligertwood/meteor,juansgaitan/meteor,karlito40/meteor,justintung/meteor,saisai/meteor,yonglehou/meteor,Theviajerock/meteor,udhayam/meteor,pjump/meteor,imanmafi/meteor,Paulyoufu/meteor-1,karlito40/meteor,dboyliao/meteor,shrop/meteor,kengchau/meteor,youprofit/meteor,JesseQin/meteor,Hansoft/meteor,aldeed/meteor,yonas/meteor-freebsd,nuvipannu/meteor,shrop/meteor,mirstan/meteor,cbonami/meteor,brettle/meteor,jdivy/meteor,jeblister/meteor,Eynaliyev/meteor,meteor-velocity/meteor,LWHTarena/meteor,Jeremy017/meteor,Jonekee/meteor,somallg/meteor,lpinto93/meteor,DCKT/meteor,namho102/meteor,emmerge/meteor,henrypan/meteor,paul-barry-kenzan/meteor,williambr/meteor,TribeMedia/meteor,lpinto93/meteor,sclausen/meteor,AnjirHossain/meteor,shadedprofit/meteor,jirengu/meteor,Hansoft/meteor,imanmafi/meteor,stevenliuit/meteor,yalexx/meteor,Urigo/meteor,kidaa/meteor,somallg/meteor,judsonbsilva/meteor,esteedqueen/meteor,lawrenceAIO/meteor,henrypan/meteor,Prithvi-A/meteor,akintoey/meteor,jrudio/meteor,cog-64/meteor,steedos/meteor,hristaki/meteor,baiyunping333/meteor,ashwathgovind/meteor,akintoey/meteor,pjump/meteor,bhargav175/meteor,iman-mafi/meteor,TechplexEngineer/meteor,cbonami/meteor,queso/meteor,zdd910/meteor,luohuazju/meteor,yanisIk/meteor,yinhe007/meteor,imanmafi/meteor,henrypan/meteor,shrop/meteor,vjau/meteor,jirengu/meteor,aldeed/meteor,brdtrpp/meteor,msavin/meteor,shmiko/meteor,imanmafi/meteor,msavin/meteor,IveWong/meteor,queso/meteor,framewr/meteor,chasertech/meteor,aramk/meteor,dev-bobsong/meteor,lawrenceAIO/meteor,wmkcc/meteor,cherbst/meteor,Puena/meteor,udhayam/meteor,brdtrpp/meteor,chiefninew/meteor,SeanOceanHu/meteor,IveWong/meteor,arunoda/meteor,sclausen/meteor,allanalexandre/meteor,aldeed/meteor,brettle/meteor,jenalgit/meteor,AnthonyAstige/meteor,esteedqueen/meteor,Theviajerock/meteor,4commerce-technologies-AG/meteor,iman-mafi/meteor,ashwathgovind/meteor,dboyliao/meteor,ericterpstra/meteor,dfischer/meteor,kidaa/meteor,oceanzou123/meteor,mauricionr/meteor,sunny-g/meteor,bhargav175/meteor,queso/meteor,luohuazju/meteor,neotim/meteor,emmerge/meteor,fashionsun/meteor,brettle/meteor,hristaki/meteor,yanisIk/meteor,eluck/meteor,akintoey/meteor,youprofit/meteor,jrudio/meteor,guazipi/meteor,joannekoong/meteor,daslicht/meteor,meteor-velocity/meteor,shadedprofit/meteor,planet-training/meteor,cherbst/meteor,arunoda/meteor,arunoda/meteor,Ken-Liu/meteor,tdamsma/meteor,williambr/meteor,alphanso/meteor,michielvanoeffelen/meteor,udhayam/meteor,lieuwex/meteor,yyx990803/meteor,Profab/meteor,LWHTarena/meteor,chmac/meteor,somallg/meteor,bhargav175/meteor,AnthonyAstige/meteor,alphanso/meteor,mjmasn/meteor,l0rd0fwar/meteor,baiyunping333/meteor,TribeMedia/meteor,brettle/meteor,rabbyalone/meteor,skarekrow/meteor,yinhe007/meteor,sunny-g/meteor,EduShareOntario/meteor,JesseQin/meteor,chinasb/meteor,jeblister/meteor,papimomi/meteor,juansgaitan/meteor,yiliaofan/meteor,youprofit/meteor,emmerge/meteor,Jeremy017/meteor,servel333/meteor,steedos/meteor,pjump/meteor,jeblister/meteor,wmkcc/meteor,iman-mafi/meteor,devgrok/meteor,ashwathgovind/meteor,mjmasn/meteor,cog-64/meteor,papimomi/meteor,codedogfish/meteor,meonkeys/meteor,lorensr/meteor,Prithvi-A/meteor,yiliaofan/meteor,katopz/meteor,codedogfish/meteor,l0rd0fwar/meteor,HugoRLopes/meteor,DCKT/meteor,benjamn/meteor,LWHTarena/meteor,msavin/meteor,mirstan/meteor,codingang/meteor,jagi/meteor,lorensr/meteor,Jonekee/meteor,steedos/meteor,PatrickMcGuinness/meteor,iman-mafi/meteor,iman-mafi/meteor,evilemon/meteor,esteedqueen/meteor,johnthepink/meteor,nuvipannu/meteor,henrypan/meteor,Eynaliyev/meteor,joannekoong/meteor,yanisIk/meteor,paul-barry-kenzan/meteor,jagi/meteor,yalexx/meteor,sdeveloper/meteor,oceanzou123/meteor,fashionsun/meteor,chengxiaole/meteor,servel333/meteor,justintung/meteor,mubassirhayat/meteor,mjmasn/meteor,Quicksteve/meteor,udhayam/meteor,iman-mafi/meteor,katopz/meteor,yanisIk/meteor,allanalexandre/meteor,hristaki/meteor,guazipi/meteor,Paulyoufu/meteor-1,servel333/meteor,alphanso/meteor,vacjaliu/meteor,colinligertwood/meteor,Profab/meteor,rabbyalone/meteor,neotim/meteor,Ken-Liu/meteor,cherbst/meteor,chengxiaole/meteor,l0rd0fwar/meteor,justintung/meteor,karlito40/meteor,yanisIk/meteor,yalexx/meteor,LWHTarena/meteor,codedogfish/meteor,lieuwex/meteor,TechplexEngineer/meteor,williambr/meteor,rabbyalone/meteor,Puena/meteor,elkingtonmcb/meteor,sclausen/meteor,youprofit/meteor,lpinto93/meteor,ericterpstra/meteor,meonkeys/meteor,rozzzly/meteor,kengchau/meteor,mubassirhayat/meteor,chinasb/meteor,D1no/meteor,JesseQin/meteor,namho102/meteor,neotim/meteor,jeblister/meteor,zdd910/meteor,dev-bobsong/meteor,wmkcc/meteor,EduShareOntario/meteor,AnjirHossain/meteor,nuvipannu/meteor,chmac/meteor,AlexR1712/meteor,brdtrpp/meteor,codingang/meteor,sclausen/meteor,4commerce-technologies-AG/meteor,meteor-velocity/meteor,Theviajerock/meteor,sunny-g/meteor,servel333/meteor,calvintychan/meteor,youprofit/meteor,IveWong/meteor,sdeveloper/meteor,Eynaliyev/meteor,AlexR1712/meteor,dfischer/meteor,yanisIk/meteor,bhargav175/meteor,emmerge/meteor,ljack/meteor,steedos/meteor,Jonekee/meteor,HugoRLopes/meteor,kengchau/meteor,Profab/meteor,h200863057/meteor,EduShareOntario/meteor,qscripter/meteor,chengxiaole/meteor,wmkcc/meteor,LWHTarena/meteor,h200863057/meteor,DAB0mB/meteor,kidaa/meteor,jrudio/meteor,stevenliuit/meteor,shadedprofit/meteor,baysao/meteor,skarekrow/meteor,daltonrenaldo/meteor,hristaki/meteor,baysao/meteor,lawrenceAIO/meteor,framewr/meteor,jirengu/meteor,zdd910/meteor,mjmasn/meteor,mauricionr/meteor,servel333/meteor,somallg/meteor,dfischer/meteor,ndarilek/meteor,paul-barry-kenzan/meteor,ericterpstra/meteor,ndarilek/meteor,IveWong/meteor,luohuazju/meteor,whip112/meteor,deanius/meteor,shmiko/meteor,emmerge/meteor,alexbeletsky/meteor,baysao/meteor,somallg/meteor,imanmafi/meteor,yinhe007/meteor,dandv/meteor,devgrok/meteor,queso/meteor,eluck/meteor,judsonbsilva/meteor,Jonekee/meteor,codingang/meteor,akintoey/meteor,sitexa/meteor,dandv/meteor,cbonami/meteor,chmac/meteor,TechplexEngineer/meteor,kencheung/meteor,kidaa/meteor,newswim/meteor,jg3526/meteor,imanmafi/meteor,hristaki/meteor,tdamsma/meteor,lassombra/meteor,TribeMedia/meteor,yonglehou/meteor,juansgaitan/meteor,katopz/meteor,DAB0mB/meteor,arunoda/meteor,yinhe007/meteor,vjau/meteor,chiefninew/meteor,aramk/meteor,shmiko/meteor,TribeMedia/meteor,skarekrow/meteor,Paulyoufu/meteor-1,jagi/meteor,colinligertwood/meteor,jagi/meteor,jdivy/meteor,framewr/meteor,mauricionr/meteor,lpinto93/meteor,qscripter/meteor,jenalgit/meteor,calvintychan/meteor,shrop/meteor,yinhe007/meteor,kidaa/meteor,sitexa/meteor,GrimDerp/meteor,Urigo/meteor,jirengu/meteor,vjau/meteor,pandeysoni/meteor,alexbeletsky/meteor,williambr/meteor,guazipi/meteor,AnjirHossain/meteor,ljack/meteor,daltonrenaldo/meteor,dboyliao/meteor,lawrenceAIO/meteor,Prithvi-A/meteor,papimomi/meteor,Hansoft/meteor,fashionsun/meteor,chasertech/meteor,yyx990803/meteor,katopz/meteor,karlito40/meteor,Quicksteve/meteor,dfischer/meteor,kidaa/meteor,planet-training/meteor,papimomi/meteor,lawrenceAIO/meteor,newswim/meteor,yonas/meteor-freebsd,AnjirHossain/meteor,Ken-Liu/meteor,PatrickMcGuinness/meteor,saisai/meteor,dev-bobsong/meteor,yonas/meteor-freebsd,karlito40/meteor,Profab/meteor,Prithvi-A/meteor,planet-training/meteor,udhayam/meteor,dandv/meteor,juansgaitan/meteor,vacjaliu/meteor,daltonrenaldo/meteor,daslicht/meteor,DAB0mB/meteor,yonas/meteor-freebsd,michielvanoeffelen/meteor,framewr/meteor,brettle/meteor,skarekrow/meteor,codedogfish/meteor,Paulyoufu/meteor-1,JesseQin/meteor,cbonami/meteor,daslicht/meteor,EduShareOntario/meteor,lorensr/meteor,queso/meteor,saisai/meteor,shmiko/meteor,baysao/meteor,luohuazju/meteor,steedos/meteor,AnthonyAstige/meteor,namho102/meteor,oceanzou123/meteor,mubassirhayat/meteor,modulexcite/meteor,aldeed/meteor,sclausen/meteor,benstoltz/meteor,tdamsma/meteor,pjump/meteor,dboyliao/meteor,SeanOceanHu/meteor,msavin/meteor,stevenliuit/meteor,Eynaliyev/meteor,joannekoong/meteor,Theviajerock/meteor,ndarilek/meteor,fashionsun/meteor,alphanso/meteor,pandeysoni/meteor,mubassirhayat/meteor,johnthepink/meteor,yyx990803/meteor,nuvipannu/meteor,papimomi/meteor,yonglehou/meteor,mauricionr/meteor,kencheung/meteor,somallg/meteor,dev-bobsong/meteor,yyx990803/meteor,GrimDerp/meteor,alexbeletsky/meteor,judsonbsilva/meteor,daslicht/meteor,planet-training/meteor,mirstan/meteor,benstoltz/meteor,dev-bobsong/meteor,l0rd0fwar/meteor,framewr/meteor,PatrickMcGuinness/meteor,kengchau/meteor,emmerge/meteor,eluck/meteor,saisai/meteor,jg3526/meteor,johnthepink/meteor,meonkeys/meteor,baiyunping333/meteor,whip112/meteor,evilemon/meteor,shmiko/meteor,4commerce-technologies-AG/meteor,rozzzly/meteor,chmac/meteor,dandv/meteor,daltonrenaldo/meteor,aramk/meteor,lieuwex/meteor,ndarilek/meteor,SeanOceanHu/meteor,Hansoft/meteor,calvintychan/meteor,mirstan/meteor,oceanzou123/meteor,benstoltz/meteor,TechplexEngineer/meteor,brdtrpp/meteor,codingang/meteor,jirengu/meteor,jg3526/meteor,jg3526/meteor,eluck/meteor,pjump/meteor,DCKT/meteor,chasertech/meteor,Theviajerock/meteor,msavin/meteor,yinhe007/meteor,AnthonyAstige/meteor,EduShareOntario/meteor,lassombra/meteor,papimomi/meteor,chiefninew/meteor,yyx990803/meteor,allanalexandre/meteor,Urigo/meteor,alphanso/meteor,jrudio/meteor,yalexx/meteor,stevenliuit/meteor,pandeysoni/meteor,D1no/meteor,codedogfish/meteor,servel333/meteor,lpinto93/meteor,namho102/meteor,elkingtonmcb/meteor,cbonami/meteor,Urigo/meteor,sunny-g/meteor,jrudio/meteor,queso/meteor,judsonbsilva/meteor,cherbst/meteor,steedos/meteor,papimomi/meteor,EduShareOntario/meteor,SeanOceanHu/meteor,daltonrenaldo/meteor,judsonbsilva/meteor,calvintychan/meteor,jdivy/meteor,chmac/meteor,wmkcc/meteor,kencheung/meteor,qscripter/meteor,namho102/meteor,yonas/meteor-freebsd,4commerce-technologies-AG/meteor,yiliaofan/meteor,D1no/meteor,h200863057/meteor,Quicksteve/meteor,l0rd0fwar/meteor,aldeed/meteor,Puena/meteor,lpinto93/meteor,chasertech/meteor,HugoRLopes/meteor,Prithvi-A/meteor,kengchau/meteor,Jonekee/meteor,justintung/meteor,GrimDerp/meteor,daslicht/meteor,cog-64/meteor,Jeremy017/meteor,rozzzly/meteor,skarekrow/meteor,dandv/meteor,D1no/meteor,whip112/meteor,meonkeys/meteor,Eynaliyev/meteor,chengxiaole/meteor,Prithvi-A/meteor,elkingtonmcb/meteor,aldeed/meteor,mjmasn/meteor,ljack/meteor,4commerce-technologies-AG/meteor,TribeMedia/meteor,alexbeletsky/meteor,kencheung/meteor,servel333/meteor,michielvanoeffelen/meteor,h200863057/meteor,saisai/meteor,johnthepink/meteor,pandeysoni/meteor,whip112/meteor,sitexa/meteor,aleclarson/meteor,jenalgit/meteor,shrop/meteor,Quicksteve/meteor,codedogfish/meteor,TechplexEngineer/meteor,dboyliao/meteor,SeanOceanHu/meteor,Urigo/meteor,codingang/meteor,ashwathgovind/meteor,AlexR1712/meteor,LWHTarena/meteor,Paulyoufu/meteor-1,Jeremy017/meteor,Quicksteve/meteor,baysao/meteor,jdivy/meteor,newswim/meteor,shadedprofit/meteor,meonkeys/meteor,daltonrenaldo/meteor,lassombra/meteor,servel333/meteor,aramk/meteor,jg3526/meteor,michielvanoeffelen/meteor,devgrok/meteor,stevenliuit/meteor,sunny-g/meteor,vjau/meteor,ashwathgovind/meteor,yiliaofan/meteor,jenalgit/meteor,fashionsun/meteor,luohuazju/meteor,mjmasn/meteor,juansgaitan/meteor,aleclarson/meteor,framewr/meteor,zdd910/meteor,sdeveloper/meteor,EduShareOntario/meteor,qscripter/meteor,chiefninew/meteor,PatrickMcGuinness/meteor,shadedprofit/meteor,codingang/meteor,dandv/meteor,JesseQin/meteor,meteor-velocity/meteor,vacjaliu/meteor,modulexcite/meteor,lorensr/meteor,evilemon/meteor,Jeremy017/meteor,esteedqueen/meteor,calvintychan/meteor,pandeysoni/meteor,l0rd0fwar/meteor,esteedqueen/meteor,fashionsun/meteor,cbonami/meteor,cherbst/meteor,yonglehou/meteor,paul-barry-kenzan/meteor,SeanOceanHu/meteor,chiefninew/meteor,somallg/meteor,Urigo/meteor,rozzzly/meteor,kencheung/meteor,elkingtonmcb/meteor,colinligertwood/meteor,esteedqueen/meteor,TribeMedia/meteor,JesseQin/meteor,dev-bobsong/meteor,ericterpstra/meteor,jirengu/meteor,sdeveloper/meteor,Quicksteve/meteor,rabbyalone/meteor,Profab/meteor,yonas/meteor-freebsd,DAB0mB/meteor,devgrok/meteor,Hansoft/meteor,yonglehou/meteor,guazipi/meteor,ndarilek/meteor,meteor-velocity/meteor,chengxiaole/meteor,juansgaitan/meteor,baiyunping333/meteor,evilemon/meteor,lassombra/meteor,tdamsma/meteor,ndarilek/meteor,henrypan/meteor,nuvipannu/meteor,cherbst/meteor,benjamn/meteor,ericterpstra/meteor,alphanso/meteor,SeanOceanHu/meteor,qscripter/meteor,sdeveloper/meteor,aleclarson/meteor,modulexcite/meteor,chengxiaole/meteor,jagi/meteor,chmac/meteor,sitexa/meteor,chiefninew/meteor,lawrenceAIO/meteor,wmkcc/meteor,deanius/meteor,tdamsma/meteor,ljack/meteor,oceanzou123/meteor,nuvipannu/meteor,mubassirhayat/meteor,planet-training/meteor,eluck/meteor,Jeremy017/meteor,karlito40/meteor,calvintychan/meteor,Eynaliyev/meteor,aramk/meteor,baysao/meteor,rozzzly/meteor,michielvanoeffelen/meteor,joannekoong/meteor,allanalexandre/meteor,Paulyoufu/meteor-1,mubassirhayat/meteor
|
fe0d1ba2d55121a69791896e0f9fec3aa70f7c3c
|
public/javascript/fonts.js
|
public/javascript/fonts.js
|
WebFontConfig = {
custom: { families: ['Alternate Gothic No.3', 'Clarendon FS Medium', 'Proxima Nova Light', 'Proxima Nova Semibold', 'Stub Serif FS', 'Stub Serif FS'],
urls: [ 'http://f.fontdeck.com/s/css/tEGvGvL6JlBfPjTgf2p9URd+sJ0/' + window.location.hostname + '/5502.css' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = '/javascript/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
|
WebFontConfig = {
custom: { families: ['Alternate Gothic No.3', 'Clarendon FS Medium', 'Proxima Nova Light', 'Proxima Nova Semibold', 'Stub Serif FS', 'Stub Serif FS', 'Reminder Pro Bold'],
urls: [ 'http://f.fontdeck.com/s/css/tEGvGvL6JlBfPjTgf2p9URd+sJ0/' + window.location.hostname + '/5502.css' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = '/javascript/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
|
Add new font to JS
|
Add new font to JS
|
JavaScript
|
mit
|
robinwhittleton/static,kalleth/static,tadast/static,robinwhittleton/static,robinwhittleton/static,kalleth/static,robinwhittleton/static,alphagov/static,tadast/static,alphagov/static,alphagov/static,kalleth/static,kalleth/static,tadast/static,tadast/static
|
040681cfa5be9a0b095fab6f8f3c84c833245c94
|
addon/components/one-way-input.js
|
addon/components/one-way-input.js
|
import Ember from 'ember';
const {
Component,
get
} = Ember;
export default Component.extend({
tagName: 'input',
type: 'text',
attributeBindings: [
'accept',
'autocomplete',
'autosave',
'dir',
'formaction',
'formenctype',
'formmethod',
'formnovalidate',
'formtarget',
'height',
'inputmode',
'lang',
'list',
'max',
'min',
'multiple',
'name',
'pattern',
'size',
'step',
'type',
'value',
'width'
],
_sanitizedValue: undefined,
input() { this._handleChangeEvent(); },
change() { this._handleChangeEvent(); },
_handleChangeEvent() {
this._processNewValue.call(this, this.readDOMAttr('value'));
},
_processNewValue(rawValue) {
const value = this.sanitizeInput(rawValue);
if (this._sanitizedValue !== value) {
this._sanitizedValue = value;
this.attrs.update(value);
}
},
sanitizeInput(input) {
return input;
},
didReceiveAttrs() {
this._super(...arguments);
if (!this.attrs.update) {
throw new Error(`You must provide an \`update\` action to \`{{${this.templateName}}}\`.`);
}
this._processNewValue.call(this, get(this, 'value'));
}
});
|
import Ember from 'ember';
const {
Component,
get
} = Ember;
export default Component.extend({
tagName: 'input',
type: 'text',
attributeBindings: [
'accept',
'autocomplete',
'autosave',
'dir',
'formaction',
'formenctype',
'formmethod',
'formnovalidate',
'formtarget',
'height',
'inputmode',
'lang',
'list',
'max',
'min',
'multiple',
'name',
'pattern',
'placeholder',
'size',
'step',
'type',
'value',
'width'
],
_sanitizedValue: undefined,
input() { this._handleChangeEvent(); },
change() { this._handleChangeEvent(); },
_handleChangeEvent() {
this._processNewValue.call(this, this.readDOMAttr('value'));
},
_processNewValue(rawValue) {
const value = this.sanitizeInput(rawValue);
if (this._sanitizedValue !== value) {
this._sanitizedValue = value;
this.attrs.update(value);
}
},
sanitizeInput(input) {
return input;
},
didReceiveAttrs() {
this._super(...arguments);
if (!this.attrs.update) {
throw new Error(`You must provide an \`update\` action to \`{{${this.templateName}}}\`.`);
}
this._processNewValue.call(this, get(this, 'value'));
}
});
|
Add placeholder to attribute bindings
|
Add placeholder to attribute bindings
|
JavaScript
|
mit
|
AdStage/ember-one-way-controls,dockyard/ember-one-way-input,dockyard/ember-one-way-controls,dockyard/ember-one-way-input,AdStage/ember-one-way-controls,dockyard/ember-one-way-controls
|
ff86c57864c82a30f9af6bea2b29b8b2ae68defd
|
server/routes/heroku.js
|
server/routes/heroku.js
|
var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(err, res, body) {
console.log(body);
res.sendStatus(200).end();
});
});
module.exports = router;
|
var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(error, response, body) {
console.log(body); // {"status":{"Production":"green","Development":"green"},"issues":[]}
res.sendStatus(200).end();
});
});
module.exports = router;
|
Rename res to not overwrite express res.
|
Rename res to not overwrite express res.
|
JavaScript
|
mit
|
jontewks/bc-slack-alerts
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.