commit
stringlengths
40
40
old_file
stringlengths
4
264
new_file
stringlengths
4
264
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
624
message
stringlengths
15
4.7k
lang
stringclasses
3 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
a84b8d2ae8a5abd33936115ef83200fbe8a2d390
docs/config.js
docs/config.js
self.$config = { landing: false, debug: false, repo: 'soruly/whatanime.ga', twitter: 'soruly', url: 'https://whatanime.ga', sidebar: true, disableSidebarToggle: false, nav: { default: [] }, icons: [], plugins: [] }
docute.init({ landing: false, debug: false, repo: 'soruly/whatanime.ga', twitter: 'soruly', url: 'https://whatanime.ga', sidebar: true, disableSidebarToggle: false, nav: { default: [] }, icons: [], plugins: [] });
Update docs for docute v3.0.0
Update docs for docute v3.0.0
JavaScript
mit
soruly/whatanime.ga,soruly/whatanime.ga,soruly/whatanime.ga
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
517f1514da2ee5ab1037badc574e1975ec386959
Test/AudioEngineTest.js
Test/AudioEngineTest.js
setTimeout( function() { var util = require( "util" ); process.on('uncaughtException', function (err) { console.error(err); console.log("Node NOT Exiting..."); }); var audioEngineImpl = require( "../Debug/NodeCoreAudio" ); console.log( audioEngineImpl ); var audioEngine = audioEngineImpl.createAudioEngine( function(uSampleFrames, inputBuffer, outputBuffer) { console.log( "aw shit, we got some samples" ); }); // Make sure the audio engine is still active if( audioEngine.isActive() ) console.log( "active" ); else console.log( "not active" ); // Declare our processing function function processAudio( numSamples, incomingSamples ) { for( var iSample = 0; iSample < numSamples; ++iSample ) { incomingSamples[iSample] = iSample/numSamples; } return incomingSamples; } // Start polling the audio engine for data every 2 milliseconds setInterval( function() { audioEngine.processIfNewData( processAudio ); }, 2 ); }, 15000);
setTimeout( function() { var util = require( "util" ); process.on('uncaughtException', function (err) { console.error(err); console.log("Node NOT Exiting..."); }); var audioEngineImpl = require( "../Debug/NodeCoreAudio" ); console.log( audioEngineImpl ); var audioEngine = audioEngineImpl.createAudioEngine( function(uSampleFrames, inputBuffer, outputBuffer) { console.log( "aw shit, we got some samples" ); }); // Make sure the audio engine is still active if( audioEngine.isActive() ) console.log( "active" ); else console.log( "not active" ); // Declare our processing function function processAudio( numSamples, incomingSamples ) { for( var iSample = 0; iSample < numSamples; ++iSample ) { incomingSamples[iSample] = iSample/numSamples; } return incomingSamples; } // Start polling the audio engine for data as fast as we can setInterval( function() { audioEngine.processIfNewData( processAudio ); }, 0 ); }, 0);
Check for new audio data as fast as possible from javascript (may eat CPU)
Check for new audio data as fast as possible from javascript (may eat CPU)
JavaScript
mit
GeorgeStrakhov/node-core-audio,ZECTBynmo/node-core-audio,ZECTBynmo/node-core-audio,ZECTBynmo/node-core-audio,GeorgeStrakhov/node-core-audio,ZECTBynmo/node-core-audio,GeorgeStrakhov/node-core-audio,GeorgeStrakhov/node-core-audio
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
24310a75287aea1947f22c152d7966433d4d0bb3
actions/vmInfo.js
actions/vmInfo.js
const execute = require('../lib/executeCommand'); module.exports = (vm) => { return new Promise((resolve, reject) => { execute(['showvminfo', '"' + vm + '"']).then(stdout => { let info = []; let regex = /^(.*?):\s+(.*)$/gim; let match; while (match = regex.exec(stdout)) { if (match.index === regex.lastIndex) { regex.lastIndex++; } // Trim let varname = match[1].trim().toLowerCase().replace(/ /g, '_'); let value = match[2].trim(); info[varname] = value; } resolve(info); }).catch(reject); }); };
const execute = require('../lib/executeCommand'); module.exports = (vm) => { return new Promise((resolve, reject) => { execute(['showvminfo', '"' + vm + '"']).then(stdout => { let info = {}; let regex = /^(.*?):\s+(.*)$/gim; let match; while (match = regex.exec(stdout)) { if (match.index === regex.lastIndex) { regex.lastIndex++; } // Trim let varname = match[1].trim().toLowerCase().replace(/ /g, '_'); let value = match[2].trim(); info[varname] = value; } resolve(info); }).catch(reject); }); };
Use Object and not array.
Use Object and not array. Instead of using `info = []`. To which if we try to assign properties, doesn't seem to work well. Hence, try to use object representation, which allows us to use `info.name` or assign it another object.
JavaScript
mit
VBoxNode/NodeVBox
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
5e5313d8b1659f9fbdee5ff3cf6198c696928005
atom/common/api/lib/shell.js
atom/common/api/lib/shell.js
'use strict'; const bindings = process.atomBinding('shell'); exports.beep = bindings.beep; exports.moveItemToTrash = bindings.moveItemToTrash; exports.openItem = bindings.openItem; exports.showItemInFolder = bindings.showItemInFolder; exports.openExternal = (url, options) => { var activate = true; if (options != null && options.activate != null) { activate = !!options.activate; } bindings._openExternal(url, activate); }
'use strict'; const bindings = process.atomBinding('shell'); exports.beep = bindings.beep; exports.moveItemToTrash = bindings.moveItemToTrash; exports.openItem = bindings.openItem; exports.showItemInFolder = bindings.showItemInFolder; exports.openExternal = (url, options) => { var activate = true; if (options != null && options.activate != null) { activate = !!options.activate; } return bindings._openExternal(url, activate); }
Return value from bindings method
Return value from bindings method
JavaScript
mit
wan-qy/electron,kokdemo/electron,aliib/electron,miniak/electron,minggo/electron,MaxWhere/electron,stevekinney/electron,brave/muon,posix4e/electron,minggo/electron,rajatsingla28/electron,voidbridge/electron,renaesop/electron,MaxWhere/electron,pombredanne/electron,kcrt/electron,wan-qy/electron,Floato/electron,thompsonemerson/electron,Floato/electron,kokdemo/electron,felixrieseberg/electron,brenca/electron,stevekinney/electron,simongregory/electron,twolfson/electron,leethomas/electron,posix4e/electron,tonyganch/electron,preco21/electron,minggo/electron,tonyganch/electron,aichingm/electron,miniak/electron,biblerule/UMCTelnetHub,voidbridge/electron,simongregory/electron,Gerhut/electron,the-ress/electron,MaxWhere/electron,thompsonemerson/electron,tinydew4/electron,thomsonreuters/electron,gerhardberger/electron,twolfson/electron,deed02392/electron,gerhardberger/electron,jhen0409/electron,leethomas/electron,stevekinney/electron,biblerule/UMCTelnetHub,brave/electron,leethomas/electron,minggo/electron,bpasero/electron,kcrt/electron,pombredanne/electron,seanchas116/electron,noikiy/electron,miniak/electron,rreimann/electron,Floato/electron,noikiy/electron,joaomoreno/atom-shell,seanchas116/electron,brave/electron,kcrt/electron,deed02392/electron,electron/electron,thomsonreuters/electron,Floato/electron,voidbridge/electron,jhen0409/electron,thompsonemerson/electron,rreimann/electron,voidbridge/electron,minggo/electron,tonyganch/electron,the-ress/electron,thomsonreuters/electron,rreimann/electron,brave/electron,jhen0409/electron,preco21/electron,posix4e/electron,posix4e/electron,felixrieseberg/electron,the-ress/electron,jhen0409/electron,noikiy/electron,tinydew4/electron,brave/muon,voidbridge/electron,kokdemo/electron,twolfson/electron,stevekinney/electron,posix4e/electron,bbondy/electron,jhen0409/electron,the-ress/electron,preco21/electron,wan-qy/electron,miniak/electron,seanchas116/electron,miniak/electron,preco21/electron,felixrieseberg/electron,thompsonemerson/electron,electron/electron,leethomas/electron,Gerhut/electron,joaomoreno/atom-shell,minggo/electron,shiftkey/electron,seanchas116/electron,tinydew4/electron,brenca/electron,rajatsingla28/electron,rajatsingla28/electron,biblerule/UMCTelnetHub,electron/electron,bbondy/electron,dongjoon-hyun/electron,bbondy/electron,bpasero/electron,thompsonemerson/electron,gabriel/electron,bpasero/electron,noikiy/electron,seanchas116/electron,preco21/electron,pombredanne/electron,gerhardberger/electron,electron/electron,brave/muon,simongregory/electron,brave/electron,twolfson/electron,Floato/electron,pombredanne/electron,aichingm/electron,tonyganch/electron,gabriel/electron,simongregory/electron,Gerhut/electron,rreimann/electron,aliib/electron,aichingm/electron,aliib/electron,bbondy/electron,brenca/electron,renaesop/electron,thomsonreuters/electron,tinydew4/electron,kcrt/electron,joaomoreno/atom-shell,leethomas/electron,rreimann/electron,dongjoon-hyun/electron,bbondy/electron,kokdemo/electron,deed02392/electron,kcrt/electron,felixrieseberg/electron,bpasero/electron,rajatsingla28/electron,shiftkey/electron,tinydew4/electron,aliib/electron,aichingm/electron,wan-qy/electron,kcrt/electron,posix4e/electron,felixrieseberg/electron,gerhardberger/electron,brave/electron,brenca/electron,tinydew4/electron,thompsonemerson/electron,gabriel/electron,seanchas116/electron,dongjoon-hyun/electron,twolfson/electron,renaesop/electron,renaesop/electron,simongregory/electron,Gerhut/electron,rajatsingla28/electron,rreimann/electron,biblerule/UMCTelnetHub,brenca/electron,MaxWhere/electron,electron/electron,brave/muon,renaesop/electron,Gerhut/electron,thomsonreuters/electron,kokdemo/electron,brave/muon,deed02392/electron,brave/electron,biblerule/UMCTelnetHub,pombredanne/electron,noikiy/electron,miniak/electron,the-ress/electron,the-ress/electron,brenca/electron,electron/electron,gerhardberger/electron,tonyganch/electron,shiftkey/electron,simongregory/electron,bpasero/electron,gerhardberger/electron,Gerhut/electron,bbondy/electron,felixrieseberg/electron,gerhardberger/electron,gabriel/electron,the-ress/electron,shiftkey/electron,biblerule/UMCTelnetHub,thomsonreuters/electron,brave/muon,bpasero/electron,MaxWhere/electron,pombredanne/electron,gabriel/electron,Floato/electron,aliib/electron,dongjoon-hyun/electron,joaomoreno/atom-shell,aichingm/electron,shiftkey/electron,leethomas/electron,rajatsingla28/electron,stevekinney/electron,voidbridge/electron,preco21/electron,joaomoreno/atom-shell,wan-qy/electron,renaesop/electron,MaxWhere/electron,gabriel/electron,shiftkey/electron,twolfson/electron,wan-qy/electron,joaomoreno/atom-shell,jhen0409/electron,kokdemo/electron,deed02392/electron,aichingm/electron,dongjoon-hyun/electron,aliib/electron,stevekinney/electron,deed02392/electron,tonyganch/electron,noikiy/electron,dongjoon-hyun/electron,electron/electron,bpasero/electron
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
7e9f1de81def0f6e02207edfba35173854f1d6e3
src/template/html_parser.js
src/template/html_parser.js
'use strict'; var DefaultStack = require('./stacks/default'); var entityMap = require('html-tokenizer/entity-map'); // @TODO examine other tokenizers or parsers var Parser = require('html-tokenizer/parser'); module.exports = function(html, stack) { var _stack = stack || new DefaultStack(true); var parser = new Parser({ entities: entityMap }); parser.on('open', function(name, attributes) { _stack.openElement(name, attributes); }); parser.on('comment', function(text) { _stack.createComment(text); }); parser.on('text', function(text) { _stack.createObject(text); }); parser.on('close', function() { var el = _stack.peek(); _stack.closeElement(el); }); parser.parse(html); if (!stack) { return _stack.getOutput(); } };
'use strict'; var DefaultStack = require('./stacks/default'); var entityMap = require('html-tokenizer/entity-map'); // @TODO examine other tokenizers or parsers var Parser = require('html-tokenizer/parser'); var defaultStack = new DefaultStack(true); var _stack; var parser = new Parser({ entities: entityMap }); parser.on('open', function(name, attributes) { _stack.openElement(name, attributes); }); parser.on('comment', function(text) { _stack.createComment(text); }); parser.on('text', function(text) { _stack.createObject(text); }); parser.on('close', function() { var el = _stack.peek(); _stack.closeElement(el); }); module.exports = function(html, stack) { if (stack) { _stack = stack; } else { defaultStack.clear(); _stack = defaultStack; } parser.parse(html); if (!stack) { return _stack.getOutput(); } };
Move parser construction outside parse function to fix performance hit
Move parser construction outside parse function to fix performance hit
JavaScript
apache-2.0
wayfair/tungstenjs,wayfair/tungstenjs
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
f0aaff823cec2b5733397f0eff4fd22d14de48e2
test/bitcoind/chain.unit.js
test/bitcoind/chain.unit.js
'use strict'; var should = require('chai').should(); var bitcoinlib = require('../../'); var sinon = require('sinon'); var Chain = bitcoinlib.RPCNode.Chain; describe('Bitcoind Chain', function() { describe('#_writeBlock', function() { it('should update hashes and call putBlock', function(done) { var chain = new Chain(); chain.db = { putBlock: sinon.stub().callsArg(1) }; chain._writeBlock({hash: 'hash', prevHash: 'prevhash'}, function(err) { should.not.exist(err); chain.db.putBlock.callCount.should.equal(1); chain.cache.hashes.hash.should.equal('prevhash'); done(); }); }); }); describe('#_validateBlock', function() { it('should call the callback', function(done) { var chain = new Chain(); chain._validateBlock('block', function(err) { should.not.exist(err); done(); }); }); }); });
'use strict'; var should = require('chai').should(); var bitcoinlib = require('../../'); var sinon = require('sinon'); var Chain = bitcoinlib.BitcoindNode.Chain; describe('Bitcoind Chain', function() { describe('#_writeBlock', function() { it('should update hashes and call putBlock', function(done) { var chain = new Chain(); chain.db = { putBlock: sinon.stub().callsArg(1) }; chain._writeBlock({hash: 'hash', prevHash: 'prevhash'}, function(err) { should.not.exist(err); chain.db.putBlock.callCount.should.equal(1); chain.cache.hashes.hash.should.equal('prevhash'); done(); }); }); }); describe('#_validateBlock', function() { it('should call the callback', function(done) { var chain = new Chain(); chain._validateBlock('block', function(err) { should.not.exist(err); done(); }); }); }); });
Use the correct dep "BitcoindNode"
Use the correct dep "BitcoindNode"
JavaScript
mit
bitpay/chainlib-bitcoin
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
aa58e823ae5f6ce86b71996a1014ad9aca01ea2b
config/strategies/spotify.js
config/strategies/spotify.js
'use strict'; /** * Module dependencies. */ var passport = require('passport'), refresh = require('passport-oauth2-refresh'), SpotifyStrategy = require('passport-spotify').Strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); module.exports = function() { // Use spotify strategy var strategy = new SpotifyStrategy({ clientID: config.spotify.clientID, clientSecret: config.spotify.clientSecret, callbackURL: config.spotify.callbackURL, }, function(req, accessToken, refreshToken, profile, done) { // Set the provider data and include tokens var providerData = profile._json; /** * NOTE: There is a bug in passport where the accessToken and * refresh token and swapped. I am patching this in the strategy * so I don't have to apply this backwards logic throughout the app */ providerData.accessToken = refreshToken.access_token; providerData.refreshToken = accessToken; // Create the user OAuth profile var providerUserProfile = { displayName: profile.displayName, username: profile.id, provider: 'spotify', providerIdentifierField: 'id', providerData: providerData }; // Save the user OAuth profile users.saveOAuthUserProfile(req, providerUserProfile, done); } ); passport.use(strategy); refresh.use(strategy); };
'use strict'; /** * Module dependencies. */ var passport = require('passport'), refresh = require('passport-oauth2-refresh'), SpotifyStrategy = require('passport-spotify').Strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); module.exports = function() { // Use spotify strategy var strategy = new SpotifyStrategy({ clientID: config.spotify.clientID, clientSecret: config.spotify.clientSecret, callbackURL: config.spotify.callbackURL, }, function(req, accessToken, refreshToken, profile, done) { // Set the provider data and include tokens var providerData = profile._json; /** * NOTE: There is a bug in passport where the accessToken and * refresh token and swapped. I am patching this in the strategy * so I don't have to apply this backwards logic throughout the app */ providerData.accessToken = refreshToken.access_token; providerData.refreshToken = accessToken; // Create the user OAuth profile var providerUserProfile = { displayName: profile.displayName || profile.id, username: profile.id, provider: 'spotify', providerIdentifierField: 'id', providerData: providerData }; // Save the user OAuth profile users.saveOAuthUserProfile(req, providerUserProfile, done); } ); passport.use(strategy); refresh.use(strategy); };
Use profile id if display name is null
Use profile id if display name is null - closes #54
JavaScript
mit
mbukosky/SpotifyUnchained,mbukosky/SpotifyUnchained,mbukosky/SpotifyUnchained,mbukosky/SpotifyUnchained
b6a7938d97dfcbceca256292ad8f3d68742d576d
tests/content/cookies/6547/issue6547.js
tests/content/cookies/6547/issue6547.js
function runTest() { FBTest.sysout("issue6547.START"); FBTest.openNewTab(basePath + "cookies/6547/issue6547.php", function(win) { FBTest.openFirebug(); FBTest.selectPanel("net"); FBTestFireCookie.enableCookiePanel(); FBTest.enableNetPanel(function(win) { var options = { tagName: "tr", classes: "netRow category-html hasHeaders loaded" }; FBTest.waitForDisplayedElement("net", options, function(row) { var panelNode = FBTest.selectPanel("net").panelNode; FBTest.click(row); FBTest.expandElements(panelNode, "netInfoCookiesTab"); var selector = ".netInfoReceivedCookies .cookieRow .cookieMaxAgeLabel"; var label = panelNode.querySelector(selector); FBTest.compare("0", label.textContent, "Max age must be zero"); FBTest.testDone("issue6547.DONE"); }); }); }); }
function runTest() { FBTest.sysout("issue6547.START"); FBTest.openNewTab(basePath + "cookies/6547/issue6547.php", function(win) { FBTest.openFirebug(); FBTest.selectPanel("net"); FBTestFireCookie.enableCookiePanel(); FBTest.enableNetPanel(function(win) { var options = { tagName: "tr", classes: "netRow category-html hasHeaders loaded" }; FBTest.waitForDisplayedElement("net", options, function(row) { var panelNode = FBTest.selectPanel("net").panelNode; FBTest.click(row); FBTest.expandElements(panelNode, "netInfoCookiesTab"); var selector = ".netInfoReceivedCookies .cookieRow .cookieMaxAgeLabel"; var label = panelNode.querySelector(selector); FBTest.compare("0ms", label.textContent, "Max age must be zero"); FBTest.testDone("issue6547.DONE"); }); }); }); }
Fix 6547 test case to account for new formatTime return
Fix 6547 test case to account for new formatTime return
JavaScript
bsd-3-clause
firebug/tracing-console,firebug/tracing-console
644fa033779995474b353d452c4384faaa3917a4
lib/reduce-statuses.js
lib/reduce-statuses.js
module.exports = function (context, statusChain) { context.log.debug(`Reducing status chain ${statusChain}`); const reduced = statusChain.reduce((overallStatus, currentStatus) => { if (currentStatus === 'error' || overallStatus === 'error') { return 'error'; } if (overallStatus === 'failure') { return 'failure'; } return currentStatus; }); context.log.debug(`Reduced status chain to ${reduced}`); return reduced; };
module.exports = function (context, statusChain) { context.log.debug(`Reducing status chain [${statusChain.join(', ')}]`); const reduced = statusChain.reduce((overallStatus, currentStatus) => { if (currentStatus === 'error' || overallStatus === 'error') { return 'error'; } if (overallStatus === 'failure') { return 'failure'; } return currentStatus; }); context.log.debug(`Reduced status chain to ${reduced}`); return reduced; };
Improve status chain logging output
Improve status chain logging output
JavaScript
mit
jarrodldavis/probot-gpg
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
a75aa8e8c07652d7e4910b6d2e70e3d7f08fe569
app/scripts/move-popup/dimItemTag.directive.js
app/scripts/move-popup/dimItemTag.directive.js
(function() { 'use strict'; angular.module('dimApp').component('dimItemTag', { controller: ItemTagController, bindings: { item: '=' }, template: ` <select ng-options="tag as tag.label | translate for tag in $ctrl.settings.itemTags track by tag.type" ng-model="$ctrl.selected" ng-change="$ctrl.updateTag()"></select> ` }); ItemTagController.$inject = ['$scope', '$rootScope', 'dimSettingsService']; function ItemTagController($scope, $rootScope, dimSettingsService) { var vm = this; vm.settings = dimSettingsService; $scope.$watch(() => vm.item.dimInfo.tag, function() { vm.selected = _.find(vm.settings.itemTags, function(tag) { return tag.type === vm.item.dimInfo.tag; }); }); vm.updateTag = function() { vm.item.dimInfo.tag = vm.selected.type; $rootScope.$broadcast('dim-filter-invalidate'); vm.item.dimInfo.save(); }; $scope.$on('dim-item-tag', (e, args) => { if (vm.item.dimInfo.tag === args.tag) { delete vm.item.dimInfo.tag; } else { vm.item.dimInfo.tag = args.tag; } $rootScope.$broadcast('dim-filter-invalidate'); vm.item.dimInfo.save(); }); } })();
(function() { 'use strict'; angular.module('dimApp').component('dimItemTag', { controller: ItemTagController, bindings: { item: '=' }, template: ` <select ng-options="tag as tag.label | translate for tag in $ctrl.settings.itemTags track by tag.type" ng-model="$ctrl.selected" ng-change="$ctrl.updateTag()"></select> ` }); ItemTagController.$inject = ['$scope', '$rootScope', 'dimSettingsService']; function ItemTagController($scope, $rootScope, dimSettingsService) { var vm = this; vm.settings = dimSettingsService; $scope.$watch('$ctrl.item.dimInfo.tag', function() { vm.selected = _.find(vm.settings.itemTags, function(tag) { return tag.type === vm.item.dimInfo.tag; }); }); vm.updateTag = function() { vm.item.dimInfo.tag = vm.selected.type; $rootScope.$broadcast('dim-filter-invalidate'); vm.item.dimInfo.save(); }; $scope.$on('dim-item-tag', (e, args) => { if (vm.item.dimInfo.tag === args.tag) { delete vm.item.dimInfo.tag; } else { vm.item.dimInfo.tag = args.tag; } $rootScope.$broadcast('dim-filter-invalidate'); vm.item.dimInfo.save(); }); } })();
Fix tag update when there's no tag
Fix tag update when there's no tag
JavaScript
mit
chrisfried/DIM,bhollis/DIM,DestinyItemManager/DIM,delphiactual/DIM,DestinyItemManager/DIM,DestinyItemManager/DIM,chrisfried/DIM,48klocs/DIM,bhollis/DIM,bhollis/DIM,DestinyItemManager/DIM,bhollis/DIM,chrisfried/DIM,LouisFettet/DIM,LouisFettet/DIM,48klocs/DIM,delphiactual/DIM,delphiactual/DIM,chrisfried/DIM,48klocs/DIM,delphiactual/DIM
01694cf1a26b9c869960a498e07c358f85cb7c71
web_app/routes/socket.js
web_app/routes/socket.js
/* * Serve content over a socket */ module.exports = function (socket) { socket.emit('send:name', { name: 'Bob' }); };
/* * Serve content over a socket */ module.exports = function (socket) { // socket.emit('send:name', { // name: 'Bob' // }); };
Comment this out for now
Comment this out for now
JavaScript
mit
projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox
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
3a642093d2344c91f1ebdbfcc73cbc2b74125fef
nls/Strings.js
nls/Strings.js
define( function( require, exports, module ) { 'use strict'; module.exports = { root: true, de: true, es: true, fr: true, gl: true, it: true, sv: true, uk: true, ru: true }; } );
define( function( require, exports, module ) { 'use strict'; module.exports = { root: true, de: true, es: true, fr: true, gl: true, it: true, ru: true, sv: true, uk: true }; } );
Use alphabetic ordering of nls.
Use alphabetic ordering of nls.
JavaScript
mit
sensuigit/brackets-autoprefixer,sensuigit/brackets-autoprefixer,mikaeljorhult/brackets-autoprefixer,mikaeljorhult/brackets-autoprefixer
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
5124587953b57db865ec3a63af138e7e43ba6a9a
app/app.js
app/app.js
(function() { var app = angular.module('notely', [ 'ui.router', 'notely.notes', 'notely.notes.service' ]); function config($urlRouterProvider) { $urlRouterProvider.otherwise('/notes'); } config['$inject'] = ['$urlRouterProvider']; app.config(config); })();
(function() { var app = angular.module('notely', [ 'ui.router', 'notely.notes', 'notely.notes.service' ]); function config($urlRouterProvider) { $urlRouterProvider.otherwise('/notes/'); } config['$inject'] = ['$urlRouterProvider']; app.config(config); })();
Update default route to include trailing slash.
Update default route to include trailing slash.
JavaScript
mit
FretlessBecks/notely,williamrulon/notely-1,FretlessBecks/notely,williamrulon/notely-1
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
826009860e444c74fbb20d668327a4f49e8f678d
public/scripts/chat.js
public/scripts/chat.js
new Vue({ el: '#app', // Using ES6 string litteral delimiters because // Go uses {{ . }} for its templates delimiters: ['${', '}'], data: { ws: null, message: '', chat: [], }, created: function() { let protocol = (window.location.protocol === 'https') ? 'wss' : 'ws' this.ws = new WebSocket(`${protocol}://${window.location.host}/ws`) this.ws.addEventListener('message', (e) => { let { user, avatar, content } = JSON.parse(e.data) this.chat.push({ user, avatar, content }) }) }, methods: { send: function() { if (!this.message) { return } this.ws.send( JSON.stringify({ content: this.message, }) ) this.message = '' }, } })
new Vue({ el: '#app', // Using ES6 string litteral delimiters because // Go uses {{ . }} for its templates delimiters: ['${', '}'], data: { ws: null, message: '', chat: [], }, created: function() { let protocol = (window.location.protocol === 'https:') ? 'wss:' : 'ws:' this.ws = new WebSocket(`${protocol}//${window.location.host}/ws`) this.ws.addEventListener('message', (e) => { let { user, avatar, content } = JSON.parse(e.data) this.chat.push({ user, avatar, content }) }) }, methods: { send: function() { if (!this.message) { return } this.ws.send( JSON.stringify({ content: this.message, }) ) this.message = '' }, } })
Set protocol correctly ... oops
Set protocol correctly ... oops
JavaScript
mit
AntonioVdlC/chat,AntonioVdlC/chat,AntonioVdlC/chat
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>&nbsp;${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>&nbsp;${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
b32664408a5c57f30a734da5c925ca9453696d1c
js/findermodel.js
js/findermodel.js
'use strict'; /** * Finder Model - Main model that uses FinderJS * * @constructor */ var FinderModel = function (arg) { // Assign `this` through `riot.observable()` var self = riot.observable(this); // Store args self.args = arg; // Create an instance of `Applait.Finder` self.finder = new Applait.Finder({ type: "sdcard", minSearchLength: 2, debugMode: arg.debug }); // Current search results self.searchResults = []; /** * Reset all internals */ self.reset = function () { self.searchResults = []; self.finder.reset(); }; /** * Initiate search * * @param {string} key - The search string */ self.search = function (key) { self.reset(); self.finder.search(key); }; /** * Subscribe to Finder's fileFound event */ self.finder.on("fileFound", function (file) { self.searchResults.push(file); }); /** * Subscribe to Finder's searchComplete event * * The `resultsFound` is triggered if any file is matched. * Else, `noResults` is triggered */ self.finder.on("searchComplete", function () { if (self.searchResults.length && self.finder.filematchcount) { self.trigger("resultsFound"); } else { self.trigger("noResults"); } }); };
'use strict'; /** * Finder Model - Main model that uses FinderJS * * @constructor */ var FinderModel = function (arg) { // Assign `this` through `riot.observable()` var self = riot.observable(this); // Store args self.args = arg; // Create an instance of `Applait.Finder` self.finder = new Applait.Finder({ type: "sdcard", minSearchLength: 2, debugMode: arg.debug }); // Current search results self.searchResults = []; /** * Reset all internals */ self.reset = function () { self.searchResults = []; self.finder.reset(); }; /** * Initiate search * * @param {string} key - The search string */ self.search = function (key) { self.reset(); self.finder.search(key); }; /** * Subscribe to Finder's fileFound event */ self.finder.on("fileFound", function (file) { self.searchResults.push(file); }); /** * Subscribe to Finder's searchComplete event * * The `resultsFound` is triggered if any file is matched. * Else, `noResults` is triggered */ self.finder.on("searchComplete", function () { if (self.searchResults.length && self.finder.filematchcount) { self.trigger("resultsFound"); } else { self.trigger("noResults"); } }); /** * Provide a generic "load" method for routing */ self.load = function (path) { self.trigger("load:" + path); }; };
Add a generic load method for routes
Add a generic load method for routes Signed-off-by: Kaustav Das Modak <[email protected]>
JavaScript
apache-2.0
applait/finder,vasuki1996/finder,applait/finder,vasuki1996/finder
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
c01248767fc5f6b2ffb755f02bd32287c21ae8e4
google-services-list.user.js
google-services-list.user.js
// ==UserScript== // @name Google Service List // @namespace wsmwason.google.service.list // @description List all Google services on support page, and auto redirect to product url. // @include https://support.google.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @auther wsmwason // @version 1.0 // @license MIT // @grant none // ==/UserScript== // hide show all icon $('.show-all').hide(); // display hide container $('.all-hc-container').addClass('all-hc-container-shown'); // add link redirect param for next page $('a').each(function(){ var stid = $(this).attr('st-id'); if (typeof stid !== typeof undefined && stid !== false) { $(this).attr('href', $(this).attr('href')+'&redirect=1').attr('target', '_blank'); } }); // auto redirect to product url if (location.search.indexOf('redirect=1') > 0) { // find product-icon link var productIcon = $('a.product-icon'); if (productIcon.length == 1) { var productUrl = productIcon.attr('href'); location.href = productUrl; } }
// ==UserScript== // @name Google Services List // @namespace wsmwason.google.services.list // @description List all Google services on support page, and auto redirect to product url. // @include https://support.google.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @auther wsmwason // @version 1.1 // @license MIT // @grant none // ==/UserScript== // hide show all icon $('.show-all').hide(); // display hide container $('.all-hc-container').addClass('all-hc-container-shown'); // add link redirect param for next page $('a').each(function(){ var stid = $(this).attr('st-id'); if (typeof stid !== typeof undefined && stid !== false) { $(this).attr('href', $(this).attr('href')+'&redirect=1').attr('target', '_blank'); } }); // auto redirect to product url if (location.search.indexOf('redirect=1') > 0) { // find product-icon link var productIcon = $('a.product-icon'); if (productIcon.length == 1) { var productUrl = productIcon.attr('href'); location.href = productUrl; } }
Update script name and namespace
Update script name and namespace
JavaScript
mit
wsmwason/google-services-list
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
4cc6f5ff25db2cc61cb153a6d60e6a5d5d4a6588
lib/install/action/update-linked.js
lib/install/action/update-linked.js
'use strict' var path = require('path') module.exports = function (top, buildpath, pkg, log, next) { if (pkg.package.version !== pkg.oldPkg.package.version) log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") next() }
'use strict' var path = require('path') module.exports = function (top, buildpath, pkg, log, next) { if (pkg.package.version !== pkg.oldPkg.package.version) { log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") } next() }
Fix up style to meet requirements for build
Fix up style to meet requirements for build
JavaScript
artistic-2.0
DaveEmmerson/npm,DaveEmmerson/npm,DaveEmmerson/npm
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
caa5746cb434bfa17731d00e25f2272aed89ccd0
js/locales/bootstrap-datepicker.mk.js
js/locales/bootstrap-datepicker.mk.js
/** * Macedonian translation for bootstrap-datepicker * Marko Aleksic <[email protected]> */ ;(function($){ $.fn.datepicker.dates['mk'] = { days: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота", "Недела"], daysShort: ["Нед", "Пон", "Вто", "Сре", "Чет", "Пет", "Саб", "Нед"], daysMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Са", "Не"], months: ["Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември"], monthsShort: ["Јан", "Фев", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Ное", "Дек"], today: "Денес", format: "dd.MM.yyyy" }; }(jQuery));
/** * Macedonian translation for bootstrap-datepicker * Marko Aleksic <[email protected]> */ ;(function($){ $.fn.datepicker.dates['mk'] = { days: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота", "Недела"], daysShort: ["Нед", "Пон", "Вто", "Сре", "Чет", "Пет", "Саб", "Нед"], daysMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Са", "Не"], months: ["Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември"], monthsShort: ["Јан", "Фев", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Ное", "Дек"], today: "Денес", format: "dd.mm.yyyy" }; }(jQuery));
Change month format from 'MM' to 'mm'.
Change month format from 'MM' to 'mm'.
JavaScript
apache-2.0
christophercaburog/bootstrap-datepicker,huang-x-h/bootstrap-datepicker,wearespindle/datepicker-js,joubertredrat/bootstrap-datepicker,riyan8250/bootstrap-datepicker,otnavle/bootstrap-datepicker,NFC-DITO/bootstrap-datepicker,osama9/bootstrap-datepicker,SimpleUpdates/bootstrap-datepicker,mfunkie/bootstrap-datepicker,defrian8/bootstrap-datepicker,MartijnDwars/bootstrap-datepicker,janusnic/bootstrap-datepicker,rocLv/bootstrap-datepicker,riyan8250/bootstrap-datepicker,HuBandiT/bootstrap-datepicker,Invulner/bootstrap-datepicker,TheJumpCloud/bootstrap-datepicker,bitzesty/bootstrap-datepicker,tcrossland/bootstrap-datepicker,dswitzer/bootstrap-datepicker,inway/bootstrap-datepicker,mfunkie/bootstrap-datepicker,steffendietz/bootstrap-datepicker,hebbet/bootstrap-datepicker,WeiLend/bootstrap-datepicker,Invulner/bootstrap-datepicker,hebbet/bootstrap-datepicker,MartijnDwars/bootstrap-datepicker,TheJumpCloud/bootstrap-datepicker,darluc/bootstrap-datepicker,otnavle/bootstrap-datepicker,abnovak/bootstrap-sass-datepicker,wulinmengzhu/bootstrap-datepicker,WeiLend/bootstrap-datepicker,Azaret/bootstrap-datepicker,saurabh27125/bootstrap-datepicker,saurabh27125/bootstrap-datepicker,kiwiupover/bootstrap-datepicker,abnovak/bootstrap-sass-datepicker,hemp/bootstrap-datepicker,inspur-tobacco/bootstrap-datepicker,ashleymcdonald/bootstrap-datepicker,kiwiupover/bootstrap-datepicker,NFC-DITO/bootstrap-datepicker,hemp/bootstrap-datepicker,defrian8/bootstrap-datepicker,steffendietz/bootstrap-datepicker,christophercaburog/bootstrap-datepicker,menatoric59/bootstrap-datepicker,yangyichen/bootstrap-datepicker,joubertredrat/bootstrap-datepicker,WebbyLab/bootstrap-datepicker,cbryer/bootstrap-datepicker,1000hz/bootstrap-datepicker,martinRjs/bootstrap-datepicker,kevintvh/bootstrap-datepicker,cherylyan/bootstrap-datepicker,chengky/bootstrap-datepicker,eternicode/bootstrap-datepicker,wulinmengzhu/bootstrap-datepicker,zhaoyan158567/bootstrap-datepicker,menatoric59/bootstrap-datepicker,rstone770/bootstrap-datepicker,HNygard/bootstrap-datepicker,dswitzer/bootstrap-datepicker,pacozaa/bootstrap-datepicker,nilbus/bootstrap-datepicker,Doublemedia/bootstrap-datepicker,janusnic/bootstrap-datepicker,acrobat/bootstrap-datepicker,jesperronn/bootstrap-datepicker,CherryDT/bootstrap-datepicker,rocLv/bootstrap-datepicker,tcrossland/bootstrap-datepicker,keiwerkgvr/bootstrap-datepicker,jesperronn/bootstrap-datepicker,ibcooley/bootstrap-datepicker,vgrish/bootstrap-datepicker,osama9/bootstrap-datepicker,vegardok/bootstrap-datepicker,josegomezr/bootstrap-datepicker,mfunkie/bootstrap-datepicker,Youraiseme/bootstrap-datepicker,vegardok/bootstrap-datepicker,xutongtong/bootstrap-datepicker,ibcooley/bootstrap-datepicker,gn0st1k4m/bootstrap-datepicker,uxsolutions/bootstrap-datepicker,jhalak/bootstrap-datepicker,vsn4ik/bootstrap-datepicker,yangyichen/bootstrap-datepicker,SimpleUpdates/bootstrap-datepicker,inspur-tobacco/bootstrap-datepicker,martinRjs/bootstrap-datepicker,Doublemedia/bootstrap-datepicker,parkeugene/bootstrap-datepicker,acrobat/bootstrap-datepicker,1000hz/bootstrap-datepicker,Azaret/bootstrap-datepicker,inukshuk/bootstrap-datepicker,cherylyan/bootstrap-datepicker,oller/foundation-datepicker-sass,Sprinkle7/bootstrap-datepicker,daniyel/bootstrap-datepicker,aldano/bootstrap-datepicker,nilbus/bootstrap-datepicker,HuBandiT/bootstrap-datepicker,champierre/bootstrap-datepicker,xutongtong/bootstrap-datepicker,thetimbanks/bootstrap-datepicker,stenmuchow/bootstrap-datepicker,kevintvh/bootstrap-datepicker,keiwerkgvr/bootstrap-datepicker,dckesler/bootstrap-datepicker,HNygard/bootstrap-datepicker,huang-x-h/bootstrap-datepicker,wetet2/bootstrap-datepicker,daniyel/bootstrap-datepicker,aldano/bootstrap-datepicker,CheapSk8/bootstrap-datepicker,parkeugene/bootstrap-datepicker,Youraiseme/bootstrap-datepicker,WebbyLab/bootstrap-datepicker,ashleymcdonald/bootstrap-datepicker,gn0st1k4m/bootstrap-datepicker,bitzesty/bootstrap-datepicker,jhalak/bootstrap-datepicker,Tekzenit/bootstrap-datepicker,inukshuk/bootstrap-datepicker,Tekzenit/bootstrap-datepicker,oller/foundation-datepicker-sass,eternicode/bootstrap-datepicker,Sprinkle7/bootstrap-datepicker,rstone770/bootstrap-datepicker,nerionavea/bootstrap-datepicker,josegomezr/bootstrap-datepicker,josegomezr/bootstrap-datepicker,mreiden/bootstrap-datepicker,Mteuahasan/bootstrap-datepicker,vgrish/bootstrap-datepicker,stenmuchow/bootstrap-datepicker,vsn4ik/bootstrap-datepicker,darluc/bootstrap-datepicker,CherryDT/bootstrap-datepicker,zhaoyan158567/bootstrap-datepicker,dckesler/bootstrap-datepicker,i-am-kenny/bootstrap-datepicker,champierre/bootstrap-datepicker,uxsolutions/bootstrap-datepicker,inway/bootstrap-datepicker,CheapSk8/bootstrap-datepicker,1000hz/bootstrap-datepicker,nerionavea/bootstrap-datepicker,oller/foundation-datepicker-sass,Mteuahasan/bootstrap-datepicker,chengky/bootstrap-datepicker,cbryer/bootstrap-datepicker,thetimbanks/bootstrap-datepicker,mreiden/bootstrap-datepicker,WebbyLab/bootstrap-datepicker,pacozaa/bootstrap-datepicker,i-am-kenny/bootstrap-datepicker,wetet2/bootstrap-datepicker
e087fe25c546b1a142727b56da4751f18c46f2cb
katas/libraries/hamjest/assertThat.js
katas/libraries/hamjest/assertThat.js
import { assertThat, equalTo, containsString } from 'hamjest'; describe('The core function, `assertThat()`', () => { it('is a function', () => { const typeOfAssertThat = typeof assertThat; assertThat(typeOfAssertThat, equalTo('function')); }); describe('requires at least two params', () => { it('1st: the actual value', () => { assertThat('actual', equalTo('actual')); }); it('2nd: a matcher for the expected value', () => { const matcher = equalTo('expected'); assertThat('expected', matcher); }); describe('the optional 3rd param', () => { it('goes first(!), and is the assertion reason', () => { const reason = 'This is the reason, the first `assertThat()` throws as part of its message.'; try { assertThat(reason, true, equalTo(false)); } catch (e) { assertThat(e.message, containsString(reason)); } }); }); }); });
import { assertThat, equalTo, containsString, throws, returns, } from 'hamjest'; describe('The core function, `assertThat()`', () => { it('is a function', () => { const typeOfAssertThat = typeof assertThat; assertThat(typeOfAssertThat, equalTo('function')); }); describe('requires at least two params', () => { it('1st: the actual value', () => { assertThat('actual', equalTo('actual')); }); it('2nd: a matcher for the expected value', () => { const matcher = equalTo('expected'); assertThat('expected', matcher); }); describe('the optional 3rd param', () => { it('goes first(!), and is the assertion reason', () => { const reason = 'This is the reason, the first `assertThat()` throws as part of its message.'; try { assertThat(reason, true, equalTo(false)); } catch (e) { assertThat(e.message, containsString(reason)); } }); }); }); describe('does under the hood', () => { it('nothing when actual and expected match (using the given matcher)', () => { const passingTest = () => assertThat(true, equalTo(true)); assertThat(passingTest, returns()); }); it('throws an assertion, when actual and expected don`t match', () => { const failingTest = () => assertThat(false, equalTo(true)); assertThat(failingTest, throws()); }); }); });
Add a little under-the-hood tests.
Add a little under-the-hood tests.
JavaScript
mit
tddbin/katas,tddbin/katas,tddbin/katas
b7d600cdf1d870e2ffba4fd7c64a94156fadb5b9
src/delir-core/tests/project/project-spec.js
src/delir-core/tests/project/project-spec.js
import Project from '../../src/project/project' import Asset from '../../src/project/asset' import Composition from '../../src/project/composition' import TimeLane from '../../src/project/timelane' import Layer from '../../src/project/layer' describe('project structure specs', () => { describe('Project', () => { let project beforeEach(() => { project = new Project() }) afterEach(() => { project = null }) it('project construction flow', () => { project.assets.add(new Asset) project.assets.add(new Asset) const comp1 = new Composition project.compositions.add(comp1) const lane1 = new TimeLane comp1.timelanes.add(lane1) lane1.layers.add(new Layer) }) it('correctry serialize/deserialize the project', () => { const comp1 = new Composition project.compositions.add(comp1) const lane1 = new TimeLane comp1.timelanes.add(lane1) const pbson = project.serialize() expect(Project.deserialize(pbson).toJSON()).to.eql(project.toJSON()) }) }) })
import Project from '../../src/project/project' import Asset from '../../src/project/asset' import Composition from '../../src/project/composition' import TimeLane from '../../src/project/timelane' import Clip from '../../src/project/clip' describe('project structure specs', () => { describe('Project', () => { let project beforeEach(() => { project = new Project() }) afterEach(() => { project = null }) it('project construction flow', () => { project.assets.add(new Asset) project.assets.add(new Asset) const comp1 = new Composition project.compositions.add(comp1) const lane1 = new TimeLane comp1.timelanes.add(lane1) lane1.layers.add(new Clip) }) it('correctry serialize/deserialize the project', () => { const comp1 = new Composition project.compositions.add(comp1) const lane1 = new TimeLane comp1.timelanes.add(lane1) const pbson = project.serialize() expect(Project.deserialize(pbson).toJSON()).to.eql(project.toJSON()) }) }) })
Replace `Layer` to `Clip` on Project structure spec`
Replace `Layer` to `Clip` on Project structure spec`
JavaScript
mit
Ragg-/Delir,Ragg-/Delir,Ragg-/Delir,Ragg-/Delir
499b227e4ec6bd00899363366c2520c9c2be151c
tests/frontend/index.js
tests/frontend/index.js
module.exports = { "open index page": function(browser) { browser .url(browser.globals.url) .waitForElementVisible("#index-view", 3000) .assert.containsText("#header .logo:nth-child(2)", "Color Themes") .waitForElementVisible(".pending-icon", 100) .waitForElementVisible(".preview-list", 5000) .assert.containsText(".pager .current", "1") .end(); } };
module.exports = { "open index page": function(browser) { browser .url(browser.globals.url) .waitForElementVisible("#index-view", 3000) .assert.containsText("#header .logo:nth-child(2)", "Color Themes") .waitForElementVisible(".pending-icon", 100) .waitForElementVisible(".preview-list", 5000) .assert.containsText(".pager .current", "1") .end(); }, "open next page": function(browser) { browser .url(browser.globals.url) .waitForElementVisible(".pager a:nth-child(2)",5000) .click(".pager a:nth-child(2)") .waitForElementVisible(".preview-list", 5000) .assert.containsText(".pager .current", "2") .end(); } };
Add new test for opening pages
Add new test for opening pages
JavaScript
mit
y-a-r-g/color-themes,y-a-r-g/color-themes