commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
6a3d91432087956de9b1e2da16acb052352487bc | Fix pes link issues with props | wwwroot/app/src/components/base/Link/index.js | wwwroot/app/src/components/base/Link/index.js | import React from 'react';
import classNames from 'classnames';
import { Link as ReactRouterLink } from 'react-router';
const Link = (props) => {
const linkClasses = classNames(props.className, 'pes-link', {
'pes-link--undecorated': props.undecorated
});
const linkProps = { ...props, className: linkClasses };
return (
<ReactRouterLink {...linkProps} />
);
};
export default Link; | JavaScript | 0 | @@ -274,37 +274,55 @@
-const linkProps = %7B ...
+return (%0A %3CReactRouterLink to=%7B
props
-,
+.to%7D
cla
@@ -327,18 +327,18 @@
lassName
-:
+=%7B
linkClas
@@ -344,25 +344,39 @@
sses
- %7D;%0A%0A return (
+%7D%3E%0A %7Bprops.children%7D
%0A
@@ -373,32 +373,33 @@
ldren%7D%0A %3C
+/
ReactRouterLink
@@ -401,25 +401,8 @@
Link
- %7B...linkProps%7D /
%3E%0A
|
e9b2aa789e7cc1d833392a93ebdb3fb6d08e6294 | use js.min files | gulpfile.js | gulpfile.js | 'use strict';
// FAPP-STACK Gulpfile
// -------------------------------------
// This file processes all of the assets in the "client" folder, combines them with the Foundation
// for Apps assets, and outputs the finished files in the buildFolder (which is configurable below)
// folder as a finished app.
// 1. LIBRARIES
// - - - - - - - - - - - - - - -
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
rimraf = require('rimraf'),
sequence = require('run-sequence'),
router = require('./bower_components/foundation-apps/bin/gulp-dynamic-routing');
// 2. SETTINGS VARIABLES
// - - - - - - - - - - - - - - -
var buildFolder = 'www';
var paths = {
// Sass will check these folders for files when you use @import.
sass: [
'client/assets/scss',
'bower_components/foundation-apps/scss'
],
// all JS dependencies
vendorJS: [
'bower_components/fastclick/lib/fastclick.js',
'bower_components/viewport-units-buggyfill/viewport-units-buggyfill.js',
'bower_components/tether/tether.js',
'bower_components/lodash/lodash.min.js',
'bower_components/angular/angular.js',
'bower_components/angular-modal-service/dst/angular-modal-service.min.js',
'bower_components/a0-angular-storage/dist/angular-storage.min.js',
'bower_components/angular-jwt/dist/angular-jwt.min.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/foundation-apps/js/vendor/**/*.js',
'bower_components/foundation-apps/js/angular/**/*.js',
'!bower_components/foundation-apps/js/angular/app.js'
],
// These files are for your app's JavaScript
appJS: [
'client/assets/modules/app.js',
'client/assets/modules/**/*.js'
]
};
// 3. TASKS
// - - - - - - - - - - - - - - -
// Cleans the build directory
gulp.task('clean', function (cb) {
rimraf('./' + buildFolder, cb);
});
// Copies user-created files and Foundation assets
gulp.task('copy', function () {
var dirs = ['./client/**/*.*', '!./client/assets/{scss,modules}/**/*.*'];
// Everything in the client folder except templates, Sass, and JS
gulp.src(dirs, {
base: './client/'
})
.pipe(gulp.dest('./' + buildFolder));
//font-awesome icon-font
gulp.src('./bower_components/font-awesome/fonts/**/*')
.pipe(gulp.dest('./' + buildFolder + '/assets/fonts/'));
// Foundation's Angular partials
return gulp.src(['./bower_components/foundation-apps/js/angular/components/**/*.html'])
.pipe(gulp.dest('./' + buildFolder + '/components/'))
.pipe($.livereload());
});
// Compiles Sass
gulp.task('sass', function () {
return gulp.src('client/assets/scss/app.scss')
.pipe($.sass({
includePaths: paths.sass,
outputStyle: 'nested',
errLogToConsole: true
}))
.pipe($.autoprefixer({
browsers: ['last 2 versions', 'ie 10']
}))
.pipe(gulp.dest('./' + buildFolder + '/assets/css/'))
.pipe($.livereload());
});
// Compiles and copies the Foundation for Apps JavaScript, as well as your app's custom JS
gulp.task('uglify', function () {
// Foundation JavaScript
gulp.src(paths.vendorJS)
.pipe($.uglify({
beautify: true,
mangle: false
})
.on('error', function (e) {
console.log(e);
}))
.pipe($.concat('vendor.js'))
.pipe(gulp.dest('./' + buildFolder + '/assets/js/'));
// App JavaScript
return gulp.src(paths.appJS)
.pipe($.ngAnnotate({
remove: true,
add: true,
single_quotes: true
}))
.pipe($.jshint())
.pipe($.jshint.reporter('default'))
.pipe($.uglify({
beautify: true,
mangle: false
})
.on('error', function (e) {
console.log(e);
}))
.pipe($.concat('app.js'))
.pipe(gulp.dest('./' + buildFolder + '/assets/js/'))
.pipe($.livereload());
});
// Copies your app's page templates and generates URLs for them
gulp.task('copy-templates', ['copy'], function () {
return gulp.src('./client/assets/modules/**/templates/**/*.html')
.pipe($.rename(function (path) {
path.dirname = '/templates/' + path.dirname.replace('/templates', '');
}))
.pipe(router({
path: buildFolder + '/assets/js/routes.js',
root: 'client/assets/modules/'
}))
.pipe(gulp.dest('./' + buildFolder))
.pipe($.livereload());
});
gulp.task('backend:start', function () {
$.nodemon({
script: './backend/server.js',
ext: 'html js',
watch: ['backend'],
env: {
'NODE_ENV': 'development',
'DEBUG': 'app:*'
}
})
.on('restart', function () {
console.log('api restarted!');
});
});
// Builds your entire app once, without starting a server
gulp.task('build', function (cb) {
sequence('clean', ['copy', 'sass', 'uglify'], 'copy-templates', function () {
console.log('Successfully built.');
// Notify gulp that build has completed
cb();
});
});
// Default task: builds your app, starts a server, and recompiles assets when they change
gulp.task('default', function () {
//Start livereload-server
$.livereload.listen({
quiet: true
});
// Run the server after the build
sequence(['build', 'backend:start']);
// Watch Sass
gulp.watch(['./client/assets/scss/**/*', './scss/**/*'], ['sass']);
// Watch JavaScript
gulp.watch(['./client/assets/modules/**/*.js', './js/**/*'], ['uglify']);
// Watch static files
gulp.watch(['./client/**/*.*', '!./client/assets/modules/**/templates/**/*', '!./client/assets/{scss,modules}/**/*.*'], ['copy']);
// Watch app templates
gulp.watch(['./client/assets/modules/**/*.html'], ['copy-templates']);
// Watch gulpfile.js
gulp.watch(['./gulpfile.js'], ['build']);
}); | JavaScript | 0.000001 | @@ -1392,16 +1392,20 @@
animate.
+min.
js',%0A
@@ -1467,16 +1467,20 @@
-router.
+min.
js',%0A
|
bc9970b9c315fe1ecafca07da8cf172c938e8f31 | Update youtube.search.js | youtube-search-v3/script/js/youtube.search.js | youtube-search-v3/script/js/youtube.search.js |
//google api keyinizi aşağıya girdikten sonra script çalışır
$(function(){
$.ARamaYap = {
GetStringDuration: function (string){
var array=string.match(/(\d+)(?=[MHS])/ig)||[],
formatted=array.map(function(item)
{
if(item.length<2) return '0'+item;return item;
}).join(':');
return formatted;
},
SerializeQuerySearch: function (query,pagetoken){
var NextPage='&pageToken='+pagetoken,
aranan=query,
Max = 16,
key = 'sizin google api key',
JSONurl= 'https://www.googleapis.com/youtube/v3/search?part=snippet&q='+aranan+'&key='+key+'&maxResults='+Max+'&type=video'+NextPage,
sonuc = $("#sonuc");
sonuc.empty();
$.getJSON(JSONurl ,function(data){
var sayilrle=data.nextPageToken;$("._bpls[page-token=next]").attr("id",sayilrle);
$.each(data.items,function(i,item){var kod=item.id.videoId,isim=item.snippet.title;
$(".Results").empty();$("._bpls[page-token=next]").show();
$.getJSON('https://www.googleapis.com/youtube/v3/videos?id='+kod+'&part=contentDetails&key'+key,function(data){
$.each(data.items,function(i,item){
var string=item.contentDetails.duration,
formatted= $.ARamaYap.GetStringDuration(string),
ne = '<div class="sonuclar" ><a href="#'+kod+'" title="'+isim+'">'+isim+'</a><span>'+formatted+'</span></div>';
sonuc.append(ne);
});
});
return true});
});
}
}
});
$(document).ready(function(){
$('#test_arama').keyup(function(){
var query = $(this).val();
console.log(query); //test edelim.
$.ARamaYap.SerializeQuerySearch(query,"");
});
});
| JavaScript | 0.000001 | @@ -1448,214 +1448,6 @@
;%0A%09%0A
-%09$(document).ready(function()%7B%0A%09%09%0A%09%09$('#test_arama').keyup(function()%7B%0A%09%09%09%0A%09%09%09var query = $(this).val();%0A%09%09%09console.log(query); //test edelim.%0A%09%09%09$.ARamaYap.SerializeQuerySearch(query,%22%22);%0A%09%09%09%0A%09%09%7D);%09%09%0A%09%09%0A%09%7D);
%0A%0A
|
e47bd582d9dc5f852731f6dc61923069f982492b | Upgrade Electron to pick up `window.open` fix | server/createBinaries.js | server/createBinaries.js | var electronPackager = Meteor.wrapAsync(Npm.require("electron-packager"));
var fs = Npm.require('fs');
var mkdirp = Meteor.wrapAsync(Npm.require('mkdirp'));
var path = Npm.require('path');
var proc = Npm.require('child_process');
var writeFile = Meteor.wrapAsync(fs.writeFile);
var exec = Meteor.wrapAsync(function(command, options, callback){
proc.exec(command, options, function(err, stdout, stderr){
callback(err, {stdout: stdout, stderr: stderr});
});
});
createBinaries = function() {
// Use a predictable directory so that other scripts can locate the builds, also so that the builds
// may be cached:
// TODO(jeff): Use existing binaries if the app hasn't changed.
var workingDir = path.join(process.env.PWD, '.meteor-electron');
mkdirp(workingDir);
//TODO probably want to allow users to add other more unusual
//architectures if they want (ARM, 32 bit, etc.)
var platform = "darwin";
//TODO seed the binaryDir from the package assets
// *binaryDir* holds the vanilla electron apps
var binaryDir = path.join(workingDir, "releases");
mkdirp(binaryDir);
// *appDir* holds the electron application that points to a meteor app
var appDir = path.join(workingDir, "apps");
mkdirp(appDir);
// *buildDir* contains the uncompressed apps
var buildDir = path.join(workingDir, "builds");
mkdirp(buildDir);
// *finalDir* contains zipped apps ready to be downloaded
var finalDir = path.join(workingDir, "final");
mkdirp(finalDir);
var electronSettings = Meteor.settings.electron || {};
var appVersion = electronSettings.version;
var appName = electronSettings.name;
[
"autoUpdater.js",
"main.js",
"menu.js",
"package.json",
"preload.js",
"proxyWindowEvents.js"
].forEach(function(filename) {
var fileContents = Assets.getText(path.join("app", filename));
// Replace parameters in `package.json`.
if (filename === "package.json") {
var packageJSON = JSON.parse(fileContents);
if (appVersion) packageJSON.version = appVersion;
if (appName) {
packageJSON.name = appName.toLowerCase().replace(/\s/g, '-');
packageJSON.productName = appName;
}
fileContents = JSON.stringify(packageJSON);
}
writeFile(path.join(appDir, filename), fileContents);
});
//TODO be smarter about caching this..
exec("npm install", {cwd: appDir});
var settings = _.defaults({}, electronSettings, {
rootUrl: process.env.ROOT_URL
});
var signingIdentity = electronSettings.sign;
if (canServeUpdates()) {
// Enable the auto-updater if possible.
if ((platform === 'darwin') && !signingIdentity) {
// If the app isn't signed and we try to use the auto-updater, it will
// throw an exception.
console.error('Developer ID signing identity is missing: remote updates will not work.');
} else {
settings.updateFeedUrl = settings.rootUrl + UPDATE_FEED_PATH;
}
}
writeFile(path.join(appDir, "electronSettings.json"), JSON.stringify(settings));
var packagerSettings = {
dir: appDir,
name: appName || "Electron",
platform: platform,
arch: "x64",
version: "0.35.0",
out: buildDir,
cache: binaryDir,
overwrite: true
};
if (appVersion) {
packagerSettings['app-version'] = appVersion;
}
if (electronSettings.icon) {
var icon = platformSpecificSetting(electronSettings.icon);
if (icon) {
var iconPath = path.join(process.cwd(), 'assets', 'app', icon);
packagerSettings.icon = iconPath;
}
}
if (signingIdentity) {
packagerSettings.sign = signingIdentity;
}
var build = electronPackager(packagerSettings)[0];
console.log("Build created at", build);
// Package the build for download.
// The auto-updater framework only supports installing ZIP releases:
// https://github.com/Squirrel/Squirrel.Mac#update-json-format
var downloadName = "app-darwin.zip";
var compressedDownload = path.join(finalDir, downloadName);
// Use `ditto` to ZIP the app because I couldn't find a good npm module to do it and also that's
// what a couple of other related projects do:
// - https://github.com/Squirrel/Squirrel.Mac/blob/8caa2fa2007b29a253f7f5be8fc9f36ace6aa30e/Squirrel/SQRLZipArchiver.h#L24
// - https://github.com/jenslind/electron-release/blob/4a2a701c18664ec668c3570c3907c0fee72f5e2a/index.js#L109
exec('ditto -ck --sequesterRsrc --keepParent "' + build + '" "' + compressedDownload + '"');
console.log("Downloadable created at", compressedDownload);
return build;
};
| JavaScript | 0 | @@ -3158,17 +3158,17 @@
: %220.35.
-0
+4
%22,%0A o
|
eed7dd2d1c03b98e45b7345b0d03c539cc3401d7 | update image | js/main.js | js/main.js |
$(document).ready(function() {
$('.home-slider').flexslider({
animation: "slide",
directionNav: false,
controlNav: false,
direction: "vertical",
slideshowSpeed: 2500,
animationSpeed: 500,
smoothHeight: false
});
$('.message-box-loader').css('display','none');
$('.message-box').css('display','block');
$.backstretch('images/header-bg-2.jpg');
//$(".intro-section").backstretch("images/header-bg.jpg");
$('#what').waypoint(function(direction){
if($('.preload-image').length){$('.preload-image').remove();}
$('.backstretch').remove();
if (direction=='down'){
$.backstretch('images/contact-bg.jpg');
}else{
$.backstretch('images/header-bg.jpg');
}
});
/*============================================
Project Preview
==============================================*/
$('.project-item').click(function(e){
e.preventDefault();
var elem = $(this),
title = elem.find('.project-title').text(),
link = elem.attr('href'),
descr = elem.find('.project-description').html(),
slidesHtml = '<ul class="slides">',
slides = elem.data('images').split(',');
for (var i = 0; i < slides.length; ++i) {
slidesHtml = slidesHtml + '<li><img src='+slides[i]+' alt=""></li>';
}
slidesHtml = slidesHtml + '</ul>';
$('#project-modal').on('show.bs.modal', function () {
$(this).find('h1').text(title);
$(this).find('.btn').attr('href',link);
$(this).find('.project-descr').html(descr);
$(this).find('.image-wrapper').addClass('flexslider').html(slidesHtml);
setTimeout(function(){
$('.image-wrapper.flexslider').flexslider({
slideshowSpeed: 3000,
animation: 'slide',
controlNav: false,
start: function(){
$('#project-modal .image-wrapper')
.addClass('done')
.prev('.loader').fadeOut();
}
});
},1000);
}).modal();
});
$('#project-modal').on('hidden.bs.modal', function () {
$(this).find('.loader').show();
$(this).find('.image-wrapper')
.removeClass('flexslider')
.removeClass('done')
.html('')
.flexslider('destroy');
});
}); | JavaScript | 0.000001 | @@ -402,10 +402,8 @@
r-bg
--2
.jpg
|
0ac09ed8482dd2a385b2ace30817ab0859165166 | add web.config deployment | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var del = require('del');
var react = require('gulp-react');
var less = require('gulp-less');
var cson = require('gulp-cson');
var nodeunit = require('gulp-nodeunit');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var JSV = require("JSV").JSV;
var fs = require('fs');
function handleError(err) {
console.log(err.toString());
console.log("\007");
this.emit('end');
}
gulp.task('clean', function(done) {
del(['build/**/*'], done);
});
gulp.task("html", function(){
return gulp.src('src/*.html')
.pipe(gulp.dest('build/'));
});
gulp.task("libs", function(){
return gulp.src('libs/**/*')
.pipe(gulp.dest('build/libs'));
});
gulp.task("img", function(){
return gulp.src('img/*')
.pipe(gulp.dest('build/img'));
});
gulp.task("less", function(){
return gulp.src('src/*.less')
.pipe(less())
.pipe(gulp.dest('build/'))
.on('error', handleError);
});
gulp.task("data", ["cson"], function(){
var schema = {
type : "array", items: {
type: "object", properties: {
name: { type: "string", required: true },
code: { type: "string", required: true },
bugs: {
type:"object", required: true, additionalProperties:{
type:"object", properties:{
type: { type: "string", required: true },
replace: { type: "string", required: true },
description: { type: "string", required: true }
}
}
}
}
}
};
var json = JSON.parse(fs.readFileSync('build/data/data.json', 'utf8'));
var env = JSV.createEnvironment();
var report = env.validate(json, schema)
if (report.errors.length > 0) {
console.log(report.errors);
console.log("\007");
}
});
gulp.task("cson", function(){
return gulp.src('data/*.cson')
.pipe(cson())
.pipe(gulp.dest('build/data/'));
});
gulp.task("jsx", function(){
return gulp.src('src/jsx/*.js')
.pipe(react())
.on('error', handleError)
.pipe(gulp.dest('src/js'));
});
gulp.task("browserify", ['jsx'], function(){
return browserify({
entries: './src/js/app.js',
'ignore-missing': true
})
.exclude('lodash')
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('build'))
.on('error', handleError);
});
gulp.task("js-with-tests", ['browserify'], function(){
return gulp.src('src/js/tests.js')
.pipe(nodeunit())
.on('error', handleError);
});
gulp.task("default", ['clean'], function(){
gulp.start('data', 'less', 'js-with-tests', 'browserify', 'libs', 'html', 'img');
});
gulp.task('watch', ['default'], function(){
gulp.watch('src/jsx/*.js', ['js-with-tests']);
gulp.watch('data/*.cson', ['data']);
gulp.watch('src/*.less', ['less']);
gulp.watch('src/*.html', ['html']);
gulp.watch('libs/**/*', ['libs']);
gulp.watch('img/*', ['img']);
});
| JavaScript | 0.000001 | @@ -783,32 +783,134 @@
ld/img'));%0A%7D);%0A%0A
+gulp.task(%22web.config%22, function()%7B%0A%09return gulp.src('web.config')%0A%09%09.pipe(gulp.dest('build'));%0A%7D);%0A%0A%0A
gulp.task(%22less%22
@@ -2611,16 +2611,30 @@
', 'img'
+, 'web.config'
);%0A%7D);%0A%0A
@@ -2904,13 +2904,56 @@
img'%5D);%0A
+%09gulp.watch('web.config', %5B'web.config'%5D);%0A
%7D);%0A%0A
|
c7fa3db7d0ea21da78e8d484a0152274b7b923c5 | refactor jquery.remotiepart.js to work with current rails ujs | lib/generators/templates/jquery.remotipart.js | lib/generators/templates/jquery.remotipart.js | (function ($) {
$.fn.extend({
/**
* Handles execution of remote calls involving file uploads, firing overridable events along the way
*/
callRemotipart: function () {
var el = this,
url = el.attr('action'),
dataType = el.attr('data-type') || 'script';
if (url === undefined) {
throw "No URL specified for remote call (action must be present).";
} else {
// Since iframe-submitted form is submitted normal-style and cannot set custom headers,
// we'll add a custom hidden input to keep track and let the server know this was still
// an AJAX form, we'll also make it easy to tell from our jQuery element object.
el
.append($('<input />', {
type: "hidden",
name: "remotipart_submitted",
value: true
}))
.data('remotipartSubmitted', dataType);
if (el.triggerAndReturn('ajax:before')) {
if (dataType == 'script') {
url = url.split('?'); // split on GET params
if(url[0].substr(-3) != '.js') url[0] += '.js'; // force rails to respond to respond to the request with :format = js
url = url.join('?'); // join on GET params
}
el.ajaxSubmit({
url: url,
dataType: dataType,
beforeSend: function (xhr) {
el.trigger('ajax:loading', xhr);
},
success: function (data, status, xhr) {
el.trigger('ajax:success', [data, status, xhr]);
},
complete: function (xhr) {
el.trigger('ajax:complete', xhr);
},
error: function (xhr, status, error) {
el.trigger('ajax:failure', [xhr, status, error]);
}
});
}
el.trigger('ajax:after');
}
},
_callRemote: $.fn.callRemote, //store the original rails callRemote
callRemote: function(){ //override the rails callRemote and check for a file input
if(this.find('input:file').length){
this.callRemotipart();
} else {
this._callRemote();
}
}
});
})(jQuery);
| JavaScript | 0.000001 | @@ -5,24 +5,166 @@
ction ($) %7B%0A
+ function fire(obj, name, data) %7B%0A%09 %09var event = new $.Event(name);%0A%09 %09obj.trigger(event, data);%0A%09 %09return event.result !== false;%0A%09 %7D%0A
$.fn.ext
@@ -1137,63 +1137,8 @@
);%0A%0A
-%09 if (el.triggerAndReturn('ajax:before')) %7B%0A
@@ -1581,39 +1581,324 @@
d: function (xhr
-) %7B%0A%09
+, settings) %7B%0A if (settings.dataType === undefined) %7B%0A xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);%0A %7D%0A var proceed = fire(el, 'ajax:beforeSend', %5Bxhr, settings, true%5D);%0A
@@ -1894,32 +1894,49 @@
+ if (proceed) %7B
el.trigger('aja
@@ -1947,23 +1947,68 @@
ading',
+%5B
xhr
+%5D
);
-%0A%09
+ %7D%0A return proceed;%0A
@@ -2421,16 +2421,27 @@
:failure
+ ajax:error
', %5Bxhr,
@@ -2562,188 +2562,141 @@
);%0A%09
- %7D%0A%09%09%7D,%0A%09%09_callRemote: $.fn.callRemote, //store the original rails callRemote%0A%09%09callRemote: function()%7B //override the rails callRemote and check for a file input%0A%09%09%09if
+%09%7D%0A%09%7D);%0A%0A $('form%5Bdata-remote%5D').live('ajax:beforeSend', function (evt, xhr, settings, remotipart) %7B%0A%0A if (!remotipart && $
(this
+)
.fin
@@ -2718,26 +2718,32 @@
.length)
+
%7B%0A
-%09%09%09%09
+ $(
this
+)
.callRem
@@ -2757,54 +2757,58 @@
();%0A
-%09%09%09%7D else %7B%0A%09%09%09%09this._callRemote();%0A%09%09%09%7D%0A%09%09%7D%0A%09
+ return false;%0A %7D%0A %0A return true;%0A
%7D);%0A
|
98f10f27fee0de9426bdd5b1a33a28b3e87a76e6 | add new region (bug 952581) | src/media/js/settings.js | src/media/js/settings.js | define('settings', ['l10n', 'settings_local', 'underscore'], function(l10n, settings_local, _) {
var gettext = l10n.gettext;
return _.defaults(settings_local, {
init_module: 'main',
default_locale: 'en-US',
api_url: 'http://' + window.location.hostname, // No trailing slash, please.
storage_version: '0',
param_whitelist: ['q', 'sort'],
model_prototypes: {
'app': 'slug',
// Dummy prototypes to facilitate testing
'dummy': 'id',
'dummy2': 'id'
},
fragment_error_template: 'errors/fragment.html',
pagination_error_template: 'errors/pagination.html',
tracking_id: 'UA-36116321-6',
// A list of regions and their L10n mappings.
REGION_CHOICES_SLUG: {
'ar': gettext('Argentina'),
'br': gettext('Brazil'),
'cn': gettext('China'),
'co': gettext('Colombia'),
'de': gettext('Germany'),
'es': gettext('Spain'),
'gr': gettext('Greece'),
'hu': gettext('Hungary'),
'it': gettext('Italy'),
'me': gettext('Montenegro'),
'mx': gettext('Mexico'),
'pe': gettext('Peru'),
'pl': gettext('Poland'),
'rs': gettext('Serbia'),
'uk': gettext('United Kingdom'),
'us': gettext('United States'),
'uy': gettext('Uruguay'),
've': gettext('Venezuela'),
'worldwide': gettext('Worldwide')
},
timing_url: '', // TODO: figure this out
persona_unverified_issuer: 'login.persona.org',
title_suffix: 'Firefox Marketplace Statistics'
});
});
| JavaScript | 0 | @@ -876,24 +876,60 @@
('Brazil'),%0A
+ 'cl': gettext('Chile'),%0A
|
44db1a2fcfd3361f8a92ff6fa6d061529e226dc2 | Consolidate HTML building logic | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var jade = require('gulp-jade');
var filter = require('gulp-filter');
var jshint = require('gulp-jshint');
var rev = require('gulp-rev');
var revReplace = require('gulp-rev-replace');
var useref = require('gulp-useref');
var uglify = require('gulp-uglify');
var csso = require('gulp-csso');
var rename = require('gulp-rename');
/* Regular tasks */
/* TODO: validate HTML */
gulp.task('html', function() {
gulp.src('src/services.jade')
.pipe(jade({ pretty: true }))
.pipe(rename('services.html'))
.pipe(gulp.dest('dist'));
return gulp.src('src/index.jade')
.pipe(jade({ pretty: true }))
.pipe(rename('index.html'))
.pipe(gulp.dest('dist'));
});
gulp.task('css', function() {
gulp.src('src/styles/*')
.pipe(gulp.dest('css'));
gulp.src('css/*')
.pipe(gulp.dest('dist/css'));
});
gulp.task('font', function() {
return gulp.src('font/*')
.pipe(gulp.dest('dist/font'));
});
gulp.task('js', function() {
return gulp.src('js/*')
.pipe(gulp.dest('dist/js'));
});
gulp.task('build', function() {
/* legacy build logic */
var jsFilter = filter('**/*.js');
var cssFilter = filter('**/*.css');
gulp.src('index.html')
.pipe(useref.assets()) // Concatenate with gulp-useref
.pipe(jsFilter)
.pipe(uglify()) // Minify any javascript sources
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe(csso()) // Minify any CSS sources
.pipe(cssFilter.restore())
.pipe(rev()) // Rename the concatenated files
.pipe(useref.restore())
.pipe(useref())
.pipe(revReplace()) // Substitute in new filenames
.pipe(gulp.dest('dist'));
});
gulp.task('csslint', function() {
});
gulp.task('jshint', function() {
gulp.src(['js/*.js', '!vendor/*', '!plugins.js'])
.pipe(jshint());
});
/* Helper tasks */
gulp.task('lint', ['csslint', 'jshint'], function() {
});
/* Default task */
gulp.task('default', ['build', 'lint'], function() {
});
| JavaScript | 0.000004 | @@ -434,162 +434,8 @@
) %7B%0A
-%09gulp.src('src/services.jade')%0A%09 .pipe(jade(%7B pretty: true %7D))%0A%09 .pipe(rename('services.html'))%0A%09 .pipe(gulp.dest('dist'));%0A
%09ret
@@ -452,21 +452,17 @@
rc('src/
-index
+*
.jade')%0A
@@ -528,28 +528,36 @@
(rename(
-'index
+%7B extname: '
.html'
+ %7D
))%0A%09
|
9e41967f332183d4c0276052e092a9eb53560cb4 | fix destroyOverlay (Type) if the response is delayed | lib/atom-ternjs-type.js | lib/atom-ternjs-type.js | 'use babel';
const TypeView = require('./atom-ternjs-type-view');
const TOLERANCE = 20;
import manager from './atom-ternjs-manager';
import packageConfig from './atom-ternjs-package-config';
import emitter from './atom-ternjs-events';
import {Range} from 'atom';
import {
prepareType,
prepareInlineDocs,
extractParams,
formatType
} from './atom-ternjs-helper';
class Type {
constructor() {
this.view = undefined;
this.overlayDecoration = undefined;
this.view = new TypeView();
this.view.initialize(this);
atom.views.getView(atom.workspace).appendChild(this.view);
this.destroyOverlayHandler = this.destroyOverlay.bind(this);
emitter.on('type-destroy-overlay', this.destroyOverlayHandler);
}
setPosition() {
const editor = atom.workspace.getActiveTextEditor();
if (!editor) {
return;
}
const marker = editor.getLastCursor && editor.getLastCursor().getMarker();
if (!marker) {
return;
}
this.overlayDecoration = editor.decorateMarker(marker, {
type: 'overlay',
item: this.view,
class: 'atom-ternjs-type',
position: 'tale',
invalidate: 'touch'
});
}
queryType(editor, cursor) {
if (
!packageConfig.options.inlineFnCompletion ||
!cursor ||
cursor.destroyed ||
!manager.client
) {
return;
}
const scopeDescriptor = cursor.getScopeDescriptor();
if (scopeDescriptor.scopes.join().match(/comment/)) {
this.destroyOverlay();
return;
}
let rowStart = 0;
let rangeBefore = false;
let tmp = false;
let may = 0;
let may2 = 0;
let skipCounter = 0;
let skipCounter2 = 0;
let paramPosition = 0;
const position = cursor.getBufferPosition();
const buffer = editor.getBuffer();
if (position.row - TOLERANCE < 0) {
rowStart = 0;
} else {
rowStart = position.row - TOLERANCE;
}
buffer.backwardsScanInRange(/\]|\[|\(|\)|\,|\{|\}/g, new Range([rowStart, 0], [position.row, position.column]), (obj) => {
// return early if we are inside a string
if (editor.scopeDescriptorForBufferPosition(obj.range.start).scopes.join().match(/string/)) {
return;
}
if (obj.matchText === '}') {
may++;
return;
}
if (obj.matchText === ']') {
if (!tmp) {
skipCounter2++;
}
may2++;
return;
}
if (obj.matchText === '{') {
if (!may) {
rangeBefore = false;
obj.stop();
return;
}
may--;
return;
}
if (obj.matchText === '[') {
if (skipCounter2) {
skipCounter2--;
}
if (!may2) {
rangeBefore = false;
obj.stop();
return;
}
may2--;
return;
}
if (obj.matchText === ')' && !tmp) {
skipCounter++;
return;
}
if (obj.matchText === ',' && !skipCounter && !skipCounter2 && !may && !may2) {
paramPosition++;
return;
}
if (obj.matchText === ',') {
return;
}
if (obj.matchText === '(' && skipCounter) {
skipCounter--;
return;
}
if (skipCounter || skipCounter2) {
return;
}
if (obj.matchText === '(' && !tmp) {
rangeBefore = obj.range;
obj.stop();
return;
}
tmp = obj.matchText;
});
if (!rangeBefore) {
this.destroyOverlay();
return;
}
manager.client.update(editor).then((data) => {
manager.client.type(editor, rangeBefore.start).then((data) => {
if (!data || data.type === '?' || !data.exprName) {
this.destroyOverlay();
return;
}
const type = prepareType(data);
const params = extractParams(type);
formatType(data);
if (params && params[paramPosition]) {
const offsetFix = paramPosition > 0 ? ' ' : '';
data.type = data.type.replace(params[paramPosition], `${offsetFix}<span class="text-info">${params[paramPosition]}</span>`);
}
if (
data.doc &&
packageConfig.options.inlineFnCompletionDocumentation
) {
data.doc = data.doc && data.doc.replace(/(?:\r\n|\r|\n)/g, '<br />');
data.doc = prepareInlineDocs(data.doc);
}
this.view.setData(data);
this.setPosition();
});
});
}
destroy() {
emitter.off('destroy-type-overlay', this.destroyOverlayHandler);
this.destroyOverlay();
if (this.view) {
this.view.destroy();
this.view = null;
}
}
destroyOverlay() {
if (this.overlayDecoration) {
this.overlayDecoration.destroy();
}
this.overlayDecoration = null;
}
}
export default new Type();
| JavaScript | 0 | @@ -749,24 +749,52 @@
sition() %7B%0A%0A
+ this.destroyOverlay();%0A%0A
const ed
@@ -1232,24 +1232,52 @@
cursor) %7B%0A%0A
+ this.destroyOverlay();%0A%0A
if (%0A
@@ -1540,38 +1540,8 @@
%7B%0A%0A
- this.destroyOverlay();%0A%0A
@@ -3540,37 +3540,8 @@
%7B%0A%0A
- this.destroyOverlay();%0A
@@ -3745,42 +3745,8 @@
%7B%0A%0A
- this.destroyOverlay();%0A%0A
|
b158e2da999018c96b23e816a83d334525afca47 | simplify slc tasks | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
run = require('gulp-run'),
fs = require('fs');
var install = require("gulp-install");
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('serve', ['startDb'], function (cb) {
new run.Command('export NODE_ENV=local').exec().pipe(process.stdout);
new run.Command('slc run').exec().pipe(process.stdout);
});
gulp.task('startDb', function() {
run('mkdir -p ./mongodb');
new run.Command('mongod --dbpath ./mongodb').exec().pipe(process.stdout);
});
gulp.task('serveprod', function (cb) {
new run.Command('export NODE_ENV=production').exec().pipe(process.stdout);
new run.Command('slc run').exec().pipe(process.stdout);
});
gulp.task('generateservice', function (cb) {
new run.Command('lb-ng ./server/server.js client/js/lib/loopback/lb-services.js').exec().pipe(process.stdout);
});
gulp.task('configProduction', function (cb) {
var productionDatabaseConfiguration = {
db:{
name:"db",
connector: "loopback-connector-mongodb",
url:process.env.DBURL
}
};
fs.writeFile('./server/datasources.production.json', JSON.stringify(productionDatabaseConfiguration));
var newRelicConfigFile = "exports.config = {app_name : ['comida-app'],license_key :'" +process.env.NEW_RELIC_LICENSE_KEY+"',logging : { level : 'info' }};"
fs.writeFile('./newRelic.js', newRelicConfigFile);
});
| JavaScript | 0.999999 | @@ -224,22 +224,8 @@
ve',
- %5B'startDb'%5D,
fun
@@ -248,39 +248,32 @@
ew run.Command('
-export
NODE_ENV=local')
@@ -274,59 +274,9 @@
ocal
-').exec().pipe(process.stdout);%0A new run.Command('
+
slc
@@ -319,152 +319,8 @@
);%0A%0A
-gulp.task('startDb', function() %7B%0A run('mkdir -p ./mongodb');%0A new run.Command('mongod --dbpath ./mongodb').exec().pipe(process.stdout);%0A%7D);%0A%0A
gulp
@@ -377,15 +377,8 @@
nd('
-export
NODE
@@ -396,59 +396,9 @@
tion
-').exec().pipe(process.stdout);%0A new run.Command('
+
slc
|
c2ecbecf2eeda95e01bde2f27181bb4ea7981c56 | Add gravity | js/main.js | js/main.js | function Hero(game, x, y) {
Phaser.Sprite.call(this, game, x, y, 'hero');
this.anchor.set(0.5, 0.5);
this.game.physics.enable(this);
this.body.collideWorldBounds = true;
}
Hero.prototype = Object.create(Phaser.Sprite.prototype);
Hero.prototype.constructor = Hero;
Hero.prototype.move = function(direction) {
const SPEED = 200;
this.body.velocity.x = direction * SPEED;
};
PlayState = {};
PlayState.init = function() {
this.game.renderer.renderSession.roundPixels = true;
this.keys = this.game.input.keyboard.addKeys({
left: Phaser.KeyCode.LEFT,
right: Phaser.KeyCode.RIGHT
});
};
PlayState.preload = function() {
this.game.load.json('level:1', 'data/level01.json');
this.game.load.image('background', 'images/background.png');
this.game.load.image('ground', 'images/ground.png');
this.game.load.image('grass:8x1', 'images/grass_8x1.png');
this.game.load.image('grass:6x1', 'images/grass_6x1.png');
this.game.load.image('grass:4x1', 'images/grass_4x1.png');
this.game.load.image('grass:2x1', 'images/grass_2x1.png');
this.game.load.image('grass:1x1', 'images/grass_1x1.png');
this.game.load.image('hero', 'images/hero_stopped.png');
};
PlayState.create = function() {
this.game.add.image(0, 0, 'background');
this._loadLevel(this.game.cache.getJSON('level:1'));
};
PlayState._loadLevel = function(data) {
data.platforms.forEach(this._spawnPlatform, this);
this._spawnCharaters({ hero: data.hero });
};
PlayState._spawnPlatform = function(platform) {
this.game.add.sprite(platform.x, platform.y, platform.image);
};
PlayState._spawnCharaters = function(data) {
this.hero = new Hero(this.game, data.hero.x, data.hero.y);
this.game.add.existing(this.hero);
};
PlayState.update = function() {
this._handleInput();
};
PlayState._handleInput = function() {
if (this.keys.left.isDown) {
this.hero.move(-1);
}
else if (this.keys.right.isDown) {
this.hero.move(1);
}
else {
this.hero.move(0);
}
};
window.onload = function() {
let game = new Phaser.Game(960, 600, Phaser.AUTO, 'game');
game.state.add('play', PlayState);
game.state.start('play');
};
| JavaScript | 0.999987 | @@ -1355,16 +1355,58 @@
data) %7B%0A
+ this.platforms = this.game.add.group();%0A
data.p
@@ -1491,24 +1491,96 @@
ta.hero %7D);%0A
+ const GRAVITY = 1200;%0A this.game.physics.arcade.gravity.y = GRAVITY;%0A
%7D;%0A%0APlayStat
@@ -1625,26 +1625,40 @@
%7B%0A
-this.game.add.spri
+let sprite = this.platforms.crea
te(p
@@ -1697,16 +1697,120 @@
image);%0A
+ this.game.physics.enable(sprite);%0A sprite.body.allowGravity = false;%0A sprite.body.immovable = true;%0A
%7D;%0A%0APlay
@@ -2002,14 +2002,152 @@
ndle
-Input(
+Collisions();%0A this._handleInput();%0A%7D;%0A%0APlayState._handleCollisions = function() %7B%0A this.game.physics.arcade.collide(this.hero, this.platforms
);%0A%7D
|
b0543c26e92fcb0dc21a8a9b3edd22a89bc2a6e2 | Fix webpack babel loader | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
_ = require('lodash'),
jpegtran = require('imagemin-jpegtran'),
pngcrush = require('imagemin-pngcrush'),
pngquant = require('imagemin-pngquant'),
svgo = require('imagemin-svgo'),
path = require('path'),
webpack = require('webpack'),
plugins = require('gulp-load-plugins')({ camelize: true }),
browserSync = require('browser-sync').create('browserSync'),
reload = browserSync.reload;
var production = !!plugins.util.env.production;
module.exports = function(projectConfig) {
var filePaths = {
src: {
fonts: 'inc/fonts/**/*.*',
images: 'inc/img/**/*.{png,jpg,jpeg,gif,svg,ico,json,xml}',
scripts: 'inc/js/**/*.js',
scriptsDir: 'inc/js',
scriptsFilename: 'app.js',
styles: 'inc/scss/**/*.scss',
views: 'public/**/*.{html,phtml,php}'
},
dist: {
base: 'public/inc/',
fonts: 'fonts',
images: 'img',
scripts: 'js',
scriptsFilename: 'app.js',
styles: 'css'
}
};
_.merge(filePaths, projectConfig);
var webpackPlugins = {
development: [
new webpack.SourceMapDevToolPlugin()
],
production: [
new webpack.optimize.UglifyJsPlugin({
comments: false
})
]
};
var defaultConfig = {
src: filePaths.src,
dist: filePaths.dist,
production: production,
options: {
autoprefixer: {
browsers: [
'last 2 versions',
'ie >= 9'
]
},
browsersync: {
open: false,
notify: false,
proxy: ''
},
csscomb: path.resolve(__dirname, '.csscomb.json'),
imagemin: {
optimizationLevel: 3,
progressive: true,
interlaced: true,
svgoPlugins: [{ removeViewBox: false }],
use: [
jpegtran(),
pngcrush(),
pngquant(),
svgo()
]
},
rucksack: {
shorthandPosition: false,
quantityQueries: false,
alias: false,
inputPseudo: false,
clearFix: false,
fontPath: false,
easings: false
},
scss: {
includePaths: [
'node_modules/foundation-sites/scss',
'node_modules/motion-ui/src/'
]
},
webpack: {
context: path.resolve(filePaths.src.scriptsDir),
entry: './' + filePaths.src.scriptsFilename,
output: {
filename: filePaths.dist.scriptsFilename,
path: path.resolve(filePaths.dist.base, filePaths.dist.scripts),
publicPath: filePaths.src.scriptsDir + '/'
},
module: {
rules: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['es2015']
}
}
]
}],
},
externals: {
foundation: 'Foundation'
},
plugins: production ? webpackPlugins.production : webpackPlugins.development
}
}
};
var config = _.merge({}, defaultConfig, projectConfig);
// Helpers
var errorHandler = require('./gulp/helpers/error-handler')(plugins),
getTask = require('./gulp/helpers/get-task')(gulp, config, plugins);
// Prune bower and install bower components
gulp.task('bower:prune', function(callback) {
getTask('bower/prune', callback);
});
gulp.task('bower:install', function(callback) {
getTask('bower/install', callback);
});
// Clean the compiled assets directory
gulp.task('clean', function(callback) {
getTask('clean/clean', callback);
});
// Move fonts
gulp.task('fonts', getTask('fonts/fonts'));
// Compress images using imagemin
gulp.task('images:compress', getTask('images/compress'));
gulp.task('images:move', getTask('images/move'));
// Compile scripts
gulp.task('scripts', getTask('scripts/build'));
// Compile styles
gulp.task('styles', getTask('styles/build'));
// Pause styles watcher and order scss files using CSScomb
gulp.task('styles:comb', getTask('styles/comb'));
// Browsersync
gulp.task('serve', function() {
browserSync.init(config.options.browsersync);
});
gulp.task('reload', function(callback) {
browserSync.reload();
callback();
});
gulp.task('build', gulp.series(
'clean',
'bower:prune',
'bower:install',
'fonts',
'images:move',
'images:compress',
'scripts',
'styles:comb',
'styles'
));
gulp.task('watch', function() {
gulp.watch(config.src.fonts, gulp.series('fonts'));
gulp.watch(config.src.images, gulp.series('images:move'));
gulp.watch(config.src.scripts, gulp.series('scripts', 'reload'));
config.styleWatcher = gulp.watch(config.src.styles, gulp.series('styles:comb', 'styles'));
gulp.watch(config.src.views, gulp.series('reload'));
});
gulp.task('default', gulp.parallel('build', 'serve', 'watch'));
return gulp;
}; | JavaScript | 0.000002 | @@ -3318,41 +3318,67 @@
de:
-/(node_modules%7Cbower_components)/
+path.resolve(__dirname, '../what-input/dist/what-input.js')
,%0A
|
ea82675d892d4eeb7b52dafe7e1ba3543c8f302b | tweak gulpfile | gulpfile.js | gulpfile.js | import babel from 'gulp-babel';
import del from 'del';
import eslint from 'gulp-eslint';
import gulp from 'gulp';
import jasmine from 'gulp-jasmine';
import plumber from 'gulp-plumber';
import runSequence from 'run-sequence';
const buildDestinationPath = 'dist';
gulp.task('clean', () => del(`${buildDestinationPath}/**/*`));
gulp.task('js', () => gulp
.src('src/**/*')
.pipe(plumber())
.pipe(babel())
.pipe(gulp.dest(buildDestinationPath)));
gulp.task('lint', () => gulp
.src(['spec/**/*', 'src/**/*'])
.pipe(eslint())
.pipe(eslint.formatEach()));
gulp.task('spec', function () {
return gulp.src('spec/index.js')
.pipe(jasmine());
});
gulp.task('watch', () => {
gulp.watch('src/**/*.js', () => runSequence(['js', 'lint'], 'spec'));
gulp.watch('spec/**/*.js*', ['lint', 'spec']);
});
gulp.task('build', () => runSequence('clean', ['js', 'lint'], 'spec'));
gulp.task('default', () => runSequence('clean', ['js', 'lint', 'watch'], 'spec'));
| JavaScript | 0.000001 | @@ -583,35 +583,21 @@
c',
-function () %7B%0A return
+() =%3E
gulp
+%0A
.src
@@ -614,18 +614,16 @@
ex.js')%0A
-
.pipe(
@@ -632,19 +632,16 @@
smine())
-;%0A%7D
);%0A%0Agulp
|
c6eb0ce26e6a3bb02c9f62066467100879761e57 | fix some icons on editor | lib/build/tasks/copy.js | lib/build/tasks/copy.js | /**
* Copy task config
*/
exports.task = function (grunt) {
return {
vendor: {
expand: true,
cwd: 'vendor/assets/stylesheets/',
src: ['**/*.css'],
dest: 'tmp/sass/vendor/',
rename: function (dest, src) {
return dest + src.replace(/\.css$/, '.scss');
},
options: {
// Change all routes from img to asset version path
process: function (content, srcpath) {
// return content.replace(/\.\.\/img/gi,"/assets/<%= pkg.version %>/images/themes");
var path = grunt.template.process('<%= env.http_path_prefix %>/editor/<%= editor_assets_version %>/images/themes');
return content.replace(/\.\.\/img/gi, path);
}
}
},
app: {
files: [{
expand: true,
dot: true,
cwd: 'node_modules/cartoassets/src/fonts',
src: '**/*.*',
dest: '<%= editor_assets_dir %>/fonts/'
}, {
expand: true,
cwd: 'node_modules/cartoassets/src/scss/',
src: '**/*.scss',
dest: 'tmp/sass/cartoassets/'
}, {
expand: true,
cwd: 'node_modules/bootstrap-colorpicker/dist/css/',
src: 'bootstrap-colorpicker.css',
dest: 'tmp/sass/colorpicker/bootstrap-colorpicker/',
rename: function (dest, src) {
return dest + src.replace(/\.css$/, '.scss');
}
}, {
expand: true,
cwd: 'app/assets/stylesheets/deep-insights/themes/scss',
src: '**/*.scss',
dest: 'tmp/sass/deep-insights/'
}, {
expand: true,
cwd: 'node_modules/internal-carto.js/themes/scss',
src: '**/*.scss',
dest: 'tmp/sass/cartodbjs_v4/'
}, {
expand: true,
cwd: 'lib/assets/javascripts/cdb/themes/css/',
src: ['cartodb.css'],
dest: '<%= editor_assets_dir %>/stylesheets/tmp/embeds/',
rename: function (dest, src) {
return dest + src.replace(/\.css$/, '.scss');
}
}, {
// Client stylesheets
expand: true,
cwd: 'app/assets/client/stylesheets/',
src: ['**/*.scss'],
dest: 'tmp/sass/client/',
rename: function (dest, src) {
return dest + src.replace(/\.css.scss$/, '.scss');
}
}, {
expand: true,
cwd: 'app/assets/images/',
src: ['**/*'],
dest: '<%= editor_assets_dir %>/images/'
}, {
// Some images should be placed in a unversioned folder
expand: true,
cwd: 'app/assets/images/',
src: ['avatars/*.png', 'alphamarker.png', 'google-maps-basemap-icons/*.jpg', 'carto.png'],
dest: '<%= root_assets_dir %>/unversioned/images/'
}, {
// CARTO.js images
expand: true,
cwd: 'lib/assets/javascripts/cdb/themes/img/',
src: ['**/*'],
dest: '<%= editor_assets_dir %>/images/themes/'
}, {
// Fonts
expand: true,
cwd: 'app/assets/fonts/',
src: ['*.{svg,ttf,eot,woff,woff2}'],
dest: '<%= editor_assets_dir %>/fonts/'
}, {
// Client fonts
expand: true,
cwd: 'app/assets/client/fonts/',
src: ['*.{svg,ttf,eot,woff,woff2}'],
dest: '<%= editor_assets_dir %>/fonts/'
}, {
// Flash
expand: true,
cwd: 'app/assets/flash/',
src: ['**/*'],
dest: '<%= editor_assets_dir %>/flash/'
}, {
// Favicons
expand: true,
cwd: 'public/favicons/',
src: ['**/*'],
dest: '<%= editor_assets_dir %>/favicons/'
}, {
// Client favicons
expand: true,
cwd: 'app/assets/client/favicons/',
src: ['**/*'],
dest: '<%= editor_assets_dir %>/favicons/'
}]
},
css_cartodb: {
files: [{
// TODO: remove editor
expand: true,
cwd: 'app/assets/stylesheets',
src: [
'**/*.scss',
'!editor-3/**/*.scss',
'!new_dashboard/**/*.scss'
],
dest: 'tmp/sass/editor/',
rename: function (dest, src) {
return dest + src.replace(/\.css.scss$/, '.scss');
}
}]
},
css_builder: {
files: [{
// TODO: remove editor
expand: true,
cwd: 'app/assets/stylesheets/editor-3/',
src: ['**/*.scss'],
dest: 'tmp/sass/editor-3/'
}]
},
css_dashboard: {
files: [{
// TODO: remove editor
expand: true,
cwd: 'app/assets/stylesheets/new_dashboard/',
src: ['**/*.scss'],
dest: 'tmp/sass/new_dashboard/'
}]
},
css_vendor_builder: {
files: [{
expand: true,
cwd: 'node_modules/cartoassets/src/scss/',
src: '**/*.scss',
dest: 'tmp/sass/cartoassets/'
}, {
expand: true,
cwd: 'app/assets/stylesheets/deep-insights/themes/scss',
src: '**/*.scss',
dest: 'tmp/sass/deep-insights/'
}, {
expand: true,
cwd: 'node_modules/internal-carto.js/themes/scss',
src: '**/*.scss',
dest: 'tmp/sass/cartodbjs_v4/'
}]
},
js: {
files: [{
expand: true,
cwd: '<%= editor_assets_dir %>/javascripts/',
src: ['**/*.js'],
dest: '<%= editor_assets_dir %>/javascripts/',
rename: function (dest, src) {
return dest + src.replace(/\.js$/, '.uncompressed.js');
}
}]
}
};
};
| JavaScript | 0.000001 | @@ -592,16 +592,23 @@
efix %25%3E/
+assets/
editor/%3C
|
d1a026168b4adad1ecedd58dc376cdd64b56e551 | Add console debug for CI | lib/builders/latexmk.js | lib/builders/latexmk.js | /** @babel */
import path from 'path'
import Builder from '../builder'
const LATEX_PATTERN = /^latex|u?platex$/
export default class LatexmkBuilder extends Builder {
executable = 'latexmk'
static canProcess (filePath) {
return path.extname(filePath) === '.tex'
}
async run (filePath, jobname, shouldRebuild) {
const args = this.constructArgs(filePath, jobname, shouldRebuild)
const command = `${this.executable} ${args.join(' ')}`
const options = this.constructChildProcessOptions(filePath, { max_print_line: 1000 })
const { statusCode } = await latex.process.executeChildProcess(command, options)
return statusCode
}
logStatusCode (statusCode) {
switch (statusCode) {
case 10:
latex.log.error('latexmk: Bad command line arguments.')
break
case 11:
latex.log.error('latexmk: File specified on command line not found or other file not found.')
break
case 12:
latex.log.error('latexmk: Failure in some part of making files.')
break
case 13:
latex.log.error('latexmk: error in initialization file.')
break
case 20:
latex.log.error('latexmk: probable bug or retcode from called program.')
break
default:
super.logStatusCode(statusCode)
}
}
constructArgs (filePath, jobname, shouldRebuild) {
const args = [
'-interaction=nonstopmode',
'-f',
'-cd',
'-file-line-error'
]
const outputFormat = this.getOutputFormat(filePath)
const enableShellEscape = atom.config.get('latex.enableShellEscape')
const enableSynctex = atom.config.get('latex.enableSynctex') !== false
const enableExtendedBuildMode = atom.config.get('latex.enableExtendedBuildMode')
const engine = this.getLatexEngine(filePath)
if (shouldRebuild) {
args.push('-g')
}
if (jobname) {
args.push(`-jobname=${jobname}`)
}
if (enableShellEscape) {
args.push('-shell-escape')
}
if (enableSynctex) {
args.push('-synctex=1')
}
if (enableExtendedBuildMode) {
const latexmkrcPath = path.resolve(__dirname, '..', '..', 'resources', 'latexmkrc')
args.push(`-r "${latexmkrcPath}"`)
}
if (engine.match(LATEX_PATTERN)) {
args.push(`-latex="${engine}"`)
args.push(outputFormat === 'pdf'
? this.constructPdfProducerArgs(filePath)
: `-${outputFormat}`)
} else {
args.push(`-pdflatex="${engine}"`)
args.push(`-${outputFormat}`)
}
let outdir = this.getOutputDirectory(filePath)
if (outdir) {
args.push(`-outdir="${outdir}"`)
}
args.push(`"${filePath}"`)
return args
}
constructPdfProducerArgs (filePath) {
const producer = this.getProducer(filePath)
switch (producer) {
case 'ps2pdf':
return '-pdfps'
case 'dvipdf':
return '-pdfdvi -e "$dvipdf = \'dvipdf %O %S %D\';"'
default:
return `-pdfdvi -e "$dvipdf = \'${producer} %O -o %D %S\';"`
}
}
}
| JavaScript | 0.000001 | @@ -562,16 +562,32 @@
atusCode
+, stdout, stderr
%7D = awa
@@ -641,16 +641,129 @@
ptions)%0A
+ if (statusCode !== 0) %7B%0A console.log(command)%0A console.log(stdout)%0A console.log(stderr)%0A %7D%0A
retu
|
36edbc45c5dcd5a5f5689748ce0750e82e49204b | fix whitespace | js/main.js | js/main.js | (function() {
var currentMonth = new Date().getMonth();
var placeForSeasonEl = document.getElementById("place");
var season;
switch (currentMonth) {
// winter
case 11:
case 0:
case 1:
season = "winter";
break;
// spring
case 2:
case 3:
case 4:
season = "spring";
break;
// summer
case 5:
case 6:
case 7:
season = "summer";
break;
// autumn
case 8:
case 9:
case 10:
season = "autumn";
break;
default:
season = null;
break;
}
if (season) {
placeForSeasonEl.className += "business-card__place_" + season;
}
})();
| JavaScript | 0.999999 | @@ -755,16 +755,17 @@
ame += %22
+
business
|
babe1d0d75f6ee5f4fc17e51f42f808ade28d9d9 | Add pagintion params to seachDataset method | lib/cartodbmapclient.js | lib/cartodbmapclient.js | 'use strict';
var request = require('request');
var _ = require('lodash');
const defaultOptions = (options) => {
const defaults = {
timeout: 30000,
headers: {
'Content-Type': 'application/json'
}
};
if(!options) {
options = defaults;
} else {
options = _.assign(defaults, options);
}
return options;
};
class CartoDBMapClient {
constructor(user, apiKey) {
this.user = user;
this.apiKey = apiKey;
this.baseURL = 'https://' + this.user + '.cartodb.com/';
}
createNamedMap(options) {
this.existsNamedMap(options.name).then(() => {
});
}
existsNamedMap(name, options) {
var $this = this;
options = defaultOptions(options);
const promise = new Promise((resolve, reject) => {
request(_.assign(options, {
method: 'GET',
uri: $this.baseURL + 'tiles/template/' + name,
qs: {
'api_key': $this.apiKey,
},
json: {}
}), (error, response, body) => {
if(error) {
reject(error);
}
resolve({
exists: response.statusCode !== 404,
data: body
});
});
});
return promise;
}
searchDatasets(text, page, size, options) {
var $this = this;
options = defaultOptions(options);
const promise = new Promise((resolve, reject) => {
request(_.assign(options, {
method: 'GET',
uri: $this.baseURL + 'api/v1/viz/',
qs: {
'api_key': $this.apiKey,
deepInsights: false,
'exclude_shared': false,
types: 'table,remote',
shared: 'yes',
q: text,
page,
'per_page': size
},
json: {}
}), (error, response, body) => {
if(error) {
reject(error);
}
resolve(body);
});
});
return promise;
}
getGroupID(name, options) {
var $this = this;
options = defaultOptions(options);
const promise = new Promise((resolve, reject) => {
request(_.assign(options, {
method: 'POST',
uri: $this.baseURL + 'tiles/template/' + name,
qs: {
'api_key': $this.apiKey,
},
json: {}
}), (error, response, body) => {
if(error) {
reject(error);
}
resolve(body);
});
});
return promise;
}
get(suffixUrl, params, options) {
var $this = this;
if(!params) {
params = {};
}
options = defaultOptions(options);
// jshint camelcase: false
params.api_key = this.apiKey;
const promise = new Promise((resolve, reject) => {
request(_.assign(options, {
method: 'GET',
uri: $this.baseURL + suffixUrl,
qs: params,
json: {}
}), (error, response, body) => {
if(error) {
reject(error);
}
resolve(body);
});
});
return promise;
}
post(suffixUrl, params, body, options) {
var $this = this;
if(!params) {
params = {};
}
if(!body) {
body = {};
}
options = defaultOptions(options);
// jshint camelcase: false
params.api_key = this.apiKey;
const promise = new Promise((resolve, reject) => {
request(_.assign(options, {
method: 'POST',
uri: $this.baseURL + suffixUrl,
qs: params,
json: body
}), (error, response, body) => {
if(error) {
reject(error);
}
resolve(body);
});
});
return promise;
}
}
module.exports = CartoDBMapClient;
| JavaScript | 0 | @@ -1233,32 +1233,77 @@
r $this = this;%0A
+ page = page %7C%7C 0;%0A size = size %7C%7C 20;%0A
options = de
|
33bed47c355c15a4efc16024bca7b2786f2b1d30 | set gulpfile back. CNAME seems to be known issue with gulp-gh-pages | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var runSequence = require("run-sequence");
var clean = require('gulp-rimraf');
var shell = require('gulp-shell');
var connect = require('gulp-connect');
var open = require('gulp-open');
var deploy = require("gulp-gh-pages");
gulp.task('clean', function () {
return gulp.src('dist', {read:false})
.pipe(clean());
});
gulp.task('snow', shell.task('.\\Snow\\_compiler\\Snow.exe config=.\\Snow\\'));
gulp.task('connect', function() {
connect.server({
root: 'dist/',
port: '8123'
});
});
gulp.task("open", function(){
var options = {
url: "http://localhost:8123"
};
gulp.src("dist/index.html")
.pipe(open("", options));
});
// generate website to 'dist' folder and then open site in browser
gulp.task('build', function(callback) {
runSequence('clean', 'snow', 'connect', 'open');
});
// deploy 'dist' folder to mwhelan.github.io github repo, master branch
var options = {
remoteUrl: "https://github.com/mwhelan/mwhelan.github.io.git",
branch: "master"};
gulp.task('deploy', function () {
gulp.src("dist/**/*")
.pipe(deploy(options));
}); | JavaScript | 0 | @@ -1019,16 +1019,18 @@
ster%22%7D;%0A
+
gulp.tas
@@ -1059,16 +1059,18 @@
) %7B%0A
+
gulp.src
@@ -1080,19 +1080,23 @@
ist/**/*
+.*
%22)%0A
+
@@ -1111,19 +1111,21 @@
ploy(options));%0A
+
%7D);
|
31f0a04c6169074ddf828b376fbfbb10568a9678 | Change bgcolor of flashcard in next QA set | js/main.js | js/main.js | var questions = [
Q1 = {
question: "What does HTML means?",
answer: "HyperText Markup Language"
},
Q2 = {
question: "What does CSS means?",
answer: "Cascading Style Sheet"
},
Q3 = {
question: "Why the \"C\" in CSS, is called Cascading?",
answer: "When CSS rules are duplicated, the rule to be use is chosen by <em>cascading</em> down from more general rules to the specific rule required"
}
];
var question = document.getElementById('question');
var questionNum = 0,
answeredQA = [],
errorTimes = 0;
// Generate random number to display random QA set
function createNum() {
// Recursively create random questionNum so that last QA set will not be repeated
while (answeredQA.indexOf(questionNum) !== -1) {
// If all QAs set is finished, let user restart the quiz
if (errorTimes > 10) {
revealBtn.value = "RESTART";
return false;
}
// Generate random num
questionNum = Math.floor(Math.random() * questions.length);
errorTimes++;
}
// Fade effect
question.style.opacity = 0;
// Wait for 500ms before changing the question
setTimeout(function () {
question.innerHTML = questions[questionNum].question;
question.style.opacity = 1;
}, 500);
// Let this program know that the user already seen the question
answeredQA.push(questionNum);
}
var revealBtn = document.getElementById('reveal-answer');
var card = document.getElementById('flashcard');
function revealAns() {
if (this.value == "RESTART") {
// Reload the page
location.reload();
} else if (this.value == "NEXT") {
revealBtn.value = "REVEAL";
// Display next set of QA
createNum();
} else {
// If value is "REVEAL", display the answer
question.innerHTML = questions[questionNum].answer;
revealBtn.value = "NEXT";
}
}
revealBtn.onclick = revealAns;
window.onload = createNum; | JavaScript | 0 | @@ -1528,16 +1528,103 @@
EXT%22) %7B%0A
+%09%09// Change back the bgcolor of flashcard to red %0A%09%09card.style.background = %22#ff4553%22;%0A
%09%09reveal
@@ -1724,16 +1724,92 @@
REVEAL%22,
+ change flashcard bgcolor to cyan%0A%09%09card.style.background = %22#0cc%22;%0A%09%09// And
display
|
ccc4cdbd119dd91005e92b5424a4c832e9f6377a | Fix install message | lib/commands/install.js | lib/commands/install.js | var fs = require('fs-extra');
var path = require('path');
var async = require('async');
var semver = require('semver');
var schemes = (function() {
var default_scheme;
var schememap = {};
return {
get: function(name) {
return schememap[name];
},
add: function(name, resolver) {
schememap[name] = resolver;
return this;
},
default: function(name) {
if( !arguments.length ) return default_scheme;
default_scheme = name;
return this;
}
};
})();
schemes.add('bower', require('../installer/bower.js'));
schemes.add('gitlab', require('../installer/npm.js'));
schemes.add('github', require('../installer/npm.js'));
schemes.add('gist', require('../installer/npm.js'));
schemes.add('bitbucket', require('../installer/npm.js'));
schemes.add('npm', require('../installer/npm.js'));
schemes.default('npm');
/**
* dependency indicator spec
*
*/
function extractSubDependencies(pkg) {
var webDependencies = pkg && pkg.webDependencies;
var pkgs = [];
Object.keys(webDependencies || {}).forEach(function(k) {
var expression = webDependencies[k];
var name = k, scheme, pos = expression.indexOf(':');
if( ~pos ) {
scheme = expression.substring(0, pos);
expression = expression.substring(pos + 1);
}
scheme = scheme || schemes.default();
// is version
if( ~['*', 'latest'].indexOf(expression) ) {
pkgs.push(scheme + ':' + k);
} else if( semver.validRange(expression) ) {
pkgs.push(scheme + ':' + k + '@' + expression);
} else {
pkgs.push(scheme + ':' + name + '[' + expression + ']');
}
});
return pkgs;
}
function parse(expression) {
var alias = (function() {
var pos = expression.indexOf('[');
if( ~pos ) return expression.substring(0, pos);
})();
if( alias ) {
expression = (function() {
expression = expression.substring(expression.indexOf('[') + 1)
expression = expression.substring(0, expression.lastIndexOf(']'));
return expression;
})();
}
var scheme = (function() {
if( alias && ~alias.indexOf(':') ) return alias.substring(0, alias.indexOf(':'));
if( expression && ~expression.indexOf(':') ) return expression.substring(0, expression.indexOf(':'));
})();
if( alias && ~alias.indexOf(':') ) alias = alias.substring(alias.indexOf(':') + 1);
if( expression && ~expression.indexOf(':') ) expression = expression.substring(expression.indexOf(':') + 1);
return {
scheme: scheme || schemes.default(),
alias: alias,
expression: expression
}
}
module.exports = function install(pkgs, options, done) {
// load .webmodulesrc file
var cwd = options.cwd || process.cwd();
var pkgfile = path.join(cwd, 'package.json');
var rcfile = path.join(cwd, '.webmodulesrc');
var target = path.resolve(cwd, 'web_modules');
if( cwd === process.cwd() && fs.existsSync(rcfile) ) {
var rc = JSON.parse(fs.readFileSync(rcfile));
if( rc.directory ) target = path.resolve(cwd, rc.directory);
}
if( options.directory ) target = path.resolve(cwd, options.directory);
if( !fs.existsSync(target) ) fs.mkdirsSync(target);
if( !pkgs || !pkgs.length ) {
if( !fs.existsSync(pkgfile) ) return done(new Error('package.json file not found'));
pkgs = extractSubDependencies(require(pkgfile));
options.save = false;
}
if( !pkgs.length ) return done(null, []);
//console.log('pkgs', pkgs);
var installed = [];
async.eachSeries(pkgs, function(pkg, done) {
pkg = parse(pkg);
console.log('- Installing %s from %s', pkg.expression, pkg.scheme);
var resolver = schemes.get(pkg.scheme);
if( !resolver ) return done(new Error('not found repository scheme:' + pkg.scheme));
resolver.install(pkg, {
target: target
}, function(err, result) {
if( err ) return done(err);
pkg.manifest = result.manifest;
pkg.directory = result.directory;
pkg.name = result.name;
pkg.expression = pkg.scheme === 'npm' ? result.expression : (pkg.scheme + ':' + result.expression);
pkg.version = result.version;
installed.push(pkg);
// search sub web modules in current packages
var pkgs = extractSubDependencies(pkg.manifest);
if( !pkgs.length ) return done();
// install sub web modules
install(pkgs, {
cwd: pkg.directory
}, done);
});
}, function(err) {
if( err ) return done(err);
if( options.save && fs.existsSync(pkgfile) ) {
var manifest = require(pkgfile);
var wd = manifest.webDependencies = manifest.webDependencies || {};
installed.forEach(function(info) {
wd[info.name] = info.expression;
});
fs.writeFileSync(pkgfile, JSON.stringify(manifest, null, ' '), 'utf8');
}
done(null, installed);
});
return this;
}; | JavaScript | 0 | @@ -3610,24 +3610,63 @@
, pkg.scheme
+, pkg.alias ? (' as ' + pkg.alias) : ''
);%0A %0A
|
fdf396de3f77166ce7607daa71656c09e9a97020 | Fix order of concatenating Javascript files | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var concat = require('gulp-concat');
var sources = ['src/**/*.js',
"node_modules/videojs-contrib-media-sources/dist/videojs-contrib-media-sources.min.js",
"node_modules/videojs-contrib-hls/dist/videojs-contrib-hls.min.js",
"node_modules/hls.js/dist/hls.min.js"];
gulp.task('build', function() {
return gulp.src(sources)
.pipe(concat('videojs-contrib-hlsjs.js'))
.pipe(gulp.dest('dist/'));
}); | JavaScript | 0 | @@ -78,28 +78,14 @@
= %5B
-'src/**/*.js',
%0A
-%22
+'
node
@@ -160,32 +160,32 @@
urces.min.js
-%22
+'
,%0A
-%22
+'
node_modules
@@ -240,16 +240,16 @@
n.js
-%22
+'
,%0A
-%22
+'
node
@@ -283,9 +283,29 @@
n.js
-%22
+',%0A 'src/**/*.js'%0A
%5D;%0A%0A
|
b00e992f047b64b70a330c164b7d7e74b069b321 | Update Ember.set() error | lib/components/chart.js | lib/components/chart.js | 'use strict';
/**
C3 Chart component
*/
Ember.C3.ChartComponent = Ember.Component.extend({
/**
Element tag name
*/
tagName: 'div',
/**
Element classes
*/
classNames: ['c3-chart-component'],
/**
The data to display
*/
data: {},
/**
Axis specifications
*/
axis: {},
/**
Region specifications
*/
regions: {},
/*
Type of chart
*/
bar: {},
pie: {},
donut: {},
gauge: {},
/**
Grid lines
*/
grid: {},
/**
Legend
*/
legend: {},
/**
Tooltip
*/
tooltip: {},
/**
Subchart
*/
subchart: {},
/**
Zoom
*/
zoom: {},
/**
Size
*/
size: {},
/**
Padding
*/
padding: {},
/**
Color
*/
color: {},
/**
Transition
*/
transition: {},
/**
The Chart
*/
chart: function() {
var self = this;
var container = self.get('element');
if (Ember.isEqual(container, undefined)) {
return undefined;
} else {
var config = self.get('_config');
var chart = c3.generate(config);
self.set('_chart', chart);
return chart;
}
}.property('element', '_config'),
/**
*/
_config: function() {
var self = this;
var c = self.getProperties([
'data',
'axis',
'regions',
'bar',
'pie',
'donut',
'gauge',
'grid',
'legend',
'tooltip',
'subchart',
'zoom',
'size',
'padding',
'color',
'transition'
]);
c.bindto = self.get('element');
return c;
}.property('element',
'data',
'axis',
'regions',
'bar',
'pie',
'donut',
'gauge',
'grid',
'legend',
'tooltip',
'subchart',
'zoom',
'size',
'padding',
'color',
'transition'),
/**
Observer
*/
chartDataDidChange: function() {
var self = this;
if (!Ember.isBlank(self.get('data'))) {
var chart = self.get('chart');
chart.load(self.get('data'));
}
}.observes('data',
'axis',
'regions',
'bar',
'pie',
'donut',
'gauge',
'grid',
'legend',
'tooltip',
'subchart',
'zoom',
'size',
'padding',
'color',
'transition'
).on('didInsertElement')
});
Ember.Handlebars.helper('c3-chart', Ember.C3.ChartComponent);
| JavaScript | 0 | @@ -1245,19 +1245,8 @@
rty(
-'element',
'_co
@@ -1788,27 +1788,8 @@
rty(
-'element',%0A
'dat
|
d050a80d633d9e23c4d60c5486599a419180b388 | Use build as default task | Gulpfile.js | Gulpfile.js | var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var jsFiles = 'src/*.js', jsDest = 'dist';
gulp.task('build', function() {
return gulp.src(jsFiles)
.pipe(concat('tongue.js'))
.pipe(gulp.dest(jsDest))
.pipe(rename('tongue.min.js'))
.pipe(uglify())
.pipe(gulp.dest(jsDest))
}); | JavaScript | 0.000001 | @@ -193,13 +193,15 @@
sk('
-build
+default
', f
|
6085f80b26ac1618ef8bd5dccf1631f4bb3d3c2e | Fix test to use message | tests/lib/main-node.js | tests/lib/main-node.js | 'use strict';
var expect = require('expect.js')
, proxyquire = require('proxyquire')
;
describe('SockJS', function() {
describe('Constructor', function () {
describe('WebSocket specification step #2', function () {
it('should throw SecurityError for an insecure url from a secure page', function () {
var main = proxyquire('../../lib/main', { './location': {
protocol: 'https'
}});
var sjs = proxyquire('../../lib/entry', { './main': main });
expect(function () {
sjs('http://localhost');
}).to.throwException(function (e) {
expect(e).to.be.a(Error);
expect(e).to.contain('SecurityError');
});
});
});
});
});
| JavaScript | 0 | @@ -647,24 +647,32 @@
expect(e
+.message
).to.contain
|
33841fd090a87285cc41d50209943296b700136f | add build gulp task | gulpfile.js | gulpfile.js | var gulp = require('gulp');
watch = require('gulp-watch'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
util = require('gulp-util'),
plumber = require('gulp-plumber'),
concat = require('gulp-concat'),
jshint = require('gulp-jshint'),
jscs = require('gulp-jscs'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
cache = require('gulp-cached'),
stylus = require('gulp-stylus'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
imagemin = require('gulp-imagemin');
function errorNotify(error){
notify.onError("Error: <%= error.message %>")
util.log(util.colors.red('Error'), error.message);
}
gulp.task('javascript', function() {
gulp.src('js/main.js')
.pipe(sourcemaps.init())
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jscs('.jscsrc'))
.on('error', errorNotify)
.pipe(uglify())
.on('error', errorNotify)
.pipe(rename({suffix: '.min'}))
.pipe(sourcemaps.write('/'))
.on('error', errorNotify)
.pipe(gulp.dest('js'))
.pipe(notify({ message: 'Javascript task complete' }));
});
gulp.task('javascript-library', function() {
gulp.src('js/library/*.js')
.pipe(concat('library.js'))
.pipe(gulp.dest('js'))
.pipe(notify({ message: 'Javascript Library task complete' }));
});
gulp.task('style', function() {
return gulp.src('css/site.styl')
.pipe(plumber())
.pipe(stylus())
.on('error', errorNotify)
.pipe(autoprefixer())
.on('error', errorNotify)
.pipe(gulp.dest('css'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.on('error', errorNotify)
.pipe(gulp.dest('css'))
.pipe(notify({ message: 'Style task complete' }));
});
gulp.task('images', function () {
return gulp.src('src/images/*.*')
.pipe(cache('images'))
.pipe(imagemin({
progressive: false
}))
.on('error', errorNotify)
.pipe(gulp.dest('img/dist'))
.pipe(notify({ message: 'Images task complete' }));
});
gulp.task('watch', function() {
gulp.watch(['js/main.js'], ['javascript']);
gulp.watch(['js/library/*.js'], ['javascript-library']);
gulp.watch(['css/site.styl'], ['style']);
gulp.watch(['img/src/**'], ['images']);
});
gulp.task('default', ['watch']);
| JavaScript | 0.000002 | @@ -2209,32 +2209,99 @@
images'%5D);%0A%7D);%0A%0A
+gulp.task('build', %5B'style', 'javascript', 'javascript-library'%5D);%0A
gulp.task('defau
|
602ec35de3aedf0e3d2ac14e08ff2a3cd548a075 | fix deploy source path | gulpfile.js | gulpfile.js | const gulp = require('gulp');
const sass = require('gulp-sass');
const minifycss = require('gulp-minify-css');
const concat = require('gulp-concat');
const iconfont = require('gulp-iconfont');
const svgmin = require('gulp-svgmin');
const consolidate = require('gulp-consolidate');
const rename = require('gulp-rename');
const foreach = require('gulp-foreach');
const exec = require('child_process').exec;
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const del = require('del');
const util = require('gulp-util');
const ftp = require('vinyl-ftp');
const minimist = require('minimist');
const deployargs = minimist(process.argv.slice(2));
gulp.task('default',['clean', 'build']);
gulp.task('build', ['iconfont', 'styles', 'scripts']);
//clean dist folder
gulp.task('clean', function() {
return del(['dist']);
});
//generate icon font from svg files
gulp.task('iconfont', function() {
gulp.src('fonts/svg/*.svg')
//minify svg source files
.pipe(foreach(function(stream, file) {
return stream
.pipe(svgmin())
.pipe(concat(file.path))
}))
// generate icon font
.pipe(gulp.dest('fonts/svg'))
.pipe(iconfont({
normalize: true,
fontHeight: 1000,
descent: 64,
fontName: 'catif',
metadata: 'Catenology Icon Font',
version: 'v1.0',
appendCodepoints: true,
fontPath: 'fonts',
formats: ['ttf', 'eot', 'woff', 'svg'],
timestamp: Math.round(Date.now() / 1000)
}))
//generate _icons.scss
.on('glyphs', function(glyphs) {
const options = {
fontName: 'catif',
fontPath: 'fonts/',
className: 'catif',
glyphs: glyphs.map(function(glyph) {
return {
codepoint: glyph.unicode[0].charCodeAt(0).toString(16).toUpperCase(),
name: glyph.name
}
})
};
glyphs.forEach(function(glyph, idx, arr) {
arr[idx].glyph = glyph.unicode[0].charCodeAt(0).toString(16).toUpperCase()
});
gulp.src('fonts/_template.scss')
.pipe(consolidate('lodash', options))
.pipe(rename('_icons.scss'))
.pipe(gulp.dest('sass/'));
})
.pipe(gulp.dest('dist/fonts/'));
});
//compile stylesheet
gulp.task('styles', function() {
gulp.src('sass/main.scss')
//compile sass
.pipe(sass())
.pipe(gulp.dest('dist'))
//minify
.pipe(minifycss())
.pipe(rename('catfw.min.css'))
.pipe(gulp.dest('dist'));
});
//compile javascript
gulp.task('scripts', function() {
gulp.src('js/main.js')
//compile babel
.pipe(babel({
presets: ['es2015']
}))
.pipe(rename('catfw.js'))
.pipe(gulp.dest('dist'))
//minify
.pipe(uglify())
.pipe(rename('catfw.min.js'))
.pipe(gulp.dest('dist'))
});
//just concat a sass file
gulp.task('justsass', function() {
gulp.src(['sass/_variables.scss', 'sass/mixins/*.scss', 'sass/_typography.scss', 'sass/_code.scss', 'sass/_grid.scss', 'sass/_buttons.scss', 'sass/_links.scss', 'sass/_labels.scss', 'sass/_images.scss', 'sass/_dialog.scss', 'sass/_carousel.scss', 'sass/_navbar.scss', 'sass/_modal.scss', 'sass/_pagination.scss', 'sass/_animation.scss', 'sass/_icons.scss', 'sass/_utilities.scss'])
.pipe(concat('catfw.scss'))
.pipe(gulp.dest('dist'));
});
//generate documentation site and build it with jekyll
gulp.task('doc', function(cb) {
//clean referenced assets
del(['doc/css/catfw.min.css','doc/css/fonts/catif.*','doc/js/catfw.min.js']);
//grab new assets
gulp.src('dist/catfw.min.css')
.pipe(gulp.dest('doc/css/'));
gulp.src('dist/catfw.min.js')
.pipe(gulp.dest('doc/js/'));
gulp.src('dist/fonts/*')
.pipe(gulp.dest('doc/css/fonts/'));
//jekyll build the site
exec(['jekyll b --source doc --destination doc/_site'], function(err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
})
});
//ftp deployment
gulp.task('deploy', function(){
const remotePath = '/catfw/';
const conn = ftp.create({
host: '184.168.61.1',
user: deployargs.user,
password: deployargs.password,
log: util.log
});
gulp.src('doc/*')
.pipe(conn.newer(remotePath))
.pipe(conn.dest(remotePath));
});
| JavaScript | 0.000001 | @@ -4672,16 +4672,22 @@
rc('doc/
+_site/
*')%0D%0A .
|
68021e16a6496cbba1b3d2e3a015c09fa2f3dcc1 | include trailing slash in API call (#7585) | services/amo/amo-base.js | services/amo/amo-base.js | import Joi from 'joi'
import { nonNegativeInteger } from '../validators.js'
import { BaseJsonService } from '../index.js'
const keywords = ['amo', 'firefox']
const schema = Joi.object({
average_daily_users: nonNegativeInteger,
current_version: Joi.object({
version: Joi.string().required(),
}).required(),
ratings: Joi.object({
average: Joi.number().required(),
}).required(),
weekly_downloads: nonNegativeInteger,
}).required()
class BaseAmoService extends BaseJsonService {
static defaultBadgeData = { label: 'mozilla add-on' }
async fetch({ addonId }) {
return this._requestJson({
schema,
url: `https://addons.mozilla.org/api/v3/addons/addon/${addonId}`,
})
}
}
export { BaseAmoService, keywords }
| JavaScript | 0 | @@ -692,16 +692,17 @@
addonId%7D
+/
%60,%0A %7D
|
500428c7fcdf3405c51c7b2562e17b03ca5ee30c | Add referent at the engine collection | src/model/AccessModel.js | src/model/AccessModel.js | var AccessModel = function (db, domain, typeDSL) {
this.db = db;
this.domain = domain;
this.typeDSL = typeDSL;
this.engine = {
Cell: CellEngine,
Collection: CollectionEngine,
Document: DocumentEngine,
Dashboard: DashboardEngine
};
this.getEngine = (model) => {
model.bind(db);
return new engine[this.typeDSL](model);
};
}
AccessModel.prototype.by = function (token) {
var model = this.domain.getByToken(token);
if (model === undefined) {
throw new Error("No such dsl reference with the token passed by argument");
} else if (model.constructor.name !== this.typeDSL) {
throw new Error(`Wrong cast from ${this.typeDSL} to ${model.constructor.name}`);
} else {
return this.getEngine(model);
}
};
AccessModel.prototype.all = function () {
var registry = this.domain.getAll();
var remains = registry.filter((value) => {
return (value.constructor.name === this.typeDSL);
});
return this.getEngine(remains);
};
module.exports = AccessModel;
| JavaScript | 0 | @@ -1,12 +1,78 @@
+var CollectionEngine = require(%22../engine/CollectionEngine.js%22);%0A%0A
var AccessMo
@@ -218,16 +218,21 @@
Cell
+Model
: CellEn
@@ -255,16 +255,21 @@
llection
+Model
: Collec
@@ -296,16 +296,21 @@
Document
+Model
: Docume
@@ -336,16 +336,21 @@
ashboard
+Model
: Dashbo
|
ab14e14f9f42f1cbc647fc9d0802239c6089db4d | Normalize arrow function syntax | gulpfile.js | gulpfile.js | 'use strict';
const gulp = require('gulp');
gulp.task('clean', () => {
let del = require('del');
return del(['lib/*.js', 'postcss.js', 'build/', 'api/']);
});
// Build
gulp.task('compile', () => {
let sourcemaps = require('gulp-sourcemaps');
let changed = require('gulp-changed');
let babel = require('gulp-babel');
return gulp.src('lib/*.es6')
.pipe(changed('lib', { extension: '.js' }))
.pipe(sourcemaps.init())
.pipe(babel({
presets: [
[
'env',
{
targets: {
browsers: 'last 1 version',
node: 4
},
loose: true
}
]
],
plugins: ['add-module-exports', 'precompile-charcodes']
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('lib'));
});
gulp.task('build:lib', ['compile'], () => {
return gulp.src(['lib/*.js', 'lib/*.d.ts']).pipe(gulp.dest('build/lib'));
});
gulp.task('build:docs', () => {
let ignore = require('fs').readFileSync('.npmignore').toString()
.trim().split(/\n+/)
.concat([
'.npmignore', 'lib/*', 'test/*', 'node_modules/**/*',
'docs/api.md', 'docs/plugins.md', 'docs/writing-a-plugin.md'
]).map( i => '!' + i );
return gulp.src(['**/*'].concat(ignore))
.pipe(gulp.dest('build'));
});
gulp.task('build', (done) => {
let runSequence = require('run-sequence');
runSequence('clean', ['build:lib', 'build:docs'], done);
});
// Tests
gulp.task('integration', ['build'], done => {
let postcss = require('./build');
let real = require('postcss-parser-tests/real');
real(done, css => {
return postcss.parse(css).toResult({ map: { annotation: false } });
});
});
gulp.task('version', ['build:lib'], () => {
let Processor = require('./lib/processor');
let instance = new Processor();
let pkg = require('./package');
if ( pkg.version !== instance.version ) {
throw new Error('Version in Processor is not equal to package.json');
}
});
// Common
gulp.task('default', ['version', 'integration']);
| JavaScript | 0.000747 | @@ -1522,14 +1522,12 @@
d',
-(
done
-)
=%3E
|
aacf17c3e8800e6da5646a56db868f69bbc03356 | remove log statement | js/main.js | js/main.js | /* globals Info */
import {markdown} from 'markdown';
require('./sketch');
require('./gui');
function httpGet(url) {
return new Promise(function(resolve, reject) {
var request = new XMLHttpRequest();
request.open('GET', url, true);
request.onload = function() {
if (this.status >= 200 && this.status < 400) {
resolve(this.response);
} else {
reject(this.response);
}
};
request.onerror = function() {
reject(this.response);
};
request.send();
});
}
httpGet('README.md').then(readme => {
console.log('README', readme);
new Info({
html: markdown.toHTML(readme),
el: 'info',
container: 'container',
keyTrigger: true
});
});
| JavaScript | 0.000002 | @@ -634,43 +634,8 @@
%3E %7B%0A
- console.log('README', readme);%0A
|
3686e7b99f61519569c7e51eb85ebfe877a588da | update spectra-processor to 0.4.0 | eln/libs/SpectraProcessor.js | eln/libs/SpectraProcessor.js | export {
SpectraProcessor
} from 'https://www.lactame.com/lib/spectra-processor/0.3.0/spectra-processor.js';
// } from 'http://localhost:9898/cheminfo-js/spectra-processor/dist/spectra-processor.js';
| JavaScript | 0.000122 | @@ -81,9 +81,9 @@
r/0.
-3
+4
.0/s
@@ -104,17 +104,16 @@
or.js';%0A
-%0A
// %7D fro
|
453bb9dbdbbb656baed00e3a0f54501bec845ea8 | Add test presenting code for debugging | livedoc-ui/src/components/DocPresenter.js | livedoc-ui/src/components/DocPresenter.js | // @flow
import {List, Map} from 'immutable';
import * as React from 'react';
import {connect} from 'react-redux';
import type {Livedoc} from '../models/livedoc';
import type {State} from '../models/state';
import type {Api} from '../models/api';
type Props = {
loading: boolean, url: ?string, livedoc: ?Livedoc
}
const DocPresenter = (props: Props) => {
if (props.loading) {
return <span>Loading documentation from {props.url}</span>
}
if (!props.livedoc) {
return <span>Please provide a URL to fetch a documentation.</span>
}
const apis: Map<string, List<Api>> = props.livedoc.apis;
const nbApis = apis.size;
return <div>
<p>nbApisGroups = {nbApis || "undef"}</p>
<p>apis.get? = {apis.get !== undefined}</p>
</div>
};
const mapStateToProps = (state: State) => ({
loading: state.loading,
url: state.url,
livedoc: state.livedoc,
});
const mapDispatchToProps = {};
export default connect(mapStateToProps, mapDispatchToProps)(DocPresenter);
| JavaScript | 0 | @@ -6,45 +6,8 @@
low%0A
-import %7BList, Map%7D from 'immutable';%0A
impo
@@ -91,16 +91,24 @@
%7BLivedoc
+, ApiDoc
%7D from '
@@ -174,48 +174,8 @@
te';
-%0Aimport type %7BApi%7D from '../models/api';
%0A%0Aty
@@ -487,33 +487,44 @@
api
-s: Map%3Cstring, List%3CApi%3E%3E
+Docs: %7B%5Bkey: string%5D: Array%3CApiDoc%3E%7D
= p
@@ -543,16 +543,19 @@
.apis;%0A
+ //
const n
@@ -563,77 +563,86 @@
Apis
- = apis.size;%0A return %3Cdiv%3E%0A %3Cp%3EnbApisGroups = %7BnbApis %7C%7C %22undef%22
+: number = apiDocs.keys();%0A return %3Cdiv%3E%0A %3Cp%3EapiDocs.get? = %7B!!apiDocs.get
%7D%3C/p
@@ -657,44 +657,136 @@
%3Eapi
-s.get
+Docs.keys
? = %7B
+!!
api
-s.get !== undefined
+Docs.keys%7D%3C/p%3E%0A %3Cpre style=%7B%7BtextAlign: 'left'%7D%7D%3EapiDocs%5B%22%22%5D = %7BJSON.stringify(apiDocs%5B''%5D, null, 3)
%7D%3C/p
+re
%3E%0A
|
25e9c82ba84cd3e16f81aad3c6c135cbbf191669 | Improve build script | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var clean = require('gulp-clean');
var zip = require('gulp-zip');
var bases = {
root: 'dist/'
};
var paths = [
'core/actions/*',
'core/common/**',
'admin/**',
'!admin/config/*',
'boxoffice/**',
'!boxoffice/config/*',
'customer/**',
'!customer/config/*',
'scanner/**',
'!scanner/config/*',
'printer/**',
'!printer/config/*',
'core/model/*',
'core/services/*',
'vendor/**',
'composer.lock',
'core/dependencies.php',
'core/.htaccess'
];
gulp.task('clean', function() {
return gulp.src(bases.root)
.pipe(clean({}));
});
gulp.task('collect', function() {
return gulp.src(paths, { base: './', dot: true })
.pipe(gulp.dest(bases.root));
});
gulp.task('zip', function() {
return gulp.src(bases.root + '**')
.pipe(zip('ticketbox-server-php.zip'))
.pipe(gulp.dest(bases.root));
});
gulp.task('default', gulp.series('clean', 'collect', 'zip'));
| JavaScript | 0.000002 | @@ -153,25 +153,86 @@
ore/
-actions/*
+**',%0A '!core/data',%0A '!core/data/**/*',%0A '!core/logs/**/*.txt
',%0A '
core
@@ -231,21 +231,97 @@
'
+!
core/
-common/*
+logs/**/*.pdf',%0A '!core/logs/**/*.html',%0A '!core/tests',%0A '!core/tests/**/
*',%0A
@@ -348,22 +348,54 @@
'!admin/
+api/
config
+',%0A '!admin/api/config/**
/*',%0A
@@ -427,22 +427,58 @@
xoffice/
+api/
config
+',%0A '!boxoffice/api/config/**
/*',%0A
@@ -508,32 +508,34 @@
ustomer/
+api/
config
-/*
',%0A '
scanner/
@@ -530,34 +530,21 @@
'
-scanner/**',%0A '!scanner
+!customer/api
/con
@@ -548,24 +548,27 @@
config/*
+*/*
',%0A '
printer/
@@ -559,21 +559,21 @@
',%0A '
-print
+scann
er/**',%0A
@@ -582,32 +582,34 @@
'!
-printer
+scanner/api
/config
-/*
',%0A '
core
@@ -608,41 +608,30 @@
'
-core/model/*',%0A 'core/services
+!scanner/api/config/**
/*',
@@ -640,13 +640,14 @@
'
-vendo
+printe
r/**
@@ -658,72 +658,59 @@
'
-composer.lock',%0A 'core/dependencies.php',%0A 'core/.htaccess
+!printer/api/config',%0A '!printer/api/config/**/*
'%0A%5D;
|
36b389cda722450f2bf3745ad530e1c3bcb67bea | fix comment | lib/es6-promise/asap.js | lib/es6-promise/asap.js | var len = 0;
var toString = {}.toString;
var vertxNext;
export default function asap(callback, arg) {
queue[len] = callback;
queue[len + 1] = arg;
len += 2;
if (len === 2) {
// If len is 1, that means that we need to schedule an async flush.
// If additional callbacks are queued before the queue is flushed, they
// will be processed by this flush that we are scheduling.
scheduleFlush();
}
}
var browserWindow = (typeof window !== 'undefined') ? window : undefined;
var browserGlobal = browserWindow || {};
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
var isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
// test for web worker but not in IE10
var isWorker = typeof Uint8ClampedArray !== 'undefined' &&
typeof importScripts !== 'undefined' &&
typeof MessageChannel !== 'undefined';
// node
function useNextTick() {
var nextTick = process.nextTick;
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
// setImmediate should be used instead instead
var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
if (Array.isArray(version) && version[1] === '0' && version[2] === '10') {
nextTick = setImmediate;
}
return function() {
nextTick(flush);
};
}
// vertx
function useVertxTimer() {
return function() {
vertxNext(flush);
};
}
function useMutationObserver() {
var iterations = 0;
var observer = new BrowserMutationObserver(flush);
var node = document.createTextNode('');
observer.observe(node, { characterData: true });
return function() {
node.data = (iterations = ++iterations % 2);
};
}
// web worker
function useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = flush;
return function () {
channel.port2.postMessage(0);
};
}
function useSetTimeout() {
return function() {
setTimeout(flush, 1);
};
}
var queue = new Array(1000);
function flush() {
for (var i = 0; i < len; i+=2) {
var callback = queue[i];
var arg = queue[i+1];
callback(arg);
queue[i] = undefined;
queue[i+1] = undefined;
}
len = 0;
}
function attemptVertex() {
try {
var r = require;
var vertx = r('vertx');
vertxNext = vertx.runOnLoop || vertx.runOnContext;
return useVertxTimer();
} catch(e) {
return useSetTimeout();
}
}
var scheduleFlush;
// Decide what async method to use to triggering processing of queued callbacks:
if (isNode) {
scheduleFlush = useNextTick();
} else if (BrowserMutationObserver) {
scheduleFlush = useMutationObserver();
} else if (isWorker) {
scheduleFlush = useMessageChannel();
} else if (browserWindow === undefined && typeof require === 'function') {
scheduleFlush = attemptVertex();
} else {
scheduleFlush = useSetTimeout();
}
| JavaScript | 0 | @@ -192,17 +192,17 @@
len is
-1
+2
, that m
|
e3fb7312ece77d4e6b18f36189b82ce6c205107a | Remove unused code | modern/src/maki-interpreter/virtualMachine.js | modern/src/maki-interpreter/virtualMachine.js | import parse from "./parser";
import { getClass, getFormattedId } from "./objects";
import { interpret } from "./interpreter";
import { isPromise } from "../utils";
// Note: if this incurs a performance overhead, we could pass a flag into the VM
// to not yield in production. In that case, we would never even enter the
// `while` loop.
async function runGeneratorUntilReturn(gen) {
let val = gen.next();
while (!val.done) {
val = gen.next();
if (isPromise(val.value)) {
gen.next(await val.value);
}
}
return val.value;
}
export function run({
runtime,
data,
system,
log,
debugHandler = runGeneratorUntilReturn,
}) {
const program = parse(data);
// Replace class hashes with actual JavaScript classes from the runtime
program.classes = program.classes.map(hash => {
const resolved = runtime[hash];
if (resolved == null && log) {
const klass = getClass(hash);
console.warn(
`Class missing from runtime: ${hash}`,
klass == null
? `(formatted ID: ${getFormattedId(hash)})`
: `expected ${klass.name}`
);
}
return resolved;
});
// Bind top level hooks.
program.bindings.forEach(binding => {
const { commandOffset, variableOffset, methodOffset } = binding;
const variable = program.variables[variableOffset];
const method = program.methods[methodOffset];
// const logger = log ? printCommand : logger;
// TODO: Handle disposing of this.
// TODO: Handle passing in variables.
variable.hook(method.name, (...args) => {
// Interpret is a generator that yields before each command is exectued.
// `handler` is reponsible for `.next()`ing until the program execution is
// complete (the generator is "done"). In production this is done
// synchronously. In the debugger, if execution is paused, it's done
// async.
debugHandler(interpret(commandOffset, program, args.reverse()));
});
});
const { commands /* variables */ } = program;
commands.forEach((/* command, i*/) => {
// printCommand({ i, command, stack: [], variables });
});
// Set the System global
// TODO: We could confirm that this variable has the "system" flag set.
program.variables[0].setValue(system);
system.js_start();
}
| JavaScript | 0.000006 | @@ -1968,164 +1968,8 @@
);%0A%0A
- const %7B commands /* variables */ %7D = program;%0A commands.forEach((/* command, i*/) =%3E %7B%0A // printCommand(%7B i, command, stack: %5B%5D, variables %7D);%0A %7D);%0A%0A
//
|
37cc9993a8ab823a2106746214a92b6f2c839a35 | Fix invalid bitmask for release archives | gulpfile.js | gulpfile.js | var eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip'),
rename = require('gulp-rename');
gulp.task('prepare-release', function() {
var version = require('./package.json').version;
return eventStream.merge(
getSources()
.pipe(zip('external-api-plugin-' + version + '.zip')),
getSources()
.pipe(tar('external-api-plugin-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
});
// Builds and packs plugins sources
gulp.task('default', ['prepare-release'], function() {
// The "default" task is just an alias for "prepare-release" task.
});
/**
* Returns files stream with the plugin sources.
*
* @returns {Object} Stream with VinylFS files.
*/
var getSources = function() {
return gulp.src([
'Controller/*',
'LICENSE',
'Plugin.php',
'README.md',
'routing.yml'
],
{base: './'}
)
.pipe(rename(function(path) {
path.dirname = 'Mibew/Mibew/Plugin/ExternalApi/' + path.dirname;
}));
}
| JavaScript | 0 | @@ -585,9 +585,8 @@
mod(
-0
644)
|
63c12adb276fd60be9b404db6461293ba67c0f65 | Fix typo, removing semicolon from jsx inline style prop #411 | client/components/navigation/sidenav/sidenav.js | client/components/navigation/sidenav/sidenav.js | import React, { Component, PropTypes } from 'react'
import { Link } from 'react-router'
// Global module dependencies
import * as paths from '~client/paths'
import * as communityPaths from '~community/paths'
// Current module dependencies
if (process.env.BROWSER) require('./sidenav.scss')
class Sidenav extends Component {
render () {
const { children, community } = this.props
return (
<nav className='sidenav clearfix'>
<div className='items items-logo'>
<div className='item'>
<div className='item-icon'>
<Link to={paths.mobilizations()} style={{ height: '43px', display: 'block' }}>
<u
className='logo-icon nossas'
style={{ backgroundImage: community.image ? `url(${community.image});` : undefined }}
/>
</Link>
</div>
<div className='item-content'>
<div className='table-cell align-middle'>
<div>
<div className='item-community-name'>
<Link to={paths.mobilizations()}>{community.name || 'Bonde'}</Link>
</div>
<div className='item-community-change'>
<Link to={communityPaths.edit('info')} className='col col-8'>
<i className='fa fa-cog mr1' />
<span>Configurações</span>
</Link>
<Link to={communityPaths.list()} className='col col-4'>
<i className='fa fa-refresh mr1' />
<span>Trocar</span>
</Link>
</div>
</div>
</div>
</div>
</div>
</div>
{children}
</nav>
)
}
}
Sidenav.contextTypes = {
router: PropTypes.object
}
export default Sidenav
| JavaScript | 0.000037 | @@ -802,9 +802,8 @@
ge%7D)
-;
%60 :
|
81ea03eb0bcbb9687d3f689c1895b6202d737c6d | Disable the "read and upload" step (not working yet) | fixtures/1_step_type.js | fixtures/1_step_type.js | module.exports = {
model: 'step_type',
data: [
{
id: 1,
name: 'Announcement Message',
description: 'No response from the user to move the next step'
},
{
id: 2,
name: 'Question Step',
description: 'Owner must enter a question and the confirmation word that the user must enter to move on in the Flow'
},
{
id: 3,
name: 'Multiple Choice Step',
description: 'Owner specifies a list of possible options, end user replies with 1,2,3 or 4 etc'
},
{
id: 4,
name: 'Upload Document Step',
description: 'Owner specifies some instructions and the end user must upload a document to complete the step'
},
{
id: 5,
name: 'Read Document Step',
description: 'Owner must upload a document and the end user must read it'
},
{
id: 6,
name: 'Read & Upload Document Step',
description: 'Owner upload a document and the end user must read it and upload a new one to complete the step'
},
{
id: 7,
name: 'People to meet',
description: 'A Spark room would be created between the person being onboarded and the people specified'
},
]
}; | JavaScript | 0 | @@ -834,33 +834,39 @@
'%0A %7D,%0A
+ //
%7B%0A
+//
+
id: 6,%0A
@@ -859,24 +859,27 @@
id: 6,%0A
+ //
name: 'Re
@@ -901,32 +901,35 @@
ument Step',%0A
+ //
description:
@@ -1021,32 +1021,35 @@
te the step'%0A
+ //
%7D,%0A %7B%0A
|
d21a823ced1a50396c1bcbd3813d6ea74b2de872 | Create mysql table with utf8mb4 charset | mysql_db.js | mysql_db.js | /**
* 2011 Peter 'Pita' Martischka
*
* 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.
*/
var mysql = require("mysql");
var async = require("async");
exports.database = function(settings)
{
this.db = require('mysql').createConnection(settings);
this.settings = settings;
if(this.settings.host != null)
this.db.host = this.settings.host;
if(this.settings.port != null)
this.db.port = this.settings.port;
if(this.settings.user != null)
this.db.user = this.settings.user;
if(this.settings.password != null)
this.db.password = this.settings.password;
if(this.settings.database != null)
this.db.database = this.settings.database;
this.settings.cache = 1000;
this.settings.writeInterval = 100;
this.settings.json = true;
}
exports.database.prototype.clearPing = function(){
if (this.interval) {
clearInterval(this.interval);
}
}
exports.database.prototype.schedulePing = function(){
this.clearPing();
var self = this;
this.interval = setInterval(function(){
self.db.query('SELECT 1');
}, 10000);
}
exports.database.prototype.init = function(callback)
{
var sqlCreate = "CREATE TABLE IF NOT EXISTS `store` ( " +
"`key` VARCHAR( 100 ) NOT NULL COLLATE utf8_general_ci, " +
"`value` LONGTEXT NOT NULL , " +
"PRIMARY KEY ( `key` ) " +
") ENGINE = MyISAM;";
var sqlAlter = "ALTER TABLE store MODIFY `key` VARCHAR(100) COLLATE utf8_general_ci;";
var db = this.db;
var self = this;
db.query(sqlCreate,[],function(err){
//call the main callback
callback(err);
//check migration level, alter if not migrated
self.get("MYSQL_MIGRATION_LEVEL", function(err, level){
if(err){
throw err;
}
if(level !== "1"){
db.query(sqlAlter,[],function(err)
{
if(err){
throw err;
}
self.set("MYSQL_MIGRATION_LEVEL","1", function(err){
if(err){
throw err;
}
});
});
}
})
});
this.schedulePing();
}
exports.database.prototype.get = function (key, callback)
{
this.db.query("SELECT `value` FROM `store` WHERE `key` = ?", [key], function(err,results)
{
var value = null;
if(!err && results.length == 1)
{
value = results[0].value;
}
callback(err,value);
});
this.schedulePing();
}
exports.database.prototype.findKeys = function (key, notKey, callback)
{
var query="SELECT `key` FROM `store` WHERE `key` LIKE ?"
, params=[]
;
//desired keys are key, e.g. pad:%
key=key.replace(/\*/g,'%');
params.push(key);
if(notKey!=null && notKey != undefined){
//not desired keys are notKey, e.g. %:%:%
notKey=notKey.replace(/\*/g,'%');
query+=" AND `key` NOT LIKE ?"
params.push(notKey);
}
this.db.query(query, params, function(err,results)
{
var value = [];
if(!err && results.length > 0)
{
results.forEach(function(val){
value.push(val.key);
});
}
callback(err,value);
});
this.schedulePing();
}
exports.database.prototype.set = function (key, value, callback)
{
if(key.length > 100)
{
callback("Your Key can only be 100 chars");
}
else
{
this.db.query("REPLACE INTO `store` VALUES (?,?)", [key, value], function(err, info){
callback(err);
});
}
this.schedulePing();
}
exports.database.prototype.remove = function (key, callback)
{
this.db.query("DELETE FROM `store` WHERE `key` = ?", [key], callback);
this.schedulePing();
}
exports.database.prototype.doBulk = function (bulk, callback)
{
var _this = this;
var replaceSQL = "REPLACE INTO `store` VALUES ";
var removeSQL = "DELETE FROM `store` WHERE `key` IN ("
var firstReplace = true;
var firstRemove = true;
for(var i in bulk)
{
if(bulk[i].type == "set")
{
if(!firstReplace)
replaceSQL+=",";
firstReplace = false;
replaceSQL+="(" + _this.db.escape(bulk[i].key) + ", " + _this.db.escape(bulk[i].value) + ")";
}
else if(bulk[i].type == "remove")
{
if(!firstRemove)
removeSQL+=",";
firstRemove = false;
removeSQL+=_this.db.escape(bulk[i].key);
}
}
replaceSQL+=";";
removeSQL+=");";
async.parallel([
function(callback)
{
if(!firstReplace)
_this.db.query(replaceSQL, callback);
else
callback();
},
function(callback)
{
if(!firstRemove)
_this.db.query(removeSQL, callback);
else
callback();
}
], callback);
this.schedulePing();
}
exports.database.prototype.close = function(callback)
{
this.clearPing();
this.db.end(callback);
}
| JavaScript | 0.000031 | @@ -1767,25 +1767,20 @@
utf8
-_general_ci
+mb4_bin
, %22 +
-
%0A
@@ -1812,16 +1812,36 @@
ONGTEXT
+COLLATE utf8mb4_bin
NOT NULL
@@ -1846,17 +1846,16 @@
LL , %22 +
-
%0A
@@ -1879,17 +1879,16 @@
RY KEY (
-
%60key%60 )
@@ -1923,40 +1923,55 @@
GINE
- =
+=
MyISAM
-;%22; %0A
+ CHARSET=utf8mb4 COLLATE=utf8mb4_bin;%22;%0A
%0A v
@@ -2046,19 +2046,15 @@
utf8
-_general_ci
+mb4_bin
;%22;%0A
|
bc0188c0983a9c9a06418f3ef7b4ccd5302e03a2 | Add compile step to tests before execution | gulpfile.js | gulpfile.js | 'use strict';
var gulp = require('gulp'),
browserify = require('browserify'),
transform = require('vinyl-transform'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
jasmine = require('gulp-jasmine');
gulp.task('default', ['javascript']);
gulp.task('javascript', function () {
var browserified = transform(function (filename) {
var b = browserify({ entries: filename, debug: true });
return b.bundle();
});
return gulp.src('./src/js/bowler.js')
.pipe(browserified)
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(uglify())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist/js'));
});
gulp.task('test', function () {
return gulp.src('./spec/**/*.js')
.pipe(jasmine());
});
| JavaScript | 0.000001 | @@ -729,24 +729,179 @@
nction () %7B%0A
+ var browserified = transform(function (filename) %7B%0A var b = browserify(%7B entries: filename, debug: true %7D);%0A return b.bundle();%0A %7D);%0A%0A
return g
@@ -922,24 +922,52 @@
c/**/*.js')%0A
+ .pipe(browserified)%0A
.pip
|
a5c3a4e62ae1771551c1b656dca963b324206dea | Fix small formatting inconsistencies. | js/main.js | js/main.js | function doAPIRequest() {
if (document.getElementById('actionField').value != "") {
$('#responseField').val("");
$("#responseField").addClass('hidden');
$("#responseFieldLabel").addClass('hidden');
$('#responseField').val("");
$('#statusField').val("");
var host = $('#hostField').val().trim();
var port = $('#portField').val().trim();
var scheme = $('#schemeField').is(':checked') ? 'https' : 'http';
var req = $('#actionField').val().trim();
var method = $('#GETField').is(':checked') ? "GET" :
$('#POSTField').is(':checked') ? "POST" :
$('#PUTField').is(':checked') ? "PUT" : "DELETE";
var data = $('#dataField').val();
var anon = $('#anonymousField').is(':checked');
var appId = $('#appIDField').val().trim();
var appKey = $('#appKeyField').val().trim();
var userKey = $('#userKeyField').val().trim();
var userId = $('#userIDField').val().trim();
var contentType = $('#contentType').val().trim();
var uploadFile = document.getElementById('fileInput').files[0];
var data = {
host: host,
port: port,
scheme: scheme,
anon: anon,
apiRequest: req,
apiMethod: method,
contentType: contentType,
data: data,
appId: appId,
appKey: appKey,
userId: userId,
userKey: userKey
};
if (uploadFile) {
var ajaxData = new FormData();
var fileName = document.getElementById('paramField').value;
ajaxData.append("fileInput", uploadFile );
ajaxData.append("fileName", fileName );
for(index in data) {
ajaxData.append(index, data[index] );
}
sendRequest(ajaxData, true);
}else{
sendRequest(data, false);
}
}
}
function sendRequest(postData, hasFile) {
if (hasFile){
$.ajaxSetup({
cache: false,
processData: false,
contentType: false,
});
}
$.ajax({
type: 'post',
url: "doRequest.php",
data: postData,
success: function(data) {
var output = {};
if(data == '') {
output.response = 'Success!';
} else {
try {
output = jQuery.parseJSON(data);
} catch(e) {
output = "Unexpected non-JSON response from the server: " + data;
}
}
$('#statusField').val(output.statusCode);
$('#responseField').val(output.response);
$("#responseField").removeClass('hidden');
$("#responseFieldLabel").removeClass('hidden');
},
error: function(jqXHR, textStatus, errorThrown) {
$('#errorField1').removeClass('hidden');
$("#errorField2").innerHTML = jqXHR.responseText;
}
});
}
function exampleGetVersions() {
hideData();
document.getElementById("GETField").checked = true;
document.getElementById("actionField").value = "/d2l/api/versions/";
}
function exampleWhoAmI() {
hideData();
document.getElementById("GETField").checked = true;
document.getElementById("actionField").value = "/d2l/api/lp/1.0/users/whoami";
}
function exampleCreateUser() {
showData();
document.getElementById("POSTField").checked = true;
document.getElementById("actionField").value = "/d2l/api/lp/1.0/users/";
document.getElementById("dataField").value = "{\n \"OrgDefinedId\": \"<string>\",\n \"FirstName\": \"<string>\",\n \"MiddleName\": \"<string>\",\n \"LastName\": \"<string>\",\n \"ExternalEmail\": \"<string>|null\",\n \"UserName\": \"<string>\",\n \"RoleId\": \"<number>\",\n \"IsActive\": \"<boolean>\",\n \"SendCreationEmail\": \"<boolean>\"\n}";
}
function setCredentials() {
$('#authButtons').addClass('hidden');
$("#manualAuthBtn").removeClass('hidden');
$("#deauthBtn").addClass('hidden');
$("#userFields").removeClass('hidden');
$("#manualBtn").addClass('hidden');
$("#userDiv").addClass('hidden');
$("#authNotice").addClass('hidden');
}
function showData() {
$('.post-forms').removeClass('hidden');
}
function hideData() {
$('.post-forms').addClass('hidden');
}
function authenticateFields() {
$("#manualAuthBtn").addClass('hidden');
$("#userDiv").addClass('hidden');
$('#deauthBtn').removeClass('hidden');
$('.auth-field').prop('disabled', true);
}
function resetFormElem (e) {
e.wrap('<form>').closest('form').get(0).reset();
e.unwrap();
}
function deAuthenticate() {
window.location.replace("index.php");
}
if (!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, '');
};
}
$(document).ready(function() {
loadProfileList();
$('#userProfiles').change(function(){
loadProfile(this.value);
localStorage.setItem('lastProfile', this.value);
});
$('#rmProfile').on('click', function(){
var profileName = $('#userProfiles').val();
removeProfile(profileName);
});
$("#authenticateBtn").on('click', function(){
var lastprofile = localStorage.getItem('lastProfile');
if ((lastprofile == 'New Profile') || lastprofile == 'authProfile') {
setProfile('authProfile');
}else{
removeProfile('authProfile');
}
});
if ((document.getElementById("appIDField").value == '' ) && (document.getElementById("appKeyField").value == '')) {
if (localStorage.getItem('lastProfile') == 'authProfile') {
loadProfile('authProfile');
}else{
loadDefaults();
}
}
if(document.getElementById("userIDField").value != "") {
authenticateFields();
} else {
$("#userFields").addClass('hidden');
document.getElementById("hostField").disabled = false;
document.getElementById("portField").disabled = false;
document.getElementById("appKeyField").disabled = false;
}
}); | JavaScript | 0.000063 | @@ -1731,23 +1731,29 @@
rue);%0A
-%7D
+ %7D
else
+
%7B%0A
+
send
@@ -1776,18 +1776,23 @@
lse);%0A
-%7D%0A
+ %7D %0A
%7D%0A%7D%0A%0Afun
@@ -5479,36 +5479,38 @@
Profile');%0A %7D
+
else
+
%7B%0A loadDefa
|
29a0fc1cf579b813cf1ed0e9f510daeb6a49b064 | exclude the e2e test that fails on safari | src/ng/filter/limitTo.js | src/ng/filter/limitTo.js | 'use strict';
*
* @ngdoc filter
* @name limitTo
* @kind function
*
* @description
* Creates a new array or string containing only a specified number of elements. The elements
* are taken from either the beginning or the end of the source array, string or number, as specified by
* the value and sign (positive or negative) of `limit`. If a number is used as input, it is
* converted to a string.
*
* @param {Array|string|number} input Source array, string or number to be limited.
* @param {string|number} limit The length of the returned array or string. If the `limit` number
* is positive, `limit` number of items from the beginning of the source array/string are copied.
* If the number is negative, `limit` number of items from the end of the source array/string
* are copied. The `limit` will be trimmed if it exceeds `array.length`
* @returns {Array|string} A new sub-array or substring of length `limit` or less if input array
* had less than `limit` elements.
*
* @example
<example module="limitToExample">
<file name="index.html">
<script>
angular.module('limitToExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.numbers = [1,2,3,4,5,6,7,8,9];
$scope.letters = "abcdefghi";
$scope.longNumber = 2345432342;
$scope.numLimit = 3;
$scope.letterLimit = 3;
$scope.longNumberLimit = 3;
}]);
</script>
<div ng-controller="ExampleController">
Limit {{numbers}} to: <input type="number" step="1" ng-model="numLimit">
<p>Output numbers: {{ numbers | limitTo:numLimit }}</p>
Limit {{letters}} to: <input type="number" step="1" ng-model="letterLimit">
<p>Output letters: {{ letters | limitTo:letterLimit }}</p>
Limit {{longNumber}} to: <input type="integer" ng-model="longNumberLimit">
<p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p>
</div>
</file>
<file name="protractor.js" type="protractor">
var numLimitInput = element(by.model('numLimit'));
var letterLimitInput = element(by.model('letterLimit'));
var longNumberLimitInput = element(by.model('longNumberLimit'));
var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));
var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));
var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));
it('should limit the number array to first three items', function() {
expect(numLimitInput.getAttribute('value')).toBe('3');
expect(letterLimitInput.getAttribute('value')).toBe('3');
expect(longNumberLimitInput.getAttribute('value')).toBe('3');
expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');
expect(limitedLetters.getText()).toEqual('Output letters: abc');
expect(limitedLongNumber.getText()).toEqual('Output long number: 234');
});
// There is a bug in safari and protractor that doesn't like the minus key
// it('should update the output when -3 is entered', function() {
// numLimitInput.clear();
// numLimitInput.sendKeys('-3');
// letterLimitInput.clear();
// letterLimitInput.sendKeys('-3');
// longNumberLimitInput.clear();
// longNumberLimitInput.sendKeys('-3');
// expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');
// expect(limitedLetters.getText()).toEqual('Output letters: ghi');
// expect(limitedLongNumber.getText()).toEqual('Output long number: 342');
// });
it('should not exceed the maximum size of input array', function() {
numLimitInput.clear();
numLimitInput.sendKeys('100');
letterLimitInput.clear();
letterLimitInput.sendKeys('100');
longNumberLimitInput.clear();
longNumberLimitInput.sendKeys('100');
expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');
expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');
expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');
});
</file>
</example>
function limitToFilter(){
return function(input, limit) {
if (isNumber(input)) input = input.toString();
if (!isArray(input) && !isString(input)) return input;
if (Math.abs(Number(limit)) === Infinity) {
limit = Number(limit);
} else {
limit = int(limit);
}
if (isString(input)) {
//NaN check on limit
if (limit) {
return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length);
} else {
return "";
}
}
var out = [],
i, n;
// if abs(limit) exceeds maximum length, trim it
if (limit > input.length)
limit = input.length;
else if (limit < -input.length)
limit = -input.length;
if (limit > 0) {
i = 0;
n = limit;
} else {
i = input.length + limit;
n = input.length;
}
for (; i<n; i++) {
out.push(input[i]);
}
return out;
};
}
| JavaScript | 0 | @@ -8,16 +8,17 @@
rict';%0A%0A
+/
*%0A * @ng
@@ -4331,16 +4331,18 @@
xample%3E%0A
+*/
%0Afunctio
|
ab123f6755be3acd75c408629abeb0047d363234 | Add position of center of ball and proper screen width/height | js/main.js | js/main.js | $(document).ready(function() {
window.Balls.initialize();
});
window.Balls = (function() {
var Balls = {
ballArray: [],
speed: 1,
initialize: function() {
// get width/height
this.screen = {
height: window.screen.availHeight,
width: window.screen.availWidth
};
this.rootEle = document.getElementById('view');
this.add(new Ball(10, 10));
},
add: function(ball) {
this.ballArray.push(ball);
ball.moveTo(this.screen.width/2, this.screen.height/2);
this.rootEle.appendChild(ball.getEle());
}
};
window.addEventListener('deviceorientation', function(event) {
Balls.ballArray.forEach(function(ball) {
ball.moveBy(event.gamma*Balls.speed, event.beta*Balls.speed);
});
}, false);
var Ball = function(radius) {
this.ele = document.createElement('div');
this.ele.setAttribute('style', 'position:absolute;width:'+(radius*2)+'px;height:'+(radius*2)+'px;background:red; border-radius:'+radius+'px');
};
Ball.prototype = {
moveBy: function(x, y) {
this.ele.style.top = (parseInt(this.ele.style.top) + y) + 'px';
this.ele.style.left = (parseInt(this.ele.style.left) + x) + 'px';
},
moveTo: function(x, y) {
this.ele.style.top = y + 'px';
this.ele.style.left = x + 'px';
},
getEle: function() {
return this.ele;
}
};
Balls.Ball = Ball;
return Balls;
})(); | JavaScript | 0.000001 | @@ -239,28 +239,21 @@
window.
-screen.avail
+inner
Height,%0A
@@ -278,20 +278,13 @@
dow.
-screen.avail
+inner
Widt
@@ -806,16 +806,93 @@
dius) %7B%0A
+ this.radius = radius;%0A this.position = %7B%0A x: 0,%0A y: 0%0A %7D;
%0A thi
@@ -1148,174 +1148,471 @@
his.
-ele.style.top = (parseInt(this.ele.style.top) + y) + 'px';%0A this.ele.style.left = (parseInt(this.ele.style.left) + x) + 'px'
+moveTo(this.position.x + x, this.position.y + y);%0A %7D,%0A moveTo: function(x, y) %7B%0A var nextX = x, nextY = y;%0A if(y %3E Balls.screen.height - this.radius) %7B%0A nextY = Balls.screen.height - this.radius;%0A %7D else if (y %3C this.radius) %7B%0A nextY = this.radius
;%0A
+
-%7D,%0A moveTo: function(x, y) %7B
+ %7D%0A if(x %3E Balls.screen.width - this.radius) %7B%0A nextX = Balls.screen.width - this.radius;%0A %7D else if (x %3C this.radius) %7B%0A nextX = this.radius;%0A %7D
%0A
@@ -1635,17 +1635,35 @@
e.top =
-y
+(nextY-this.radius)
+ 'px';
@@ -1695,17 +1695,98 @@
t =
-x + 'px';
+(nextX-this.radius) + 'px';%0A this.position.x = nextX;%0A this.position.y = nextY;%0A
%0A
|
d282075c4bce2a76c364db8a8e9e6b639f8c4e49 | add new production gulp file | gulpfile.js | gulpfile.js | var gulp = require('gulp');
var $ = require('gulp-load-plugins')()
var commonFiles = [
'app/shared/vendor/async.js',
'app/shared/vendor/jquery.min.js',
'app/shared/vendor/angular.min.js',
'app/shared/vendor/moment.min.js',
'app/shared/vendor/*.js',
'app/modules.js',
'app/shared/**/*.js',
];
gulp.task('js', function () {
gulp.src(commonFiles.concat([
'!app/shared/**/*Spec.js',
'app/pages/**/*.js',
'!app/pages/guest/*.js',
'!app/pages/**/*Spec.js'
]))
.pipe($.sourcemaps.init())
.pipe($.concat('cluster.js'))
// .pipe($.ngAnnotate())
// .pipe($.uglify())
.pipe($.sourcemaps.write())
.pipe(gulp.dest('app/assets/js'))
})
gulp.task('guestjs', function () {
gulp.src(commonFiles.concat([
'!app/shared/routes/*.js',
'!app/shared/**/*Spec.js',
'app/pages/**/*.js',
'!app/pages/logout/*.js',
'!app/pages/create/*.js',
'!app/pages/**/*Spec.js'
]))
.pipe($.sourcemaps.init())
.pipe($.concat('guest.js'))
// .pipe($.ngAnnotate())
// .pipe($.uglify())
.pipe($.sourcemaps.write())
.pipe(gulp.dest('app/assets/js'))
})
gulp.task('sass', function () {
gulp.src('app/assets/sass/cluster.sass')
.pipe($.rubySass({style: 'compressed', loadPath: process.cwd() + '/app/assets/sass'}))
.pipe(gulp.dest('app/assets/css'));
});
gulp.task('dev', ['js', 'guestjs', 'sass'], function () {
gulp.watch(['app/pages/**/*.js', 'app/shared/**/*.js'], ['js', 'guestjs'])
gulp.watch('app/assets/sass/**/*.sass', ['sass'])
})
gulp.task('build', ['js'])
gulp.task('heroku', ['js', 'guestjs', 'sass'])
| JavaScript | 0 | @@ -661,24 +661,354 @@
s/js'))%0A%7D)%0A%0A
+gulp.task('jspro', function () %7B%0A gulp.src(commonFiles.concat(%5B%0A '!app/shared/**/*Spec.js',%0A 'app/pages/**/*.js',%0A '!app/pages/guest/*.js',%0A '!app/pages/**/*Spec.js'%0A %5D))%0A .pipe($.sourcemaps.init())%0A .pipe($.concat('cluster.js'))%0A .pipe($.ngAnnotate())%0A .pipe($.uglify())%0A .pipe(gulp.dest('app/assets/js'))%0A%7D)%0A%0A
%0Agulp.task('
@@ -1422,16 +1422,412 @@
/js'))%0A%0A
+%7D)%0Agulp.task('guestjspro', function () %7B%0A%0A gulp.src(commonFiles.concat(%5B%0A '!app/shared/routes/*.js',%0A '!app/shared/**/*Spec.js',%0A 'app/pages/**/*.js',%0A '!app/pages/logout/*.js',%0A '!app/pages/create/*.js',%0A '!app/pages/**/*Spec.js'%0A %5D))%0A .pipe($.sourcemaps.init())%0A .pipe($.concat('guest.js'))%0A .pipe($.ngAnnotate())%0A .pipe($.uglify())%0A .pipe(gulp.dest('app/assets/js'))%0A%0A
%7D)%0A%0A%0A%0Agu
@@ -2271,24 +2271,27 @@
eroku', %5B'js
+pro
', 'guestjs'
@@ -2281,28 +2281,31 @@
jspro', 'guestjs
+pro
', 'sass'%5D)%0A
|
a2bb11f1a1cff9eb8bfba6d329a9673104c0b6a9 | Update main.js | js/main.js | js/main.js | $(document).ready(function(event){
$('#submit').click(function(event){
getData();
});
$('#formThing').submit(function(event){
event.preventDefault();
getData();
});
});
function getData(){
$.get('https://api.github.com/users/' + $('#inputText').val(), "", function(data){
var Avatar = data['avatar_url'];
var Username = data['login'];
var url = data['html_url'];
var lastPlayed = "None";
var joined = data['created_at'];
var html = '<center><img src="' + Avatar + '"width="100px" height="100px" style="border:3px solid #fff">';
html += '<br>Name: ' + Username + '</br>';
html += '<br>Joined Github: ' + joined + '</br>';
// Center
html += '<br><b>Url Link: </b>' + url;
$('.profile').html(html);
});;
}
| JavaScript | 0.000001 | @@ -829,16 +829,176 @@
(html);%0A
+ %7D).fail(function(data)%7B%0A html = '%3Ch1%3EA Github user with that name does not exist.';%0A $('.profile').html(html);%0A return;%0A
%7D)
|
f14cae4dfa83329ff1e9843c954e6beb1cf54eb9 | Use custom error message if email is invalid | app/database/model/user.js | app/database/model/user.js | const Sequelize = require('sequelize')
const bcrypt = require('bcrypt')
module.exports = {
model: {
name: Sequelize.STRING,
email: {
type: Sequelize.STRING,
allowNull: false,
unique: {
msg: 'username taken'
},
validate: {
isEmail: true
}
},
password: Sequelize.STRING,
photo: Sequelize.STRING,
verifiedEmail: Sequelize.BOOLEAN,
emailToken: Sequelize.STRING,
emailTokenExpires: Sequelize.DATE,
permission: {
type: Sequelize.STRING,
defaultValue: 'admin'
}
},
options: {
freezeTableName: true,
setterMethods: {
password: function(value) {
const salt = bcrypt.genSaltSync()
const hash = bcrypt.hashSync(value, salt)
this.setDataValue('password', hash)
}
},
instanceMethods: {
validPassword: function(password) {
return bcrypt.compareSync(password, this.password)
}
}
},
relations: [
['belongsToMany', 'hub', {
through: 'userHub'
}]
]
}
| JavaScript | 0.000249 | @@ -253,20 +253,73 @@
sEmail:
-true
+%7B%0A%09%09%09%09%09msg: 'username is not a valid email address'%0A%09%09%09%09%7D
%0A%09%09%09%7D%0A%09%09
|
62b8179730b468f73570cbe42b743e91d99e49b8 | Update answer_with_instance.js | samples/bank_mfa_device/answer_with_instance.js | samples/bank_mfa_device/answer_with_instance.js | See bank_mfa_device's Methods. | JavaScript | 0.000011 | @@ -5,26 +5,11 @@
bank
-_mfa_device's Methods.
+s#link%0A
|
3d389cf5dc1c25a9e0fe6f7e993deb3bc860f108 | add _resyncView method | layer/tile/Yandex.js | layer/tile/Yandex.js | // https://tech.yandex.com/maps/doc/jsapi/2.1/quick-start/index-docpage/
/* global ymaps: true */
L.Yandex = L.Layer.extend({
options: {
type: 'yandex#map', // 'map', 'satellite', 'hybrid', 'map~vector' | 'overlay', 'skeleton'
mapOptions: { // https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/Map-docpage/#Map__param-options
// yandexMapDisablePoiInteractivity: true,
balloonAutoPan: false,
suppressMapOpenBlock: true
},
overlayOpacity: 0.8,
minZoom: 0,
maxZoom: 19
},
initialize: function (type, options) {
if (typeof type === 'object') {
options = type;
type = false;
}
options = L.Util.setOptions(this, options);
if (type) { options.type = type; }
this._isOverlay = options.type.indexOf('overlay') !== -1 ||
options.type.indexOf('skeleton') !== -1;
},
_setStyle: function (el, style) {
for (var prop in style) {
el.style[prop] = style[prop];
}
},
_initContainer: function (parentEl) {
var zIndexClass = this._isOverlay ? 'leaflet-overlay-pane' : 'leaflet-tile-pane';
var _container = L.DomUtil.create('div', 'leaflet-yandex-container leaflet-pane ' + zIndexClass);
var opacity = this.options.opacity || this._isOverlay && this.options.overlayOpacity;
if (opacity) {
L.DomUtil.setOpacity(_container, opacity);
}
var auto = { width: '100%', height: '100%' };
this._setStyle(parentEl, auto); // need to set this explicitly,
this._setStyle(_container, auto); // otherwise ymaps fails to follow container size changes
return _container;
},
onAdd: function (map) {
var mapPane = map.getPane('mapPane');
if (!this._container) {
this._container = this._initContainer(mapPane);
map.once('unload', this._destroy, this);
ymaps.ready(this._initMapObject, this);
}
mapPane.appendChild(this._container);
if (!this._yandex) { return; }
this._update();
},
beforeAdd: function (map) {
map._addZoomLimit(this);
},
onRemove: function (map) {
// do not remove container until api is initialized (ymaps API expects DOM element)
if (this._yandex) {
this._container.remove();
}
map._removeZoomLimit(this);
},
_destroy: function (e) {
if (!this._map || this._map === e.target) {
if (this._yandex) {
this._yandex.destroy();
delete this._yandex;
}
delete this._container;
}
},
getEvents: function () {
var events = {
move: this._update
};
if (this._zoomAnimated) {
events.zoomanim = this._animateZoom;
}
return events;
},
_update: function () {
if (!this._yandex) { return; }
var map = this._map;
var center = map.getCenter();
this._yandex.setCenter([center.lat, center.lng], map.getZoom());
var offset = L.point(0,0).subtract(L.DomUtil.getPosition(map.getPane('mapPane')));
L.DomUtil.setPosition(this._container, offset); // move to visible part of pane
},
_animateZoom: function (e) {
if (!this._yandex) { return; }
var map = this._map;
var viewHalf = map.getSize()._divideBy(2);
var topLeft = map.project(e.center, e.zoom)._subtract(viewHalf)._round();
var offset = map.project(map.getBounds().getNorthWest(), e.zoom)._subtract(topLeft);
var scale = map.getZoomScale(e.zoom);
this._yandex.panes._array.forEach(function (el) {
if (el.pane instanceof ymaps.pane.MovablePane) {
var element = el.pane.getElement();
L.DomUtil.addClass(element, 'leaflet-zoom-animated');
L.DomUtil.setTransform(element, offset, scale);
}
});
},
_mapType: function () {
var shortType = this.options.type;
if (!shortType || shortType.indexOf('#') !== -1) {
return shortType;
}
return 'yandex#' + shortType;
},
_initMapObject: function () {
ymaps.mapType.storage.add('yandex#overlay', new ymaps.MapType('overlay', []));
ymaps.mapType.storage.add('yandex#skeleton', new ymaps.MapType('skeleton', ['yandex#skeleton']));
ymaps.mapType.storage.add('yandex#map~vector', new ymaps.MapType('map~vector', ['yandex#map~vector']));
var ymap = new ymaps.Map(this._container, {
center: [0, 0], zoom: 0, behaviors: [], controls: [],
type: this._mapType()
}, this.options.mapOptions);
if (this._isOverlay) {
ymap.container.getElement().style.background = 'transparent';
}
this._container.remove(); // see onRemove comments
this._yandex = ymap;
if (this._map) { this.onAdd(this._map); }
this.fire('load');
}
});
L.yandex = function (type, options) {
return new L.Yandex(type, options);
};
| JavaScript | 0 | @@ -2839,16 +2839,202 @@
ne%0A%09%7D,%0A%0A
+%09_resyncView: function () %7B // for use in addons%0A%09%09if (!this._map) %7B return; %7D%0A%09%09var ymap = this._yandex;%0A%09%09this._map.setView(ymap.getCenter(), ymap.getZoom(), %7B animate: false %7D);%0A%09%7D,%0A%0A
%09_animat
|
d723a395a64b1479f49a57111c6379bcdbf58f2f | Fix `update-available` message not showing up | src/client/story_box.js | src/client/story_box.js | import React from 'react'
import _ from 'lodash'
import Client from 'electron-rpc/client'
import StoryList from './story_list.js'
import Spinner from './spinner.js'
import Menu from './menu.js'
import StoryType from '../model/story_type'
export default class StoryBox extends React.Component {
constructor (props) {
super(props)
this.client = new Client()
this.state = {
stories: [],
selected: StoryType.TOP_TYPE,
status: '',
version: '',
upgradeVersion: ''
}
}
componentDidMount () {
var self = this
self.client.on('update-available', function (err, releaseVersion) {
if (err) {
console.error(err)
return
}
self.setState({ status: 'update-available', upgradeVersion: releaseVersion })
})
self.client.request('current-version', function (err, version) {
if (err) {
console.error(err)
return
}
self.setState({ version: version })
})
self.onNavbarClick(self.state.selected)
}
onQuitClick () {
this.client.request('terminate')
}
onUrlClick (url) {
this.client.request('open-url', { url: url })
}
onMarkAsRead (id) {
this.client.request('mark-as-read', { id: id }, function () {
var story = _.findWhere(this.state.stories, { id: id })
story.hasRead = true
this.setState({ stories: this.state.stories })
}.bind(this))
}
onNavbarClick (selected) {
var self = this
self.setState({ stories: [], selected: selected })
self.client.localEventEmitter.removeAllListeners()
var storycb = function (err, storiesMap) {
if (err) {
return
}
// console.log(JSON.stringify(Object.keys(storiesMap), null, 2))
var stories = storiesMap[self.state.selected]
if (!stories) {
return
}
// console.log(JSON.stringify(stories, null, 2))
self.setState({stories: stories})
}
self.client.request(selected, storycb)
self.client.on(selected, storycb)
}
render () {
var navNodes = _.map(StoryType.ALL, function (selection) {
var className = 'control-item'
if (this.state.selected === selection) {
className = className + ' active'
}
return (
<a key={selection} className={className} onClick={this.onNavbarClick.bind(this, selection)}>{selection}</a>
)
}, this)
var content = null
if (_.isEmpty(this.state.stories)) {
content = <Spinner />
} else {
content = <StoryList stories={this.state.stories} onUrlClick={this.onUrlClick.bind(this)} onMarkAsRead={this.onMarkAsRead.bind(this)} />
}
return (
<div className='story-menu'>
<header className='bar bar-nav'>
<div className='segmented-control'>
{navNodes}
</div>
</header>
{content}
<Menu onQuitClick={this.onQuitClick.bind(this)} status={this.state.status} version={this.state.version} upgradeVersion={this.state.upgradeVersion} />
</div>
)
}
}
| JavaScript | 0.000003 | @@ -558,240 +558,8 @@
is%0A%0A
- self.client.on('update-available', function (err, releaseVersion) %7B%0A if (err) %7B%0A console.error(err)%0A return%0A %7D%0A%0A self.setState(%7B status: 'update-available', upgradeVersion: releaseVersion %7D)%0A %7D)%0A%0A
@@ -1341,16 +1341,248 @@
ners()%0A%0A
+ self.client.on('update-available', function (err, releaseVersion) %7B%0A if (err) %7B%0A console.error(err)%0A return%0A %7D%0A%0A self.setState(%7B status: 'update-available', upgradeVersion: releaseVersion %7D)%0A %7D)%0A%0A
var
|
065cbcb1c668fc34eb7f8bf1c03ea2bbf5452324 | Update dispatcher.es6 | src/Plugins/Server/middleware/dispatcher.es6 | src/Plugins/Server/middleware/dispatcher.es6 | import path from 'path';
import {fileUtil, util, DispatherTypes} from '../../../helper';
export function apiHandler(dispatcher) {
if (dispatcher.handler) {
return dispatcher.handler(this).then((data) => {
let json = data;
if (typeof data === 'string') {
try {
json = util.JSONParse(data);
} catch (error) {
json = {
error: error.toString(),
data
};
}
}
return Promise.resolve({json});
});
}
const dataPath = dispatcher.dataPath;
if (Array.isArray(dataPath)) {
return Promise.all(dataPath.map(url => {
return util.jsonResolver({url})
})).then(resps => {
return resps.reduce((bef, aft) => {
return {
json: Object.assign(bef.json, aft.json)
};
});
});
}
return util.jsonResolver({url: dataPath});
}
/**
* default dispatcher
* @param {[type]} dispatcher [description]
* @param {[type]} config [description]
* @param {[type]} next [description]
* @return {[type]} [description]
*/
export function* dirDispatcher(dispatcher, {tplRender}, next) {
const sortFiles = (list) => {
return list.sort((a, b) => {
return a.name.charAt(0).localeCompare(b.name.charAt(0));
});
};
const viewPath = dispatcher.pagePath;
const files = yield fileUtil.getDirInfo(viewPath);
const promises = files.map((file) => fileUtil.getFileStat(path.resolve(viewPath, file)));
let result = (yield Promise.all(promises)).map((item, idx) => {
return Object.assign(item, {
name: files[idx],
isFile: item.isFile(),
requestPath: [this.request.path, files[idx], item.isFile() ? '' : '/'].join('')
});
});
const fileList = sortFiles(result.filter((item) => {
return item.isFile;
}));
const dirList = sortFiles(result.filter((item) => {
return !item.isFile;
}));
yield this.render('cataLog', {
title: '查看列表',
showList: dirList.concat(fileList)
});
yield next;
}
/**
* 同步请求响应
* @param dispatcher
* @param config
* @param next
* @returns {*}
*/
export function* syncDispatcher(dispatcher, {tplRender}, next) {
const filePath = dispatcher.pagePath;
let res = yield apiHandler.call(this, dispatcher);
if (!res || !res.json) {
this.type = 500;
yield this.render('e', {
title: '出错了', e: {
code: 500,
msg: '模拟数据处理'
}
});
return yield next;
}
try {
let result = yield tplRender.parse(filePath, res.json);
this.type = 'text/html; charset=utf-8';
this.body = result;
} catch (error) {
util.notify({
title: '模板解析失败',
msg: error
});
yield this.render('e', {
title: '出错了', e: {
code: 500,
msg: error
}
});
}
return yield next;
}
/**
* 异步请求响应
* @param dispatcher
* @param config
* @param next
* @returns {*}
*/
export function* asyncDispather(dispatcher, {tplRender}, next) {
/**
* 异步接口处理
* @type {[type]}
*/
let res = yield apiHandler.call(this, dispatcher);
if (res && res.json) {
this.type = 'application/json; charset=utf-8';
this.body = res.json;
return yield next;
}
yield this.render('e', {
title: '出错了', e: {
code: 500,
msg: '请求代理服务器异常'
}
});
yield next;
}
export default ({tplRender}) => {
return function*(next) {
if (!this.dispatcher) {
return void 0;
}
/**
* 分配给不同的处理器
* @type {Object}
*/
let args = [{tplRender}, next];
let dispatcherMap = {
[DispatherTypes.DIR]: dirDispatcher,
[DispatherTypes.SYNC]: syncDispatcher,
[DispatherTypes.ASYNC]: asyncDispather
};
let dispatcher = dispatcherMap[this.dispatcher.type];
if (dispatcher) {
yield dispatcher.call(this, this.dispatcher, ...args);
}
};
};
| JavaScript | 0 | @@ -3847,14 +3847,18 @@
urn
-void 0
+yield next
;%0A
@@ -4267,24 +4267,31 @@
+return
yield dispat
@@ -4339,22 +4339,51 @@
;%0A %7D%0A
+ %0A yield next;%0A
%7D;%0A%7D;%0A
|
6ae13696ae9f923d2f257d29a3d1fa55ff71e01a | Fix done button style | lib/KeyboardAccessoryNavigation.js | lib/KeyboardAccessoryNavigation.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
StyleSheet,
View,
Text,
TouchableOpacity,
Keyboard,
ViewPropTypes,
} from 'react-native';
import KeyboardAccessoryView from './KeyboardAccessoryView';
import Arrow from './components/Arrow';
// Render a prev/hidden arrow button
const AccessoryArrowButton = ({style, hidden = false, disabled = false, onPress, ...props}) => {
if (hidden) {
return null;
} else {
return (
<TouchableOpacity
disabled={disabled}
style={style}
onPress={onPress}
>
{props.customButton ? props.customButton : (
<Arrow
direction={props.direction}
disabled={disabled}
tintColor={props.tintColor}
/>
)}
</TouchableOpacity>
);
}
}
AccessoryArrowButton.propTypes = {
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
customButton: PropTypes.element,
tintColor: PropTypes.string.isRequired,
direction: PropTypes.string.isRequired,
disabled: PropTypes.bool.isRequired,
hidden: PropTypes.bool.isRequired,
onPress: PropTypes.func.isRequired,
}
class KeyboardAccessoryNavigation extends Component {
handleDoneButton() {
this.props.onDone && this.props.onDone();
Keyboard.dismiss();
}
render() {
const {
nextButton,
previousButton,
doneButton,
doneButtonTitle,
infoContainer,
infoMessage,
tintColor,
onNext,
onPrevious,
nextDisabled,
previousDisabled,
nextHidden,
previousHidden,
style,
accessoryStyle,
nextButtonStyle,
previousButtonStyle,
doneButtonStyle,
doneButtonTitleStyle,
infoMessageStyle,
nextButtonDirection,
previousButtonDirection,
alwaysVisible,
} = this.props;
return (
<KeyboardAccessoryView {...(style ? { style } : {})} alwaysVisible={alwaysVisible}>
<View style={[styles.accessoryContainer, accessoryStyle]}>
{!nextHidden && !previousHidden && (
<View style={styles.leftContainer}>
<AccessoryArrowButton
style={[styles.previousButton, previousButtonStyle]}
hidden={previousHidden}
disabled={previousDisabled}
direction={previousButtonDirection}
customButton={previousButton}
tintColor={tintColor}
onPress={onPrevious}
/>
<AccessoryArrowButton
style={{...(style ? { style: nextButtonStyle } : {})}}
hidden={nextHidden}
disabled={nextDisabled}
direction={nextButtonDirection}
customButton={nextButton}
tintColor={tintColor}
onPress={onNext}
/>
</View>
)}
{(infoMessage || infoContainer) && (
<View style={styles.infoContainer}>
{infoContainer ? infoContainer : (
<Text style={[infoMessageStyle, {
color: tintColor,
}]}>
{infoMessage}
</Text>
)}
</View>
)}
<TouchableOpacity
style={[styles.doneButton, doneButtonStyle]}
onPress={this.handleDoneButton.bind(this)} >
{doneButton ? doneButton : (
<Text style={[ styles.doneButtonText, doneButtonTitleStyle, {
color: tintColor,
}]}>
{doneButtonTitle}
</Text>
)}
</TouchableOpacity>
</View>
</KeyboardAccessoryView>
);
}
}
KeyboardAccessoryNavigation.propTypes = {
doneButtonTitle: PropTypes.string,
infoMessage: PropTypes.string,
doneButton: PropTypes.element,
nextButton: PropTypes.element,
previousButton: PropTypes.element,
infoContainer: PropTypes.element,
onNext: PropTypes.func,
onPrevious: PropTypes.func,
onDone: PropTypes.func,
nextDisabled: PropTypes.bool,
previousDisabled: PropTypes.bool,
doneDisabled: PropTypes.bool,
nextHidden: PropTypes.bool,
previousHidden: PropTypes.bool,
alwaysVisible: PropTypes.bool,
tintColor: PropTypes.string,
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
accessoryStyle: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
previousButtonStyle: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
nextButtonStyle: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
doneButtonStyle: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
doneButtonTitleStyle: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
infoMessageStyle: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number
]),
nextButtonDirection: PropTypes.oneOf(['up', 'down', 'left', 'right']),
previousButtonDirection: PropTypes.oneOf(['up', 'down', 'left', 'right']),
}
KeyboardAccessoryNavigation.defaultProps = {
doneButtonTitle: 'Done',
tintColor: '#007AFF',
nextDisabled: false,
previousDisabled: false,
nextHidden: false,
previousHidden: false,
nextButtonDirection: 'down',
previousButtonDirection: 'up',
alwaysVisible: false,
}
const styles = StyleSheet.create({
accessoryContainer: {
height: 45,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingLeft: 15,
paddingRight: 15,
},
leftContainer: {
flexDirection: 'row',
alignItems: 'center',
},
previousButton: {
marginRight: 16,
},
doneButtonText: {
fontWeight: 'bold'
},
})
export default KeyboardAccessoryNavigation;
| JavaScript | 0.000001 | @@ -1873,16 +1873,370 @@
props;%0A%0A
+ // Are both arrows hidden?%0A const arrowsHidden = nextHidden && previousHidden;%0A%0A // Is there an info message/container?%0A const noInfo = !infoMessage && !infoContainer;%0A%0A const accessoryContainerStyle = %5B%0A styles.accessoryContainer,%0A arrowsHidden && noInfo ? styles.accessoryContainerReverse : null,%0A accessoryStyle,%0A %5D%0A%0A
retu
@@ -2351,24 +2351,16 @@
style=%7B
-%5Bstyles.
accessor
@@ -2373,25 +2373,13 @@
iner
-, accessory
Style
-%5D
%7D%3E%0A
@@ -2393,30 +2393,13 @@
%7B!
-nextHidden && !previou
+arrow
sHid
@@ -3724,16 +3724,26 @@
d(this)%7D
+%0A
%3E%0A
@@ -5907,16 +5907,86 @@
5,%0A %7D,%0A
+ accessoryContainerReverse: %7B%0A flexDirection: 'row-reverse',%0A %7D,%0A
leftCo
|
7e610e0d9df4c71f43d7114502ea663d45af889f | add issue prefix case | @commitlint/rules/src/references-empty.test.js | @commitlint/rules/src/references-empty.test.js | import test from 'ava';
import preset from 'conventional-changelog-angular';
import parse from '@commitlint/parse';
import referencesEmpty from './references-empty';
const messages = {
plain: 'foo: bar',
comment: 'foo: baz\n#1 Comment',
reference: '#comment\nfoo: baz \nCloses #1',
references: '#comment\nfoo: bar \nCloses #1, #2, #3'
};
const opts = (async () => {
const o = await preset;
o.parserOpts.commentChar = '#';
return o;
})();
const parsed = {
plain: (async () =>
parse(messages.plain, undefined, (await opts).parserOpts))(),
comment: (async () =>
parse(messages.comment, undefined, (await opts).parserOpts))(),
reference: (async () =>
parse(messages.reference, undefined, (await opts).parserOpts))(),
references: (async () =>
parse(messages.references, undefined, (await opts).parserOpts))()
};
test('defaults to never and fails for plain', async t => {
const [actual] = referencesEmpty(await parsed.plain);
const expected = false;
t.is(actual, expected);
});
test('defaults to never and succeeds for reference', async t => {
const [actual] = referencesEmpty(await parsed.reference);
const expected = true;
t.is(actual, expected);
});
test('fails for comment with never', async t => {
const [actual] = referencesEmpty(await parsed.comment, 'never');
const expected = false;
t.is(actual, expected);
});
test('succeeds for comment with always', async t => {
const [actual] = referencesEmpty(await parsed.comment, 'always');
const expected = true;
t.is(actual, expected);
});
test('succeeds for reference with never', async t => {
const [actual] = referencesEmpty(await parsed.reference, 'never');
const expected = true;
t.is(actual, expected);
});
test('fails for reference with always', async t => {
const [actual] = referencesEmpty(await parsed.reference, 'always');
const expected = false;
t.is(actual, expected);
});
test('succeeds for references with never', async t => {
const [actual] = referencesEmpty(await parsed.references, 'never');
const expected = true;
t.is(actual, expected);
});
test('fails for references with always', async t => {
const [actual] = referencesEmpty(await parsed.references, 'always');
const expected = false;
t.is(actual, expected);
});
| JavaScript | 0.000013 | @@ -332,16 +332,41 @@
#2, #3'
+,%0A%09prefix: 'bar REF-1234'
%0A%7D;%0A%0Acon
@@ -843,16 +843,92 @@
Opts))()
+,%0A%09prefix: parse(messages.prefix, undefined, %7B%0A%09%09issuePrefixes: %5B'REF-'%5D%0A%09%7D)
%0A%7D;%0A%0Ates
@@ -2309,28 +2309,211 @@
t.is(actual, expected);%0A%7D);%0A
+%0Atest('succeeds for custom references with always', async t =%3E %7B%0A%09const %5Bactual%5D = referencesEmpty(await parsed.prefix, 'never');%0A%09const expected = true;%0A%09t.is(actual, expected);%0A%7D);%0A
|
d4113e532923b6306195cc67182bfd492bfd7565 | fixed run task to return Promise | voyager.js | voyager.js | /**
* @file voyager.js Exported methods for voyager in a node environment.
* @module {Object} voyager
*/
/**
* Module dependencies
*/
var colors = require('colors')
, del = require('del')
, fs = require('graceful-fs')
, Pinwheel = require('pinwheel')({ mark: '⚡' })
, Promise = require('es6-promise').Promise
, requireDir = require('require-dir')
, defaults = {
spin: false
, namespaces: []
};
function addNS(ns, args) {
var tasks = []
, i = 0
, l = voyager.namespaces_[ns].length;
for (i; i < l; i++) {
var t = voyager.namespaces_[ns][i];
if (typeof voyager.tasks_[t] === 'function') {
tasks.push(addTask(t, args));
}
}
return Promise.resolve(tasks);
}
function addTask(id, args) {
new Promise(function (done, fail) {
voyager.tasks_[id].call(voyager, args).then(done);
});
}
var voyager = Object.defineProperties({}, {
/**
* Namespace for registered tasks
* @member {Object}
* @private
*/
tasks_: {
value: {}
}
, namespaces_: {
value: {}
}
, BLD: {
value: process.cwd() + '/build'
}
, CWD: {
value: process.cwd()
}
, TMP: {
value: process.cwd() + '/.dev'
}
, SRC: {
value: process.cwd() + '/src'
}
, loadTasks_: {
value: function () {
// load default tasks
requireDir('./tasks');
// load installed voyager tasks
var pkg = JSON.parse(fs.readFileSync(this.CWD + '/package.json', { encoding: 'utf8' }))
, scopes = ['dependencies', 'devDependencies'];
for (var i = 0, l = scopes.length; i < l; i++) {
if (pkg[scopes[i]]) {
for (var key in pkg[scopes[i]]) {
if (/^voyager\-/.test(key)) {
require(this.CWD + '/node_modules/' + key);
}
}
}
}
// try loading any user defined tasks
try {
requireDir(this.CWD + '/tasks');
} catch (e) {
if (e.errno !== 34) {
console.log(e);
}
}
}
}
, build: {
value: function (done) {
done = done || function () {};
this.loadTasks_();
this.clean()
.then(this.run.bind(this, ['prebuild', 'build']))
.then(done);
}
}
, clean: {
value: function () {
return new Promise(function (done, fail) {
del([voyager.TMP, voyager.BLD], done);
});
}
}
, start: {
value: function (done) {
done = done || function () {};
this.loadTasks_();
this.clean()
.then(this.run.bind(this, ['prebuild', 'serve', 'watch']))
.then(done);
}
}
/**
* Registers a task in the _tasks namespace. Tasks are automatically wrapped
* in a Promise for chained execution.
* @method
* @public
* @param {string} id - The name under which this task will be registered
* @param {string|Array} ns - Namespace(s) this task belongs to
* @param {Function} func - The task definition
* @param {Object} [opts={}] - Options for this task
* @returns {Promise}
*/
, task: {
value: function (id, ns, func, opts) {
if (typeof ns === 'function') {
opts = func || {};
func = ns;
ns = 'ns';
} else {
opts = opts || {};
}
var options = {}
, key
, wheel = new Pinwheel('TASK: ' + id);
// extend default options
if (ns.indexOf('watch') > 0 || ns === 'watch') options.spin = false;
for (key in defaults) {
var v = defaults[key];
if (opts.hasOwnProperty(key)) {
v = opts[key];
}
options[key] = v;
}
// store task id in given namespace
if (Array.isArray(ns)) {
for (var i = 0, l = ns.length; i < l; i++) {
if (!this.namespaces_[ns[i]]) this.namespaces_[ns[i]] = [];
if (this.namespaces_[ns[i]].indexOf(id) === -1) {
this.namespaces_[ns[i]].push(id);
}
}
} else {
if (!this.namespaces_[ns]) this.namespaces_[ns] = [];
this.namespaces_[ns].push(id);
}
// register the task
this.tasks_[id] = function () {
var start = Date.now();
if (options.spin) {
wheel.start();
} else {
console.log('starting ' + id.grey + '...');
}
var args = Array.prototype.slice.call(arguments);
return new Promise(function (resolve, reject) {
func.call(voyager, function (err) {
if (err) return reject(err);
return resolve();
}, args);
}).then(function () {
if (options.spin) return wheel.stop();
return console.log(
'finished ' + id.green + ' ' + ((Date.now() - start) + 'ms').grey
);
})['catch'](function (err) {
if (options.spin) {
wheel.stop(err);
} else {
console.log(
'ERROR'.inverse.red + ' ' + id.red + ' '
+ ((Date.now() - start) + 'ms').grey
);
}
return console.error(err);
});
};
}
}
/**
* Run a registered task
* @method
* @public
* @param {string|Array} id - The task(s)/namespace(s) to run
*/
, run: {
value: function (id) {
var ids = Array.isArray(id) ? id : [id]
, tasks = []
, watches = [];
ids.forEach(function (name) {
if (name in voyager.namespaces_) {
voyager.namespaces_[name].forEach(function (t) {
if (name === 'watch') {
watches.push(t);
} else {
tasks.push(t);
}
});
} else if (name in voyager.tasks_) {
tasks.push(name);
} else {
throw new Error(name + ' is neither a registered task or namespace.');
}
});
tasks.reduce(function (sequence, task) {
return sequence.then(voyager.tasks_[task].bind(voyager));
}, Promise.resolve()).then(function () {
watches.forEach(function (t) {
voyager.tasks_[t].call(voyager);
});
});
}
}
});
module.exports = voyager;
| JavaScript | 0.998729 | @@ -5769,24 +5769,31 @@
%7D);%0A
+return
tasks.reduce
|
52a81b33e274040e36a575b7f16206e933247ab9 | complete bar chart and fixed the bug with transition | client/Components/AnalyticsComponents/visualizations/barchart.js | client/Components/AnalyticsComponents/visualizations/barchart.js | import d3 from 'd3';
import _ from 'lodash';
const barChart = {};
const margin = 60;
// data looks like this
// { emotion: emotion, data: object[emotion], index: i }
barChart.create = (el, props, data) => {
console.log(el, 'svg inside create');
// functions to grab specific parts of the data
const emotion = d => d.emotion;
// const yAxisMargin = {'margin-top': '25%'};
const emotionsData = d => d.data;
// const index = (d) => d.index;
let svg = d3.select(el)
.append('svg')
.style('padding-top', '20%')
.attr('id', 'barChart')
.attr('width', props.width)
.attr('height', props.height);
// both x and y axes don't currently render
let xScale = d3.scale.ordinal()
.domain(data.map(d => d.emotion))
.rangeRoundBands([100, 450], 0.1); // magic #40, width is a %
/* [height, width], distance <> bars */
//
let yScale = d3.scale.linear()
.domain([0, d3.max(data, emotionsData)]) // ?
.range([400 - margin, 0]); // height - margin, 300
let xAxis = d3.svg.axis().scale(xScale);
let yAxis = d3.svg.axis().scale(yScale).orient('left');
d3.select('svg')
.append('g')
.attr('class', 'x-axis')
.attr('transform', `translate(-5, ${400 - margin})`)
.call(xAxis);
d3.select('svg')
.append('g')
.attr('class', 'y-axis')
.attr('transform', `translate(${margin + 41}, 0)`)
.call(yAxis);
svg.selectAll('rect')
.data(data)
.enter()
.append('rect')
.attr('x', d => xScale(d.emotion))
.attr('y', d => yScale(d.data))
.attr('width', xScale.rangeBand())
.attr('height', (d) => (yScale(0) - yScale(d.data)))
.attr('fill', 'green');
svg.selectAll('text')
.data(data)
.enter()
.append('text')
.text((d) => d.emotion)
.attr('text-anchor', 'middle')
.attr('x', (d, i) => (xScale(i) + xScale.rangeBand() / 2))
.attr('y', (d) => yScale(d.data))
.attr('font-family', 'sans-serif')
.attr('font-size', '11px')
.attr('fill', 'black');
};
barChart.update = (el, props, data) => {
const emotionsData = d => d.data;
let xScale = d3.scale.ordinal()
.domain(data.map(d => d.emotion))
.rangeRoundBands([100, 450], 0.1); // magic #40, width is a %
/* [height, width], distance <> bars */
let yScale = d3.scale.linear()
.domain([0, d3.max(data, emotionsData)]) // ?
.range([400 - margin, 0]); // height - margin, 300
let xAxis = d3.svg.axis().scale(xScale);
let yAxis = d3.svg.axis().scale(yScale).orient('left');
let svg = d3.select('#barChart');
svg.selectAll('rect')
.data(data)
.transition()
.duration(500)
.attr('x', d => xScale(d.emotion))
.attr('y', d => yScale(d.data))
.attr('width', xScale.rangeBand())
.attr('height', (d) => (yScale(0) - yScale(d.data)))
.attr('text-anchor', 'middle')
.attr('fill', 'green')
};
export default barChart;
| JavaScript | 0 | @@ -848,17 +848,16 @@
*/%0A //
-
%0A let y
@@ -2516,16 +2516,37 @@
hart');%0A
+ console.log(data);%0A
svg.se
@@ -2553,32 +2553,32 @@
lectAll('rect')%0A
-
.data(data)%0A
@@ -2645,32 +2645,89 @@
ale(d.emotion))%0A
+ .attr('height', (d) =%3E (yScale(0) - yScale(d.data)))%0A
.attr('y', d
@@ -2793,64 +2793,10 @@
-.attr('height', (d) =%3E (yScale(0) - yScale(d.data)))%0A
+//
.at
@@ -2818,32 +2818,35 @@
', 'middle')%0A
+ //
.attr('fill', '
@@ -2853,16 +2853,17 @@
green')%0A
+%0A
%7D;%0A%0Aexpo
|
6c53608908002dcc33e37be23ccec3c7f3a8cf5e | Document custom shader constructor | Source/Scene/ModelExperimental/CustomShader.js | Source/Scene/ModelExperimental/CustomShader.js | import defaultValue from "../../Core/defaultValue.js";
import CustomShaderMode from "./CustomShaderMode.js";
export default function CustomShader(options) {
this.mode = defaultValue(options.model, CustomShaderMode.MODIFY_MATERIAL);
this.lightingModel = options.lightingModel;
this.uniforms = options.uniforms;
this.varyings = options.varyings;
this.vertexShaderText = options.vertexShaderText;
this.fragmentShaderText = options.fragmentShaderText;
this.uniformMap = buildUniformMap(this);
}
function buildUniformMap(customShader) {
var uniformMap = {};
for (var uniformName in customShader.uniforms) {
if (customShader.uniforms.hasOwnProperty(uniformName)) {
uniformMap[uniformName] = createUniformFunction(
customShader,
uniformName
);
}
}
return uniformMap;
}
function createUniformFunction(customShader, uniformName) {
return function () {
return customShader.uniforms[uniformName].value;
};
}
CustomShader.prototype.setUniform = function (uniformName, value) {
this.uniforms[uniformName].value = value;
};
| JavaScript | 0 | @@ -107,55 +107,2294 @@
%22;%0A%0A
-export default function CustomShader(options) %7B
+/**%0A * An object describing a uniform, its type, and an initial value%0A *%0A * @typedef %7BObject%7D UniformSpecifier%0A * @property %7BUniformType%7D type The Glsl type of the uniform.%0A * @property %7BBoolean%7CNumber%7CCartesian2%7CCartesian3%7CCartesian4%7CMatrix2%7CMatrix3%7CMatrix4%7D value The initial value to%0A */%0A%0A/**%0A *%0A * @param %7BObject%7D options An object with the following options%0A * @param %7BCustomShaderMode%7D %5Boptions.mode=CustomShaderMode.MODIFY_MATERIAL%5D The custom shader mode, which determines how the custom shader code is inserted into the fragment shader.%0A * @param %7BLightingModel%7D %5Boptions.lightingModel%5D The lighting model (e.g. PBR or unlit). If present, this overrides the normal lighting for the model.%0A * @param %7BObject.%3CString, UniformSpecifier%3E%7D %5Boptions.uniforms%5D A dictionary for user-defined uniforms. The key is the uniform name that will appear in the GLSL code. The value is an object that describes the uniform type and initial value%0A * @param %7BObject.%3CString, VaryingType%7D %5Boptions.varyings%5D A dictionary for declaring additional GLSL varyings used in the shader. The key is the varying name that will appear in the GLSL code. The value is the data type of the varying. For each varying, the declaration will be added to the top of the shader automatically. The caller is responsible for assigning a value in the vertex shader and using the value in the fragment shader.%0A * @param %7BString%7D %5Boptions.vertexShaderText%5D The custom vertex shader as a string of GLSL code. It must include a GLSL function called vertexMain. See the example for the expected signature. If not specified, the custom vertex shader step will be skipped in the computed vertex shader.%0A * @param %7BString%7D %5Boptions.fragmentShaderText%5D The custom fragment shader as a string of GLSL code. It must include a GLSL function called fragmentMain. See the example for the expected signature. If not specified, the custom fragment shader step will be skipped in the computed fragment shader.%0A *%0A * @alias CustomShader%0A * @constructor%0A *%0A * @private%0A * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.%0A */%0Aexport default function CustomShader(options) %7B%0A options = defaultValue(options, defaultValue.EMPTY_OBJECT);%0A
%0A t
@@ -2429,17 +2429,16 @@
ons.mode
-l
, Custom
@@ -2526,24 +2526,37 @@
.uniforms =
+defaultValue(
options.unif
@@ -2559,16 +2559,44 @@
uniforms
+, defaultValue.EMPTY_OBJECT)
;%0A this
@@ -2607,16 +2607,29 @@
yings =
+defaultValue(
options.
@@ -2636,17 +2636,46 @@
varyings
-;
+, defaultValue.EMPTY_OBJECT);%0A
%0A this.
|
75eb2e6f13e961c1635016154dd4b76f1ece029b | add "'stringProperty'" to bad-sim-text, factor out string literal, https://github.com/phetsims/scenery/issues/1451 | eslint/rules/bad-sim-text.js | eslint/rules/bad-sim-text.js | // Copyright 2019, University of Colorado Boulder
/* eslint-disable bad-sim-text */
/**
* Lint detector for invalid text.
* Lint is disabled for this file so the bad texts aren't themselves flagged.
*
* @author Sam Reid (PhET Interactive Simulations)
* @author Michael Kauzmann (PhET Interactive Simulations)
*/
module.exports = function( context ) {
const getBadTextTester = require( './getBadTextTester' );
// see getBadTextTester for schema.
const forbiddenTextObjects = [
// should be using dot.Utils.roundSymmetric, Math.round does not treat positive and negative numbers
// symmetrically see https://github.com/phetsims/dot/issues/35#issuecomment-113587879
{ id: 'Math.round(', codeTokens: [ 'Math', '.', 'round', '(' ] },
// should be using `DOT/dotRandom`
{ id: 'Math.random()', codeTokens: [ 'Math', '.', 'random', '(', ')' ] },
{ id: '_.shuffle(', codeTokens: [ '_', '.', 'shuffle', '(' ] },
{ id: '_.sample(', codeTokens: [ '_', '.', 'sample', '(' ] },
{ id: '_.random(', codeTokens: [ '_', '.', 'random', '(' ] },
{ id: 'new Random()', codeTokens: [ 'new', 'Random', '(', ')' ] },
// IE doesn't support:
{ id: 'Number.parseInt(', codeTokens: [ 'Number', '.', 'parseInt', '(' ] },
{ id: 'Array.prototype.find', codeTokens: [ 'Array', '.', 'prototype', '.', 'find' ] },
// Use merge instead of _.extend for combining options/config. Leave out first letter to allow for `options = `
// and `sliderOptions = _.extend` to both be caught.
'ptions = _.extend(',
'onfig = _.extend(',
// ParallelDOM.pdomOrder should not be mutated, instead only set with `setPDOMOrder`
'.pdomOrder.push(',
// Should import dotRandom instead of using the namespace
'phet.dot.dotRandom',
// Prefer using Pointer.isTouchLike() to help support Pen. This is not set in stone, please see
// https://github.com/phetsims/scenery/issues/1156 and feel free to discuss if there are usages you want to support.
' instanceof Touch ',
// Prevent accidental importing of files from the TypeScript build output directory
'chipper/dist',
// Relying on these in sim code can break PhET-iO playback, instead use Sim.dimensionProperty, see https://github.com/phetsims/joist/issues/768
'window.innerWidth',
'window.innerHeight',
// These are types that can be inferred by the common code and provided arguments
'new Enumeration<',
'new EnumerationProperty<',
// Voicing utterances should be registered with a Node for "voicing visibility", using Voicing.alertUtterance asserts
// that. See https://github.com/phetsims/scenery/issues/1403
'voicingUtteranceQueue.addToBack',
// In sims, don't allow setTimout and setInterval calls coming from window, see https://github.com/phetsims/phet-info/issues/59
{
id: 'setTimeout(',
regex: /(window\.| )setTimeout\(/
},
{
id: 'setInterval(',
regex: /(window\.| )setInterval\(/
},
// Decided on during developer meeting, in regards to https://github.com/phetsims/scenery/issues/1324, use `{ Type }`
// import syntax from SCENERY/imports.js
{
id: 'should import from SCENERY/imports.js instead of directly',
regex: /import.*from.*\/scenery\/(?!js\/imports.js)/
},
// Decided on during developer meeting, in regards to https://github.com/phetsims/scenery/issues/1324, use `{ Type }`
// import syntax from KITE/imports.js
{
id: 'should import from KITE/imports.js instead of directly',
regex: /import.*from.*\/kite\/(?!js\/imports.js)/
},
// DOT/Utils.toFixed or DOT/Utils.toFixedNumber should be used instead of toFixed.
// JavaScript's toFixed is notoriously buggy. Behavior differs depending on browser,
// because the spec doesn't specify whether to round or floor.
{
id: '.toFixed(', // support regex with english names this way
regex: new RegExp( '(?<!Utils)\\.toFixed\\(' ) // NOTE: eslint parsing breaks when using regex syntax like `/regex/`
},
{
id: 'Import from statements require a *.js suffix',
predicate: line => {
if ( line.trim().indexOf( 'import ' ) === 0 && line.indexOf( ' from ' ) > 0 && line.indexOf( '.js' ) === -1 ) {
return false;
}
return true;
}
}
];
return {
Program: getBadTextTester( 'bad-sim-text', forbiddenTextObjects, context )
};
};
module.exports.schema = [
// JSON Schema for rule options goes here
]; | JavaScript | 0.001424 | @@ -2693,24 +2693,273 @@
ddToBack',%0A%0A
+ // Please use Text/RichText.STRING_PROPERTY_TANDEM_NAME when appropriate (though not all usages apply here, and%0A // you can ignore this rule), https://github.com/phetsims/scenery/issues/1451#issuecomment-1270576831%0A '%5C'stringProperty%5C'',%0A%0A
// In si
|
a8d7a01ac97b4ad8bc8c906ccc2610fd2c1967eb | Fix for readonly hash args | app/helpers/app-version.js | app/helpers/app-version.js | import { helper } from '@ember/component/helper';
import config from '../config/environment';
import { shaRegExp, versionRegExp, versionExtendedRegExp } from 'ember-cli-app-version/utils/regexp';
const {
APP: {
version
}
} = config;
export function makeHelper(version) {
return function appVersion(_, hash = {}) {
// e.g. 1.0.0-alpha.1+4jds75hf
// Allow use of 'hideSha' and 'hideVersion' For backwards compatibility
hash.versionOnly = hash.versionOnly || hash.hideSha;
hash.shaOnly = hash.shaOnly || hash.hideVersion;
let match = null;
if (hash.versionOnly) {
if (hash.showExtended) {
match = version.match(versionExtendedRegExp); // 1.0.0-alpha.1
} else {
match = version.match(versionRegExp); // 1.0.0
}
}
if (hash.shaOnly) {
match = version.match(shaRegExp); // 4jds75hf
}
return match?match[0]:version;
};
}
export default helper(appVersion);
| JavaScript | 0 | @@ -435,21 +435,20 @@
ity%0A
-hash.
+let
versionO
@@ -491,21 +491,20 @@
ha;%0A
-hash.
+let
shaOnly
@@ -571,21 +571,16 @@
if (
-hash.
versionO
@@ -781,21 +781,16 @@
if (
-hash.
shaOnly)
|
90d45ee04b1bea29d6c870b41559fadb487db408 | Set friendly delay for cleanup alarm | common/CleanupConst.js | common/CleanupConst.js | /*
* Copyright (c) 2017. Stephan Mahieu
*
* This file is subject to the terms and conditions defined in
* file 'LICENSE', which is part of this source code package.
*/
class CleanupConst {
// no support for static contants, declare then after the class definition
}
CleanupConst.ALARM_NAME = "fhc-periodic-cleanup-alarm";
CleanupConst.INITIAL_DELAY_MINUTES = 2; //5;
CleanupConst.PERIOD_MINUTES = 2; //15;
CleanupConst.DEFAULT_DAYS_TO_KEEP = 90;
CleanupConst.DEFAULT_DO_CLEANUP = true; | JavaScript | 0 | @@ -368,13 +368,8 @@
= 2;
- //5;
%0ACle
@@ -399,13 +399,8 @@
S =
-2; //
15;%0A
|
bfe4bd33dbedd874a19bcd3a7e68e59fd3cfba2d | Update app.js | leaf-analysis/app.js | leaf-analysis/app.js | //File name: app.js
//Description: the entry point to the chat app server
//Last updated: 4/28/2019
// Name of .jar file for BloomingLeaf project must be Blooming.jar
//var userPath = "/Users/<your user path here>/BloomingLeaf"
var userPath = "/Users/Joey/Downloads/SURF/BloomingLeaf"
var http = require('http'),
url = require('url'),
fileServer = require('./node/fileServer.js'),
fs = require('fs');
qs = require('./node/query.js'),
utils = require('./node/utils.js');
exec = require('child_process').exec;
//TODO: If wait is not longer needed, this function can be removed.
function wait(ms){
var start = new Date().getTime();
var end = start;
while(end < start + ms) {
end = new Date().getTime();
}
}
function processGet(path,queryObj,res) {
// if URL includes a path to a file, call file server method
if (path && path.length > 1) {
// precede the given path with name of the subdirectory in which
// the client files are stored
fileServer.serve_static_file(userPath+"/leaf-ui"+path,res);
}
// check if there is a query. The query object will always be created
// even if there is no quesry string. So check using a property that you
// know will be part of any query sent by the client. This is application
// specific - depends on our knowledge of what the client will serve
// alternatively - you can check if (url.parse(req.url).search)
// search is the query string
/*else if (queryObj.request) {
qs.processQuery(queryObj,res);
} else {
// if not file path or query were sent - read and serve default html file
fileServer.serve_static_file("public_html/index.html",res);
fileServed = true;
}*/
}
function processPost(queryObj,req,res) {
var body = '';
req.on('data', data => {body += data;}); // get the request data
req.on('end', () => { // request fully received - process it
if (body || queryObj.name) {
queryObj.message = body; // specific to the chat application
qs.processQuery(queryObj,res);
}
fs.writeFileSync(userPath+"/leaf-analysis/temp/default.json",body);
passIntoJar(res);
// //TODO: Can this function be written in an asynchronous call?
// wait(1000);
// //TODO: Can this be made asynchronous by moving the follow code down to to "HERE"
// //read from output.out and pass the data as a string with the response
// analysisFile = fs.readFileSync(userPath+"/leaf-analysis/temp/output.out");
// analysisFileString = String(analysisFile);
// res.writeHead(200, { "Content-Type" : 'text/plain'});
// // send data
// res.write(analysisFileString);
// res.end();
});
}
// server call back function
function handle_incoming_request(req, res) {
// get the path of the file to served
var path = url.parse(req.url).pathname;
// get a query (true makes sure the query string is parsed into an object)
var queryObj = url.parse(req.url,"true").query;
if (req.method.toLowerCase() == "get")
processGet(path,queryObj,res);
else if (req.method.toLowerCase() == "post")
processPost(queryObj,req,res);
else
utils.sendText(res,400,"Server accepts only GET ans POST requests");
}
/*
*This function executed the jar file
*/
function passIntoJar(res) {
child = exec('java -jar '+userPath+'/leaf-analysis/bin/Blooming.jar ',
function (error, stdout, stderr){
if(error !== null){
console.log('exec error: ' + error);
}
else{
//Analysis return code.
analysisFile = fs.readFileSync(userPath+"/leaf-analysis/temp/output.out");
analysisFileString = String(analysisFile);
res.writeHead(200, { "Content-Type" : 'text/plain'});
// send data
res.write(analysisFileString);
res.end();
return stdout;
}
});
return child;
}
var server = http.createServer(handle_incoming_request);
server.listen(8080); | JavaScript | 0.000002 | @@ -255,27 +255,21 @@
ers/
-Joey/Downloads/SURF
+judySmith/git
/Blo
@@ -4273,8 +4273,10 @@
n(8080);
+%0D%0A
|
d4e3634ade6b51df3b5271bcf2a2a05ef7218a46 | remove the script tag | assets/js/analytics.js | assets/js/analytics.js | /* <!-- Asynchronous Baidu Analytics snippet --> */
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?11224c4b3c0923fa6de6e431325fe387";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
/* <!-- Aysnchronous CNZZ Analytics --> */
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1256833726'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s95.cnzz.com/z_stat.php%3Fid%3D1256833726' type='text/javascript'%3E%3C/script%3E"));</script>
/* <!-- Asynchronous Google Analytics snippet --> */
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-39438576-1', 'auto');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
| JavaScript | 0.000006 | @@ -342,39 +342,8 @@
*/%0A
-%3Cscript type=%22text/javascript%22%3E
var
@@ -426,16 +426,17 @@
tp://%22);
+%0A
document
@@ -629,17 +629,8 @@
%22));
-%3C/script%3E
%0A%0A/*
|
0d061bf39a521fb2ea5fa33f885e0d2b49a5d3d3 | remove comments | tests/test-helper.js | tests/test-helper.js | // import resolver from './helpers/resolver'
// import {setResolver} from 'ember-mocha'
// setResolver(resolver)
import Application from '../app'
import config from '../config/environment'
import {setApplication} from '@ember/test-helpers'
setApplication(Application.create(config.APP))
| JavaScript | 0 | @@ -1,119 +1,4 @@
-// import resolver from './helpers/resolver'%0A// import %7BsetResolver%7D from 'ember-mocha'%0A%0A// setResolver(resolver)%0A%0A
impo
|
5fbd35cd7c47b49abb8451f50f18b92317f60556 | update reducers | examples/reduxes/reducers/index.js | examples/reduxes/reducers/index.js | import {combineReducers} from 'redux';
import {routerReducer} from 'react-router-redux';
import device from './app/DeviceReducer';
import navMenu from './app/NavMenuReducer';
import loadComponent from './app/LoadComponentReducer';
const rootReducer = combineReducers({
device,
navMenu,
loadComponent,
router: routerReducer
});
export default rootReducer; | JavaScript | 0.000001 | @@ -44,29 +44,39 @@
rt %7B
-routerReducer%7D from '
+connectRouter%7D from 'connected-
reac
@@ -87,14 +87,8 @@
uter
--redux
';%0A%0A
@@ -234,27 +234,33 @@
';%0A%0A
-const rootReducer
+export default history
=
+%3E
com
@@ -275,16 +275,53 @@
cers(%7B%0A%0A
+ router: connectRouter(history),%0A%0A
devi
@@ -358,66 +358,10 @@
nent
-,%0A%0A router: routerReducer%0A%0A%7D);%0A%0Aexport default rootReducer;
+%0A%0A%7D);%0A
|
4dc0cf0e325612b0832be33d5d3f1ca13f5a8e3b | Default autopublish as true | client/app/scripts/liveblog-syndication/reducers/ingest-panel.js | client/app/scripts/liveblog-syndication/reducers/ingest-panel.js | liveblogSyndication
.factory('IngestPanelReducers', function() {
var locallySyndicatedItems = function(syndicationIn, localSyndTokens) {
return syndicationIn._items.filter(function(item) {
return (localSyndTokens.indexOf(item.blog_token) != -1);
});
};
return function(state, action) {
switch (action.type) {
case 'ON_GET_SYND':
var localSyndTokens = action.syndicationIn._items
.filter(function(syndication) {
return (syndication.blog_id == state.consumerBlogId);
})
.map(function(syndication) {
return syndication.blog_token;
});
return {
modalActive: state.modalActive,
consumerBlogId: state.consumerBlogId,
syndicationIn: action.syndicationIn, //ACTION
producers: state.producers,
producerBlogs: state.producerBlogs,
localProducerBlogIds: state.localProducerBlogsIds,
localSyndTokens: localSyndTokens,
locallySyndicatedItems: locallySyndicatedItems(
action.syndicationIn,
localSyndTokens
)
};
case 'ON_GET_PRODUCERS':
return {
modalActive: state.modalActive,
consumerBlogId: state.consumerBlogId,
syndicationIn: state.syndicationIn,
producers: action.producers, // ACTION
producerBlogs: state.producerBlogs,
localProducerBlogIds: state.localProducerBlogsIds,
localSyndTokens: state.localSyndTokens,
locallySyndicatedItems: state.locallySyndicatedItems
}
case 'ON_GET_PRODUCER_BLOGS':
var localProducerBlogIds = [];
action.producerBlogs._items = action.producerBlogs._items.map(function(blog) {
blog.checked = false;
state.locallySyndicatedItems.forEach(function(localBlog) {
if (localBlog.producer_blog_id == blog._id) {
localProducerBlogIds.push(blog._id);
blog.checked = true;
}
});
return blog;
});
return {
modalActive: state.modalActive,
consumerBlogId: state.consumerBlogId,
syndicationIn: state.syndicationIn,
producers: state.producers,
producerBlogs: action.producerBlogs, // ACTION
localProducerBlogIds: localProducerBlogIds,
localSyndTokens: state.localSyndTokens,
locallySyndicatedItems: state.locallySyndicatedItems
}
case 'ON_TOGGLE_MODAL':
return {
modalActive: action.modalActive, // ACTION
consumerBlogId: state.consumerBlogId,
syndicationIn: state.syndicationIn,
producers: state.producers,
producerBlogs: state.producerBlogs,
localProducerBlogIds: state.localProducerBlogsIds,
localSyndTokens: state.localSyndTokens,
locallySyndicatedItems: state.locallySyndicatedItems
}
}
}
});
| JavaScript | 0.998889 | @@ -2628,32 +2628,117 @@
%7D
+%0A%0A blog.autopublish = true; // Default autopublish as true
%0A
|
1d78d0b144186a8488281ffd6cd52b84b26a883d | fix ObjectName dimming error | src/object/ObjectName.js | src/object/ObjectName.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import createStyles from '../styles/createStyles';
/**
* A view for object property names.
*
* If the property name is enumerable (in Object.keys(object)),
* the property name will be rendered normally.
*
* If the property name is not enumerable (`Object.prototype.propertyIsEnumerable()`),
* the property name will be dimmed to show the difference.
*/
const ObjectName = ({ name, dimmed, styles }, { theme }) => {
const themeStyles = createStyles('ObjectName', theme);
return (
<span style={{ ...themeStyles.base, ...(dimmed && styles.dimmed), ...styles }}>{name}</span>
);
};
ObjectName.propTypes = {
/** Property name */
name: PropTypes.string,
/** Should property name be dimmed */
dimmed: PropTypes.bool,
};
ObjectName.defaultProps = {
dimmed: false,
};
ObjectName.contextTypes = {
theme: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
};
export default ObjectName;
| JavaScript | 0.000001 | @@ -558,35 +558,35 @@
;%0A
-return (%0A %3Cspan style=%7B%7B
+const appliedStyles = %7B%0A
...
@@ -602,16 +602,20 @@
es.base,
+%0A
...(dim
@@ -622,38 +622,103 @@
med
-&& s
+? themeS
tyles
-.
+%5B'
dimmed
-), ...styles %7D
+'%5D : %7B%7D),%0A ...styles,%0A %7D;%0A %0A return (%0A %3Cspan style=%7BappliedStyles
%7D%3E%7Bn
|
29b46bef4151ef17d4410aa08602ef3fffcc9996 | Return streams. | Gulpfile.js | Gulpfile.js | var gulp = require('gulp')
var coffee = require('gulp-coffee')
var concat = require('gulp-concat')
var prepend = require('gulp-insert').prepend
var shell = require('gulp-shell')
var uglify = require('gulp-uglify')
var rename = require('gulp-rename')
var fs = require('fs')
gulp.task('build', function() {
// Order here is important.
files = [
'./src/setup.coffee',
'./src/assert.coffee',
'./src/id_factory.coffee',
'./src/action.coffee',
'./src/dispatcher.coffee',
'./src/deferred_task.coffee',
'./src/store.coffee',
'./src/export.coffee'
]
gulp.src(files)
.pipe(concat('hippodrome.js'))
.pipe(coffee())
.pipe(gulp.dest('./dist'))
.pipe(uglify())
.pipe(rename('hippodrome.min.js'))
.pipe(gulp.dest('./dist'))
});
gulp.task('test', ['build'], shell.task([
'npm run test'
]))
gulp.task('watch', ['test'], function() {
gulp.watch('src/**/*.coffee', ['test']);
})
gulp.task('set-npm-version', function() {
version = require('./package.json').version;
pkg = fs.readFileSync('./npm/package.json')
pkgJson = JSON.parse(pkg)
pkgJson.version = version
fs.writeFileSync('./npm/package.json', JSON.stringify(pkgJson, null, 2))
})
gulp.task('copy-npm-javascript', function() {
gulp.src('dist/*.js')
.pipe(gulp.dest('./npm'))
})
gulp.task('prepare-npm', ['set-npm-version', 'copy-npm-javascript'])
gulp.task('set-gem-version', function() {
version = require('./package.json').version;
gemVersionModule = 'module Hippodrome\n VERSION = \'' + version + '\'\nend'
fs.writeFileSync('./rails/lib/hippodrome/version.rb', gemVersionModule)
})
gulp.task('copy-gem-javascript', function() {
gulp.src('dist/*/js')
.pipe(prepend('//= require lodash\n\n')) // Sprockets directive for rails.
.pipe(gulp.dest('./rails/app/assets/javascripts'))
})
gulp.task('prepare-gem', ['set-gem-version', 'copy-gem-javascript'])
gulp.task('set-bower-version', function() {
version = require('./package.json').version
bowerJson = JSON.parse(fs.readFileSync('./bower.json'))
bowerJson.version = version
fs.writeFileSync('./bower.json', JSON.stringify(bowerJson, null, 2))
})
gulp.task('copy-bower-javascript', function() {
gulp.src('dist/*.js')
.pipe(gulp.dest('./bower'))
})
gulp.task('prepare-bower', ['set-bower-version', 'copy-bower-javascript'])
gulp.task('commit-version-changes', ['prepare-gem', 'prepare-npm', 'prepare-bower'], function() {
version = require('./package.json').version;
gulp.src('')
.pipe(shell([
'git add npm/package.json rails/lib/hippodrome/version.rb ./bower.json bower/*.js',
'git commit -m "Build version ' + version + ' of hippodrome."'
]))
})
gulp.task('release-gem', ['commit-version-changes'], shell.task([
'rake build',
'rake release'
], {cwd: './rails'}))
// Strictly speaking, this doesn't depend on releasing the gem, but I want them
// to run in order.
gulp.task('publish-npm', ['release-gem'], shell.task([
'npm publish'
], {cwd: './npm'}))
// Pretend there's a publish-bower task here. We don't need it because
// release-gem will create and push the right tags for bower.
gulp.task('publish', ['publish-npm'])
| JavaScript | 0.000004 | @@ -1248,32 +1248,39 @@
function() %7B%0A
+return
gulp.src('dist/*
@@ -1277,32 +1277,39 @@
rc('dist/*.js')%0A
+
.pipe(gulp
@@ -1684,32 +1684,39 @@
function() %7B%0A
+return
gulp.src('dist/*
@@ -1717,24 +1717,31 @@
dist/*/js')%0A
+
.pipe(
@@ -1809,16 +1809,23 @@
rails.%0A
+
.p
@@ -2246,24 +2246,31 @@
ction() %7B%0A
+return
gulp.src('di
@@ -2275,24 +2275,31 @@
dist/*.js')%0A
+
.pipe(
|
5105d74cf9ac495557d553cc8363197b70fb358e | Fix bad check | script/check-version.js | script/check-version.js | #!/usr/bin/env node
var path = require('path');
var getBundledNodeVersion = require('./bundled-node-version')
var bundledNodePath = path.join(__dirname, '..', 'bin', 'node')
if (process.platform === 'win32') {
bundledNodePath += '.exe'
}
getBundledNodeVersion(bundledNodePath, function(err, bundledVersion) {
if (err) {
console.error(err);
process.exit(1);
}
var ourVersion = process.version
if (ourVersion !== bundledVersion) {
console.error('System node (' + ourVersion + ') does not match bundled node (' + bundledVersion + ').');
if (process.platform !== 'win32') {
console.error('Please use `.\\bin\\node.exe` to run node, and use `.\\bin\\npm.cmd` to run npm scripts.')
} else {
console.error('Please use `./bin/node` to run node, and use `./bin/npm` to run npm scripts.')
}
process.exit(1)
} else {
process.exit(0)
}
});
| JavaScript | 0.000042 | @@ -580,17 +580,17 @@
latform
-!
+=
== 'win3
|
45c5941cc81451eada0fb6f263a7ebca026cfec9 | Fix templating feature. | site/top/src/filetype.js | site/top/src/filetype.js | (function(top, module, define) {
function inferScriptType(filename) {
var mime = mimeForFilename(filename);
if (mime == 'text/x-pencilcode') {
mime = 'text/coffeescript';
}
return mime;
}
function wrapTurtle(text, pragmasOnly) {
var result, scripts = [], script_pattern =
/(?:^|\n)#[^\S\n]*@script[^\S\n<>]+(\S+|"[^"\n]*"|'[^'\n]*')/g;
// Add the default turtle script.
scripts.push(
'<script src="//' +
top.pencilcode.domain + '/turtlebits.js' +
'">\n<\057script>');
while (null != (result = script_pattern.exec(text))) {
scripts.push(
'<script src=' + result[1] +
' type="' + inferScriptType(result[1]) +
'">\n<\057script>');
}
result = (
'<!doctype html>\n<html>\n<body>' +
scripts.join('') +
'<script type="text/coffeescript">\n' +
'window.see && window.see.init(eval(window.see.cs))\n\n' +
(pragmasOnly ? '' : text) + '\n<\057script></body></html>');
return result;
}
function modifyForPreview(text, filename, targetUrl, pragmasOnly) {
var mimeType = mimeForFilename(filename);
if (mimeType && /^text\/x-pencilcode/.test(mimeType)) {
text = wrapTurtle(text, pragmasOnly);
mimeType = mimeType.replace(/\/x-pencilcode/, '/html');
}
if (!text) return '';
if (mimeType && !/^text\/html/.test(mimeType)) {
return '<PLAINTEXT>' + text;
}
if (targetUrl && !/<base/i.exec(text)) {
// Insert a <base href="target_url" /> in a good location.
var firstLink = text.match(
/(?:<link|<script|<style|<body|<img|<iframe|<frame|<meta|<a)\b/i),
insertLocation = [
text.match(/(?:<head)\b[^>]*>\n?/i),
text.match(/<html\b[^>]*>\n?/i),
text.match(/<\!doctype\b[^>]*>\n?/i)
],
insertAt = 0, j, match;
for (j = 0; j < insertLocation.length; ++j) {
match = insertLocation[j];
if (match && (!firstLink || match.index < firstLink.index)) {
insertAt = match.index + match[0].length;
break;
}
}
return text.substring(0, insertAt) +
'<base href="' + targetUrl + '" />\n' +
text.substring(insertAt);
}
return text;
}
function mimeForFilename(filename) {
var result = filename && filename.indexOf('.') > 0 && {
'jpg' : 'image/jpeg',
'jpeg' : 'image/jpeg',
'gif' : 'image/gif',
'png' : 'image/png',
'bmp' : 'image/x-ms-bmp',
'ico' : 'image/x-icon',
'htm' : 'text/html',
'html' : 'text/html',
'txt' : 'text/plain',
'text' : 'text/plain',
'css' : 'text/css',
'coffee' : 'text/coffeescript',
'js' : 'text/javascript',
'xml' : 'text/xml'
}[filename.replace(/^.*\./, '')]
if (!result) {
result = 'text/x-pencilcode';
}
if (/^text\//.test(result)) {
result += ';charset=utf-8';
}
return result;
}
var impl = {
mimeForFilename: mimeForFilename,
modifyForPreview: modifyForPreview,
wrapTurtle: wrapTurtle
};
if (module && module.exports) {
module.exports = impl;
} else if (define && define.amd) {
define(function() { return impl; });
}
})(
(typeof process) == 'object' ? process : window,
(typeof module) == 'object' && module,
(typeof define) == 'function' && define
);
| JavaScript | 0 | @@ -114,21 +114,15 @@
if (
-mime == '
+/%5E
text
+%5C
/x-p
@@ -130,17 +130,28 @@
ncilcode
-'
+/.test(mime)
) %7B%0A
|
9a16391c6a76f6e0c5d9f777ac2b3ab9913333f8 | add oninit vendor/jquery/plugins: init, moved jquery plugins here mainhtml: removed useage of ua specific css files, now use classes on <html> | eventHandlers/hashHandler.js | eventHandlers/hashHandler.js | /*
allows binding of events to hashchange, and will hashify urls so that they can be animated but still based on the non-javascript urls
-----parameters
-----instantiation
*/
/*-------
©hashHandler
-------- */
__.classes.hashHandler = function(arguments){
//--required attributes
//->return
//--optional attributes
this.elmsContainer = arguments.elmsContainer || null;
this.onhashchange = arguments.onhashchange || null;
this.selectorAnchors = arguments.selectorAnchors || "a";
//--derived attributes
var fncThis = this;
//--hashify urls
if(this.elmsContainer)
this.hashifyURLs(this.elmsContainer);
//--attach listener for hash change
if(this.onhashchange)
$(window).bind("hashchange", function(){
var url = location.hash || "/";
fncThis.onhashchange.call(fncThis, url);
});
}
__.classes.hashHandler.prototype.hashifyURLs = function(argContainers){
if(argContainers && argContainers.length > 0){
argContainers.find(this.selectorAnchors).add(argContainers.filter(this.selectorAnchors)).each(function(){
var elmThis = $(this);
var currentHref = elmThis.attr("href");
if(currentHref.substring(0,1) == "/")
elmThis.attr("href", "#"+currentHref);
});
}
}
| JavaScript | 0 | @@ -421,24 +421,66 @@
ge %7C%7C null;%0A
+%09%09this.oninit = arguments.oninit %7C%7C null;%0A
%09%09this.selec
@@ -856,16 +856,82 @@
%0A%09%09%09%7D);%0A
+%09%09%0A%09%09if(this.oninit)%0A%09%09%09this.oninit.call(fncThis, location.hash);%0A
%09%7D%0A%09__.c
|
f9745f3938fb58c4ebebd78de65889b6bc6e962b | Revert "console" | detectLanguage.js | detectLanguage.js |
(function(ext) {
console.log('in function');
var ext = this;
var apiKey="trnsl.1.1.20150605T132039Z.c660d54664d42d1d.3e02378e3b4f321ba39e2dee119909f8b402292a";
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
var langNames={"ar":"Arabic","az":"Azerbaijani","be":"Belarusian","bg":"Bulgarian","bs":"Bosnian","ca":"Catalan","cs":"Czech","da":"Danish","de":"German","el":"Greek","en":"English","es":"Spanish","et":"Estonian","fa":"Persian","fi":"Finnish","fr":"French","he":"Hebrew","hr":"Croatian","hu":"Hungarian","hy":"Armenian","id":"Indonesian","is":"Icelandic","it":"Italian","ja":"Japanese","ka":"Georgian","ko":"Korean","lt":"Lithuanian","lv":"Latvian","mk":"Macedonian","ms":"Malay","mt":"Maltese","nl":"Dutch","no":"Norwegian","pl":"Polish","pt":"Portuguese","ro":"Romanian","ru":"Russian","sk":"Slovak","sl":"Slovenian","sq":"Albanian","sr":"Serbian","sv":"Swedish","th":"Thai","tr":"Turkish","tt":"Tatar","uk":"Ukrainian","vi":"Vietnamese","zh":"Chinese"};
var names = [];
for(var n in langNames) names.push(n);
console.log(names);
ext.get_lang = function(text, callback){
console.log('setting key');
// var apiKey="trnsl.1.1.20150605T132039Z.c660d54664d42d1d.3e02378e3b4f321ba39e2dee119909f8b402292a";
console.log('starting ajax');
var urltext = "https://translate.yandex.net/api/v1.5/tr.json/detect?key="+apiKey+"&text="+text+"&callback=myCallback";
console.log(urltext);
$.ajax({
url: urltext,
dataType:'jsonp',
success: function(language_results){
langCode = language_results["lang"];
langName = langNames[langCode];
callback(langName);
}
});
};
// Block and block menu descriptions
var descriptor = {
blocks: [
// Block type, block name, function name, param1 default value, param2 default value
['R', 'language of %s', 'get_lang','Hello world'],
['R', 'translate %s from %m.langs to %m.langs', 'translate', 'Hola mundo', 'Spanish', 'English'],
]
};
menus: {
langs: names,
};
// Register the extension
ScratchExtensions.register('Detect Language', descriptor, ext);
})({});
| JavaScript | 0 | @@ -1274,31 +1274,8 @@
n);%0A
- console.log(names);
%0A
|
e810dc3aaf6e18157c5aa9ae2f1a2f6c877ee3d7 | correct filtering for boolean | src/admin/app/features/list/services/filterData.js | src/admin/app/features/list/services/filterData.js | import _ from 'lodash';
import moment from 'moment';
import {DATETIME, DATE, TIME, DEFAULT_DATE_FORMAT} from '../../shared/constants';
const itemValueByConfig = (itemValue, config) => {
switch (config.type) {
case DATETIME:
case DATE:
case TIME:
return moment(itemValue).format(config.format || DEFAULT_DATE_FORMAT).toLowerCase();
default:
return itemValue.toLowerCase();
}
};
export default (data, schema, filter) =>
_.reduce(filter, (result, value, key) =>
_.filter(result, item => {
const itemValue = item[key];
if (!itemValue) {
return value.length === 0;
}
const config = schema.map[key];
return itemValueByConfig(item[key], config).includes(value.toLowerCase());
}),
data
);
| JavaScript | 0.000105 | @@ -54,16 +54,19 @@
import %7B
+%0A
DATETIME
@@ -78,16 +78,27 @@
E, TIME,
+ BOOLEAN,%0A
DEFAULT
@@ -109,16 +109,18 @@
E_FORMAT
+,%0A
%7D from '
@@ -145,16 +145,63 @@
ants';%0A%0A
+const falseValues = %5B'f', 'false', 'n', '0'%5D;%0A%0A
const it
@@ -583,16 +583,54 @@
em =%3E %7B%0A
+ const config = schema.map%5Bkey%5D;%0A
co
@@ -652,24 +652,25 @@
item%5Bkey%5D;%0A
+%0A
if (!i
@@ -668,16 +668,203 @@
if (!
+value %7C%7C value.length === 0) %7B%0A return true;%0A %7D%0A%0A if (config.type === BOOLEAN) %7B%0A return falseValues.includes(value) ? !itemValue : itemValue;%0A %7D%0A%0A if (!
itemValu
@@ -915,46 +915,8 @@
%7D%0A
-%0A const config = schema.map%5Bkey%5D;
%0A
@@ -947,21 +947,21 @@
fig(item
-%5Bkey%5D
+Value
, config
|
ab8d34431ddded05ce7d99e5099dbf1b020b3312 | Make spaceholder constant less shouty. | tinylisp.js | tinylisp.js | ;(function(exports) {
var Ctx = function() {
this.first = function(x) {
return x[0];
};
this.rest = function(x) {
return x.slice(1);
};
this.print = function() {
var argsArray = Array.prototype.slice.call(arguments);
console.log(argsArray);
return argsArray;
};
};
var interpret = function(input, ctx) {
if (ctx === undefined) {
return interpret(input, new Ctx());
} else if (input.value !== undefined) {
return input.value;
} else {
if (input[0].type === "identifier") {
return ctx[input[0].value].apply(this, interpret(input.slice(1)));
} else {
return input.slice(0).map(function(x) {
return interpret(x);
});
}
}
};
var atDepth = function(output, depth) {
if (depth === 0) {
return output;
} else {
return atDepth(output[output.length - 1], depth - 1);
}
};
var type = function(input) {
if (!isNaN(parseFloat(input))) {
return { type:'number', value: parseFloat(input) };
} else if (input[0] === '"' && input.slice(-1) === '"') {
return { type:'string', value: input.slice(1, -1) };
} else {
return { type:'identifier', value: input };
}
};
var parenthesize = function(input) {
var output = [];
var depth = 0;
while (input.length > 0) {
var token = input.shift();
if (token === "(") {
atDepth(output, depth++).push([]);
} else if (token === ")") {
depth--;
} else {
atDepth(output, depth).push(type(token));
}
}
return output.pop();
};
var tokenize = function(input) {
return input.split('"').map(function(x, i) {
return i % 2 === 0 ? x : x.replace(/ /g, "!spaceholder!");
}).join('"')
.replace(/\(/g, ' ( ')
.replace(/\)/g, ' ) ')
.trim()
.split(/ +/)
.map(function(x) {
return x.replace(/!spaceholder!/, " ");
});
};
var parse = function(input) {
return parenthesize(tokenize(input));
};
exports.tinyLisp = {};
exports.tinyLisp.parse = parse;
exports.tinyLisp.interpret = interpret;
})(typeof exports === 'undefined' ? this : exports);
| JavaScript | 0.000097 | @@ -1772,17 +1772,16 @@
(/ /g, %22
-!
spacehol
@@ -1783,17 +1783,16 @@
ceholder
-!
%22);%0A
@@ -2019,17 +2019,16 @@
eplace(/
-!
spacehol
@@ -2034,10 +2034,10 @@
lder
-!
/
+g
, %22
|
a0780fed7ceb87a14a7c20f8dabd7ae600675870 | use a container to hold the physic editor shapes | examples/shapes/js/screens/play.js | examples/shapes/js/screens/play.js | game.PlayScreen = me.ScreenObject.extend({
/**
* action to perform on state change
*/
onResetEvent: function() {
// clear the background
me.game.world.addChild(new me.ColorLayer("background", "#5E3F66"), 0);
// add a few shapes
// physic-editor
me.game.world.addChild(new game.Circle(250, 200, {width: 50, height: 50}), 1);
me.game.world.addChild(new game.Poly(50, 75, {width: 200, height: 200, sprite:"hamburger"}), 2);
me.game.world.addChild(new game.Poly(50, 200, {width: 200, height: 200, sprite:"hotdog"}), 3);
me.game.world.addChild(new game.Poly(50, 350, {width: 200, height: 200, sprite:"icecream"}), 4);
me.game.world.addChild(new game.Poly(450, 100, {width: 200, height: 200, sprite:"icecream2"}), 5);
me.game.world.addChild(new game.Poly(350, 100, {width: 200, height: 200, sprite:"icecream3"}), 6);
// physic-body-editor
me.game.world.addChild(new game.Poly2(540, 50, {width: 256, height: 256, sprite:"test03"}), 7);
me.game.world.addChild(new game.Poly2(200, 275, {width: 300, height: 300, sprite:"test02"}), 8);
me.game.world.addChild(new game.Poly2(526, 325, {width: 256, height: 256, sprite:"test01"}), 9);
// display the current pointer coordinates on top of the pointer arrow
me.game.world.addChild(new (me.Renderable.extend({
init: function() {
this._super(me.Renderable, 'init', [0, 0, 10, 10]);
this.font = new me.Font("Arial", 10, "#FFFFFF");
this.font.textAlign = "center";
this.fontHeight = this.font.measureText(me.video.renderer, "DUMMY").height;
},
draw: function(renderer){
var x = Math.round(me.input.pointer.pos.x);
var y = Math.round(me.input.pointer.pos.y);
this.font.draw (
renderer,
"( " + x + "," + y + " )",
x,
y - this.fontHeight);
}
})), 10);
}
});
| JavaScript | 0 | @@ -275,26 +275,22 @@
w shapes
-%0A
%0A
+%0A
@@ -310,37 +310,115 @@
tor%0A
-me.game.world
+var physicEditorContainer = new me.Container(0, 0, 400, 600);%0A physicEditorContainer
.addChild(ne
@@ -435,14 +435,13 @@
cle(
-250, 2
+75, 5
00,
@@ -474,37 +474,45 @@
1);%0A
-me.game.world
+physicEditorContainer
.addChild(ne
@@ -587,37 +587,45 @@
2);%0A
-me.game.world
+physicEditorContainer
.addChild(ne
@@ -698,37 +698,45 @@
3);%0A
-me.game.world
+physicEditorContainer
.addChild(ne
@@ -811,37 +811,45 @@
4);%0A
-me.game.world
+physicEditorContainer
.addChild(ne
@@ -864,10 +864,10 @@
oly(
-45
+30
0, 1
@@ -926,37 +926,45 @@
5);%0A
-me.game.world
+physicEditorContainer
.addChild(ne
@@ -975,18 +975,18 @@
me.Poly(
-35
+20
0, 100,
@@ -1037,32 +1037,88 @@
%7D), 6);%0A
+me.game.world.addChild(physicEditorContainer);%0A %0A
%0A // phys
@@ -1123,14 +1123,14 @@
ysic
--
+
body
--
+
edit
@@ -1179,17 +1179,17 @@
.Poly2(5
-4
+0
0, 50, %7B
@@ -1446,16 +1446,17 @@
%7D), 9);%0A
+%0A
|
e8419eac193b759cddd23bab53e11bbf2dd1753e | Set up strict lint options. | jakefile.js | jakefile.js | /*global desc, task, jake, fail, complete */
"user strict";
task("default", ["lint"]);
desc("Lint everything");
task("lint", [], function(){
var lint = require("./build/lint/lint_runner.js");
var files = new jake.FileList();
files.include("**/*.js");
files.exclude("node_modules");
var options = {
node: true
};
lint.validateFileList(files.toArray(), options, {});
});
| JavaScript | 0 | @@ -42,14 +42,27 @@
*/%0A
-%0A
+(function()%7B%0A
%22use
-r
str
@@ -68,16 +68,18 @@
rict%22;%0A%0A
+
task(%22de
@@ -98,16 +98,18 @@
nt%22%5D);%0A%0A
+
desc(%22Li
@@ -125,16 +125,18 @@
hing%22);%0A
+
task(%22li
@@ -156,16 +156,18 @@
tion()%7B%0A
+
var li
@@ -215,11 +215,11 @@
%22);%0A
+%0A
-%0A
va
@@ -249,16 +249,18 @@
List();%0A
+
files.
@@ -279,16 +279,18 @@
*.js%22);%0A
+
files.
@@ -315,16 +315,18 @@
les%22);%0A%0A
+
var op
@@ -337,31 +337,29 @@
s =
-%7B%0A node: true%0A %7D;%0A%0A
+nodeLintOptions();%0A
li
@@ -409,12 +409,372 @@
s, %7B%7D);%0A
+
%7D);%0A
+%0A function nodeLintOptions()%7B%0A return %7B%0A bitwise: true,%0A curly: false,%0A eqeqeq: true,%0A forin: true,%0A immed: true,%0A latedef: true,%0A newcap: true,%0A noarg: true,%0A noempty: true,%0A nonew: true,%0A regexp: true,%0A undef: true,%0A strict: true,%0A trailing: true,%0A node: true%0A %7D;%0A %7D%0A%7D)();%0A
|
f092f4af505155bf3a64f7a2ea2f42dd4cc17078 | Rollback to 12 jobs | Gulpfile.js | Gulpfile.js | var gulp = require('gulp');
var qunitHarness = require('gulp-qunit-harness');
var Promise = require('pinkie');
var CLIENT_TESTS_SETTINGS = {
basePath: 'test',
port: 2000,
crossDomainPort: 2001,
};
var CLIENT_TESTS_BROWSERS = [
{
platform: 'Windows 10',
browserName: 'microsoftedge'
},
{
platform: 'Windows 10',
browserName: 'chrome'
},
{
browserName: 'chrome',
platform: 'OS X 10.11'
},
{
platform: 'Windows 10',
browserName: 'firefox'
},
{
browserName: 'firefox',
platform: 'OS X 10.11'
}
];
var SAUCELABS_SETTINGS = {
username: 'JohnSilverM',
accessKey: '5ac1ea58-8ea0-4f15-a0c9-1e41786bcc51',
build: process.env.TRAVIS_JOB_ID || '',
tags: [process.env.TRAVIS_BRANCH || 'master'],
browsers: CLIENT_TESTS_BROWSERS,
name: 'qunit browserJob tests',
timeout: 720
};
gulp.task('test-local', function () {
return gulp
.src('test/**/*-test.js')
.pipe(qunitHarness(CLIENT_TESTS_SETTINGS));
});
gulp.task('test-remote', function () {
return gulp
.src('test/**/*-test.js')
.pipe(qunitHarness(CLIENT_TESTS_SETTINGS, SAUCELABS_SETTINGS));
});
gulp.task('travis', [process.env.GULP_TASK || '']); | JavaScript | 0 | @@ -685,24 +685,951 @@
S X 10.11'%0D%0A
+ %7D,%0D%0A %7B%0D%0A platform: 'Windows 10',%0D%0A browserName: 'internet explorer',%0D%0A version: '11.0'%0D%0A %7D,%0D%0A %7B%0D%0A platform: 'Windows 8',%0D%0A browserName: 'internet explorer',%0D%0A version: '10.0'%0D%0A %7D,%0D%0A %7B%0D%0A platform: 'Windows 7',%0D%0A browserName: 'internet explorer',%0D%0A version: '9.0'%0D%0A %7D,%0D%0A %7B%0D%0A platform: 'Linux',%0D%0A browserName: 'android',%0D%0A version: '5.1',%0D%0A deviceName: 'Android Emulator'%0D%0A %7D,%0D%0A %7B%0D%0A browserName: 'safari',%0D%0A platform: 'OS X 10.10',%0D%0A version: '8.0'%0D%0A %7D,%0D%0A %7B%0D%0A browserName: 'iphone',%0D%0A platform: 'OS X 10.10',%0D%0A version: '8.1',%0D%0A deviceName: 'iPad Simulator'%0D%0A %7D,%0D%0A %7B%0D%0A browserName: 'iphone',%0D%0A platform: 'OS X 10.10',%0D%0A version: '9.1',%0D%0A deviceName: 'iPhone 6 Plus'%0D%0A
%7D%0D%0A%5D;%0D%0A%0D
|
7e7e9f0ac15cadb462a20969ccda86e67ee4cd69 | Use request helper to download node | script/download-node.js | script/download-node.js | #!/usr/bin/env node
var fs = require('fs');
var mv = require('mv');
var zlib = require('zlib');
var path = require('path');
var request = require('request');
var tar = require('tar');
var temp = require('temp');
temp.track();
var downloadFileToLocation = function(url, filename, callback) {
var stream = fs.createWriteStream(filename);
stream.on('end', callback);
stream.on('error', callback);
return request(url).pipe(stream);
};
var downloadTarballAndExtract = function(url, location, callback) {
var tempPath = temp.mkdirSync('apm-node-');
var stream = tar.Extract({
path: tempPath
});
stream.on('end', callback.bind(this, tempPath));
stream.on('error', callback);
var requestOptions = {
url: url,
proxy: process.env.http_proxy || process.env.https_proxy
};
return request(requestOptions).pipe(zlib.createGunzip()).pipe(stream);
};
var copyNodeBinToLocation = function(callback, version, targetFilename, fromDirectory) {
var arch = process.arch === 'ia32' ? 'x86' : process.arch;
var subDir = "node-" + version + "-" + process.platform + "-" + arch;
var fromPath = path.join(fromDirectory, subDir, 'bin', 'node');
return mv(fromPath, targetFilename, function(err) {
if (err) {
callback(err);
return;
}
fs.chmod(targetFilename, "755", callback);
});
};
var downloadNode = function(version, done) {
var arch, downloadURL, filename;
if (process.platform === 'win32') {
arch = process.arch === 'x64' ? 'x64/' : '';
downloadURL = "http://nodejs.org/dist/" + version + "/" + arch + "node.exe";
filename = path.join('bin', "node.exe");
} else {
arch = process.arch === 'ia32' ? 'x86' : process.arch;
downloadURL = "http://nodejs.org/dist/" + version + "/node-" + version + "-" + process.platform + "-" + arch + ".tar.gz";
filename = path.join('bin', "node");
}
if (fs.existsSync(filename)) {
done();
return;
}
if (process.platform === 'win32') {
return downloadFileToLocation(downloadURL, filename, done);
} else {
var next = copyNodeBinToLocation.bind(this, done, version, filename);
return downloadTarballAndExtract(downloadURL, filename, next);
}
};
downloadNode('v0.10.26', function(error) {
if (error != null) {
console.error('Failed to download node', error);
return process.exit(1);
} else {
return process.exit(0);
}
});
| JavaScript | 0 | @@ -117,19 +117,295 @@
path');%0A
-var
+%0A// Use whichever version of the local request helper is available%0A// This might be the JavaScript or CoffeeScript version depending%0A// on whether this module is being installed explictly or%0A// %60npm install%60 is being run at the root of the repository.%0Avar request = null;%0Atry %7B%0A
request
@@ -416,16 +416,23 @@
equire('
+../lib/
request'
@@ -430,24 +430,123 @@
/request');%0A
+%7D catch (error) %7B%0A require('coffee-script').register();%0A request = require('../src/request');%0A%7D%0A%0A
var tar = re
@@ -1074,143 +1074,88 @@
;%0A
-var
request
-Options = %7B%0A url: url,%0A proxy: process.env.http_proxy %7C%7C process.env.https_proxy%0A %7D;%0A return request(requestOptions)
+.createReadStream(%7Burl: url%7D, function(requestStream) %7B%0A requestStream
.pip
@@ -1183,32 +1183,38 @@
).pipe(stream);%0A
+ %7D);%0A
%7D;%0A%0Avar copyNode
|
628f89902e46480371b1846dcb53d62461c516cc | Stop depending on "logs" directory | newrelic.js | newrelic.js | /**
* New Relic agent configuration.
*
* See lib/config.defaults.js in the agent distribution for a more complete
* description of configuration variables and their potential values.
*/
exports.config = {
/**
* Array of application names.
*/
app_name : ['Data Dashboard (' + process.env.NEW_RELIC_ENVIRONMENT + ')'],
/**
* Your New Relic license key.
*/
license_key : process.env.NEW_RELIC_LICENSE_KEY,
logging : {
/**
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
* issues with the agent, 'info' and higher will impose the least overhead on
* production applications.
*/
level : 'info',
filepath : require('path').join(process.cwd(), 'logs', 'newrelic_agent.log')
}
};
| JavaScript | 0 | @@ -722,16 +722,8 @@
d(),
- 'logs',
'ne
|
788237ca6101e2def417aa4e5d781327ec544ba9 | abort if signalr connection doesn't come up | RightpointLabs.ConferenceRoom.StatusMonitor/index.js | RightpointLabs.ConferenceRoom.StatusMonitor/index.js | var fs = require('fs');
var http = require('http');
var url = require('url');
var Promise = require('promise');
var signalR = require('signalr-client');
var path = require('path');
var pwm = require('pi-blaster.js');
var configFile = path.join(__dirname, 'config.json');
console.log('Loading configuration from ' + configFile);
var config = JSON.parse(fs.readFileSync(configFile));
var LedManager = require('./ledManager.js');
var led = new LedManager(config);
// test colors
led.setColor(0, 0, 0, 0);
led.setColor(1, 0, 0, 400);
setTimeout(function() {
led.setColor(0, 1, 0, 400);
setTimeout(function() {
led.setColor(0, 0, 1, 400);
setTimeout(function() {
// and start
led.setColor(0, 0, 0, 400);
setTimeout(function() {
updateIn(1);
start();
}, 500);
}, 500);
}, 500);
}, 500);
function getStatus() {
return new Promise(function(resolve, reject) {
var options = url.parse(config.apiServer + "/room/" + config.room + "/status");
options.method = "GET";
return http.request(options, function(e) {
data = "";
e.on('data', function(c) { data += String(c); });
e.on('end', function() { resolve(data); });
}).end();
})
}
var applyInterval = null;
var updateTimeout = null;
function updateIn(delay) {
if(null != updateTimeout){
clearTimeout(updateTimeout);
}
updateTimeout = setTimeout(function() {
getStatus().then(function(data) {
var obj = JSON.parse(data);
var status = obj.Status;
if(null != applyInterval) {
clearInterval(applyInterval);
applyInterval = null;
}
var lastApply = new Date().getTime();
function apply() {
var thisApply = new Date().getTime();
obj.RoomNextFreeInSeconds -= (thisApply - lastApply) / 1000;
lastApply = thisApply;
switch(status) {
case 0:
green();
break;
case 1:
if(obj.RoomNextFreeInSeconds < 600) {
orange();
} else {
red();
}
break;
case 2:
if(obj.CurrentMeeting && obj.CurrentMeeting.IsNotManaged) {
// non-managed meetings don't need to be started
red();
} else {
// this is a managed meeting that's on the verge of getting auto-cancelled - look wierd.
purple();
}
break;
default:
console.log('invalid status: ' + status);
break;
}
}
apply();
if(status == 1) {
applyInterval = setInterval(apply, 10000);
}
if(obj.NextChangeSeconds) {
updateIn((obj.NextChangeSeconds + 1) * 1000); // server advises us to check back at this time
}
});
}, delay);
}
function purple() {
console.log('purple');
led.setCycle([
{ state: { red: 1, green: 0, blue: 0 }, duration: 200 },
{ state: { red: 1, green: 0, blue: 0 }, duration: 2000 },
{ state: { red: 0.625, green: 0.125, blue: 0.9375 }, duration: 200 }
]);
}
function orange() {
console.log('orange');
led.setCycle([
{ state: { red: 1, green: 0, blue: 0 }, duration: 200 },
{ state: { red: 1, green: 0, blue: 0 }, duration: 5000 },
{ state: { red: 1, green: 0.5, blue: 0 }, duration: 200 }
]);
}
function red() {
console.log('red');
led.setColor(1, 0, 0, 1000);
}
function green() {
console.log('green');
led.setColor(0, 1, 0, 1000);
}
function start() {
setInterval(function() {
updateIn(5000);
}, 5 * 60 * 1000);
var client = new signalR.client(
config.signalRServer,
['UpdateHub']
);
client.on('UpdateHub', 'Update', function(room) {
console.log('got notification of change to ' + room);
if(config.room == room) {
updateIn(1);
}
});
client.serviceHandlers.connected = function() {
console.log('signalR connected');
};
client.serviceHandlers.connectionLost = function() {
console.log('signalR connection lost');
};
client.serviceHandlers.connectFailed = function() {
console.log('signalR connection failed');
};
client.serviceHandlers.reconnecting = function() {
console.log('signalR reconnecting');
return true;
};
client.serviceHandlers.reconnected = function() {
console.log('signalR reconnected');
};
client.serviceHandlers.onerror = function(error) {
console.log('signalR error: ' + error);
};
}
// wait
| JavaScript | 0.000001 | @@ -4147,16 +4147,210 @@
* 1000);
+%0A var gotConnected = false;%0A setTimeout(function() %7B%0A if(!gotConnected) %7B%0A console.log('Aborting - no connection');%0A process.exit(-1);%0A %7D%0A %7D, 30000);
%0A%0A va
@@ -4677,32 +4677,61 @@
= function() %7B%0A
+ gotConnected = true;%0A
console.
@@ -5092,9 +5092,16 @@
');%0A
-%09
+
retu
|
5707b4f93a1a93b4a9609311fd1829d9854617dc | update Dropdown | src/dropdown/Dropdown.js | src/dropdown/Dropdown.js | import React from 'react';
import Select from 'react-select';
import omit from 'lodash/object/omit';
import { warn } from '../utils/log';
const themes = {
semantic: 'semantic-theme'
};
const PropTypes = {
children: React.PropTypes.oneOfType([
React.PropTypes.node,
React.PropTypes.element,
React.PropTypes.array
]),
theme: React.PropTypes.oneOf(['semantic']),
valueLink: React.PropTypes.shape({
value: React.PropTypes.string,
requestChange: React.PropTypes.func
})
};
const Dropdown = React.createClass({
propTypes: PropTypes,
getChildren() {
return [].concat(this.props.children || []);
},
renderOption(option) {
return this.getChildren()[option.value];
},
renderValue(option) {
return this.getChildren()[option.value];
},
getGeneralProps() {
if (this.props.children && this.props.options) {
warn('You\'re passing both children and options. Children will override options!');
}
return omit(this.props, Object.keys(PropTypes));
},
getChildrenProps() {
if (this.props.children) {
const options = this.getChildren().map((c, index) => {
return {
value: index,
label: index
};
});
return {
options,
valueRenderer: this.renderValue,
optionRenderer: this.renderOption
};
}
},
getValueLinkProps() {
if (this.props.valueLink) {
return {
value: this.props.valueLink.value,
onChange: this.props.valueLink.requestChange
};
}
},
getClassName() {
return {
className: [this.props.className, themes[this.props.theme]].join(' ')
};
},
render() {
// The order is important: props may override previous ones
return (
<Select
{...this.getGeneralProps()}
{...this.getChildrenProps()}
{...this.getValueLinkProps()}
{...this.getClassName()}
/>
);
}
});
export default Dropdown;
| JavaScript | 0.000001 | @@ -90,24 +90,53 @@
ject/omit';%0A
+import cx from 'classnames';%0A
import %7B war
@@ -529,47 +529,73 @@
%7D;%0A%0A
-const Dropdown = React.createClass(%7B%0A%0A
+export default class Dropdown extends React.Component %7B%0A%0A static
pro
@@ -600,17 +600,18 @@
ropTypes
-:
+ =
PropTyp
@@ -612,17 +612,16 @@
ropTypes
-,
%0A%0A getC
@@ -627,31 +627,24 @@
Children
-() %7B%0A return
+ = () =%3E
%5B%5D.conc
@@ -672,22 +672,16 @@
n %7C%7C %5B%5D)
-;%0A %7D,
%0A%0A rend
@@ -688,16 +688,19 @@
erOption
+ =
(option)
@@ -696,36 +696,26 @@
= (option)
-%7B%0A return
+=%3E
this.getChi
@@ -731,30 +731,24 @@
ption.value%5D
-;%0A %7D,
%0A%0A renderVa
@@ -750,16 +750,19 @@
derValue
+ =
(option)
@@ -762,28 +762,18 @@
option)
-%7B%0A return
+=%3E
this.ge
@@ -797,22 +797,16 @@
n.value%5D
-;%0A %7D,
%0A%0A getG
@@ -812,26 +812,32 @@
GeneralProps
-()
+ = () =%3E
%7B%0A if (t
@@ -1028,25 +1028,24 @@
Types));%0A %7D
-,
%0A%0A getChild
@@ -1048,26 +1048,32 @@
hildrenProps
-()
+ = () =%3E
%7B%0A if (t
@@ -1370,25 +1370,24 @@
%7D;%0A %7D%0A %7D
-,
%0A%0A getValue
@@ -1395,18 +1395,24 @@
inkProps
-()
+ = () =%3E
%7B%0A i
@@ -1563,25 +1563,24 @@
%7D;%0A %7D%0A %7D
-,
%0A%0A getClass
@@ -1587,44 +1587,20 @@
Name
-() %7B%0A return %7B%0A className: %5B
+ = () =%3E cx(
this
@@ -1645,31 +1645,9 @@
eme%5D
-%5D.join(' ')%0A %7D;%0A %7D,
+)
%0A%0A
@@ -1918,33 +1918,5 @@
%7D%0A%0A%7D
-);%0A%0Aexport default Dropdown;
%0A
|
7a6c955d546b94ed7e7e4e4d6ecaee03dfafad48 | Use 8001 port instead of 8000 to be reverse proxied over 9090 | example/nodejs/LocalProxy.js | example/nodejs/LocalProxy.js | /*
This script runs a reverse proxy on http://localhost:9090/ to the actual backend http://localhost:8000/aws-mock/ec2-endpoint/
*/
'use strict';
var httpProxy = require('http-proxy'),
options = {
router: {
'localhost/': 'http://localhost:8000/aws-mock/ec2-endpoint/'
}
},
proxyServer = httpProxy.createServer(options);
proxyServer.listen(9090);
console.log("Proxy running on http://localhost:9090/");
| JavaScript | 0.000001 | @@ -241,33 +241,33 @@
://localhost:800
-0
+1
/aws-mock/ec2-en
|
ef75314e2bbc9a6cedb24bd82b91fe13bdd90e03 | Add some faker generated data :zap: | examples/todo-app/kakapo-config.js | examples/todo-app/kakapo-config.js | (function() {
'use strict';
const router = new Kakapo.Router();
const db = new Kakapo.Database();
db.register('todo', () => {
return {
title: 'Use Kakapo.js',
done: false
};
});
db.create('todo', 1);
router.get('/todos', () => {
return db.all('todo');
});
router.post('/todos', (request) => {
const todo = JSON.parse(request.body);
return db.push('todo', todo);
});
router.put('/todos/:todo_id', (request) => {
const updatedTodo = JSON.parse(request.body);
const id = parseInt(request.params.todo_id);
const todo = db.findOne('todo', {id});
Object.keys(updatedTodo).forEach(k => {
todo[k] = updatedTodo[k];
});
todo.save();
return todo;
});
router.delete('/todos/:todo_id', (request) => {
const id = parseInt(request.params.todo_id);
const todo = db.findOne('todo', {id});
todo.delete();
return db.all('todo');
});
})(); | JavaScript | 0 | @@ -117,24 +117,29 @@
er('todo', (
+faker
) =%3E %7B%0A r
@@ -163,42 +163,68 @@
le:
-'Use Kakapo.js',%0A done: false
+faker.company.companyName,%0A done: faker.random.boolean,
%0A
@@ -233,20 +233,16 @@
;%0A %7D);%0A
-
%0A db.cr
@@ -740,20 +740,16 @@
save();%0A
-
%0A ret
@@ -966,8 +966,9 @@
);%0A%7D)();
+%0A
|
0677809279c8a48200918631af384d940c1802c1 | fix example doc page title | dev/metalsmith.js | dev/metalsmith.js | 'use strict';
const Metalsmith = require('metalsmith');
const layouts = require('metalsmith-layouts');
const prism = require('metalsmith-prism');
const marked = require('marked');
const markdown = require('metalsmith-markdown');
const inPlace = require('metalsmith-in-place');
const mock = require('metalsmith-mock');
const permalinks = require('metalsmith-permalinks');
const nunjucks = require('nunjucks');
const nunjucksDate = require('nunjucks-date');
const path = require('path');
const collections = require('metalsmith-collections');
const filter = require('metalsmith-filter');
const relative = require('metalsmith-rootpath');
const dataMarkdown = require('./plugins/metalsmith-data-markdown');
const slug = require('./plugins/nunjucks-slug');
const tocify = require('./plugins/metalsmith-tocify');
const Logger = require('./logger');
const pkg = require('../package.json');
const markedOptions = {
langPrefix: 'language-',
renderer: new marked.Renderer(),
gfm: true,
tables: true
};
nunjucksDate
.setDefaultFormat('YYYY');
const env = nunjucks.configure('examples/layouts', {watch: false, noCache: true});
env.addFilter('year', nunjucksDate);
env.addFilter('slug', slug.slugify);
function build() {
return new Promise((resolve, reject) => {
const metalsmith = new Metalsmith(path.join(process.cwd(), 'examples'));
metalsmith
.metadata({
site: {
title: 'Availity UIKit'
},
today: new Date(),
pkg
})
.ignore('**/.DS_Store')
.source(path.join(process.cwd(), 'examples', 'content'))
.use(markdown(markedOptions))
.use(dataMarkdown({
selector: '[data-markdown]'
}))
.use(prism({
decode: true
}))
.use(mock())
.use(collections({
pages: {
pattern: 'pages/**/*.html',
reverse: false
},
components: {
pattern: 'components/**/*.html',
sortBy: 'title',
refer: false
},
examples: {
pattern: 'examples/**/*.html',
sortBy: 'title',
reverse: true,
refer: false
},
javascript: {
pattern: 'javascript/**/*.html',
sortBy: 'title',
reverse: true,
refer: false
}
}))
.use(permalinks({
relative: false
}))
.use(relative())
.use(inPlace({
engine: 'nunjucks',
partials: 'layouts/partials'
}))
.use(tocify({selector: '.docs-section-header, .docs-subsection-title'}))
.use(layouts({
engine: 'nunjucks',
directory: 'layouts'
}))
.use(filter(['index.html', 'pages/**/*.html', 'examples/**/*.html']))
.destination(path.join(process.cwd(), 'build'));
metalsmith.build( (err) => {
if (err) {
reject(err);
} else {
Logger.ok('metalsmith');
resolve();
}
});
});
}
module.exports = build;
| JavaScript | 0.000002 | @@ -1422,13 +1422,15 @@
ity
-UIKit
+Angular
'%0A
|
149587df812ff00b5496c8c355a727fe9bfd489c | Remove outdated TODO | admin/client/App/screens/List/actions/active.js | admin/client/App/screens/List/actions/active.js | import {
ADD_FILTER,
CLEAR_FILTER,
CLEAR_ALL_FILTERS,
SET_ACTIVE_SEARCH,
SET_ACTIVE_SORT,
SET_ACTIVE_COLUMNS,
SET_ACTIVE_LIST,
} from '../constants';
import { setCurrentPage } from '../actions';
/**
* Active actions
*/
export function setActiveSearch (searchString) {
return {
type: SET_ACTIVE_SEARCH,
searchString,
};
}
export function setActiveSort (path) {
return (dispatch, getState) => {
// TODO Decouple from state somehow
const list = getState().lists.currentList;
const sort = list.expandSort(path);
dispatch({
type: SET_ACTIVE_SORT,
sort,
});
};
}
export function setActiveColumns (columns) {
// TODO Figure out why we needed below checks in CurrentListSotre and
// add them back in
// if (Array.isArray(columns)) columns = columns.join(',');
// if (columns === _list.defaultColumnPaths) columns = undefined;
return (dispatch, getState) => {
// TODO Decouple from state somehow
const list = getState().lists.currentList;
const expandedColumns = list.expandColumns(columns);
dispatch({
type: SET_ACTIVE_COLUMNS,
columns: expandedColumns,
});
};
}
export function setActiveList (list) {
return {
type: SET_ACTIVE_LIST,
list,
};
}
/**
* Filtering actions
*/
function addFilter (filter) {
return {
type: ADD_FILTER,
filter,
};
}
export function clearFilter (path) {
return {
type: CLEAR_FILTER,
path,
};
}
export function clearAllFilters () {
return {
type: CLEAR_ALL_FILTERS,
};
}
export function setFilter (path, value) {
return (dispatch, getState) => {
const state = getState();
const activeFilters = state.active.filters;
const currentList = state.lists.currentList;
// Get current filter
let filter = activeFilters.filter(i => i.field.path === path)[0];
// If a filter exists already, update its value
if (filter) {
filter.value = value;
// Otherwise construct a new one
} else {
const field = currentList.fields[path];
if (!field) {
console.warn('Invalid Filter path specified:', path);
return;
}
filter = {
field,
value,
};
}
dispatch(addFilter(filter));
dispatch(setCurrentPage(1));
};
}
| JavaScript | 0.000032 | @@ -635,228 +635,8 @@
) %7B%0A
-%09// TODO Figure out why we needed below checks in CurrentListSotre and%0A%09// add them back in%0A%09// if (Array.isArray(columns)) columns = columns.join(',');%0A%09// if (columns === _list.defaultColumnPaths) columns = undefined;%0A
%09ret
|
461ee275907fa077e78a273dc3554e3174af6bd9 | fix jshint warning for newrelic config | newrelic.js | newrelic.js | /**
* New Relic agent configuration.
*
* See lib/config.defaults.js in the agent distribution for a more complete
* description of configuration variables and their potential values.
*
* https://docs.newrelic.com/docs/nodejs/configuring-nodejs-with-environment-variables
*/
exports.config = {
app_name : ['JSONP'],
logging : {
filepath : 'stdout'
}
};
| JavaScript | 0 | @@ -274,16 +274,52 @@
les%0A */%0A
+/*jshint node:true, strict:false */%0A
exports.
|
54f705537a0b780c72aa0dc8479bf5e9e20b4b7f | Add dynamic options | src/options/flat_opts.js | src/options/flat_opts.js | 'use strict';
const { assignArray } = require('../utilities');
// Get `flatOpts`, i.e. all options in a flat array
// Recursively validate each option, including intermediate objects
// in object chains
const getFlatOpts = function ({ prefix = '', options, availableOpts }) {
if (!options || options.constructor !== Object) { return []; }
return Object.entries(options)
.map(([optName, optVal]) =>
getFlatOpt({ prefix, optName, optVal, availableOpts }))
.reduce(assignArray, []);
};
const getFlatOpt = function ({ prefix, optName, optVal, availableOpts }) {
const name = `${prefix}${optName}`;
// Retrieve from `availableOptions`
const availableOpt = availableOpts.find(({ name: nameA }) => nameA === name);
if (!availableOpt) {
return [{ name, unknown: true }];
}
const { validate = {}, subConfFiles } = availableOpt;
const flatOpt = [{ name, validate, optVal }];
// Sub-conf options do not recurse
// E.g. schema is a sub-conf which resolves to an object, but schema
// properties are not options themselves
if (subConfFiles !== undefined) { return flatOpt; }
const children = getFlatOpts({
prefix: `${name}.`,
options: optVal,
availableOpts,
});
return [...flatOpt, ...children];
};
module.exports = {
getFlatOpts,
};
| JavaScript | 0.000026 | @@ -833,16 +833,25 @@
onfFiles
+, dynamic
%7D = ava
@@ -1062,16 +1062,57 @@
mselves%0A
+ // Dynamic options also do not recurse%0A
if (su
@@ -1135,16 +1135,27 @@
ndefined
+ %7C%7C dynamic
) %7B retu
|
528ceb812c94022e161dd898f04b080daaa99099 | Fix translation error status reason #6700 | src/app/components/media/MediaTranslationStatus.js | src/app/components/media/MediaTranslationStatus.js | import React, { Component } from 'react';
import Relay from 'react-relay';
import { injectIntl, FormattedMessage } from 'react-intl';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import TextField from 'material-ui/TextField';
import CreateDynamicMutation from '../../relay/mutations/CreateDynamicMutation';
import UpdateDynamicMutation from '../../relay/mutations/UpdateDynamicMutation';
import MediaStatusCommon from './MediaStatusCommon';
class MediaStatus extends Component {
static setStatus(context, store, media, status, parentComponent, note_) {
const note = note_ || '';
if (status === 'error' && parentComponent && !parentComponent.state.open) {
parentComponent.setState({
setStatus: {
context, store, media, status,
},
});
parentComponent.handleOpen();
return;
}
const onFailure = (transaction) => {
context.fail(transaction);
};
const onSuccess = () => {
context.success('status');
};
let status_id = null;
if (media.translation_status !== null) {
status_id = media.translation_status.id;
}
// Update existing status
if (status_id != null) {
const vars = {
annotated: media,
parent_type: 'project_media',
dynamic: {
id: status_id,
fields: {
translation_status_status: status,
translation_status_note: note,
},
},
};
Relay.Store.commitUpdate(new UpdateDynamicMutation(vars), { onSuccess, onFailure });
} else {
// Create new status
const vars = {
parent_type: 'project_media',
annotated: media,
annotation: {
annotation_type: 'translation_status',
annotated_type: 'ProjectMedia',
annotated_id: media.dbid,
fields: {
translation_status_status: status,
translation_status_note: note,
},
},
};
Relay.Store.commitUpdate(new CreateDynamicMutation(vars), { onSuccess, onFailure });
}
}
constructor(props) {
super(props);
this.state = {
open: false,
submitted: false,
setStatus: {},
};
}
handleOpen() {
this.setState({ open: true });
}
handleClose() {
this.setState({ open: false });
}
resetState() {
this.setState({ open: false, submitted: false, setStatus: {} });
}
handleKeyPress(e) {
if (e.key === 'Enter' && !e.shiftKey && !this.state.submitted) {
this.setState({ submitted: true });
const st = Object.assign({}, this.state.setStatus);
this.setStatus(st.context, st.store, st.media, st.status, this, e.target.value);
document.forms['media-status-note-form'].note.value = '';
this.resetState();
e.preventDefault();
}
}
render() {
const actions = [
<FlatButton
label={<FormattedMessage id="mediaStatus.cancelMessage" defaultMessage="Cancel" />}
secondary
onClick={this.handleClose.bind(this)}
/>,
];
return (
<span>
<Dialog
title={null}
actions={actions}
modal={false}
open={this.state.open}
onRequestClose={this.handleClose.bind(this)}
>
<p>
<FormattedMessage
id="mediaStatus.messageDescription"
defaultMessage="Please add a comment. it will be sent back to the original poster to inform them that their request will be closed."
/>
</p>
<form name="media-status-note-form">
<TextField
className="media-status--note"
name="note"
onKeyPress={this.handleKeyPress.bind(this)}
errorText={
<FormattedMessage
id="mediaStatus.noteHint"
defaultMessage="Press ENTER to submit"
/>
}
errorStyle={{ color: '#757575' }}
autoFocus
fullWidth
multiLine
/>
</form>
</Dialog>
<MediaStatusCommon
{...this.props}
parentComponent={this}
setStatus={MediaStatus.setStatus}
/>
</span>
);
}
}
export default injectIntl(MediaStatus);
| JavaScript | 0.000001 | @@ -2634,27 +2634,34 @@
tus);%0A
-thi
+MediaStatu
s.setStatus(
|
17e2412b8d4b065d3ae34f9cb6acb2c5c4fc2c20 | fix leads and customers link in menu | js/menu.js | js/menu.js | export default function (nga, admin) {
return nga.menu()
.addChild(nga.menu()
.title('Visitors')
.icon('<span class="fa fa-users fa-fw"></span>')
.active(path => path.indexOf('/customers') === 0) // active() is the function that determines if the menu is active
.addChild(nga.menu()
.title('Leads')
.link('/customers/list?search={"has_ordered":"false"}') // use the same entity list for several menu items
.icon('<span class="fa fa-user-times fa-fw"></span>')) // no active() function => will never appear active
.addChild(nga.menu()
.title('Customers')
.link('/customers/list?search={"has_ordered":"true"}') // use the same entity list for several menu items
.icon('<span class="fa fa-user fa-fw"></span>'))
.addChild(nga.menu()
.title('Segments')
.link('/segments') // this state isn't handled by ng-admin - no problem
.active(path => path == '/segments')
.icon('<span class="fa fa-scissors fa-fw"></span>'))
)
.addChild(nga.menu()
.title('Sales')
.icon('<span class="fa fa-shopping-cart fa-fw"></span>')
.active(path => path.indexOf('/commands') === 0)
.addChild(nga.menu()
.title('Orders')
.link('/commands/list?search={"status":"ordered"}')
.icon('<span class="fa fa-credit-card fa-fw"></span>'))
.addChild(nga.menu()
.title('Invoices')
.link('/commands/list?search={"status":"delivered"}')
.icon('<span class="fa fa-usd fa-fw"></span>'))
.addChild(nga.menu()
.title('Cancels')
.link('/commands/list?search={"status":"cancelled"}')
.icon('<span class="fa fa-hand-o-left fa-fw"></span>'))
)
.addChild(nga.menu()
.title('Catalog')
.icon('<span class="fa fa-th-list fa-fw"></span>')
.addChild(nga.menu(admin.getEntity('products')) // nga.menu(entity) sets defaults title, link and active values correctly
.icon('<span class="fa fa-picture-o fa-fw"></span>'))
.addChild(nga.menu(admin.getEntity('categories'))
.icon('<span class="fa fa-tags fa-fw"></span>'))
)
.addChild(nga.menu(admin.getEntity('reviews'))
.icon('<span class="fa fa-comments fa-fw"></span>'))
.addChild(nga.menu()
.title('Configuration')
.icon('<span class="fa fa-cog fa-fw"></span>')
.link('/settings/show/1')
.active(path => path.indexOf('/settings') === 0)
)
;
}
| JavaScript | 0 | @@ -433,15 +433,13 @@
ed%22:
-%22
false
-%22
%7D')
@@ -746,14 +746,12 @@
ed%22:
-%22
true
-%22
%7D')
|
8ed7b1b1fe93c274e4ecb283a2052f680e2e43fc | Align the instructions page better for fewer collisions | js/menu.js | js/menu.js | MENU = {
}
MENU.setup = function() {
width = 500;
height = 500;
menuArea = document.getElementById('menuarea');
menuArea.style.width = width;
menuArea.style.height = height;
menuHeader = document.getElementById('menuheader');
menuHeader.style.position = "absolute";
menuHeader.style.left = width/2 - 70 + 'px';
menuHeader.style.top = 80;
buttons = document.getElementsByClassName('menubutton');
buttons[0].style.position = "absolute";
buttons[1].style.position = "absolute";
buttons[0].style.left = width/2;
buttons[0].style.top = height/2 - 50;
buttons[0].style.fontSize = "x-large";
buttons[0].onclick = function() {
MENU.play();
};
buttons[1].style.left = width/2 - 37;
buttons[1].style.top = height/2 + 50;
buttons[1].style.fontSize = "x-large";
buttons[1].onclick = function() {
MENU.instructions();
};
var instrArea = document.getElementById('instrarea');
instrArea.style.width = width;
instrArea.style.height = height;
var instrHeader = document.getElementById('instrheader');
instrHeader.style.position = "absolute";
instrHeader.style.left = width/2 - 70 + 'px';
instrHeader.style.top = 80;
var back = document.getElementById('instrbutton');
back.style.position = "absolute";
back.style.left = 30;
back.style.top = height - 50;
back.onclick = function() {
MENU.home();
};
var desc = document.getElementById('instrdesc');
desc.style.position = "absolute";
desc.style.left = width/10;
desc.style.width = width * 4/5;
desc.style.top = height/2 - 80;
}
MENU.play = function() {
GAME.setup();
document.getElementById('menuarea').style.display = "none";
GAME.main();
}
MENU.home = function() {
document.getElementById('menuarea').style.display = "block";
document.getElementById('instrarea').style.display = "none";
}
MENU.instructions = function() {
document.getElementById('menuarea').style.display = "none";
document.getElementById('instrarea').style.display = "block";
}
| JavaScript | 0.999688 | @@ -358,33 +358,33 @@
der.style.top =
-8
+6
0;%0A%0A buttons
@@ -1229,17 +1229,17 @@
e.top =
-8
+6
0;%0A%0A
@@ -1643,9 +1643,10 @@
2 -
-8
+12
0;%0A%0A
|
ba2af965ff39dc4a5374ac4030a25c77e6cdd4c5 | Add db module to dependencies after postInstall completes, fixes #36 | bin/postInstall.js | bin/postInstall.js | 'use strict';
var path = require('path')
, fs = require('fs')
, cp = require('child_process')
, config = require('config')
, dialect = config['clever-orm'].db.options.dialect
, appRoot = path.resolve(path.join(__dirname, '..', '..', '..'))
, verbose = process.argv.indexOf('-v') !== -1
, dbPkg;
switch(dialect) {
case 'mysql':
dbPkg = 'mysql';
break;
case 'mariadb':
dbPkg = 'mariasql';
break;
case 'mssql':
dbPkg = 'tedious';
break;
case 'postgres':
dbPkg = 'pg pg-hstore';
break;
case 'sqlite':
dbPkg = 'sqlite3';
break;
}
if (!fs.existsSync(path.join(appRoot, 'node_modules', dbPkg))) {
var opts = { cwd: appRoot };
if (verbose) {
opts.stdio = 'inherit';
}
var proc = cp.spawn('npm', ['i', dbPkg], opts);
proc.on('close', function(code) {
process.exit(code);
});
} | JavaScript | 0 | @@ -16,27 +16,24 @@
var path
-
= require('p
@@ -46,27 +46,24 @@
, fs
-
= require('f
@@ -78,19 +78,16 @@
cp
-
-
= requir
@@ -117,19 +117,16 @@
config
-
= requir
@@ -149,19 +149,16 @@
dialect
-
= config
@@ -203,19 +203,16 @@
appRoot
-
= path.r
@@ -266,18 +266,117 @@
,
+pkgPath = path.resolve(path.join(__dirname, '..', 'package.json'))%0A , pkgJson = require(pkgPath)%0A ,
verbose
-
= p
@@ -913,27 +913,367 @@
-process.exit(code);
+if (code === 0) %7B%0A pkgJson.dependencies%5BdbPkg%5D = '~' + require(path.join(appRoot, 'node_modules', dbPkg, 'package.json')).version;%0A fs.writeFile(pkgPath, JSON.stringify( pkgJson, null, ' '), function(err) %7B%0A if (err) %7B%0A console.error(err);%0A %7D%0A process.exit(code);%0A %7D);%0A %7D else %7B%0A process.exit(code);%0A %7D
%0A %7D
|
b3efaffffe983f3401951e5de12090a8dbd0a94f | rename gulptask: build:templates | Gulpfile.js | Gulpfile.js | // Generated by CoffeeScript 1.9.2
var gulp = require('gulp');
var concat = require('gulp-concat');
var tsc = require('gulp-typescript');
var bowerFiles = require('gulp-bower-files');
var handlebars = require('gulp-handlebars');
var wrap = require('gulp-wrap');
var declare = require('gulp-declare');
var path = require('path');
gulp.task('build', ['build:assets', 'build:typescript', 'build:bower:components', 'build-templates']);
gulp.task('default', ['build']);
gulp.task('watch', ['build'], function() {
gulp.watch('./assets/**/*.*', ['build:assets']);
gulp.watch('./src/ts/**/*.ts', ['build:typescript']);
return gulp.watch('./src/tpl/**/*.hbs', ['build-templates']);
});
gulp.task('build:assets', function() {
return gulp.src('./assets/**/*.*').pipe(gulp.dest('./dest/'));
});
gulp.task('build:typescript', function() {
var tsOption;
tsOption = {
noImplicitAny: true,
sortOutput: true,
target: "ES5",
sourceRoot: "./src/ts/rootFile.ts"
};
return gulp.src('./src/ts/**/*.ts').pipe(tsc(tsOption)).js.pipe(concat('app.js')).pipe(gulp.dest('./dest/js/'));
});
gulp.task('build:bower:components', function() {
return bowerFiles().pipe(concat('vendors.js')).pipe(gulp.dest('./dest/js/'));
});
gulp.task('build-templates', function() {
return gulp.src('./src/tpl/**/*.hbs').pipe(handlebars()).pipe(wrap('Handlebars.template(<%= contents %>)')).pipe(declare({
namespace: 'Diccal.templates',
noRedeclare: true,
processName: function(filePath) {
return declare.processNameByPath(filePath.replace('src' + path.sep + 'tpl' + path.sep, ''));
}
})).pipe(concat('templates.js')).pipe(gulp.dest('./dest/js/'));
});
| JavaScript | 0.012229 | @@ -407,25 +407,25 @@
nts', 'build
--
+:
templates'%5D)
@@ -656,25 +656,25 @@
bs', %5B'build
--
+:
templates'%5D)
@@ -1243,17 +1243,17 @@
k('build
--
+:
template
|
e0f98c17a73a6c27083a46bcc07ea270451273b1 | Add sockets to messages | app/messages/controller.js | app/messages/controller.js | var router = getRouter();
var Message = require('./model');
var User = require('../users/model');
/**
* Create a new message
* POST /messages
* Auth -> admin, staff
*/
router.post('/messages', User.auth('admin', 'staff'), function (req, res) {
var errors = Message.validate(req.body);
if (errors.length) return res.multiError(errors);
var message = new Message(req.body);
message.created = Date.now();
message.save(function (err, message) {
if (err) return res.internalError();
return res.json(message);
});
});
/**
* Get a list of messages
* GET /messages
*/
router.get('/messages', function (req, res) {
Message
.find()
.exec(function (err, messages) {
if (err) return res.internalError();
return res.json({messages: messages});
});
});
/**
* Get a single message
* GET /messages/:id
*/
router.get('/messages/:id', function (req, res) {
Message
.findById(req.params.id)
.exec(function (err, message) {
if (err) return res.internalError();
return res.json(message);
});
});
/**
* Update a message
* PATCH /messages/:id
* Auth -> admin, staff
*/
router.patch('/messages/:id', User.auth('admin', 'staff'), function (req, res) {
var errors = Message.validate(req.body);
if (errors.length) return res.multiError(errors);
Message
.findByIdAndUpdate(req.params.id, req.body)
.exec(function (err, message) {
if (err) return res.internalError();
return res.json(message);
});
});
/**
* Delete a message
* DELETE /messages/:id
* Auth -> admin, staff
*/
router.delete('/messages/:id', User.auth('admin', 'staff'), function (req, res) {
Message
.findByIdAndRemove(req.params.id)
.exec(function (err, message) {
if (err) return res.internalError();
return res.json({
_id: message._id
});
});
}); | JavaScript | 0.000001 | @@ -19,16 +19,94 @@
uter();%0A
+var socket = rootRequire('app/helpers/socket');%0Avar io = socket('/messages');%0A
var Mess
@@ -127,24 +127,24 @@
'./model');%0A
-
var User = r
@@ -560,24 +560,56 @@
nalError();%0A
+ io.emit('create', message);%0A
return r
@@ -1530,32 +1530,66 @@
nternalError();%0A
+ io.emit('update', message);%0A
return res
@@ -1904,32 +1904,31 @@
;%0A
-return res.json(
+var response =
%7B%0A
@@ -1950,15 +1950,82 @@
_id%0A
-
%7D
+;%0A io.emit('delete', response);%0A return res.json(response
);%0A
|
f8f2c89ba391dc3d8b87a3e7ce7442354f38a342 | Fix bug global leaks, `;` to `,` | lib/less/tree/extend.js | lib/less/tree/extend.js | (function (tree) {
tree.Extend = function Extend(elements, index) {
this.selector = new(tree.Selector)(elements);
this.index = index;
};
tree.Extend.prototype.eval = function Extend_eval(env) {
var selfSelectors = findSelfSelectors(env.selectors);
targetValue = this.selector.elements[0].value;
env.frames.forEach(function(frame) {
frame.rulesets().forEach(function(rule) {
rule.selectors.forEach(function(selector) {
selector.elements.forEach(function(element, idx) {
if (element.value === targetValue) {
selfSelectors.forEach(function(_selector) {
rule.selectors.push(new tree.Selector(
selector.elements
.slice(0, idx)
.concat(_selector.elements)
.concat(selector.elements.slice(idx + 1))
));
});
}
});
});
});
});
return this;
};
function findSelfSelectors(selectors) {
var ret = [];
(function loop(elem, i) {
if (selectors[i] && selectors[i].length) {
selectors[i].forEach(function(s) {
loop(s.elements.concat(elem), i + 1);
});
}
else {
ret.push({ elements: elem });
}
})([], 0);
return ret;
}
})(require('../tree'));
| JavaScript | 0.000025 | @@ -253,17 +253,17 @@
lectors)
-;
+,
%0A
|
e37c099f7e00a3e18c2642c8f4f342dea02b4b48 | change source and destination path | gulpfile.js | gulpfile.js | var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
|
*/
//to not create *.map file
elixir.config.sourcemaps = false;
elixir(function(mix) {
// mix.sass('app.scss');
mix.scripts([
'app.js'
],'public/elixir/js/app.js');
mix.scripts([
'controllers/userController.js',
'controllers/globalController.js',
'controllers/navController.js'
],'public/elixir/js/controller.js');
mix.scripts([
'models/userModel.js'
],'public/elixir/js/models.js');
});
| JavaScript | 0 | @@ -586,16 +586,24 @@
%5B%0A %09'
+gallery/
app.js'%0A
@@ -612,30 +612,31 @@
%5D,'public/
-elixir
+gallery
/js/app.js')
@@ -662,16 +662,24 @@
%5B%0A %09'
+gallery/
controll
@@ -703,32 +703,40 @@
r.js',%0A '
+gallery/
controllers/glob
@@ -762,16 +762,24 @@
'
+gallery/
controll
@@ -785,16 +785,23 @@
lers/nav
+igation
Controll
@@ -817,30 +817,31 @@
%5D,'public/
-elixir
+gallery
/js/controll
@@ -874,16 +874,24 @@
%5B%0A %09'
+gallery/
models/u
@@ -917,22 +917,23 @@
'public/
-elixir
+gallery
/js/mode
|
82e144b44c8b3d327369f14a254d8c21692e5c0a | Make sure we don't end up with identical random hash seeds. | lib/bloom.js | lib/bloom.js | var
crypto = require('crypto'),
util = require('util'),
Xxhash = require('xxhash')
;
function BloomFilter(hashes, bits, seeds)
{
this.hashes = hashes;
this.bits = bits;
this.seeds = seeds || [];
var octets = Math.ceil(this.bits / 8);
this.buffer = new Buffer(octets);
this.clear();
if (!seeds)
this.generateSeeds();
}
var LN2_SQUARED = Math.LN2 * Math.LN2;
BloomFilter.optimize = function(itemcount, errorRate)
{
errorRate = errorRate || 0.005;
var bits = Math.round(-1 * itemcount * Math.log(errorRate) / LN2_SQUARED);
var hashes = Math.round((bits / itemcount) * Math.LN2);
return {
bits: bits,
hashes: hashes
};
};
BloomFilter.optimalForSize = function(itemcount, errorRate)
{
var sizes = BloomFilter.optimize(itemcount, errorRate);
return new BloomFilter(sizes.hashes, sizes.bits);
};
BloomFilter.prototype.clear = function()
{
for (var i = 0; i < this.buffer.length; i++)
this.buffer[i] = 0;
};
BloomFilter.prototype.generateSeeds = function()
{
var buf;
for (var i = 0; i < this.hashes; i++)
{
buf = crypto.randomBytes(4);
this.seeds[i] = buf.readUInt32LE(0);
}
};
BloomFilter.prototype.setbit = function(bit)
{
var pos = 0;
var shift = bit;
while (shift > 7)
{
pos++;
shift -= 8;
}
var bitfield = this.buffer[pos];
bitfield |= (0x1 << shift);
this.buffer[pos] = bitfield;
};
BloomFilter.prototype.getbit = function(bit)
{
var pos = 0;
var shift = bit;
while (shift > 7)
{
pos++;
shift -= 8;
}
var bitfield = this.buffer[pos];
return (bitfield & (0x1 << shift)) !== 0;
};
BloomFilter.prototype._addOne = function(buf)
{
if (typeof buf === 'string')
buf = new Buffer(buf);
for (var i = 0; i < this.hashes; i++)
{
var hash = Xxhash.hash(buf, this.seeds[i]);
var bit = hash % this.bits;
this.setbit(bit);
}
};
BloomFilter.prototype.add = function(item)
{
if (Array.isArray(item))
{
for (var i = 0; i < item.length; i++)
this._addOne(item[i]);
}
else
this._addOne(item);
};
BloomFilter.prototype.has = function(item)
{
if (typeof item === 'string')
item = new Buffer(item);
var comp = 0x0;
for (var i = 0; i < this.hashes; i++)
{
var hash = Xxhash.hash(item, this.seeds[i]);
var bit = hash % this.bits;
var isSet = this.getbit(bit);
if (!isSet)
return false;
}
return true;
};
module.exports = BloomFilter;
| JavaScript | 0 | @@ -991,16 +991,19 @@
var buf
+, j
;%0A%09for (
@@ -1107,16 +1107,215 @@
32LE(0);
+%0A%0A%09%09// Make sure we don't end up with two identical seeds,%0A%09%09// which is unlikely but possible.%0A%09%09for (j = 0; j %3C i; j++)%0A%09%09%7B%0A%09%09%09if (this.seeds%5Bi%5D === this.seeds%5Bj%5D)%0A%09%09%09%7B%0A%09%09%09%09i--;%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D
%0A%09%7D%0A%7D;%0A%0A
|
40fbdfd127dfa0b35956aee4274cd4e041d7d816 | Fix wrong shortcut name in installer | gulpfile.js | gulpfile.js | var exec = require('child_process').exec;
var del = require('del');
var gulp = require('gulp');
var sequence = require('run-sequence');
var packager = require('electron-packager');
var vulcanize = require('gulp-vulcanize');
var winInstaller = require('electron-windows-installer');
var TEMP_BUILD_DIR = 'vulcanized';
var BUILD_DIR = 'build';
var DIST_DIR = 'dist';
gulp.task('make-installer', function() {
return winInstaller({
appDirectory: BUILD_DIR + '/Auto-Shutdown-win32-ia32',
outputDirectory: DIST_DIR,
iconUrl: __dirname + '/src/assets/logo-gray.ico',
exe: 'Auto-Shutdown.exe',
setupExe: 'Auto Shutdown Setup.exe',
authors: 'Mccxiv Software',
title: 'Auto Shutdown',
setupIcon: __dirname + '/src/assets/logo-gray.ico'
});
});
gulp.task('run-development', function(cb) {
exec('"src/node_modules/.bin/electron" ./src', cb);
});
gulp.task('run-vulcanized', function(cb) {
exec('"src/node_modules/.bin/electron" '+TEMP_BUILD_DIR, cb);
});
gulp.task('vulcanize', function() {
return gulp.src('src/index.html')
.pipe(vulcanize({
excludes: [],
inlineScripts: true,
inlineCss: true,
stripExcludes: false
}))
.pipe(gulp.dest(TEMP_BUILD_DIR));
});
gulp.task('copy-files', function() {
return gulp.src(['src/main.js', 'src/package.json'])
.pipe(gulp.dest(TEMP_BUILD_DIR));
});
gulp.task('copy-modules', function() {
return gulp.src(['src/modules/**'])
.pipe(gulp.dest(TEMP_BUILD_DIR+'/modules'));
});
gulp.task('clean-up-before', function(cb) {
del([TEMP_BUILD_DIR, BUILD_DIR, DIST_DIR], cb);
});
gulp.task('clean-up-after', function(cb) {
del([TEMP_BUILD_DIR, BUILD_DIR], cb);
});
gulp.task('package', function(cb) {
var opts = {
dir: 'vulcanized',
name: 'Auto-Shutdown',
platform: 'all',
arch: 'ia32',
version: '0.30.2',
icon: 'src/assets/logo-gray.ico',
out: BUILD_DIR
};
packager(opts, cb);
});
gulp.task('build', function(cb) {
sequence('clean-up-before', ['vulcanize', 'copy-files', 'copy-modules'], 'package', 'make-installer', 'clean-up-after', cb);
});
gulp.task('default', ['build']); | JavaScript | 0.000002 | @@ -276,16 +276,69 @@
ler');%0A%0A
+var VERSION = require('./src/package.json').version;%0A
var TEMP
@@ -413,17 +413,16 @@
dist';%0A%0A
-%0A
gulp.tas
@@ -1834,16 +1834,42 @@
.30.2',%0A
+%09%09'app-version': VERSION,%0A
%09%09icon:
@@ -1896,16 +1896,314 @@
y.ico',%0A
+%09%09'version-string': %7B%0A%09%09%09CompanyName: 'Mccxiv Software',%0A%09%09%09LegalCopyright: 'Copyright 2015 Andrea Stella. All rights reserved',%0A%09%09%09ProductVersion: VERSION,%0A%09%09%09FileVersion: VERSION,%0A%09%09%09OriginalFilename: 'auto-shutdown.exe',%0A%09%09%09FileDescription: 'Auto Shutdown',%0A%09%09%09ProductName: 'Auto Shutdown'%0A%09%09%7D,%0A
%09%09out: B
|
bd72d764d4e85bdfd89ffa91e36b527e46e3df44 | Add latitude & longitude to traffic_data.js file | app/models/traffic_data.js | app/models/traffic_data.js | var sequelize = require('./traffic_data.js');
var Sequelize = require ('sequelize')
, sequelize = new Sequelize('area', 'location', 'address', 'code', 'type', 'date');
var Data = sequelize.define('traffic_data', {
area: Sequelize.STRING,
location: Sequelize.STRING,
address: Sequelize.STRING,
code: Sequelize.STRING,
type: Sequelize.STRING,
date: Sequelize.DATE
});
// //Tester ONLY
return sequelize.sync().then(function() {
return Data.create({
area: "KANEOHE",
location: "PALI TUNNELS D4 S",
address: "600X PALI HWY",
code: "633",
type: "STALLED/HAZARDOUS VEHICLE",
date: new Date(2015, 12, 12)
}).then(function(sdepold) {
console.log(sdepold.values);
});
});
// module.exports = model; | JavaScript | 0.000006 | @@ -1,12 +1,385 @@
+#!/usr/bin/env node%0A%0Avar debug = require('debug')('express-example');%0Avar app = require('../app');%0Avar models = require(%22../models%22);%0A%0Aapp.set('port', process.env.PORT %7C%7C 3000);%0A%0Amodels.sequelize.sync().then(function () %7B%0A var server = app.listen(app.get('port'), function() %7B%0A debug('Express server listening on port ' + server.address().port);%0A %7D);%0A%7D);%0A%0A//sequelize%0A
var sequeliz
@@ -743,22 +743,510 @@
ize.DATE
+,%0A latitude: %7B%0A type: Sequelize.INTEGER,%0A allowNull: true,%0A defaultValue: null,%0A validate: %7B min: -90, max: 90 %7D%0A %7D,%0A longitude: %7B%0A type: Sequelize.INTEGER,%0A allowNull: true,%0A defaultValue: null,%0A validate: %7B min: -180, max: 180 %7D%0A %7D,%0A%7D, %7B%0A validate: %7B%0A bothCoordsOrNone: function () %7B%0A if ((this.latitude === null) === (this.longitude === null)) %7B%0A throw new Error ('Require either both latitude and longitude or neither');%0A %7D%0A %7D%0A %7D
%0A%7D);%0A%0A
+%0A%0A
// //Tes
@@ -1254,16 +1254,19 @@
er ONLY%0A
+//
return s
@@ -1299,16 +1299,19 @@
ion() %7B%0A
+//
return
@@ -1325,16 +1325,19 @@
reate(%7B%0A
+//
area
@@ -1345,24 +1345,27 @@
%22KANEOHE%22,%0A
+//
location
@@ -1387,20 +1387,23 @@
D4 S%22,%0A
+//
+
address:
@@ -1420,16 +1420,19 @@
I HWY%22,%0A
+//
code
@@ -1440,16 +1440,19 @@
%22633%22,%0A
+//
type
@@ -1482,20 +1482,23 @@
HICLE%22,%0A
+//
+
date: ne
@@ -1518,16 +1518,19 @@
12, 12)%0A
+//
%7D).the
@@ -1547,24 +1547,27 @@
(sdepold) %7B%0A
+//
console.
@@ -1587,22 +1587,28 @@
alues);%0A
+//
%7D);%0A
+//
%7D);%0A%0A//
@@ -1630,8 +1630,113 @@
= model;
+%0A%0A//RUN ON TERMINAL ONLY%0A// pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
|
7bb5574ab3baca27e85862dacd4d28b368d41a20 | Make MemoryLocation more useful for the server side rendering | lib/locations/memory.js | lib/locations/memory.js | module.exports = function (path) {
return {
path: path || '',
getURL: function () {
return this.path
},
setURL: function (path) {
this.path = path
this.handleURL(this.getURL())
},
replaceURL: function (path) {
this.setURL(path)
},
onChange: function (callback) {
this.changeCallback = callback
},
handleURL: function (url) {
this.path = url
if (this.changeCallback) {
this.changeCallback(url)
}
},
usesPushState: function () {
return false
},
removeRoot: function (url) {
return url
},
formatURL: function (url) {
return url
}
}
}
| JavaScript | 0.000123 | @@ -1,8 +1,36 @@
+var _ = require('../dash')%0A%0A
module.e
@@ -165,32 +165,41 @@
: function (path
+, options
) %7B%0A this.p
@@ -184,32 +184,36 @@
ptions) %7B%0A
+if (
this.path = path
@@ -210,15 +210,47 @@
ath
+!=
= path
-%0A
+) %7B%0A this.path = path%0A
@@ -279,17 +279,34 @@
getURL()
-)
+, options)%0A %7D
%0A %7D,%0A
@@ -332,24 +332,33 @@
nction (path
+, options
) %7B%0A th
@@ -359,25 +359,76 @@
-this.setURL(path)
+if (this.path !== path) %7B%0A this.setURL(path, options)%0A %7D
%0A
@@ -533,32 +533,41 @@
L: function (url
+, options
) %7B%0A this.p
@@ -572,24 +572,75 @@
.path = url%0A
+ options = _.extend(%7Btrigger: true%7D, options)%0A
if (th
@@ -652,24 +652,43 @@
angeCallback
+ && options.trigger
) %7B%0A
|
cb5117a17578a69a1bb9b539ed838ad748f06159 | fix getter | packages/shell-dev-vue2/src/store.js | packages/shell-dev-vue2/src/store.js | import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
strict: true,
state: {
inited: 0,
count: 0,
lastCountPayload: null,
date: new Date(),
set: new Set(),
map: new Map(),
sym: Symbol('test'),
object: {
name: 'I am Object',
number: 0,
children: [
{
number: 0
}
]
}
},
mutations: {
TEST_INIT: state => state.inited++,
INCREMENT: (state, payload) => {
state.count++
state.lastCountPayload = payload
},
DECREMENT: (state, payload) => {
state.count--
state.lastCountPayload = payload
},
UPDATE_DATE: state => {
state.date = new Date()
},
TEST_COMPONENT: state => { /* noop */ },
TEST_SET: state => {
state.set.add(Math.random())
},
TEST_MAP: state => {
state.map.set(`mykey_${state.map.size}`, state.map.size)
}
},
actions: {
ASYNC_INCREMENT: ({ commit }) => {
return wait(100).then(() => {
commit('INCREMENT', 1)
})
}
},
getters: {
isPositive: state => state.count >= 0,
hours: state => state.date.getHours(),
errorGetter: () => {
throw new Error('Error from getter')
}
},
modules: {
nested: {
namespaced: true,
state () {
return {
foo: 'bar'
}
},
getters: {
twoFoos: state => state.foo.repeat(2),
dummy: () => {
console.log('dummy getter was computed')
return 'dummy'
}
},
mutations: {
ADD_BAR: (state) => {
state.foo += 'bar'
},
REMOVE_BAR: (state) => {
state.foo = state.foo.substr('bar'.length)
}
}
},
notNamespaced: {
state () {
return {
hello: 'world'
}
},
getters: {
hello2: state => state.notNamespaced.hello.repeat(2)
}
}
}
})
function wait (ms) {
return new Promise(resolve => {
setTimeout(resolve, ms)
})
}
| JavaScript | 0.000002 | @@ -1905,22 +1905,8 @@
ate.
-notNamespaced.
hell
|
47cdd83df3b20127f7d62215a8d7428c64a3e4f3 | update tests | lib/check.js | lib/check.js | import net from 'net';
export default function check(port, host) {
return new Promise( (resolve, reject) => {
var server = net.createServer(null, () => {});
server.on('error', (err) => {
server.close();
if (err.code == 'EADDRINUSE') {
resolve(true);
}else {
resolve(false);
}
});
server.listen(port, host, (err) => {
server.close();
if (err && err.code == 'EADDRINUSE') {
resolve(true);
}else {
resolve(false);
}
});
});
};
| JavaScript | 0.000001 | @@ -196,38 +196,16 @@
r) =%3E %7B%0A
- server.close();%0A
if
|
0eb2d12531267c3ccd3bd4868937a901e2f4534c | Add PointerLockOptions argument to requestPointerLock | externs/browser/w3c_pointerlock.js | externs/browser/w3c_pointerlock.js | /*
* Copyright 2015 The Closure Compiler Authors
*
* 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.
*/
/**
* @fileoverview Definitions for W3C's Pointer Lock API.
* @see https://w3c.github.io/pointerlock/
*
* @externs
*/
/**
* @see https://w3c.github.io/pointerlock/#widl-Element-requestPointerLock-void
* @return {void}
*/
Element.prototype.requestPointerLock = function() {};
/**
* @see https://w3c.github.io/pointerlock/#widl-Document-pointerLockElement
* @type {?Element}
*/
Document.prototype.pointerLockElement;
/**
* @see https://w3c.github.io/pointerlock/#widl-Document-exitPointerLock-void
* @return {void}
*/
Document.prototype.exitPointerLock = function() {};
/**
* @see https://w3c.github.io/pointerlock/#widl-MouseEvent-movementX
* @type {number}
*/
MouseEvent.prototype.movementX;
/**
* @see https://w3c.github.io/pointerlock/#widl-MouseEvent-movementY
* @type {number}
*/
MouseEvent.prototype.movementY;
| JavaScript | 0.000001 | @@ -730,16 +730,262 @@
ns%0A */%0A%0A
+/**%0A * TODO(bradfordcsmith): update the link when PR is merged%0A * @see https://github.com/w3c/pointerlock/pull/49/%0A * @record%0A */%0Afunction PointerLockOptions() %7B%7D%0A%0A/** @type %7Bundefined%7Cboolean%7D */%0APointerLockOptions.prototype.unadjustedMovement;%0A
%0A/**%0A *
@@ -1061,36 +1061,92 @@
ck-void%0A * @
-return %7Bvoid
+param %7B!PointerLockOptions=%7D options%0A * @return %7Bvoid%7C!Promise%3Cvoid%3E
%7D%0A */%0AElemen
@@ -1179,32 +1179,39 @@
Lock = function(
+options
) %7B%7D;%0A%0A/**%0A * @s
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.