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
|
|---|---|---|---|---|---|---|---|---|---|
ec343008e4db8688acfb383a3b254a86ecfeac29
|
shared/reducers/favorite.js
|
shared/reducers/favorite.js
|
/* @flow */
import * as Constants from '../constants/favorite'
import {logoutDone} from '../constants/login'
import type {FavoriteAction} from '../constants/favorite'
import type {Folder} from '../constants/types/flow-types'
type State = {
folders: ?Array<Folder>
}
const initialState = {
folders: null
}
export default function (state: State = initialState, action: FavoriteAction): State {
switch (action.type) {
case Constants.favoriteList:
return {
...state,
folders: action.payload && action.payload.folders
}
case logoutDone: {
return {
...state,
folders: null
}
}
default:
return state
}
}
|
/* @flow */
import * as Constants from '../constants/favorite'
import {logoutDone} from '../constants/login'
import type {FavoriteAction} from '../constants/favorite'
import type {Folder} from '../constants/types/flow-types'
type State = {
folders: ?Array<Folder>
}
const initialState = {
folders: null
}
export default function (state: State = initialState, action: FavoriteAction): State {
switch (action.type) {
case Constants.favoriteList:
return {
...state,
folders: action.payload && action.payload.folders
}
case logoutDone: {
return {
...initialState
}
}
default:
return state
}
}
|
Use initial state instead of setting folder manually
|
Use initial state instead of setting folder manually
|
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
|
42be88e329535f7777e0c33da7194d21bf81c6b4
|
gulp/tasks/html.js
|
gulp/tasks/html.js
|
var gulp = require ('gulp');
gulp.task ( 'html', ['css'], function() {
gulp.src('src/main/resources/html/**')
.pipe ( gulp.dest( './build/') );
gulp.src('src/test/resources/**')
.pipe ( gulp.dest('./build/data/'));
gulp.src(['node_modules/dat-gui/vendor/dat*.js'])
.pipe ( gulp.dest('./build/js/'));
// "Vendor" packages
// Bootstrap
gulp.src(['node_modules/bootstrap/dist/**'])
.pipe ( gulp.dest('./build'));
// Font Awesome
gulp.src(['node_modules/font-awesome/fonts/**'])
.pipe( gulp.dest('./build/fonts'));
gulp.src(['node_modules/font-awesome/css/**'])
.pipe( gulp.dest('./build/css'));
// JQuery
gulp.src(['node_modules/jquery/dist/**'])
.pipe( gulp.dest('./build/js'));
// Dropzone file upload
gulp.src(['node_modules/dropzone/downloads/*js'])
.pipe(gulp.dest('./build/js'));
gulp.src(['node_modules/dropzone/downloads/css/**'])
.pipe(gulp.dest('./build/css'));
gulp.src(['node_modules/dropzone/downloads/images/**'])
.pipe(gulp.dest('./build/images'));
});
|
var gulp = require ('gulp');
gulp.task ( 'html', ['css'], function() {
gulp.src('src/main/resources/html/**')
.pipe ( gulp.dest( './build/') );
gulp.src('src/main/resources/js/**')
.pipe ( gulp.dest( './build/js/') );
gulp.src('src/main/resources/images/**')
.pipe ( gulp.dest( './build/images/') );
gulp.src('src/test/resources/**')
.pipe ( gulp.dest('./build/data/'));
gulp.src(['node_modules/dat-gui/vendor/dat*.js'])
.pipe ( gulp.dest('./build/js/'));
// XTK Local build (if available)
// should copy for production
gulp.src(['../X/utils/xtk.js'])
.pipe ( gulp.dest('./build/js'));
// "Vendor" packages
// Bootstrap
gulp.src(['node_modules/bootstrap/dist/**'])
.pipe ( gulp.dest('./build'));
// Font Awesome
gulp.src(['node_modules/font-awesome/fonts/**'])
.pipe( gulp.dest('./build/fonts'));
gulp.src(['node_modules/font-awesome/css/**'])
.pipe( gulp.dest('./build/css'));
// JQuery
gulp.src(['node_modules/jquery/dist/**'])
.pipe( gulp.dest('./build/js'));
// Dropzone file upload
gulp.src(['node_modules/dropzone/downloads/*js'])
.pipe(gulp.dest('./build/js'));
gulp.src(['node_modules/dropzone/downloads/css/**'])
.pipe(gulp.dest('./build/css'));
gulp.src(['node_modules/dropzone/downloads/images/**'])
.pipe(gulp.dest('./build/images'));
});
|
Include JS and XTK in build
|
Include JS and XTK in build
|
JavaScript
|
bsd-3-clause
|
dblezek/webapp-skeleton,dblezek/webapp-skeleton
|
06a9a7400aedc0985657874c3aba35af6ab6b1fb
|
app/components/Settings/components/colors-panel.js
|
app/components/Settings/components/colors-panel.js
|
import React from 'react';
import PropTypes from 'prop-types';
import { Switch } from '@blueprintjs/core';
import { Themes } from '../../../containers/enums';
const ColorsPanel = ({ theme, setTheme }) =>
<div className="mt-1">
<h3 className="mb-3">Themes</h3>
<Switch
label="Dark Theme"
checked={theme === Themes.DARK}
onChange={() =>
setTheme(theme === Themes.DARK ? Themes.LIGHT : Themes.DARK)}
className="pt-large w-fit-content"
/>
</div>;
ColorsPanel.propTypes = {
theme: PropTypes.string.isRequired,
setTheme: PropTypes.func.isRequired
};
export default ColorsPanel;
|
import React from 'react';
import PropTypes from 'prop-types';
import { RadioGroup, Radio } from '@blueprintjs/core';
import { Themes } from '../../../containers/enums';
const ColorsPanel = ({ theme, setTheme }) =>
<div className="mt-1">
<RadioGroup
label="Themes"
selectedValue={theme}
onChange={e => setTheme(e.target.value)}
>
<Radio label="Dark Mode" value={Themes.DARK} />
<Radio label="Light Mode" value={Themes.LIGHT} />
</RadioGroup>
</div>;
ColorsPanel.propTypes = {
theme: PropTypes.string.isRequired,
setTheme: PropTypes.func.isRequired
};
export default ColorsPanel;
|
Select themes as radio buttons
|
enhancement: Select themes as radio buttons
|
JavaScript
|
mit
|
builtwithluv/ZenFocus,builtwithluv/ZenFocus
|
d286a3d9d171b77651e6c81fad3970baa5584fdc
|
src/javascript/binary/common_functions/check_new_release.js
|
src/javascript/binary/common_functions/check_new_release.js
|
const url_for_static = require('../base/url').url_for_static;
const moment = require('moment');
const check_new_release = function() { // calling this method is handled by GTM tags
const last_reload = localStorage.getItem('new_release_reload_time');
// prevent reload in less than 10 minutes
if (last_reload && +last_reload + (10 * 60 * 1000) > moment().valueOf()) return;
const currect_hash = $('script[src*="binary.min.js"],script[src*="binary.js"]').attr('src').split('?')[1];
const xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (+xhttp.readyState === 4 && +xhttp.status === 200) {
const latest_hash = xhttp.responseText;
if (latest_hash && latest_hash !== currect_hash) {
localStorage.setItem('new_release_reload_time', moment().valueOf());
window.location.reload(true);
}
}
};
xhttp.open('GET', url_for_static() + 'version?' + Math.random().toString(36).slice(2), true);
xhttp.send();
};
module.exports = {
check_new_release: check_new_release,
};
|
const url_for_static = require('../base/url').url_for_static;
const moment = require('moment');
const check_new_release = function() { // calling this method is handled by GTM tags
const last_reload = localStorage.getItem('new_release_reload_time');
// prevent reload in less than 10 minutes
if (last_reload && +last_reload + (10 * 60 * 1000) > moment().valueOf()) return;
localStorage.setItem('new_release_reload_time', moment().valueOf());
const currect_hash = $('script[src*="binary.min.js"],script[src*="binary.js"]').attr('src').split('?')[1];
const xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (+xhttp.readyState === 4 && +xhttp.status === 200) {
const latest_hash = xhttp.responseText;
if (latest_hash && latest_hash !== currect_hash) {
window.location.reload(true);
}
}
};
xhttp.open('GET', url_for_static() + 'version?' + Math.random().toString(36).slice(2), true);
xhttp.send();
};
module.exports = {
check_new_release: check_new_release,
};
|
Check for new release in 10 minutes intervals
|
Check for new release in 10 minutes intervals
|
JavaScript
|
apache-2.0
|
binary-com/binary-static,negar-binary/binary-static,4p00rv/binary-static,ashkanx/binary-static,raunakkathuria/binary-static,raunakkathuria/binary-static,binary-static-deployed/binary-static,binary-static-deployed/binary-static,raunakkathuria/binary-static,binary-com/binary-static,kellybinary/binary-static,ashkanx/binary-static,4p00rv/binary-static,negar-binary/binary-static,binary-com/binary-static,negar-binary/binary-static,kellybinary/binary-static,ashkanx/binary-static,binary-static-deployed/binary-static,4p00rv/binary-static,kellybinary/binary-static
|
45731fa369103e32b6b02d6ed5e99997def24e08
|
app/client/components/Sidebar/Sidebar.js
|
app/client/components/Sidebar/Sidebar.js
|
// @flow
import React, { Component } from 'react'
import { Link } from 'react-router'
import s from './Sidebar.scss'
export default class Sidebar extends Component {
constructor (props) {
super(props)
this.state = {
links: [
{ text: 'Dashboard', to: '/admin/dashboard' },
{ text: 'Entries', to: '/admin/entries' },
{ text: 'Globals', to: '/admin/globals' },
{ text: 'Categories', to: '/admin/categories' },
{ text: 'Assets', to: '/admin/assets' },
{ text: 'Settings', to: '/admin/settings' }
]
}
}
renderLink (link) {
return (
<li>
<Link className={s.link}
activeClassName={s.activeLink}
to={link.to}>
{link.text}
</Link>
</li>
)
}
render () {
return (
<header className={s.root}>
<nav className={s.nav}>
<ul>
{this.state.links.map(this.renderLink)}
</ul>
</nav>
</header>
)
}
}
|
// @flow
import React, { Component } from 'react'
import { Link } from 'react-router'
import s from './Sidebar.scss'
export default class Sidebar extends Component {
constructor (props) {
super(props)
this.state = {
links: [
{ text: 'Dashboard', to: '/admin/dashboard' },
{ text: 'Entries', to: '/admin/entries' },
{ text: 'Globals', to: '/admin/globals' },
{ text: 'Categories', to: '/admin/categories' },
{ text: 'Assets', to: '/admin/assets' },
{ text: 'Settings', to: '/admin/settings' }
]
}
}
renderLink (link, index) {
return (
<li key={index}>
<Link className={s.link}
activeClassName={s.activeLink}
to={link.to}>
{link.text}
</Link>
</li>
)
}
render () {
return (
<header className={s.root}>
<nav className={s.nav}>
<ul>
{this.state.links.map(this.renderLink)}
</ul>
</nav>
</header>
)
}
}
|
Add key to sidebar links
|
Add key to sidebar links
|
JavaScript
|
mit
|
jmdesiderio/swan-cms,jmdesiderio/swan-cms
|
11c4c935d9bb1ab5967a8eba97cd73d6ee9df684
|
packages/internal-test-helpers/lib/ember-dev/setup-qunit.js
|
packages/internal-test-helpers/lib/ember-dev/setup-qunit.js
|
/* globals QUnit */
export default function setupQUnit(assertion, _qunitGlobal) {
var qunitGlobal = QUnit;
if (_qunitGlobal) {
qunitGlobal = _qunitGlobal;
}
var originalModule = qunitGlobal.module;
qunitGlobal.module = function(name, _options) {
var options = _options || {};
var originalSetup = options.setup || function() { };
var originalTeardown = options.teardown || function() { };
options.setup = function() {
assertion.reset();
assertion.inject();
return originalSetup.apply(this, arguments);
};
options.teardown = function() {
let result = originalTeardown.apply(this, arguments);
assertion.assert();
assertion.restore();
return result;
};
return originalModule(name, options);
};
}
|
/* globals QUnit */
export default function setupQUnit(assertion, _qunitGlobal) {
var qunitGlobal = QUnit;
if (_qunitGlobal) {
qunitGlobal = _qunitGlobal;
}
var originalModule = qunitGlobal.module;
qunitGlobal.module = function(name, _options) {
var options = _options || {};
var originalSetup = options.setup || options.beforeEach || function() { };
var originalTeardown = options.teardown || options.afterEach || function() { };
delete options.setup;
delete options.teardown;
options.beforeEach = function() {
assertion.reset();
assertion.inject();
return originalSetup.apply(this, arguments);
};
options.afterEach = function() {
let result = originalTeardown.apply(this, arguments);
assertion.assert();
assertion.restore();
return result;
};
return originalModule(name, options);
};
}
|
Add support for beforeEach / afterEach to ember-dev assertions.
|
Add support for beforeEach / afterEach to ember-dev assertions.
|
JavaScript
|
mit
|
kellyselden/ember.js,fpauser/ember.js,thoov/ember.js,kanongil/ember.js,Gaurav0/ember.js,mixonic/ember.js,csantero/ember.js,Gaurav0/ember.js,Turbo87/ember.js,kennethdavidbuck/ember.js,gfvcastro/ember.js,sandstrom/ember.js,csantero/ember.js,xiujunma/ember.js,asakusuma/ember.js,qaiken/ember.js,jasonmit/ember.js,givanse/ember.js,tildeio/ember.js,qaiken/ember.js,sly7-7/ember.js,karthiick/ember.js,kellyselden/ember.js,thoov/ember.js,knownasilya/ember.js,kanongil/ember.js,jaswilli/ember.js,csantero/ember.js,givanse/ember.js,mixonic/ember.js,stefanpenner/ember.js,givanse/ember.js,GavinJoyce/ember.js,jaswilli/ember.js,mike-north/ember.js,sandstrom/ember.js,Turbo87/ember.js,asakusuma/ember.js,emberjs/ember.js,Serabe/ember.js,kanongil/ember.js,cibernox/ember.js,qaiken/ember.js,thoov/ember.js,miguelcobain/ember.js,mike-north/ember.js,kellyselden/ember.js,mike-north/ember.js,runspired/ember.js,gfvcastro/ember.js,knownasilya/ember.js,bekzod/ember.js,intercom/ember.js,twokul/ember.js,GavinJoyce/ember.js,qaiken/ember.js,jasonmit/ember.js,jasonmit/ember.js,fpauser/ember.js,sly7-7/ember.js,bekzod/ember.js,xiujunma/ember.js,mixonic/ember.js,fpauser/ember.js,tildeio/ember.js,twokul/ember.js,stefanpenner/ember.js,kellyselden/ember.js,mfeckie/ember.js,tildeio/ember.js,elwayman02/ember.js,asakusuma/ember.js,twokul/ember.js,runspired/ember.js,miguelcobain/ember.js,karthiick/ember.js,cibernox/ember.js,knownasilya/ember.js,intercom/ember.js,gfvcastro/ember.js,mfeckie/ember.js,emberjs/ember.js,jaswilli/ember.js,mike-north/ember.js,gfvcastro/ember.js,elwayman02/ember.js,asakusuma/ember.js,xiujunma/ember.js,sandstrom/ember.js,kanongil/ember.js,Serabe/ember.js,bekzod/ember.js,bekzod/ember.js,Turbo87/ember.js,jasonmit/ember.js,stefanpenner/ember.js,Gaurav0/ember.js,miguelcobain/ember.js,twokul/ember.js,cibernox/ember.js,kennethdavidbuck/ember.js,runspired/ember.js,karthiick/ember.js,jasonmit/ember.js,kennethdavidbuck/ember.js,fpauser/ember.js,miguelcobain/ember.js,elwayman02/ember.js,jaswilli/ember.js,xiujunma/ember.js,Serabe/ember.js,mfeckie/ember.js,givanse/ember.js,elwayman02/ember.js,Gaurav0/ember.js,GavinJoyce/ember.js,csantero/ember.js,Turbo87/ember.js,intercom/ember.js,cibernox/ember.js,mfeckie/ember.js,emberjs/ember.js,runspired/ember.js,GavinJoyce/ember.js,sly7-7/ember.js,Serabe/ember.js,intercom/ember.js,kennethdavidbuck/ember.js,karthiick/ember.js,thoov/ember.js
|
7dbdff31b9c97fb7eed2420e1e46508dee1797a2
|
ember-cli-build.js
|
ember-cli-build.js
|
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function (defaults) {
var app = new EmberAddon(defaults, {
'ember-cli-babel': {
includePolyfill: true
},
'ember-cli-qunit': {
useLintTree: false // we use standard instead
}
});
// we do this because we don't want the addon to bundle it, but we need it for dev
app.import('vendor/adapter.js');
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
return app.toTree();
};
|
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const cdnUrl = process.env.CDN_URL || '/';
module.exports = function (defaults) {
var app = new EmberAddon(defaults, {
'ember-cli-babel': {
includePolyfill: true
},
'ember-cli-qunit': {
useLintTree: false // we use standard instead
},
fingerprint: {
prepend: cdnUrl,
extensions: ['js', 'css']
}
});
// we do this because we don't want the addon to bundle it, but we need it for dev
app.import('vendor/adapter.js');
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
return app.toTree();
};
|
Add fingerprinting for troubleshooter deployed app
|
Add fingerprinting for troubleshooter deployed app
|
JavaScript
|
mit
|
MyPureCloud/ember-webrtc-troubleshoot,MyPureCloud/ember-webrtc-troubleshoot,MyPureCloud/ember-webrtc-troubleshoot
|
294aafacd298a013881f92f7a866a8b07f5a25f5
|
examples/simple.js
|
examples/simple.js
|
"use strict";
const Rectangle = require('../lib/Rectangle');
const cursor = require('kittik-cursor').create().resetTTY();
Rectangle.create({text: 'Text here!', x: 'center', width: 20, background: 'green', foreground: 'black'}).render(cursor);
Rectangle.create({x: 'center', y: 'middle', width: '50%', height: '20%', background: 'dark_blue'}).render(cursor);
cursor.moveTo(1, process.stdout.rows).flush();
|
"use strict";
const Rectangle = require('../lib/Rectangle');
const cursor = require('kittik-cursor').create().resetTTY();
Rectangle.create({
text: 'Text here!',
x: 'center',
y: 2,
width: 40,
background: 'green',
foreground: 'black'
}).render(cursor);
Rectangle.create({
text: 'Text here',
x: 'center',
y: 'middle',
width: '50%',
height: '20%',
background: 'dark_blue'
}).render(cursor);
cursor.moveTo(1, process.stdout.rows).flush();
|
Update shape-basic to the latest version
|
fix(shape): Update shape-basic to the latest version
|
JavaScript
|
mit
|
kittikjs/shape-rectangle
|
68943423f789993e2ca91cd5f76e94d524a127c8
|
addon/authenticators/token.js
|
addon/authenticators/token.js
|
import Ember from 'ember';
import Base from 'ember-simple-auth/authenticators/base';
import Configuration from '../configuration';
const { get, isEmpty, inject: { service }, RSVP: { resolve, reject } } = Ember;
export default Base.extend({
ajax: service(),
init() {
this._super(...arguments);
this.serverTokenEndpoint = Configuration.serverTokenEndpoint;
this.tokenAttributeName = Configuration.tokenAttributeName;
this.identificationAttributeName = Configuration.identificationAttributeName;
},
restore(data) {
const token = get(data, this.tokenAttributeName);
if (!isEmpty(token)) {
return resolve(data);
} else {
return reject();
}
},
authenticate(data) {
return get(this, 'ajax').post(this.serverTokenEndpoint, {
data: JSON.stringify(data)
}).then((response) => {
return resolve(response);
}).catch((error) => {
Ember.Logger.warn(error);
return reject();
});
}
});
|
import Ember from 'ember';
import Base from 'ember-simple-auth/authenticators/base';
import Configuration from '../configuration';
const { get, isEmpty, inject: { service }, RSVP: { resolve, reject } } = Ember;
export default Base.extend({
ajax: service(),
init() {
this._super(...arguments);
this.serverTokenEndpoint = Configuration.serverTokenEndpoint;
this.tokenAttributeName = Configuration.tokenAttributeName;
this.identificationAttributeName = Configuration.identificationAttributeName;
},
restore(data) {
const token = get(data, this.tokenAttributeName);
if (!isEmpty(token)) {
return resolve(data);
} else {
return reject();
}
},
authenticate(data) {
return get(this, 'ajax').post(this.serverTokenEndpoint, {
contentType: 'application/json',
data: JSON.stringify(data)
}).then((response) => {
return resolve(response);
}).catch((error) => {
Ember.Logger.warn(error);
return reject();
});
}
});
|
Add JSON content type to authenticate headers
|
Add JSON content type to authenticate headers
|
JavaScript
|
mit
|
datajohnny/ember-simple-token,datajohnny/ember-simple-token
|
99fe3b420e9bc14a2d01fd0f3c61bb94ce970a2c
|
hooks/src/index.js
|
hooks/src/index.js
|
import { options } from 'preact';
let currentIndex;
let component;
options.beforeRender = function (vnode) {
component = vnode._component;
currentIndex = 0;
}
const createHook = (create) => (...args) => {
if (component == null) return;
const list = component.__hooks || (component.__hooks = []);
let index = currentIndex++;
let hook = list[index];
if (!hook) {
hook = list[index] = { index, value: undefined };
hook.run = create(hook, component, ...args);
}
return (hook.value = hook.run());
};
export const useState = createHook((hook, inst, initialValue) => {
const stateId = 'hookstate$' + hook.index;
let value = typeof initialValue === 'function' ? initialValue() : initialValue;
const setter = {};
setter[stateId] = inst.state[stateId] = value;
function set(v) {
value = setter[stateId] = typeof v === 'function' ? v(value) : v;
inst.setState(setter);
}
return () => [value, set];
});
|
import { options } from 'preact';
let currentIndex;
let component;
let oldBeforeRender = options.beforeRender;
options.beforeRender = vnode => {
component = vnode._component;
currentIndex = 0;
if (oldBeforeRender) oldBeforeRender(vnode)
}
const createHook = (create) => (...args) => {
if (component == null) return;
const list = component.__hooks || (component.__hooks = []);
let index = currentIndex++;
let hook = list[index];
if (!hook) {
hook = list[index] = { index, value: undefined };
hook.run = create(hook, component, ...args);
}
return (hook.value = hook.run());
};
export const useState = createHook((hook, inst, initialValue) => {
const stateId = 'hookstate$' + hook.index;
let value = typeof initialValue === 'function' ? initialValue() : initialValue;
const setter = {};
setter[stateId] = inst.state[stateId] = value;
function set(v) {
value = setter[stateId] = typeof v === 'function' ? v(value) : v;
inst.setState(setter);
}
return () => [value, set];
});
|
Call any previous beforeRender() once we're done with ours
|
Call any previous beforeRender() once we're done with ours
|
JavaScript
|
mit
|
developit/preact,developit/preact
|
79788a69daa951d85f4600926c464d6fbff9fe5b
|
assets/javascripts/global.js
|
assets/javascripts/global.js
|
$(function () {
$('input[type="file"]').on('change', function (e) {
if ($(this).val()) {
$('input[type="submit"]').prop('disabled', false);
}
else {
$('input[type="submit"]').prop('disabled', true);
}
});
$('input[name="format"]').on('change', function (e) {
var action = $('form').prop('action'),
new_action = action.replace(/\.[^.]+$/, '.' + $(this).val());
$('form').prop('action', new_action);
});
$('input[name="format"]').trigger('change');
});
|
$(function () {
$('input[type="file"]').on('change', function (e) {
if ($(this).val()) {
$('input[type="submit"]').prop('disabled', false);
}
else {
$('input[type="submit"]').prop('disabled', true);
}
});
$('input[name="format"]:checked').on('change', function (e) {
var action = $('form').prop('action'),
new_action = action.replace(/\.[^.]+$/, '.' + $(this).val());
$('form').prop('action', new_action);
});
$('input[name="format"]:checked').trigger('change');
});
|
Fix ARCSPC-45: Handle radio button form action setting correctly
|
Fix ARCSPC-45: Handle radio button form action setting correctly
|
JavaScript
|
apache-2.0
|
harvard-library/archivesspace-checker,harvard-library/archivesspace-checker
|
30dd01f64e5e7dc98a517c8ff2353ab2cdde0583
|
lib/assets/javascripts/cartodb3/components/form-components/editors/node-dataset/node-dataset-item-view.js
|
lib/assets/javascripts/cartodb3/components/form-components/editors/node-dataset/node-dataset-item-view.js
|
var CustomListItemView = require('cartodb3/components/custom-list/custom-list-item-view');
var _ = require('underscore');
module.exports = CustomListItemView.extend({
render: function () {
this.$el.empty();
this.clearSubViews();
this.$el.append(
this.options.template(
_.extend(
{
typeLabel: this.options.typeLabel,
isSelected: this.model.get('selected'),
name: this.model.getName(),
val: this.model.getValue()
},
this.model.attributes
)
)
);
this.$el
.attr('data-val', this.model.getValue())
.toggleClass('is-disabled', !!this.model.get('disabled'));
return this;
}
});
|
var CustomListItemView = require('cartodb3/components/custom-list/custom-list-item-view');
var _ = require('underscore');
module.exports = CustomListItemView.extend({
render: function () {
this.$el.empty();
this.clearSubViews();
this.$el.append(
this.options.template(
_.extend(
{
typeLabel: this.options.typeLabel,
isSelected: this.model.get('selected'),
isSourceType: this.model.get('isSourceType'),
name: this.model.getName(),
val: this.model.getValue()
},
this.model.attributes
)
)
);
this.$el
.attr('data-val', this.model.getValue())
.toggleClass('is-disabled', !!this.model.get('disabled'));
return this;
}
});
|
Add isSourceType to base template object
|
Add isSourceType to base template object
|
JavaScript
|
bsd-3-clause
|
CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb
|
36a53309e022f1ad6351756568bcc4d9e0df6940
|
app/src/common/base-styles.js
|
app/src/common/base-styles.js
|
export default function() {
return `
html {
height: 100%;
overflow-y: scroll;
}
body {
font-family: 'Lato', sans-serif;
font-size: 14px;
color: #000;
background: #f6f6f6;
}
`;
}
|
export default function() {
return `
*,
*:before,
*:after {
box-sizing: inherit;
}
html {
height: 100%;
overflow-y: scroll;
box-sizing: border-box;
}
body {
font-family: 'Lato', sans-serif;
font-size: 14px;
color: #000;
background: #f6f6f6;
}
`;
}
|
Use 'border-box' as default box sizing
|
:lipstick: Use 'border-box' as default box sizing
|
JavaScript
|
mit
|
vvasilev-/weatheros,vvasilev-/weatheros
|
b3b18edfa2e964fe76125eb53189d92c48b867d1
|
src/is-defined.js
|
src/is-defined.js
|
define([
], function () {
/**
* @exports is-defined
*
* Helper which checks whether a variable is defined or not.
*
* @param {*} check The variable to check that is defined
* @param {String} type The type your expecting the variable to be defined as.
*
* @returns {Boolean} When the variable is undefined it will pass back false otherwise pass back true.
*
* @example
* ```js
* var barney;
* isDefined(barney);
* // Returns false
*
* var barney = 'stinson';
* isDefined(barney);
* // Returns true
*
* isDefined(barney, 'string');
* // Returns true
*
* isDefined(barney, 'function');
* // Returns false
* ```
*/
function isDefined (check, type) {
// Check that the variable is a specific type
if (type) {
var regex = new RegExp(/\[object (\w+)]/),
string = Object.prototype.toString.call(check).toLowerCase(),
matches = string.match(regex);
return matches[1] === type;
}
return (typeof check !== 'undefined');
}
return isDefined;
});
|
define([
], function () {
/**
* @exports is-defined
*
* Helper which checks whether a variable is defined or not.
*
* @param {*} check The variable to check that is defined
* @param {String} type The type your expecting the variable to be defined as.
*
* @returns {Boolean} When the variable is undefined it will pass back false otherwise pass back true.
*
* @example
* ```js
* var barney;
* isDefined(barney);
* // Returns false
*
* var barney = 'stinson';
* isDefined(barney);
* // Returns true
*
* isDefined(barney, 'string');
* // Returns true
*
* isDefined(barney, 'function');
* // Returns false
* ```
*/
function isDefined (check, type) {
// Check that the variable is a specific type && not undefined (IE8 reports undefined variables as objects)
if (type && typeof check !== 'undefined') {
var regex = new RegExp(/\[object (\w+)]/),
string = Object.prototype.toString.call(check).toLowerCase(),
matches = string.match(regex);
return matches[1] === type;
}
return (typeof check !== 'undefined');
}
return isDefined;
});
|
Fix bug in IE8 undefined returns as object
|
Fix bug in IE8 undefined returns as object
|
JavaScript
|
mit
|
rockabox/Auxilium.js
|
7f3804a1da20276ad309fa6554cca329f296ff64
|
app/assets/javascripts/districts/controllers/sister_modal_controller.js
|
app/assets/javascripts/districts/controllers/sister_modal_controller.js
|
VtTracker.SisterModalController = Ember.ObjectController.extend({
needs: ['districtSistersIndex', 'application'],
districts: Ember.computed.alias('controllers.application.model'),
modalTitle: function() {
if (this.get('isNew')) {
return 'New Sister';
} else {
return 'Edit Sister';
}
}.property('isNew'),
actions: {
save: function() {
var _self = this;
var isNew = _self.get('model.isNew');
var district = _self.get('model.district');
_self.get('model').save().then(function() {
if (isNew) {
_self.set('controllers.districtSistersIndex.newSister', _self.store.createRecord('sister', {
district: district
}));
}
});
}
}
});
|
VtTracker.SisterModalController = Ember.ObjectController.extend({
needs: ['districtSistersIndex', 'application'],
districts: Ember.computed.alias('controllers.application.model'),
modalTitle: function() {
if (this.get('isNew')) {
return 'New Sister';
} else {
return 'Edit Sister';
}
}.property('isNew'),
actions: {
removeModal: function() {
this.get('model').rollback();
return true;
},
save: function() {
var _self = this;
var isNew = _self.get('model.isNew');
var district = _self.get('model.district');
_self.get('model').save().then(function() {
if (isNew) {
_self.set('controllers.districtSistersIndex.newSister', _self.store.createRecord('sister', {
district: district
}));
}
});
}
}
});
|
Rollback model when modal is closed
|
Rollback model when modal is closed
|
JavaScript
|
mit
|
bfcoder/vt-ht-tracker,bfcoder/vt-ht-tracker,bfcoder/vt-ht-tracker
|
eb0f5fd8a337ace145c40e9b624738619542033a
|
Rightmove_Enhancement_Suite.user.js
|
Rightmove_Enhancement_Suite.user.js
|
// ==UserScript==
// @name Rightmove Enhancement Suite
// @namespace https://github.com/chigley/
// @description Keyboard shortcuts
// @include http://www.rightmove.co.uk/*
// @version 1
// @grant GM_addStyle
// @grant GM_getResourceText
// @resource style style.css
// ==/UserScript==
var $ = unsafeWindow.jQuery;
GM_addStyle(GM_getResourceText("style"));
var listItems = $("[name=summary-list-item]");
// Remove grey background on premium listings. Otherwise, my active item doesn't
// stand out against such listings
$(".premium").css("background", "white");
listItems.click(function () {
listItems.removeClass("RES-active-list-item");
$(this).addClass("RES-active-list-item");
});
$('body').bind('keyup', function(e) {
var code = e.keyCode || e.which;
if (e.keyCode == 74) {
// j
alert("j!");
}
});
|
// ==UserScript==
// @name Rightmove Enhancement Suite
// @namespace https://github.com/chigley/
// @description Keyboard shortcuts
// @include http://www.rightmove.co.uk/*
// @version 1
// @grant GM_addStyle
// @grant GM_getResourceText
// @resource style style.css
// ==/UserScript==
var $ = unsafeWindow.jQuery;
GM_addStyle(GM_getResourceText("style"));
var listItems = $("[name=summary-list-item]");
var currentlySelected;
// Remove grey background on premium listings. Otherwise, my active item doesn't
// stand out against such listings
$(".premium").css("background", "white");
listItems.click(function () {
listItems.removeClass("RES-active-list-item");
$(this).addClass("RES-active-list-item");
currentlySelected = $(this);
});
$('body').bind('keyup', function(e) {
var code = e.keyCode || e.which;
if (e.keyCode == 74) {
// j
var next = currentlySelected.next("[name=summary-list-item]");
if (next.length == 1) {
listItems.removeClass("RES-active-list-item");
next.addClass("RES-active-list-item");
currentlySelected = next;
}
}
});
|
Select next item with j key
|
Select next item with j key
|
JavaScript
|
mit
|
chigley/rightmove-enhancement-suite
|
f13ecda8d2a69f455b175d013a2609197f495bb0
|
src/components/outline/Link.js
|
src/components/outline/Link.js
|
// @flow
import styled, { css } from 'styled-components'
import * as vars from 'settings/styles'
import * as colors from 'settings/colors'
type Props = {
depth: '1' | '2' | '3' | '4' | '5' | '6',
}
const fn = ({ depth: depthStr }: Props) => {
const depth = parseInt(depthStr)
return css`
padding-left: ${(2 + (depth > 1 ? depth - 2 : 0)) * vars.spacing}px;
&:before {
content: '${'#'.repeat(depth)}';
}
`
}
const Link = styled.a`
display: block;
height: 100%;
padding-right: ${2 * vars.spacing}px;
border-bottom: 1px solid ${colors.blackForeground200};
text-decoration: none;
font-size: 0.9rem;
color: white;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
${fn}
&:before {
color: ${colors.whiteForeground300};
padding-right: ${vars.spacing}px;
font-size: 0.8rem;
}
&:hover {
background-color: ${colors.blackForeground200};
}
`
export default Link
|
// @flow
import styled, { css } from 'styled-components'
import * as vars from 'settings/styles'
import * as colors from 'settings/colors'
type Props = {
depth: '1' | '2' | '3' | '4' | '5' | '6',
}
const fn = ({ depth: depthStr }: Props) => {
const depth = parseInt(depthStr)
return css`
padding-left: ${(2 + (depth > 1 ? depth - 2 : 0)) * vars.spacing}px;
&:before {
content: '${'#'.repeat(depth)}';
}
`
}
const Link = styled.a`
display: block;
height: 100%;
padding-right: ${2 * vars.spacing}px;
border-bottom: 1px solid ${colors.blackForeground200};
text-decoration: none;
font-size: 0.9rem;
color: white;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
pointer-events: none;
${fn}
&:before {
color: ${colors.whiteForeground300};
padding-right: ${vars.spacing}px;
font-size: 0.8rem;
}
&:hover {
background-color: ${colors.blackForeground200};
}
`
export default Link
|
Disable pointer-events of outline items
|
Disable pointer-events of outline items
|
JavaScript
|
mit
|
izumin5210/OHP,izumin5210/OHP
|
248b0e54a3bda3271f5735dedf61eda8395d882d
|
src/helpers/find-root.js
|
src/helpers/find-root.js
|
'use babel'
/* @flow */
import Path from 'path'
import {findCached} from './common'
import {CONFIG_FILE_NAME} from '../defaults'
export async function findRoot(directory: string): Promise<string> {
const configFile = await findCached(directory, CONFIG_FILE_NAME)
if (configFile) {
return Path.dirname(configFile)
} else return directory
}
|
'use babel'
/* @flow */
import Path from 'path'
import {findCached} from './common'
import {CONFIG_FILE_NAME} from '../defaults'
export async function findRoot(directory: string): Promise<string> {
const configFile = await findCached(directory, CONFIG_FILE_NAME)
if (configFile) {
return Path.dirname(configFile)
} else throw new Error('No configuration found file')
}
|
Throw error if no config is found
|
:no_entry: Throw error if no config is found
|
JavaScript
|
mit
|
steelbrain/UCompiler
|
e78af7ead579d2c91f461734d2bdff5910cf3a5c
|
server.js
|
server.js
|
// Load required modules
var http = require('http'), // http server core module
port = 8080,
timeNow = new Date().toLocaleString('en-US', {hour12: false, timeZone: 'Europe/Kiev'}),
express = require('express'), // web framework external module
fs = require('fs'),
httpApp = express();
// Setup and configure Express http server. Expect a subfolder called 'site' to be the web root.
httpApp.use(express.static(__dirname + '/site/'));
// Start Express http server on the port
console.info(timeNow + ': Starting http server on the port ' + port);
console.info(timeNow + ': Ctrl-C to abort');
http.createServer(httpApp).listen(port);
|
// Load required modules
var http = require('http'), // http server core module
port = 8080,
timeNow = new Date().toLocaleString('en-US', {hour12: false, timeZone: 'Europe/Kiev'}),
express = require('express'), // web framework external module
fs = require('fs'),
httpApp = express();
// Setup and configure Express http server. Expect a subfolder called 'site' to be the web root.
httpApp.use(express.static(__dirname + '/site/'));
httpApp.get(['/search/*', '/profile/*', '/repo/*'], function(req, res){
res.sendFile(__dirname + '/site/index.html');
});
// Start Express http server on the port
console.info(timeNow + ': Starting http server on the port ' + port);
console.info(timeNow + ': Ctrl-C to abort');
http.createServer(httpApp).listen(port);
|
Set reroute to index.html for /search/*, /profile/*, /repo/*
|
Set reroute to index.html for /search/*, /profile/*, /repo/*
|
JavaScript
|
mit
|
SteveBidenko/github-angular,SteveBidenko/github-angular,SteveBidenko/github-angular
|
5d309087a7e4cd2931a1c8e29096f9eadb5de188
|
src/lb.js
|
src/lb.js
|
/*
* Namespace: lb
* Root of Legal Box Scalable JavaScript Application
*
* Authors:
* o Eric Bréchemier <legalbox@eric.brechemier.name>
* o Marc Delhommeau <marc.delhommeau@legalbox.com>
*
* Copyright:
* Legal-Box SAS (c) 2010-2011, All Rights Reserved
*
* License:
* BSD License
* http://creativecommons.org/licenses/BSD/
*
* Version:
* 2011-07-04
*/
/*jslint white:false, plusplus:false */
/*global define, window */
define(function() {
// Note: no methods defined at this level currently
var lb = { // public API
};
// initialize global variable lb in browser environment,
// for backward-compatibility
if (window !== undefined){
window.lb = lb;
}
return lb;
});
|
/*
* Namespace: lb
* Root of Legal Box Scalable JavaScript Application
*
* Authors:
* o Eric Bréchemier <legalbox@eric.brechemier.name>
* o Marc Delhommeau <marc.delhommeau@legalbox.com>
*
* Copyright:
* Legal-Box SAS (c) 2010-2011, All Rights Reserved
*
* License:
* BSD License
* http://creativecommons.org/licenses/BSD/
*
* Version:
* 2011-07-05
*/
/*jslint white:false, plusplus:false */
/*global define, window */
define(function(undefined) {
// Note: no methods defined at this level currently
var lb = { // public API
};
// initialize global variable lb in browser environment,
// for backward-compatibility
if (window !== undefined){
window.lb = lb;
}
return lb;
});
|
Declare undefined as parameter to make sure it is actually undefined
|
Declare undefined as parameter to make sure it is actually undefined
Since undefined is a property of the global object, its value may be replaced,
e.g. due to programming mistakes:
if (undefined = myobject){ // programming mistake which assigns undefined
// ...
}
|
JavaScript
|
bsd-3-clause
|
eric-brechemier/lb_js_scalableApp,eric-brechemier/lb_js_scalableApp,eric-brechemier/lb_js_scalableApp
|
a8d2e74163cf71bb811150143089f83aca2c55a0
|
src/lightbox/LightboxFooter.js
|
src/lightbox/LightboxFooter.js
|
/* @flow */
import React, { PureComponent } from 'react';
import { Text, StyleSheet, View } from 'react-native';
import type { Style } from '../types';
import NavButton from '../nav/NavButton';
const styles = StyleSheet.create({
wrapper: {
height: 44,
flexDirection: 'row',
justifyContent: 'space-between',
paddingLeft: 16,
paddingRight: 8,
flex: 1,
},
text: {
color: 'white',
fontSize: 14,
alignSelf: 'center',
},
icon: {
fontSize: 28,
},
});
type Props = {
style?: Style,
displayMessage: string,
onOptionsPress: () => void,
};
export default class LightboxFooter extends PureComponent<Props> {
props: Props;
render() {
const { displayMessage, onOptionsPress, style } = this.props;
return (
<View style={[styles.wrapper, style]}>
<Text style={styles.text}>{displayMessage}</Text>
<NavButton
name="more-vertical"
color="white"
style={styles.icon}
onPress={onOptionsPress}
/>
</View>
);
}
}
|
/* @flow */
import React, { PureComponent } from 'react';
import { Text, StyleSheet, View } from 'react-native';
import type { Style } from '../types';
import Icon from '../common/Icons';
const styles = StyleSheet.create({
wrapper: {
height: 44,
flexDirection: 'row',
justifyContent: 'space-between',
paddingLeft: 16,
paddingRight: 8,
flex: 1,
},
text: {
color: 'white',
fontSize: 14,
alignSelf: 'center',
},
icon: {
fontSize: 28,
alignSelf: 'center',
},
});
type Props = {
style?: Style,
displayMessage: string,
onOptionsPress: () => void,
};
export default class LightboxFooter extends PureComponent<Props> {
props: Props;
render() {
const { displayMessage, onOptionsPress, style } = this.props;
return (
<View style={[styles.wrapper, style]}>
<Text style={styles.text}>{displayMessage}</Text>
<Icon style={styles.icon} color="white" name="more-vertical" onPress={onOptionsPress} />
</View>
);
}
}
|
Align option icon in Lightbox screen
|
layout: Align option icon in Lightbox screen
Icon was not properly aligned due to overlay of unreadCount.
As there is no need of unreadCount here, Instead of using NavButton,
use Icon component directly.
Fixes #3003.
|
JavaScript
|
apache-2.0
|
vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile
|
2021611229e5b6691297504fc72926b085d70ca3
|
src/ggrc/assets/javascripts/components/mapped-objects/mapped-objects.js
|
src/ggrc/assets/javascripts/components/mapped-objects/mapped-objects.js
|
/*!
Copyright (C) 2016 Google Inc., authors, and contributors
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
*/
(function (can, GGRC) {
'use strict';
var tpl = can.view(GGRC.mustache_path +
'/components/mapped-objects/mapped-objects.mustache');
var tag = 'mapped-objects';
/**
* Assessment specific mapped objects view component
*/
GGRC.Components('mappedObjects', {
tag: tag,
template: tpl,
scope: {
isLoading: false,
mapping: '@',
parentInstance: null,
mappedItems: [],
setMappedObjects: function (items) {
this.attr('isLoading', false);
this.attr('mappedItems').replace(items);
},
load: function () {
this.attr('isLoading', true);
this.attr('parentInstance')
.get_binding(this.attr('mapping'))
.refresh_instances()
.then(this.setMappedObjects.bind(this));
}
},
init: function () {
this.scope.load();
}
});
})(window.can, window.GGRC);
|
/*!
Copyright (C) 2016 Google Inc., authors, and contributors
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
*/
(function (can, GGRC) {
'use strict';
var tpl = can.view(GGRC.mustache_path +
'/components/mapped-objects/mapped-objects.mustache');
var tag = 'mapped-objects';
/**
* Mapped objects view component
*/
GGRC.Components('mappedObjects', {
tag: tag,
template: tpl,
scope: {
isLoading: false,
mapping: '@',
parentInstance: null,
selectedItem: null,
mappedItems: [],
filter: null,
setMappedObjects: function (items) {
var filterObj = this.attr('filter');
this.attr('isLoading', false);
items = filterObj ?
GGRC.Utils.filters.applyTypeFilter(items, filterObj.serialize()) :
items;
this.attr('mappedItems').replace(items);
},
load: function () {
this.attr('isLoading', true);
this.attr('parentInstance')
.get_binding(this.attr('mapping'))
.refresh_instances()
.then(this.setMappedObjects.bind(this));
}
},
init: function () {
this.scope.load();
}
});
})(window.can, window.GGRC);
|
Add filtering feature to base Mapped Objects component
|
Add filtering feature to base Mapped Objects component
|
JavaScript
|
apache-2.0
|
josthkko/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,edofic/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,selahssea/ggrc-core,edofic/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core
|
cd432d2fd9ef0c76f9673990f4b2c2f8680a1831
|
lib/global-admin/addon/security/roles/new/route.js
|
lib/global-admin/addon/security/roles/new/route.js
|
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { get } from '@ember/object';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
model() {
const store = get(this, 'globalStore');
var role = store.createRecord({
type: `projectRoleTemplate`,
name: '',
rules: [
{
apiGroups: ['*'],
type: 'policyRule',
resources: [],
verbs: [],
}
],
});
return hash({
roles: store.find('projectRoleTemplate'),
policies: store.find('podSecurityPolicyTemplate'),
}).then((res) => {
res.role = role;
return res;
});
},
});
|
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { get } from '@ember/object';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
model() {
const store = get(this, 'globalStore');
var role = store.createRecord({
type: `projectRoleTemplate`,
name: '',
rules: [],
});
return hash({
roles: store.find('projectRoleTemplate'),
policies: store.find('podSecurityPolicyTemplate'),
}).then((res) => {
res.role = role;
return res;
});
},
});
|
Remove the default added resource when add a role
|
Remove the default added resource when add a role
|
JavaScript
|
apache-2.0
|
rancherio/ui,pengjiang80/ui,vincent99/ui,lvuch/ui,rancherio/ui,westlywright/ui,rancher/ui,vincent99/ui,rancherio/ui,pengjiang80/ui,lvuch/ui,vincent99/ui,lvuch/ui,rancher/ui,westlywright/ui,pengjiang80/ui,westlywright/ui,rancher/ui
|
08a48f04219f01fa3140a17ce6c905cbca9b54a5
|
spec/arethusa.core/main_ctrl_spec.js
|
spec/arethusa.core/main_ctrl_spec.js
|
"use strict";
describe('MainCtrl', function() {
beforeEach(module('arethusa'));
it('sets scope values', inject(function($controller, $rootScope) {
var scope = $rootScope.$new();
var mystate = {
init: function() {},
allLoaded: false
};
var notifier = {
init: function() {},
success: function() {},
info: function() {},
error: function() {}
};
var ctrl = $controller('MainCtrl', {$scope:scope, state:mystate, notifier:notifier, configurator: {
configurationFor: function(name) {
return { plugins: {}, template: "template"};
}
}});
expect(scope.state).toBe(mystate);
expect(scope.plugins).toBeUndefined();
expect(scope.template).toBe("template");
}));
});
|
"use strict";
describe('MainCtrl', function() {
beforeEach(module('arethusa'));
it('sets scope values', inject(function($controller, $rootScope) {
var scope = $rootScope.$new();
var state = {
init: function() {},
allLoaded: false
};
var notifier = {
init: function() {},
success: function() {},
info: function() {},
error: function() {}
};
var configurator = {
configurationFor: function(name) {
return { plugins: {}, template: "template"};
}
};
var saver = { init: function() {} };
var mainCtrlInits = {
$scope: scope,
configurator: configurator,
state: state,
notifier: notifier,
saver: saver
};
var ctrl = $controller('MainCtrl', mainCtrlInits);
expect(scope.state).toBe(state);
expect(scope.plugins).toBeUndefined();
expect(scope.template).toBe("template");
}));
});
|
Update and refactor MainCtrl spec
|
Update and refactor MainCtrl spec
Whoops, #197 broke that spec. Used the opportunity to refactor the file
a bit.
|
JavaScript
|
mit
|
fbaumgardt/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa,Masoumeh/arethusa,latin-language-toolkit/arethusa,PonteIneptique/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa
|
0f53f3742abf00c18e14b1ad4ad2da5369586c03
|
filebrowser_safe/static/filebrowser/js/FB_FileBrowseField.js
|
filebrowser_safe/static/filebrowser/js/FB_FileBrowseField.js
|
function FileSubmit(FilePath, FileURL, ThumbURL, FileType) {
// var input_id=window.name.split("___").join(".");
var input_id=window.name.replace(/____/g,'-').split("___").join(".");
var preview_id = 'image_' + input_id;
var link_id = 'link_' + input_id;
var help_id = 'help_' + input_id;
var clear_id = 'clear_' + input_id;
input = opener.document.getElementById(input_id);
preview = opener.document.getElementById(preview_id);
link = opener.document.getElementById(link_id);
help = opener.document.getElementById(help_id);
clear = opener.document.getElementById(clear_id);
// set new value for input field
input.value = FilePath;
// enable the clear "button"
jQuery(clear).css("display", "inline");
if (ThumbURL && FileType != "") {
// selected file is an image and thumbnail is available:
// display the preview-image (thumbnail)
// link the preview-image to the original image
link.setAttribute("href", FileURL);
link.setAttribute("target", "_blank");
preview.setAttribute("src", ThumbURL);
help.setAttribute("style", "display:inline");
jQuery(help).addClass("mezz-fb-thumbnail");
} else {
// hide preview elements
link.setAttribute("href", "");
link.setAttribute("target", "");
preview.setAttribute("src", "");
help.setAttribute("style", "display:none");
}
this.close();
}
|
function FileSubmit(FilePath, FileURL, ThumbURL, FileType) {
// var input_id=window.name.split("___").join(".");
var input_id=window.name.replace(/____/g,'-').split("___").join(".");
var preview_id = 'image_' + input_id;
var link_id = 'link_' + input_id;
var help_id = 'help_' + input_id;
var clear_id = 'clear_' + input_id;
input = opener.document.getElementById(input_id);
preview = opener.document.getElementById(preview_id);
link = opener.document.getElementById(link_id);
help = opener.document.getElementById(help_id);
clear = opener.document.getElementById(clear_id);
// set new value for input field
input.value = FilePath;
// enable the clear "button"
jQuery(clear).css("display", "inline");
if (ThumbURL && FileType != "") {
// selected file is an image and thumbnail is available:
// display the preview-image (thumbnail)
// link the preview-image to the original image
link.setAttribute("href", FileURL);
link.setAttribute("target", "_blank");
link.setAttribute("style", "display:inline");
preview.setAttribute("src", ThumbURL);
help.setAttribute("style", "display:inline");
jQuery(help).addClass("mezz-fb-thumbnail");
} else {
// hide preview elements
link.setAttribute("href", "");
link.setAttribute("target", "");
preview.setAttribute("src", "");
help.setAttribute("style", "display:none");
}
this.close();
}
|
Fix regression in displaying a thumbnail for newly selected images on FileBrowseField.
|
Fix regression in displaying a thumbnail for newly selected images on FileBrowseField.
|
JavaScript
|
bsd-3-clause
|
ryneeverett/filebrowser-safe,ryneeverett/filebrowser-safe,ryneeverett/filebrowser-safe,fawx/filebrowser-safe,ryneeverett/filebrowser-safe,fawx/filebrowser-safe,fawx/filebrowser-safe
|
4e4ceb2fbb9eeffdd61b1f1bfc022347d4ae46e8
|
app/components/appearance-verify.js
|
app/components/appearance-verify.js
|
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
export default Component.extend({
store: service(),
flashMessages: service(),
verifyAppearance: task(function *() {
try {
yield this.model.verify({
'by': this.get('currentUser.user.id'),
});
this.model.reload();
if (this.get('model.varianceReport') == null) {
this.flashMessages.success("Verified!");
} else {
this.flashMessages.warning("VARIANCE!");
}
} catch(e) {
this.flashMessages.error(e);
}
}).drop(),
});
|
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
export default Component.extend({
store: service(),
flashMessages: service(),
verifyAppearance: task(function *() {
try {
yield this.model.verify({
'by': this.get('currentUser.user.id'),
});
this.model.reload();
if (this.get('model.varianceReport') == null) {
this.flashMessages.success("Verified!");
} else {
this.flashMessages.warning("VARIANCE!");
}
} catch(e) {
this.flashMessages.danger(e.errors.status);
}
}).drop(),
});
|
Add transition failure to appearance
|
Add transition failure to appearance
|
JavaScript
|
bsd-2-clause
|
barberscore/barberscore-web,barberscore/barberscore-web,barberscore/barberscore-web
|
26ca1acc5437a717ec4f622ffb2fc63bdf090aa9
|
app/components/live/get_services.js
|
app/components/live/get_services.js
|
'use strict';
angular.module('adagios.live')
.constant('filterSuffixes', { contains: '__contains',
has_fields: '__has_field',
startswith: '__startswith',
endswith: '__endswith',
exists: '__exists',
in: '__in',
isnot: '__isnot',
regex: '__regex'
})
.factory('getServices', ['$http', 'filterSuffixes',
function ($http, filterSuffixes) {
return function (columns, filters, apiName) {
var filtersQuery = '';
function createFiltersQuery(filters) {
var builtQuery = '';
angular.forEach(filters, function (value, key) {
var filterType = filterSuffixes[key];
angular.forEach(value, function (fieldValues, fieldName) {
var filter = fieldName + filterType;
angular.forEach(fieldValues, function (_value) {
var filterQuery = '&' + filter + '=' + _value;
builtQuery += filterQuery;
});
});
});
return builtQuery;
}
filtersQuery = createFiltersQuery(filters);
return $http.get('/rest/status/json/' + apiName + '/?fields=' + columns + filtersQuery)
.error(function () {
throw new Error('getServices : GET Request failed');
});
};
}]);
|
'use strict';
angular.module('adagios.live')
.constant('filterSuffixes', { contains: '__contains',
has_fields: '__has_field',
startswith: '__startswith',
endswith: '__endswith',
exists: '__exists',
in: '__in',
isnot: '__isnot',
regex: '__regex'
})
.factory('getServices', ['$http', 'filterSuffixes',
function ($http, filterSuffixes) {
return function (columns, filters, apiName, additionnalFields) {
var filtersQuery = '',
additionnalQuery = '';
function createFiltersQuery(filters) {
var builtQuery = '';
angular.forEach(filters, function (value, key) {
var filterType = filterSuffixes[key];
angular.forEach(value, function (fieldValues, fieldName) {
var filter = fieldName + filterType;
angular.forEach(fieldValues, function (_value) {
var filterQuery = '&' + filter + '=' + _value;
builtQuery += filterQuery;
});
});
});
return builtQuery;
}
function createAdditionnalQuery(additionnalFields) {
var query = '';
angular.forEach(additionnalFields, function (value, key) {
query += '&' + key + '=' + value;
});
return query;
}
filtersQuery = createFiltersQuery(filters);
additionnalQuery = createAdditionnalQuery(additionnalFields);
return $http.get('/rest/status/json/' + apiName + '/?fields=' + columns + filtersQuery + additionnalQuery)
.error(function () {
throw new Error('getServices : GET Request failed');
});
};
}]);
|
Add additinonalFields support to GetServices
|
Add additinonalFields support to GetServices
|
JavaScript
|
agpl-3.0
|
openstack/bansho,openstack/bansho,Freddrickk/adagios-frontend,stackforge/bansho,stackforge/bansho,Freddrickk/adagios-frontend,stackforge/bansho,openstack/bansho
|
2ac1100d313c1bd80c4230dff605c51e39048009
|
webpack.config.js
|
webpack.config.js
|
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const config = {
entry: {
'bundle': './client/js/index.js'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
},
{
test: /\.(ttf|eot|woff|jpe?g|svg|png)$/,
loader: 'url-loader'
}
]
},
plugins: [
new CopyWebpackPlugin([
{ context: 'public', from: '**/*' }
])
]
};
if (process.env.NODE_ENV === 'production') {
config.plugins = config.plugins.concat(
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: true }
})
);
} else {
config.devtool = 'sourcemap';
}
module.exports = config;
|
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const config = {
entry: {
'bundle': './client/js/index.js'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
},
{
test: /\.(ttf|eot|woff|jpe?g|svg|png)$/,
loader: 'url-loader'
}
]
},
plugins: [
new CopyWebpackPlugin([
{ context: 'public', from: '**/*' }
])
]
};
if (process.env.NODE_ENV === 'production') {
config.plugins = config.plugins.concat(
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: true }
})
);
} else {
config.devtool = 'sourcemap';
}
module.exports = config;
|
Use production build of React when deploying
|
Use production build of React when deploying
|
JavaScript
|
mit
|
flammenmensch/proverbs-and-sayings,flammenmensch/proverbs-and-sayings
|
91a006a3795d177d4ed12b380f43f7227d654de7
|
webpack.config.js
|
webpack.config.js
|
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: [
'./examples/index'
],
output: {
path: path.join(__dirname, 'examples'),
filename: 'bundle.js',
},
resolveLoader: {
modulesDirectories: ['node_modules']
},
resolve: {
extensions: ['', '.js', '.cjsx', '.coffee']
},
module: {
loaders: [
{ test: /\.css$/, loaders: ['style', 'css']},
{ test: /\.cjsx$/, loaders: ['coffee', 'cjsx']},
{ test: /\.coffee$/, loader: 'coffee' }
]
}
};
|
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: [
'./examples/index'
],
output: {
path: path.join(__dirname, 'examples'),
filename: 'bundle.js',
},
resolveLoader: {
modulesDirectories: ['node_modules']
},
resolve: {
extensions: ['', '.js', '.cjsx', '.coffee']
},
plugins: [
new webpack.DefinePlugin({'process.env.NODE_ENV': '"production"'})
],
module: {
loaders: [
{ test: /\.css$/, loaders: ['style', 'css']},
{ test: /\.cjsx$/, loaders: ['coffee', 'cjsx']},
{ test: /\.coffee$/, loader: 'coffee' }
]
}
};
|
Build in production mode so React includes less
|
Build in production mode so React includes less
|
JavaScript
|
mit
|
idolize/react-spinkit,KyleAMathews/react-spinkit,pieter-lazzaro/react-spinkit
|
3839cf5bd8fa7b54ec3f06b2c27e97fbe2ccd0ec
|
src/components/HueResult.js
|
src/components/HueResult.js
|
import React, {Component} from 'react';
import Chart from './Chart'
class HueResult extends Component {
constructor(props) {
super(props);
}
render(){
return (
<div>
<h1>Results</h1>
<Chart {...this.props}/>
</div>
);
}
}
export default HueResult;
|
import React, {Component} from 'react';
import Chart from './Chart'
class HueResult extends Component {
constructor(props) {
super(props);
}
render(){
return (
<div className="hue-results">
<h1>Results</h1>
<Chart {...this.props}/>
<div id="hue-interpretation">
<h2>Results interpretation:</h2>
Bla bla bla, blu blu blu, bli bli bli...
</div>
<div id="hue-about">
<h2>About this test:</h2>
This test measures your ability to make color discrimination (color aptitude), rather than detecting color blindness.
Color discrimination is a trainable skill that is also affected be external effects such as neurological conditions or aging.
</div>
</div>
);
}
}
export default HueResult;
|
Add copy to hue restults page.
|
Add copy to hue restults page.
|
JavaScript
|
mit
|
FilmonFeMe/coloreyes,FilmonFeMe/coloreyes
|
e905ad177f78ad40a7b8472c5e852ffc2de07471
|
aura-components/src/main/components/ui/outputText/outputTextRenderer.js
|
aura-components/src/main/components/ui/outputText/outputTextRenderer.js
|
/*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless 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.
*/
{
render: function(cmp, helper) {
var value = cmp.get('v.value');
var ret = this.superRender();
var span = cmp.find('span').getElement();
helper.appendTextElements(value, span);
return ret;
},
rerender: function(cmp, helper) {
var value = cmp.getValue('v.value');
if (value.isDirty()) {
var span = cmp.find('span').getElement();
helper.removeChildren(span);
helper.appendTextElements(value.getValue(), span);
}
this.superRerender();
}
}
|
/*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless 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.
*/
{
render: function(cmp, helper) {
var value = cmp.get('v.value');
var ret = this.superRender();
var span = cmp.find('span').getElement();
helper.appendTextElements(value, span);
return ret;
},
rerender: function(cmp, helper) {
var value = cmp.getValue('v.value');
var dirty = true;
var unwrapped = "";
//
// Very careful with value here, if it is unset, we don't want
// to fail in an ugly way.
//
if (value) {
dirty = value.isDirty();
if (dirty) {
unwrapped = value.getValue();
}
} else {
$A.warning("Component has v.value unset: "+cmp.getGlobalId());
}
if (dirty) {
var span = cmp.find('span').getElement();
helper.removeChildren(span);
helper.appendTextElements(unwrapped, span);
}
this.superRerender();
}
}
|
Make output text not die on null value.
|
Make output text not die on null value.
@bug W-@
@rev eric.anderson@
|
JavaScript
|
apache-2.0
|
badlogicmanpreet/aura,madmax983/aura,SalesforceSFDC/aura,TribeMedia/aura,lcnbala/aura,badlogicmanpreet/aura,SalesforceSFDC/aura,madmax983/aura,navyliu/aura,igor-sfdc/aura,DebalinaDey/AuraDevelopDeb,forcedotcom/aura,SalesforceSFDC/aura,madmax983/aura,navyliu/aura,igor-sfdc/aura,TribeMedia/aura,lhong375/aura,igor-sfdc/aura,forcedotcom/aura,SalesforceSFDC/aura,SalesforceSFDC/aura,lhong375/aura,badlogicmanpreet/aura,badlogicmanpreet/aura,DebalinaDey/AuraDevelopDeb,DebalinaDey/AuraDevelopDeb,navyliu/aura,navyliu/aura,lhong375/aura,lcnbala/aura,navyliu/aura,lcnbala/aura,DebalinaDey/AuraDevelopDeb,badlogicmanpreet/aura,TribeMedia/aura,igor-sfdc/aura,madmax983/aura,TribeMedia/aura,forcedotcom/aura,lcnbala/aura,igor-sfdc/aura,DebalinaDey/AuraDevelopDeb,navyliu/aura,TribeMedia/aura,forcedotcom/aura,madmax983/aura,TribeMedia/aura,SalesforceSFDC/aura,DebalinaDey/AuraDevelopDeb,lcnbala/aura,lhong375/aura,madmax983/aura,forcedotcom/aura,lcnbala/aura,badlogicmanpreet/aura
|
0b03bc33b13dcf1a9deb4f4a7435ec77f3308371
|
app/components/bd-arrival.js
|
app/components/bd-arrival.js
|
import Ember from 'ember';
import moment from 'moment';
import stringToHue from 'bus-detective/utils/string-to-hue';
var inject = Ember.inject;
export default Ember.Component.extend({
tagName: 'li',
clock: inject.service(),
attributeBindings: ['style'],
classNames: ['timeline__event'],
classNameBindings: ['isPast:arrival--past'],
timeFromNow: Ember.computed('clock.time', function() {
return moment(this.get('arrival.time')).fromNow('mm');
}),
arrivalTime: Ember.computed('clock.time', function () {
return moment(this.get('arrival.time')).format('h:mm');
}),
isPast: Ember.computed('clock.time', function() {
return new Date(this.get('arrival.time')) < new Date();
}),
});
|
import Ember from 'ember';
import moment from 'moment';
import stringToHue from 'bus-detective/utils/string-to-hue';
var inject = Ember.inject;
export default Ember.Component.extend({
tagName: 'li',
clock: inject.service(),
attributeBindings: ['style'],
classNames: ['timeline__event'],
classNameBindings: ['isPast:event--past'],
timeFromNow: Ember.computed('clock.time', function() {
return moment(this.get('arrival.time')).fromNow();
}),
arrivalTime: Ember.computed('clock.time', function () {
return moment(this.get('arrival.time')).format('h:mm');
}),
isPast: Ember.computed('clock.time', function() {
return new Date(this.get('arrival.time')) < new Date();
}),
});
|
Apply ghosted styles to past arrivals
|
Apply ghosted styles to past arrivals
|
JavaScript
|
mit
|
bus-detective/web-client,bus-detective/web-client
|
658812bb2ec2a3423e7c3cb0ff676e1e7b5d1f35
|
main.js
|
main.js
|
require(
{
paths: {
assert: 'src/assert',
bunit: 'src/bunit'
}
},
['bunit', 'tests/tests'],
function(bunit, tests) {
require.ready(function() {
var r = bunit.runner();
r.defaultUI();
r.run();
});
}
);
|
require(
{
paths: {
assert: 'src/assert',
bunit: 'src/bunit'
},
urlArgs: "bust=" + (new Date()).getTime()
},
['bunit', 'tests/tests'],
function(bunit, tests) {
require.ready(function() {
var r = bunit.runner();
r.defaultUI();
r.run();
});
}
);
|
Set up cache buster to RequireJS
|
Set up cache buster to RequireJS
|
JavaScript
|
mit
|
bebraw/bunit.js
|
9dfd7d6b5cf4f56b3d2aac4e6f97ff1c2986ee6e
|
main.js
|
main.js
|
var googleapis = require('googleapis');
/*
Example of using google apis module to discover the URL shortener module, and shorten
a url
@param params.url : the URL to shorten
*/
exports.googleapis = function(params, cb) {
googleapis.withOpts({ cache: { path: 'public' }}).discover('urlshortener', 'v1').execute(function(err, client) {
console.log('executing');
console.log('dirname is ' + __dirname);
var req1 = client.urlshortener.url.insert({
longUrl: params.url || 'https://www.feedhenry.com'
});
console.log(req1);
req1.withApiKey( << place google API key here >> );
req1.execute(function(err, response) {
console.log(err);
console.log('Short URL is', response.id);
return cb(null, response);
});
});
};
|
var googleapis = require('googleapis');
/*
Example of using google apis module to discover the URL shortener module, and shorten
a url
@param params.url : the URL to shorten
*/
exports.googleapis = function(params, cb) {
// Note that, a folder named 'public' must be present in the same folder for the cache: { path: 'public' } option to work.
googleapis.withOpts({ cache: { path: 'public' }}).discover('urlshortener', 'v1').execute(function(err, client) {
console.log('executing');
console.log('dirname is ' + __dirname);
var req1 = client.urlshortener.url.insert({
longUrl: params.url || 'https://www.feedhenry.com'
});
console.log(req1);
req1.withApiKey( << place google API key here >> );
req1.execute(function(err, response) {
console.log(err);
console.log('Short URL is', response.id);
return cb(null, response);
});
});
};
|
Add comment before googleapis.discover call
|
Add comment before googleapis.discover call
|
JavaScript
|
mit
|
RHMAP-Support/URL_shortener,RHMAP-Support/URL_shortener
|
32db1c929c2a7bf2bd78acf2553cd74a30fde81e
|
lib/taskManager.js
|
lib/taskManager.js
|
var schedule = require('node-schedule');
var syncTask = require('./tasks/sync');
// Update entries every 30 minutes
schedule.scheduleJob('0,30 * * * *', syncTask);
|
var
schedule = require('node-schedule'),
syncTask = require('./tasks/sync');
// Tasks to run on startup
syncTask();
// Update entries every 30 minutes and boot
schedule.scheduleJob('0,30 * * * *', syncTask);
|
Add sync to start up tasks
|
Add sync to start up tasks
|
JavaScript
|
mit
|
web-audio-components/web-audio-components-service
|
18fe24f19444d24f1b453e6fcd908eddcff4165a
|
rollup.binary.config.js
|
rollup.binary.config.js
|
export default {
input: 'bin/capnpc-es.js',
output: {
file: 'dist/bin/capnpc-es.js',
format: 'cjs'
}
};
|
export default {
input: 'bin/capnpc-es.js',
output: {
file: 'dist/bin/capnpc-es.js',
format: 'cjs',
banner: '#! /usr/bin/env node\n'
}
};
|
Add shebang to the binary file
|
Add shebang to the binary file
|
JavaScript
|
mit
|
mattyclarkson/capnp-es
|
867325b8ffd256a481983966da69edfc0981ef6c
|
addon/components/bs4/bs-navbar.js
|
addon/components/bs4/bs-navbar.js
|
import Ember from 'ember';
import Navbar from 'ember-bootstrap/components/base/bs-navbar';
export default Navbar.extend({
classNameBindings: ['breakpointClass', 'backgroundClass'],
/**
* Defines the responsive toggle breakpoint size. Options are the standard
* two character Bootstrap size abbreviations. Used to set the `navbar-toggleable-*`
* class.
*
* @property toggleBreakpoint
* @type String
* @default 'md'
* @public
*/
toggleBreakpoint: 'md',
/**
* Sets the background color for the navbar. Can be any color
* in the set that composes the `bg-*` classes.
*
* @property backgroundColor
* @type String
* @default 'faded'
* @public
*/
backgroundColor: 'faded',
breakpointClass: Ember.computed('toggleBreakpoint', function() {
let toggleBreakpoint = this.get('toggleBreakpoint');
return `navbar-toggleable-${toggleBreakpoint}`;
}),
backgroundClass: Ember.computed('backgroundColor', function() {
let backgroundColor = this.get('backgroundColor');
return `bg-${backgroundColor}`;
})
});
|
import Ember from 'ember';
import Navbar from 'ember-bootstrap/components/base/bs-navbar';
export default Navbar.extend({
classNameBindings: ['breakpointClass', 'backgroundClass'],
type: 'light',
/**
* Defines the responsive toggle breakpoint size. Options are the standard
* two character Bootstrap size abbreviations. Used to set the `navbar-toggleable-*`
* class.
*
* @property toggleBreakpoint
* @type String
* @default 'md'
* @public
*/
toggleBreakpoint: 'md',
/**
* Sets the background color for the navbar. Can be any color
* in the set that composes the `bg-*` classes.
*
* @property backgroundColor
* @type String
* @default 'faded'
* @public
*/
backgroundColor: 'faded',
breakpointClass: Ember.computed('toggleBreakpoint', function() {
let toggleBreakpoint = this.get('toggleBreakpoint');
return `navbar-toggleable-${toggleBreakpoint}`;
}),
backgroundClass: Ember.computed('backgroundColor', function() {
let backgroundColor = this.get('backgroundColor');
return `bg-${backgroundColor}`;
})
});
|
Make `navbar-light` the default type class.
|
Make `navbar-light` the default type class.
|
JavaScript
|
mit
|
kaliber5/ember-bootstrap,kaliber5/ember-bootstrap,jelhan/ember-bootstrap,jelhan/ember-bootstrap
|
a2eabdfe43c47342201466d0ded6392964bca4cb
|
src/browser/extension/devtools/index.js
|
src/browser/extension/devtools/index.js
|
chrome.devtools.panels.create(
'Redux', null, 'devpanel.html', function(panel) {}
);
|
chrome.devtools.panels.create(
'Redux', 'img/scalable.png', 'devpanel.html', function(panel) {}
);
|
Add the icon to the devtools panel
|
Add the icon to the devtools panel
Related to #95.
|
JavaScript
|
mit
|
zalmoxisus/redux-devtools-extension,zalmoxisus/redux-devtools-extension
|
4197b869b65dba800fbf16c5e96088735a6c4c35
|
lib/factory_boy.js
|
lib/factory_boy.js
|
FactoryBoy = {};
FactoryBoy._factories = [];
Factory = function (name, collection, attributes) {
this.name = name;
this.collection = collection;
this.attributes = attributes;
};
FactoryBoy.define = function (name, collection, attributes) {
var factory = new Factory(name, collection, attributes);
for (var i = 0; i < this._factories.length; i++) {
if (this._factories[i].name === name) {
throw new Error('A factory named ' + name + ' already exists');
}
}
FactoryBoy._factories.push(factory);
};
FactoryBoy._getFactory = function (name) {
var factory = _.findWhere(FactoryBoy._factories, {name: name});
if (! factory) {
throw new Error('Could not find the factory by that name');
}
return factory;
};
FactoryBoy.create = function (name, newAttr) {
var factory = this._getFactory(name);
var collection = factory.collection;
// Allow to overwrite the attribute definitions
var attr = _.merge({}, factory.attributes, newAttr);
var docId = collection.insert(attr);
var doc = collection.findOne(docId);
return doc;
};
FactoryBoy.build = function (name, newAttr) {
var factory = this._getFactory(name);
var doc = _.merge({}, factory.attributes, newAttr);
return doc;
};
|
FactoryBoy = {};
FactoryBoy._factories = [];
Factory = function (name, collection, attributes) {
this.name = name;
this.collection = collection;
this.attributes = attributes;
};
FactoryBoy.define = function (name, collection, attributes) {
var factory = new Factory(name, collection, attributes);
for (var i = 0; i < this._factories.length; i++) {
if (this._factories[i].name === name) {
throw new Error('A factory named ' + name + ' already exists');
}
}
FactoryBoy._factories.push(factory);
};
FactoryBoy._getFactory = function (name) {
var factory = _.findWhere(FactoryBoy._factories, {name: name});
if (! factory) {
throw new Error('Could not find the factory named ' + name);
}
return factory;
};
FactoryBoy.create = function (name, newAttr) {
var factory = this._getFactory(name);
var collection = factory.collection;
// Allow to overwrite the attribute definitions
var attr = _.merge({}, factory.attributes, newAttr);
var docId = collection.insert(attr);
var doc = collection.findOne(docId);
return doc;
};
FactoryBoy.build = function (name, newAttr) {
var factory = this._getFactory(name);
var doc = _.merge({}, factory.attributes, newAttr);
return doc;
};
|
Make error message more helpful by providing name
|
Make error message more helpful by providing name
|
JavaScript
|
mit
|
sungwoncho/factory-boy
|
35ce9b283e9e19bc752a661ca608d5a3dacc292d
|
src/js/showcase-specials.js
|
src/js/showcase-specials.js
|
/**
*
*
* Shows: special features for models
* Requires:
**/
showcase.specials = {}
showcase.specials.inlinespace = 'inlinespace__'
showcase.specials.onLoaded = function () {
var skin_shape = $('x3d Shape#'+showcase.specials.inlinespace+'headskin_1');
if(skin_shape.length) {
$('#tool-list').append($('<li class="navbar-li"/>').append($('<input id="skin-fade-slider"/>')).append($('<b>Fade skin</b>').css('margin', '15px')))
$('#skin-fade-slider').slider({
min: 0
,max: 100
,step: 1
,value: 100
})
.on('slide', function () {
var val = $('#skin-fade-slider').slider('getValue')
if(val == 100) {
showcase.highlighter.setMaterial(skin_shape, $(''));
} else {
showcase.highlighter.setMaterial(skin_shape, $('<Material/>').attr('transparency', (100-val)/100));
}
})
}
};
showcase.addEventListener('load', showcase.specials.onLoaded);
$(document).ready( function () {
});
|
/**
*
*
* Shows: special features for models
* Requires:
**/
showcase.specials = {}
showcase.specials.inlinespace = 'inlinespace__'
showcase.specials.onLoaded = function () {
var skin_shape = $('x3d Shape#'+showcase.specials.inlinespace+'headskin_1');
if(skin_shape.length) {
$('#tool-list').append($('<li class="navbar-li"/>').append($('<input id="skin-fade-slider"/>')).append($('<b>Fade skin</b>').css('margin', '15px')))
$('#skin-fade-slider').slider({
min: 0
,max: 100
,step: 1
,value: 100
})
.on('slide', function () {
var val = $('#skin-fade-slider').slider('getValue')
if(val == 100) {
showcase.highlighter.setMaterial(skin_shape, $(''));
} else {
showcase.highlighter.setMaterial(skin_shape, $('<Material/>').attr('transparency', (100-val)/100));
}
})
}
// reverse material-deletion from highlighting
var no_texture_shape = $('x3d Shape#'+showcase.specials.inlinespace+'no_texture')
if(no_texture_shape.length) {
no_texture_shape.first().prepend('<Appearance><Material></Material></Appearance>')
}
};
showcase.addEventListener('load', showcase.specials.onLoaded);
|
Test for a model without texture
|
Test for a model without texture
|
JavaScript
|
apache-2.0
|
rwth-acis/Anatomy2.0,rwth-acis/Anatomy2.0,rwth-acis/Anatomy2.0,rwth-acis/Anatomy2.0
|
cb8176a827b25f7e148606da45a62a312a1018a1
|
libs/model/user.js
|
libs/model/user.js
|
var mongoose = require('mongoose'),
crypto = require('crypto'),
Schema = mongoose.Schema,
User = new Schema({
username: {
type: String,
unique: true,
required: true
},
hashedPassword: {
type: String,
required: true
},
salt: {
type: String,
required: true
},
created: {
type: Date,
default: Date.now
}
});
User.methods.encryptPassword = function(password) {
return crypto.createHmac('sha1', this.salt).update(password).digest('hex');
//more secure - return crypto.pbkdf2Sync(password, this.salt, 10000, 512).toString('base64').replace(/\//g,'_').replace(/\+/g,'-');
};
User.virtual('userId')
.get(function () {
return this.id;
});
User.virtual('password')
.set(function(password) {
this._plainPassword = password;
this.salt = crypto.randomBytes(32).toString('hex');
//more secure - this.salt = crypto.randomBytes(128).toString('hex');
this.hashedPassword = this.encryptPassword(password);
})
.get(function() { return this._plainPassword; });
User.methods.checkPassword = function(password) {
return this.encryptPassword(password) === this.hashedPassword;
};
module.exports = mongoose.model('User', User);
|
var mongoose = require('mongoose'),
crypto = require('crypto'),
Schema = mongoose.Schema,
User = new Schema({
username: {
type: String,
unique: true,
required: true
},
hashedPassword: {
type: String,
required: true
},
salt: {
type: String,
required: true
},
created: {
type: Date,
default: Date.now
}
});
User.methods.encryptPassword = function(password) {
return crypto.createHmac('sha1', this.salt).update(password).digest('hex');
//more secure - return crypto.pbkdf2Sync(password, this.salt, 10000, 512).toString('hex');
};
User.virtual('userId')
.get(function () {
return this.id;
});
User.virtual('password')
.set(function(password) {
this._plainPassword = password;
this.salt = crypto.randomBytes(32).toString('hex');
//more secure - this.salt = crypto.randomBytes(128).toString('hex');
this.hashedPassword = this.encryptPassword(password);
})
.get(function() { return this._plainPassword; });
User.methods.checkPassword = function(password) {
return this.encryptPassword(password) === this.hashedPassword;
};
module.exports = mongoose.model('User', User);
|
Change secure hash example to output hex
|
Change secure hash example to output hex
|
JavaScript
|
mit
|
MichalTuleja/jdl-backend,ealeksandrov/NodeAPI
|
6511caef65366b09792d566fc3184ba88fe6f211
|
app/core/views/MapBrowseLayout.js
|
app/core/views/MapBrowseLayout.js
|
define(['backbone', 'core/views/MapView', 'hbs!core/templates/map-browse'], function(Backbone, MapView, mapBrowseTemplate) {
var MapBrowseLayout = Backbone.View.extend({
manage: true,
template: mapBrowseTemplate,
className: 'map-browse-layout',
name: 'MapBrowseLayout',
views: {
".content-map": new MapView()
}
});
return MapBrowseLayout;
});
|
define(['backbone', 'core/views/MapView', 'hbs!core/templates/map-browse'], function(Backbone, MapView, mapBrowseTemplate) {
var MapBrowseLayout = Backbone.Layout.extend({
manage: true,
template: mapBrowseTemplate,
className: 'map-browse-layout',
name: 'MapBrowseLayout',
beforeRender: function() {
this.setView(".content-map", new MapView());
}
});
return MapBrowseLayout;
});
|
Create the MapView on beforeRender
|
Create the MapView on beforeRender
This was the source of much confusion. Think of the previous code as
having mapView as a class attribute. Meaning it wasn't being correctly
removed from the app.
|
JavaScript
|
apache-2.0
|
ox-it/moxie-js-client,ox-it/moxie-js-client,ox-it/moxie-js-client,ox-it/moxie-js-client
|
2f9172dd0c6a5433592b97e5fc203640869654e6
|
app/controllers/home.js
|
app/controllers/home.js
|
import Ember from 'ember';
import $ from 'jquery';
export default Ember.Controller.extend({
spendingsMeter: 0.00,
sumByCategory: null,
watchAddSpending: function () {
this.updateSpendingsMeter();
}.observes('model.@each'),
updateSpendingsMeter () {
let sumCounted = 0;
let sumByCategory = [];
this.get('model').forEach(item => {
let sum = item.get('sum');
let category = item.get('category');
if (sumByCategory.findBy('category', category)) {
sumByCategory.findBy('category', category).sum += parseFloat(sum);
} else {
sumByCategory.pushObject({
category,
sum: parseFloat(sum)
});
}
sumCounted += parseFloat(sum);
});
this.set('spendingsMeter', sumCounted);
this.set('sumByCategory', sumByCategory);
return;
},
saveRecord (record) {
let newExpense = this.store.createRecord('expense', record);
newExpense.save();
}
}
});
|
import Ember from 'ember';
import $ from 'jquery';
export default Ember.Controller.extend({
spendingsMeter: 0.00,
sumByCategory: null,
watchAddSpending: function () {
this.updateSpendingsMeter();
}.observes('model.@each'),
updateSpendingsMeter () {
let sumCounted = 0;
let sumByCategory = [];
this.get('model').forEach(item => {
let sum = item.get('sum');
let category = item.get('category');
if (sumByCategory.findBy('category', category)) {
sumByCategory.findBy('category', category).sum += parseFloat(sum);
} else {
sumByCategory.pushObject({
category,
sum: parseFloat(sum)
});
}
sumCounted += parseFloat(sum);
});
this.set('spendingsMeter', sumCounted);
this.set('sumByCategory', sumByCategory);
return;
},
formatedChartData: function () {
const data = [
['Category', 'Spendings']
];
this.get('sumByCategory').forEach(category => {
data.push(
[category.category, category.sum]
);
});
return data;
}.property('sumByCategory'),
saveRecord (record) {
let newExpense = this.store.createRecord('expense', record);
newExpense.save();
}
}
});
|
Format pie-date to proper format each time model change
|
feat: Format pie-date to proper format each time model change
|
JavaScript
|
mit
|
pe1te3son/spendings-tracker,pe1te3son/spendings-tracker
|
a4cb20d83dab1560e42b4ff538b8971245ab20ef
|
app/users/user-links.directive.js
|
app/users/user-links.directive.js
|
{
angular.module('meganote.users')
.directive('userLinks', [
'CurrentUser',
(CurrentUser) => {
class UserLinksController {
user() {
return CurrentUser.get();
}
signedIn() {
return CurrentUser.signedIn();
}
}
return {
scope: {},
controller: UserLinksController,
controllerAs: 'vm',
bindToController: true,
template: `
<div class="user-links">
<span ng-show="vm.signedIn()">
Signed in as {{ vm.user().name }}
</span>
<span ng-show="!vm.signedIn()">
<a ui-sref="sign-up">Sign up for Meganote today!</a>
</span>
</div>
`
};
}
]);
}
|
{
angular.module('meganote.users')
.directive('userLinks', [
'AuthToken',
'CurrentUser',
(AuthToken, CurrentUser) => {
class UserLinksController {
user() {
return CurrentUser.get();
}
signedIn() {
return CurrentUser.signedIn();
}
logout() {
CurrentUser.clear();
AuthToken.clear();
}
}
return {
scope: {},
controller: UserLinksController,
controllerAs: 'vm',
bindToController: true,
template: `
<div class="user-links">
<span ng-show="vm.signedIn()">
Signed in as {{ vm.user().name }}
|
<a ui-sref="sign-up" ng-click="vm.logout()">Logout</a>
</span>
<span ng-show="!vm.signedIn()">
<a ui-sref="sign-up">Sign up for Meganote today!</a>
</span>
</div>
`
};
}
]);
}
|
Add a working logout link.
|
Add a working logout link.
|
JavaScript
|
mit
|
xternbootcamp16/meganote,xternbootcamp16/meganote
|
2c2acda39035ee78daab8e3bcb658696533b1c36
|
webpack.config.js
|
webpack.config.js
|
var webpack = require("webpack");
var CopyWebpackPlugin = require("copy-webpack-plugin");
var path = require("path");
module.exports = {
entry: "./src/com/mendix/widget/badge/Badge.ts",
output: {
path: __dirname + "/dist/tmp",
filename: "src/com/mendix/widget/badge/Badge.js",
libraryTarget: "umd",
umdNamedDefine: true,
library: "com.mendix.widget.badge.Badge"
},
resolve: {
extensions: [ "", ".ts", ".js", ".json" ]
},
errorDetails: true,
module: {
loaders: [
{ test: /\.ts$/, loaders: [ "ts-loader" ] },
{ test: /\.json$/, loader: "json" }
]
},
devtool: "source-map",
externals: [ "mxui/widget/_WidgetBase", "dojo/_base/declare" ],
plugins: [
new CopyWebpackPlugin([
{ from: "src/**/*.js" },
{ from: "src/**/*.xml" },
{ from: "src/**/*.css" }
], {
copyUnmodified: true
})
],
watch: true
};
|
var webpack = require("webpack");
var CopyWebpackPlugin = require("copy-webpack-plugin");
var path = require("path");
module.exports = {
entry: "./src/com/mendix/widget/badge/Badge.ts",
output: {
path: __dirname + "/dist/tmp",
filename: "src/com/mendix/widget/badge/Badge.js",
libraryTarget: "umd"
},
resolve: {
extensions: [ "", ".ts", ".js", ".json" ]
},
errorDetails: true,
module: {
loaders: [
{ test: /\.ts$/, loaders: [ "ts-loader" ] },
{ test: /\.json$/, loader: "json" }
]
},
devtool: "source-map",
externals: [ "mxui/widget/_WidgetBase", "dojo/_base/declare" ],
plugins: [
new CopyWebpackPlugin([
{ from: "src/**/*.js" },
{ from: "src/**/*.xml" },
{ from: "src/**/*.css" }
], {
copyUnmodified: true
})
],
watch: true
};
|
Remove named define for webpack
|
Remove named define for webpack
|
JavaScript
|
apache-2.0
|
mendixlabs/badge,mendixlabs/badge
|
6da8f2e871e0b3c30debd93fe22df630a5b27db0
|
webpack.config.js
|
webpack.config.js
|
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
home: path.join(__dirname, 'app/src/home'),
},
module: {
loaders: [
{
test: /\.sass$/,
loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: 'node_modules',
query: { presets: ['es2015'] },
},
{
test: /\.(ttf|woff|woff2)$/,
loader: 'file',
query: { name: 'fonts/[name].[ext]' },
},
{
test: /\.png$/,
loader: 'file',
},
{
test: /\.html$/,
loader: 'file-loader?name=[name].[ext]!extract-loader!html-loader',
},
],
},
output: {
path: path.join(__dirname, 'app/build'),
publicPath: '/',
filename: '[name].js',
},
plugins: [
new webpack.optimize.UglifyJsPlugin({ minimize: true, compress: { warnings: false } }),
],
// --------------------------------------------------------------------------
devServer: {
contentBase: path.join(__dirname, 'app/build'),
},
};
|
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
home: path.join(__dirname, 'app/src/home'),
},
module: {
loaders: [
{
test: /\.sass$/,
loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: 'node_modules',
query: { presets: ['es2015'] },
},
{
test: /\.(ttf|woff|woff2)$/,
loader: 'file',
query: { name: 'fonts/[name].[ext]' },
},
{
test: /\.png$/,
loader: 'file',
},
{
test: /\.html$/,
loader: 'file-loader?name=[name].[ext]!extract-loader!html-loader',
},
],
},
output: {
path: path.join(__dirname, 'app/build'),
publicPath: '/',
filename: '[name].js',
},
plugins: [
new webpack.optimize.UglifyJsPlugin({ minimize: true, compress: { warnings: false } }),
],
// --------------------------------------------------------------------------
devServer: {
contentBase: path.join(__dirname, 'app/build'),
inline: true,
},
};
|
Add --inline autorefreshing to webpack dev server
|
Add --inline autorefreshing to webpack dev server
|
JavaScript
|
mit
|
arkis/arkis.io,arkis/arkis.io
|
9e80530cde993e07333bcdecde6cccf658c52a4a
|
webpack.config.js
|
webpack.config.js
|
/* global require, module, __dirname */
const path = require( 'path' );
module.exports = {
entry: {
'./assets/js/amp-blocks-compiled': './blocks/index.js',
'./assets/js/amp-block-editor-toggle-compiled': './assets/src/amp-block-editor-toggle.js',
'./assets/js/amp-validation-error-detail-toggle-compiled': './assets/src/amp-validation-error-detail-toggle.js'
},
output: {
path: path.resolve( __dirname ),
filename: '[name].js'
},
externals: {
'@wordpress/dom-ready': 'wp.domReady',
'amp-validation-i18n': 'ampValidationI18n'
},
devtool: 'cheap-eval-source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader'
}
}
]
}
};
|
/* global require, module, __dirname */
const path = require( 'path' );
module.exports = {
entry: {
'./assets/js/amp-blocks-compiled': './blocks/index.js',
'./assets/js/amp-block-editor-toggle-compiled': './assets/src/amp-block-editor-toggle.js',
'./assets/js/amp-validation-error-detail-toggle-compiled': './assets/src/amp-validation-error-detail-toggle.js'
},
output: {
path: path.resolve( __dirname ),
filename: '[name].js'
},
externals: {
'amp-validation-i18n': 'ampValidationI18n'
},
devtool: 'cheap-eval-source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader'
}
}
]
}
};
|
Implement workaround to fix JS not loading issue
|
Implement workaround to fix JS not loading issue
|
JavaScript
|
apache-2.0
|
GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp
|
70bce90b7f1df2bbcbf9bfd4a638a20952b3bc33
|
webpack.config.js
|
webpack.config.js
|
'use strict';
var webpack = require('webpack');
var LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
var env = process.env.NODE_ENV;
var reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
};
var reactDomExternal = {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
};
var config = {
externals: {
react: reactExternal,
reactDom: reactDomExternal
},
module: {
loaders: [
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ },
{ test: /\.jsx$/, loaders: ['babel-loader'], exclude: /node_modules/ }
]
},
output: {
library: 'ReactWebAnimation',
libraryTarget: 'umd'
},
plugins: [
new LodashModuleReplacementPlugin(),
new webpack.EnvironmentPlugin([
"NODE_ENV"
])
]
};
if ( env === 'production' ) {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
screw_ie8: true,
warnings: false
}
})
);
}
module.exports = config;
|
'use strict';
var webpack = require('webpack');
var LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
var env = process.env.NODE_ENV;
var reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
};
var reactDomExternal = {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
};
var config = {
externals: {
react: reactExternal,
reactDom: reactDomExternal
},
module: {
loaders: [
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ },
{ test: /\.jsx$/, loaders: ['babel-loader'], exclude: /node_modules/ }
]
},
output: {
library: {
root: 'ReactWebAnimation',
amd: 'react-web-animation',
},
libraryTarget: 'umd',
umdNamedDefine: true,
},
plugins: [
new LodashModuleReplacementPlugin(),
new webpack.EnvironmentPlugin([
"NODE_ENV"
])
]
};
if ( env === 'production' ) {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
screw_ie8: true,
warnings: false
}
})
);
}
module.exports = config;
|
Include module name in AMD definition
|
feat(repo): Include module name in AMD definition
RequireJS needs to know which name to register an AMD module under. The name was previously mixing; this PR fixes that.
|
JavaScript
|
mit
|
RinconStrategies/react-web-animation,RinconStrategies/react-web-animation,bringking/react-web-animation
|
0ed54d51529f68fda56ad2da8f169e6dea8e5584
|
troposphere/static/js/components/images/search_results.js
|
troposphere/static/js/components/images/search_results.js
|
define(['react'], function(React) {
var SearchResults = React.createClass({
render: function() {
return React.DOM.div({}, this.props.query);
}
});
return SearchResults;
});
|
define(['react', 'components/images/search',
'components/page_header', 'components/mixins/loading', 'rsvp',
'controllers/applications'], function(React, SearchBox, PageHeader,
LoadingMixin, RSVP, Images) {
var Results = React.createClass({
mixins: [LoadingMixin],
model: function() {
return Images.searchApplications(this.props.query);
},
renderContent: function() {
return React.DOM.ul({},
this.state.model.map(function(app) {
return React.DOM.li({}, app.get('name'));
}));
}
});
var SearchResults = React.createClass({
render: function() {
return React.DOM.div({},
PageHeader({title: "Image Search"}),
SearchBox({query: this.props.query}),
Results({query: this.props.query}))
}
});
return SearchResults;
});
|
Add search results to, well, search results page
|
Add search results to, well, search results page
|
JavaScript
|
apache-2.0
|
CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend
|
7700c7c436612517a03f2b7fdc7fabb7b0fd3863
|
template/app/controllers/application_controller.js
|
template/app/controllers/application_controller.js
|
const {
ActionController
} = require('backrest')
class ApplicationController extends ActionController.Base {
get before() {
return [
{ action: this._setHeaders }
]
}
constructor() {
super()
}
_setHeaders(req, res, next) {
// Example headers
// res.header("Access-Control-Allow-Origin", "*")
// res.header("Access-Control-Allow-Methods", "OPTIONS,GET,HEAD,POST,PUT,DELETE")
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
next()
}
}
module.exports = ApplicationController
|
const {
ActionController
} = require('backrest')
class ApplicationController extends ActionController.Base {
constructor() {
super()
this.beforeFilters([
{ action: this._setHeaders }
])
}
_setHeaders(req, res, next) {
// Example headers
// res.header("Access-Control-Allow-Origin", "*")
// res.header("Access-Control-Allow-Methods", "OPTIONS,GET,HEAD,POST,PUT,DELETE")
// res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
next()
}
}
module.exports = ApplicationController
|
Update controller template for proper filter usage.
|
Update controller template for proper filter usage.
|
JavaScript
|
mit
|
passabilities/backrest
|
aa967b9335eb12b9af42abf9ee248b2c7b3aa9d9
|
apps/global-game-jam-2021/routes.js
|
apps/global-game-jam-2021/routes.js
|
const routeRegex = /^\/(global-game-jam-2021|globalgamejam2021|ggj2021|ggj21)(?:\/.*)?$/;
const githubUrl = 'https://levilindsey.github.io/global-game-jam-2021';
// Attaches the route handlers for this app.
exports.attachRoutes = (server, appPath, config) => {
server.get(routeRegex, handleRequest);
// --- --- //
// Handles a request for this app.
function handleRequest(req, res, next) {
// Check whether this request was directed to the games subdomain.
if (config.gamesDomains.indexOf(req.hostname) < 0) {
next();
return;
}
const dirs = req.path.split('/');
if (dirs[2] === '' || dirs.length === 2) {
res.redirect(githubUrl);
} else {
next();
}
}
};
|
const routeRegex = /^\/(global-game-jam-2021|globalgamejam2021|ggj2021|ggj21)(?:\/.*)?$/;
const githubUrl = 'https://levilindsey.github.io/global-game-jam-2021';
// Attaches the route handlers for this app.
exports.attachRoutes = (server, appPath, config) => {
server.get(routeRegex, handleRequest);
// --- --- //
// Handles a request for this app.
function handleRequest(req, res, next) {
// Check whether this request was directed to the portfolio.
if (config.portfolioDomains.indexOf(req.hostname) < 0) {
next();
return;
}
const dirs = req.path.split('/');
if (dirs[2] === '' || dirs.length === 2) {
res.redirect(githubUrl);
} else {
next();
}
}
};
|
Fix the ggj route setup
|
Fix the ggj route setup
|
JavaScript
|
mit
|
levilindsey/levi.sl,levilindsey/levi.sl
|
e325455147e4a0d9a02c10729a2cc45a66f149e9
|
client/js/models/shipment.js
|
client/js/models/shipment.js
|
define(['backbone'], function(Backbone) {
return Backbone.Model.extend({
idAttribute: 'SHIPPINGID',
urlRoot: '/shipment/shipments',
/*
Validators for shipment, used for both editables and new shipments
*/
validation: {
SHIPPINGNAME: {
required: true,
pattern: 'wwsdash',
},
'FCODES[]': {
required: false,
pattern: 'fcode',
},
SENDINGLABCONTACTID: {
required: true,
},
RETURNLABCONTACTID: {
required: true,
},
DELIVERYAGENT_AGENTCODE: {
required: true,
},
DELIVERYAGENT_AGENTNAME: {
required: true,
},
},
})
})
|
define(['backbone'], function(Backbone) {
return Backbone.Model.extend({
idAttribute: 'SHIPPINGID',
urlRoot: '/shipment/shipments',
/*
Validators for shipment, used for both editables and new shipments
*/
validation: {
SHIPPINGNAME: {
required: true,
pattern: 'wwsdash',
},
'FCODES[]': {
required: false,
pattern: 'fcode',
},
SENDINGLABCONTACTID: {
required: true,
},
RETURNLABCONTACTID: {
required: true,
},
DELIVERYAGENT_AGENTCODE: {
required: true,
},
DELIVERYAGENT_AGENTNAME: {
required: true,
pattern: 'wwsdash'
},
},
})
})
|
Add validator for courier name
|
Add validator for courier name
|
JavaScript
|
apache-2.0
|
DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb,tcspain/SynchWeb,DiamondLightSource/SynchWeb,tcspain/SynchWeb,tcspain/SynchWeb,tcspain/SynchWeb,tcspain/SynchWeb,tcspain/SynchWeb,DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb
|
80e679cd33528d8050097e681bad0020c2cf0a4c
|
tests/integration/components/search-result-test.js
|
tests/integration/components/search-result-test.js
|
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('search-result', 'Integration | Component | search result', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs`{{search-result}}`);
assert.equal(this.$().text().trim(), '');
});
|
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('search-result', 'Integration | Component | search result', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
let result = {
providers: []
};
this.set('result', result);
this.render(hbs`{{search-result result=result}}`);
assert.equal(this.$().text().trim(), '');
});
|
Fix CI failure due to missing thing the component needs to render
|
Fix CI failure due to missing thing the component needs to render
[ci skip]
[#PREP-135]
|
JavaScript
|
apache-2.0
|
laurenrevere/ember-preprints,pattisdr/ember-preprints,laurenrevere/ember-preprints,baylee-d/ember-preprints,pattisdr/ember-preprints,CenterForOpenScience/ember-preprints,caneruguz/ember-preprints,caneruguz/ember-preprints,CenterForOpenScience/ember-preprints,hmoco/ember-preprints,baylee-d/ember-preprints,hmoco/ember-preprints
|
75000c3d890987385e0c3a832dc0f8a5bc247146
|
app/models/chart.js
|
app/models/chart.js
|
import Model from 'ember-data/model';
import DS from 'ember-data';
import { validator, buildValidations } from 'ember-cp-validations';
const Validations = buildValidations({
title: validator('presence', true),
composers: validator('presence', true),
lyricists: validator('presence', true),
arrangers: validator('presence', true),
});
export default Model.extend(Validations, {
nomen: DS.attr('string'),
status: DS.attr('chart-status'),
title: DS.attr('string'),
arrangers: DS.attr('string'),
composers: DS.attr('string'),
lyricists: DS.attr('string'),
holders: DS.attr('string', {defaultValue:''}),
repertories: DS.hasMany('repertory', {async: true}),
songs: DS.hasMany('song', {async: true}),
permissions: DS.attr(),
});
|
import Model from 'ember-data/model';
import DS from 'ember-data';
import { validator, buildValidations } from 'ember-cp-validations';
import {memberAction} from 'ember-api-actions';
const Validations = buildValidations({
title: validator('presence', true),
composers: validator('presence', true),
lyricists: validator('presence', true),
arrangers: validator('presence', true),
});
export default Model.extend(Validations, {
nomen: DS.attr('string'),
status: DS.attr('chart-status'),
title: DS.attr('string'),
arrangers: DS.attr('string'),
composers: DS.attr('string'),
lyricists: DS.attr('string'),
holders: DS.attr('string', {defaultValue:''}),
repertories: DS.hasMany('repertory', {async: true}),
songs: DS.hasMany('song', {async: true}),
permissions: DS.attr(),
activate: memberAction({path: 'activate', type: 'post'}),
deactivate: memberAction({path: 'deactivate', type: 'post'}),
statusOptions: [
'New',
'Active',
'Inactive',
],
statusSort: Ember.computed(
'status',
'statusOptions',
function() {
return this.get('statusOptions').indexOf(this.get('status'));
}
),
});
|
Update status and Chart transitions
|
Update status and Chart transitions
|
JavaScript
|
bsd-2-clause
|
barberscore/barberscore-web,barberscore/barberscore-web,barberscore/barberscore-web
|
29b811034c553c20275231167c1c005d619be346
|
templates/urls.js
|
templates/urls.js
|
"use strict";
var URLS = (function() {
var BASE = 'https://raw.githubusercontent.com/robertpainsi/robertpainsi.github.data/master/';
return {
BASE: BASE,
PROGRAM_STATISTICS: BASE + 'catrobat/statistics/statistics.json'
};
}());
|
"use strict";
var URLS = (function() {
var BASE = 'https://raw.githubusercontent.com/robertpainsi/robertpainsi.github.data/master/';
if (location.hostname === 'robertpainsi.localhost.io') {
BASE = 'http://localhost/robertpainsi.github.data/';
}
return {
BASE: BASE,
PROGRAM_STATISTICS: BASE + 'catrobat/statistics/statistics.json'
};
}());
|
Add local base url (only used for hostname robertpainsi.localhost.io)
|
Add local base url (only used for hostname robertpainsi.localhost.io)
|
JavaScript
|
mit
|
robertpainsi/robertpainsi.github.io,robertpainsi/robertpainsi.github.io
|
b0e05495d46f45bea07de5bbdf359fdf8416c7f3
|
test/conjoiner.js
|
test/conjoiner.js
|
'use strict';
var conjoiners = require('../lib/conjoiners');
exports['simple inter-process communication'] = function(test) {
test.expect(3);
var value = 'test_value';
var cj1 = {};
var cj1Name = 'test';
var cj2 = {
onTransenlightenment: function (event) {
test.equal(event.property, 'val');
test.equal(this[event.property], value);
}
};
conjoiners.implant(cj1, 'test/conf.json', cj1Name).then(function() {
return conjoiners.implant(cj2, 'test/conf.json', 'test2');
}).then(function () {
cj1.val = value;
setTimeout(function() {
test.equal(cj2.val, value);
test.done();
}, 1500);
}).done();
};
|
'use strict';
var conjoiners = require('../lib/conjoiners');
exports['simple inter-process communication'] = function(test) {
test.expect(3);
var value = 'test_value';
var cj1 = {};
var cj1Name = 'test';
var cj2 = {
onTransenlightenment: function (event) {
test.equal(event.property, 'val');
test.equal(this[event.property], value);
test.equal(cj2.val, value);
test.done();
}
};
conjoiners.implant(cj1, 'test/conf.json', cj1Name).then(function() {
return conjoiners.implant(cj2, 'test/conf.json', 'test2');
}).then(function () {
cj1.val = value;
}).done();
};
|
Test should not rely on setTimeout
|
Test should not rely on setTimeout
|
JavaScript
|
apache-2.0
|
conjoiners/conjoiners-node.js
|
0445f6472b615cd0915ed5b681dff162986e4903
|
models/Captions.js
|
models/Captions.js
|
var mongoose = require('mongoose');
var captionSchema = new mongoose.Schema({
_id: { type: String, unique: true},
url: String,
captions: [{
start: Number,
dur: Number,
value: String,
extra_data: Array
}]
});
module.exports = mongoose.model('Caption', captionSchema);
|
var mongoose = require('mongoose');
var captionSchema = new mongoose.Schema({
_id: { type: String, unique: true},
title: String,
url: String,
captions: [{
start: Number,
dur: Number,
value: String,
extra_data: Array
}]
});
module.exports = mongoose.model('Caption', captionSchema);
|
Add title to mongoose caption schema
|
Add title to mongoose caption schema
|
JavaScript
|
mit
|
yaskyj/fastcaption,yaskyj/fastcaption,yaskyj/fastcaptions,yaskyj/fastcaptions
|
21e134c3d11e3ce688735bf1b59d37f847c19b3c
|
core/filter-options/index.js
|
core/filter-options/index.js
|
"use strict";
const dedent = require("dedent");
module.exports = filterOptions;
function filterOptions(yargs) {
// Only for 'run', 'exec', 'clean', 'ls', and 'bootstrap' commands
const opts = {
scope: {
describe: "Include only packages with names matching the given glob.",
type: "string",
},
ignore: {
describe: "Exclude packages with names matching the given glob.",
type: "string",
},
private: {
describe: "Include private packages.\nPass --no-private to exclude private packages.",
type: "boolean",
default: true,
},
since: {
describe: dedent`
Only include packages that have been updated since the specified [ref].
If no ref is passed, it defaults to the most-recent tag.
`,
type: "string",
},
"include-filtered-dependents": {
describe: dedent`
Include all transitive dependents when running a command
regardless of --scope, --ignore, or --since.
`,
type: "boolean",
},
"include-filtered-dependencies": {
describe: dedent`
Include all transitive dependencies when running a command
regardless of --scope, --ignore, or --since.
`,
type: "boolean",
},
};
return yargs.options(opts).group(Object.keys(opts), "Filter Options:");
}
|
"use strict";
const dedent = require("dedent");
module.exports = filterOptions;
function filterOptions(yargs) {
// Only for 'run', 'exec', 'clean', 'ls', and 'bootstrap' commands
const opts = {
scope: {
describe: "Include only packages with names matching the given glob.",
type: "string",
},
ignore: {
describe: "Exclude packages with names matching the given glob.",
type: "string",
},
private: {
describe: "Include private packages.\nPass --no-private to exclude private packages.",
type: "boolean",
defaultDescription: "true",
},
since: {
describe: dedent`
Only include packages that have been updated since the specified [ref].
If no ref is passed, it defaults to the most-recent tag.
`,
type: "string",
},
"include-filtered-dependents": {
describe: dedent`
Include all transitive dependents when running a command
regardless of --scope, --ignore, or --since.
`,
type: "boolean",
},
"include-filtered-dependencies": {
describe: dedent`
Include all transitive dependencies when running a command
regardless of --scope, --ignore, or --since.
`,
type: "boolean",
},
};
return yargs.options(opts).group(Object.keys(opts), "Filter Options:");
}
|
Allow --private to be configured from file
|
fix(filter-options): Allow --private to be configured from file
|
JavaScript
|
mit
|
lerna/lerna,sebmck/lerna,lerna/lerna,kittens/lerna,evocateur/lerna,lerna/lerna,evocateur/lerna
|
3483929b3b5610bc2ff17369bdcf356c1d05cc9e
|
cdn/src/app.js
|
cdn/src/app.js
|
import express from 'express';
import extensions from './extensions';
const app = express();
app.use('/extensions', extensions);
export default app;
|
import express from 'express';
import extensions from './extensions';
const app = express();
app.use('/extensions', extensions);
app.get('/', function (req, res) {
res.send('The CDN is working');
});
export default app;
|
Add text to test the server is working
|
Add text to test the server is working
|
JavaScript
|
mit
|
worona/worona-dashboard,worona/worona,worona/worona,worona/worona-core,worona/worona-dashboard,worona/worona-core,worona/worona
|
764258718d976aa826e16fd470954f18f8eabf65
|
packages/core/src/Rules/CopyTargetsToRoot.js
|
packages/core/src/Rules/CopyTargetsToRoot.js
|
/* @flow */
import path from 'path'
import State from '../State'
import File from '../File'
import Rule from '../Rule'
import type { Command, OptionsInterface, Phase } from '../types'
export default class CopyTargetsToRoot extends Rule {
static parameterTypes: Array<Set<string>> = [new Set(['*'])]
static description: string = 'Copy targets to root directory.'
static alwaysEvaluate: boolean = true
static async appliesToParameters (state: State, command: Command, phase: Phase, options: OptionsInterface, ...parameters: Array<File>): Promise<boolean> {
return !!options.copyTargetsToRoot &&
parameters.every(file => state.targets.has(file.filePath) && path.dirname(file.filePath) !== '.')
}
async initialize () {
this.removeTarget(this.firstParameter.filePath)
await this.addResolvedTarget('$BASE_0')
}
async run () {
const filePath = this.resolvePath('$ROOTDIR/$BASE_0')
await this.firstParameter.copy(filePath)
await this.getOutput(filePath)
return true
}
}
|
/* @flow */
import path from 'path'
import State from '../State'
import File from '../File'
import Rule from '../Rule'
import type { Command, OptionsInterface, Phase } from '../types'
export default class CopyTargetsToRoot extends Rule {
static parameterTypes: Array<Set<string>> = [new Set(['*'])]
static description: string = 'Copy targets to root directory.'
static alwaysEvaluate: boolean = true
static async appliesToParameters (state: State, command: Command, phase: Phase, options: OptionsInterface, ...parameters: Array<File>): Promise<boolean> {
return !!options.copyTargetsToRoot &&
parameters.every(file => !file.virtual && state.targets.has(file.filePath) && path.dirname(file.filePath) !== '.')
}
async initialize () {
// Remove the old target and replace with the new one.
this.removeTarget(this.firstParameter.filePath)
await this.addResolvedTarget('$BASE_0')
}
async run () {
// Copy the target to it's new location and add the result as an output.
const filePath = this.resolvePath('$ROOTDIR/$BASE_0')
await this.firstParameter.copy(filePath)
await this.getOutput(filePath)
return true
}
}
|
Add comments and check for virtual files
|
Add comments and check for virtual files
|
JavaScript
|
mit
|
yitzchak/ouroboros,yitzchak/ouroboros,yitzchak/dicy,yitzchak/dicy,yitzchak/dicy
|
49f1da05920d4ab335ffcd7d1be9604845f23da5
|
lib/logging.js
|
lib/logging.js
|
var Tracer = require('tracer');
function Logger (options) {
this.options = options;
this.tracer = this._setupTracer(options.enabled);
}
Logger.prototype.info = function () {
this.tracer.info.apply(this.tracer, arguments);
};
Logger.prototype.error = function (message) {
this.tracer.error(message);
}
Logger.prototype._setupTracer = function (enabled) {
var noopTransport = function () {};
var options = {};
options.format = "{{message}}";
if (!enabled) {
options.transport = noopTransport;
}
return Tracer.colorConsole(options);
}
function initTheLogger (options) {
return new Logger(options);
}
var logger;
exports.logger = function (options) {
if (!logger) {
logger = initTheLogger(options);
}
return logger;
}
|
'use strict';
var Tracer = require('tracer');
function Logger (options) {
this.options = options;
this.tracer = this._setupTracer(options.enabled);
}
Logger.prototype.info = function () {
this.tracer.info.apply(this.tracer, arguments);
};
Logger.prototype.error = function (message) {
this.tracer.error(message);
};
Logger.prototype._setupTracer = function (enabled) {
var noopTransport = function () {};
var options = {};
options.format = '{{message}}';
if (!enabled) {
options.transport = noopTransport;
}
return Tracer.colorConsole(options);
};
function initTheLogger (options) {
return new Logger(options);
}
var logger;
exports.logger = function (options) {
if (!logger) {
logger = initTheLogger(options);
}
return logger;
};
|
Make the syntax checker happy
|
Make the syntax checker happy
|
JavaScript
|
mit
|
madtrick/spr
|
599c9c809d160f0562a5e6ca69d27332585e5bc4
|
packages/core/strapi/lib/services/entity-service/attributes/transforms.js
|
packages/core/strapi/lib/services/entity-service/attributes/transforms.js
|
'use strict';
const { getOr, toNumber } = require('lodash/fp');
const bcrypt = require('bcrypt');
const transforms = {
password(value, context) {
const { action, attribute } = context;
if (action !== 'create' && action !== 'update') {
return value;
}
const rounds = toNumber(getOr(10, 'encryption.rounds', attribute));
return bcrypt.hashSync(value, rounds);
},
};
module.exports = transforms;
|
'use strict';
const { getOr, toNumber, isString, isBuffer } = require('lodash/fp');
const bcrypt = require('bcrypt');
const transforms = {
password(value, context) {
const { action, attribute } = context;
if (!isString(value) && !isBuffer(value)) {
return value;
}
if (action !== 'create' && action !== 'update') {
return value;
}
const rounds = toNumber(getOr(10, 'encryption.rounds', attribute));
return bcrypt.hashSync(value, rounds);
},
};
module.exports = transforms;
|
Handle non-string & non-buffer scenarios for the password transform
|
Handle non-string & non-buffer scenarios for the password transform
|
JavaScript
|
mit
|
wistityhq/strapi,wistityhq/strapi
|
f06ce668d3c3fb8e05139cf46e0d714f5e28aa35
|
packages/react-jsx-highcharts/test/components/BaseChart/BaseChart.spec.js
|
packages/react-jsx-highcharts/test/components/BaseChart/BaseChart.spec.js
|
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import BaseChart from '../../../src/components/BaseChart';
import { createMockChart } from '../../test-utils';
describe('<BaseChart />', function () {
describe('on mount', function () {
let clock;
let chart;
beforeEach(function () {
chart = createMockChart();
this.chartCreationFunc = sinon.stub();
this.chartCreationFunc.returns(chart);
clock = sinon.useFakeTimers();
});
afterEach(function () {
clock.restore();
});
describe('when mounted', function () {
it('should create a Highcharts chart', function () {
const wrapper = mount(<BaseChart chartCreationFunc={this.chartCreationFunc} />);
clock.tick(1);
expect(this.chartCreationFunc).to.have.been.calledWith(wrapper.getDOMNode());
});
it('should create a chart context', function () {
const wrapper = mount(<BaseChart chartCreationFunc={this.chartCreationFunc} />);
clock.tick(1);
const context = wrapper.instance().getChildContext();
expect(context.chart).to.eql(chart);
});
});
describe('when unmounted', function () {
it('destroys the chart instance', function () {
const wrapper = mount(<BaseChart chartCreationFunc={this.chartCreationFunc} />);
clock.tick(1);
expect(chart.destroy).not.to.have.been.called;
wrapper.unmount();
clock.tick(1);
expect(chart.destroy).to.have.been.called;
});
});
});
});
|
import React, { Component } from 'react';
import BaseChart from '../../../src/components/BaseChart';
import { createMockChart } from '../../test-utils';
describe('<BaseChart />', function () {
let clock;
let chart;
beforeEach(function () {
chart = createMockChart();
this.chartCreationFunc = sinon.stub();
this.chartCreationFunc.returns(chart);
clock = sinon.useFakeTimers();
});
afterEach(function () {
clock.restore();
});
describe('when mounted', function () {
it('should create a Highcharts chart', function () {
const wrapper = mount(<BaseChart chartCreationFunc={this.chartCreationFunc} />);
clock.tick(1);
expect(this.chartCreationFunc).to.have.been.calledWith(wrapper.getDOMNode());
});
it('should create a chart context', function () {
const wrapper = mount(<BaseChart chartCreationFunc={this.chartCreationFunc} />);
clock.tick(1);
const context = wrapper.instance().getChildContext();
expect(context.chart).to.eql(chart);
});
});
describe('when unmounted', function () {
it('destroys the chart instance', function () {
const wrapper = mount(<BaseChart chartCreationFunc={this.chartCreationFunc} />);
clock.tick(1);
expect(chart.destroy).not.to.have.been.called;
wrapper.unmount();
clock.tick(1);
expect(chart.destroy).to.have.been.called;
});
});
});
|
Remove unnecessary BaseChart test code
|
Remove unnecessary BaseChart test code
|
JavaScript
|
mit
|
whawker/react-jsx-highcharts,whawker/react-jsx-highcharts
|
8b15314c71e91b5c6f210915d53fb6c11a5cbce2
|
lib/assets/javascripts/cartodb3/deep-insights-integration/legend-manager.js
|
lib/assets/javascripts/cartodb3/deep-insights-integration/legend-manager.js
|
var LegendFactory = require('../editor/layers/layer-content-views/legend/legend-factory');
var onChange = function (layerDefModel) {
var styleModel = layerDefModel.styleModel;
var canSuggestLegends = LegendFactory.hasMigratedLegend(layerDefModel);
var fill;
var color;
var size;
if (!styleModel) return;
if (!canSuggestLegends) return;
LegendFactory.removeAllLegend(layerDefModel);
fill = styleModel.get('fill');
color = fill.color;
size = fill.size;
if (size && size.attribute !== undefined) {
LegendFactory.createLegend(layerDefModel, 'bubble');
}
if (color && color.attribute !== undefined) {
if (color.attribute_type && color.attribute_type === 'string') {
LegendFactory.createLegend(layerDefModel, 'category');
} else {
LegendFactory.createLegend(layerDefModel, 'choropleth');
}
}
};
module.exports = {
track: function (layerDefModel) {
layerDefModel.on('change:cartocss', onChange);
layerDefModel.on('destroy', function () {
layerDefModel.off('change:cartocss', onChange);
});
}
};
|
var LegendFactory = require('../editor/layers/layer-content-views/legend/legend-factory');
var onChange = function (layerDefModel) {
var styleModel = layerDefModel.styleModel;
var canSuggestLegends = !LegendFactory.hasMigratedLegend(layerDefModel);
var fill;
var color;
var size;
if (!styleModel) return;
if (!canSuggestLegends) return;
LegendFactory.removeAllLegend(layerDefModel);
fill = styleModel.get('fill');
if (!fill) return;
color = fill.color;
size = fill.size;
if (size && size.attribute !== undefined) {
LegendFactory.createLegend(layerDefModel, 'bubble');
}
if (color && color.attribute !== undefined) {
if (color.attribute_type && color.attribute_type === 'string') {
LegendFactory.createLegend(layerDefModel, 'category');
} else {
LegendFactory.createLegend(layerDefModel, 'choropleth');
}
}
};
module.exports = {
track: function (layerDefModel) {
layerDefModel.on('change:cartocss', onChange);
layerDefModel.on('destroy', function () {
layerDefModel.off('change:cartocss', onChange);
});
}
};
|
Fix bug in legends magic.
|
Fix bug in legends magic.
|
JavaScript
|
bsd-3-clause
|
splashblot/dronedb,splashblot/dronedb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb
|
881a22edcb6438f9d65a8794b17ae710ee44c089
|
listentotwitter/static/js/keyword-box.js
|
listentotwitter/static/js/keyword-box.js
|
function redirectKeyword(keyword) {
document.location.href = '/keyword/' + keyword;
}
$(document).ready(function() {
$('#keyword-form #keyword-input').focus();
$('#keyword-form').submit(function() {
redirectKeyword($('#keyword-form #keyword-input').val());
});
$('#keyword-form #keyword-input').focus(function() {
if (this.setSelectionRange) {
var len = $(this).val().length * 2;
this.setSelectionRange(len, len);
} else {
$(this).val($(this).val());
}
});
$('#keyword-form #keyword-input').trigger('focus');
});
|
function redirectKeyword(keyword) {
document.location.href = '/keyword/' + keyword;
}
$(document).ready(function() {
$('#keyword-form #keyword-input').focus();
$('#keyword-form').submit(function() {
redirectKeyword($('#keyword-form #keyword-input').val());
});
$('#keyword-form #keyword-input').focus(function() {
$(this).select();
});
$('#keyword-form #keyword-input').trigger('focus');
});
|
Select text instead of move cursor to the end
|
Select text instead of move cursor to the end
|
JavaScript
|
agpl-3.0
|
musalbas/listentotwitter,musalbas/listentotwitter,musalbas/listentotwitter
|
23644c40350c07a5266d4f1242dd8665a076ee53
|
tests/CoreSpec.js
|
tests/CoreSpec.js
|
describe("Core Bliss", function () {
"use strict";
before(function() {
fixture.setBase('tests/fixtures');
});
beforeEach(function () {
this.fixture = fixture.load('core.html');
});
// testing setup
it("has the fixture on the dom", function () {
expect($('#fixture-container')).to.not.be.null;
});
it("is a valid testing environment", function () {
// PhantomJS fails this one by default
expect(Element.prototype.matches).to.not.be.undefined;
});
it("has global methods and aliases", function() {
expect(Bliss).to.exist;
expect($).to.exist;
expect($$).to.exist;
expect($).to.equal(Bliss);
expect($$).to.equal($.$);
});
});
|
describe("Core Bliss", function () {
"use strict";
before(function() {
fixture.setBase('tests/fixtures');
});
beforeEach(function () {
this.fixture = fixture.load('core.html');
});
// testing setup
it("has the fixture on the dom", function () {
expect($('#fixture-container')).to.not.be.null;
});
it("has global methods and aliases", function() {
expect(Bliss).to.exist;
expect($).to.exist;
expect($$).to.exist;
expect($).to.equal(Bliss);
expect($$).to.equal($.$);
});
});
|
Revert "Check testing environment has appropriate features"
|
Revert "Check testing environment has appropriate features"
This reverts commit dbb0a79af0c061b1de7acb0d609b05a438d52cae.
|
JavaScript
|
mit
|
LeaVerou/bliss,LeaVerou/bliss,dperrymorrow/bliss,dperrymorrow/bliss
|
574d8ec4bb13661372284f703caa48e7b387feb2
|
gulpfile.js/util/pattern-library/lib/parseDocumentation.js
|
gulpfile.js/util/pattern-library/lib/parseDocumentation.js
|
var path = require('path')
var marked = require('marked')
var nunjucks = require('nunjucks')
var parseDocumentation = function (files) {
files.forEach(function (file) {
nunjucks.configure([
path.join(__dirname, '..', 'macros'),
path.parse(file.path).dir
])
marked.setOptions({
gfm: false
})
var fileContents = [
`{% from 'example.html' import example %}`,
`{% from 'markup.html' import markup %}`,
file.contents.toString()
].join('\n')
var markdown = nunjucks.renderString(fileContents)
var html = marked(markdown)
file.contents = Buffer.from(html)
})
return files
}
module.exports = parseDocumentation
|
var path = require('path')
var marked = require('marked')
var nunjucks = require('nunjucks')
var parseDocumentation = function (files) {
files.forEach(function (file) {
nunjucks.configure([
path.join(__dirname, '..', 'macros'),
path.parse(file.path).dir
])
var fileContents = [
`{% from 'example.html' import example %}`,
`{% from 'markup.html' import markup %}`,
file.contents.toString()
].join('\n')
var markdown = nunjucks.renderString(fileContents)
var html = marked(markdown)
file.contents = Buffer.from(html)
})
return files
}
module.exports = parseDocumentation
|
Use github flavoured markdown as before
|
Use github flavoured markdown as before
|
JavaScript
|
apache-2.0
|
hmrc/assets-frontend,hmrc/assets-frontend,hmrc/assets-frontend
|
f7bd33c7211ed3d79f91da700c51379a26e64196
|
app/map/map.utils.js
|
app/map/map.utils.js
|
function clearEOIMarkers(scope) {
// Remove existing markers.
scope.placesOfInterestMarkers.forEach(function (markerObj) {
scope.map.removeLayer(markerObj.marker);
});
scope.placesOfInterestMarkers = [];
}
function clampWithinBounds(value, lowerBound, upperBound) {
value = Math.max(value, lowerBound);
value = Math.min(value, upperBound);
return value;
}
function createPoiPopupContent(poiAndMarkerObj, scope, compile) {
var content = compile(angular.element('<span>{{poi.DisplayName}}<br>'
+ '<a href="" ng-click="removePlaceOfInterest(poi)">'
+ 'Remove</a>'
+ '</span>'));
var tempScope = scope.$new();
tempScope.poi = poiAndMarkerObj.poi;
return content(tempScope)[0];
}
function updateOrigin(latlng, scope) {
scope.originMarker.setLatLng(latlng).update();
// If have already drawn radius circle then remove it and re-set radius.
if (scope.map.hasLayer(scope.circleOverlay)) {
scope.map.removeLayer(scope.circleOverlay);
scope.radius = 0;
scope.$root.$broadcast('searchAreaCleared');
}
}
|
function clearEOIMarkers(scope) {
// Remove existing markers.
scope.placesOfInterestMarkers.forEach(function (markerObj) {
scope.map.removeLayer(markerObj.marker);
});
scope.placesOfInterestMarkers = [];
}
function clampWithinBounds(value, lowerBound, upperBound) {
value = Math.max(value, lowerBound);
value = Math.min(value, upperBound);
return value;
}
function createPoiPopupContent(poiAndMarkerObj, scope, compile) {
var content = compile(angular.element('<span>{{poi.DisplayName}}<br>'
+ '<a href="" ng-click="removePlaceOfInterest(poi)">'
+ 'Remove</a>'
+ '</span>'));
var tempScope = scope.$new();
tempScope.poi = poiAndMarkerObj.poi;
return content(tempScope)[0];
}
function updateOrigin(latlng, scope) {
scope.originMarker.setLatLng(latlng).update();
// If have already drawn radius circle then remove it and re-set radius.
if (scope.map.hasLayer(scope.circleOverlay)) {
scope.map.removeLayer(scope.circleOverlay);
scope.radius = 0;
scope.circleOverlay.setRadius(0);
scope.$root.$broadcast('searchAreaCleared');
}
}
|
Set search area circle size to 0 on reset.
|
Set search area circle size to 0 on reset.
|
JavaScript
|
mit
|
joseph-iussa/tour-planner,joseph-iussa/tour-planner,joseph-iussa/tour-planner
|
483b0240eedfc44bb8105f0bdc218d16f754ccde
|
conf/buster-coverage.js
|
conf/buster-coverage.js
|
module.exports.unit = {
environment: 'node',
rootPath: process.cwd(),
sources: [
'lib/**/*.js'
],
tests: [
'test/**/*.js'
],
extensions: [
require('buster-istanbul')
],
'buster-istanbul': {
outputDirectory: '.bob/report/coverage'
}
};
|
module.exports.unit = {
environment: 'node',
rootPath: process.cwd(),
sources: [
'lib/**/*.js'
],
tests: [
'test/**/*.js'
],
extensions: [
require('buster-istanbul')
],
'buster-istanbul': {
outputDirectory: '.bob/report/coverage/buster-istanbul/'
}
};
|
Add buster-istanbul subdir as output directory.
|
Add buster-istanbul subdir as output directory.
|
JavaScript
|
mit
|
cliffano/bob
|
46d12bb8b5a302922d9ef2c6e305c78a99876701
|
app/javascript/app/components/footer/site-map-footer/site-map-footer-data.js
|
app/javascript/app/components/footer/site-map-footer/site-map-footer-data.js
|
export const siteMapData = [
{
title: 'Tools',
links: [
{ title: 'Country Profiles', href: '/countries' },
{ title: 'NDCs', href: '/ndcs-content' },
{ title: 'NDC-SDG Linkages', href: '/ndcs-sdg' },
{ title: 'Historical GHG Emissions', href: '/ghg-emissions' },
{ title: 'Pathways', href: '/pathways' }
]
},
{
title: 'Data',
links: [
{ title: 'Explore Datasets', href: '/data-explorer' },
{ title: 'My Climate Watch', href: '/my-climate-watch' }
]
},
{
title: 'Country Platforms',
links: [
// { title: 'India', href: '/' },
// { title: 'Indonesia', href: '/' },
{ title: 'South Africa', href: 'http://southafricaclimateexplorer.org/' }
]
},
{
title: 'About',
links: [
{ title: 'About Climate Watch', href: '/about' },
{ title: 'Climate Watch Partners', href: '/about/partners' },
{ title: 'Contact Us & Feedback', href: '/about/contact' },
{ title: 'Permissions & Licensing', href: '/about/permissions' },
{ title: 'FAQ', href: '/about/faq' }
]
}
];
|
export const siteMapData = [
{
title: 'Tools',
links: [
{ title: 'Country Profiles', href: '/countries' },
{ title: 'NDCs', href: '/ndcs-content' },
{ title: 'NDC-SDG Linkages', href: '/ndcs-sdg' },
{ title: 'Historical GHG Emissions', href: '/ghg-emissions' },
{ title: 'Pathways', href: '/pathways' }
]
},
{
title: 'Data',
links: [
{ title: 'Explore Datasets', href: '/data-explorer' },
{ title: 'My Climate Watch', href: '/my-climate-watch' }
]
},
{
title: 'Country Platforms',
links: [
// { title: 'India', href: '/' },
// { title: 'Indonesia', href: '/' },
{ title: 'South Africa', href: 'http://southafricaclimateexplorer.org/' }
]
},
{
title: 'About',
links: [
{ title: 'About Climate Watch', href: '/about' },
{ title: 'Climate Watch Partners', href: '/about/partners' },
{ title: 'Contact Us & Feedback', href: '/about/contact' },
{ title: 'Permissions & Licensing', href: '/about/permissions' },
{ title: 'FAQ', href: '/about/faq/general_questions' }
]
}
];
|
Correct FAQ link on footer
|
Correct FAQ link on footer
|
JavaScript
|
mit
|
Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch
|
2ffb9af2862202068c7dc4c7144a3340bc1dd3df
|
spec/www/background.js
|
spec/www/background.js
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
chromespec.registerJasmineTest('chrome.app.runtime');
chromespec.registerJasmineTest('chrome.app.window');
chromespec.registerJasmineTest('chrome.fileSystem');
chromespec.registerJasmineTest('chrome.i18n');
chromespec.registerJasmineTest('chrome.runtime');
chromespec.registerJasmineTest('chrome.storage');
chromespec.registerJasmineTest('chrome.socket');
chromespec.registerJasmineTest('chrome.syncFileSystem');
chromespec.registerJasmineTest('pageload');
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
chromespec.registerJasmineTest('chrome.app.runtime');
chromespec.registerJasmineTest('chrome.app.window');
chromespec.registerJasmineTest('chrome.fileSystem');
chromespec.registerJasmineTest('chrome.i18n');
chromespec.registerJasmineTest('chrome.runtime');
chromespec.registerJasmineTest('chrome.storage');
chromespec.registerJasmineTest('chrome.socket');
chromespec.registerJasmineTest('pageload');
|
Remove test.syncFileSystem.js from the load list as it doesn't exist.
|
Remove test.syncFileSystem.js from the load list as it doesn't exist.
|
JavaScript
|
bsd-3-clause
|
xiaoyanit/mobile-chrome-apps,wudkj/mobile-chrome-apps,MobileChromeApps/mobile-chrome-apps,liqingzhu/mobile-chrome-apps,guozanhua/mobile-chrome-apps,guozanhua/mobile-chrome-apps,chirilo/mobile-chrome-apps,hgl888/mobile-chrome-apps,xiaoyanit/mobile-chrome-apps,hgl888/mobile-chrome-apps,liqingzhu/mobile-chrome-apps,chirilo/mobile-chrome-apps,hgl888/mobile-chrome-apps,guozanhua/mobile-chrome-apps,hgl888/mobile-chrome-apps,liqingzhu/mobile-chrome-apps,wudkj/mobile-chrome-apps,chirilo/mobile-chrome-apps,xiaoyanit/mobile-chrome-apps,MobileChromeApps/mobile-chrome-apps,MobileChromeApps/mobile-chrome-apps,MobileChromeApps/mobile-chrome-apps,hgl888/mobile-chrome-apps,xiaoyanit/mobile-chrome-apps,hgl888/mobile-chrome-apps,liqingzhu/mobile-chrome-apps,hgl888/mobile-chrome-apps,wudkj/mobile-chrome-apps,wudkj/mobile-chrome-apps,guozanhua/mobile-chrome-apps,chirilo/mobile-chrome-apps
|
e0a85c0e739f1d4b0b82380ec4092893f8fb996c
|
src/Core/Characters.js
|
src/Core/Characters.js
|
// @flow
export opaque type WideBar = "W"
export const WIDE_BAR: WideBar = "W"
export opaque type NarrowBar = "N"
export const NARROW_BAR: NarrowBar = "N"
export opaque type WideSpace = "w"
export const WIDE_SPACE: WideSpace = "w"
export opaque type NarrowSpace = "n"
export const NARROW_SPACE: NarrowSpace = "n"
export opaque type DiscreteSymbologySymbol = WideBar | NarrowBar | WideSpace | WideBar
export opaque type SymbologySymbol = DiscreteSymbologySymbol
|
// @flow
export opaque type WideBar = "W"
export const WIDE_BAR: WideBar = "W"
export opaque type NarrowBar = "N"
export const NARROW_BAR: NarrowBar = "N"
export opaque type WideSpace = "w"
export const WIDE_SPACE: WideSpace = "w"
export opaque type NarrowSpace = "n"
export const NARROW_SPACE: NarrowSpace = "n"
export type DiscreteSymbologySymbol = WideBar | NarrowBar | WideSpace | WideBar
export type SymbologySymbol = DiscreteSymbologySymbol
|
Make symbol unions non opaque types
|
Make symbol unions non opaque types
|
JavaScript
|
mit
|
mormahr/barcode.js,mormahr/barcode.js
|
49ad1e4378f81738f8ed59ab94dc603c4d5c1938
|
webpack.config.js
|
webpack.config.js
|
const path = require("path");
module.exports = {
entry: path.resolve(__dirname, "./source/index.js"),
externals: {
buttercup: "buttercup"
},
module: {
rules : [
{
test: /\.(js|esm)$/,
use: {
loader: "babel-loader",
options: {
"presets": [
["@babel/preset-env", {
"corejs": 3,
"useBuiltIns": "entry",
"targets": {
"node": "6"
}
}]
],
"plugins": [
["@babel/plugin-proposal-object-rest-spread", {
"useBuiltIns": true
}]
]
}
}
}
]
},
output: {
filename: "buttercup-importer.js",
libraryTarget: "commonjs2",
path: path.resolve(__dirname, "./dist")
},
target: "node"
};
|
const path = require("path");
module.exports = {
entry: path.resolve(__dirname, "./source/index.js"),
externals: {
argon2: "argon2",
buttercup: "buttercup",
kdbxweb: "kdbxweb"
},
module: {
rules : [
{
test: /\.(js|esm)$/,
use: {
loader: "babel-loader",
options: {
"presets": [
["@babel/preset-env", {
"corejs": 3,
"useBuiltIns": "entry",
"targets": {
"node": "6"
}
}]
],
"plugins": [
["@babel/plugin-proposal-object-rest-spread", {
"useBuiltIns": true
}]
]
}
}
}
]
},
output: {
filename: "buttercup-importer.js",
libraryTarget: "commonjs2",
path: path.resolve(__dirname, "./dist")
},
target: "node"
};
|
Split dependencies out in webpack to reduce bundle size
|
Split dependencies out in webpack to reduce bundle size
|
JavaScript
|
mit
|
perry-mitchell/buttercup-importer
|
6851efdd1fd5d214c70eb8db093e6d158870eece
|
webpack.config.js
|
webpack.config.js
|
var webpack = require('webpack');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/dev-server',
'./scripts/index'
],
output: {
path: __dirname,
filename: 'bundle.js',
publicPath: '/scripts/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
resolve: {
extensions: ['', '.js']
},
module: {
loaders: [
{ test: /\.js$/, loaders: ['react-hot', 'jsx?harmony'] },
]
}
};
|
var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/dev-server',
'./scripts/index'
],
output: {
path: __dirname,
filename: 'bundle.js',
publicPath: '/scripts/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
resolve: {
extensions: ['', '.js']
},
module: {
loaders: [
{ test: /\.js$/, loaders: ['react-hot', 'jsx?harmony'] },
]
}
};
|
Add devtool: 'eval' for Chrome DevTools
|
Add devtool: 'eval' for Chrome DevTools
|
JavaScript
|
mit
|
getguesstimate/guesstimate-app
|
485af180a0407d2961e53609ab379bdd3bdb1c67
|
webpack.config.js
|
webpack.config.js
|
const TerserJsPlugin = require('terser-webpack-plugin');
const serverBuild = {
mode: 'production',
entry: './src/twig.js',
target: 'node',
node: false,
output: {
path: __dirname,
filename: 'twig.js',
library: 'Twig',
libraryTarget: 'umd'
},
optimization: {
minimize: false
}
};
const clientBuild = {
mode: 'production',
entry: './src/twig.js',
target: 'web',
node: {
__dirname: false,
__filename: false
},
module: {
rules: [
{
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: [
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-transform-runtime'
]
}
}
}
]
},
output: {
path: __dirname,
filename: 'twig.min.js',
library: 'Twig',
libraryTarget: 'umd'
},
optimization: {
minimize: true,
minimizer: [new TerserJsPlugin({
include: /\.min\.js$/
})]
}
};
module.exports = [serverBuild, clientBuild];
|
const TerserJsPlugin = require('terser-webpack-plugin');
const commonModule = {
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
plugins: [
"@babel/plugin-transform-modules-commonjs",
"@babel/plugin-transform-runtime"
]
}
}
};
const serverBuild = {
mode: 'production',
entry: './src/twig.js',
target: 'node',
node: false,
output: {
path: __dirname,
filename: 'twig.js',
library: 'Twig',
libraryTarget: 'umd'
},
module: {
rules: [commonModule],
},
optimization: {
minimize: false
}
};
const clientBuild = {
mode: 'production',
entry: './src/twig.js',
target: 'web',
node: {
__dirname: false,
__filename: false
},
module: {
rules: [commonModule]
},
output: {
path: __dirname,
filename: 'twig.min.js',
library: 'Twig',
libraryTarget: 'umd'
},
optimization: {
minimize: true,
minimizer: [new TerserJsPlugin({
include: /\.min\.js$/
})]
}
};
module.exports = [serverBuild, clientBuild];
|
Add babel preset on serverBuild
|
Add babel preset on serverBuild
|
JavaScript
|
bsd-2-clause
|
twigjs/twig.js,justjohn/twig.js,twigjs/twig.js,twigjs/twig.js,justjohn/twig.js,justjohn/twig.js
|
32acbf191be290f0eccf756f5f6dc28067e3c565
|
client/sw-precache-config.js
|
client/sw-precache-config.js
|
module.exports = {
navigateFallback: '/index.html',
runtimeCaching: [{
urlPattern: /\/api\/search\/.*/,
handler: 'networkFirst',
options: {
cache: {
maxEntries: 100,
name: 'search-cache',
},
},
urlPattern: /\/api\/.*/,
handler: 'networkFirst',
options: {
cache: {
maxEntries: 1000,
name: 'api-cache',
},
},
}],
}
|
module.exports = {
navigateFallback: '/index.html',
runtimeCaching: [{
urlPattern: /\/api\/search\/.*/,
handler: 'networkFirst',
options: {
cache: {
maxEntries: 100,
name: 'search-cache',
},
},
urlPattern: /\/api\/.*/,
handler: 'fastest',
options: {
cache: {
maxEntries: 1000,
name: 'api-cache',
},
},
}],
}
|
Use fastest method for api calls other than search
|
Use fastest method for api calls other than search
|
JavaScript
|
apache-2.0
|
customelements/v2,webcomponents/webcomponents.org,andymutton/beta,customelements/v2,andymutton/beta,andymutton/v2,andymutton/beta,andymutton/v2,andymutton/beta,webcomponents/webcomponents.org,andymutton/v2,webcomponents/webcomponents.org,andymutton/v2,customelements/v2,customelements/v2
|
6a15410123e9650f003c7a97ef091e08145dc4eb
|
src/actions/budgets.js
|
src/actions/budgets.js
|
import { ActionTypes } from '../config/constants';
import { ref } from '../config/constants';
export const addItem = payload => {
return {
type: ActionTypes.BUDGETS_ADD_ITEM,
payload,
}
}
export const removeItem = payload => {
return {
type: ActionTypes.BUDGETS_REMOVE_ITEM,
payload,
}
}
export const subscribe = payload => {
return dispatch => {
dispatch({
type: ActionTypes.BUDGETS_SUBSCRIBE,
})
const itemsRef = ref.child(`items`);
itemsRef.on('value', snapshot => {
const itemList = snapshot.val();
dispatch({
type: ActionTypes.BUDGETS_UPDATE,
payload: {
itemList: itemList,
}
});
});
}
}
export const search = payload => {
return {
type: ActionTypes.BUDGETS_SEARCH,
payload,
}
}
export const toggleColumn = payload => {
return {
type: ActionTypes.BUDGETS_TOGGLE_COL,
payload,
}
}
export const updateItem = payload => {
return {
type: ActionTypes.BUDGETS_UPDATE_ITEM,
payload,
}
}
|
import { ActionTypes } from '../config/constants';
import { ref } from '../config/constants';
export const addItem = payload => {
return dispatch => {
const itemRef = ref.child(`items/${payload.item.id}`);
itemRef.set( payload.item );
dispatch({
type: ActionTypes.BUDGETS_ADD_ITEM,
payload,
});
}
}
export const removeItem = payload => {
return dispatch => {
const itemRef = ref.child(`items/${payload.itemId}`);
itemRef.remove();
dispatch({
type: ActionTypes.BUDGETS_REMOVE_ITEM,
payload,
});
}
}
export const subscribe = payload => {
return dispatch => {
dispatch({
type: ActionTypes.BUDGETS_SUBSCRIBE,
})
const itemsRef = ref.child(`items`);
itemsRef.on('value', snapshot => {
const itemList = snapshot.val();
dispatch({
type: ActionTypes.BUDGETS_UPDATE,
payload: {
itemList: itemList,
}
});
});
}
}
export const search = payload => {
return {
type: ActionTypes.BUDGETS_SEARCH,
payload,
}
}
export const toggleColumn = payload => {
return {
type: ActionTypes.BUDGETS_TOGGLE_COL,
payload,
}
}
export const updateItem = payload => {
return dispatch => {
const itemRef = ref.child(`items/${payload.updatedItem.id}`);
itemRef.update(payload.updatedItem);
dispatch({
type: ActionTypes.BUDGETS_UPDATE_ITEM,
payload,
})
}
}
|
Update items in Firebase on change
|
Update items in Firebase on change
Initially only read operators were implemented.
The following write operators are now supported:
- Edit item
- Delete item
- Add item
|
JavaScript
|
mit
|
nadavspi/UnwiseConnect,nadavspi/UnwiseConnect,nadavspi/UnwiseConnect
|
818ff925d39f419a290ec46c28c5cea39de23906
|
config/ember-try.js
|
config/ember-try.js
|
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-1.13.8',
dependencies: {
'ember': '1.13.8',
'ember-data': '1.13.9'
}
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release',
'ember-data': 'v2.0.0-beta.2'
},
resolutions: {
'ember': 'release'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
]
};
|
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-1.13.8',
dependencies: {
'ember': '1.13.8',
'ember-data': '1.13.9'
}
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release',
'ember-data': 'v2.0.0-beta.2'
},
resolutions: {
'ember': 'release'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta',
'ember-data': 'v2.0.0-beta.2'
},
resolutions: {
'ember': 'beta'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary',
'ember-data': 'v2.0.0-beta.2'
},
resolutions: {
'ember': 'canary'
}
}
]
};
|
Use 2.x flavor of ember data in canary and beta.
|
Use 2.x flavor of ember data in canary and beta.
|
JavaScript
|
mit
|
mixonic/ember-cli-mirage,flexyford/ember-cli-mirage,martinmaillard/ember-cli-mirage,IAmJulianAcosta/ember-cli-mirage,oliverbarnes/ember-cli-mirage,lazybensch/ember-cli-mirage,mydea/ember-cli-mirage,constantm/ember-cli-mirage,oliverbarnes/ember-cli-mirage,IAmJulianAcosta/ember-cli-mirage,HeroicEric/ember-cli-mirage,ronco/ember-cli-mirage,mixonic/ember-cli-mirage,unchartedcode/ember-cli-mirage,ballPointPenguin/ember-cli-mirage,jerel/ember-cli-mirage,unchartedcode/ember-cli-mirage,blimmer/ember-cli-mirage,blimmer/ember-cli-mirage,samselikoff/ember-cli-mirage,samselikoff/ember-cli-mirage,ronco/ember-cli-mirage,samselikoff/ember-cli-mirage,makepanic/ember-cli-mirage,martinmaillard/ember-cli-mirage,flexyford/ember-cli-mirage,escobera/ember-cli-mirage,mydea/ember-cli-mirage,unchartedcode/ember-cli-mirage,HeroicEric/ember-cli-mirage,ibroadfo/ember-cli-mirage,samselikoff/ember-cli-mirage,alecho/ember-cli-mirage,jherdman/ember-cli-mirage,escobera/ember-cli-mirage,ibroadfo/ember-cli-mirage,LevelbossMike/ember-cli-mirage,jherdman/ember-cli-mirage,alvinvogelzang/ember-cli-mirage,alvinvogelzang/ember-cli-mirage,kategengler/ember-cli-mirage,lependu/ember-cli-mirage,cs3b/ember-cli-mirage,jherdman/ember-cli-mirage,constantm/ember-cli-mirage,cibernox/ember-cli-mirage,jherdman/ember-cli-mirage,unchartedcode/ember-cli-mirage,kategengler/ember-cli-mirage,alecho/ember-cli-mirage,cs3b/ember-cli-mirage,ballPointPenguin/ember-cli-mirage,jamesdixon/ember-cli-mirage,LevelbossMike/ember-cli-mirage,lependu/ember-cli-mirage,lazybensch/ember-cli-mirage,makepanic/ember-cli-mirage,cibernox/ember-cli-mirage,jerel/ember-cli-mirage,jamesdixon/ember-cli-mirage
|
c71f6d3aa4807e6d384846519f266a8bdb4c8e72
|
create-user.js
|
create-user.js
|
'use strict';
const path = require('path');
const encryptor = require('./src/encryptor');
const argv = process.argv.slice(2);
if(argv.length != 2) {
console.log('Usage: node create-user.js USERNAME PASSWORD');
process.exit(1);
}
encryptor
.encrypt('{}', path.join('./data', `${argv[0]}.dat`), argv[1])
.then(() => {
console.log('User file created!');
process.exit(0);
})
.catch(err => {
console.log('Error: ', e);
process.exit(1);
});
|
'use strict';
const path = require('path');
const encryptor = require('./src/encryptor');
const argv = process.argv.slice(2);
if(argv.length != 2) {
console.log('Usage: node create-user.js USERNAME PASSWORD');
process.exit(1);
}
encryptor
.encrypt(JSON.stringify({
services: []
}), path.join('./data', `${argv[0]}.dat`), argv[1])
.then(() => {
console.log('User file created!');
process.exit(0);
})
.catch(err => {
console.log('Error: ', e);
process.exit(1);
});
|
Create user adiciona json básico no arquivo
|
Create user adiciona json básico no arquivo
|
JavaScript
|
mit
|
gustavopaes/password-manager,gustavopaes/password-manager,gustavopaes/password-manager
|
c771edf30259bae85af719dc27fa5d07999160c8
|
scripts/dbsetup.js
|
scripts/dbsetup.js
|
let db;
try {
db = require("rethinkdbdash")(require("../config").connectionOpts);
} catch (err) {
console.error("You haven't installed rethinkdbdash npm module or you didn't have configured the bot yet! Please do so.");
}
(async function () {
if (!db) return;
const tables = await db.tableList();
if (!tables.includes("blacklist")) await db.tableCreate("blacklist");
if (!tables.includes("session")) await db.tableCreate("session");
if (!tables.includes("configs")) await db.tableCreate("configs");
if (!tables.includes("feedback")) await db.tableCreate("feedback");
if (!tables.includes("tags")) await db.tableCreate("tags");
if (!tables.includes("profile")) await db.tableCreate("profile");
if (!tables.includes("modlog")) await db.tableCreate("modlog");
if (!tables.includes("extensions")) await db.tableCreate("extensions");
if (!tables.includes("extension_store")) await db.tableCreate("extension_store");
console.log("All set up!");
process.exit(0);
})();
|
let db;
try {
db = require("rethinkdbdash")(require("../config").connectionOpts);
} catch (err) {
console.error("You haven't installed rethinkdbdash npm module or you didn't have configured the bot yet! Please do so.");
}
(async function () {
if (!db) return;
const tables = await db.tableList();
if (!tables.includes("blacklist")) await db.tableCreate("blacklist");
if (!tables.includes("session")) await db.tableCreate("session");
if (!tables.includes("configs")) await db.tableCreate("configs");
if (!tables.includes("feedback")) await db.tableCreate("feedback");
if (!tables.includes("tags")) await db.tableCreate("tags");
if (!tables.includes("profile")) await db.tableCreate("profile");
if (!tables.includes("modlog")) await db.tableCreate("modlog");
if (!tables.includes("extensions")) await db.tableCreate("extensions");
if (!tables.includes("extension_store")) await db.tableCreate("extension_store");
if (!tables.includes("phone")) await db.tableCreate("phone");
console.log("All set up!");
process.exit(0);
})();
|
Create the phone table when it existn't
|
Create the phone table when it existn't
|
JavaScript
|
mit
|
TTtie/TTtie-Bot,TTtie/TTtie-Bot,TTtie/TTtie-Bot
|
5620ebe8a3c22927e2bacba2ef7ea12157469b8d
|
js/mentions.js
|
js/mentions.js
|
jQuery(function( $ ) {
var mOptions = $.extend({}, mOpt);
console.log(mOptions);
$('#cmessage').atwho({
at: "@",
displayTpl: "<li>${username}<small> ${name}</small></li>",
insertTpl: "${atwho-at}${username}",
callbacks: {
remoteFilter: function(query, callback) {
console.log('Query: ' + query);
//
if(query === null || query.length < 1){
return callback(null);
}
$.ajax({
url: mOptions.path + "index.php?mq=" + query,
type: 'GET',
dataType: 'json',
success: function(data) {
callback(data);
console.log('Data: ' + data);
},
error: function() {
console.warn('Didn\'t Work');
},
beforeSend: function(xhr) {
//xhr.setRequestHeader('Authorization', localStorageService.get('authToken'));
}
});
}
},
searchKey: "username",
limit: 5,
maxLen: 15,
displayTimeout: 300,
highlightFirst: true,
delay: 50,
});
});
|
jQuery(function( $ ) {
var mOptions = $.extend({}, mOpt);
console.log(mOptions);
$('#cmessage').atwho({
at: "@",
displayTpl: "<li>${username}<small> ${name}</small></li>",
insertTpl: "${atwho-at}${username}",
callbacks: {
remoteFilter: function(query, callback) {
console.log('Query: ' + query);
//
/*
if(query === null || query.length < 1){
return callback(null);
}*/
$.ajax({
url: mOptions.path + "index.php?mq=" + query,
type: 'GET',
dataType: 'json',
success: function(data) {
callback(data);
console.log('Data: ' + data);
},
error: function() {
console.warn('Didn\'t Work');
},
beforeSend: function(xhr) {
//xhr.setRequestHeader('Authorization', localStorageService.get('authToken'));
}
});
}
},
searchKey: "username",
limit: 5,
maxLen: 15,
minLen: 1,
displayTimeout: 300,
highlightFirst: true,
});
});
|
Set atwho.js minLen param to 1 default was 0.
|
Set atwho.js minLen param to 1 default was 0.
|
JavaScript
|
agpl-3.0
|
arunshekher/mentions,arunshekher/mentions
|
6053767e229e18cb4f416a44ede954c2a90ba5ee
|
src/can-be-asserted.js
|
src/can-be-asserted.js
|
import _ from 'lodash';
export default function canBeAsserted(vdom) {
return _.all([].concat(vdom), node =>
node
&& typeof node === 'object'
&& typeof node.type === 'string'
&& (!node.props || typeof node.props === 'object')
);
}
|
import _ from 'lodash';
import React from 'react';
export default function canBeAsserted(vdom) {
return _.all([].concat(vdom), node =>
React.isValidElement(node) ||
(node
&& typeof node === 'object'
&& typeof node.type === 'string'
&& (!node.props || typeof node.props === 'object'))
);
}
|
Add validation for local component classes as well First try the official method, then fall-back to duck typing.
|
Add validation for local component classes as well
First try the official method, then fall-back to duck typing.
|
JavaScript
|
mit
|
electricmonk/chai-react-element
|
1d92c984fc1d0876b26378015a33ba1795733404
|
lib/EditorInserter.js
|
lib/EditorInserter.js
|
'use babel';
import { TextEditor } from 'atom';
export default class EditorInserter {
setText(text) {
this.insertionText = text;
}
performInsertion() {
if (!this.insertionText) {
console.error("No text to insert.");
return;
}
this.textEditor = atom.workspace.getActiveTextEditor();
//Break up lines
var lines = this.insertionText.split("\n");
//Start by inserting the first line
this.textEditor.insertText(lines[0]);
//Go back to the very beginning of the line and save the tab spacing
var tabSpacing = " ";
//Now prepend this tab spacing to all other lines and concatenate them
var concatenation = "";
for (let i = 1; i < lines.length; i++) {
concatenation += tabSpacing + lines[i];
}
//Finally, insert this concatenation to complete the insertion
this.textEditor.insertText(concatenation);
}
}
|
'use babel';
import { TextEditor } from 'atom';
export default class EditorInserter {
setText(text) {
this.insertionText = text;
}
performInsertion() {
//Make sure there's actually text to insert before continuing
if (!this.insertionText) {
console.error("No text to insert.");
return;
}
//Get the active text editor
var textEditor = atom.workspace.getActiveTextEditor();
//Get all current selections
var selections = textEditor.getSelections();
//Perform an insertion for each selection taking into account its own tabbing
for (let i = 0; i < selections.length; i++) {
//Break up lines
var lines = this.insertionText.split("\n");
//Go back to the very beginning of the line and save the tab spacing
selections[i].selectToBeginningOfLine();
var selectedText = selections[i].getText();
var tabSpacing = "";
for (let j = 0; j < selectedText.length; j++) {
//Stop collecting tab characters when the first non-(hard/soft)tab character is reached
if (selectedText[j] != "\t" && selectedText[j] != " ") {
break;
}
tabSpacing += selectedText[j];
}
//Place selection back to where it was initially
selections[i].selectRight(selectedText.length);
//Start by inserting the first line
selections[i].insertText(lines[0]);
//Now prepend this tab spacing to all other lines and concatenate them
var concatenation = "";
for (let j = 1; j < lines.length; j++) {
concatenation += tabSpacing + lines[j];
}
//Finally, insert this concatenation to complete the insertion
selections[i].insertText(concatenation);
}
}
}
|
Add tabbing to example insertion.
|
Add tabbing to example insertion.
|
JavaScript
|
mit
|
Coteh/syntaxdb-atom-plugin
|
a1daba2ef60ffb34c73932f68fefb727d45d4568
|
src/locale/en/build_distance_in_words_localize_fn/index.js
|
src/locale/en/build_distance_in_words_localize_fn/index.js
|
module.exports = function buildDistanceInWordsLocalizeFn () {
var distanceInWordsLocale = {
lessThanXSeconds: {
one: 'less than a second',
other: 'less than ${count} seconds'
},
halfAMinute: 'half a minute',
lessThanXMinutes: {
one: 'less than a minute',
other: 'less than ${count} minutes'
},
xMinutes: {
one: '1 minute',
other: '${count} minutes'
},
aboutXHours: {
one: 'about 1 hour',
other: 'about ${count} hours'
},
xDays: {
one: '1 day',
other: '${count} days'
},
aboutXMonths: {
one: 'about 1 month',
other: 'about ${count} months'
},
xMonths: {
one: '1 month',
other: '${count} months'
},
aboutXYears: {
one: 'about 1 year',
other: 'about ${count} years'
},
overXYears: {
one: 'over 1 year',
other: 'over ${count} years'
},
almostXYears: {
one: 'almost 1 year',
other: 'almost ${count} years'
}
}
return function (token, count) {
if (count === undefined) {
return distanceInWordsLocale[token]
} else if (count === 1) {
return distanceInWordsLocale[token].one
} else {
return distanceInWordsLocale[token].other.replace('${count}', count)
}
}
}
|
module.exports = function buildDistanceInWordsLocalizeFn () {
var distanceInWordsLocale = {
lessThanXSeconds: {
one: 'less than a second',
other: 'less than {{count}} seconds'
},
halfAMinute: 'half a minute',
lessThanXMinutes: {
one: 'less than a minute',
other: 'less than {{count}} minutes'
},
xMinutes: {
one: '1 minute',
other: '{{count}} minutes'
},
aboutXHours: {
one: 'about 1 hour',
other: 'about {{count}} hours'
},
xDays: {
one: '1 day',
other: '{{count}} days'
},
aboutXMonths: {
one: 'about 1 month',
other: 'about {{count}} months'
},
xMonths: {
one: '1 month',
other: '{{count}} months'
},
aboutXYears: {
one: 'about 1 year',
other: 'about {{count}} years'
},
overXYears: {
one: 'over 1 year',
other: 'over {{count}} years'
},
almostXYears: {
one: 'almost 1 year',
other: 'almost {{count}} years'
}
}
return function (token, count) {
if (count === undefined) {
return distanceInWordsLocale[token]
} else if (count === 1) {
return distanceInWordsLocale[token].one
} else {
return distanceInWordsLocale[token].other.replace('{{count}}', count)
}
}
}
|
Use handlebars string format in distanceInWords localize function
|
Use handlebars string format in distanceInWords localize function
|
JavaScript
|
mit
|
date-fns/date-fns,js-fns/date-fns,date-fns/date-fns,date-fns/date-fns,js-fns/date-fns
|
e8b3cb735567ebc27a842c275eab9aac306c8ea2
|
assets/www/map/js/views/point-view.js
|
assets/www/map/js/views/point-view.js
|
var PointView = Backbone.View.extend({
initialize:function (options) {
this.model = options.model;
this.gmap = options.gmap;
this.marker = new google.maps.Marker({
position:this.model.getGLocation(),
poiType:this.model.getPoiType(),
visible:true,
icon:this.model.get('pin'),
map:null
});
// render the initial point state
this.render();
},
render:function () {
this.marker.setMap(this.gmap);
},
remove:function () {
this.marker.setMap(null);
this.marker = null;
}
});
|
var PointView = Backbone.View.extend({
initialize:function (options) {
this.model = options.model;
this.gmap = options.gmap;
this.marker = new google.maps.Marker({
position:this.model.getGLocation(),
poiType:this.model.getPoiType(),
visible:true,
icon:this.model.get('pin'),
map:null
});
var self = this;
this.model.on('change:locations', function () {
self.marker.setPosition(self.model.getGLocation());
});
// render the initial point state
this.render();
},
render:function () {
this.marker.setMap(this.gmap);
},
remove:function () {
this.marker.setMap(null);
this.marker = null;
}
});
|
Change position on model location change.
|
Change position on model location change.
|
JavaScript
|
bsd-3-clause
|
bwestlin/hermes,bwestlin/hermes,carllarsson/hermes,carllarsson/hermes,bwestlin/hermes,carllarsson/hermes
|
afe38c01e268a04153e8a644b5e64c2fd4897d0e
|
lib/poolify.js
|
lib/poolify.js
|
'use strict';
const poolified = Symbol('poolified');
const mixFlag = { [poolified]: true };
const duplicate = (factory, n) => (
new Array(n).fill().map(() => {
const instance = factory();
return Object.assign(instance, mixFlag);
})
);
const provide = callback => item => {
setImmediate(() => {
callback(item);
});
};
const poolify = (factory, min, norm, max) => {
let allocated = norm;
const pool = (par) => {
if (par && par[poolified]) {
const delayed = pool.delayed.shift();
if (delayed) delayed(par);
else pool.items.push(par);
return;
}
if (pool.items.length < min && allocated < max) {
const grow = Math.min(max - allocated, norm - pool.items.length);
allocated += grow;
const items = duplicate(factory, grow);
pool.items.push(...items);
}
const res = pool.items.pop();
if (!par) return res;
const callback = provide(par);
if (res) callback(res);
else pool.delayed.push(callback);
};
return Object.assign(pool, {
items: duplicate(factory, norm),
delayed: []
});
};
module.exports = {
poolify,
};
|
'use strict';
const poolified = Symbol('poolified');
const mixFlag = { [poolified]: true };
const duplicate = (factory, n) => Array
.from({ length: n }, factory)
.map(instance => Object.assign(instance, mixFlag));
const provide = callback => item => {
setImmediate(() => {
callback(item);
});
};
const poolify = (factory, min, norm, max) => {
let allocated = norm;
const pool = (par) => {
if (par && par[poolified]) {
const delayed = pool.delayed.shift();
if (delayed) delayed(par);
else pool.items.push(par);
return;
}
if (pool.items.length < min && allocated < max) {
const grow = Math.min(max - allocated, norm - pool.items.length);
allocated += grow;
const items = duplicate(factory, grow);
pool.items.push(...items);
}
const res = pool.items.pop();
if (!par) return res;
const callback = provide(par);
if (res) callback(res);
else pool.delayed.push(callback);
};
return Object.assign(pool, {
items: duplicate(factory, norm),
delayed: []
});
};
module.exports = {
poolify,
};
|
Use Array.from({ length: n }, factory)
|
Use Array.from({ length: n }, factory)
PR-URL: https://github.com/metarhia/metasync/pull/306
|
JavaScript
|
mit
|
metarhia/MetaSync,DzyubSpirit/MetaSync,DzyubSpirit/MetaSync
|
d9fb86986d77688bfe606dad153b4e0c26125c83
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
qunit: {
files: ['jstests/index.html']
},
jshint: {
all: [
'Gruntfile.js',
'nbdiff/server/static/*.js'
],
options: {
jshintrc: '.jshintrc'
}
}
});
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('test', ['qunit']);
// Travis CI task.
grunt.registerTask('travis', ['jshint', 'qunit']);
grunt.registerTask('default', ['qunit', 'jshint']);
};
|
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
qunit: {
files: ['jstests/index.html']
},
jshint: {
all: [
'Gruntfile.js',
'jstests/*.js',
'nbdiff/server/static/*.js'
],
options: {
jshintrc: '.jshintrc'
}
}
});
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('test', ['qunit']);
// Travis CI task.
grunt.registerTask('travis', ['jshint', 'qunit']);
grunt.registerTask('default', ['qunit', 'jshint']);
};
|
Add jstests to jshint checks
|
Add jstests to jshint checks
|
JavaScript
|
mit
|
tarmstrong/nbdiff,tarmstrong/nbdiff,tarmstrong/nbdiff,tarmstrong/nbdiff
|
248053f65310ee9e2702a16678f05b2076ca88f1
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json')
});
grunt.loadNpmTasks('grunt-release');
grunt.registerTask('message', function() {
grunt.log.writeln("use grunt release:{patch|minor|major}");
});
grunt.registerTask('default', ['message']);
};
|
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
release: {
options: {
tagName: 'v<%= version %>'
}
}
});
grunt.loadNpmTasks('grunt-release');
grunt.registerTask('message', function() {
grunt.log.writeln("use grunt release:{patch|minor|major}");
});
grunt.registerTask('default', ['message']);
};
|
Use correct tag with grunt-release
|
Use correct tag with grunt-release
|
JavaScript
|
mit
|
leszekhanusz/generator-knockout-bootstrap
|
2fc93c70a7a674bed8a9d677d5ac5b4afd36e179
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
rebuild: {
command: 'npm install --build-from-source'
}
},
jasmine_node: {
all: ['spec/']
}
});
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['shell:rebuild', 'jasmine_node:all']);
};
|
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
rebuild: {
command: 'npm install --build-from-source'
}
},
jasmine_node: {
all: ['spec/']
}
});
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('build', ['shell:rebuild']);
grunt.registerTask('test', ['jasmine_node:all']);
grunt.registerTask('default', ['build', 'test']);
};
|
Split Grunt tasks into “build” and “test”
|
Split Grunt tasks into “build” and “test”
|
JavaScript
|
bsd-2-clause
|
mross-pivotal/node-gemfire,gemfire/node-gemfire,gemfire/node-gemfire,mross-pivotal/node-gemfire,gemfire/node-gemfire,mross-pivotal/node-gemfire,gemfire/node-gemfire,mross-pivotal/node-gemfire,gemfire/node-gemfire,gemfire/node-gemfire,mross-pivotal/node-gemfire,mross-pivotal/node-gemfire
|
cab2faf71d7b8d0e0c8950b2315879b7f39e835f
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.initConfig({
qunit: {
files: ['test/index.html']
}
});
grunt.loadNpmTasks('grunt-contrib-qunit');
// Default task.
grunt.registerTask('test', 'qunit');
// Travis CI task.
grunt.registerTask('travis', 'test');
};
// vim:ts=2:sw=2:et:
|
module.exports = function(grunt) {
grunt.initConfig({
qunit: {
files: ['test/index.html']
},
jshint: {
all: ['Gruntfile.js', 'yt-looper.js', 'test/**/*.js'],
options: {
'-W014': true, // ignore [W014] Bad line breaking
},
},
});
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task.
grunt.registerTask('test', 'qunit');
// Travis CI task.
grunt.registerTask('travis', ['test','jshint']);
};
// vim:ts=2:sw=2:et:
|
Add jshint to a test suite
|
Add jshint to a test suite
|
JavaScript
|
cc0-1.0
|
sk4zuzu/yt-looper,sk4zuzu/yt-looper,sk4zuzu/yt-looper,lidel/yt-looper,lidel/yt-looper,lidel/yt-looper
|
b78927680317b26f44008debb33c2abc3db5712b
|
postcss.config.js
|
postcss.config.js
|
'use strict';
module.exports = {
input: 'src/*.css',
dir: 'dist',
use: [
'postcss-import',
'postcss-import-url',
'postcss-custom-properties',
'postcss-normalize-charset',
'autoprefixer',
'postcss-reporter'
],
'postcss-import': {
plugins: [
require('postcss-copy')({
src: './src',
dest: './dist',
template: (file) => {
return `assets/${file.name}.${file.ext}`;
},
relativePath: (dir, file, result, opts) => {
return opts.dest;
}
})
]
},
'postcss-custom-properties': {
preserve: true
},
autoprefixer: {
browsers: [
'> 1% in JP'
]
},
'postcss-reporter': {
clearMessages: true
}
}
|
'use strict';
module.exports = {
input: 'src/*.css',
dir: 'dist',
use: [
'postcss-import',
'postcss-custom-properties',
'postcss-normalize-charset',
'autoprefixer',
'postcss-reporter'
],
'postcss-import': {
plugins: [
require('postcss-import-url'),
require('postcss-copy')({
src: './src',
dest: './dist',
template: file => {
return `assets/${file.name}.${file.ext}`;
},
relativePath: (dir, file, result, opts) => {
return opts.dest;
}
})
]
},
'postcss-custom-properties': {
preserve: true
},
autoprefixer: {
browsers: [
'> 1% in JP'
]
},
'postcss-reporter': {
clearMessages: true
}
}
|
Change the time of loading external CSS
|
[change] Change the time of loading external CSS
|
JavaScript
|
mit
|
seamile4kairi/japanese-fonts-css
|
bb76add5adfe95e4b95b004bf64c871cde3aaca5
|
reviewboard/static/rb/js/models/diffModel.js
|
reviewboard/static/rb/js/models/diffModel.js
|
/*
* A diff to be uploaded to a server.
*
* For now, this is used only for uploading new diffs.
*
* It is expected that parentObject will be set to a ReviewRequest instance.
*/
RB.Diff = RB.BaseResource.extend({
rspNamespace: 'diff',
getErrorString: function(rsp) {
if (rsp.err.code == 207) {
return 'The file "' + rsp.file + '" (revision ' + rsp.revision +
') was not found in the repository';
}
return rsp.err.msg;
}
});
|
/*
* A diff to be uploaded to a server.
*
* For now, this is used only for uploading new diffs.
*
* It is expected that parentObject will be set to a ReviewRequest instance.
*/
RB.Diff = RB.BaseResource.extend({
defaults: {
diff: null,
parentDiff: null,
basedir: ''
},
payloadFileKeys: ['path', 'parent_diff_path'],
rspNamespace: 'diff',
getErrorString: function(rsp) {
if (rsp.err.code == 207) {
return 'The file "' + rsp.file + '" (revision ' + rsp.revision +
') was not found in the repository';
}
return rsp.err.msg;
},
toJSON: function() {
var payload;
if (this.isNew()) {
payload = {
basedir: this.get('basedir'),
path: this.get('diff'),
parent_diff_path: this.get('parentDiff')
};
} else {
payload = RB.BaseResource.prototype.toJSON.apply(this, arguments);
}
return payload;
}
});
|
Enhance RB.Diff to be able to create new diffs.
|
Enhance RB.Diff to be able to create new diffs.
The existing diff model didn't do very much, and was really meant for dealing
with existing diffs. This change adds some attributes and methods that allow it
to be used to create new diffs.
Testing done:
Used this in another change to create a diff from javascript.
Reviewed at http://reviews.reviewboard.org/r/4303/
|
JavaScript
|
mit
|
reviewboard/reviewboard,davidt/reviewboard,1tush/reviewboard,1tush/reviewboard,custode/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,davidt/reviewboard,KnowNo/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,KnowNo/reviewboard,1tush/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,bkochendorfer/reviewboard,sgallagher/reviewboard,bkochendorfer/reviewboard,custode/reviewboard,chipx86/reviewboard,1tush/reviewboard,davidt/reviewboard,chipx86/reviewboard,beol/reviewboard,sgallagher/reviewboard,brennie/reviewboard,1tush/reviewboard,custode/reviewboard,brennie/reviewboard,beol/reviewboard,beol/reviewboard,bkochendorfer/reviewboard,1tush/reviewboard,beol/reviewboard,KnowNo/reviewboard,custode/reviewboard,1tush/reviewboard,KnowNo/reviewboard,1tush/reviewboard,brennie/reviewboard,sgallagher/reviewboard,davidt/reviewboard,brennie/reviewboard,reviewboard/reviewboard,chipx86/reviewboard
|
f6d6955c6d459717a357872ae68a0b0eabc779bf
|
app/assets/javascripts/pageflow/media_player/volume_fading.js
|
app/assets/javascripts/pageflow/media_player/volume_fading.js
|
//= require_self
//= require_tree ./volume_fading
pageflow.mediaPlayer.volumeFading = function(player) {
if (!pageflow.browser.has('volume control support')) {
return pageflow.mediaPlayer.volumeFading.noop(player);
}
else if (pageflow.audioContext.get()) {
return pageflow.mediaPlayer.volumeFading.webAudio(
player,
pageflow.audioContext.get()
);
}
else {
return pageflow.mediaPlayer.volumeFading.interval(player);
}
};
|
//= require_self
//= require_tree ./volume_fading
pageflow.mediaPlayer.volumeFading = function(player) {
if (!pageflow.browser.has('volume control support')) {
return pageflow.mediaPlayer.volumeFading.noop(player);
}
else if (pageflow.audioContext.get() && player.getMediaElement) {
return pageflow.mediaPlayer.volumeFading.webAudio(
player,
pageflow.audioContext.get()
);
}
else {
return pageflow.mediaPlayer.volumeFading.interval(player);
}
};
|
Use Web Audio volume fading only if player has getMediaElement
|
Use Web Audio volume fading only if player has getMediaElement
`pagefow-vr` player does not support accessing the media element
directly.
|
JavaScript
|
mit
|
Modularfield/pageflow,Modularfield/pageflow,Modularfield/pageflow,tf/pageflow,codevise/pageflow,codevise/pageflow,codevise/pageflow,tf/pageflow,tf/pageflow,tf/pageflow,codevise/pageflow,Modularfield/pageflow
|
1b20df7e99f846efc6f64c1fae20df5e6fdcd6e5
|
backend/app/assets/javascripts/spree/backend/store_credits.js
|
backend/app/assets/javascripts/spree/backend/store_credits.js
|
Spree.ready(function() {
$('.store-credit-memo-row').each(function() {
var row = this;
var field = row.querySelector('[name="store_credit[memo]"]')
var textDisplay = row.querySelector('.store-credit-memo-text')
$(row).on('ajax:success', function(event, data) {
row.classList.remove('editing');
field.defaultValue = field.value;
textDisplay.textContent = field.value;
show_flash('success', data.message);
}).on('ajax:error', function(event, xhr, status, error) {
show_flash('error', xhr.responseJSON.message);
});
row.querySelector('.edit-memo').addEventListener('click', function() {
row.classList.add('editing');
});
row.querySelector('.cancel-memo').addEventListener('click', function() {
row.classList.remove('editing');
});
});
});
|
Spree.ready(function() {
$('.store-credit-memo-row').each(function() {
var row = this;
var field = row.querySelector('[name="store_credit[memo]"]')
var textDisplay = row.querySelector('.store-credit-memo-text')
$(row).on('ajax:success', function(event, data) {
row.classList.remove('editing');
field.defaultValue = field.value;
textDisplay.textContent = field.value;
if (typeof data !== "undefined") {
// we are using jquery_ujs
message = data.message
} else {
// we are using rails-ujs
message = event.detail[0].message
}
show_flash('success', message);
}).on('ajax:error', function(event, xhr, status, error) {
if (typeof xhr !== "undefined") {
// we are using jquery_ujs
message = xhr.responseJSON.message
} else {
// we are using rails-ujs
message = event.detail[0].message
}
show_flash('error', message);
});
row.querySelector('.edit-memo').addEventListener('click', function() {
row.classList.add('editing');
});
row.querySelector('.cancel-memo').addEventListener('click', function() {
row.classList.remove('editing');
});
});
});
|
Allow admin store credit memo to be changed using rails-ujs
|
Allow admin store credit memo to be changed using rails-ujs
rails-ujs has a different api handling ajax events than jquery_ujs.
The former passes all the event information into the event.detail object
while the latter accept different parameters. For more details see:
- https://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html#rails-ujs-event-handlers
- https://github.com/rails/jquery-ujs/wiki/ajax
|
JavaScript
|
bsd-3-clause
|
pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus
|
2be6aed059542216005f1fbd1b8f0b0ba53af1f4
|
examples/scribuntoConsole.js
|
examples/scribuntoConsole.js
|
var Bot = require( 'nodemw' ),
readline = require( 'readline' ),
c = require( 'ansi-colors' ),
rl = readline.createInterface( {
input: process.stdin,
output: process.stdout
} ),
client = new Bot( {
protocol: 'https',
server: 'dev.fandom.com',
path: ''
} ),
params = {
action: 'scribunto-console',
title: 'Module:CLI/testcases/title',
clear: true
};
function call( err, info, next, data ) {
if ( err ) {
console.error( err );
} else if ( data.type === 'error' ) {
console.error( data.message );
} else {
console.log( data.print );
}
}
function cli( input ) {
params.question = input;
client.api.call( params, call );
}
function session( err, content ) {
params.content = content;
console.log( c.gray('* The module exports are available as the variable "p", including unsaved modifications.' ) );
console.log( c.gray('* Precede a line with "=" to evaluate it as an expression, or use print().' ) );
console.log( c.gray('* Use mw.log() in module code to send messages to this console.' ) );
rl.on( 'line', cli );
}
client.getArticle( params.title, session );
|
var Bot = require( 'nodemw' ),
readline = require( 'readline' ),
c = require( 'ansicolors' ),
rl = readline.createInterface( {
input: process.stdin,
output: process.stdout
} ),
client = new Bot( {
protocol: 'https',
server: 'dev.fandom.com',
path: ''
} ),
params = {
action: 'scribunto-console',
title: 'Module:CLI/testcases/title',
clear: true
};
function call( err, info, next, data ) {
if ( err ) {
console.error( err );
} else if ( data.type === 'error' ) {
console.error( data.message );
} else {
console.log( data.print );
}
}
function cli( input ) {
params.question = input;
client.api.call( params, call );
}
function session( err, content ) {
params.content = content;
console.log( c.green('* The module exports are available as the variable "p", including unsaved modifications.' ) );
console.log( c.green('* Precede a line with "=" to evaluate it as an expression, or use print().' ) );
console.log( c.green('* Use mw.log() in module code to send messages to this console.' ) );
rl.on( 'line', cli );
}
client.getArticle( params.title, session );
|
Use green for console intro instead
|
Use green for console intro instead
|
JavaScript
|
bsd-2-clause
|
macbre/nodemw
|
58a5b2b5c69343b684ecb6db9cd9e43bb8f37747
|
app/plugins/wildflower/jlm/controllers/components/write_new.js
|
app/plugins/wildflower/jlm/controllers/components/write_new.js
|
$.jlm.component('WriteNew', 'wild_posts.wf_index, wild_posts.wf_edit, wild_pages.wf_index, wild_pages.wf_edit', function() {
$('#sidebar .add').click(function() {
var buttonEl = $(this);
var formAction = buttonEl.attr('href');
var templatePath = 'posts/new_post';
var parentPageOptions = null;
if ($.jlm.params.controller == 'wild_pages') {
templatePath = 'pages/new_page';
parentPageOptions = $('.all-page-parents').html();
parentPageOptions = parentPageOptions.replace('[parent_id_options]', '[parent_id]');
}
var dialogEl = $($.jlm.template(templatePath, { action: formAction, parentPageOptions: parentPageOptions }));
var contentEl = $('#content-pad');
contentEl.append(dialogEl);
var toHeight = 230;
var hiddenContentEls = contentEl.animate({
height: toHeight
}, 600).children().not(dialogEl).hide();
$('.input input', dialogEl).focus();
// Bind cancel link
$('.cancel-edit a', dialogEl).click(function() {
dialogEl.remove();
hiddenContentEls.show();
contentEl.height('auto');
return false;
});
// Create link
$('.submit input', dialogEl).click(function() {
$(this).attr('disabled', 'disabled').attr('value', '<l18n>Saving...</l18n>');
return true;
});
return false;
});
});
|
$.jlm.component('WriteNew', 'wild_posts.wf_index, wild_posts.wf_edit, wild_pages.wf_index, wild_pages.wf_edit', function() {
$('#sidebar .add').click(function() {
var buttonEl = $(this);
var formAction = buttonEl.attr('href');
var templatePath = 'posts/new_post';
var parentPageOptions = null;
if ($.jlm.params.controller == 'wild_pages') {
templatePath = 'pages/new_page';
parentPageOptions = $('.all-page-parents').html();
parentPageOptions = parentPageOptions.replace('[Page]', '[WildPage]');
parentPageOptions = parentPageOptions.replace('[parent_id_options]', '[parent_id]');
}
var dialogEl = $($.jlm.template(templatePath, { action: formAction, parentPageOptions: parentPageOptions }));
var contentEl = $('#content-pad');
contentEl.append(dialogEl);
var toHeight = 230;
var hiddenContentEls = contentEl.animate({
height: toHeight
}, 600).children().not(dialogEl).hide();
$('.input input', dialogEl).focus();
// Bind cancel link
$('.cancel-edit a', dialogEl).click(function() {
dialogEl.remove();
hiddenContentEls.show();
contentEl.height('auto');
return false;
});
// Create link
$('.submit input', dialogEl).click(function() {
$(this).attr('disabled', 'disabled').attr('value', '<l18n>Saving...</l18n>');
return true;
});
return false;
});
});
|
Write new page parent select box bug fixed
|
Write new page parent select box bug fixed
|
JavaScript
|
mit
|
klevo/wildflower,klevo/wildflower,klevo/wildflower
|
86e08d1d638656ff5c655bb9af4d658330907edf
|
test/idle-timer_test.js
|
test/idle-timer_test.js
|
(function($) {
/*
======== A Handy Little QUnit Reference ========
http://docs.jquery.com/QUnit
Test methods:
expect(numAssertions)
stop(increment)
start(decrement)
Test assertions:
ok(value, [message])
equal(actual, expected, [message])
notEqual(actual, expected, [message])
deepEqual(actual, expected, [message])
notDeepEqual(actual, expected, [message])
strictEqual(actual, expected, [message])
notStrictEqual(actual, expected, [message])
raises(block, [expected], [message])
*/
module("jQuery#idle-timer");
asyncTest( "default behavior", function() {
expect( 1 );
$( document ).on( "idle.idleTimer", function(){
ok( true, "idleTime fires at document by default" );
start();
});
$.idleTimer( 100 );
});
}(jQuery));
|
(function($) {
/*
======== A Handy Little QUnit Reference ========
http://docs.jquery.com/QUnit
Test methods:
expect(numAssertions)
stop(increment)
start(decrement)
Test assertions:
ok(value, [message])
equal(actual, expected, [message])
notEqual(actual, expected, [message])
deepEqual(actual, expected, [message])
notDeepEqual(actual, expected, [message])
strictEqual(actual, expected, [message])
notStrictEqual(actual, expected, [message])
raises(block, [expected], [message])
*/
module("jQuery#idle-timer");
asyncTest( "default behavior", function() {
expect( 1 );
$( document ).on( "idle.idleTimer", function(){
ok( true, "idleTime fires at document by default" );
start();
$.idleTimer( "destroy" );
});
$.idleTimer( 100 );
});
}(jQuery));
|
Destroy idle timer instance after test has finished
|
Destroy idle timer instance after test has finished
|
JavaScript
|
mit
|
thorst/jquery-idletimer,amitabhaghosh197/jquery-idletimer,dpease/jquery-idletimer,amitabhaghosh197/jquery-idletimer,dpease/jquery-idletimer,thorst/jquery-idletimer
|
43906d08af184b3c20bb201dedf1d79de7dd8549
|
node-tests/unit/linting-compiler-test.js
|
node-tests/unit/linting-compiler-test.js
|
'use strict';
var assert = require('assert');
var buildTemplateCompiler = require('../helpers/template-compiler');
describe('Ember template compiler', function() {
var templateCompiler;
beforeEach(function() {
templateCompiler = buildTemplateCompiler();
});
it('sanity: compiles templates', function() {
var template = templateCompiler.precompile('<div></div>');
assert.ok(template, 'template is created from precompile');
});
it('sanity: loads plugins on the template compiler', function() {
var instanceCount = 0;
var NoopPlugin = function(){
instanceCount++;
};
NoopPlugin.prototype.transform = function(ast) {
return ast;
};
templateCompiler.registerPlugin('ast', NoopPlugin);
templateCompiler.precompile('<div></div>');
assert.equal(instanceCount, 1, 'registered plugins are instantiated');
});
});
|
'use strict';
var assert = require('assert');
var _compile = require('htmlbars').compile;
describe('Ember template compiler', function() {
var astPlugins;
function compile(template) {
return _compile(template, {
plugins: {
ast: astPlugins
}
});
}
beforeEach(function() {
astPlugins = [];
});
it('sanity: compiles templates', function() {
var template = compile('<div></div>');
assert.ok(template, 'template is created');
});
it('sanity: loads plugins on the template compiler', function() {
var instanceCount = 0;
var NoopPlugin = function(){
instanceCount++;
};
NoopPlugin.prototype.transform = function(ast) {
return ast;
};
astPlugins.push(NoopPlugin);
compile('<div></div>');
assert.equal(instanceCount, 1, 'registered plugins are instantiated');
});
});
|
Fix issues with HTMLBars parser transition.
|
Fix issues with HTMLBars parser transition.
|
JavaScript
|
mit
|
rwjblue/ember-cli-template-lint,oriSomething/ember-cli-template-lint,oriSomething/ember-template-lint,rwjblue/ember-cli-template-lint,rwjblue/ember-template-lint,oriSomething/ember-cli-template-lint
|
26e229add96b3fbf67a15bb3465832881ced5023
|
infrastructure/table-creation-wait.js
|
infrastructure/table-creation-wait.js
|
exports.runWhenTableIs = function (tableName, desiredStatus, db, callback) {
var describeParams = {};
describeParams.TableName = tableName;
db.describeTable(describeParams, function (err, data) {
if (data.Table.TableStatus === desiredStatus) {
callback();
} else{
var waitTimeMs = 1000;
setTimeout(function () {
console.log('table status is ' + data.Table.TableStatus);
console.log('waiting ' + waitTimeMs + 'ms for table status to be ' + desiredStatus);
exports.runWhenTableIs(tableName, desiredStatus, db, callback);
}, waitTimeMs);
}
});
}
|
exports.runWhenTableIs = function (tableName, desiredStatus, db, callback) {
var describeParams = {};
describeParams.TableName = tableName;
db.describeTable(describeParams, function (err, data) {
if (err) {
console.log(err);
} else if (data.Table.TableStatus === desiredStatus) {
callback();
} else{
var waitTimeMs = 1000;
setTimeout(function () {
console.log('table status is ' + data.Table.TableStatus);
console.log('waiting ' + waitTimeMs + 'ms for table status to be ' + desiredStatus);
exports.runWhenTableIs(tableName, desiredStatus, db, callback);
}, waitTimeMs);
}
});
}
|
Check for error and print when waiting for a particular table status.
|
Check for error and print when waiting for a particular table status.
|
JavaScript
|
apache-2.0
|
timg456789/musical-octo-train,timg456789/musical-octo-train,timg456789/musical-octo-train
|
470b44113fc07de8ada5b10a64a938177961347b
|
js/locales/bootstrap-datepicker.fi.js
|
js/locales/bootstrap-datepicker.fi.js
|
/**
* Finnish translation for bootstrap-datepicker
* Jaakko Salonen <https://github.com/jsalonen>
*/
;(function($){
$.fn.datepicker.dates['fi'] = {
days: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai", "sunnuntai"],
daysShort: ["sun", "maa", "tii", "kes", "tor", "per", "lau", "sun"],
daysMin: ["su", "ma", "ti", "ke", "to", "pe", "la", "su"],
months: ["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu"],
monthsShort: ["tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mar", "jou"],
today: "tänään"
};
}(jQuery));
|
/**
* Finnish translation for bootstrap-datepicker
* Jaakko Salonen <https://github.com/jsalonen>
*/
;(function($){
$.fn.datepicker.dates['fi'] = {
days: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai", "sunnuntai"],
daysShort: ["sun", "maa", "tii", "kes", "tor", "per", "lau", "sun"],
daysMin: ["su", "ma", "ti", "ke", "to", "pe", "la", "su"],
months: ["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu"],
monthsShort: ["tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mar", "jou"],
today: "tänään",
weekStart: 1,
format: "d.m.yyyy"
};
}(jQuery));
|
Fix Finnish week start to Monday, add format
|
Fix Finnish week start to Monday, add format
Finns *always* start their week on Mondays.
The d.m.yyyy date format is the most common one.
|
JavaScript
|
apache-2.0
|
oller/foundation-datepicker-sass,abnovak/bootstrap-sass-datepicker,rocLv/bootstrap-datepicker,rstone770/bootstrap-datepicker,wetet2/bootstrap-datepicker,Azaret/bootstrap-datepicker,osama9/bootstrap-datepicker,zhaoyan158567/bootstrap-datepicker,bitzesty/bootstrap-datepicker,HNygard/bootstrap-datepicker,wetet2/bootstrap-datepicker,NFC-DITO/bootstrap-datepicker,Doublemedia/bootstrap-datepicker,champierre/bootstrap-datepicker,aldano/bootstrap-datepicker,ashleymcdonald/bootstrap-datepicker,SimpleUpdates/bootstrap-datepicker,dswitzer/bootstrap-datepicker,fabdouglas/bootstrap-datepicker,aldano/bootstrap-datepicker,rstone770/bootstrap-datepicker,mfunkie/bootstrap-datepicker,huang-x-h/bootstrap-datepicker,thetimbanks/bootstrap-datepicker,TheJumpCloud/bootstrap-datepicker,xutongtong/bootstrap-datepicker,keiwerkgvr/bootstrap-datepicker,acrobat/bootstrap-datepicker,joubertredrat/bootstrap-datepicker,inway/bootstrap-datepicker,champierre/bootstrap-datepicker,Habitissimo/bootstrap-datepicker,Youraiseme/bootstrap-datepicker,mfunkie/bootstrap-datepicker,NFC-DITO/bootstrap-datepicker,jesperronn/bootstrap-datepicker,saurabh27125/bootstrap-datepicker,Zweer/bootstrap-datepicker,defrian8/bootstrap-datepicker,pacozaa/bootstrap-datepicker,mreiden/bootstrap-datepicker,cbryer/bootstrap-datepicker,darluc/bootstrap-datepicker,Sprinkle7/bootstrap-datepicker,keiwerkgvr/bootstrap-datepicker,WebbyLab/bootstrap-datepicker,janusnic/bootstrap-datepicker,ashleymcdonald/bootstrap-datepicker,vsn4ik/bootstrap-datepicker,ibcooley/bootstrap-datepicker,MartijnDwars/bootstrap-datepicker,dckesler/bootstrap-datepicker,CherryDT/bootstrap-datepicker,riyan8250/bootstrap-datepicker,kiwiupover/bootstrap-datepicker,yangyichen/bootstrap-datepicker,cbryer/bootstrap-datepicker,HuBandiT/bootstrap-datepicker,hebbet/bootstrap-datepicker,gn0st1k4m/bootstrap-datepicker,janusnic/bootstrap-datepicker,uxsolutions/bootstrap-datepicker,kevintvh/bootstrap-datepicker,mfunkie/bootstrap-datepicker,MartijnDwars/bootstrap-datepicker,Invulner/bootstrap-datepicker,1000hz/bootstrap-datepicker,defrian8/bootstrap-datepicker,vsn4ik/bootstrap-datepicker,Mteuahasan/bootstrap-datepicker,stenmuchow/bootstrap-datepicker,cherylyan/bootstrap-datepicker,saurabh27125/bootstrap-datepicker,chengky/bootstrap-datepicker,Azaret/bootstrap-datepicker,Habitissimo/bootstrap-datepicker,Invulner/bootstrap-datepicker,otnavle/bootstrap-datepicker,uxsolutions/bootstrap-datepicker,Tekzenit/bootstrap-datepicker,christophercaburog/bootstrap-datepicker,eternicode/bootstrap-datepicker,steffendietz/bootstrap-datepicker,dckesler/bootstrap-datepicker,Habitissimo/bootstrap-datepicker,steffendietz/bootstrap-datepicker,eternicode/bootstrap-datepicker,tcrossland/bootstrap-datepicker,osama9/bootstrap-datepicker,fabdouglas/bootstrap-datepicker,gn0st1k4m/bootstrap-datepicker,martinRjs/bootstrap-datepicker,menatoric59/bootstrap-datepicker,hemp/bootstrap-datepicker,tcrossland/bootstrap-datepicker,kevintvh/bootstrap-datepicker,chengky/bootstrap-datepicker,abnovak/bootstrap-sass-datepicker,vgrish/bootstrap-datepicker,zhaoyan158567/bootstrap-datepicker,SimpleUpdates/bootstrap-datepicker,nerionavea/bootstrap-datepicker,rocLv/bootstrap-datepicker,WeiLend/bootstrap-datepicker,wulinmengzhu/bootstrap-datepicker,1000hz/bootstrap-datepicker,jhalak/bootstrap-datepicker,menatoric59/bootstrap-datepicker,dswitzer/bootstrap-datepicker,Tekzenit/bootstrap-datepicker,wulinmengzhu/bootstrap-datepicker,WebbyLab/bootstrap-datepicker,i-am-kenny/bootstrap-datepicker,Doublemedia/bootstrap-datepicker,daniyel/bootstrap-datepicker,nilbus/bootstrap-datepicker,nilbus/bootstrap-datepicker,hebbet/bootstrap-datepicker,vgrish/bootstrap-datepicker,josegomezr/bootstrap-datepicker,stenmuchow/bootstrap-datepicker,oller/foundation-datepicker-sass,WeiLend/bootstrap-datepicker,1000hz/bootstrap-datepicker,acrobat/bootstrap-datepicker,parkeugene/bootstrap-datepicker,TheJumpCloud/bootstrap-datepicker,CherryDT/bootstrap-datepicker,huang-x-h/bootstrap-datepicker,christophercaburog/bootstrap-datepicker,nerionavea/bootstrap-datepicker,bitzesty/bootstrap-datepicker,inway/bootstrap-datepicker,daniyel/bootstrap-datepicker,riyan8250/bootstrap-datepicker,inspur-tobacco/bootstrap-datepicker,darluc/bootstrap-datepicker,Sprinkle7/bootstrap-datepicker,jesperronn/bootstrap-datepicker,yangyichen/bootstrap-datepicker,martinRjs/bootstrap-datepicker,wearespindle/datepicker-js,otnavle/bootstrap-datepicker,Mteuahasan/bootstrap-datepicker,josegomezr/bootstrap-datepicker,hemp/bootstrap-datepicker,inukshuk/bootstrap-datepicker,CheapSk8/bootstrap-datepicker,oller/foundation-datepicker-sass,parkeugene/bootstrap-datepicker,joubertredrat/bootstrap-datepicker,Zweer/bootstrap-datepicker,vegardok/bootstrap-datepicker,thetimbanks/bootstrap-datepicker,vegardok/bootstrap-datepicker,xutongtong/bootstrap-datepicker,mreiden/bootstrap-datepicker,i-am-kenny/bootstrap-datepicker,HNygard/bootstrap-datepicker,CheapSk8/bootstrap-datepicker,kiwiupover/bootstrap-datepicker,Youraiseme/bootstrap-datepicker,josegomezr/bootstrap-datepicker,ibcooley/bootstrap-datepicker,inukshuk/bootstrap-datepicker,HuBandiT/bootstrap-datepicker,inspur-tobacco/bootstrap-datepicker,fabdouglas/bootstrap-datepicker,WebbyLab/bootstrap-datepicker,pacozaa/bootstrap-datepicker,jhalak/bootstrap-datepicker,Zweer/bootstrap-datepicker,cherylyan/bootstrap-datepicker
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.