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
|
---|---|---|---|---|---|---|---|
0a0bca076d9b85468767a21d42a5fa0f2542e375
|
Update storySort Function for Storybook (#5753)
|
storybook/preview.js
|
storybook/preview.js
|
import React, { useState, useEffect } from 'react';
import { hpe } from 'grommet-theme-hpe';
import { Grommet, grommet, Box, Text } from '../src/js';
const CUSTOM_THEMED = 'Custom Themed';
const THEMES = {
hpe,
grommet,
base: {},
};
export const decorators = [
(Story, context) => {
const [state, setState] = useState('grommet');
useEffect(() => {
setState(context.globals.theme);
}, [context.globals.theme]);
/**
* This demonstrates that custom themed stories are driven off the "base"
* theme. Custom themed stories will live under a "CustomThemed" directory.
*/
if (context.kind.split('/')[2] === CUSTOM_THEMED && state !== 'base') {
return (
<Box align="center" pad="large">
<Text size="large">
{`Custom themed stories are only displayed in the
"base" theme mode. To enable, select "base" from the
Theme menu above.`}
</Text>
</Box>
);
}
return (
<Grommet theme={THEMES[state]}>
<Story state={THEMES[state]} />
</Grommet>
);
},
];
export const parameters = {
layout: 'fullscreen',
options: {
storySort: (a, b) => {
const isCustom = a[1].kind.split('/')[2] === CUSTOM_THEMED;
if (isCustom) return 1;
return a[1].kind === b[1].kind
? 0
: a[1].id.localeCompare(b[1].id, undefined, { numeric: true });
},
},
};
export const globalTypes = {
theme: {
name: 'Theme',
defaultValue: 'grommet',
toolbar: {
items: ['base', 'grommet', 'hpe'],
showName: true,
},
},
};
|
JavaScript
| 0 |
@@ -1193,18 +1193,669 @@
t: (
-a, b) =%3E %7B
+first, second) =%3E %7B%0A /**%0A * The story sort algorithm will only ever compare two stories%0A * a single time. This means that every story will only ever be either%0A * the %22first%22 parameter OR the %22second%22 parameter, but not both.%0A * So, the checks for custom themed stories need to happen on both inputs%0A * of this function.%0A *%0A * A return value of 1 results in sorting the %22first%22 story AFTER the%0A * %22second%22 story.%0A *%0A * A return value of 0 results in sorting the %22first%22 story BEFORE the%0A * secondary story.%0A */%0A const isFirstCustom = first%5B1%5D.kind.split('/')%5B2%5D === CUSTOM_THEMED;
%0A
@@ -1865,16 +1865,22 @@
const is
+Second
Custom =
@@ -1880,17 +1880,22 @@
ustom =
-a
+second
%5B1%5D.kind
@@ -1940,16 +1940,21 @@
if (is
+First
Custom)
@@ -1973,16 +1973,56 @@
-return a
+if (isSecondCustom) return 0;%0A return first
%5B1%5D.
@@ -2030,17 +2030,22 @@
ind ===
-b
+second
%5B1%5D.kind
@@ -2067,17 +2067,21 @@
:
-a
+first
%5B1%5D.id.l
@@ -2093,17 +2093,22 @@
Compare(
-b
+second
%5B1%5D.id,
|
0c8e0bdaf38b0c44ce28988708792ffe08cb3ebe
|
Remove unnecesary require from tweak
|
subcommands/tweak.js
|
subcommands/tweak.js
|
'use strict';
const fs = require('fs'),
processors = require('../processors.js');
module.exports = {
help: 'Run a script against the objects in the loaded data, outputting its results.',
options: {
script: {
position: 1,
help: 'Script to run against the objects in the loaded data.',
required: true
}
},
outputsObject: true,
needsSandbox: true,
hasWithClauseOpt: true,
handler: tweakCommandHandler
};
function tweakCommandHandler(runtimeSettings, config, opts)
{
let res = [],
scriptWithReturn = opts.script + '; return $';
processors.mapOverInput(scriptWithReturn, runtimeSettings, (raw, ret) => {
res.push(ret);
return true;
}, false);
// Using mapOverInput like we did means that we will always have an array result.
// If the input data was a single object, let's unpack it from the res array:
if(!Array.isArray(runtimeSettings.data))
return res[0];
return res;
}
|
JavaScript
| 0 |
@@ -18,34 +18,8 @@
nst
-fs = require('fs'),%0A
proc
|
4b183071e234fa86deedfe79d71be5e9253b4bab
|
test path
|
Gruntfile.js
|
Gruntfile.js
|
/*
* grunt-ssis
* https://github.com/lee/grunt-ssi
*
* Copyright (c) 2015 Lee Goddard
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'<%= nodeunit.tests %>'
],
options: {
jshintrc: '.jshintrc'
}
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['test/fixtures/*.html']
},
// Configuration to be run (and then tested).
ssis: {
build: {
ext: '.html',
documentRoot: '.',
src: ['test/fixtures/1.shtml']
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js']
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'ssis', 'nodeunit']);
// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);
};
|
JavaScript
| 0.000002 |
@@ -705,16 +705,20 @@
ixtures/
+foo/
1.shtml'
|
e365e19687c823fa0878b535d10a3a2658b27391
|
Add Jade to Grunt config as empty:
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.file.defaultEncoding = 'utf8';
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-yui-compressor');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-git-describe');
grunt.initConfig({
'requirejs': {
production: {
options: {
baseUrl: './public/src/js',
mainConfigFile: './public/src/js/require.config.js',
name: 'main',
out: './public/js/debuggerio.min.js',
pragmas: { bustCache: true },
findNestedDependencies: true,
preserveLicenseComments: true,
useStrict: true,
paths: {
jqueryjs: 'empty:',
underscorejs: 'empty:',
backbonejs: 'empty:',
codemirrorjs: 'empty:',
ui: 'empty:',
transit: 'empty:',
nano: 'empty:',
hammer: 'empty:',
string: 'empty:',
cm_overlay: 'empty:',
cm_search: 'empty:',
cm_xml: 'empty:',
cm_html: 'empty:',
cm_markdown: 'empty:',
cm_gfm: 'empty:',
cm_ruby: 'empty:',
cm_haml: 'empty:',
cm_css: 'empty:',
cm_less: 'empty:',
cm_js: 'empty:',
cm_coffeescript: 'empty:'
},
exclude: ['promise', 'inflection']
}
}
},
'less': {
production: {
options: { cleancss: true },
files: {
'public/css/debuggerio.light.min.css':
'public/src/less/debuggerio.light.less',
'public/css/debuggerio.dark.min.css':
'public/src/less/debuggerio.dark.less'
}
}
},
'cssmin': {
production: {
src: ['frame/css/gfm.css'],
dest: 'frame/css/gfm.min.css'
}
},
'clean': {
build: ['build.json'],
js: ['public/js/debuggerio.min.js'],
css: [
'public/css',
'frame/css/gfm.min.css'
]
},
'git-describe': {
production: {
options: {
template: '{%=object%}',
}
}
}
});
grunt.task.registerTask('rev', function() {
grunt.event.once('git-describe', function (rev) {
grunt.file.write('./build.json', JSON.stringify({
date: grunt.template.date(new Date(), 'isoUtcDateTime'),
rev: rev.toString()
}));
});
grunt.task.run('git-describe');
});
grunt.registerTask('default', [
'clean', 'requirejs', 'less', 'cssmin', 'rev'
]);
};
|
JavaScript
| 0 |
@@ -1190,32 +1190,63 @@
_gfm: 'empty:',%0A
+ cm_jade: 'empty:',%0A
cm_r
|
c9710f6d0bc24e3c5d85a3ef924045378a09e19a
|
use onlyLocals option instead of css-loader/locals (#1033)
|
packages/razzle-plugin-scss/index.js
|
packages/razzle-plugin-scss/index.js
|
'use strict';
const autoprefixer = require('autoprefixer');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const PostCssFlexBugFixes = require('postcss-flexbugs-fixes');
const paths = require('razzle/config/paths');
const defaultOptions = {
postcss: {
dev: {
sourceMap: true,
ident: 'postcss',
},
prod: {
sourceMap: false,
ident: 'postcss',
},
plugins: [
PostCssFlexBugFixes,
autoprefixer({
browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'],
flexbox: 'no-2009',
}),
],
},
sass: {
dev: {
sourceMap: true,
includePaths: [paths.appNodeModules],
},
prod: {
// XXX Source maps are required for the resolve-url-loader to properly
// function. Disable them in later stages if you do not want source maps.
sourceMap: true,
sourceMapContents: false,
includePaths: [paths.appNodeModules],
},
},
css: {
dev: {
sourceMap: true,
importLoaders: 1,
modules: false,
},
prod: {
sourceMap: false,
importLoaders: 1,
modules: false,
minimize: true,
},
},
style: {},
resolveUrl: {
dev: {},
prod: {},
},
};
module.exports = (
defaultConfig,
{ target, dev },
webpack,
userOptions = {}
) => {
const isServer = target !== 'web';
const constantEnv = dev ? 'dev' : 'prod';
const config = Object.assign({}, defaultConfig);
const options = Object.assign({}, defaultOptions, userOptions);
const styleLoader = {
loader: require.resolve('style-loader'),
options: options.style,
};
const cssLoader = {
loader: require.resolve('css-loader'),
options: options.css[constantEnv],
};
const resolveUrlLoader = {
loader: require.resolve('resolve-url-loader'),
options: options.resolveUrl[constantEnv],
};
const postCssLoader = {
loader: require.resolve('postcss-loader'),
options: Object.assign({}, options.postcss[constantEnv], {
plugins: () => options.postcss.plugins,
}),
};
const sassLoader = {
loader: require.resolve('sass-loader'),
options: options.sass[constantEnv],
};
config.module.rules = [
...config.module.rules,
{
test: /\.(sa|sc)ss$/,
use: isServer
? [
{
loader: require.resolve('css-loader/locals'),
options: options.css[constantEnv],
},
resolveUrlLoader,
postCssLoader,
sassLoader,
]
: [
dev ? styleLoader : MiniCssExtractPlugin.loader,
cssLoader,
postCssLoader,
resolveUrlLoader,
sassLoader,
],
},
];
return config;
};
|
JavaScript
| 0 |
@@ -2373,15 +2373,8 @@
ader
-/locals
'),%0A
@@ -2387,32 +2387,50 @@
options:
+ Object.assign(%7B%7D,
options.css%5Bcon
@@ -2439,16 +2439,37 @@
antEnv%5D,
+ %7BonlyLocals: true%7D),
%0A
|
e84fea65565b4468bcb4b5af1d4c5050723efdb0
|
Fix #133
|
Gruntfile.js
|
Gruntfile.js
|
var fs = require('fs'),
path = require('path'),
browserify = require('browserify'),
Jasmine = require('jasmine');
module.exports = function(grunt) {
var WEB_ROOT = 'public',
BUILD_DIR = path.join(WEB_ROOT,'js'),
DIST_DIR = 'dist';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
options: {
force: true
},
data: [path.join(WEB_ROOT,'data')],
build: [path.join(DIST_DIR,'**')],
js: [path.join(BUILD_DIR,'**')],
test: [path.join(BUILD_DIR,'jasmine-bundle.js')]
},
"jasmine":{
browser: {
src: path.join('spec','support','Jasmine.json'),
dest: path.join(BUILD_DIR,'jasmine-bundle.js')
}
},
js:{
dist: {
options:{
debug: false
},
src: [path.join('src','index.js')],
dest: path.join(DIST_DIR,'LW.js')
},
debug: {
options: {
debug: true
},
src: [path.join('src','index.js')],
dest: path.join(DIST_DIR,'LW-debug.js')
}
},
watch:{
options: {
livereload: true
},
test: {
files: [path.join('src','**','*.js'),path.join('spec','**','*.js')],
tasks: ['build','test']
},
html: {
files: [path.join(WEB_ROOT,'**','*.html')]
}
},
connect:{
test: {
options: {
base: {
path: WEB_ROOT,
options: {
index: 'SpecRunner.html'
}
},
hostname: '*',
livereload: true,
open: true,
useAvailablePort: true,
}
},
demo: {
options: {
base: {
path: WEB_ROOT,
options: {
index: 'demo.html'
}
},
hostname: '*',
livereload: true,
open: true,
useAvailablePort: true,
}
}
},
copy: {
data: {
expand: true,
src: path.join('data',"*"),
dest: WEB_ROOT
},
js: {
expand: true,
flatten: true,
src: path.join(DIST_DIR,"*"),
dest: path.join(WEB_ROOT,'js')
}
}
});
// Load grunt tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
// Custom tasks
function mkDirs(p){
function f(dir,i){
if(i < dir.length){
var cwd = dir.slice(0,i+1);
var dirPath = cwd.join(path.sep);
if(/v0\.1\d\.\d+/.test(process.version)){
// node version is 0.1x.x
if(!fs.existsSync(dirPath)){
fs.mkdirSync(dirPath);
}else{
console.log(dirPath + " already exists");
}
}else{
try{
fs.accessSync(dirPath, fs.constants.F_OK);
console.log(dirPath + " already exists");
}catch(e){
// directory doesn't exist
fs.mkdirSync(dirPath);
console.log("mkdir " + dirPath);
}
}
f(dir,i+1);
}
}
f(p.split(path.sep),0);
}
grunt.registerMultiTask('js','Builds bundle for JavaScript component', function(){
var opts = this.options({
debug: false
});
console.log("debug: " + opts.debug);
var output = this.files[0].dest;
mkDirs(DIST_DIR);
console.log("files:\t" + this.filesSrc.join('\n\t'));
var b = browserify({
basedir: '.',
entries: this.filesSrc,
noParse: [],
browserField: false,
debug: opts.debug,
standalone: 'LW'
});
// prevents file from being loaded into bundle
b.exclude("node-localstorage");
var done = this.async();
var outputFile = fs.createWriteStream(output);
outputFile.on('finish',function(){
console.log('Wrote ' + output);
done();
});
b.bundle().pipe(outputFile);
});
grunt.registerMultiTask('jasmine','Creates bundle for Jasmine tests',function(){
var output = this.files[0].dest;
var config = this.filesSrc[0];
console.log("config: " + config);
mkDirs(path.dirname(output));
var runner = new Jasmine();
runner.loadConfigFile(config);
var entries = runner.helperFiles.concat(runner.specFiles);
console.log("files:\t" + entries.join('\n\t'));
var b = browserify({
basedir: '.',
entries: entries,
noParse: [],
browserField: false,
debug: true
});
// prevents file from being loaded into bundle
b.exclude("node-localstorage");
var done = this.async();
var outputFile = fs.createWriteStream(output);
outputFile.on('finish',function(){
console.log('Wrote ' + output);
done();
});
b.bundle().pipe(outputFile);
});
grunt.registerTask('build', ['clean:build','js']);
grunt.registerTask('demo',['build','copy']);
grunt.registerTask('test', ['clean:test','jasmine']);
// Default task(s).
grunt.registerTask('default', ['demo','test','connect','watch']);
};
|
JavaScript
| 0.000001 |
@@ -2060,16 +2060,17 @@
data',%22*
+*
%22),%0A
|
15c6f23ff43b1dcc1056c9d63bd7df10b79e65be
|
Create sourceMap for minified js
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
igv: {
src: [
'js/**/*.js',
'vendor/inflate.js',
'vendor/zlib_and_gzip.min.js'
],
dest: 'dist/igv-all.js'
}
},
uglify: {
options: {
mangle: false
},
igv: {
src: 'dist/igv-all.js',
dest: 'dist/igv-all.min.js'
}
}
});
// 3. Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
// 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
//grunt.registerTask('default', ['concat:igvexp', 'uglify:igvexp']);
grunt.registerTask('default', ['concat:igv', 'uglify:igv']);
};
|
JavaScript
| 0 |
@@ -483,16 +483,49 @@
e: false
+,%0A sourceMap: true
%0A
|
7d63e35e201e74733354672f5d55d0d7da2b72be
|
update node-webkit to v0.10.5
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
files: {
'www/css/index.css': 'src/less/index.less'
}
}
},
nodewebkit: {
options: {
version: '0.9.1',
build_dir: './build', // Destination for built apps.
mac: true, // OS X support.
win: true, // Windows support.
linux32: true, // Linux 32-bit support.
linux64: true, // Linux 64-bit support.
credits: 'www/credits.html',
mac_icns: 'www/img/app-icons/icon.icns'
},
src: ['./www/**/*', './node_modules/phonegap/**/*']
},
watch: {
files: ['./src/less/**/*'],
tasks: ['less']
}
});
// Load the grunt plugins.
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-node-webkit-builder');
// Register the task to install nodewebkit dependencies.
grunt.task.registerTask('install-dependencies', function() {
var exec = require('child_process').exec,
callback = this.async();
exec('npm install --production', { cwd: './www' }, function(e, stdout, stderr) {
console.log(stdout);
callback();
});
});
grunt.task.registerTask('copy-dev-config', function() {
//var config = grunt.file.read('./src/config/package.json');
grunt.file.copy('./src/config/package.json', './www/package.json');
});
grunt.task.registerTask('copy-release-config', function() {
var config = grunt.file.read('./src/config/package.json');
var releaseConfig = config.replace("\"toolbar\": true", "\"toolbar\": false");
grunt.file.write('./www/package.json', releaseConfig);
});
// Register the task to open an app.
grunt.task.registerTask('open', 'Open the app', function() {
var fs = require('fs'),
os = require('os'),
opener = require('opener'),
appName = JSON.parse(fs.readFileSync('./www/package.json')).name,
macPath = 'build/appName/osx/appName.app',
winPath = 'build/appName/win/appName.exe';
macPath = macPath.replace(/appName/g, appName);
winPath = winPath.replace(/appName/g, appName);
opener((os.platform() === 'darwin') ? macPath : winPath);
});
// Default tasks.
grunt.registerTask('default', ['install-dependencies', 'less', 'copy-dev-config', 'nodewebkit', 'open']);
grunt.registerTask('release', ['install-dependencies', 'less', 'copy-release-config', 'nodewebkit']);
};
|
JavaScript
| 0 |
@@ -311,11 +311,12 @@
'0.
-9.1
+10.5
',%0A
|
334f379ef14f9ac3a1a32f35ef2666be92b59d20
|
change gruntfile to fix css import and minification
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
// ===========================================================================
// CONFIGURE GRUNT ===========================================================
// ===========================================================================
grunt.initConfig({
// get the configuration info from package.json
pkg: grunt.file.readJSON('package.json'),
// CLEAN
clean: {
tmp: 'app/.tmp',
build: 'build/',
dist: 'dist/',
distTmp: 'dist/.tmp',
sassCache: '.sass-cache',
compressed: 'cupido-frontend.tar.gz',
coverage: 'coverage/',
},
// BOWER
bower: {
install: {
options: {
targetDir: 'app/vendors',
layout: 'byComponent',
install: true,
verbose: false,
cleanTargetDir: true,
cleanBowerDir: false,
bowerOptions: {
}
}
}
},
// BOWER REQUIRE JS
bowerRequirejs: {
build: {
rjsConfig: 'config.js',
options: {
transitive: true,
excludeDev: true
}
}
},
// BOWER CONCAT
bower_concat: {
build: {
dest: 'build/js/_bower.js',
cssDest: 'build/css/_bower.css',
bowerOptions: {
relative: true
}
}
},
// JSHINT
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: ['Grunfile.js', 'app/**/*.js', '!app/vendors/**', '!app/**/*.spec.js']
},
// SASS
sass: {
dev: {
options: {
sourceMap: false
},
files: {
'app/.tmp/css/main.css': 'app/index.scss'
}
}
},
// POSTCSS
postcss: {
dev: {
options: {
map: false,
processors: [
require('autoprefixer')()
],
},
src: 'app/.tmp/css/*.css'
}
},
// WIREDEP
wiredep: {
task: {
directory: 'app/vendors',
src: ['app/index.html'],
}
},
// INJECTOR
injector: {
dev: {
options: {
template: 'app/index.html',
min: true,
relative: true
},
files: {
'app/index.html': ['app/index.js', 'app/**/*.js', 'app/.tmp/css/main.css', '!app/vendors/**'],
}
}
},
// WATCH
watch: {
options:{
livereload: true
},
stylesheet: {
files: ['app/index.scss'],
tasks: ['devStyle', 'injector']
},
scripts: {
files:['app/**/*.js', '!app/vendors/**'],
tasks:['devScript', 'injector']
},
bower: {
files: ['app/vendors/**'],
tasks: ['wiredep']
},
all: {
files: ['app/**/*'],
tasks: ['devStyle', 'devScript', 'injector']
}
},
// EXPRESS SERVER
express:{
dev:{
options:{
port:9001,
bases:['app/'],
livereload: true
}
},
dist:{
options:{
port:9003,
bases:['dist/static/'],
livereload: true
}
}
},
// CONCAT
concat: {
options: {
separator: ';',
},
dist: {
src: ['build/js/_bower.js', 'build/js/index.js', 'build/templates/**/*.js'],
dest: 'dist/.tmp/js/main.concat.js'
},
},
// UGLIFY
uglify: {
options: {
mangle: false
},
dist: {
files: {
'dist/static/js/main.min.js': [ 'dist/.tmp/js/main.concat.js' ]
}
}
},
// CSSMIN
cssmin: {
dist: {
files: [{
expand: true,
cwd: 'build/css',
src: ['*.css', '!*.min.css'],
dest: 'dist/static/css',
ext: '.min.css'
}]
}
},
// COPY
copy: {
options: {
encoding: 'utf-8'
},
build: {
files: [
{expand: true, cwd: 'app', src: ['images/**/*'], dest: 'build/'},
{expand: true, cwd: 'app', src: ['templates/**'], dest: 'build/'},
{expand: true, cwd: 'app', src: ['**/*.html'], dest: 'build/'},
{expand: true, cwd: 'app', src: ['index.js'], dest: 'build/js'},
{expand: true, cwd: 'app/.tmp', src: ['css/**/*.css'], dest: 'build/'},
]
},
dist: {
files: [
{expand: true, cwd: 'build', src: ['images/**/*'], dest: 'dist/static/'},
{expand: true, cwd: 'build', src: ['**/*.html'], dest: 'dist/static/'},
]
}
},
//USEMIN
// --> usemin prepare
useminPrepare: {
html: 'dist/static/index.html',
options: {
flow: {
html: {
steps: {
js: ['concat', 'uglify'],
css: ['cssmin']
},
post: {}
}
}
}
},
// --> usemin
usemin: {
html: ['dist/static/index.html'],
options: {
root: 'app',
dest: 'dist/static'
}
},
// COMPRESS
compress: {
dist: {
options: {
archive: 'boilerplate.tar.gz',
mode: 'tgz',
pretty: true
},
expand: true,
cwd: 'dist/static/',
src: ['**/*'],
dest: '/'
}
},
});
// ===========================================================================
// LOAD GRUNT PLUGINS ========================================================
// ===========================================================================
require('load-grunt-tasks')(grunt);
// ===========================================================================
// RUN GRUNT TASKS ===========================================================
// ===========================================================================
grunt.registerTask('default', ['clean', 'bower', 'server']);
grunt.registerTask('devStyle', ['sass:dev', 'postcss:dev']); // Style task
grunt.registerTask('devScript', ['jshint']); // Script task
grunt.registerTask('optimizeScript', ['concat', 'uglify']); // Script optimizer
grunt.registerTask('optimizeStyle', ['cssmin']); // Style optimizer
// Server task
grunt.registerTask('server', ['express', 'devScript', 'devStyle', 'wiredep', 'injector:dev', 'watch']);
// Server dist
grunt.registerTask('server:dist', ['express:dist', 'watch']);
// Build task
grunt.registerTask('build', ['clean', 'bower', 'devStyle', 'wiredep', 'injector:dev', 'copy:build', 'bower_concat']);
// Dist task
grunt.registerTask('dist', ['build', 'useminPrepare', 'optimizeScript', 'optimizeStyle', 'clean:distTmp', 'copy:dist', 'usemin', 'compress']);
};
|
JavaScript
| 0 |
@@ -3673,36 +3673,39 @@
cssmin: %7B%0A
-dist
+options
: %7B%0A file
@@ -3704,109 +3704,107 @@
-files: %5B%7B%0A expand: true,
+shorthandCompacting: false,%0A roundingPrecision: -1
%0A
+%7D,%0A
-cwd: 'build/css',%0A src: %5B'*.css', '!*.min.css'%5D,
+ target: %7B%0A files: %7B
%0A
@@ -3801,38 +3801,32 @@
les: %7B%0A
- dest:
'dist/static/cs
@@ -3830,36 +3830,70 @@
/css
-',%0A ext: '.m
+/main.min.css': %5B'build/css/_bower.css', 'build/css/ma
in.css'
+%5D
%0A
@@ -3898,17 +3898,16 @@
%7D
-%5D
%0A %7D
|
8c13f0f6f49a082c3d1c96e28e5ef2791d0fe04e
|
Fix jasmine conf
|
Gruntfile.js
|
Gruntfile.js
|
/* jshint node: true */
"use strict";
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
simplemocha: {
options: {
timeout: 3000,
ui: "bdd",
reporter: "spec"
},
all: { src: "test/**/*.js" }
},
jasmine: {
jsverify: {
src: "lib/**/*.js",
options: {
specs: "spec/jsverify/*.js",
helpers: "helpers/*.js"
},
},
},
jshint: {
options: {
jshintrc: ".jshintrc"
},
gruntfile: {
src: "Gruntfile.js",
options: {
node: true,
},
},
lib: {
src: ["lib/**/*.js"]
},
spec: {
src: ["spec/**/*.js"]
},
test: {
src: ["test/**/*.js"],
},
},
watch: {
gruntfile: {
files: "<%= jshint.gruntfile.src %>",
tasks: ["jshint:gruntfile"]
},
lib: {
files: "<%= jshint.lib.src %>",
tasks: ["jshint:lib"]
},
},
literate: {
"README.md": "lib/jsverify.js",
},
});
// Tasks
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-jasmine");
grunt.loadNpmTasks("grunt-simple-mocha");
grunt.loadNpmTasks("grunt-literate");
// Default task.
grunt.registerTask("default", ["jshint"]);
grunt.registerTask("test", ["jshint", "simplemocha", "jasmine"]);
grunt.registerTask("jasmine-build", ["jasmine:jsverify:build"]);
};
|
JavaScript
| 0.999921 |
@@ -468,17 +468,8 @@
pec/
-jsverify/
*.js
|
bed44e2e362125a5b8916ce61b64bda49653ffc9
|
Test firefox on Windows 10.
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
var browsers = [{
browserName: 'firefox',
version: '19',
platform: 'XP'
}, {
browserName: 'googlechrome',
platform: 'OS X 10.11'
}, {
browserName: 'googlechrome',
platform: 'linux'
}, {
browserName: 'internet explorer',
platform: 'WIN8',
version: '10'
}, {
browserName: 'internet explorer',
platform: 'XP',
version: '8'
}];
grunt.initConfig({
connect: {
server: {
options: {
base: '',
port: 9999
}
}
},
jasmine : {
src : ['build/src/**/*.js', 'src/**/*.js'],
options : {
specs : 'build/spec/**/*.js'
}
},
'saucelabs-jasmine': {
all: {
options: {
urls: ['http://127.0.0.1:9999/spec/runner.html'],
tunnelTimeout: 5,
build: process.env.TRAVIS_JOB_ID,
concurrency: 3,
browsers: browsers,
testname: 'honeybadger.js specs',
tags: ['master']
}
}
},
shell: {
compile: {
command: 'make compile'
}
},
watch: {
compile: {
files: ['Makefile', 'spec/**/*.*', 'src/**/*.*', 'spec/runner.html'],
tasks: 'shell:compile'
},
specs: {
files: ['build/spec/**/*.js'],
tasks: 'jasmine'
}
}
});
// Loading dependencies
for (var key in grunt.file.readJSON('package.json').devDependencies) {
if (key !== 'grunt' && key.indexOf('grunt') === 0) grunt.loadNpmTasks(key);
}
grunt.registerTask('dev', ['connect', 'watch']);
grunt.registerTask('test', ['shell:compile', 'connect', 'saucelabs-jasmine']);
};
|
JavaScript
| 0 |
@@ -80,27 +80,8 @@
x',%0A
- version: '19',%0A
@@ -91,18 +91,26 @@
tform: '
-XP
+Windows 10
'%0A %7D, %7B
|
d776faa401ec98b62f1b06094ffb9095846c23c5
|
Update Gruntfile.js
|
Gruntfile.js
|
Gruntfile.js
|
/*
* grunt-po2mo
* https://github.com/MicheleBertoli/grunt-po2mo
*
* Copyright (c) 2013 Michele Bertoli
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'<%= nodeunit.tests %>',
],
options: {
jshintrc: '.jshintrc',
},
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['tmp'],
},
// Configuration to be run (and then tested).
po2mo: {
stage: {
src: 'test/fixtures/fr.po',
dest: 'tmp/fr.mo',
},
prod: {
options: {
deleteSrc: true
},
src: 'tmp/fixtures/fr.po',
dest: 'tmp/fr.mo'
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js'],
},
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.registerTask('copy', 'Copy fixtures to a temp location.', function() {
grunt.file.copy('test/fixtures/fr.po', 'tmp/fixtures/fr.po');
});
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'copy', 'po2mo', 'nodeunit']);
// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);
};
|
JavaScript
| 0 |
@@ -641,32 +641,40 @@
test/fixtures/fr
+/message
.po',%0A de
@@ -680,24 +680,32 @@
est: 'tmp/fr
+/message
.mo',%0A
@@ -792,34 +792,33 @@
src: 'tmp/f
-ixtures/fr
+r/message
.po',%0A
@@ -832,20 +832,95 @@
'tmp/fr
-.mo'
+/message.mo'%0A %7D,%0A multiple: %7B%0A src: %5B'test/fixtures/**/*.po'%5D,
%0A %7D
@@ -1378,24 +1378,32 @@
/fixtures/fr
+/message
.po', 'tmp/f
@@ -1402,26 +1402,25 @@
, 'tmp/f
-ixtures/fr
+r/message
.po');%0A
|
eaab5715d7efb3ed8b2f3a98e6c606a5a6034538
|
delete qunit
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('resizeChecker.jquery.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
src: ['src/<%= pkg.name %>.js'],
dest: 'dist/<%= pkg.name %>.js'
},
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
src: '<%= concat.dist.dest %>',
dest: 'dist/<%= pkg.name %>.min.js'
},
},
qunit: {
files: ['test/**/*.html']
},
jshint: {
gruntfile: {
options: {
jshintrc: '.jshintrc'
},
src: 'Gruntfile.js'
},
src: {
options: {
jshintrc: 'src/.jshintrc'
},
src: ['src/**/*.js']
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/**/*.js']
},
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
src: {
files: '<%= jshint.src.src %>',
tasks: ['jshint:src', 'qunit']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'qunit']
},
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task.
grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify']);
};
|
JavaScript
| 0.000022 |
@@ -2139,17 +2139,8 @@
nt',
- 'qunit',
'cl
|
15be126928a51d33b8fec14ed1da1023c4f99619
|
Use readable names for tests
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.initConfig({
mochaTest: {
test: {
src: 'test/**/*.js'
}
}
});
var aliases = [
'fn',
'fun',
'func',
'lam'
];
grunt.registerTask('build', function() {
var macro = grunt.file.read('./src/macro.js');
var regex = /MACRO_NAME/gm;
grunt.file.write('./macros/index.js', macro.replace(regex, 'λ'));
aliases.forEach(function(name) {
grunt.file.write('./macros/' + name + '/index.js', macro.replace(regex, name));
});
});
grunt.registerTask('alias', function(name, file) {
var macro = grunt.file.read('./src/macro.js');
var regex = /MACRO_NAME/gm;
grunt.file.write(file, macro.replace(regex, name));
});
grunt.registerTask('build-test', function() {
grunt.file.write('./test/tests.js', compileFile('./test/tests.sjs', true));
});
grunt.registerTask('compile', function(fileName) {
console.log(compileFile(fileName));
});
var moduleCtx;
function compileFile(fileName, isTest) {
var macro = grunt.file.read('./macros/index.js');
var test = isTest ? grunt.file.read('./test/macros.sjs') : '';
var file = grunt.file.read(fileName);
var sweet = require('sweet.js');
if (!moduleCtx) moduleCtx = sweet.loadModule(macro);
return sweet.compile(test + file, {
modules:[moduleCtx]
}).code;
}
grunt.registerTask('default', ['build']);
grunt.registerTask('test', ['build', 'build-test', 'mochaTest']);
grunt.loadNpmTasks('grunt-mocha-test');
};
|
JavaScript
| 0.000001 |
@@ -1343,16 +1343,17 @@
modules:
+
%5BmoduleC
@@ -1355,16 +1355,44 @@
duleCtx%5D
+,%0A readableNames: true,
%0A %7D).
|
f5a24aa77fa329fc548fa8314c4d0c6b6cd91617
|
Add `index.js`
|
Gruntfile.js
|
Gruntfile.js
|
/**
* Author: Umayr Shahid <[email protected]>,
* Created: 20:05, 29/06/15.
*/
'use strict';
module.exports = function (grunt) {
require('grunt-timer').init(grunt, {
deferLogs: true,
friendlyTime: true,
color: 'blue'
});
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc',
ignores: [
'node_modules/**/*.js'
],
reporter: require('jshint-stylish')
},
files: [
'Gruntfile.js',
'src/**/*.js'
]
},
jscs: {
options: {
config: '.jscsrc',
esnext: true,
verbose: true,
excludeFiles: [
'node_modules/**/*.js'
],
reporter: 'console'
},
files: {
src: [
'Gruntfile.js',
'src/**/*.js'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
grunt.registerTask('verify', [
'jshint',
'jscs'
]);
};
|
JavaScript
| 0.000001 |
@@ -479,32 +479,29 @@
',%0A '
-src/**/*
+index
.js'%0A %5D
@@ -785,16 +785,13 @@
'
-src/**/*
+index
.js'
|
1919ee25b448e443bdcaf7e1c2f47b21c520eff7
|
Use current rep
|
Gruntfile.js
|
Gruntfile.js
|
/*
* Jappix Me
* Test tasks (uses GruntJS)
*
* Copyright 2014, FrenchTouch Web Agency
* Author: Valérian Saliou <[email protected]>
*/
module.exports = function(grunt) {
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Task: CSSLint
csslint: {
all: {
options: {
/*
* CSS Lint Options
* Reference: https://github.com/gruntjs/grunt-contrib-csslint/blob/master/README.md#options
*/
'important': false,
'duplicate-background-images': false,
'star-property-hack': false,
'adjoining-classes': false,
'box-model': false,
'qualified-headings': false,
'unique-headings': false,
'floats': false,
'font-sizes': false,
'ids': false,
'overqualified-elements': false,
'known-properties': false,
'unqualified-attributes': false,
'universal-selector': false
},
src: [
'../css/*.css',
// Ignored files
'!../app/stylesheets/ie6.css',
'!../app/stylesheets/ie7.css'
]
}
},
// Task: JSHint
jshint: {
files: ['../js/*.js']
},
// Task PHPLint
phplint: {
all: [
'../index.php',
'../php/*.php'
]
}
});
// Load plugins
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-phplint');
// Map tasks
var GRUNT_TASKS_TEST = {
all: [['lint',0]]
};
var GRUNT_TASKS_LINT = {
css: [['csslint',0]],
js: [['jshint',0]],
php: [['phplint',0]]
};
// Register tasks
grunt.registerTask('default', function() {
return grunt.warn('Usage:' + '\n\n' + 'test - grunt test' + '\n\n');
});
grunt.registerTask('test', function() {
for(t in GRUNT_TASKS_TEST) {
for(i in GRUNT_TASKS_TEST[t]) {
grunt.task.run(GRUNT_TASKS_TEST[t][i][0] + (GRUNT_TASKS_TEST[t][i][1] ? (':' + t) : ''));
}
}
});
grunt.registerTask('lint', function(t) {
var lint_t_all = [];
if(t == null) {
for(t in GRUNT_TASKS_LINT) {
lint_t_all.push(t);
}
} else if(typeof GRUNT_TASKS_LINT[t] != 'object') {
return grunt.warn('Invalid lint target name.\n');
} else {
lint_t_all.push(t);
}
for(c in lint_t_all) {
t = lint_t_all[c];
for(i in GRUNT_TASKS_LINT[t]) {
grunt.task.run(GRUNT_TASKS_LINT[t][i][0] + (GRUNT_TASKS_LINT[t][i][1] ? (':' + t) : ''));
}
}
});
};
|
JavaScript
| 0 |
@@ -360,17 +360,16 @@
/*
-
%0A
@@ -1051,17 +1051,16 @@
'.
-.
/css/*.c
@@ -1064,16 +1064,16 @@
*.css',%0A
+
%0A
@@ -1097,33 +1097,32 @@
es%0A '!.
-.
/app/stylesheets
@@ -1145,17 +1145,16 @@
'!.
-.
/app/sty
@@ -1248,17 +1248,16 @@
les: %5B'.
-.
/js/*.js
@@ -1326,17 +1326,16 @@
'.
-.
/index.p
@@ -1349,17 +1349,16 @@
'.
-.
/php/*.p
@@ -2621,8 +2621,9 @@
%7D);%0A%0A%7D;
+%0A
|
092fc9fe656c6d70a22149f2b7c23cb1cefbb981
|
Fix case in file reference
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.initConfig({
replace: {
// expose a couple of methods so they can be unit-tested
exposeTestMethods: {
src: ['src/*.js'],
overwrite: true,
replacements: [{
from: /^(\/(\*)*TESTS.*$)/gm,
to: '/$1'
}]
},
// hide private methods
hideTestMethods: {
src: ['src/*.js'],
overwrite: true,
replacements: [{
from: /^(\/(\/(\*)*TESTS.*$))/gm,
to: '$2'
}]
},
// updates pdfkit for client-side-support
fixPdfKit: {
src: ['node_modules/pdfkit/js/document.js', 'node_modules/pdfkit/js/mixins/fonts.js', 'node_modules/pdfkit/js/font/table.js', 'node_modules/pdfkit/package.json'],
overwrite: true,
replacements: [{
from: /^(\s*mixin = function\()(name)(\) {.*)$/mg,
to: '$1$2, methods$3'
}, {
from: /^(.*require.*\.\/mixins\/'.*$)/mg,
to: '//'
}, {
from: /^(\s*mixin\('([a-zA-Z]*)')(\);)/mg,
to: '$1, require(\'./mixins/$2.js\')$3'
}, {
from: 'return this.font(\'Helvetica\');',
to: ''
},
{
from: /"browserify": {[^}]*},/mg,
to: ''
},
/* IE workaround for no constructor.name */
{
from: 'this.constructor.name.replace',
to: '(this.constructor.name || this.constructor.toString().match(/function (.{1,})\\(/)[1]).replace'
}]
}
},
mochacov: {
test: {
options: {
reporter: '<%= (grunt.option("cc") ? "html-cov" : "spec") %>',
}
},
options: {
files: 'tests',
recursive: true,
'check-leaks': true
}
},
jsdoc: {
dist: {
src: ['src/*.js'],
options: {
destination: 'doc',
a: 'true'
}
}
},
jshint: {
all: [ 'src/**/*.js' ]
},
browserify: {
build: {
files: {
'build/pdfmake.js': ['./src/browser-extensions/pdfMake.js']
},
options: {
require: ['./src/browser-extensions/virtual-fs.js:fs', './src/browser-extensions/pdfmake.js:pdfMake'],
browserifyOptions: {
standalone: 'pdfMake',
}
}
}
},
dump_dir: {
fonts: {
options: {
pre: 'window.pdfMake = window.pdfMake || {}; window.pdfMake.vfs = ',
rootPath: 'examples/fonts/'
},
files: {
'build/vfs_fonts.js': ['examples/fonts/*' ]
}
}
},
uglify: {
build: {
options: {
sourceMap: true,
compress: {
drop_console: true
},
mangle: {
except: ['HeadTable', 'NameTable', 'CmapTable', 'HheaTable', 'MaxpTable', 'HmtxTable', 'PostTable', 'OS2Table', 'LocaTable', 'GlyfTable']
}
},
files: {
'build/pdfmake.min.js': ['build/pdfmake.js']
}
}
}
});
grunt.loadNpmTasks('grunt-mocha-cov');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-dump-dir');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('test', [ 'replace:exposeTestMethods', 'jshint', 'mochacov', 'replace:hideTestMethods' ]);
grunt.registerTask('fixVfsFonts', 'Adds semicolon to the end of vfs_fonts.js', function () {
var file = grunt.file.read('build/vfs_fonts.js');
file += ";";
grunt.file.write('build/vfs_fonts.js', file);
});
grunt.registerTask('buildFonts', [ 'dump_dir', 'fixVfsFonts' ]);
grunt.registerTask('build', [ 'replace:fixPdfKit', 'browserify', 'uglify', 'buildFonts' ]);
grunt.registerTask('default', [ 'test', 'build' ]);
};
|
JavaScript
| 0 |
@@ -1942,25 +1942,25 @@
tensions/pdf
-m
+M
ake.js:pdfMa
|
34022c2dde3caec9dbb2ab115f2f77dadc860e50
|
Add chrome section to karma
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
module.exports = function (grunt) {
var path = require('path');
/**
* Gets the index.html file from the code coverage folder.
*
* @param {!string} folder The path to the code coverage folder.
*/
function getCoverageReport (folder) {
var reports = grunt.file.expand(folder + '*/index.html');
if (reports && reports.length > 0) {
return reports[0];
}
return '';
}
// load all grunt tasks
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint_files_to_test: ['Gruntfile.js', 'modules/**/*.js'],
banner: '/*!\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' *\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' +
' */\n\n',
// Before generating any new files, remove any previously-created files..
clean: {
karma: ['build/reports/tests'],
lint: ['build/reports/lint'],
coverage: ['build/reports/coverage'],
tmp: ['build/tmp']
},
jshint: {
options: {
jshintrc: true
},
test: '<%= jshint_files_to_test %>',
jslint: {
options: {
reporter: 'jslint',
reporterOutput: 'build/reports/lint/jshint.xml'
},
files: {
src: '<%= jshint_files_to_test %>'
}
},
checkstyle: {
options: {
reporter: 'checkstyle',
reporterOutput: 'build/reports/lint/jshint_checkstyle.xml'
},
files: {
src: '<%= jshint_files_to_test %>'
}
}
},
html2js: {
modules: {
options: {
module: null, // no bundle module for all the html2js templates
base: 'modules'
},
files: [
{
expand: true,
src: ['modules/**/*.html'],
ext: '.tpl.js',
dest: 'build/tmp/templates/'
}
]
}
},
open: {
coverage: {
path: path.join(__dirname, getCoverageReport('build/reports/coverage/'))
}
},
karma: {
unit: {
configFile: 'test/karma.conf.js'
},
ci: {
configFile: 'test/karma.conf.js',
colors: false,
reporters: ['progress', 'junit'],
junitReporter: {
outputFile: 'build/reports/tests/baboon-client.xml',
suite: 'baboon_client'
}
},
debug: {
configFile: 'test/karma.conf.js',
detectBrowsers: {
enabled: false
},
singleRun: false
},
coverage: {
configFile: 'test/karma.coverage.conf.js',
colors: false
},
cobertura: {
configFile: 'test/karma.coverage.conf.js',
coverageReporter: {
type: 'cobertura',
dir: 'build/reports/coverage'
},
colors: false
}
}
});
// Register tasks.
grunt.registerTask('lint', ['jshint:test']);
grunt.registerTask('debug', ['clean:tmp', 'html2js', 'karma:debug']);
grunt.registerTask('test', ['clean:tmp', 'html2js', 'jshint:test', 'karma:unit']);
grunt.registerTask('cover', ['clean:tmp', 'html2js', 'clean:coverage', 'jshint:test', 'karma:coverage', 'open:coverage']);
grunt.registerTask('ci', ['clean', 'html2js', 'jshint:jslint', 'jshint:checkstyle', 'karma:ci', 'karma:coverage', 'karma:cobertura']);
// Default task.
grunt.registerTask('default', ['test']);
};
|
JavaScript
| 0 |
@@ -2893,32 +2893,206 @@
%0A %7D,%0A
+ chrome: %7B%0A configFile: 'test/karma.conf.js',%0A detectBrowsers: %7B%0A enabled: false%0A %7D%0A %7D,%0A
ci:
|
e1959bd3229ede3905ca7a85c48d5799c7588f49
|
remove ie11 from test coverage
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
var conf = require('./files.conf.js');
module.exports = function(grunt) {
// GRUNT CONFIGURATION
grunt.initConfig({
pkg: conf.pkg,
jshint: {
files: [
'*.js',
'src/**/*.js',
'*.json',
'.jshintrc',
'test/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
concat: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + '\'use strict\';\n',
process: function(src, filepath) {
return '\n// Source: ' + filepath + '\n' +
src.replace(/'use strict';\n/g, '');
}
},
dist: {
src: conf.stimuliFiles,
dest: conf.distFolder + '<%= pkg.name %>.js'
}
},
copy: {
license: {
src: 'LICENSE',
dest: conf.distFolder
},
readme: {
src: 'README.md',
dest: conf.distFolder
},
blank: {
src: 'src/blank.html',
dest: conf.distFolder + 'blank.html'
}
},
coveralls: {
options: {
coverage_dir: 'coverage'
}
},
hub: {
event_tester: {
src: ['tools/event_tester/Gruntfile.js'],
tasks: ['jshint', 'build:templates']
}
},
jsduck: {
main: {
// source paths with your code
src: [
'src'
],
// docs output dir
dest: conf.distFolder + 'docs',
// extra options
options: {
exclude: [
'src/keyboard/layout/macosx',
'src/keyboard/layout/linux',
'src/keyboard/layout/windows'
],
title: "Stimuli <%= pkg.version %> Documentation"
}
}
}
});
grunt.registerTask('sizzle', function(){
var done = this.async();
grunt.util.spawn({ cmd: 'bower', args: ['install'], opts: {stdio: 'inherit'}}, function() {
grunt.util.spawn({ cmd: 'rm', args: ['-rf', 'lib'], opts: {stdio: 'inherit'}}, function() {
grunt.util.spawn({ cmd: 'mv', args: ['bower_components', 'lib'], opts: {stdio: 'inherit'}}, function() {
grunt.util.spawn({ cmd: 'mv', args: ['lib/sizzle/dist/sizzle.js', 'lib/sizzle/'], opts: {stdio: 'inherit'}}, done);
});
});
});
});
grunt.registerTask('phantom', function(){
var done = this.async();
grunt.util.spawn({
cmd: 'karma',
args: ['start', 'karma.phantom.conf.js', '--browsers',
'PhantomJS'],
opts: {stdio: 'inherit'}
},done);
});
grunt.registerTask('test_coverage', function(){
var done = this.async();
grunt.util.spawn({
cmd: 'karma',
args: ['start', 'karma.coverage.conf.js', '--browsers',
'PhantomJS,Firefox,BS_IE8,BS_IE10,BS_IE11,BS_ANDROID_4,BS_IOS_6'],
opts: {stdio: 'inherit'}
},done);
});
grunt.registerTask('test_all', function(){
var done = this.async();
grunt.util.spawn({
cmd: 'karma',
args: ['start', 'karma.travis.conf.js', '--browsers',
'BS_IE8,BS_IE9,BS_IE10,BS_IE11,BS_FIREFOX,BS_ANDROID_4,BS_ANDROID_41,BS_ANDROID_42,BS_IOS_6,BS_CHROME,BS_SAFARI51,BS_SAFARI6'
],
opts: {stdio: 'inherit'}
},done);
});
grunt.registerTask('watch', function(){
var done = this.async();
grunt.util.spawn({
cmd: 'karma',
args: ['start', 'karma.conf.js'],
opts: {stdio: 'inherit'}
},done);
});
grunt.registerTask('nginx_start', function(){
var done = this.async();
grunt.util.spawn({
cmd: 'nginx',
args: ['-c', '.nginx/nginx.conf', '-p', '.'],
opts: {stdio: 'inherit'}
},done);
});
grunt.registerTask('nginx_stop', function(){
var done = this.async();
grunt.util.spawn({
cmd: 'nginx',
args: ['-c', '.nginx/nginx.conf', '-p', '.', '-s', 'stop'],
opts: {stdio: 'inherit'}
},done);
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jsduck');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-hub');
grunt.loadNpmTasks('grunt-karma-coveralls');
grunt.registerTask('build', [ 'sizzle', 'concat:dist', 'jsduck', 'copy']);
grunt.registerTask('travis', ['jshint', 'build', 'phantom', 'test_coverage', 'coveralls', 'test_all']);
grunt.registerTask('test_travis_local', ['nginx_start', 'build', 'test_all', 'nginx_stop']);
};
|
JavaScript
| 0 |
@@ -3503,24 +3503,16 @@
IE10,BS_
-IE11,BS_
ANDROID_
|
59656824278b5efb2108fdf7d579266cfb1e0f5e
|
Update require shims
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
var
pkg = grunt.file.readJSON('package.json')
;
// project configuration
grunt.initConfig({
pkg: pkg,
jshint: {
all: [
'Gruntfile.js',
'src/js/src/**/*.js'
],
options: {
'boss': true,
'curly': true,
'eqeqeq': true,
'eqnull': true,
'expr': true,
'globals': {
'define': true,
'require': true,
'module': true,
'window': true
},
'immed': true,
'noarg': true,
'onevar': true,
'quotmark': 'single',
'smarttabs': true,
'trailing': true,
'undef': true,
'unused': true
}
},
requirejs: {
build: {
options: {
baseUrl: '.',
appDir: 'src/js/src/', /* source dir */
dir: 'bin/js/', /* output dir */
modules: [
{
name: 'application'
}
],
paths: {
jquery: '../libs/jquery/jquery',
underscore: '../libs/underscore/underscore',
backbone: '../libs/backbone/backbone',
wreqr: '../libs/backbone/backbone.wreqr',
marionette: '../libs/backbone/backbone.marionette',
geppetto: '../libs/backbone/backbone.geppetto',
text: '../libs/require/require.text'
},
shim: {
jquery: {
exports: '$'
},
underscore: {
exports: '_'
},
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
wreqr: {
deps: ['backbone'],
exports: 'Backbone.Wreqr'
},
marionette: {
deps: ['wreqr'],
exports: 'Backbone.Marionette'
},
geppetto: {
deps: ['marionette'],
exports: 'Backbone.Geppetto'
}
},
almond: true, /* simple AMD loader for build files */
wrap: true, /* to use with the almond option */
preserveLicenseComments: false,
logLevel: 1
}
}
},
connect: {
dev: {
options: {
port: 8000,
base: 'src',
keepalive: true
}
},
prod: {
options: {
port: 8000,
base: 'bin',
keepalive: true
}
}
},
copy: {
build: {
files: [
{
src: 'src/index.html',
dest: 'bin/index.html'
}
]
}
},
clean: {
options: {
force: true /* delete files outside of current directory */
},
build: [
'bin/js/core/',
'bin/js/application/',
'bin/js/build.txt'
]
},
'string-replace': {
build: {
files: {
'bin/index.html': 'bin/index.html'
},
options: {
replacements: [
{
pattern: 'data-main="js/src/application" src="js/libs/require/require.js"',
replacement: 'src="js/application.js"'
}
]
}
}
},
lintspaces: {
all: {
src: [
'Gruntfile.js',
'src/js/src/**/*',
'src/scss/**/*'
],
options: {
newline: true,
trailingspaces: true,
indentation: 'tabs'
}
}
},
gitclone: {
ghpages: {
options: {
repository: pkg.repository.url,
branch: 'gh-pages',
directory: 'bin'
}
}
}
});
// load tasks
/* grunt.loadNpmTasks('grunt-contrib-requirejs'); this contrib of
* grunt-require.js doesn't support almond.js in build files. */
grunt.loadNpmTasks('grunt-requirejs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-string-replace');
grunt.loadNpmTasks('grunt-lintspaces');
grunt.loadNpmTasks('grunt-git');
// define tasks
grunt.registerTask('init', [
'gitclone'
]);
grunt.registerTask('validate', [
'jshint',
'lintspaces'
]);
grunt.registerTask('build', [
'copy:build',
'requirejs:build',
'clean:build',
'string-replace:build'
]);
grunt.registerTask('default', [
'validate',
'build'
]);
};
|
JavaScript
| 0 |
@@ -1459,24 +1459,118 @@
r'%0A%09%09%09%09%09%09%7D,%0A
+%09%09%09%09%09%09babysitter: %7B%0A%09%09%09%09%09%09%09deps: %5B'backbone'%5D,%0A%09%09%09%09%09%09%09exports: 'Backbone.BabySitter'%0A%09%09%09%09%09%09%7D,%0A
%09%09%09%09%09%09marion
@@ -1598,16 +1598,30 @@
%5B'wreqr'
+, 'babysitter'
%5D,%0A%09%09%09%09%09
|
f8af711896dd4c1f0fd9fbbdb988250f20ee8429
|
Exclude helpers/ from nodeunit
|
Gruntfile.js
|
Gruntfile.js
|
/*
* grunt
* http://gruntjs.com/
*
* Copyright (c) 2013 "Cowboy" Ben Alman
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
nodeunit: {
all: ['tests/**.js', '!tests/fixtures/**']
},
jshint: {
lib: ['lib/**/*.js'],
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: 'nofunc',
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
node: true,
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-bump');
// "npm test" runs these tasks
grunt.registerTask('test', ['jshint', 'nodeunit']);
// Default task.
grunt.registerTask('default', ['test']);
};
|
JavaScript
| 0.000001 |
@@ -335,16 +335,37 @@
ures/**'
+, '!tests/helpers/**'
%5D%0A %7D,
|
a3f9b0813465655cf2488f74853b1ec1a14489ba
|
Reorder release tasks
|
Gruntfile.js
|
Gruntfile.js
|
"use strict";
module.exports = function (grunt) {
grunt.initConfig({
bump: {
options: {
files: ["package.json"],
commit: true,
commitMessage: "Release %VERSION%",
commitFiles: ["package.json"],
createTag: true,
tagName: "%VERSION%",
tagMessage: "Version %VERSION%",
push: false
}
},
shell: {
options: {
stdout: true,
stderr: true,
failOnError: true
},
push: {
command: "git push -u -f --tags origin master"
},
publish: {
command: "npm publish"
},
update: {
command: "npm-check-updates -u"
},
modules: {
command: "rm -rf node_modules && npm install"
},
heroku : {
command: "git push -u -f --tags heroku master"
}
}
});
grunt.registerTask("update", ["shell:update", "shell:modules"]);
grunt.registerTask("patch", ["bump", "shell:heroku", "shell:push", "shell:publish"]);
grunt.registerTask("minor", ["bump:minor", "shell:heroku", "shell:push", "shell:publish"]);
grunt.registerTask("major", ["bump:major", "shell:heroku", "shell:push", "shell:publish"]);
grunt.registerTask("deploy", ["shell:heroku"]);
grunt.loadNpmTasks("grunt-bump");
grunt.loadNpmTasks("grunt-shell");
};
|
JavaScript
| 0 |
@@ -1187,32 +1187,16 @@
%5B%22bump%22,
- %22shell:heroku%22,
%22shell:
@@ -1209,32 +1209,48 @@
%22shell:publish%22
+, %22shell:heroku%22
%5D);%0A grunt.re
@@ -1284,38 +1284,36 @@
:minor%22, %22shell:
-heroku
+push
%22, %22shell:push%22,
@@ -1300,32 +1300,35 @@
push%22, %22shell:pu
+bli
sh%22, %22shell:publ
@@ -1315,39 +1315,38 @@
ublish%22, %22shell:
-publish
+heroku
%22%5D);%0A grunt.r
@@ -1385,24 +1385,8 @@
or%22,
- %22shell:heroku%22,
%22sh
@@ -1411,16 +1411,32 @@
publish%22
+, %22shell:heroku%22
%5D);%0A
|
d9e47daf67a68942bcca12cb6c32c088d512cdcf
|
add syncRecords implementation
|
Gruntfile.js
|
Gruntfile.js
|
var _ = require('underscore');
module.exports = function(grunt) {
'use strict';
function makeTestArgs(testFile) {
return ['-u exports --recursive -t 10000 ./test/setup.js', testFile].join(' ');
}
function makeUnits(testArgString) {
return [test_runner, testArgString].join(' ');
}
function makeUnitCovers(testArgString) {
return ['istanbul cover --dir cov-unit', test_runner, '--', testArgString].join(' ');
}
// TODO: move these to use the grunt-mocha-test plugin
var tests = [ /* If updating this list of tests, also update test_win.cmd for Windows */
'./test/test_fhutils.js',
'./test/test_fhact.js',
'./test/test_fhdb.js',
'./test/test_fhforms.js',
'./test/test_fhsec.js',
'./test/test_fhsession.js',
'./test/test_fhstat.js',
'./test/test_cache.js',
'./test/test_redis.js',
'./test/test_fhauth.js',
'./test/test_init.js',
'./test/test_log.js',
'./test/test_fhpush.js',
'./test/sync/test_mongodbQueue.js',
'./test/sync/test_index.js',
'./test/sync/test_worker.js',
'./test/sync/test_sync-processor.js',
'./test/sync/test_sync-scheduler.js',
'./test/sync/test_ack-processor.js',
'./test/sync/test_pending-processor.js',
'./test/sync/test_hashProvider.js',
'./test/sync/test_api-sync.js',
'./test/sync/test_dataHandlers.js',
'./test/sync/test_api-syncRecords.js',
'./test/sync/test_default-dataHandlers.js',
];
var unit_args = _.map(tests, makeTestArgs);
var test_runner = '_mocha';
// Just set shell commands for running different types of tests
grunt.initConfig({
mochaTest: {
integration: {
options: {
ui: 'exports',
reporter: 'spec'
},
src: ['integration/**/*.js']
}
},
// These are the properties that grunt-fh-build will use
unit: _.map(unit_args, makeUnits),
unit_cover: _.map(unit_args, makeUnitCovers)
});
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-fh-build');
grunt.registerTask('default', ['fh:default']);
};
|
JavaScript
| 0.000001 |
@@ -1439,17 +1439,16 @@
lers.js'
-,
%0A %5D;%0A
|
f85a0fce36db2047868b81131b6290fc65136a67
|
add charset=UTF-8 to Content-Type in cdn
|
Gruntfile.js
|
Gruntfile.js
|
var fs = require('fs');
var pkg = require('./package');
var cssPrefix = require('css-prefix');
var minor_version = pkg.version.replace(/\.(\d)*$/, '');
var major_version = pkg.version.replace(/\.(\d)*\.(\d)*$/, '');
var path = require('path');
function rename_release (v) {
return function (d, f) {
var dest = path.join(d, f.replace(/(\.min)?\.js$/, '-'+ v + "$1.js"));
return dest;
};
}
module.exports = function (grunt) {
grunt.initConfig({
connect: {
test: {
options: {
// base: "test",
hostname: '*',
port: 9999
}
},
example: {
options: {
hostname: '*',
base: 'example',
port: 3000
}
},
example_https: {
options: {
base: "example",
port: 3000,
protocol: 'https',
hostname: '*',
cert: fs.readFileSync(__dirname + '/test/https_test_certs/server.crt').toString(),
key: fs.readFileSync(__dirname + '/test/https_test_certs/server.key').toString()
}
}
},
browserify: {
debug: {
files: {
'build/auth0-widget.js': ['standalone.js']
},
options: {
debug: true
}
},
},
uglify: {
min: {
files: {
'build/auth0-widget.min.js': ['build/auth0-widget.js']
}
}
},
less: {
dist: {
options: {
paths: ["widget/css"],
},
files: {
"widget/css/main.css": "widget/css/main.less"
}
}
},
autoprefixer: {
options: {
browsers: ['> 1%', 'last 2 versions', 'ff 15', 'opera 12.1', 'ie 8']
},
main: {
src: 'widget/css/main.css',
dest: 'widget/css/main.css',
},
},
prefix: { //this adds "a0-" to every class and id
css: {
src: 'widget/css/main.css',
dest: 'widget/css/main.css',
prefix: 'a0-'
}
},
cssmin: {
minify: {
options: {
keepSpecialComments: 0
},
files: {
'widget/css/main.min.css': ['widget/css/main.css']
}
}
},
copy: {
example: {
files: {
'example/auth0-widget.min.js': 'build/auth0-widget.min.js',
'example/auth0-widget.js': 'build/auth0-widget.js'
}
},
release: {
files: [
{ expand: true, flatten: true, src: 'build/*', dest: 'release/', rename: rename_release(pkg.version) },
{ expand: true, flatten: true, src: 'build/*', dest: 'release/', rename: rename_release(minor_version) },
{ expand: true, flatten: true, src: 'build/*', dest: 'release/', rename: rename_release(major_version) }
]
}
},
exec: {
'test-phantom': {
cmd: 'testem -f testem_dev.yml ci -l PhantomJS',
stdout: true,
stderr: true
},
'test-ie': {
cmd: 'testem ci -l bs_ie_9,bs_ie_10', //disable ,bs_ie_8 is not working
stdout: true,
stderr: true
},
'test-desktop': {
cmd: 'testem ci -l bs_chrome,bs_firefox,bs_ie_9,bs_ie_10', //disable ,bs_ie_8 is not working
stdout: true,
stderr: true
},
'test-mobile': {
cmd: 'testem ci -l bs_iphone_5', //disable ,bs_android_41: is not working
stdout: true,
stderr: true
}
},
clean: {
build: ["release/", "build/", "widget/css/main.css", "widget/css/main.min.css", "example/auth0-widget.js"]
},
watch: {
another: {
files: ['node_modules',
'standalone.js',
'widget/**/*',
'i18n/*'],
tasks: ['build']
}
},
s3: {
options: {
key: process.env.S3_KEY,
secret: process.env.S3_SECRET,
bucket: process.env.S3_BUCKET,
access: 'public-read',
headers: {
'Cache-Control': 'public, max-age=300',
}
},
clean: {
del: [
{
src: 'w2/auth0-widget-' + pkg.version + '.js',
},
{
src: 'w2/auth0-widget-' + pkg.version + '.min.js',
},
{
src: 'w2/auth0-widget-' + major_version + '.js',
},
{
src: 'w2/auth0-widget-' + major_version + '.min.js',
},
{
src: 'w2/auth0-widget-' + minor_version + '.js',
},
{
src: 'w2/auth0-widget-' + minor_version + '.min.js',
}
]
},
publish: {
upload: [
{
src: 'release/*',
dest: 'w2/',
options: { gzip: true }
}
]
}
},
invalidate_cloudfront: {
options: {
key: process.env.S3_KEY,
secret: process.env.S3_SECRET,
distribution: process.env.CDN_DISTRIBUTION
},
production: {
files: [{
expand: true,
cwd: './release/',
src: ['**/*'],
filter: 'isFile',
dest: 'w2/'
}]
}
}
});
grunt.registerMultiTask('prefix', 'Prefix css.', function() {
var css = fs.readFileSync(__dirname + '/' + this.data.src, 'utf8');
var prefixed = cssPrefix(this.data.prefix, css.toString());
fs.writeFileSync(__dirname + '/' + this.data.dest, prefixed);
});
// Loading dependencies
for (var key in grunt.file.readJSON("package.json").devDependencies) {
if (key !== "grunt" && key.indexOf("grunt") === 0) grunt.loadNpmTasks(key);
}
grunt.registerTask("build", ["clean", "less:dist", "prefix:css", "autoprefixer:main", "cssmin:minify",
"browserify:debug", "uglify:min", "copy:example"]);
grunt.registerTask("example", ["connect:example", "build", "watch"]);
grunt.registerTask("example_https", ["connect:example_https", "build", "watch"]);
grunt.registerTask("dev", ["connect:test", "build", "watch"]);
grunt.registerTask("test", ["exec:test-phantom"]);
grunt.registerTask("integration", ["exec:test-desktop", "exec:test-mobile"]);
grunt.registerTask("cdn", ["build", "copy:release", "s3:clean", "s3:publish", "invalidate_cloudfront:production"]);
};
|
JavaScript
| 0.000007 |
@@ -3988,16 +3988,82 @@
e=300',%0A
+ 'Content-Type': 'application/javascript; charset=UTF-8'%0A
|
0a316e2a304bfcd4cf5cd78c89c8d11c51687328
|
Correct error in Grunt register agent task
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
var utils = require('./lib/utils'),
nconf = require('nconf');
nconf.file({ file: 'gebo.json' });
var db = require('./schemata/gebo')(nconf.get('email')),
action = require('./actions/basic')(nconf.get('email'));
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
nodeunit: {
files: ['test/**/*.js', '!test/**/mocks/*.js']
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
apps: {
src: ['app/**/*.js']
},
config: {
src: ['config/**/*.js']
},
lib: {
src: ['lib/**/*.js']
},
routes: {
src: ['routes/**/*.js']
},
// test: {
// src: ['test/**/*.js']
// },
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
lib: {
files: '<%= jshint.lib.src %>',
tasks: ['jshint:lib', 'nodeunit']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'nodeunit']
},
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task.
grunt.registerTask('default', ['jshint', 'nodeunit']);
/**
* Thank you to jaredhanson/passport-local
* https://github.com/jaredhanson/passport-local
*/
grunt.registerTask('dbseed', 'seed the database', function () {
grunt.task.run('registeragent:admin:[email protected]:secret:true');
grunt.task.run('registeragent:bob:[email protected]:secret:false');
grunt.task.run('addfriend:bob:[email protected]:[email protected]');
grunt.task.run('addfriend:admin:[email protected]:[email protected]');
grunt.task.run('setpermission:[email protected]:[email protected]:[email protected]:true:false:false');
grunt.task.run('setpermission:[email protected]:[email protected]:[email protected]:true:false:false');
});
grunt.registerTask('registeragent', 'add an agent to the database',
function (usr, emailaddress, pass, adm) {
// convert adm string to bool
adm = (adm === 'true');
var agent = new db.registrantModel({
name: usr,
email: emailaddress,
password: pass,
admin: adm
});
// save call is async, put grunt into async mode to work
var done = this.async();
agent.save(function (err) {
if (err) {
console.log('Error: ' + err);
done(false);
}
else {
console.log('Registered ' + agent.name);
action.createDatabase({ admin: true,
dbName: utils.getMongoDbName(emailaddress) },
{ profile: agent }).
then(function() {
done();
}).
catch(function(err) {
if (err) {
console.log(err);
done(false);
}
done();
});
}
});
});
grunt.registerTask('dbdrop', 'drop the database',
function () {
// async mode
var done = this.async();
db.connection.db.on('open', function () {
db.connection.db.dropDatabase(function (err) {
if (err) {
console.log('Error: ' + err);
done(false);
}
else {
console.log('Successfully dropped db');
done();
}
});
})
});
/**
* addfriend
*/
grunt.registerTask('addfriend', 'add a friend to the agent specified',
function (name, email, agentEmail, geboUri) {
// Put grunt into async mode
var done = this.async();
utils.getPrivateKeyAndCertificate().
then(function(pair) {
var agentDb = require('./schemata/agent')(agentEmail);
var friend = new agentDb.friendModel({
name: name,
email: email,
uri: geboUri,
myPrivateKey: pair.privateKey,
myCertificate: pair.certificate,
});
// Can't modify ID in findOneAndUpdate
friend._id = undefined;
agentDb.friendModel.findOneAndUpdate({ email: friend.email },
friend.toObject(),
{ upsert: true },
function (err) {
if (err) {
console.log('Error: ' + err);
done(false);
}
else {
console.log('Saved friend: ' + friend.name);
done();
}
});
}).
catch(function(err) {
console.log(err);
done();
});
});
/**
* setpermission
*/
grunt.registerTask('setpermission', 'Set access to an agent\'s resource',
function(friendAgent, ownerAgent, resource, read, write, execute) {
var agentDb = require('./schemata/agent')(ownerAgent);
// Save call is async. Put grunt into async mode to work
var done = this.async();
agentDb.friendModel.findOne({ email: friendAgent },
function(err, friend) {
if (err) {
console.log(err);
}
var index = utils.getIndexOfObject(friend.hisPermissions, 'email', resource);
if (index > -1) {
friend.hisPermissions.splice(index, 1);
}
friend.hisPermissions.push({ email: resource,
read: read === 'true',
write: write === 'true',
execute: execute === 'true',
});
friend.save(function(err) {
if (err) {
console.log(err);
}
done();
});
});
});
};
|
JavaScript
| 0.000001 |
@@ -7,17 +7,16 @@
trict';%0A
-%0A
var util
@@ -3843,16 +3843,27 @@
%7B
+ content: %7B
profile
@@ -3869,16 +3869,18 @@
e: agent
+ %7D
%7D).%0A
|
f8891476c4be26833e118f4984d0637b422148a8
|
fix removing blank characters in grunt-combine
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
module.exports = function (grunt) {
grunt.util.linefeed = '\n';
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: {
full: '/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
' * Licensed under <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
short: '/* <%= pkg.title || pkg.name %> <%= pkg.version %>' +
' | <%= _.pluck(pkg.licenses, "type").join(", ") %> License */\n'
},
// Task configuration.
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= banner.full %>',
process: function(src) {
// remove jslint/jshint options and 'use strict' declaration
return src
.replace(/\/\*js[hl]int.*?\*\/\n/g, '')
.replace(/(^|\n)[ \t]*(['"])use strict\2;\s*/g, '$1');
}
},
base: {
src: ['src/jquery.<%= pkg.name %>.js'],
dest: 'dist/jquery.<%= pkg.name %>.js'
},
extra: {
src: ['src/jquery.<%= pkg.name %>.js', 'src/jquery.<%= pkg.name %>.video.js'],
dest: 'dist/jquery.<%= pkg.name %>.extra.js'
},
simple: {
src: ['src/jquery.<%= pkg.name %>.simple.js'],
dest: 'dist/jquery.<%= pkg.name %>.simple.js'
},
autoload: {
src: ['src/jquery.<%= pkg.name %>.autoload.js'],
dest: 'dist/jquery.<%= pkg.name %>.autoload.js'
},
bg: {
src: ['src/jquery.<%= pkg.name %>.bg.js'],
dest: 'dist/jquery.<%= pkg.name %>.bg.js'
},
print: {
src: ['src/jquery.<%= pkg.name %>.print.js'],
dest: 'dist/jquery.<%= pkg.name %>.print.js'
},
script: {
src: ['src/jquery.<%= pkg.name %>.script.js'],
dest: 'dist/jquery.<%= pkg.name %>.script.js'
},
srcset: {
src: ['src/jquery.<%= pkg.name %>.srcset.js'],
dest: 'dist/jquery.<%= pkg.name %>.srcset.js'
},
video: {
src: ['src/jquery.<%= pkg.name %>.video.js'],
dest: 'dist/jquery.<%= pkg.name %>.video.js'
},
widget: {
src: ['src/jquery.<%= pkg.name %>.widget.js'],
dest: 'dist/jquery.<%= pkg.name %>.widget.js'
}
},
uglify: {
options: {
banner: '<%= banner.short %>',
report: 'gzip'
},
base: {
src: '<%= concat.base.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.min.js'
},
extra: {
src: '<%= concat.extra.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.extra.min.js'
},
simple: {
src: '<%= concat.simple.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.simple.min.js'
},
autoload: {
src: '<%= concat.autoload.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.autoload.min.js'
},
bg: {
src: '<%= concat.bg.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.bg.min.js'
},
print: {
src: '<%= concat.print.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.print.min.js'
},
script: {
src: '<%= concat.script.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.script.min.js'
},
srcset: {
src: '<%= concat.srcset.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.srcset.min.js'
},
video: {
src: '<%= concat.video.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.video.min.js'
},
widget: {
src: '<%= concat.widget.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.widget.min.js'
}
},
qunit: {
files: ['test/**/*.html']
},
jshint: {
gruntfile: {
options: {
jshintrc: '.jshintrc'
},
src: 'Gruntfile.js'
},
src: {
options: {
jshintrc: 'src/.jshintrc'
},
src: ['src/**/*.js']
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/**/*.js']
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
src: {
files: '<%= jshint.src.src %>',
tasks: ['jshint:src', 'qunit']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'qunit']
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task.
grunt.registerTask('default', ['jshint', 'clean', 'concat', 'uglify', 'qunit']);
};
|
JavaScript
| 0.011792 |
@@ -1219,10 +1219,16 @@
t%5C2;
-%5Cs
+%5B %5Ct%5D*%5Cn
*/g,
|
7d5178507d0e5f8f38cddb28b52dd6a8f27b06c9
|
Add clean task
|
Gruntfile.js
|
Gruntfile.js
|
/*
* svg_fallback
*
*
* Copyright (c) 2014 yoksel
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Configuration to be run (and then tested).
svg_fallback: {
options: {
debug: true
},
your_target: {
src: 'test/sources/',
dest: 'test/result/'
}
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
grunt.registerTask('default', ['svg_fallback']);
};
|
JavaScript
| 0.999997 |
@@ -192,16 +192,69 @@
nfig(%7B%0A%0A
+ clean: %7B%0A temp: %5B%22temp%22%5D%0A %7D,%0A
@@ -533,47 +533,33 @@
-// Actually load this plugin's task(s).
+grunt.loadTasks('tasks');
%0A
@@ -565,36 +565,53 @@
grunt.load
+Npm
Tasks('
-tasks
+grunt-contrib-clean
');%0A%0A gru
@@ -638,16 +638,25 @@
ault', %5B
+'clean',
'svg_fal
|
37a225ffd4699615fe78214015f288fa77da54ef
|
use window before Transifex to prevent errors
|
app/assets/javascripts/map/presenters/LayersNavPresenter.js
|
app/assets/javascripts/map/presenters/LayersNavPresenter.js
|
/**
* The LayersNavPresenter class for the LayersNavView.
*
* @return LayersNavPresenter class.
*/
define([
'underscore',
'mps',
'map/presenters/PresenterClass',
'map/services/LayerSpecService'
], function(_, mps, PresenterClass, layerSpecService) {
'use strict';
var LayersNavPresenter = PresenterClass.extend({
init: function(view) {
this.view = view;
this._super();
this.listeners();
},
listeners: function() {
if (!!Transifex) {
Transifex.live.onTranslatePage(function(language_code) {
this.view.fixLegibility();
}.bind(this));
Transifex.live.onDynamicContent(function(new_strings) {
this.view.fixLegibility();
}.bind(this));
}
},
/**
* Application subscriptions.
*/
_subscriptions: [{
'Place/go': function(place) {
this.view._toggleSelected(place.layerSpec.getLayers());
}
},{
'LayerNav/change': function(layerSpec) {
this.view._toggleSelected(layerSpec.getLayers());
}
},{
'Country/update': function(iso) {
this.view.fixLegibility();
}
},{
'Analysis/iso': function(iso, isoDisabled) {
this.view.fixLegibility();
}
}],
initExperiment: function(id){
mps.publish('Experiment/choose',[id]);
},
notificate: function(id){
mps.publish('Notification/open', [id]);
},
/**
* Publish a a Map/toggle-layer.
*
* @param {string} layerSlug
*/
toggleLayer: function(layerSlug) {
var where = [{slug: layerSlug}];
layerSpecService.toggle(where,
_.bind(function(layerSpec) {
mps.publish('LayerNav/change', [layerSpec]);
mps.publish('Place/update', [{go: false}]);
}, this));
},
});
return LayersNavPresenter;
});
|
JavaScript
| 0 |
@@ -469,16 +469,23 @@
if (!!
+window.
Transife
@@ -489,32 +489,39 @@
ifex) %7B%0A
+window.
Transifex.live.o
@@ -629,16 +629,23 @@
+window.
Transife
|
2a5c56794ba90d34efff284e4771b5922f70c1e4
|
Add braintree_error script into manifest
|
app/assets/javascripts/solidus_paypal_braintree/frontend.js
|
app/assets/javascripts/solidus_paypal_braintree/frontend.js
|
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require solidus_paypal_braintree/constants
//= require solidus_paypal_braintree/promise
//= require solidus_paypal_braintree/client
//= require solidus_paypal_braintree/hosted_form
//= require solidus_paypal_braintree/paypal_button
//= require solidus_paypal_braintree/apple_pay_button
|
JavaScript
| 0.000001 |
@@ -395,16 +395,70 @@
ile.%0A//%0A
+//= require solidus_paypal_braintree/braintree_errors%0A
//= requ
|
2af90912a08086e97e1cdce6785857703724414f
|
Update grunt tasks for heroku
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.initConfig({
NODE_MODULES_DIR: 'node_modules/',
STATIC_DIR: 'saleor/static/',
webpack: {
default: require('./webpack.config')
},
browserSync: {
dev: {
bsFiles: {
src: [
"<%= STATIC_DIR %>/css/*.css",
"<%= STATIC_DIR %>/js/*.js",
"saleor/**/*.html"
]
},
options: {
open: false,
port: "3004",
proxy: "localhost:8000",
reloadOnRestart: true,
watchTask: true
}
}
},
copy: {
production: {
files: [
{
expand: true,
dot: true,
cwd: "<%= NODE_MODULES_DIR %>/bootstrap-sass/assets/fonts/bootstrap",
dest: "<%= STATIC_DIR %>/fonts/",
src: [
"*"
]
},
{
expand: true,
dot: true,
cwd: "<%= NODE_MODULES_DIR %>/font-awesome/fonts",
dest: "<%= STATIC_DIR %>/fonts/",
src: [
"*"
]
},
{
expand: true,
dot: true,
cwd: "<%= NODE_MODULES_DIR %>/materialize-sass-origin/font/roboto",
dest: "<%= STATIC_DIR %>/fonts/",
src: [
"*"
]
},
{
expand: true,
dot: true,
cwd: "<%= NODE_MODULES_DIR %>/materialize-sass-origin/font/material-design-icons",
dest: "<%= STATIC_DIR %>/fonts/",
src: [
"*"
]
},
{
expand: true,
dot: true,
cwd: "<%= NODE_MODULES_DIR %>/dropzone/dist",
dest: "<%= STATIC_DIR %>/scss/vendor/",
src: [
"*.css"
],
rename: function(dest, src) {
src = "_" + src;
return dest + src.replace(/\.css$/, ".scss");
}
}
]
}
},
postcss: {
options: {
map: true,
processors: [
require("autoprefixer")
]
},
prod: {
src: [
"<%= STATIC_DIR %>/css/storefront.css",
"<%= STATIC_DIR %>/css/dashboard.css"
]
}
},
sass: {
options: {
sourceMap: true,
includePaths: ["<%= NODE_MODULES_DIR %>"]
},
dist: {
files: {
"<%= STATIC_DIR %>/css/storefront.css": "<%= STATIC_DIR %>/scss/storefront.scss",
"<%= STATIC_DIR %>/css/dashboard.css": "<%= STATIC_DIR %>/scss/dashboard.scss"
}
}
},
watch: {
options: {
atBegin: true,
interrupt: false,
livereload: true,
spawn: false
},
sass: {
files: ["<%= STATIC_DIR %>/scss/**/*.scss"],
tasks: ["sass", "postcss"]
},
uglify: {
files: ["<%= STATIC_DIR %>/js_src/**/*.js", "<%= STATIC_DIR %>/js_src/**/*.jsx"],
tasks: ["webpack"]
}
}
});
require("load-grunt-tasks")(grunt);
grunt.registerTask("default", ["copy", "sass", "postcss", "webpack"]);
grunt.registerTask("sync", ["browserSync", "watch"]);
grunt.registerTask("heroku", ["copy", "sass", "postcss", "babel", "uglify"]);
};
|
JavaScript
| 0 |
@@ -3302,23 +3302,15 @@
%22, %22
-babel%22, %22uglify
+webpack
%22%5D);
|
1396a1392e1497ed2a08e8bba5783409eb1aa8f2
|
modify grunt task copy.image
|
Gruntfile.js
|
Gruntfile.js
|
require("dotenv").config();
var sprintf = require("sprintf-js").sprintf;
module.exports = function(grunt) {
var forProduction = (function() {
var mode = process.env.EXTENSION_MODE || "development";
return mode === "production";
})();
var dist = (function() {
var baseDir = process.env.EXTENSION_DIST || "dist";
if (forProduction) {
return sprintf("%s/<%%= pkg.name %%>-v<%%= pkg.version %%>", baseDir);
} else {
return sprintf("%s/<%%= pkg.name %%>-dev", baseDir);
}
})();
grunt.initConfig({
dist: dist,
pkg: grunt.file.readJSON("package.json"),
locales: grunt.file.readJSON("src/_locales/ja/messages.json"),
meta: {
banner: "/*!\n" +
" * <%= locales.meta_name.message %> v<%= pkg.version %>\n" +
" *\n" +
" * Copyright (c) <%= grunt.template.today('yyyy') %> smori <[email protected]>\n" +
" * Licensed under the MIT license.\n" +
" *\n" +
" * Date <%= grunt.template.today('yyyy-mm-dd HH:MM:ss') %>\n" +
" */\n"
},
qunit: {
files: []
},
clean: {
options: {
force: true
},
dist: [
"<%= dist %>"
]
},
copy: {
manifest: {
expand: true,
cwd: "src",
src: "manifest.json",
dest: "<%= dist %>/"
},
locales: {
expand: true,
cwd: "src",
src: "_locales/**/*",
dest: "<%= dist %>/"
},
html: {
expand: true,
cwd: "src",
src: "html/**/*.html",
dest: "<%= dist %>/"
},
template: {
expand: true,
cwd: "src",
src: "template/**/*.html",
dest: "<%= dist %>/"
},
js: {
expand: true,
cwd: "src",
src: "js/lib/**/*",
dest: "<%= dist %>/"
},
css: {
expand: true,
cwd: "src",
src: "css/**/*.css",
dest: "<%= dist %>/"
},
image: {
expand: true,
cwd: "src",
src: "image/**/*.png",
dest: "<%= dist %>/"
}
},
concat: {
tbmBackground: {
options: {
banner: "<%= meta.banner %>"
},
src: [
"src/js/tbm/HEAD.js",
"src/js/tbm/util.js",
"src/js/tbm/setting.js",
"src/js/tbm/background.HEAD.js",
"src/js/tbm/background.*.js"
],
dest: "<%= dist %>/js/tbm.background.js"
},
tbmFront: {
options: {
banner: "<%= meta.banner %>"
},
src: [
"src/js/tbm/HEAD.js",
"src/js/tbm/util.js",
"src/js/tbm/setting.js",
"src/js/tbm/user.*.js",
"src/js/tbm/bookmark.*.js"
],
dest: "<%= dist %>/js/tbm.front.js"
},
mainBackground: {
options: {
banner: "<%= meta.banner %>"
},
src: [
"src/js/main/background.js"
],
dest: "<%= dist %>/js/main.background.js"
},
mainOptions: {
options: {
banner: "<%= meta.banner %>"
},
src: [
"src/js/main/options.js"
],
dest: "<%= dist %>/js/main.options.js"
},
mainPopup: {
options: {
banner: "<%= meta.banner %>"
},
src: [
"src/js/main/front.js",
"src/js/main/popup.js"
],
dest: "<%= dist %>/js/main.popup.js"
}
},
jshint: {
options: {
force: true,
browser: true,
curly: true,
eqeqeq: true,
forin: true
},
all: [
"Gruntfile.js",
"src/js/main/*.js",
"src/js/tbm/*.js"
]
},
watch: {
files: [
"src/js/tbm/*.js",
"src/js/main/*.js"
],
tasks: ["jshint"]
}
});
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask("default", ["jshint", "clean", "copy", "concat"]);
};
|
JavaScript
| 0.000001 |
@@ -2244,16 +2244,68 @@
src:
+ %5B%0A %22image/**/*.gif%22,%0A
%22image/
@@ -2313,16 +2313,30 @@
*/*.png%22
+%0A %5D
,%0A
|
55f901d3e8c4a7310954842b5ceed88d02917ba6
|
rebuild added to speed up development
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function( grunt ) {
'use strict';
// helper function to load task configs
function loadConfig( path, config ) {
var glob = require( 'glob' );
var object = {}
, key;
glob.sync('*', { cwd: path })
.forEach(function( option ) {
key = option.replace( /\.js$/, '' );
object[key] = require( path + option )( config );
});
return object;
}
// actual config
var config = {
pkg: grunt.file.readJSON('package.json')
, env: process.env
, __dirname: __dirname
};
grunt.util._.extend(config, loadConfig( './tasks/options/', config ));
grunt.initConfig(config);
// load grunt tasks
require('load-grunt-tasks')(grunt);
// local tasks
grunt.loadTasks('tasks');
// clean
// grunt.registerTask('clean' , [ 'clean' ]);
// test
grunt.registerTask('coverage' , [ 'clean:coverage', 'blanket', 'copy:coverage', 'mochaTest:instrumented', 'mochaTest:lcov', 'mochaTest:coverage' ]);
grunt.registerTask('test' , [ /*'jshint', 'eslint',*/ 'mochaTest:test' ]);
// build
grunt.registerTask('build' , [ 'browserify', 'copy:client' ]);
grunt.registerTask('build:test' , [ 'browserify:test' ]);
// auto build
// grunt.registerTask('default' , [ 'watch' ]);
// docker containers
grunt.registerTask('dock' , [ 'dock:dev:build', 'dock:dev:start' ]);
// local dev servers
grunt.registerTask('serve' , [ 'nodemon:dev' ]);
grunt.registerTask('serve:local' , [ 'nodemon:local' ]);
// travis-ci
grunt.registerTask('ci' , [ 'coverage', 'coveralls' ]);
};
|
JavaScript
| 0 |
@@ -504,17 +504,16 @@
fig = %7B%0A
-%0A
@@ -553,17 +553,16 @@
.json')%0A
-%0A
,
@@ -578,17 +578,16 @@
ess.env%0A
-%0A
,
@@ -607,17 +607,16 @@
dirname%0A
-%0A
%7D;%0A%0A
@@ -1304,32 +1304,95 @@
serify:test' %5D);
+%0A grunt.registerTask('rebuild' , %5B 'clean', 'build' %5D);
%0A%0A // auto bu
@@ -1619,24 +1619,35 @@
' , %5B
+ 'rebuild',
'nodemon:de
@@ -1694,16 +1694,27 @@
al' , %5B
+ 'rebuild',
'nodemo
|
7b40f9f5876f20cce2daee290277c343c10e4d50
|
clean up gruntfile
|
Gruntfile.js
|
Gruntfile.js
|
var util = require('./config/grunt/utils.js');
var files = require('./config/files');
module.exports = function (grunt) {
var APP_VERSION = util.getVersion();
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take.
require('time-grunt')(grunt);
var port = process.env.PORT || 3000;
grunt.initConfig({
APP_VERSION:APP_VERSION,
pkg: grunt.file.readJSON('package.json'),
meta : {
files : ['Gruntfile.js', 'dist/*.js', 'test/**/*.js', 'src/**/*.js', 'config/**/*.js'],
dist : ["dist/*.js"],
port: port
},
jshint: {
files: '<%= meta.files %>',
options: {
// options here to override JSHint defaults
jshintrc: '.jshintrc'
}
},
jsbeautifier : {
files : '<%= meta.dist %>'
},
concat: {
options: {
separator: '\n',
process: function(src){
return src
.replace(/%VERSION%/g, APP_VERSION.full)
.replace(/%WEBSITE%/g, APP_VERSION.website)
.replace(/%LICENSE%/g, APP_VERSION.license)
.replace(/%CONTRIBUTOR%/g, APP_VERSION.contributor)
.replace(/%APP_NAME%/g, APP_VERSION.appname)
.replace(/%DESCRIPTION%/g, APP_VERSION.description);
}
},
minify:{
src: [
'src/header.js',
'dist/log-ex-unobtrusive.min.js'
],
dest: 'dist/log-ex-unobtrusive.min.js'
},
dist: {
src: [
'src/header.js',
'src/module.prefix',
'src/declarations.js',
// < ----------------
'src/enhanceObj/obj.prefix',
'src/enhanceObj/main.js',
// <------- eLogger Start
'src/eLogger/obj.prefix',
'src/eLogger/logger.js',
'src/eLogger/globals.js',
'src/eLogger/obj.suffix',
// <------- eLogger End
// <------- extras Start
'src/extras/extras.js',
// <------- extras End
'src/enhanceObj/globals.js',
'src/enhanceObj/obj.suffix',
// < ----------------
'src/module.suffix',
// <--------- provider func start
'src/providerFunc/main.js',
'src/providerFunc/provider.suffix'
],
dest: 'dist/log-ex-unobtrusive.js'
}
},
karma: {
options: {
singleRun: true,
browsers: ['PhantomJS']
},
'1.0.x': {
options : {
files: files.getAngularFiles('1.0').concat(files.libs, files.tests('1.0'))
},
configFile: 'config/karma.conf.js'
},
'1.1.x': {
options : {
files: files.getAngularFiles('1.1').concat(files.libs, files.tests('1.1'))
},
configFile: 'config/karma.conf.js'
},
'1.1.2': {
options : {
files: files.getAngularFiles('1.1.2').concat(files.libs, files.tests('1.1.2'))
},
configFile: 'config/karma.conf.js'
},
'1.2.x': {
options : {
files: files.getAngularFiles('1.2').concat(files.libs, files.tests('1.2'))
},
configFile: 'config/karma.conf.js'
},
latest: {
options : {
files: files.getAngularFiles().concat(files.libs, files.tests('1.2'))
},
configFile: 'config/karma.conf.js'
},
coverage: {
configFile : 'config/karma.lcov.conf.js'
}
},
watch: {
files: '<%= meta.files %>',
tasks: ['jshint', 'karma:unit']
},
coveralls: {
options: {
coverage_dir: 'lcov'
}
},
bump: {
options: {
files: ['package.json'],
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['-a'], // '-a' for all files
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%'
}
},
shell: {
changelog: {
command: 'git changelog --tag <%= APP_VERSION.full %>'
},
open:{
command: 'node sample_app/scripts/web-server'
}
},
jsonlint: {
sample: {
src: [ 'package.json', 'bower.json' ]
}
},
clean: {
dist: ['dist/'],
cover: ['coverage/']
},
minified : {
files: {
src: [
'dist/log-ex-unobtrusive.js'
],
dest: 'dist/'
},
options : {
sourcemap: true,
allinone: false,
ext: '.min.js'
}
},
express: {
options: {
port: port
},
dev: {
options: {
script: 'sample_app/server.js',
debug: false
}
}
},
open: {
server: {
path: 'http://localhost:<%= meta.port %>'
}
}
});
grunt.registerTask('bower_update', 'Update bower version', function (arg1) {
if(arguments.length === 0) {
util.updateBowerVersion(APP_VERSION.full);
}
else {
util.updateBowerVersion(arg1);
}
});
grunt.registerTask('test', [
'clean:cover',
'jshint',
'jsonlint',
'karma:1.0.x', 'karma:1.1.x', 'karma:1.2.x', 'karma:1.1.2', 'karma:latest'
]);
grunt.registerTask('minify', ['minified' ,'concat:minify']);
grunt.registerTask('dist', ['test', 'clean:dist','concat:dist', 'jsbeautifier', 'minify', 'bower_update']);
grunt.registerTask('fixes', ['bump:patch', 'dist']);
grunt.registerTask('changelog', ['shell:changelog']);
grunt.registerTask('serve', ['express:dev', 'open', 'watch']);
grunt.registerTask('default', ['test', 'karma:coverage', 'coveralls']);
};
|
JavaScript
| 0.000001 |
@@ -5023,104 +5023,8 @@
%25%3E'%0A
- %7D,%0A open:%7B%0A command: 'node sample_app/scripts/web-server'%0A
|
c2a6b5c2adf07fa2b278c6d5ceebd1a36f342ac8
|
disable sourcemap of css because .scss is not in public
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var through = require('through');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
function globalJQ(rules) {
return function(file) {
var filename = file.replace(/\\/g, '/');
var matched = rules.some(function(rule) {
if (rule instanceof RegExp && rule.test(filename) || typeof rule === 'string' && ~filename.indexOf(rule))
return true;
});
if (!matched)
return through();
var stream = through(write, end);
var data = ';(function(__ojq__, __jq__) {\nwindow.jQuery = window.$ = __jq__;\n';
function write(buf) {
data += buf;
}
function end() {
data += '\n;window.jQuery = window.$ = __ojq__;\n}).call(window, window.jQuery, require(\'jquery\'));';
stream.queue(data);
stream.queue(null);
}
return stream;
};
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
githooks: {
setup: {
'pre-commit': 'git-pre-commit'
}
},
jshint: {
options: {
jshintrc: true,
reporter: require('jshint-stylish')
},
all: {
src: [
'*.js',
'src/**/*.js'
]
}
},
uglify: {
dist: {
options: {
sourceMap: true
},
files: {
'dist/scripts/main.js': ['dist/scripts/main.js']
}
}
},
browserify: {
dist: {
options: {
transform: [globalJQ(['jquery-ui', 'fotorama', 'sticky-kit']), 'browserify-shim', 'debowerify']
},
files: {
'dist/scripts/main.js': ['src/scripts/main.js']
}
}
},
watch: {
styles: {
files: ['src/styles/*.scss'],
tasks: ['sass']
},
scripts: {
files: ['*.js', 'src/scripts/{pages/,}*.js', '!src/scripts/all-plugins.js'],
tasks: ['jshint', 'browserify']
},
plugins: {
files: ['src/scripts/plugins/*.js'],
tasks: ['plugin-require', 'jshint', 'browserify']
}
},
clean: {
dist: {
files: {
src: 'dist/*'
}
}
},
sass_imports: {
options: {
banner: ''
},
dist: {
files: {
'src/styles/_imports.scss': [
'bower_components/jquery-ui/themes/base/{core,draggable,resizable}.css',
'bower_components/fotorama/fotorama.css',
'bower_components/toastr/toastr.css'
]
}
}
},
sass: {
options: {
style: 'compressed'
},
dist: {
files: {
'dist/styles/main.css': [
'src/styles/main.scss'
]
}
}
},
copy: {
dist: {
files: [{
expand: true,
cwd: 'bower_components/fotorama',
src: ['*.png'],
dest: 'dist/styles'
}, {
expand: true,
cwd: 'src/styles',
src: ['*.{gif,jpg,png}'],
dest: 'dist/styles'
}, {
expand: true,
cwd: 'bower_components/zeroclipboard/dist',
src: ['*.swf'],
dest: 'dist/scripts'
}, {
expand: true,
cwd: 'bower_components/bootstrap-sass-official/assets',
src: ['fonts/**'],
dest: 'dist'
}]
}
}
});
grunt.registerTask('plugin-require', function() {
var dir = 'src/scripts';
var files = glob.sync(dir + '/plugins/*.js');
var reqs = files.map(function(file) {
return 'require(\'' + file.replace(dir, '.') + '\');';
});
var body = '\'use strict\';\n\n// Auto generated. See grunt "plugin-require" task.\n' + reqs.join('\n') + '\n';
var filename = path.join(dir, 'all-plugins.js');
fs.writeFileSync(filename, body);
console.log('File "' + filename + '" created.');
});
grunt.registerTask('build', [
'jshint',
'clean',
'plugin-require',
'browserify',
'uglify',
'sass_imports',
'sass',
'copy:dist'
]);
grunt.registerTask('git-pre-commit', [
'jshint'
]);
grunt.registerTask('default', [
'build',
]);
};
|
JavaScript
| 0.000001 |
@@ -1423,19 +1423,20 @@
rceMap:
-tru
+fals
e%0A
@@ -1899,16 +1899,20 @@
: %5B'sass
+:dev
'%5D%0A
@@ -2666,24 +2666,40 @@
sass: %7B%0A
+ dist: %7B%0A
option
@@ -2707,24 +2707,26 @@
: %7B%0A
+
+
style: 'comp
@@ -2731,32 +2731,34 @@
mpressed'%0A
+
%7D,%0A dist: %7B
@@ -2742,36 +2742,152 @@
%7D,%0A
-dist
+ files: %7B%0A 'dist/styles/main.css': %5B%0A 'src/styles/main.scss'%0A %5D%0A %7D%0A %7D,%0A dev
: %7B%0A file
@@ -2929,34 +2929,32 @@
s': %5B%0A
-
'src/styles/main
@@ -4285,16 +4285,21 @@
'sass
+:dist
',%0A '
|
cb1bec8ee21af24bcd1b46b7d99f52b64934445a
|
Change copyright holder to `Symantec`
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
/* jshint camelcase: false */
module.exports = function ( grunt ) {
require( 'load-grunt-tasks' )( grunt );
require( 'time-grunt' )( grunt );
// Define the configuration for all the tasks
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require( 'jshint-stylish' )
},
all: [
'Gruntfile.js',
'src/js/{,*/}*.js'
],
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: [ 'test/spec/{,*/}*.js' ]
}
},
// Empties folders to start fresh
clean: {
dist: {
files: [ {
dot: true,
src: [
'.tmp',
'dist/*',
'!dist/.git*'
]
} ]
},
server: '.tmp'
},
// Add vendor prefixed styles
autoprefixer: {
options: {
browsers: [ 'last 2 version' ]
},
dist: {
files: [ {
expand: true,
cwd: '.tmp/css/',
src: '{,*/}*.css',
dest: '.tmp/css/'
} ]
}
},
// Compiles Sass to CSS and generates necessary files if requested
sass: {
options: { },
dist: {
files: {
'.tmp/css/zeus-widgets.css': 'src/sass/index.scss'
}
}
},
concat: {
dist: {
src: [ 'src/js/*.js' ],
dest: '.tmp/js/zeus-widgets.js'
}
},
jscs: {
src: [
'app/js/{,*/}*.js',
'test/spec/{,*/}*.js'
],
options: {
config: '.jscsrc'
}
},
uglify: {
options: {
banner: '/*! Copyright (C) <%= grunt.template.today("yyyy") %>. ' +
'ZeusJS \n' +
'<%= pkg.name %> - v<%= pkg.version %>.' +
'<%= process.env.BUILD_NUMBER %> */\n',
compress: {
drop_console: true
},
preserveComments: false
},
dist: {
files: {
'dist/js/zeus-widgets.min.js': [
'dist/js/zeus-widgets.js'
]
}
}
},
// The following *-min tasks produce minified files in the dist folder
cssmin: {
options: {
root: '.',
keepSpecialComments: 0,
banner: '/*! Copyright (C) <%= grunt.template.today("yyyy") %>. ' +
'ZeusJS \n' +
'<%= pkg.name %> - v<%= pkg.version %>.' +
'<%= process.env.BUILD_NUMBER %> */\n'
},
target: {
files: {
'dist/css/zeus-widgets.min.css': [ '.tmp/css/*.css' ]
}
}
},
// ng-annotate tries to make the code safe for minification automatically
// by using the Angular long form for dependency injection.
ngAnnotate: {
dist: {
files: [ {
expand: true,
cwd: '.tmp/js',
src: 'zeus-widgets.js',
dest: 'dist/js'
} ]
}
},
ngdocs: {
options: {
dest: 'docs',
html5Mode: false,
title: 'Zeus Widgets',
startPage: '/api',
editExample: false,
styles: [
'docs/css/zeus.css'
],
scripts: [
'docs/js/vendor.js',
'docs/js/angular-animate.min.js',
'docs/js/zeus-ui.js'
]
},
api: [
'src/js/*.js'
]
},
sloc: {
'source-code': {
files: {
code: [
'src/js/*.js',
'src/sass/*.scss'
]
}
},
tests: {
files: {
test: [
'spec/**/*.js',
'mock_views/*.html'
]
}
}
},
// Copies remaining files to places other tasks can use
copy: {
docs: {
files: [
{
expand: true,
flatten: true,
cwd: '.tmp/concat/scripts',
dest: 'docs/js',
src: [ '*.js' ]
},
{
expand: true,
flatten: true,
cwd: 'dist/css',
dest: 'docs/css',
src: [ '*.css' ]
} ]
},
build: {
files: [
{
expand: true,
flatten: true,
cwd: 'src/sass',
dest: 'dist/sass',
src: [ '*.scss' ]
},
{
expand: true,
flatten: true,
cwd: 'src/html',
dest: 'dist/html',
src: [ '*.html' ]
}
]
}
},
// Test settings
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
livereload: {
options: {
open: true,
base: [
'.tmp',
'src'
]
}
},
test: {
options: {
port: 9001,
base: [
'.tmp',
'test',
'dist'
]
}
},
dist: {
options: {
base: 'dist'
}
}
}
} );
grunt.registerTask( 'lint', [
'jscs',
'jshint:all'
] );
grunt.registerTask( 'test', [
'lint',
'jshint:test',
'karma'
] );
grunt.registerTask( 'docs', [
'copy:docs',
'ngdocs'
] );
grunt.registerTask( 'build', [
'test',
'clean:dist',
'sass',
'autoprefixer',
'concat',
'ngAnnotate',
'copy:build',
// 'docs',
'cssmin',
'uglify',
'sloc'
] );
};
|
JavaScript
| 0.000004 |
@@ -2233,38 +2233,52 @@
+%0A '
-ZeusJS
+Symantec Corporation
%5Cn' +%0A
@@ -3040,14 +3040,28 @@
'
-ZeusJS
+Symantec Corporation
%5Cn'
|
f84fa6bb38757e7e7e563dc85e0d37975342fd21
|
include license
|
Gruntfile.js
|
Gruntfile.js
|
/*!
* Zafree's Gruntfile
* http://zafree.github.io/salt
* Copyright 2014-2015 Zafree
* Licensed under MIT (https://github.com/zafree/salt/blob/master/LICENSE)
*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
' * Salt v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * Copyright 2014-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' */\n',
less: {
development: {
options: {
banner: '<%= banner %>\n',
compress: false,
yuicompress: true,
optimization: 2,
},
files: {
"dist/css/<%= pkg.name %>.css": "less/bootaide.less"
},
build: {
src: ['less/bootaide.less'],
dest: 'dist/css/<%= pkg.name %>.css'
}
}
},
cssmin: {
options: {
banner: '<%= banner %>\n',
},
dist: {
src: ['dist/css/<%= pkg.name %>.css'],
dest: 'dist/css/<%= pkg.name %>.min.css'
}
},
concat: {
options: {
banner: '<%= banner %>\n',
separator: ';',
},
dist: {
src: ['js/**.js'],
dest: 'dist/js/<%= pkg.name %>.js'
},
},
uglify: {
options: {
banner: '<%= banner %>',
},
dist: {
src: ['dist/js/<%= pkg.name %>.js'],
dest: 'dist/js/<%= pkg.name %>.min.js'
}
},
watch: {
less: {
files: 'less/**/*.less',
tasks: ['less'],
options: {
livereload: true
}
},
cssmin: {
files: 'less/**/*.less',
tasks: ['cssmin'],
options: {
livereload: true
}
},
concat: {
files: 'js/*.js',
tasks: ['concat'],
options: {
livereload: true
}
},
uglify: {
files: 'js/*.js',
tasks: ['uglify'],
options: {
livereload: true
}
},
html: {
files: ['**/*.html'],
options: {
spawn: false,
livereload: true
}
}
},
connect: {
server: {
options: {
port: 9090,
base: '.',
open: true,
livereload: true
}
}
}
});
// Load the plugin that provides the task.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
// Default task(s).
grunt.registerTask('build', ['less','cssmin','concat','uglify']);
// Creates the `server` task
grunt.registerTask('serve', ['connect', 'watch']);
};
|
JavaScript
| 0.000001 |
@@ -483,24 +483,109 @@
hor %25%3E%5Cn' +%0A
+ ' * Licensed under %3C%25= pkg.license.type %25%3E (%3C%25= pkg.license.url %25%3E)%5Cn' +%0A
|
9ab89d9e422381cf98e305703b967cd8f6f647b7
|
clean tasks
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
eslint: {
target: ['Gruntfile.js', 'lib/**/*.js', 'routes/**/*/js', 'public/javascripts/*.js', 'test/**/*.js']
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js']
}
},
watch: {
// files: ['<%= eslint.target %>'],
// tasks: ['eslint']
}
});
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('test', ['mochaTest']);
grunt.registerTask('lint', ['eslint']);
grunt.registerTask('default', ['eslint']);
};
|
JavaScript
| 0.000342 |
@@ -1,9 +1,8 @@
-%0A
module.e
@@ -400,21 +400,21 @@
%7D,%0A
-watch
+shell
: %7B%0A
@@ -419,70 +419,405 @@
-// files: %5B'%3C%25= eslint.target %25%3E'%5D,%0A // tasks: %5B'eslint'%5D
+templateSource: 'views/client-side/*.pug',%0A templateOutput: 'public/javascripts/template',%0A options: %7B%0A stderr: false%0A %7D,%0A template: %7B%0A command: 'pug %3C%25= shell.templateSource %25%3E -D -c --name-after-file -o %3C%25= shell.templateOutput %25%3E'%0A %7D,%0A puglint: %7B%0A command: './node_modules/pug-lint/bin/pug-lint ./views/*.pug ./views/client-side/*.pug'%0A %7D
%0A
@@ -838,39 +838,51 @@
unt.
-loadNpm
+register
Task
-s
('
-grunt-mocha-test'
+template', %5B'shell:template'%5D
);%0A
@@ -892,46 +892,45 @@
unt.
-loadNpm
+register
Task
-s
('
-grunt-contrib-watch'
+test', %5B'mochaTest'%5D
);%0A
-%0A
gr
@@ -947,33 +947,40 @@
erTask('
-test', %5B'mochaTes
+puglint', %5B'shell:puglin
t'%5D);%0A
@@ -999,16 +999,18 @@
erTask('
+es
lint', %5B
@@ -1050,24 +1050,35 @@
'default', %5B
+'puglint',
'eslint'%5D);%0A
|
b89f33c27fe8efab95436414b625ee553cc45ac9
|
Remove the copyright header
|
Gruntfile.js
|
Gruntfile.js
|
/**
* grunth-cli
* https://github.com/EE/grunth-cli
*
* Author Michał Gołębiowski <[email protected]>
* Copyright Laboratorium EE (http://laboratorium.ee/en)
* Licensed under the MIT license.
*/
'use strict';
const assert = require('assert');
module.exports = function (grunt) {
require('time-grunt')(grunt);
let defaultName = 'default';
grunt.initConfig({
eslint: {
all: {
src: [
'*.js',
'bin/grunth',
'lib/*.js',
],
},
},
jscs: {
all: {
src: '<%= eslint.all.src %>',
options: {
config: '.jscsrc',
},
},
},
});
// Load all grunt tasks matching the `grunt-*` pattern.
require('load-grunt-tasks')(grunt);
grunt.registerTask('asserts', function () {
assert(process.execArgv.indexOf('--harmony_scoping') !== -1,
'The harmony_scoping flag wasn\'t passed to the process');
try {
/* eslint-disable no-eval */
eval('function* f() {yield 2;} const g = f(); g.next();');
/* eslint-ensable no-eval */
} catch (e) {
throw new Error('Generators not recognized!');
}
});
grunt.registerTask('lint', [
'eslint',
'jscs',
]);
grunt.registerTask('test', [
'lint',
'asserts',
]);
grunt.registerTask(defaultName, ['test']);
};
|
JavaScript
| 0.000005 |
@@ -1,207 +1,4 @@
-/**%0A * grunth-cli%0A * https://github.com/EE/grunth-cli%0A *%0A * Author Micha%C5%82 Go%C5%82%C4%99biowski %[email protected]%3E%0A * Copyright Laboratorium EE (http://laboratorium.ee/en)%0A * Licensed under the MIT license.%0A */%0A%0A
'use
|
bbb0d4f0e892cefa8aaf4cb21c442745f567cdef
|
improve files plugin re #386
|
component/ckeditor/resources/media/ckeditor/extras/files/plugin.js
|
component/ckeditor/resources/media/ckeditor/extras/files/plugin.js
|
var iframeWindow = null;
CKEDITOR.plugins.add('files',
{
requires: [ 'iframedialog' ],
icons: 'images',
init: function( editor )
{
var height = 480, width = 750;
CKEDITOR.dialog.addIframe(
'filesDialog',
'files',
'?option=com_ckeditor&container=files-files&view=files&type=file&layout=dialog&tmpl=dialog', width, height,
function() {
var iframe = document.getElementById( this._.frameId );
iframeWindow = iframe.contentWindow;
var dialog = CKEDITOR.dialog.getCurrent();
var editor = dialog.getParentEditor();
var selected = CKEDITOR.plugins.link.getSelectedLink( editor );
if(editor.getSelection().getSelectedText()){
iframeWindow.document.id('image-text').set('value', editor.getSelection().getSelectedText());
}
if(selected){
iframeWindow.document.id('image-url').set('value',selected.getAttribute('href'));
iframeWindow.document.id('image-alt').set('value',selected.getAttribute('alt'));
iframeWindow.document.id('image-title').set('value',selected.getAttribute('title'));
iframeWindow.document.id('target').set('value',selected.getAttribute('target'));
}
},
{ // userDefinition
onOk : function()
{
var iframedocument = iframeWindow.document;
var src = iframedocument.id('image-url').get('value');
var link = iframedocument.id('image-text').get('value');
var target = iframedocument.id('target').get('value');
var attrs = {};
['alt', 'title','type'].each(function(id) {
var value = iframedocument.id('image-'+id).get('value');
if (value) {
attrs[id] = value;
}
});
var str = '<a href="'+src+'" ';
var parts = [];
parts.push('target='+target);
$each(attrs, function(value, key) {
parts.push(key+'="'+value+'"');
});
str += parts.join(' ')+' >';
str += link+"</a>";
// puts the image in the editor
this._.editor.insertHtml(str);
},
onShow : function()
{
this.parts.dialog.addClass('image_dialog');
}
}
);
editor.addCommand( 'filesDialog', new CKEDITOR.dialogCommand( 'filesDialog' ) );
editor.ui.addButton( 'files',
{
label: 'File Dialog',
command: 'filesDialog',
icon: this.path + 'images/image.png'
});
if ( editor.contextMenu ) {
editor.addMenuGroup( 'fileGroup' );
editor.addMenuItem( 'fileItem', {
label: 'Edit File Link',
icon: this.path + 'images/image.png',
command: 'filesDialog',
group: 'fileGroup'
});
editor.contextMenu.addListener( function( ) {
var element = CKEDITOR.plugins.link.getSelectedLink( editor );
//we only want to show this if the type = application
if ( element.getAttribute('type').search('application') != -1) {
return { fileItem: CKEDITOR.TRISTATE_OFF };
}
});
}
}
}
);
function showDialogPlugin(e){
e.openDialog('files.dlg');
}
|
JavaScript
| 0 |
@@ -3830,17 +3830,50 @@
ication%0A
-%0A
+ if(element)%7B%0A
@@ -3880,24 +3880,27 @@
+
if ( element
@@ -3976,16 +3976,20 @@
+
return %7B
@@ -4024,16 +4024,42 @@
_OFF %7D;%0A
+ %7D%0A
|
a2400daa556852622e0944d46fc47ca8d6f4aa67
|
Use .jshintrc instead of the hardcoded JSHint configuration in Gruntfile.js.
|
Gruntfile.js
|
Gruntfile.js
|
// Gruntfile
module.exports = function(grunt) {
'use strict'
require('load-grunt-tasks')(grunt);
var baseJsSourcePath = 'src/js/',
fileToBuild = 'dist/js/' + 'proact.js';
grunt.initConfig({
concat: {
dist: {
src: '<%= customBuild.files %>',
dest: fileToBuild
}
},
wrap: {
modules: {
src: [fileToBuild],
dest: '',
options: {
wrapper: [
';(function (pro) {\n' +
'\tif (typeof module === "object" && typeof module.exports === "object") {\n' +
'\t\tmodule.exports = pro();\n' +
'\t} else {\n' +
'\t\twindow.Pro = window.ProAct = window.P = pro();\n' +
'\t}\n' +
'}(function() {', '\treturn Pro;\n}));'
],
indent: '\t',
separator: '\n'
}
}
},
uglify: {
main: {
files: {
'dist/js/proact.min.js': ['dist/js/proact.js']
}
}
},
clean: {
dist: ['tmp', 'dist']
},
jshint: {
all: ['src/js/**/*.js'],
options: {
curly: true,
multistr: true,
quotmark: 'single',
camelcase: false,
bitwise: false,
unused: true,
eqeqeq: true,
indent: 2,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
boss: true,
es5: true,
eqnull: true,
evil: true,
scripturl: true,
smarttabs: true,
maxparams: 5,
maxdepth: 3,
maxlen: 100,
globals: {}
}
},
jsdoc : {
dist : {
src: ['src/js/**/*.js'],
options: {
destination: 'doc'
}
}
},
pkg: grunt.file.readJSON('package.json'),
yuidoc: {
compile: {
name: '<%= pkg.name %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '<%= pkg.homepage %>',
logo: '../proact_logo_icon.png',
options: {
linkNatives: true,
paths: [
'src/js/core',
'src/js/properties',
'src/js/streams',
'src/js/arrays',
'src/js/dsl'
],
exclude: [
'events',
'flow',
'objects',
].join(','),
outdir: 'doc',
themedir: '../yuidoc-bootstrap-theme',
helpers: ['../yuidoc-bootstrap-theme/helpers/helpers.js']
}
}
},
todo: {
options: {
verbose: true,
marks: [
{
name: 'TODO',
pattern: /TODO|\@todo/,
color: "magenta"
}
]
},
src : [
'spec/unit/flow/flow.spec.js',
'spec/unit/arrays/array.spec.js',
'src/js/core/pro.js',
'src/js/flow/queue.js',
'src/js/flow/queues.js',
'src/js/flow/flow.js',
'src/js/core/actor_util.js',
'src/js/core/actor.js',
'src/js/core/event.js',
'src/js/core/core.js',
'src/js/streams/stream.js',
'src/js/streams/buffered_stream.js',
'src/js/streams/size_buffered_stream.js',
'src/js/streams/delayed_stream.js',
'src/js/streams/throttling_stream.js',
'src/js/streams/debouncing_stream.js',
'src/js/streams/subscribable_stream.js',
'src/js/arrays/array.js',
'src/js/arrays/listeners.js',
'src/js/properties/value_event.js',
'src/js/properties/property.js',
'src/js/dsl/registry.js',
'src/js/dsl/provider.js'
]
},
compress: {
main: {
options: {
mode: 'gzip'
},
files: [
{expand: true, src: ['dist/js/proact.min.js'], dest: '', ext: '.min.gz.js'}
]
}
},
karma: {
unit: {
configFile: 'spec/config/karma.conf.js',
keepalive: true
},
integration: {
configFile: 'spec/config/karma.integration.conf.js',
keepalive: true
},
coverage: {
configFile: 'spec/config/karma.coverage.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}
}
});
grunt.registerTask('setup', 'build task', function() {
var defaultFiles = [
'core/pro',
'flow/queue',
'flow/queues',
'flow/flow',
'core/actor_util',
'core/actor',
'core/event',
'core/core',
'streams/stream',
'streams/buffered_stream',
'streams/size_buffered_stream',
'streams/delayed_stream',
'streams/throttling_stream',
'streams/debouncing_stream',
'streams/subscribable_stream',
'properties/value_event',
'properties/property',
'properties/auto_property',
'properties/object_property',
'properties/array_property',
'properties/proxy_property',
'properties/property_provider',
'properties/object_core',
'arrays/array_core',
'arrays/array',
'arrays/listeners',
'objects/prob',
'dsl/registry',
'dsl/dsl',
'dsl/provider',
],
args = this.args, customFiles = [], index, i = -1;
if (args.length) {
while (++i < args.length) {
index = defaultFiles.indexOf(args[i]);
if (index !== -1) {
defaultFiles.splice(index, 1);
}
}
}
customFiles = defaultFiles.map(function(currentFile) {
return baseJsSourcePath + currentFile + '.js';
});
grunt.config.set('customBuild.files', customFiles);
});
grunt.registerTask('build', ['clean:dist', 'setup', 'concat', 'wrap', 'uglify', 'compress', 'karma:integration']);
grunt.registerTask('spec', ['karma:unit']);
grunt.registerTask('all', ['lint', 'todo', 'spec', 'jsdoc', 'build']);
grunt.registerTask('default', ['build']);
};
|
JavaScript
| 0 |
@@ -1110,506 +1110,29 @@
-curly: true,%0A multistr: true,%0A quotmark: 'single',%0A camelcase: false,%0A bitwise: false,%0A unused: true,%0A eqeqeq: true,%0A indent: 2,%0A immed: true,%0A latedef: true,%0A newcap: true,%0A noarg: true,%0A sub: true,%0A boss: true,%0A es5: true,%0A eqnull: true,%0A evil: true,%0A scripturl: true,%0A smarttabs: true,%0A maxparams: 5,%0A maxdepth: 3,%0A maxlen: 100,%0A globals: %7B%7D
+jshintrc: '.jshintrc'
%0A
|
3b638b244656ee0b50f649e6b94c99158c491739
|
set graphite back to default backend
|
exampleConfig.js
|
exampleConfig.js
|
/*
Required Variables:
port: StatsD listening port [default: 8125]
Graphite Required Variables:
(Leave these unset to avoid sending stats to Graphite.
Set debug flag and leave these unset to run in 'dry' debug mode -
useful for testing statsd clients without a Graphite server.)
graphiteHost: hostname or IP of Graphite server
graphitePort: port of Graphite server
Optional Variables:
backends: an array of backends to load. Each backend must exist
by name in the directory backends/. If not specified,
the default graphite backend will be loaded.
debug: debug flag [default: false]
address: address to listen on over UDP [default: 0.0.0.0]
port: port to listen for messages on over UDP [default: 8125]
mgmt_address: address to run the management TCP interface on
[default: 0.0.0.0]
mgmt_port: port to run the management TCP interface on [default: 8126]
debugInterval: interval to print debug information [ms, default: 10000]
dumpMessages: log all incoming messages
flushInterval: interval (in ms) to flush to Graphite
percentThreshold: for time information, calculate the Nth percentile(s)
(can be a single value or list of floating-point values)
[%, default: 90]
keyFlush: log the most frequently sent keys [object, default: undefined]
interval: how often to log frequent keys [ms, default: 0]
percent: percentage of frequent keys to log [%, default: 100]
log: location of log file for frequent keys [default: STDOUT]
console:
prettyprint: whether to prettyprint the console backend
output [true or false, default: true]
log: log settings [object, default: undefined]
backend: where to log: stdout or syslog [string, default: stdout]
application: name of the application for syslog [string, default: statsd]
level: log level for [node-]syslog [string, default: LOG_INFO]
repeater: an array of hashes of the for host: and port:
that details other statsd servers to which the received
packets should be "repeated" (duplicated to).
e.g. [ { host: '10.10.10.10', port: 8125 },
{ host: 'observer', port: 88125 } ]
*/
{
graphitePort: 2003
, graphiteHost: "graphite.host.com"
, port: 8125
, backends: [ "./backends/repeater" ]
, repeater: [ { host: "10.8.3.214", port: 8125 } ]
}
|
JavaScript
| 0.000001 |
@@ -2542,24 +2542,24 @@
ackends/
-repea
+graphi
te
-r
%22 %5D%0A, re
|
77066a2fdd50f06a7e7e1aae722b095bccfd03ee
|
Update Gruntfile
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.initConfig({
modernizr: {
dist: {
"parseFiles": true,
"customTests": [],
"devFile": "node_modules/modernizr/src/Modernizr.js",
"dest": "assets/dist/js/custom-modernizr.min.js",
files: {
src: [
'assets/js/utils/check-html5.js',
]
},
"uglify": true
}
},
webpack: {
js: {
entry: "./assets/js/main.js",
output: {
path: "./assets/dist/js",
filename: "packed.js",
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015'],
plugins: ['transform-runtime']
}
}
]
}
},
},
concat: {
js: {
src: [
'node_modules/pace-progress/pace.js',
'node_modules/tether/dist/js/tether.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/mustache/mustache.js',
'node_modules/js-cookie/src/js.cookie.js',
'node_modules/db.js/dist/db.min.js',
'node_modules/bootpag/lib/jquery.bootpag.js',
'node_modules/codemirror/lib/codemirror.js',
'node_modules/codemirror/mode/xml/xml.js',
'node_modules/pnotify/dist/pnotify.js',
'node_modules/pnotify/dist/pnotify.buttons.js',
'node_modules/pnotify/dist/pnotify.confirm.js',
'node_modules/urijs/src/URI.js',
'node_modules/dropzone/dist/dropzone.js',
'node_modules/datatables.net/js/jquery.dataTables.js',
'node_modules/datatables.net-buttons/js/dataTables.buttons.js',
'node_modules/datatables.net-buttons/js/buttons.html5.js',
'node_modules/datatables.net-buttons/js/buttons.colVis.js',
'node_modules/datatables.net-select/js/dataTables.select.js',
'node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.js',
'node_modules/datatables.net-colreorder/js/dataTables.colReorder.js',
'node_modules/jszip/dist/jszip.js',
'node_modules/file-saver/FileSaver.js'
],
dest: 'assets/dist/js/vendor.js',
nonull: true
},
css: {
src: [
'node_modules/pace-progress/themes/white/pace-theme-big-counter.css',
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/font-awesome/css/font-awesome.css',
'node_modules/pnotify/dist/pnotify.css',
'node_modules/pnotify/dist/pnotify.buttons.css',
'node_modules/pnotify/dist/pnotify.brighttheme.css',
'node_modules/codemirror/lib/codemirror.css',
'node_modules/dropzone/dist/dropzone.css',
'node_modules/animate.css/animate.css',
'node_modules/datatables.net/css/jquery.dataTables.bootstrap.css',
'node_modules/datatables.net-bs/css/dataTables.bootstrap.css',
'node_modules/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.css'
],
dest: 'assets/dist/css/vendor.css',
nonull: true
}
},
copy: {
fontawesome: {
expand: true,
dot: true,
cwd: 'node_modules/font-awesome',
src: ['fonts/*.*'],
dest: 'assets/dist'
}
},
watch: {
options: {
livereload: true
},
js: {
files: ['assets/js/**/*.js'],
tasks: ['webpack', 'modernizr']
}
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-modernizr');
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('dev', ['modernizr:dist', 'webpack', 'concat', 'copy',
'watch']);
grunt.registerTask('build', ['modernizr:dist', 'webpack', 'concat',
'copy']);
};
|
JavaScript
| 0.000001 |
@@ -1,12 +1,47 @@
+var webpack = require('webpack');%0A%0A
module.expor
@@ -63,17 +63,16 @@
runt) %7B%0A
-%0A
grun
@@ -733,14 +733,14 @@
e: %22
-packed
+bundle
.js%22
@@ -1231,32 +1231,265 @@
%7D
+,%0A plugins: %5B%0A new webpack.optimize.UglifyJsPlugin(%7B%0A compress: %7B%0A warnings: false%0A %7D%0A %7D)%0A %5D
%0A %7D,%0A
@@ -1478,33 +1478,32 @@
%5D%0A %7D
-,
%0A %7D,%0A%0A
@@ -1840,211 +1840,25 @@
les/
-mustache/mustache.js',%0A 'node_modules/js-cookie/src/js.cookie.js',%0A 'node_modules/db.js/dist/db.min.js',%0A 'node_modules/bootpag/lib/jquery.bootpag
+db.js/dist/db.min
.js'
@@ -2119,76 +2119,8 @@
s',%0A
- 'node_modules/pnotify/dist/pnotify.confirm.js',%0A
@@ -2991,16 +2991,23 @@
/vendor.
+bundle.
js',%0A
@@ -3714,95 +3714,8 @@
s',%0A
- 'node_modules/datatables.net/css/jquery.dataTables.bootstrap.css',%0A
@@ -3953,16 +3953,23 @@
/vendor.
+bundle.
css',%0A
|
1228efb034f49bdea3f6c32f22aa9b980ac417fc
|
update gruntfile
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
paths: {
src: {
app: {
clinic: 'src/clinic.js',
chw: 'src/chw.js',
personal: 'src/personal.js'
},
clinic: [
'src/index.js',
'src/utils.js',
'<%= paths.src.app.clinic %>',
'src/init.js'
],
chw: [
'src/index.js',
'src/utils.js',
'<%= paths.src.app.chw %>',
'src/init.js'
],
personal: [
'src/index.js',
'src/utils.js',
'<%= paths.src.app.personal %>',
'src/init.js'
],
all: [
'src/**/*.js'
]
},
dest: {
clinic: 'go-app-clinic.js',
chw: 'go-app-chw.js',
personal: 'go-app-personal.js'
},
test: {
clinic: [
'test/setup.js',
'src/utils.js',
'<%= paths.src.app.clinic %>',
'test/clinic.test.js'
],
chw: [
'test/setup.js',
'src/utils.js',
'<%= paths.src.app.chw %>',
'test/chw.test.js'
],
personal: [
'test/setup.js',
'src/utils.js',
'<%= paths.src.app.personal %>',
'test/personal.test.js'
]
}
},
jshint: {
options: {jshintrc: '.jshintrc'},
all: [
'Gruntfile.js',
'<%= paths.src.all %>'
]
},
watch: {
src: {
files: ['<%= paths.src.all %>'],
tasks: ['build']
}
},
concat: {
clinic: {
src: ['<%= paths.src.clinic %>'],
dest: '<%= paths.dest.clinic %>'
},
chw: {
src: ['<%= paths.src.chw %>'],
dest: '<%= paths.dest.chw %>'
},
personal: {
src: ['<%= paths.src.personal %>'],
dest: '<%= paths.dest.personal %>'
}
},
mochaTest: {
options: {
reporter: 'spec'
},
test_clinic: {
src: ['<%= paths.test.clinic %>']
},
test_chw: {
src: ['<%= paths.test.chw %>']
},
test_personal: {
src: ['<%= paths.test.personal %>']
}
}
});
grunt.registerTask('test', [
'jshint',
'build',
'mochaTest'
]);
grunt.registerTask('build', [
'concat',
]);
grunt.registerTask('default', [
'build',
'test'
]);
};
|
JavaScript
| 0.000001 |
@@ -1048,32 +1048,234 @@
%5D,%0A
+ optout: %5B%0A 'src/index.js',%0A 'src/utils.js',%0A '%3C%25= paths.src.app.optout %25%3E',%0A 'src/init.js'%0A %5D,%0A
@@ -1273,32 +1273,32 @@
all: %5B%0A
-
@@ -1488,32 +1488,76 @@
app-personal.js'
+,%0A optout: 'go-app-optout.js'
%0A %7D,%0A
@@ -2179,32 +2179,243 @@
rsonal.test.js'%0A
+ %5D,%0A optout: %5B%0A 'test/setup.js',%0A 'src/utils.js',%0A '%3C%25= paths.src.app.optout %25%3E',%0A 'test/optout.test.js'%0A
@@ -3171,24 +3171,160 @@
ersonal %25%3E'%0A
+ %7D,%0A optout: %7B%0A src: %5B'%3C%25= paths.src.optout %25%3E'%5D,%0A dest: '%3C%25= paths.dest.optout %25%3E'%0A
@@ -3628,32 +3628,32 @@
est_personal: %7B%0A
-
@@ -3684,24 +3684,116 @@
rsonal %25%3E'%5D%0A
+ %7D,%0A test_optout: %7B%0A src: %5B'%3C%25= paths.test.optout %25%3E'%5D%0A
|
6944ed9c85e4dfcbb3f616de99bf0167b81093c9
|
modify tasks
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
var os = require('os');
var interfaces = os.networkInterfaces();
var addresses = [];
for (var k in interfaces) {
for (var k2 in interfaces[k]) {
var address = interfaces[k][k2];
if (address.family === 'IPv4' && !address.internal) {
addresses.push(address.address);
}
}
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sassdoc: {
default: {
src: 'src',
options: {
dest: 'docs/sass/'
}
}
},
jshint: {
myFiles: ['app/scripts/*.js'],
options: {
jshintrc: 'grunt/.jshintrc'
}
},
compass: {
default: {
options: {
config: 'grunt/config.rb'
}
}
},
ts: {
default: {
outDir: '.tmp/scripts/typescript/',
src: 'app/scripts/typescript/*.ts',
baseDir: 'app/scripts/typescript'
}
},
uglify: {
default: {
files: {
'.tmp/scripts/all.min.js': [
'app/scripts/**.js'
]
}
}
},
minifyHtml: {
options: {
cdata: true
},
default: {
files: {
'.tmp/index.html': 'app/markup/index.html',
'.tmp/ui.html': 'app/markup/ui.html'
}
}
},
image: {
static: {
options: {
optipng: true,
},
files: {
}
},
dynamic: {
files: [{
expand: true,
cwd: 'app/images',
filter: 'isFile',
src: '**.{png,jpg,gif}',
dest: '.tmp/images'
}]
}
},
watch: {
scripts: {
files: ['app/scripts/*.js'],
tasks: ['jshint', 'uglify']
},
typescript: {
files: ['app/scripts/typescript/*.ts'],
tasks: ['clean:ts', 'ts', 'jshint', 'uglify']
},
sass: {
files: ['app/styles/*.scss', 'app/styles/**/*.scss'],
tasks: ['compass']
},
partials: {
files: ['app/markup/src/*.html', 'app/markup/src/_includes/*.tpl'],
tasks: ['includereplace', 'minifyHtml']
},
images: {
files: ['app/images/*.png', 'app/images/*.jpg', 'app/images/*.gif'],
tasks: ['image']
}
},
connect: {
server: {
port: {
port: 9001,
base: '.tmp',
livereload: true,
keepalive: true,
open: true
}
}
},
"http-server": {
default: {
root: '.tmp',
port: 9001,
customPages: {
'/bower_components/normalize-css/normalize.css': 'bower_components/normalize-css/normalize.css'
}
}
},
clean: {
default: [".tmp"]
},
htmllint: {
all: ["app/markup/*.html"],
options: {
'id-class-ignore-regex': "^unlint",
force: true
}
},
includereplace: {
default: {
options: {
includesDir: 'app/markup/src/_includes'
},
files: [{
src: '*.html',
dest: "app/markup",
expand: true,
cwd: 'app/markup/src'
}]
}
}
});
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
grunt.registerTask( 'default' ,[ 'jshint', 'sassdoc' ]);
grunt.registerTask( 'jsall' ,[ 'ts', 'jshint', 'uglify' ]);
grunt.registerTask( 'htmlall' ,[ 'includereplace', 'htmllint', 'minifyHtml']);
};
|
JavaScript
| 0.000012 |
@@ -1548,20 +1548,20 @@
'
-.tmp
+dist
/index.h
@@ -1567,25 +1567,19 @@
html': '
-app/marku
+.tm
p/index.
@@ -1589,65 +1589,8 @@
l',%0A
- '.tmp/ui.html': 'app/markup/ui.html'%0A
@@ -2600,20 +2600,16 @@
/markup/
-src/
*.html',
@@ -2621,29 +2621,18 @@
/markup/
-src/_includes
+**
/*.tpl'%5D
@@ -3543,25 +3543,19 @@
all: %5B%22
-app/marku
+.tm
p/*.html
@@ -3811,12 +3811,8 @@
kup/
-src/
_inc
@@ -3925,25 +3925,19 @@
dest: %22
-app/marku
+.tm
p%22,%0A
@@ -4006,12 +4006,8 @@
rkup
-/src
'%0A
@@ -4174,21 +4174,8 @@
int'
-, 'sassdoc'
@@ -4225,16 +4225,16 @@
( '
-jsall'
+scripts'
,%5B
@@ -4257,29 +4257,16 @@
'uglify'
-
%5D);
@@ -4300,12 +4300,12 @@
html
-all'
+'
,%5B
@@ -4332,30 +4332,17 @@
tmllint'
-, 'minifyHtml'
+
%5D);%0A%0A%7D;%0A
|
64fa6d38223888f7a5f7daa60015642a99a9a404
|
Fix mincss target description
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
var js = [
'static/js/jquery-2.1.3.js',
'static/js/chess.js',
'static/js/chessboard-0.3.0.js',
'static/js/client.js'
];
var css = [
'static/css/bootstrap.css',
'static/css/chessboard-0.3.0.css',
'static/css/style.css'
];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
compress: true,
mangle: true,
sourceMap: true
},
target: {
files: {
'static/js/client.min.js': js
}
}
},
cssmin: {
options: {
sourceMap: true,
keepSpecialComments: 0
},
target: {
files: css
}
},
watch: {
js: {
files: js,
tasks: ['uglify']
},
css: {
files: css,
tasks: ['cssmin']
}
}
});
grunt.registerTask('default', ['uglify', 'cssmin']);
};
|
JavaScript
| 0.012956 |
@@ -827,19 +827,69 @@
files:
-css
+%7B%0A 'static/css/style.min.css': css%0A %7D
%0A %7D
|
00165ef7c923e04d813a698ef52e44d6a49a0cef
|
return non-string null as linkage
|
src/formatter-jsonapi/lib/link.js
|
src/formatter-jsonapi/lib/link.js
|
import _ from 'lodash';
import relate from './relate';
export default function (model, opts={}) {
var links = {};
var primaryType = model.constructor.typeName;
var linkWithoutIncludes = opts.linkWithoutInclude || [];
var linkWithIncludes = opts.linkWithInclude || [];
var exporter = opts.exporter;
var topLevelLinker = opts.topLevelLinker;
if (topLevelLinker) {
links.self = '/' + opts.baseType + '/' + opts.baseId + '/links/' + opts.baseRelation;
links.related = '/' + opts.baseType + '/' + opts.baseId + '/' + opts.baseRelation;
topLevelLinker(links);
} else {
// To-one link relations that were not explictly included. For
// example, a record in a database of employees might look like this:
// {
// "id": "1",
// "name": "tyler",
// "position_id": "1"
// }
// The output of that record in json-api notation would be:
// {
// "id": "1",
// "name": "tyler",
// "links": {
// "self": "/employees/1/links/position",
// "related": "/employees/1/position"
// }
// }
linkWithoutIncludes.reduce(function (result, relationName) {
var id = model.id;
var link = {
self: '/' + primaryType + '/' + id + '/links/' + relationName,
related: '/' + primaryType + '/' + id + '/' + relationName
};
result[relationName] = link;
return result;
}, links);
// Link relations that were explictly included, adding the associated
// resources to the top level "included" object
linkWithIncludes.reduce(function (result, relationName) {
var id = model.id;
var related = relate(model, relationName);
var relatedType = related.model ? related.model.typeName : related.constructor.typeName;
var link = {
self: '/' + primaryType + '/' + id + '/links/' + relationName,
related: '/' + primaryType + '/' + id + '/' + relationName
};
if (related.models) {
// if the related is an array, we have a hasMany relation
link.linkage = related.reduce(function (result, model) {
var id = String(model.id);
var linkObject = {
id: id,
type: relatedType
};
// exclude nulls and duplicates, the point of a links
// entry is to provide linkage to related resources,
// not a full mapping of the underlying data
if (id && !_.findWhere(result, linkObject)) {
result.push(linkObject);
}
return result;
}, []);
if (exporter) {
related.forEach(function (model) {
exporter(model);
});
}
} else {
// for singular resources
if (related.id) {
link.linkage = {
type: relatedType,
id: String(related.id)
};
} else {
link.linkage = 'null';
}
if (exporter) {
exporter(related);
}
}
result[relationName] = link;
return result;
}, links);
// always add a self-referential link
links.self = '/' + primaryType + '/' + model.id;
}
return links;
}
|
JavaScript
| 0.02237 |
@@ -2892,14 +2892,12 @@
e =
-'
null
-'
;%0A
|
2c83d814f9a3403e630b79272f715755c14e02ae
|
Copy lib/ and config.js to build/
|
Gruntfile.js
|
Gruntfile.js
|
/*
* Copyright (C) 2014 James Ye, Simon Shields
*
* This file is part of SBHS-Timetable-Node.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
GIT_RV: require('fs').readFileSync('.git/refs/heads/master').toString().trim(),
GIT_RV_SHORT: require('fs').readFileSync('.git/refs/heads/master').toString().trim().substr(0,6),
uglify: {
options: {
banner: '/*! <%= pkg.name %> rev. <%= GIT_RV_SHORT %> License: https://www.gnu.org/licenses/agpl-3.0.html (C) 2014.' +
' Built: <%= grunt.template.today("yyyy-mm-dd H:MM Z") %> */\n',
compress: {
drop_console: true,
global_defs: {
DEBUG: false,
RELEASE: true
},
dead_code: true
},
mangle: true
},
dynamic_mappings: {
expand: true,
src: ['script/belltimes.concat.js'],
dest: 'build/',
ext: '.js',
extDot: 'last'
}
},
jshint: {
files: ['script/*.js', 'server.js', 'lib/*.js'],
options: {
jshintrc: true,
reporter: require('jshint-stylish'),
}
},
run: {
options: {
wait: true,
},
target: {
args: [ 'server.js' ],
}
},
cssmin: {
minify: {
expand: true,
cwd: 'style',
src: ['**/*.css', '!**/*.min.css'],
dest: 'build/style/',
ext: '.css'
}/*, TODO this makes css files 2x bigger - do we really want it?
add_banner: {
options: {
banner: '/* <%= pkg.name %> License: https://www.gnu.org/licenses/agpl-3.0.html (C) 2014. Built: <%= grunt.template.today("yyyy-mm-dd H:MM Z") %>'
},
files: [{
expand: true,
src: 'build/style/**.min.css',
dest: 'build/style/',
flatten: true,
}]
},*/
},
copy: {
main: {
expand: true,
src: ['dynamic/**', 'static/**', 'server.js', 'secret.js'],
dest: 'build/',
},
vars: {
src: 'variables_rel.js',
dest: 'build/variables.js',
options: {
process: function(content, srcpath) {
return content + '\nGIT_RV = \'' + grunt.config.get('GIT_RV') + '\';\n';
}
}
}
},
concat: {
dist: {
src: ['script/*.js', '!script/belltimes.concat.js'],
dest: 'script/belltimes.concat.js'
}
},
'delete': {
run: 'true'
},
nodemon: {
dev: {
script: 'server.js',
options: {
callback: function(nm) {
nm.on('restart', function() {
if (require('fs').existsSync('/tmp/timetable.sock')) {
require('fs').unlinkSync('/tmp/timetable.sock');
}
grunt.task.run('concat');
console.log();
console.log('[nodemon] *** RESTARTING ***');
console.log();
});
},
ignore: ['node_modules/**', 'Gruntfile.js', 'script/*', 'style/*', 'static/*']
}
}
},
watch: {
scripts: {
files: ['script/**.js', '!script/*.concat.js'],
tasks: ['concat']
},
content: {
files: ['style/*.css', 'dynamic/*.jade'],
tasks: ['reload']
}
},
concurrent: {
develop: {
tasks: ['watch', 'nodemon'],
options: {
logConcurrentOutput: true
}
}
},
reload: {
why: 'is this necessary?'
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerMultiTask('delete', 'delete stuff', function() {
if (process.platform !== 'win32' && require('fs').existsSync('/tmp/timetable.sock')) {
require('fs').unlinkSync('/tmp/timetable.sock');
grunt.log.writeln(this.target + ': deleted /tmp/timetable.sock');
}
else {
grunt.log.writeln(this.target + ': nothing happened');
}
});
grunt.registerMultiTask('reload', 'tell a process to reload', function() {
require('fs').writeFile('.reload', '1');
});
grunt.registerTask('minify', ['uglify', 'cssmin']);
grunt.registerTask('release', ['jshint', 'concat', 'minify', 'copy']);
grunt.registerTask('default', ['delete', 'concat', 'concurrent:develop', 'delete']);
};
|
JavaScript
| 0 |
@@ -2488,14 +2488,24 @@
', '
-secret
+lib/**', 'config
.js'
|
1b8575331ba9cfe7b8306e2b7498f93afc5ca5a7
|
fix environment option
|
tasks/sails_tasks.js
|
tasks/sails_tasks.js
|
/*
* grunt-sails-tasks
* https://github.com/tobalsgithub/grunt-sails-tasks
*
* Copyright (c) 2015 TC
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Please see the Grunt documentation for more information regarding task
// creation: http://gruntjs.com/creating-tasks
grunt.registerMultiTask('sails_tasks', 'A grunt command to run 1 off tasks with sails', function() {
var sails = require('sails');
var asyncFn;
var fns = this.data.functions;
var done = this.async();
var series = this.data.series;
if (!fns || !fns.length) {
return grunt.fail.fatal('Missing required field "functions"');
}
if (!(fns instanceof Array)) {
fns = [fns];
}
var liftSails = function (config, cb) {
if (sails.config) {
return cb();
}
sails.lift(config, cb);
};
liftSails({
port: -1,
environment: this.options('env') || process.env.NODE_ENV,
tasks: true
}, function (err, sails) {
if (err) {
grunt.fail.fatal('Could not lift sails', err);
return done();
}
if (series) {
asyncFn = async.series;
} else {
asyncFn = async.parallel;
}
asyncFn(fns, function (err) {
if (err) {
grunt.fail.fatal('An error occurred running the input functions', err);
}
return done();
});
});
});
};
|
JavaScript
| 0.000003 |
@@ -930,20 +930,20 @@
nt:
-this
+grunt
.option
-s
('en
|
aef9fecf7b76c2be96546bc2d90ccacc426fbfee
|
remove console.log
|
analysis/reports/hourly/js/app.js
|
analysis/reports/hourly/js/app.js
|
(function (ReportFilters, Errors, HourlyCalendar, HourlyLine) {
var App = {
cfg: {
sdate: '#sdate',
edate: '#edate',
legend: '#legend',
welcome: '#welcome',
loading: '#loading',
errorTarget: '#error-container',
errorTemplate: '#error',
chart: '#chart',
chart2: '#chart2',
filter: '#initiatives',
buttons: '#controls',
filterOptions: {
url: '../../lib/php/reportFilters.php',
triggerForm: '#initiatives',
filterForm: '#secondary-filters',
locationsTemplate: '#locations-template',
activitiesTemplate: '#activities-template',
locationsSelect: '#locations',
activitiesSelect: '#activities'
}
},
filters: null,
init: function () {
// Insert default dates
this.insertDefaultDates();
// Set initiative filter to default (for back button)
$(this.cfg.filter).val('default');
// Insert filter select boxes
this.insertFilters();
// Bind Events
this.bindEvents();
},
/**
* Inserts default dates into form
*/
insertDefaultDates : function () {
// Create dates for default date display
var now = moment().format('YYYY-MM-DD'),
then = moment().subtract('months', 6).format('YYYY-MM-DD');
// Insert default dates into DOM
$(this.cfg.sdate).val(then);
$(this.cfg.edate).val(now);
},
/**
* Initializes and inserts secondary filters
*/
insertFilters: function () {
var filters,
self = this;
if (this.filters === null) {
this.filters = new ReportFilters(this.cfg.filterOptions);
}
filters = this.filters.init();
filters.fail(function (e) {
self.error(e);
});
},
bindEvents: function () {
var self = this;
// Initialize datepicker
$(self.cfg.sdate).datepicker({'format': 'yyyy-mm-dd', 'autoclose': 'true'});
$(self.cfg.edate).datepicker({'format': 'yyyy-mm-dd', 'autoclose': 'true'});
// Get chart data on submit
$('body').on('submit', 'form', function (e) {
var input = $(this).serializeArray();
$.when(self.getData(input))
.then(self.processData.bind(self))
.then(self.drawChart.bind(self), self.error.bind(self));
e.preventDefault();
});
// Toggle between sum and avg
$('#avg-sum').on('click', function (e) {
var state = e.target.value;
self.drawChart(self.data, state);
});
// Initialize help popovers
$('.suma-popover').popover({placement: 'bottom'});
// Chart Download
$('#line-download').on('click', function () {
var linkId = "#" + this.id,
chartId = "#" + $(this).attr('data-chart-div');
self.downloadPNG(linkId, chartId);
});
$('#calendar-download').on('click', function () {
var linkId = "#" + this.id,
chartId = "#" + $(this).attr('data-chart-div');
console.log('test', linkId, chartId)
self.downloadPNG(linkId, chartId);
});
},
downloadPNG: function (linkId, chartId) {
var canvas,
img,
svg;
// Get svg markup from chart
svg = $.trim($(chartId).html());
// Insert invisible canvas
$('body').append('<canvas id="canvas" style="display:none"></canvas>');
// Insert chart into invisible canvas
canvg(document.getElementById('canvas'), svg);
// Retrieve contents of invisible canvas
canvas = document.getElementById('canvas');
// Convert canvas to data
img = canvas.toDataURL("image/png");
// Update href to use data:image
$(linkId).attr('href', img);
// Remove Canvas
$('#canvas').remove();
},
getData: function (input) {
var self = this;
return $.ajax({
url: 'results.php',
data: input,
beforeSend: function () {
var text = $('#submit').data('loading-text');
$('#submit').addClass('disabled').val(text);
$('#submit').attr('disabled', 'true');
$(self.cfg.loading).show();
$(self.cfg.legend).hide();
$(self.cfg.buttons).hide();
$(self.cfg.welcome).hide();
$(self.cfg.errorTarget).empty();
$('svg').remove();
},
success: function () {
$(self.cfg.legend).show();
$(self.cfg.buttons).show();
},
complete: function () {
var text = $('#submit').data('default-text');
$('#submit').removeClass('disabled').val(text);
$('#submit').removeAttr('disabled');
$(self.cfg.loading).hide();
},
timeout: 180000 // 3 mins
});
},
getState: function () {
return $('#avg-sum > .active')[0].value;
},
error: function (e) {
$(this.cfg.legend).hide();
$(this.cfg.buttons).hide();
$(this.cfg.welcome).hide();
// Log errors for debugging
console.log('error object', e);
this.buildTemplate([{msg: Errors.getMsg(e.statusText)}], this.cfg.errorTemplate, this.cfg.errorTarget);
},
sortData: function (response) {
return _.sortBy(
_.map(response, function (count, date) {
return {
date: date,
count: count.count
};
}),
function (obj) {
return obj.date;
}
);
},
processData: function (response) {
console.log('response', response);
var dfd = $.Deferred(),
data = {};
data.sum = _.flatten(_.map(response.dailyHourSummary, function (day, d) {
return _.map(day, function (hour, h) {
return {
day: d + 1,
hour: h + 1,
value: hour.sum
};
});
}));
// Does response have enough values to draw meaningful graph?
if (_.compact(_.pluck(data.sum, 'value')) < 1) {
dfd.reject({statusText: 'no data'});
}
data.avg = _.flatten(_.map(response.dailyHourSummary, function (day, d) {
return _.map(day, function (hour, h) {
return {
day: d + 1,
hour: h + 1,
value: hour.avg
};
});
}));
this.data = data;
dfd.resolve(data);
return dfd.promise();
},
drawChart: function (counts, state) {
var data,
self = this;
if (state) {
data = counts[state];
} else {
state = this.getState();
data = counts[state];
}
if (!this.calendar) {
this.calendar = HourlyCalendar();
}
if (!this.line) {
this.line = HourlyLine();
}
d3.select(self.cfg.chart)
.datum(data)
.call(this.calendar);
d3.select(self.cfg.chart2)
.datum(data)
.call(this.line);
},
buildTemplate: function (items, templateId, targetId, empty) {
var html,
json,
template;
// Insert list into object for template iteration
json = {items: items};
// Retrieve template from index.php (in script tag)
html = $(templateId).html();
// Compile template
template = Handlebars.compile(html);
// Populate template with data and insert into DOM
if (empty) {
$(targetId).empty();
}
$(targetId).prepend(template(json));
}
};
// Start app on document ready
$(document).ready(function () {
App.init();
});
}(ReportFilters, Errors, HourlyCalendar, HourlyLine));
|
JavaScript
| 0.000006 |
@@ -3654,60 +3654,8 @@
');%0A
- console.log('test', linkId, chartId)
%0A
@@ -6636,55 +6636,8 @@
) %7B%0A
- console.log('response', response);%0A
|
7becf373384cbe3384c7053eca6724aa8123097b
|
Create the new component in the Docker image
|
public/visifile_drivers/services/serverDockerStuff.js
|
public/visifile_drivers/services/serverDockerStuff.js
|
async function serverDockerStuff(args) {
/*
description("The VB6 style docker control communicates with this")
base_component_id("server_docker_stuff")
load_once_from_file(true)
only_run_on_server(true)
*/
var message = ""
var msg = function(m) {
console.log(m)
message += (m + "\n")
}
//
// On Mac Docker doesn't seem to expose itself via a port by default, so we did
// this:
// docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:1234:1234 bobrik/socat TCP-LISTEN:1234,fork UNIX-CONNECT:/var/run/docker.sock
// export DOCKER_HOST=tcp://localhost:1234
//
// Based on this URL:
// https://github.com/docker/for-mac/issues/770
//
var host = 'host.docker.internal'
var port = 1234
if (args.host && (args.host.length > 0)) {
host = args.host
}
if (args.port && (args.port > 0)) {
port = args.port
}
var Docker = require('dockerode')
console.log("//var docker = require('dockerode')")
var dockerEngine = new Docker({
host: host,
port: port,
version: 'v1.25'
});
if (args.create) {
//await dockerEngine.commit({
// change: 'CMD ["node", "src/electron.js", "--runapp", "homapage", "--nogui", "true", "--deleteonstartup", "true", "--locked", "false"]'
// }) --= e3b1bd7239df zubairq/yazz2
try {
var runningContainers = await dockerEngine.listContainers()
var yazzRunningContainerDetails = null
var oldRunningAppContainerDetails = null
var yazzRunningContainerId = null
var yazzRunningContainer = null
msg("Checking running containers")
for (var ewr=0;ewr < runningContainers.length;ewr ++) {
if (runningContainers[ewr].Image == "zubairq/yazz") {
yazzRunningContainerDetails = runningContainers[ewr]
}
if (runningContainers[ewr].Image == args.image_name) {
oldRunningAppContainerDetails = runningContainers[ewr]
}
}
msg("Checking running app container...")
if (oldRunningAppContainerDetails != null) {
msg(" Found and stopping app container: " + oldRunningAppContainerDetails.Id + " for image " + args.image_name)
await dockerEngine.getContainer(oldRunningAppContainerDetails.Id).stop()
}
msg("...Checked.")
msg("Checking running yazz container...")
if (yazzRunningContainerDetails != null) {
yazzRunningContainerId = yazzRunningContainerDetails.Id
msg("Yazz container found with ID: " + yazzRunningContainerId)
} else {
msg("Yazz container NOT found.")
msg("Creating ...")
var cc = await dockerEngine.run( "zubairq/yazz")
yazzRunningContainerId = cc.Id
msg("Created with ID " + yazzRunningContainerId + " ...")
}
msg("...Checked.")
yazzRunningContainer = dockerEngine.getContainer( yazzRunningContainerId );
var extraFns = ""
extraFns += "async function() {"
extraFns += "}"
//zzz
var tar = require('tar-stream')
var pack = tar.pack() // pack is a streams2 stream
// add a file called my-test.txt with the content "Hello World!"
pack.entry({ name: 'extraFns.js' }, extraFns)
var extraComp = await (new Promise(async function(returnfn) {
dbsearch.serialize(
function() {
dbsearch.all(
" select " +
" base_component_id, code, id " +
" from " +
" system_code " +
" where " +
" base_component_id = ? and code_tag = 'LATEST';"
,
args.app_id
,
async function(err, rows) {
if (rows.length > 0) {
returnfn(rows[0].code.toString())
} else {
returnfn("")
}
}
);
}, sqlite3.OPEN_READONLY)
}))
pack.entry({ name: 'extraComp.js' }, extraComp)
pack.finalize();
await yazzRunningContainer.putArchive(pack, { path: "/src"} )
await yazzRunningContainer.commit({
changes: 'CMD ["node", "src/electron.js", "--runapp", "' + args.app_id + '", "--nogui", "true", "--deleteonstartup", "true", "--locked", "false"]'
,
repo: args.image_name
})
msg("args.docker_local_port: " + args.docker_local_port)
msg("Running app: " + args.image_name)
dockerEngine.run( args.image_name,
[],
undefined,
{
"HostConfig": {
"PortBindings": {
"80/tcp": [
{
"HostPort": args.docker_local_port //Map container to a random unused port.
}
]
}
}
})
msg("Done app: " + args.image_name)
} catch ( err ) {
msg(err)
}
return {message: message}
} else {
var runningContainers = await dockerEngine.listContainers()
return runningContainers
}
}
|
JavaScript
| 0.000002 |
@@ -3370,16 +3370,146 @@
on() %7B%22%0A
+extraFns += %22await evalLocalSystemDriver('%22 + args.app_id + %22', path.join(__dirname, '../src/extraComp.js'),%7Bsave_html: true%7D)%22%0A
extraFns
|
c7d3b971ed83703962e916842f747f841ca8d40f
|
add error handle on analysis function
|
analysis/index.js
|
analysis/index.js
|
const Services = require('../services/');
const tagoSocket = require('../comum/tago_socket');
function stringify_msg(msg) {
return (typeof msg === 'object' && !Array.isArray(msg) ? JSON.stringify(msg) : String(msg));
}
class Analysis {
constructor(analysis, token) {
this._token = token;
this._analysis = analysis;
if (!process.env.TAGO_RUNTIME) {
this.localRuntime();
}
}
run(environment, data, analysis_id, token) {
const tago_console = new Services(token).console;
function log(...args) {
if (!process.env.TAGO_RUNTIME) console.log(...args);
return tago_console.log(Object.keys(args).map((x) => stringify_msg(args[x])).join(' '));
}
const context = {
log,
token,
environment,
analysis_id,
};
this._analysis(context, data || []);
}
localRuntime() {
if (!this._token) {
throw 'To run locally, needs a token.';
}
const socket = tagoSocket(this._token);
socket.on('connect', () => console.info('Connected to TagoIO.'));
socket.on('disconnect', () => console.info('Disconnected from TagoIO.\n\n'));
socket.on('error', (e) => console.error('Connection error', e));
socket.on('ready', (analysis) => console.info(`Analysis [${analysis.name}] Started.`));
socket.on(tagoSocket.channels.analysisTrigger, (scope) => {
this.run(scope.environment, scope.data, scope.analysis_id, scope.token);
});
}
}
module.exports = Analysis;
|
JavaScript
| 0.000001 |
@@ -786,48 +786,368 @@
%7D;%0A
- this._analysis(context, data %7C%7C %5B%5D);
+%0A if (!this._analysis %7C%7C typeof this._analysis !== 'function') %7B%0A throw 'Invalid analysis function';%0A %7D%0A%0A if (this._analysis.constructor.name === 'AsyncFunction') %7B%0A this._analysis(context, data %7C%7C %5B%5D).catch(log);%0A %7D else %7B%0A try %7B%0A this._analysis(context, data %7C%7C %5B%5D);%0A %7D catch (error) %7B%0A log(error);%0A %7D%0A %7D
%0A %7D
|
f1d04dc041a465969791fc19b3ac53388322e592
|
remove cleanup task. #226
|
Gruntfile.js
|
Gruntfile.js
|
var versionFiles = [
'package.json',
'bower.json',
'public/humans.txt'
];
var jsFilesToCheck = [
'Gruntfile.js',
'app.js',
'public/js/main.js',
'archives/**/*.js',
'countdown/**/*.js',
'test/archives/*.js'
];
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bump: {
options: {
files: versionFiles,
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: versionFiles,
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'origin',
gitDescribeOptions: '--tags --always --abbrev=1'
}
},
clean: [
'public/js/script.js'
],
csslint: {
options: {
csslintrc: '.csslintrc'
},
strict: {
options: {
import: 2
},
src: [ 'public/css/style.css' ]
}
},
jscs: {
src: jsFilesToCheck,
options: {
config: '.jscsrc'
}
},
jshint: {
all: {
options: {
jshintrc: '.jshintrc'
},
src: jsFilesToCheck
}
},
uglify: {
production: {
options: {
mangle: false,
compress: true,
beautify: false
},
files: {
'public/js/script.js': [
'public/js/vendor/moment/min/moment.min.js',
'public/js/vendor/fluidvids/dist/fluidvids.min.js',
'public/js/vendor/fetch/fetch.js',
'public/js/main.js'
]
}
}
},
jsbeautifier: {
files: [ 'public/js/main.js' ],
options: {
config: '.jsbeautifyrc'
}
}
});
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.registerTask('cleanup', 'Remove past events in blacklist and whitelist', function() {
var cleanup = require('./tasks/cleanup');
var blacklistEventsFilepath = __dirname + '/config/blacklistEvents.json';
var whitelistEventsFilepath = __dirname + '/config/whitelistEvents.json';
var done = this.async();
cleanup.all(blacklistEventsFilepath, cleanup.getEventsToKeep(blacklistEventsFilepath), function(reply) {
grunt.log.writeln(reply);
cleanup.all(whitelistEventsFilepath, cleanup.getEventsToKeep(whitelistEventsFilepath), function(reply) {
grunt.log.writeln(reply);
done();
})
})
});
grunt.registerTask('travis', [
'clean',
'jshint',
'jsbeautifier',
'jscs',
'uglify',
'csslint'
]);
grunt.registerTask('default', [
'clean',
'jshint',
'csslint',
'jsbeautifier',
'jscs',
'uglify'
]);
grunt.registerTask('build', [
'jsbeautifier',
'uglify'
]);
};
|
JavaScript
| 0.000152 |
@@ -2076,662 +2076,8 @@
);%0A%0A
- grunt.registerTask('cleanup', 'Remove past events in blacklist and whitelist', function() %7B%0A var cleanup = require('./tasks/cleanup');%0A var blacklistEventsFilepath = __dirname + '/config/blacklistEvents.json';%0A var whitelistEventsFilepath = __dirname + '/config/whitelistEvents.json';%0A var done = this.async();%0A%0A cleanup.all(blacklistEventsFilepath, cleanup.getEventsToKeep(blacklistEventsFilepath), function(reply) %7B%0A grunt.log.writeln(reply);%0A cleanup.all(whitelistEventsFilepath, cleanup.getEventsToKeep(whitelistEventsFilepath), function(reply) %7B%0A grunt.log.writeln(reply);%0A done();%0A %7D)%0A %7D)%0A %7D);%0A%0A
gr
|
b1132cf57205913621a5b02ea73b959ec22baf2f
|
Read computed styles instead of element styles when toggling folders
|
antxetamedia/static/js/folders.js
|
antxetamedia/static/js/folders.js
|
(function() {
function toggleFold(event) {
var content = this.querySelector('.folderContent');
content.style.display = content.style.display !== 'none' ? 'none' : 'block';
}
var folders = document.querySelectorAll('.folder');
Array.forEach(folders, function(folder) {
folder.onclick = toggleFold;
});
})();
|
JavaScript
| 0 |
@@ -122,29 +122,48 @@
splay =
+window.getComputedStyle(
content
-.style
+)
.display
|
f4ac183e473cca141d1b94ffac68e269a8beaf06
|
call with rank >= 3
|
player.js
|
player.js
|
'use strict';
const getRanking = require('./ranking');
let gameState, myplayer, folded;
module.exports = {
VERSION: "Kickstarter",
bet_request: function(game_state, bet) {
new Promise((resolve, reject) => {
folded = false;
gameState = game_state;
myplayer = game_state.players[game_state.in_action];
console.log(myplayer.hole_cards);
console.log(game_state);
//Check for zero phase
let promise;
if(gameState.community_cards.length <= 3){
promise = Promise.resolve(phase_zero());
} else {
promise = Promise.resolve(phase_two());
}
promise.then(resolve, reject);
}).then(value => {
bet(value);
}).catch(err => {
console.log('ERROR', err);
});
},
showdown: function(game_state) {
}
};
function phase_zero (){
folded = false;
if(myplayer.hole_cards.length < 2){
return 0;
}
console.log("phase zero");
const rank = evaluate(myplayer.hole_cards);
if(rank === 3){
return gameState.minimum_raise;
}else if (rank ===2) {
return call();
}
folded = true;
return fold();
}
function phase_two (){
console.log('phase 2!');
const allCards = gameState.community_cards.map(item => item);
myplayer.hole_cards.forEach(item => allCards.push(item));
console.log('allcards', allCards);
return getRanking(allCards).then((rankingData) => {
const rank = rankingData.rank;
if(rank >= 8) {
return allIn();
} else if(rank >= 5) {
return minimalRaise();
} else {
return fold();
}
}, err => {
console.log('ERROR could not get rank', err);
return call();
});
// const rank = evaluate(myplayer.hole_cards);
// if(rank === 3){
// return gameState.minimum_raise;
// }else if (rank ===2) {
// return call();
// }
// return fold();
}
function evaluate (cards){
const first = cards[0];
const second = cards[1];
if(first.rank === second.rank){ // check pair
return 3;
}else if(isSuited(cards)){
return 2;
} else {
return 0;
}
}
function isSuited(cards){
const first = cards[0];
const second = cards[1];
if(first.suit === second.suit){
return true;
}
return false;
}
function call (){
const c = gameState.current_buy_in - gameState.players[gameState.in_action].bet;
return c;
}
function allIn(){
const c = myplayer.stack;
return c;
}
function fold(){
return 0;
}
function minimalRaise() {
return call() + gameState.minimum_raise;
}
|
JavaScript
| 0 |
@@ -1544,24 +1544,74 @@
malRaise();%0A
+ %7D else if(rank %3E= 3) %7B%0A return call();%0A
%7D else %7B
|
dda53889f54a51ef99f3e48ee71ea86fd982cf05
|
fix test-browser grunt task.
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
var testServer = require("./spec/test-server.js");
grunt.initConfig({
bower_concat: {
all: {
dest: "spec/browser-dependencies.js"
}
},
jasmine: {
src: ["spec/browser-dependencies.js", "spec/resources.js", "wadl-client.js"],
options: {
host: "http://localhost:3000/",
outfile: "index.html",
specs: "spec/wadl-client.spec.js"
}
},
jasmine_node: {
all: ["spec/"]
},
jshint: {
all: ["wadl-client.js", "spec/**/*.js"]
}
});
grunt.loadNpmTasks('grunt-bower-concat');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('start-test-server', function() {
testServer.start();
});
grunt.registerTask('stop-test-server', function() {
testServer.stop();
});
grunt.registerTask("test-node", "jasmine_node");
grunt.registerTask("test-browser", "bower_concat", "jasmine");
grunt.registerTask("test", ["test-node", "test-browser"]);
grunt.registerTask("default", ["jshint", "start-test-server", "test", "stop-test-server"]);
};
|
JavaScript
| 0.000002 |
@@ -1001,16 +1001,17 @@
owser%22,
+%5B
%22bower_c
@@ -1027,16 +1027,17 @@
jasmine%22
+%5D
);%0A gru
|
7ec7f8a2b29e15f7a5067cf1c514034dcc3ec7e2
|
Add schema validation support for arbitrary top-level usermeta object.
|
packages/vega-parser/schema/index.js
|
packages/vega-parser/schema/index.js
|
import autosize from './autosize';
import axis from './axis';
import background from './background';
import bind from './bind';
import data from './data';
import encode from './encode';
import expr from './expr';
import layout from './layout';
import legend from './legend';
import mark from './mark';
import marktype from './marktype';
import onEvents from './on-events';
import onTrigger from './on-trigger';
import padding from './padding';
import projection from './projection';
import scale from './scale';
import scope from './scope';
import selector from './selector';
import signal from './signal';
import stream from './stream';
import title from './title';
import transform from './transform';
function extend(target, source) {
for (var key in source) {
target[key] = source[key];
}
}
function addModule(schema, module) {
if (module.refs) extend(schema.refs, module.refs);
if (module.defs) extend(schema.defs, module.defs);
}
export default function(definitions) {
var schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Vega 3.0 Visualization Specification Language",
"defs": {},
"refs": {},
"type": "object",
"allOf": [
{"$ref": "#/defs/scope"},
{
"properties": {
"$schema": {"type": "string", "format": "uri"},
"config": {"type": "object"},
"description": {"type": "string"},
"width": {"type": "number"},
"height": {"type": "number"},
"padding": {"$ref": "#/defs/padding"},
"autosize": {"$ref": "#/defs/autosize"},
"background": {"$ref": "#/defs/background"}
}
}
]
};
[
autosize,
axis,
background,
bind,
data,
encode,
expr,
layout,
legend,
mark,
marktype,
onEvents,
onTrigger,
padding,
projection,
scale,
scope,
selector,
signal,
stream,
title,
transform(definitions)
].forEach(function(module) {
addModule(schema, module);
});
return schema;
}
|
JavaScript
| 0 |
@@ -1307,24 +1307,66 @@
t%22: %22uri%22%7D,%0A
+ %22usermeta%22: %7B%22type%22: %22object%22%7D,%0A
%22c
|
f76b8475fbcc9f0cb188c7e8373f0f211c9a4b03
|
use fast click
|
static/index.js
|
static/index.js
|
import React from 'react'
import Routes from '../components/_routes/'
import Router from 'react-router'
import data from '../components/_routes/example/data.js'
Router.run(Routes, Router.HistoryLocation, (Handler) => {
React.render(<Handler {...data} />, document.getElementById('app'))
})
|
JavaScript
| 0.000001 |
@@ -97,16 +97,50 @@
router'%0A
+import FastClick from 'fastclick'%0A
import d
@@ -189,16 +189,88 @@
ta.js'%0A%0A
+window.addEventListener('load', () =%3E FastClick.attach(document.body))%0A%0A
Router.r
|
77185ad01b4a73e76ac1fc053cff7c209f480186
|
put logging filters in place
|
static/index.js
|
static/index.js
|
var socket = io.connect();
var streamOut = document.querySelector('#stream-output');
var statusElement = document.querySelector('#status')
var firstStream = true;
var machine = {};
socket.on('connect', function() {
var hash = window.location.hash;
if (hash) {
firstStream = true;
hash = hash.slice(1);
var hashParts = hash.split(',')
machine.ip = hashParts[0];
machine.file = hashParts[1];
statusElement.innerHTML = "Connecting to tailbridge to fetch logs from <b>" + machine.ip + "</b>...";
console.log(status.innerHTML);
socket.emit('init', hash);
}
});
socket.on('stream', function(data) {
if (firstStream) {
statusElement.innerHTML = "Tailing the file <b>" + machine.file + "</b> on <b>" + machine.ip + "</b>...";
firstStream = false;
}
var data = data.replace('\n', '<br>');
var atBottom = (streamOut.scrollHeight - streamOut.scrollTop) === streamOut.offsetHeight;
streamOut.innerHTML += data + '<br>';
if (atBottom) {
streamOut.scrollTop = streamOut.scrollHeight - streamOut.offsetHeight
}
});
socket.on('denied', function(data) {
statusElement.innerHTML = "Tailbridge cannot access the requested file.";
});
socket.on('invalid_ip', function(data) {
statusElement.innerHTML = "Requested IP not found in the config.";
});
|
JavaScript
| 0.000001 |
@@ -133,50 +133,290 @@
atus
-')%0Avar firstStream = true;%0Avar machine = %7B
+-text');%0Avar filterRegex = new RegExp('', 'g');%0Avar firstStream = true;%0Avar machine = %7B%7D;%0A%0Avar filterLogs = function(logs) %7B%0A var filterLogs = %5B%5D;%0A for (var i = 0; i %3C logs.length; i++) %7B%0A if (filterRegex.test(logs%5Bi%5D))%0A filterLogs.push(logs%5Bi%5D);%0A %7D%0A return filterLogs;%0A
%7D;%0A%0A
@@ -1045,27 +1045,42 @@
a =
-data.replace('%5Cn',
+filterLogs(data.split('%5Cn')).join(
'%3Cbr
|
f31591fa1e4fa13bb2d85523f98e6590116326bb
|
Rename Decoder.decodeNextString_ to decodeNextOctetSequence_
|
header_decoder.js
|
header_decoder.js
|
'use strict';
// emitFunction will be called with the name and value of each header
// encountered while decoding.
function Decoder(buffer, encodingContext, emitFunction) {
this.buffer_ = buffer;
this.i_ = 0;
this.encodingContext_ = encodingContext;
this.emitFunction_ = emitFunction;
}
Decoder.prototype.hasMoreData = function() {
return this.i_ < this.buffer_.length;
};
Decoder.prototype.peekNextOctet_ = function() {
if (!this.hasMoreData()) {
throw new Error('Unexpected end of buffer');
}
return this.buffer_[this.i_] & 0xff;
};
Decoder.prototype.decodeNextOctet_ = function() {
var nextOctet = this.peekNextOctet_();
++this.i_;
return nextOctet;
};
// Decodes the next integer based on the representation described in
// 4.1.1. N is the number of bits of the prefix as described in 4.1.1.
Decoder.prototype.decodeNextInteger_ = function(N) {
var I = 0;
var hasMore = true;
var shift = N;
if (N > 0) {
var nextMarker = (1 << N) - 1;
var nextOctet = this.decodeNextOctet_();
I = nextOctet & nextMarker;
hasMore = (I == nextMarker);
}
while (hasMore) {
var nextOctet = this.decodeNextOctet_();
// Check the high bit. (Remember that / in JavaScript is
// floating-point division).
hasMore = ((nextOctet & 0x80) != 0);
I += (nextOctet % 128) << shift;
shift += 7;
}
return I;
};
// Decodes the next length-prefixed octet sequence and returns it as a
// string with character codes representing the octets.
Decoder.prototype.decodeNextString_ = function() {
var length = this.decodeNextInteger_(0);
var str = '';
for (var i = 0; i < length; ++i) {
var nextOctet = this.decodeNextOctet_();
str += String.fromCharCode(nextOctet);
}
return str;
};
// Decodes the next header name based on the representation described
// in 4.1.2. N is the number of bits of the prefix of the length of
// the header name as described in 4.1.1.
Decoder.prototype.decodeNextName_ = function(N) {
var indexPlusOneOrZero = this.decodeNextInteger_(N);
var name = null;
if (indexPlusOneOrZero == 0) {
name = this.decodeNextString_();
} else {
var index = indexPlusOneOrZero - 1;
name = this.encodingContext_.getIndexedHeaderName(index);
}
if (!isValidHeaderName(name)) {
throw new Error('Invalid header name: ' + name);
}
return name;
};
// Decodes the next header value based on the representation described
// in 4.1.3.
Decoder.prototype.decodeNextValue_ = function() {
var value = this.decodeNextString_();
if (!isValidHeaderValue(value)) {
throw new Error('Invalid header value: ' + value);
}
return value;
};
// Processes the next header representation as described in 3.2.1.
Decoder.prototype.processNextHeaderRepresentation = function() {
var nextOctet = this.peekNextOctet_();
// Touches are used below to track which headers have been emitted.
if ((nextOctet >> 7) == 0x1) {
// Indexed header (4.2).
var index = this.decodeNextInteger_(7);
this.encodingContext_.processIndexedHeader(index);
if (!this.encodingContext_.isReferenced(index)) {
return;
}
this.encodingContext_.addTouches(index, 0);
var result = this.encodingContext_.getIndexedHeaderNameAndValue(index);
this.emitFunction_(result.name, result.value);
return;
}
if ((nextOctet >> 5) == 0x3) {
// Literal header without indexing (4.3.1).
var name = this.decodeNextName_(5);
var value = this.decodeNextValue_();
this.emitFunction_(name, value);
return;
}
if ((nextOctet >> 5) == 0x2) {
// Literal header with incremental indexing (4.3.2).
var name = this.decodeNextName_(5);
var value = this.decodeNextValue_();
var index =
this.encodingContext_.processLiteralHeaderWithIncrementalIndexing(
name, value);
if (index >= 0) {
this.encodingContext_.addTouches(index, 0);
}
this.emitFunction_(name, value);
return;
}
if ((nextOctet >> 6) == 0x0) {
// Literal header with substitution indexing (4.3.3).
var name = this.decodeNextName_(6);
var substitutedIndex = this.decodeNextInteger_(0);
var value = this.decodeNextValue_();
var index =
this.encodingContext_.processLiteralHeaderWithSubstitutionIndexing(
name, substitutedIndex, value);
if (index >= 0) {
this.encodingContext_.addTouches(index, 0);
}
this.emitFunction_(name, value);
return;
}
throw new Error('Could not decode opcode from ' + nextOctet);
};
// direction can be either REQUEST or RESPONSE, which controls the
// initial header table to use.
function HeaderDecoder(direction) {
this.encodingContext_ = new EncodingContext(direction);
}
HeaderDecoder.prototype.setHeaderTableMaxSize = function(maxSize) {
this.encodingContext_.setHeaderTableMaxSize(maxSize);
};
// encodedHeaderSet must be the complete encoding of an header set,
// represented as an array of octets. emitFunction will be called with
// the name and value of each header in the header set. An exception
// will be thrown if an error is encountered.
HeaderDecoder.prototype.decodeHeaderSet = function(
encodedHeaderSet, emitFunction) {
var decoder =
new Decoder(encodedHeaderSet, this.encodingContext_, emitFunction);
while (decoder.hasMoreData()) {
decoder.processNextHeaderRepresentation();
}
// Emits each header contained in the reference set that has not
// already been emitted as described in 3.2.2.
this.encodingContext_.forEachEntry(
function(index, name, value, referenced, touchCount) {
if (referenced && (touchCount === null)) {
emitFunction(name, value);
}
this.encodingContext_.clearTouches(index);
}.bind(this));
};
|
JavaScript
| 0 |
@@ -1520,22 +1520,29 @@
codeNext
-String
+OctetSequence
_ = func
@@ -2115,30 +2115,37 @@
s.decodeNext
-String
+OctetSequence
_();%0A %7D els
@@ -2527,22 +2527,29 @@
codeNext
-String
+OctetSequence
_();%0A i
|
53af0d972c4235b0494b9ac455beae8ffdfe850f
|
switch version number of electron (v0.36.3 crashes)
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
var path = require('path');
var cssBowerLibs = 'css/libs/bower/';
var jsBowerLibs = 'js/libs/bower/';
var appVersion = '0.2.6';
var electronVersion = '0.36.3';
var targets = ["linux-ia32", "linux-x64", "darwin-x64", "win32-ia32", "win32-x64"];
var editorDependencies = ["angular-ui-codemirror", "codemirror", "angular-xeditable", "eventEmitter", "eventie", "imagesloaded", "jquery.browser"];
grunt.initConfig({
clean: ["build", "cache", "bower_components", "app/js/libs/bower", "app/css/libs/bower", "app/editor/js/libs/bower", "app/editor/css/libs/bower"],
electron: {
"linux-x64": {
options: {
name: 'bmotion-prob',
dir: 'app',
out: 'build/client',
version: electronVersion,
platform: 'linux',
arch: 'x64',
asar: true,
"app-version": appVersion
}
},
"linux-ia32": {
options: {
name: 'bmotion-prob',
dir: 'app',
out: 'build/client',
version: electronVersion,
platform: 'linux',
arch: 'ia32',
asar: true,
"app-version": appVersion
}
},
"win32-ia32": {
options: {
name: 'bmotion-prob',
dir: 'app',
out: 'build/client',
version: electronVersion,
platform: 'win32',
icon: 'app/resources/icons/bmsicon.ico',
arch: 'ia32',
asar: true,
"app-version": appVersion
}
},
"win32-x64": {
options: {
name: 'bmotion-prob',
dir: 'app',
out: 'build/client',
version: electronVersion,
platform: 'win32',
icon: 'app/resources/icons/bmsicon.ico',
arch: 'x64',
asar: true,
"app-version": appVersion
}
},
"darwin-x64": {
options: {
name: 'bmotion-prob',
dir: 'app',
out: 'build/client',
version: electronVersion,
platform: 'darwin',
icon: 'app/resources/icons/bmsicon.icns',
arch: 'x64',
asar: true,
"app-version": appVersion
}
}
},
bower: {
install: {
options: {
layout: function (type, component, source) {
/* workaround for https://github.com/yatskevich/grunt-bower-task/issues/121 */
if (type === '__untyped__') {
type = source.substring(source.lastIndexOf('.') + 1);
}
var renamedType = type;
var prefix = '';
if (editorDependencies.indexOf(component) > -1) {
prefix = 'editor/'
}
switch (type) {
case 'js':
if (component === 'codemirror') {
if (source.indexOf('javascript', this.length - 'javascript'.length) !== -1) {
renamedType = 'js/libs/bower/codemirror/mode/javascript';
} else {
renamedType = 'js/libs/bower/codemirror/lib';
}
} else {
renamedType = path.join(jsBowerLibs, component);
}
break;
case 'css':
renamedType = component === 'bootstrap' ? 'css/bootstrap/css' : path.join(cssBowerLibs, component);
break;
case 'fonts':
renamedType = component === 'bootstrap' ? 'css/bootstrap/fonts' : path.join(cssBowerLibs, component);
break;
}
return prefix + renamedType;
},
targetDir: 'app'
//,cleanBowerDir: true
}
}
},
requirejs: {
'js-online': {
options: {
mainConfigFile: "app/bmotion.config.js",
baseUrl: "app",
removeCombined: true,
findNestedDependencies: true,
name: "bmotion.online",
out: "build/online/js/bmotion.online.js",
optimize: 'none',
skipDirOptimize: true,
keepBuildDir: false,
noBuildTxt: true
}
},
'css-online': {
options: {
keepBuildDir: true,
//optimizeCss: "standard.keepLines.keepWhitespace",
optimizeCss: "standard",
cssPrefix: "",
cssIn: "app/css/bms.main.css",
out: "build/online/css/bms.main.css"
}
},
'js-template': {
options: {
mainConfigFile: "app/bmotion.config.js",
baseUrl: "app",
removeCombined: true,
findNestedDependencies: true,
name: "bmotion.template",
out: "build/template/bmotion.template.js",
//optimize: 'none',
skipDirOptimize: true,
keepBuildDir: false,
noBuildTxt: true
}
}
},
copy: {
online: {
files: [
{
expand: true,
cwd: 'app/',
src: ['css/**', 'images/**', 'js/require.js', 'bmotion.json'],
dest: 'build/online/'
}
]
},
template: {
files: [
{
expand: true,
cwd: 'template/',
src: ['**'],
dest: 'build/template/'
}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-electron');
grunt.registerTask('default', ['build']);
grunt.registerTask('prepare', ['bower:install']);
grunt.registerTask('build', ['standalone_all']);
grunt.registerTask('online', ['prepare', 'requirejs:js-online', 'requirejs:css-online', 'copy:online']);
grunt.registerTask('template', ['prepare', 'requirejs:js-template', 'copy:template']);
targets.forEach(function (target) {
grunt.registerTask('standalone_' + target, '', function () {
grunt.config.set('mode', 'standalone');
grunt.task.run(['prepare', 'electron:' + target]);
});
});
grunt.registerTask('standalone_all', '', function () {
grunt.config.set('mode', 'standalone');
grunt.task.run(['prepare', 'electron']);
});
};
|
JavaScript
| 0 |
@@ -206,17 +206,17 @@
= '0.36.
-3
+2
';%0A v
|
c483f7ad84c172367a83244f4139431cd0c32e3b
|
simplify variable declaration
|
socmed/fbinsight.js
|
socmed/fbinsight.js
|
module.exports = function (url) {
var Horseman = require('node-horseman'),
horseman = new Horseman();
var fbElem = [
'meta[property="fb:admins"]',
'meta[property="fb:page_id"]',
'meta[property="fb:app_id"]'
];
var fbName = [
'fb:admins',
'fb:page_id',
'fb:app_id'
];
var fbTag = [
'<meta property="fb:admins" content="" />',
'<meta property="fb:page_id" content="" />',
'<meta property="fb:app_id" content="" />'
];
var fbDesc;
var resultFbInsight = {
socmedName : 'Facebook Insight',
message : []
};
var openPage = horseman.open( url );
fbElem.forEach(function (value,index) {
var isExist = horseman.exists( value );
if ( !isExist ) {
fbDesc = 'Facebook Insight with property ' + fbName[index] + ' is not found. Please add this meta tag ' + fbTag[index] + 'to keep the standarization.';
resultFbInsight.message.push({
error : 'Warning',
desc : fbDesc
});
}
});
horseman.close();
return resultFbInsight;
};
|
JavaScript
| 0.205264 |
@@ -123,143 +123,181 @@
-var fbElem = %5B%0A 'meta%5Bproperty=%22fb:admins%22%5D',
+function getElem (value) %7B%0A return 'meta%5Bname=%22' + value + '%22%5D';
%0A
+%7D%0A%0A
-'meta%5Bproperty=%22fb:page_id%22%5D',%0A 'meta%5Bproperty=%22fb:app_id%22%5D'
+function getTag (value) %7B%0A return '%3Cmeta name=%22' + value + '%22 content=%22%22 /%3E';
%0A
-%5D;
+%7D
%0A%0A
@@ -375,32 +375,53 @@
:app_id'%0A %5D;%0A
+ var fbElem = %5B%5D;
%0A var fbTag =
@@ -423,173 +423,139 @@
Tag
+
= %5B
-%0A '%3Cmeta property=%22fb:admins%22 content=%22%22 /%3E',%0A '%3Cmeta property=%22fb:page_id%22 content=%22%22 /%3E',%0A '%3Cmeta property=%22fb:app_id%22 content=%22%22 /%3E'
+%5D;%0A%0A fbName.forEach(function (value,index) %7B%0A fbElem.push(getElem(value));%0A fbTag.push(getTag(value));
%0A
-%5D
+%7D)
;%0A%0A
|
2708ad89a9d2cc5e5c95d4c638aa17951de217c8
|
fix linkgearrequests cap issue
|
public/modules/linkgearrequests/config/linkgearrequests.client.routes.js
|
public/modules/linkgearrequests/config/linkgearrequests.client.routes.js
|
'use strict';
//Setting up route
angular.module('linkGearRequests').config(['$stateProvider',
function($stateProvider) {
// LinkGearRequests state routing
$stateProvider.
state('listLinkGearRequests', {
url: '/linkGearRequests',
templateUrl: 'modules/linkgearrequests/views/list-linkgearrequests.client.view.html'
}).
state('createLinkGearRequest', {
url: '/linkGearRequests/create/:proId',
templateUrl: 'modules/linkgearrequests/views/create-linkgearrequests.client.view.html'
}).
state('viewLinkGearRequest', {
url: '/linkGearRequests/:linkGearRequestId',
templateUrl: 'modules/linkgearrequests/views/view-linkgearrequests.client.view.html'
}).
state('editLinkGearRequest', {
url: '/linkGearRequests/:linkGearRequestId/edit',
templateUrl: 'modules/linkgearrequests/views/edit-linkgearrequests.client.view.html'
});
}
]);
|
JavaScript
| 0 |
@@ -183,25 +183,25 @@
te('list
-LinkGearR
+linkgearr
equests'
@@ -214,29 +214,29 @@
%09url: '/link
-GearR
+gearr
equests',%0A%09%09
@@ -233,19 +233,28 @@
uests',%0A
-%09%09%09
+
template
@@ -377,37 +377,37 @@
%7B%0A%09%09%09url: '/link
-GearR
+gearr
equests/create/:
@@ -549,37 +549,37 @@
%7B%0A%09%09%09url: '/link
-GearR
+gearr
equests/:linkGea
@@ -728,29 +728,29 @@
%09url: '/link
-GearR
+gearr
equests/:lin
|
2901f981edddc00db287e0c0ccdbb69ddf5a16e2
|
Use email type input
|
src/frontend/components/Signup.js
|
src/frontend/components/Signup.js
|
import React from 'react';
import Relay from 'react-relay';
import {Paper, TextField} from 'material-ui';
import {BernieText, BernieColors} from './styles/bernie-css';
import GCForm from './forms/GCForm';
import Form from 'react-formal';
import yup from 'yup';
import superagent from 'superagent';
import {Styles} from 'material-ui';
import {BernieTheme} from './styles/bernie-theme';
@Styles.ThemeDecorator(Styles.ThemeManager.getMuiTheme(BernieTheme))
export default class Signup extends React.Component {
state = {
formState: 'signup',
errorMessage: null,
}
clearError() {
this.setState({errorMessage: null})
}
redirectToNext() {
let queryDict = {};
location.search.substr(1).split("&").forEach((item) => {
queryDict[item.split("=")[0]] = item.split("=").slice(1).join('=')
})
this.props.history.push(queryDict.next || '/call')
}
formStates = {
signup: {
formTitle: 'Login or sign up to continue',
formSchema: yup.object({
email: yup.string().email().required(),
password: yup.string().required(),
}),
formElement: (
<div>
<Form.Field
name='email'
label='E-mail Address'
hintText='Email'
floatingLabelText={false}
/>
<br />
<Form.Field
name='password'
type='password'
label='Password'
hintText='Password'
floatingLabelText={false}
/>
<br />
</div>
),
onSubmit: (formState) => {
this.clearError();
superagent
.post('/signup')
.send({
email: formState.email,
password: formState.password
})
.end((err, res) => {
if (!err) {
this.redirectToNext();
} else {
this.setState({errorMessage: 'Incorrect e-mail or password'});
}
})
}
}
}
styles = {
signupForm: {
width: '100%',
backgroundColor: BernieColors.blue,
color: BernieColors.white,
padding: '15px 15px 15px 15px'
},
paragraph: {
paddingTop: '0.5em',
paddingBottom: '0.5em',
paddingLeft: '0.5em',
paddingRight: '0.5em',
},
introContainer: {
display: 'flex',
flexDirection: 'row'
},
introTextContainer: {
flex: 1,
marginRight: 40
},
signupFormContainer: {
flex: 'auto',
width: '12em'
},
container: {
padding: 40,
paddingTop: 40,
paddingRight: 40,
paddingBottom: 40,
},
errorMessage: {
...BernieText.default,
color: BernieColors.red,
fontSize: '0.8em',
marginTop: 15
}
}
renderSplash() {
return (
<div style={this.styles.container} >
<div style={this.styles.introContainer}>
<div style={this.styles.introTextContainer}>
<div style={{
...BernieText.secondaryTitle,
display: 'block'
}}>
Organize
</div>
<div style={BernieText.title}>
It takes a nation of millions to move us forward
</div>
<div style={BernieText.default}>
<p style={this.styles.paragraph}>
Bernie has said time and time again that the only way to bring about meaningful change in the White House is if all of us stand up and say enough is enough.
</p>
<p style={this.styles.paragraph}>
Will you sign up to make this political revolution a reality?
</p>
</div>
</div>
<div styles={this.styles.signupFormContainer}>
{this.renderSignupForm()}
</div>
</div>
</div>
)
}
renderSignupForm() {
let signupState = this.formStates[this.state.formState];
let formElement = signupState.formElement;
let formTitle = signupState.formTitle;
let formSchema = signupState.formSchema;
let submitHandler = signupState.onSubmit;
let errorElement = <div></div>
if (this.state.errorMessage) {
errorElement = <div style={this.styles.errorMessage}>{this.state.errorMessage}</div>
}
return (
<Paper style={this.styles.signupForm}>
<div style={
{
...BernieText.title,
color: BernieColors.white,
fontSize: '1.5em'
}}>
<GCForm
schema={formSchema}
onSubmit={(formData) => {
submitHandler(formData)
}}
>
{formTitle}
{errorElement}
<Paper zDepth={0} style={{
padding: '15px 15px 15px 15px',
marginTop: 15,
marginBottom: 15
}}>
{formElement}
</Paper>
<Form.Button
type='submit'
label='Go!'
fullWidth={true}
/>
<div style={{
...BernieText.default,
fontSize: '0.7em',
color: BernieColors.white,
marginTop: 10
}}>
</div>
</GCForm>
</div>
</Paper>
)
}
render() {
return this.renderSplash();
}
}
|
JavaScript
| 0.000062 |
@@ -1230,24 +1230,49 @@
ext='Email'%0A
+ type='email'%0A
|
8959a9f5bec89b1700c7e925e044c55b590c969d
|
Remove todo
|
redef/patron-client/src/frontend/containers/MyPage.js
|
redef/patron-client/src/frontend/containers/MyPage.js
|
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { injectIntl, intlShape, defineMessages, FormattedMessage } from 'react-intl'
import { routerActions } from 'react-router-redux'
import * as ProfileActions from '../actions/ProfileActions'
import * as LoginActions from '../actions/LoginActions'
import Tabs from '../components/Tabs'
class MyPage extends React.Component {
componentWillMount () {
if (this.props.isLoggedIn) {
this.props.profileActions.fetchAllProfileData()
} else {
// TODO Find a solution for showing login dialog when refreshing / accessing a privileged page directly
// this.props.loginActions.showLoginDialog()
}
}
componentDidUpdate (prevProps) {
if (prevProps.isLoggedIn === false && this.props.isLoggedIn === true) {
this.props.profileActions.fetchAllProfileData()
}
}
renderNotLoggedIn () {
return <div data-automation-id='profile_not_logged_in'><FormattedMessage {...messages.mustBeLoggedIn} /></div>
}
render () {
if (!this.props.isLoggedIn) {
return this.renderNotLoggedIn()
}
const tabList = [
{ label: this.props.intl.formatMessage(messages.loansAndReservations), path: '/profile/loans' },
{ label: this.props.intl.formatMessage(messages.personalInformation), path: '/profile/info' },
{ label: this.props.intl.formatMessage(messages.settings), path: '/profile/settings' }
]
return (
<div data-automation-id='profile_page'>
<Tabs tabList={tabList} currentPath={this.props.currentPath} push={this.props.routerActions.push} />
<hr />
{this.props.children}
</div>
)
}
}
MyPage.propTypes = {
dispatch: PropTypes.func.isRequired,
loginActions: PropTypes.object.isRequired,
borrowerNumber: PropTypes.string,
isLoggedIn: PropTypes.bool.isRequired,
profileActions: PropTypes.object.isRequired,
currentPath: PropTypes.string.isRequired,
routerActions: PropTypes.object.isRequired,
children: PropTypes.node.isRequired,
intl: intlShape.isRequired
}
const messages = defineMessages({
loansAndReservations: {
id: 'MyPage.loansAndReservations',
description: 'The label on the loans and reservations tab',
defaultMessage: 'Loans and reservations'
},
personalInformation: {
id: 'MyPage.personalInformation',
description: 'The label on the personal information tab',
defaultMessage: 'Personal information'
},
settings: {
id: 'MyPage.settings',
description: 'The label on the settings tab',
defaultMessage: 'Settings'
},
mustBeLoggedIn: {
id: 'MyPage.mustBeLoggedIn',
description: 'The message shown when not logged in',
defaultMessage: 'Must be logged in to access this page.'
}
})
function mapStateToProps (state) {
return {
isLoggedIn: state.application.isLoggedIn,
loginError: state.application.loginError,
currentPath: state.routing.locationBeforeTransitions.pathname
}
}
function mapDispatchToProps (dispatch) {
return {
dispatch: dispatch,
profileActions: bindActionCreators(ProfileActions, dispatch),
loginActions: bindActionCreators(LoginActions, dispatch),
routerActions: bindActionCreators(routerActions, dispatch)
}
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(injectIntl(MyPage))
|
JavaScript
| 0.000001 |
@@ -563,182 +563,8 @@
a()%0A
- %7D else %7B%0A // TODO Find a solution for showing login dialog when refreshing / accessing a privileged page directly%0A // this.props.loginActions.showLoginDialog()%0A
|
c25cd50c8302da2be28a8d5269d334d1b8f3b0d2
|
Rename variable
|
plugin.js
|
plugin.js
|
var correction = require('./correction');
var format = require('util').format;
// Will not change if 2 instances of tennu launched
const helps = {
"correction": [
"s/<target>/<replacement>",
"Correct a previously said message."
]
};
var TennuCorrection = {
//dblogger forces users to meet the dependency. No logger, no data.
requiresRoles: ["admin", "dbcore", "dblogger"],
init: function(client, imports) {
const requiresAdminHelp = "Requires admin privileges.";
var correctionConfig = client.config("correction");
if (!correctionConfig) {
throw Error("tennu-correction: is missing some or all of its configuration.");
}
var isAdmin = imports.admin.isAdmin;
const adminCooldown = client._plugins.getRole("cooldown");
if (adminCooldown) {
var cooldown = correctionConfig['cooldown'];
if (!cooldown) {
client._logger.warn('tennu-correction: Cooldown plugin found but no cooldown defined.')
}
else {
isAdmin = adminCooldown(cooldown);
client._logger.notice('tennu-correction: cooldowns enabled: ' + cooldown + ' seconds.');
}
}
const dbACorrectionPromise = imports.dbcore.then(function(knex) {
return correction(knex);
});
function handleCorrection(IRCMessage) {
// Lets do this quickly
var isSearchAndReplace = IRCMessage.message.match(/^s\/(.+?)\/(.*?)$/);
if (!isSearchAndReplace) {
return;
}
return isAdmin(IRCMessage.hostmask).then(function(isadmin) {
// isAdmin will be "undefined" if cooldown system is enabled
// isAdmin will be true/false if cooldown system is disabled
if (typeof(isAdmin) !== "undefined" && isAdmin === false) {
throw new Error(requiresAdminHelp);
}
// Build data for correction
var target = isSearchAndReplace[1];
var replacement = isSearchAndReplace[2];
return dbACorrectionPromise.then(function(correction) {
return correction.findCorrectable(target, IRCMessage.channel).then(function(locatedDBTarget) {
if (!locatedDBTarget) {
return {
intent: "notice",
query: true,
message: format('I searched the last 30 messages to the channel but couldnt find anything with "%s" in it', target)
};
}
var corrected = correction.correct(locatedDBTarget.Message, target, replacement);
return format('Correction, <%s> %s', locatedDBTarget.FromNick, corrected);
});
});
}).catch(adminFail);
}
function adminFail(err) {
return {
intent: 'notice',
query: true,
message: err
};
}
return {
handlers: {
"privmsg": handleCorrection,
},
help: {
"correction": helps.correction
}
};
}
};
module.exports = TennuCorrection;
|
JavaScript
| 0.000003 |
@@ -252,16 +252,73 @@
%5D%0A%7D;%0A%0A
+const requiresAdminHelp = %22Requires admin privileges.%22;%0A%0A
var Tenn
@@ -500,73 +500,8 @@
%7B%0A%0A
- const requiresAdminHelp = %22Requires admin privileges.%22;%0A%0A
@@ -1678,24 +1678,25 @@
(isadmin) %7B%0A
+%0A
@@ -1696,33 +1696,33 @@
// is
-A
+a
dmin will be %22un
@@ -1781,17 +1781,17 @@
// is
-A
+a
dmin wil
@@ -1866,17 +1866,17 @@
ypeof(is
-A
+a
dmin) !=
@@ -1894,17 +1894,17 @@
d%22 && is
-A
+a
dmin ===
|
9373f5b2fb460b410ed10c9ab9c9cef6be5cc96e
|
fix check for observable
|
html-element.js
|
html-element.js
|
var applyProperties = require('./lib/apply-properties')
var isObservable = require('./is-observable')
var parseTag = require('./lib/parse-tag')
var walk = require('./lib/walk')
var watch = require('./watch')
var caches = new global.WeakMap()
var bindQueue = []
var currentlyBinding = false
var watcher = null
var invalidateNextTick = require('./lib/invalidate-next-tick')
module.exports = function (tag, attributes, children) {
return Element(global.document, null, tag, attributes, children)
}
module.exports.forDocument = function (document, namespace) {
return Element.bind(this, document, namespace)
}
function Element (document, namespace, tagName, properties, children) {
if (!children && (Array.isArray(properties) || isText(properties) || isNode(properties))) {
children = properties
properties = null
}
checkWatcher(document)
properties = properties || {}
var tag = parseTag(tagName, properties, namespace)
var node = namespace
? document.createElementNS(namespace, tag.tagName)
: document.createElement(tag.tagName)
if (tag.id) {
node.id = tag.id
}
if (tag.classes && tag.classes.length) {
node.className = tag.classes.join(' ')
}
var data = {
targets: new Map(),
bindings: []
}
caches.set(node, data)
applyProperties(node, properties, data)
if (children != null) {
appendChild(document, node, data, children)
}
maybeBind(document, node)
return node
}
function appendChild (document, target, data, node) {
if (Array.isArray(node)) {
node.forEach(function (child) {
appendChild(document, target, data, child)
})
} else if (isObservable(node)) {
var nodes = getNodes(document, resolve(node))
nodes.forEach(append, { target: target, document: document })
data.targets.set(node, nodes)
data.bindings.push(new Binding(document, node, data))
} else {
node = getNode(document, node)
target.appendChild(node)
if (getRootNode(node) === document) {
walk(node, rebind)
}
}
}
function append (child) {
this.target.appendChild(child)
if (getRootNode(child) === this.document) {
walk(child, rebind)
}
}
function maybeBind (document, node) {
bindQueue.push([document, node])
if (!currentlyBinding) {
currentlyBinding = true
setImmediate(flushBindQueue)
}
}
function flushBindQueue () {
currentlyBinding = false
while (bindQueue.length) {
var item = bindQueue.shift()
var document = item[0]
var node = item[1]
if (getRootNode(node) === document) {
walk(node, rebind)
}
}
}
function checkWatcher (document) {
if (!watcher && global.MutationObserver) {
watcher = new global.MutationObserver(onMutate)
watcher.observe(document, {subtree: true, childList: true})
}
}
function onMutate (changes) {
changes.forEach(handleChange)
}
function getRootNode (el) {
var element = el
while (element.parentNode) {
element = element.parentNode
}
return element
}
function handleChange (change) {
for (var i = 0; i < change.addedNodes.length; i++) {
// if parent is a mutant element, then safe to assume it has already been bound
var node = change.addedNodes[i]
if (!caches.has(node.parentNode)) {
walk(node, rebind)
}
}
for (var i = 0; i < change.removedNodes.length; i++) {
var node = change.removedNodes[i]
walk(node, unbind)
}
}
function indexOf (target, item) {
return Array.prototype.indexOf.call(target, item)
}
function replace (oldNodes, newNodes) {
var parent = oldNodes[oldNodes.length - 1].parentNode
var nodes = parent.childNodes
var startIndex = indexOf(nodes, oldNodes[0])
// avoid reinserting nodes that are already in correct position!
for (var i = 0; i < newNodes.length; i++) {
if (nodes[i + startIndex] === newNodes[i]) {
continue
} else if (nodes[i + startIndex + 1] === newNodes[i]) {
parent.removeChild(nodes[i + startIndex])
continue
} else if (nodes[i + startIndex] === newNodes[i + 1] && newNodes[i + 1]) {
parent.insertBefore(newNodes[i], nodes[i + startIndex])
} else if (nodes[i + startIndex]) {
parent.insertBefore(newNodes[i], nodes[i + startIndex])
} else {
parent.appendChild(newNodes[i])
}
walk(newNodes[i], rebind)
}
oldNodes.filter(function (node) {
return !~newNodes.indexOf(node)
}).forEach(function (node) {
if (node.parentNode) {
parent.removeChild(node)
}
walk(node, unbind)
})
}
function isText (value) {
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean'
}
function isNode (value) {
return value instanceof Node
}
function getNode (document, nodeOrText) {
if (nodeOrText == null) {
return document.createTextNode('')
} else if (isText(nodeOrText)) {
return document.createTextNode(nodeOrText.toString())
} else {
return nodeOrText
}
}
function getNodes (document, nodeOrNodes) {
if (Array.isArray(nodeOrNodes)) {
if (nodeOrNodes.length) {
var result = []
for (var i = 0; i < nodeOrNodes.length; i++) {
var item = nodeOrNodes[i]
if (Array.isArray(item)) {
getNodes(document, item).forEach(push, result)
} else {
result.push(getNode(document, item))
}
}
return result.map(getNode.bind(this, document))
} else {
return [getNode(document, null)]
}
} else {
return [getNode(document, nodeOrNodes)]
}
}
function rebind (node) {
if (node.nodeType === 1) {
var data = caches.get(node)
if (data) {
data.bindings.forEach(invokeBind)
}
}
}
function unbind (node) {
if (node.nodeType === 1) {
var data = caches.get(node)
if (data) {
data.bindings.forEach(invokeUnbind)
}
}
}
function invokeBind (binding) {
binding.bind()
}
function invokeUnbind (binding) {
binding.unbind()
}
function push (item) {
this.push(item)
}
function resolve (source) {
return typeof source === 'function' ? source() : source
}
function Binding (document, obs, data) {
this.document = document
this.obs = obs
this.data = data
this.bound = false
this.invalidated = false
this.update = function (value) {
var oldNodes = data.targets.get(obs)
var newNodes = getNodes(document, value)
if (oldNodes) {
replace(oldNodes, newNodes)
data.targets.set(obs, newNodes)
}
}
invalidateNextTick(this)
}
Binding.prototype = {
bind: function () {
if (!this.bound) {
this._release = this.invalidated
? watch(this.obs, this.update)
: this.obs(this.update)
this.invalidated = false
this.bound = true
}
},
unbind: function () {
if (this.bound && typeof this._release === 'function') {
this._release()
this._release = null
this.bound = false
invalidateNextTick(this)
}
}
}
|
JavaScript
| 0.000001 |
@@ -767,16 +767,44 @@
perties)
+ %7C%7C isObservable(properties)
)) %7B%0A
|
5b315340cf73d2f3bb6b80660d2938b27b2b079f
|
rollback changes to Gruntfile.js
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
module.exports = function(grunt) {
require('time-grunt')(grunt);
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
js: {
files: ['gruntfile.js', 'application.js', 'lib/**/*.js', 'test/**/*.js'],
options: {
livereload: true
}
},
html: {
files: ['public/views/**', 'app/views/**'],
options: {
livereload: true
}
}
},
nodemon: {
dev: {
script: 'application.js',
options: {
args: [],
ignore: ['public/**'],
ext: 'js,html',
nodeArgs: [],
delayTime: 1,
env: {
PORT: 3000
},
cwd: __dirname
}
}
},
concurrent: {
serve: ['nodemon', 'watch'],
debug: ['node-inspector', 'shell:debug', 'open:debug'],
options: {
logConcurrentOutput: true
}
},
env : {
options : {},
// environment variables - see https://github.com/jsoverson/grunt-env for more information
local: {
FH_USE_LOCAL_DB: true,
DEV:true,
FH_MONGODB_CONN_URL: "mongodb://192.168.33.10/FH_LOCAL",
FH_SERVICE_MAP: function() {
/*
* Define the mappings for your services here - for local development.
* You must provide a mapping for each service you wish to access
* This can be a mapping to a locally running instance of the service (for local development)
* or a remote instance.
*/
var serviceMap = {
'SERVICE_GUID_1': 'http://127.0.0.1:8010',
'SERVICE_GUID_2': 'https://host-and-path-to-service'
};
return JSON.stringify(serviceMap);
}
},
//environement for acceptance tests
accept:{
FH_MONGODB_CONN_URL: "mongodb://192.168.33.10/FH_LOCAL",
FH_SERVICE_MAP: function() {
/*
* Define the mappings for your services here - for local development.
* You must provide a mapping for each service you wish to access
* This can be a mapping to a locally running instance of the service (for local development)
* or a remote instance.
*/
var serviceMap = {
'SERVICE_GUID_1': 'http://127.0.0.1:8010',
'SERVICE_GUID_2': 'https://host-and-path-to-service'
};
return JSON.stringify(serviceMap);
}
}
},
'node-inspector': {
dev: {}
},
shell: {
build:{
options:{
stdout:true
},
command: 'python ./build.py'
},
debug: {
options: {
stdout: true
},
command: 'env NODE_PATH=. node --debug-brk application.js'
},
unit: {
options: {
stdout: true,
stderr: true,
failOnError: true
},
command: 'env NODE_PATH=. ./node_modules/.bin/mocha test/unit'
},
accept: {
options: {
stdout: true,
stderr: true,
failOnError: true
},
command: 'env NODE_PATH=. ./node_modules/.bin/nightwatch'
//command: 'env NODE_PATH=. ./node_modules/.bin/turbo --setUp=test/accept/server.js --tearDown=test/accept/server.js test/accept'
},
coverage_unit: {
options: {
stdout: true,
stderr: true,
failOnError: true
},
command: [
'rm -rf coverage cov-unit',
'env NODE_PATH=. ./node_modules/.bin/istanbul cover --dir cov-unit ./node_modules/.bin/turbo -- test/unit',
'./node_modules/.bin/istanbul report',
'echo "See html coverage at: `pwd`/coverage/lcov-report/index.html"'
].join('&&')
},
coverage_accept: {
options: {
stdout: true,
stderr: true,
failOnError: true
},
command: [
'rm -rf coverage cov-accept',
'env NODE_PATH=. ./node_modules/.bin/istanbul cover --dir cov-accept ./node_modules/.bin/turbo -- --setUp=test/accept/server.js --tearDown=test/accept/server.js test/accept',
'./node_modules/.bin/istanbul report',
'echo "See html coverage at: `pwd`/coverage/lcov-report/index.html"'
].join('&&')
}
},
open: {
debug: {
path: 'http://127.0.0.1:8080/debug?port=5858',
app: 'Google Chrome'
},
platoReport: {
path: './plato/index.html',
app: 'Google Chrome'
}
},
plato: {
src: {
options : {
jshint : grunt.file.readJSON('.jshintrc')
},
files: {
'plato': ['Gruntfile.js', 'libs/**/*.js', 'tests/**/*.js', 'static/client/app/**/*.js']
}
}
},
jshint: {
all: ['Gruntfile.js', 'libs/**/*.js', 'tests/**/*.js', 'static/client/app/**/*.js'],
options: {
jshintrc: true
}
}
});
// Load NPM tasks
require('load-grunt-tasks')(grunt, {
scope: 'devDependencies'
});
//build tasks
grunt.registerTask('build',['shell:build']);
// Testing tasks
grunt.registerTask('test', ['shell:unit', 'shell:accept']);
grunt.registerTask('unit', ['shell:unit']);
grunt.registerTask('accept', ['env:accept', 'shell:accept']);
// Coverate tasks
grunt.registerTask('coverage', ['shell:coverage_unit', 'shell:coverage_accept']);
grunt.registerTask('coverage-unit', ['shell:coverage_unit']);
grunt.registerTask('coverage-accept', ['env:local', 'shell:coverage_accept']);
// Making grunt default to force in order not to break the project.
grunt.option('force', true);
grunt.registerTask('analysis', ['plato:src', 'open:platoReport']);
grunt.registerTask('serve', ['env:local', 'concurrent:serve']);
grunt.registerTask('debug', ['env:local', 'concurrent:debug']);
grunt.registerTask('default', ['serve']);
};
|
JavaScript
| 0.000001 |
@@ -1200,36 +1200,32 @@
%22mongodb://1
-92.168.33
+27.0.0
.1
-0
/FH_LOCAL%22,%0A
@@ -1912,20 +1912,16 @@
://1
-92.168.33
+27.0.0
.1
-0
/FH_
|
5b4afe6bb3b3fc4bdada37f75c455c4cf03836cd
|
Fix ESLint errors
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt)
// Project configuration
grunt.initConfig({
// Configure ESLint task
eslint: {
all: [
'**/*.js',
'!node_modules/**'
]
}
})
// Default tasks
grunt.registerTask('default', ['eslint'])
}
|
JavaScript
| 0.022289 |
@@ -18,17 +18,16 @@
function
-
(grunt)
@@ -64,16 +64,17 @@
)(grunt)
+;
%0A%0A // P
@@ -220,16 +220,17 @@
/**'
+,
%0A %5D
%0A
@@ -229,19 +229,22 @@
%5D
+,
%0A %7D
+,
%0A %7D)
+;
%0A%0A
@@ -307,7 +307,9 @@
t'%5D)
+;
%0A%7D
+;
%0A
|
eeefdf14ed3589ff8d84c42ceec7d3fb76037bf7
|
update changelog configuration
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
var grunt = require('grunt');
function getVersion() {
var pkg = grunt.file.readJSON('./package.json');
return pkg.version;
}
module.exports = function () {
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-conventional-changelog');
grunt.loadNpmTasks('grunt-git');
grunt.registerTask('release', [
'bump:minor',
'changelog',
'gitadd:changelog',
'gitcommit:changelog'
]);
grunt.registerTask('hotfix', [
'bump:patch',
'changelog',
'gitadd:changelog',
'gitcommit:changelog'
]);
grunt.initConfig({
lazy: {
getVersion: getVersion
},
bump: {
options: {
files: ['package.json'],
commit: true,
commitMessage: 'chore(project): bump version to %VERSION%',
commitFiles: ['package.json'],
createTag: false,
push: false
}
},
changelog: {
options: {
editor: 'open -W'
}
},
gitadd: {
changelog: {
files: {
src: ['Changelog.md']
}
}
},
gitcommit: {
changelog: {
options: {
message: 'doc(changelog): update changelog for <%= lazy.getVersion() %>'
},
files: {
src: ['Changelog.md']
}
}
}
});
};
|
JavaScript
| 0.000006 |
@@ -869,24 +869,36 @@
%7D,%0A c
+onventionalC
hangelog: %7B%0A
@@ -926,24 +926,495 @@
-editor: 'open -W
+changelogOpts: %7B%0A // conventional-changelog options go here%0A preset: 'angular'%0A %7D,%0A context: %7B%0A // context goes here%0A %7D,%0A gitRawCommitsOpts: %7B%0A // git-raw-commits options go here%0A %7D,%0A parserOpts: %7B%0A // conventional-commits-parser options go here%0A %7D,%0A writerOpts: %7B%0A // conventional-changelog-writer options go here%0A %7D%0A %7D,%0A release: %7B%0A src: 'CHANGELOG.md
'%0A
|
75a8703521435250f439ce8bd9d1a36ce952eb4b
|
Check all files
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'tests/lib/**/*.js'],
options: {
jshintrc: '.jshintrc',
}
},
mochacli: {
all: ['test/**/*.js'],
options: {
reporter: 'spec',
ui: 'tdd'
}
}
})
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-mocha-cli')
// Configure tasks
grunt.registerTask('default', ['test'])
grunt.registerTask('test', ['mochacli', 'jshint'])
}
|
JavaScript
| 0 |
@@ -196,24 +196,32 @@
'tests/
-lib/
**/*
+.js', 'index
.js'%5D,%0A
|
7598e4f2b53b0a69b10eef5b8fc43c26b254a67b
|
Add icon to firefox.
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
// ----------
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-jpm");
grunt.loadNpmTasks("grunt-crx");
// ----------
// Project configuration.
grunt.initConfig({
clean: {
build: ["build"],
chromium: ["build/chromium"],
firefox: ["build/firefox"]
},
watch: {
files: ["Gruntfile.js", "chromium/*", "firefox/*", "common/*"],
tasks: "watchTask"
},
jpm: {
options: {
src: "build/firefox",
xpi: "build"
}
},
crx: {
crx: {
"src": "build/chromium/**/*",
"dest": "build",
"options": {
"privateKey": "../openseadragonizer.pem"
}
}
},
compress: {
chromium: {
options: {
archive: "build/chromium.zip"
},
files: [{
expand: true,
cwd: "build/chromium",
src: ["**/*"],
dest: ""
}
]
}
}
});
// ----------
// Watch task.
// Called from the watch feature; does a full build or a particular browser build,
// depending on whether you used --browsername on the command line.
grunt.registerTask("watchTask", function () {
if (grunt.option('chromium')) {
grunt.task.run("build:chromium");
} else if (grunt.option('firefox')) {
grunt.task.run("build:firefox");
} else {
grunt.task.run("build");
}
});
// ----------
// Chromium build task.
grunt.registerTask("build:chromium", function () {
grunt.file.recurse("chromium", function (abspath, rootdir, subdir, filename) {
subdir = subdir ? subdir + "/" : "";
grunt.file.copy(abspath, "build/chromium/" + subdir + filename);
});
grunt.file.recurse("common", function (abspath, rootdir, subdir, filename) {
subdir = subdir ? subdir + "/" : "";
grunt.file.copy(abspath, "build/chromium/" + subdir + filename);
});
grunt.task.run("compress:chromium");
});
// ----------
// Firefox build task.
grunt.registerTask("build:firefox", function () {
grunt.file.recurse("firefox", function (abspath, rootdir, subdir, filename) {
subdir = subdir ? subdir + "/" : "";
grunt.file.copy(abspath, "build/firefox/" + subdir + filename);
});
grunt.file.recurse("common", function (abspath, rootdir, subdir, filename) {
subdir = subdir ? subdir + "/" : "";
grunt.file.copy(abspath, "build/firefox/data/" + subdir + filename);
});
grunt.task.run("jpm:xpi");
});
// ----------
// Full build task.
grunt.registerTask("build", ["clean", "build:chromium", "build:firefox"]);
// ----------
// Default task.
// Does a normal build.
grunt.registerTask("default", ["build"]);
};
|
JavaScript
| 0 |
@@ -3024,32 +3024,116 @@
e);%0A %7D);%0A
+ grunt.file.copy(%22build/firefox/data/logo48.png%22, %22build/firefox/icon.png%22);%0A
grunt.ta
|
779899372498fdc3bf2ef21401532dba91de9525
|
Update angular-meteor.js
|
angular-meteor.js
|
angular-meteor.js
|
// Define angular-meteor and its dependencies
var angularMeteor = angular.module('angular-meteor', [
'angular-meteor.subscribe',
'angular-meteor.collections',
'angular-meteor.meteor-collection',
'angular-meteor.object',
'angular-meteor.template',
'angular-meteor.user',
'angular-meteor.methods',
'angular-meteor.session',
'angular-meteor.reactive-scope',
'angular-meteor.utils',
'hashKeyCopier'
]);
angularMeteor.run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) {
// Recompile after iron:router builds page
if(typeof Router != 'undefined') {
Router.onAfterAction(function(req, res, next) {
// Since Router.current().ready() is reactive we wrap it in Tracker.nonreactive to avoid re-runs.
Tracker.nonreactive(function() {
Tracker.afterFlush(function() {
if (Router.current().ready()) {
// Since onAfterAction runs always twice when a route has waitOn's subscriptions,
// we need to handle case when data is already loaded at the moment Tracker.afterFlush executes
// which means it will run twice with Router.current().ready equals true.
// That's we save state to an additional auxiliry variable _done.
if (!Router.current()._done) {
// Checks if document's been compiled to the moment.
// If yes, compile only newly inserted parts.
if (Router.current()._docCompiled) {
for (var prop in Router.current()._layout._regions) {
var region = Router.current()._layout._regions[prop];
var firstNode = region.view._domrange.firstNode();
var lastNode = region.view._domrange.lastNode();
$compile(firstNode)($rootScope);
if (firstNode != lastNode) {
$compile(lastNode)($rootScope);
}
}
} else {
$compile($document)($rootScope);
Router.current()._docCompiled = true;
}
if (!$rootScope.$$phase) $rootScope.$apply();
Router.current()._done = true;
}
} else {
// Compiles and applies scope for the first time when current route is not ready.
$compile($document)($rootScope);
if (!$rootScope.$$phase) $rootScope.$apply();
Router.current()._docCompiled = true;
}
});
});
});
}]);
// Putting all services under $meteor service for syntactic sugar
angularMeteor.service('$meteor', ['$meteorCollection', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils',
function($meteorCollection, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils){
this.collection = $meteorCollection;
this.object = $meteorObject;
this.subscribe = $meteorSubscribe.subscribe;
this.call = $meteorMethods.call;
this.session = $meteorSession;
this.autorun = $meteorUtils.autorun;
this.getCollectionByName = $meteorUtils.getCollectionByName;
}]);
|
JavaScript
| 0.000001 |
@@ -1882,23 +1882,16 @@
%09%7D%0A%09%09%09
-
%7D else %7B
@@ -1894,17 +1894,18 @@
se %7B%0A%09%09%09
-%09
+
$compile
|
9d3d4f5a278707b4684585703ff0f3c88654e814
|
fix Gruntfile for 0.4.x
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
coffeelint: {
one: {
files: ['test/fixtures/*.coffee'],
options: {
indentation: {
value: 2,
level: "warn"
},
"no_trailing_semicolons": {
level: "warn"
}
}
},
two: ['test/fixtures/correct.coffee', 'test/fixtures/some.coffee']
},
coffeelintOptions: {
}
});
// Load local tasks.
grunt.loadTasks('tasks');
// Default task.
grunt.registerTask('default', 'coffeelint');
};
|
JavaScript
| 0.000001 |
@@ -123,16 +123,33 @@
files:
+ %7B%0A src:
%5B'test/
@@ -169,16 +169,27 @@
ffee'%5D,%0A
+ %7D,%0A
|
ff7ba820e6139d88ac282c707ad0e98b8e93d7bd
|
Update rests.js
|
drawing/rests.js
|
drawing/rests.js
|
function drawSemiBreveRest(ctx, x, y, height){
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(x + 2 * height, y);
ctx.lineTo(x + 2 * height, y + height / 2);
ctx.lineTo(x, y + height / 2);
ctx.lineTo(x, y);
ctx.fill();
}
function drawMinimRest(ctx, x, y, height){
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(x + 2 * height, y);
ctx.lineTo(x + 2 * height, y - height / 2);
ctx.lineTo(x, y - height / 2);
ctx.lineTo(x, y);
ctx.fill();
}
function drawCrotchetRest(ctx, x, y, height){
ctx.beginPath();
ctx.moveTo(x, y);
ctx.quadraticCurveTo(x + height, y - height/2, x, y - height);
ctx.quadraticCurveTo(x + 2 * height, y, x + height / 2, y + height / 2);
ctx.quadraticCurveTo(x - height, y + height, x + height / 2, y + 3 * height / 2);
ctx.quadraticCurveTo(x - height/ 2, y + 7 * height/ 4, x, y + 5 * height / 2);
ctx.quadraticCurveTo(x - 3 * height / 2, y + 6 * height/ 4, x + height / 2, y + 3 * height / 2);
ctx.quadraticCurveTo(x - 2 * height, y + height / 2, x, y);
ctx.fill();
ctx.stroke();
}
function drawQuaverRest(ctx, x, y, height){
ctx.beginPath();
ctx.arc(x, y, height / 4, 0, 2 * Math.PI);
ctx.fill();
ctx.moveTo(x, y);
ctx.bezierCurveTo( x + height / 2, y + height , x + 3 * height / 2, y + height / 2, x + 2 * height, y);
ctx.bezierCurveTo( x + 3 * height / 2, y + height / 2 , x + height / 2, y + height, x - height / 5, y + height * 0.75 / 4);
ctx.stroke();
ctx.fill();
ctx.moveTo(x + 2 * height, y);
ctx.lineTo(x, y + height * 4);
ctx.stroke();
}
function drawSemiQuaverRest(ctx, x, y, height){
drawQuaverRest(ctx, x, y, height);
drawQuaverRest(ctx, x - height, y + 2 * height, height);
}
function drawDemiSemiQuaverRest(ctx, x, y, height){
drawQuaverRest(ctx, x, y, height);
drawQuaverRest(ctx, x - height, y + 2 * height, height);
drawQuaverRest(ctx, x + height, y - 2 * height, height);
}
function drawHemiDemiSemiQuaverRest(ctx, x, y, height){
drawQuaverRest(ctx, x, y, height);
drawQuaverRest(ctx, x - height, y + 2 * height, height);
drawQuaverRest(ctx, x + height, y - 2 * height, height);
drawQuaverRest(ctx, x - height * 2, y + 4 * height, height);
}
/* y should be middle of second top line, ideally. */
function drawRest(ctx, x, y, duration, height){
if(duration.denom == 1){
switch(duration.num){
case 1:
drawCrotchetRest(ctx, x, y, height);
case 2:
drawMinimRest(ctx, x, y, height);
case 4:
drawSemiBreveRest(ctx, x, y, height);
}
}
else{
switch(duration.denom){
case 2:
drawQuaverRest(ctx, x, y, height);
case 4:
drawSemiQuaverRest(ctx, x, y, height);
case 8:
drawDemiSemiQuaverRest(ctx, x, y, height);
case 16:
drawHemiDemiSemiQuaverRest(ctx, x, y, height);
}
}
}
|
JavaScript
| 0.000001 |
@@ -2232,25 +2232,29 @@
ration,
-h
+lineH
eight)%7B%0A
%09if(dura
@@ -2245,16 +2245,44 @@
eight)%7B%0A
+%09var height = lineHeight/2;%0A
%09if(dura
|
bf0971917b6fa1dc7a44413028b27f7941180638
|
Add banner on build/minify
|
Gruntfile.js
|
Gruntfile.js
|
/* eslint strict: [2, "global"] */
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
meta: {
version: '1.0.0'
},
pkg: grunt.file.readJSON('package.json'),
banner: '/** \n' +
'* Project: <%= pkg.name %>\n' +
'* Version: <%= pkg.version %>\n' +
'* Date: <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'*/',
// Task configuration.
clean: {
src: 'dist'
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
src: ['lib/FILE_NAME.js'],
dest: 'dist/FILE_NAME.js'
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
src: '<%= concat.dist.dest %>',
dest: 'dist/FILE_NAME.min.js'
}
},
eslint: {
target: [
'app/js/**/*.js',
'Gruntfile.js'
],
gruntfile: {
src: 'Gruntfile.js'
},
app_files: {
src: 'app/js/*.js'
},
unit_testing_files: {
src: 'test/unit/*.js'
},
end_2_end_testing_files: {
src: 'test/e2e/*.js'
}
},
karma: {
unit: {
configFile: 'test/karma.conf.js',
singleRun: true
}
},
connect: {
options: {
port: 9999,
hostname: 'localhost',
keepalive: true
},
test: {
options: {
// set the location of the application files
base: [''],
keepalive: false
}
},
alive: {
options: {
base: 'app'
}
}
},
protractor: {
options: {
configFile: "test/protractor-conf.js", // Default config file
noColor: false, // If true, protractor will not use colors in its output.
args: {
// Arguments passed to the command
}
},
e2e: { // Grunt requires at least one target to run so you can simply put 'all: {}' here too.
options: {
keepAlive: false // If false, the grunt process stops when the test fails.
}
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
app_files: {
files: '<%= jshint.app_files.src %>',
tasks: 'jshint:app_files'
}
},
bowerInstall: {
options: {
exclude: [],
fileTypes: {}
},
target: {
src: 'app/index.html'
}
},
// Adds a banner to built files
usebanner: {
options: {
position: 'replace',
banner: '<%= banner %>',
replaceContent: true,
replace: '^\\/\\*\\*(.|\\n)\\*\\*\\/$'
},
files: {
src: ['app/js/app.js']
}
}
});
// filter npm modules and load them
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Add task aliases
grunt.registerTask('default', ['eslint', 'karma', 'e2e-test', 'watch:app_files']);
grunt.registerTask('e2e-test', ['server_test', 'protractor:e2e']);
grunt.registerTask('server_test', 'connect:test');
grunt.registerTask('server_app', 'connect:alive');
};
|
JavaScript
| 0 |
@@ -132,25 +132,8 @@
g(%7B%0A
- // Metadata.%0A
@@ -238,17 +238,16 @@
** %5Cn' +
-
%0A
@@ -264,16 +264,18 @@
Project:
+
%3C%25= pkg
@@ -313,16 +313,18 @@
Version:
+
%3C%25= pkg
@@ -366,16 +366,18 @@
ate:
+
+
%3C%25= grun
@@ -407,32 +407,72 @@
mm-dd%22) %25%3E%5Cn' +%0A
+ '* Copyright: Solnet%5Cn' +%0A
'*
@@ -475,20 +475,16 @@
'*/',%0A
-
%0A //
@@ -672,28 +672,21 @@
rc:
-%5B'lib/FILE_NAME
+'app/js/*
.js'
-%5D
,%0A
@@ -1819,17 +1819,16 @@
fig file
-
%0A
@@ -1901,17 +1901,16 @@
output.
-
%0A
@@ -1962,17 +1962,16 @@
command
-
%0A
@@ -2083,17 +2083,16 @@
ere too.
-
%0A
@@ -2187,17 +2187,16 @@
t fails.
-
%0A
@@ -2212,20 +2212,16 @@
%7D%0A %7D,
-
%0A wat
@@ -2230,118 +2230,8 @@
: %7B%0A
- gruntfile: %7B%0A files: '%3C%25= jshint.gruntfile.src %25%3E',%0A tasks: %5B'jshint:gruntfile'%5D%0A %7D,%0A
@@ -2487,288 +2487,8 @@
%7D%0A
- %7D,%0A // Adds a banner to built files%0A usebanner: %7B%0A options: %7B%0A position: 'replace',%0A banner: '%3C%25= banner %25%3E',%0A replaceContent: true,%0A replace: '%5E%5C%5C/%5C%5C*%5C%5C*(.%7C%5C%5Cn)%5C%5C*%5C%5C*%5C%5C/$'%0A %7D,%0A files: %7B%0A src: %5B'app/js/app.js'%5D%0A %7D%0A
@@ -2889,11 +2889,64 @@
live');%0A
+ grunt.registerTask('build', %5B'concat', 'uglify'%5D);%0A
%7D;%0A
|
fa999cbca3835e2ecd14012d381ef5e241ab9519
|
Fix type in Gruntfile
|
Gruntfile.js
|
Gruntfile.js
|
var extend = require("xtend");
var getRequirejsConfig = function () {
var requirejsConfig;
global.define = function (config) {
requirejsConfig = config({ isBuild: true });
};
require('./app/config');
return requirejsConfig;
};
module.exports = function(grunt) {
"use strict";
// Project configuration.
grunt.initConfig({
clean: ["public/"],
sass: {
development: {
files: {
'public/stylesheets/spotlight.css': 'styles/index.scss'
},
options: {
loadPath: [
'node_modules/govuk_frontend_toolkit/govuk_frontend_toolkit/stylesheets'
],
style: 'nested'
}
},
production: {
files: [
{ 'public/stylesheets/spotlight.css': 'styles/index.scss' },
{
expand: true,
cwd: 'node_modules/govuk_template_mustache/assets/stylesheets',
src: ['*.css'],
dest: 'public/stylesheets',
ext: '.css'
}
],
options: {
loadPath: [
'node_modules/govuk_frontend_toolkit/govuk_frontend_toolkit/stylesheets'
],
style: 'compressed'
}
}
},
jasmine: {
spotlight: {
src: 'app/**/*.js',
options: {
specs: 'test/spec/shared/**/spec.*.js',
template: 'test/spec/index.html',
keepRunner: true
}
}
},
jasmine_node: {
specNameMatcher: "spec\..*", // load only specs containing specNameMatcher
match: ".*",
projectRoot: "./test/spec/",
requirejs: "test/spec/requirejs-setup.js",
forceExit: true,
useHelpers: true,
jUnit: {
report: false,
savePath : "./build/reports/jasmine/",
useDotNotation: true,
consolidate: true
}
},
cucumber: {
test: {
features: 'features/'
},
options: {
prefix: 'bundle exec',
format: 'progress',
tags: ['~@wip']
}
},
jshint: {
files: "app/**/*.js",
options: {
ignores: ['app/vendor/**'],
eqnull: true
}
},
requirejs: {
production: {
options: extend(getRequirejsConfig(), {
baseUrl: 'app',
out: "public/javascripts/spotlight.js",
name: "client",
include: ["vendor/almond"],
deps: [
'client'
],
wrap: false
})
}
},
copy: {
govuk_template: {
src: 'node_modules/govuk_template_mustache/views/layouts/govuk_template.html',
dest: 'app/common/templates/',
expand: true,
flatten: true,
filter: 'isFile'
},
govuk_assets: {
files: [
{
expand: true,
src: '**',
cwd: 'node_modules/govuk_template_mustache/assets',
dest: 'public/'
}
]
},
vendor: {
files: [
{
src: 'node_modules/backbone/backbone.js',
dest: 'app/vendor/',
flatten: true,
expand: true
}
]
}
},
watch: {
css: {
files: ['styles/**/*.scss'],
tasks: ['sass:development'],
options: { nospawn: true }
},
spec: {
files: ['test/spec/**/spec.*.js'],
tasks: ['jasmine:spotlight:build']
}
},
nodemon: {
dev: {
options: {
file: 'app/server.js',
watchedExtensions: ['js'],
watchedFolders: ['app', 'support'],
delayTime: 1,
legacyWatch: true
}
}
},
concurrent: {
dev: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
}
}
});
[
'grunt-contrib-jasmine',
'grunt-jasmine-node',
'grunt-contrib-jshint',
'grunt-contrib-clean',
'grunt-contrib-sass',
'grunt-contrib-requirejs',
'grunt-rcukes',
'grunt-contrib-copy',
'grunt-contrib-watch',
'grunt-nodemon',
'grunt-concurrent'
].forEach(function (task) {
grunt.loadNpmTasks(task);
});
// Default task.
grunt.registerTask('build:development', [
'copy:vendor, copy:govuk_template', 'jshint', 'clean', 'copy:govuk_assets', 'sass:development'
]);
grunt.registerTask('build:production', [
'copy:vendor, copy:govuk_template', 'jshint', 'clean', 'copy:govuk_assets', 'sass:production', 'requirejs'
]);
grunt.registerTask('test:all', ['copy:vendor, jasmine_node', 'jasmine', 'cucumber']);
grunt.registerTask('default', ['build:development', 'jasmine:spotlight:build', 'concurrent']);
};
|
JavaScript
| 0.000002 |
@@ -4273,34 +4273,36 @@
'copy:vendor
+'
,
+'
copy:govuk_templ
@@ -4431,18 +4431,20 @@
y:vendor
+'
,
+'
copy:gov
@@ -4580,18 +4580,20 @@
y:vendor
+'
,
+'
jasmine_
|
4df7b97dc2210a605cf607fcfd4f24880fa8f651
|
Add mocha-only test
|
Gruntfile.js
|
Gruntfile.js
|
'use strict';
var paths = {
js: ['*.js', 'packages/**/*.js', 'test/**/*.js', '!test/coverage/**', '!bower_components/**',
'!packages/**/node_modules/**', '!packages/contrib/**', '!packages/**/vendor/**', '!packages/**/tests/**', '!test/**'],
coffee: ['**/*.coffee'],
html: ['packages/**/public/**/views/**', 'packages/**/server/views/**'],
css: ['!bower_components/**', 'packages/**/public/**/css/*.css', '!packages/contrib/**/public/**/css/*.css',
'!packages/articles/public/assets/vendor/**']
};
module.exports = function (grunt) {
if (process.env.NODE_ENV !== 'production') {
require('time-grunt')(grunt);
}
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
assets: grunt.file.readJSON('config/assets.json'),
clean: ['bower_components/build'],
watch: {
js: {
files: paths.js,
tasks: ['jshint'],
options: {
livereload: true
//interval: 1000
}
},
html: {
files: paths.html,
options: {
livereload: true,
interval: 1000
}
},
css: {
files: paths.css,
tasks: ['csslint'],
options: {
livereload: true
}
},
coffee: {
files: paths.coffee,
tasks: ['coffee:compile']
}
},
coffee: {
compile: {
expand: true,
bare: true,
flatten: false,
force: true,
// Need to change this to whatever makes sense
cwd: __dirname + '/packages',
dest: __dirname + '/packages',
src: paths.coffee,
ext: '.js'
}
},
jshint: {
all: {
src: paths.js,
options: {
jshintrc: true
}
}
},
uglify: {
core: {
options: {
mangle: false
},
files: '<%= assets.core.js %>'
}
},
csslint: {
options: {
csslintrc: '.csslintrc'
},
src: paths.css
},
cssmin: {
core: {
files: '<%= assets.core.css %>'
}
},
nodemon: {
dev: {
script: 'server.js',
options: {
args: [],
ignore: ['node_modules/**'],
ext: 'js,html',
nodeArgs: ['--debug'],
delayTime: 1,
cwd: __dirname
}
}
},
concurrent: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
}, // Testing framework
mochaTest: {
options: {
reporter: 'spec', require: ['server.js', function () {
require('meanio/lib/util').preload(__dirname + '/packages/**/server', 'model');
}]
},
src: ['packages/**/server/tests/**/*.js']
},
env: {
test: {
NODE_ENV: 'test'
}
},
// Unit tests
karma: {
unit: {
configFile: 'karma.conf.js'
}
},
// e2e test
protractor: {
options: {
configFile: 'protractorConf.js', // Default config file
keepAlive: true, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
args: {
// Arguments passed to the command
}
},
all: {
}
//your_target: { // Grunt requires at least one target to run so you can simply put 'all: {}' here too.
// options: {
// configFile: "e2e.conf.js", // Target-specific config file
// args: {} // Target-specific arguments
// }
//}
}
});
//Load NPM tasks
require('load-grunt-tasks')(grunt);
//Default task(s).
if (process.env.NODE_ENV === 'production') {
grunt.registerTask('default', ['clean', 'cssmin', 'uglify', 'concurrent']);
} else {
grunt.registerTask('default', ['clean', 'jshint', 'csslint', 'concurrent']);
}
//Test task.
grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);
grunt.registerTask('karmatest', ['env:test', 'karma:unit']);
grunt.registerTask('e2e', ['env:test', 'mochaTest', 'protractor']);
// For Heroku users only.
// Docs: https://github.com/linnovate/mean/wiki/Deploying-on-Heroku
grunt.registerTask('heroku:production', ['cssmin', 'uglify']);
};
|
JavaScript
| 0.000001 |
@@ -4940,17 +4940,73 @@
sk('
+mocha', %5B'env:test', 'mochaTest'%5D);%0A grunt.registerTask('
karma
-test
', %5B
|
352a4f11f7b7df28a3e54be264b34fdef0394ea6
|
Update Grunt js scripts
|
Gruntfile.js
|
Gruntfile.js
|
module.exports = function (grunt) {
'use strict';
// ====================
// == Edit this section
var jsFileList = [
'js/helpers.js',
'js/plugins.js',
'js/script.js'
];
var distDir = 'js/dist/';
var jsFile = 'app.min.js';
// ====================
// Project configuration
grunt.initConfig({
pkg: require('./package'),
jshint: {
all: jsFileList,
options: {
jshintrc: '.jshintrc'
}
},
// Choose Sass files below
sass: {
dev: {
options: {
unixNewlines: true,
style: 'expanded',
lineNumbers: false,
debugInfo : false,
precision : 8
},
files: {
'css/kickoff.css': 'scss/kickoff.scss',
'css/kickoff-old-ie.css': 'scss/kickoff-old-ie.scss'
}
},
deploy: {
options: {
style: 'compressed'
},
files: {
'css/kickoff.min.css': 'scss/kickoff.scss',
'css/kickoff-old-ie.min.css': 'scss/kickoff-old-ie.scss'
}
}
},
uglify: {
options: {
// mangle: Turn on or off mangling
mangle: true,
// beautify: beautify your code for debugging/troubleshooting purposes
beautify: false,
// report: Show file size report
report: 'gzip',
// sourceMap: @string. The location of the source map, relative to the project
sourceMap: jsFile + '.map',
// sourceMappingURL: @string. The string that is printed to the final file
sourceMappingURL: '../../'+ jsFile +'.map'
// sourceMapRoot: @string. The location where your source files can be found. This sets the sourceRoot field in the source map.
// sourceMapRoot: 'js',
// sourceMapPrefix: @integer. The number of directories to drop from the path prefix when declaring files in the source map.
// sourceMapPrefix: 1,
},
js: {
src: jsFileList,
dest: distDir + jsFile
}
},
watch: {
scss: {
files: ['scss/**/*.scss'],
tasks: 'sass:dev'
},
js: {
files: [
'Gruntfile.js',
'js/*.js',
'js/libs/**/*.js'
],
tasks: ['uglify']
},
livereload: {
options: { livereload: true },
files: [
'css/*.css'
]
}
}
});
// Load some stuff
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-devtools');
// =============
// === Tasks ===
// =============
// A task for development
grunt.registerTask('dev', ['jshint', 'uglify', 'sass:dev']);
// A task for deployment
grunt.registerTask('deploy', ['jshint', 'clean', 'modernizr', 'uglify', 'sass:deploy']);
// Default task
grunt.registerTask('default', ['jshint', 'uglify', 'sass:dev']);
};
|
JavaScript
| 0 |
@@ -129,16 +129,24 @@
/helpers
+/helpers
.js',%0A%09%09
@@ -153,15 +153,23 @@
'js/
-plugins
+helpers/console
.js'
|
af6a07ba16c78956e74f886b3eed2464e88677de
|
Correct name error
|
packages/config/configDefaults.js
|
packages/config/configDefaults.js
|
const path = require("path");
const Provider = require("@truffle/provider");
// This is a list of multi-level keys with defaults
// we need to _.merge. Using this list for safety
// vs. just merging all objects.
const _values = ({ truffleDirectory, workingDirectory, network }) => {
return {
truffle_directory:
truffleDirectory || path.resolve(path.join(__dirname, "../")),
working_directory: workingDirectory || process.cwd(),
network,
networks: {},
verboseRpc: false,
gas: null,
gasPrice: null,
from: null,
confirmations: 0,
timeoutBlocks: 0,
production: false,
skipDryRun: false,
build: null,
resolver: null,
artifactor: null,
ethpm: {
ipfs_host: "ipfs.infura.io",
ipfs_protocol: "https",
registry: "0x8011df4830b4f696cd81393997e5371b93338878",
install_provider_uri: "https://ropsten.infura.io/truffle"
},
compilers: {
solc: {
settings: {
optimizer: {
enabled: false,
runs: 200
}
}
},
vyper: {}
},
logger: {
log() {}
}
};
};
const props = ({ configObject }) => {
const resolveDirectory = value => {
return path.resolve(configObject.working_directory, value);
};
const defaultTXValues = {
gas: 6721975,
gasPrice: 20000000000, // 20 gwei,
from: null
};
return {
// These are already set.
truffle_directory() {},
working_directory() {},
network() {},
networks() {},
verboseRpc() {},
build() {},
resolver() {},
artifactor() {},
ethpm() {},
logger() {},
compilers() {},
build_directory: {
default: () => path.join(configObject.working_directory, "build"),
transform: resolveDirectory
},
contracts_directory: {
default: () => path.join(configObject.working_directory, "contracts"),
transform: resolveDirectory
},
contracts_build_directory: {
default: () => path.join(configObject.build_directory, "contracts"),
transform: resolveDirectory
},
migrations_directory: {
default: () => path.join(configObject.working_directory, "migrations"),
transform: resolveDirectory
},
migrations_file_extension_regexp() {
return /^\.(js|es6?)$/;
},
test_directory: {
default: () => path.join(configObject.working_directory, "test"),
transform: resolveDirectory
},
test_file_extension_regexp() {
return /.*\.(js|ts|es|es6|jsx|sol)$/;
},
example_project_directory: {
default: () => path.join(configObject.truffle_directory, "example"),
transform: resolveDirectory
},
network_id: {
get() {
try {
return configObject.network_config.network_id;
} catch (e) {
return null;
}
},
set() {
throw new Error(
"Do not set config.network_id. Instead, set config.networks and then config.networks[<network name>].network_id"
);
}
},
network_config: {
get() {
const network = configObject.network;
if (network === null || network === undefined) {
throw new Error("Network not set. Cannot determine network to use.");
}
let conf = configObject.networks[network];
if (conf === null || conf === undefined) {
config = {};
}
conf = _.extend({}, defaultTXValues, conf);
return conf;
},
set() {
throw new Error(
"Don't set config.network_config. Instead, set config.networks with the desired values."
);
}
},
from: {
get() {
try {
return configObject.network_config.from;
} catch (e) {
return defaultTXValues.from;
}
},
set() {
throw new Error(
"Don't set config.from directly. Instead, set config.networks and then config.networks[<network name>].from"
);
}
},
gas: {
get() {
try {
return configObject.network_config.gas;
} catch (e) {
return defaultTXValues.gas;
}
},
set() {
throw new Error(
"Don't set config.gas directly. Instead, set config.networks and then config.networks[<network name>].gas"
);
}
},
gasPrice: {
get() {
try {
return configObject.network_config.gasPrice;
} catch (e) {
return defaultTXValues.gasPrice;
}
},
set() {
throw new Error(
"Don't set config.gasPrice directly. Instead, set config.networks and then config.networks[<network name>].gasPrice"
);
}
},
provider: {
get() {
if (!configObject.network) {
return null;
}
const options = configObject.network_config;
options.verboseRpc = configObject.verboseRpc;
return Provider.create(options);
},
set() {
throw new Error(
"Don't set config.provider directly. Instead, set config.networks and then set config.networks[<network name>].provider"
);
}
},
confirmations: {
get() {
try {
return configObject.network_config.confirmations;
} catch (e) {
return 0;
}
},
set() {
throw new Error(
"Don't set config.confirmations directly. Instead, set config.networks and then config.networks[<network name>].confirmations"
);
}
},
production: {
get() {
try {
return configObject.network_config.production;
} catch (e) {
return false;
}
},
set() {
throw new Error(
"Don't set config.production directly. Instead, set config.networks and then config.networks[<network name>].production"
);
}
},
timeoutBlocks: {
get() {
try {
return configObject.network_config.timeoutBlocks;
} catch (e) {
return 0;
}
},
set() {
throw new Error(
"Don't set config.timeoutBlocks directly. Instead, set config.networks and then config.networks[<network name>].timeoutBlocks"
);
}
}
};
};
module.exports = {
_values,
props
};
|
JavaScript
| 0.998757 |
@@ -1131,17 +1131,23 @@
%0A%0Aconst
-p
+configP
rops = (
@@ -6326,17 +6326,23 @@
lues,%0A
-p
+configP
rops%0A%7D;%0A
|
b8e948e8ca1a521055f8f5b6918c986e4dd40c70
|
change cells color
|
js/src/GameOfLifeCanvasRender.js
|
js/src/GameOfLifeCanvasRender.js
|
function GameOfLifeCanvasRender(gameOfLife, pixelSize, numMaxGenerations, insertionElement) {
this.gameOfLife = gameOfLife;
this.generation = 0;
this.pixelSize = pixelSize;
this.insertionElement = insertionElement;
this.generationLabel = document.createElement("Label");
this.generationLabel.innerHTML = "Generation: ";
this.canvas = document.createElement('canvas');
this.canvas.id = "GameOfLifeCanvas";
this.canvas.width = this.gameOfLife.board.numColumns * this.pixelSize;
this.canvas.height = this.gameOfLife.board.numRows * this.pixelSize;
this.canvas.style.zIndex = 8;
this.canvas.style.border = "1px solid gray";
var sizeXLabel = document.createElement("Label");
sizeXLabel.innerHTML = "Canvas Width: " + this.canvas.width + " ";
var sizeYLabel = document.createElement("Label");
sizeYLabel.innerHTML = "Canvas Height: " + this.canvas.height + " ";
this.insertionElement.appendChild(sizeXLabel);
this.insertionElement.appendChild(sizeYLabel);
this.insertionElement.appendChild(this.generationLabel);
this.insertionElement.appendChild(document.createElement("br"));
this.insertionElement.appendChild(this.canvas);
this.insertionElement.appendChild(document.createElement("br"));
this.Render(numMaxGenerations);
};
GameOfLifeCanvasRender.prototype.Render = function(numMaxGenerations) {
var ctx = this.canvas.getContext("2d");
ctx.fillStyle = "red";
var stopOnAllDead = true;
var self = this;
var animation = setInterval(function() {
ctx.clearRect(0, 0, self.canvas.width, self.canvas.height);
stopOnAllDead = true;
var nextState = self.gameOfLife.board.GetStateMatrix();
for (var rowIndex = 0; rowIndex < self.gameOfLife.board.numRows; rowIndex++) {
for (var colIndex = 0; colIndex < self.gameOfLife.board.numColumns; colIndex++) {
if (nextState[rowIndex][colIndex] === 1) {
ctx.fillRect(colIndex*self.pixelSize, rowIndex*self.pixelSize, self.pixelSize, self.pixelSize);
stopOnAllDead = false;
}
}
}
self.gameOfLife.NextGeneration();
self.generation++;
self.generationLabel.innerHTML = "Generation: " + self.generation;
if (stopOnAllDead || self.generation === numMaxGenerations) {
clearInterval(animation);
}
}, 100);
}
GameOfLifeCanvasRender.prototype.Clear = function() {
while (this.insertionElement.hasChildNodes()) {
this.insertionElement.removeChild(this.insertionElement.lastChild);
}
}
|
JavaScript
| 0.000001 |
@@ -1478,11 +1478,15 @@
= %22
-red
+#135AC3
%22;%0A%0A
|
ec83384637b8ffe863bd4c0559cd80fd5b2c7582
|
Make client less verbose
|
html-example/likeButton.js
|
html-example/likeButton.js
|
// Protect from weird console issues
(function () {
// Union of Chrome, Firefox, IE, Opera, and Safari console methods
var methods = ["assert", "cd", "clear", "count", "countReset",
"debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed",
"groupEnd", "info", "log", "markTimeline", "profile", "profileEnd",
"select", "table", "time", "timeEnd", "timeStamp", "timeline",
"timelineEnd", "trace", "warn"
];
var length = methods.length;
var console = (window.console = window.console || {});
var method;
var noop = function () {};
while (length--) {
method = methods[length];
// define undefined methods as noops to prevent errors
if (!console[method])
console[method] = noop;
}
})();
var userid;
// Add FontAwesome stylesheet
var cssId = 'fontawesome';
if (!document.getElementById(cssId)) {
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css';
link.media = 'all';
head.appendChild(link);
}
// Add the like buttons
$(document).ready(function () {
// Get the userID from the top-right menu
userid = $("span#zz17_Menu_t").text().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
$("div.blogFloat").each(function () {
// Generate a unique identifier for the post — I'll use the title here, but this should be done better!
var postid = $(this).find("h3").text().replace(/^\s\s*/, '').replace(/\s\s*$/, '').replace(/ /g, '');
$(this).find("h3").css("float", "left");
$(this).find("h3").after('<p> <span style="margin-left:1em;border: 1px solid rgb(128,128,128);padding:0.2em;padding-right:0.4em;" onclick="likePost(\'' + postid + '\', \'' + userid + '\', this)"><i style="margin-right:0.5em;" class="fa fa-thumbs-up"></i><i style="margin-right:0.5em;" class="fa fa-thumbs-o-up"></i>Like</span><span class="likesContainer" id="' + postid + '"><span class="counter" style="margin-left:0;border: 1px solid rgb(128,128,128);padding:0.2em 0.5em 0.2em;">0</span></span><span style="display:none;position:absolute;background-color:rgb(102,102,102);color:white;padding:0 0.3em 0;left:0;top:0;font-size:80%;width:10em;" id="' + postid + 'LikesList"></span></p>');
console.log(this);
$(this).find(".fa-thumbs-up").toggle();
});
// Show the likes list
var postid, itsheight, itswidth;
$('.likesContainer').on('mouseover', function (event) {
postid = $(this).attr('id');
itsheight = $(this).height() + 10;
//itswidth = $('#SocialMediaatWorkLikesList').parent().position().left;
itswidth = 57 + 16 + $('#' + postid + 'LikesList').parent().parent().find("h3").width() + 58;
$('#' + postid + 'LikesList').parent().css({
position: 'relative'
});
$('#' + postid + 'LikesList').css({
top: itsheight,
left: itswidth,
position: 'absolute'
});
//$('#'+postid+'LikesList').css("top", topposition + itsheight);
//$('#'+postid+'LikesList').css("left", leftposition - (itswidth/2));
$('#' + postid + 'LikesList').show();
});
$('.likesContainer').on('mouseout', function (event) {
var postid = $(this).attr('id');
$('#'+postid+'LikesList').hide();
});
$.ajax({
method: "POST",
url: "https://schlachter.ca/sharepoint-like/getLikes",
data: {
sitekey: "7B8215BF76"
}
})
.done(function (likesList) {
processLikes(likesList);
});
});
// When like button is clicked...
var likePost = function (postid, userid, caller) {
console.log("We have clicked it!");
$.ajax({
method: "POST",
url: "https://schlachter.ca/sharepoint-like/like",
data: {
userid: userid,
postid: postid,
sitekey: "7B8215BF76"
}
})
.done(function (msg) {
processLikes(msg);
});
console.log(caller);
}
var processLikes = function (likesList) {
console.log(likesList);
// Now, go through an update the state of each like button, based on if the current user has liked it!
var postid, i, j, count, userLikesIt, users, neatUsers;
$("div.blogFloat").each(function () {
count = 0;
users = [];
userLikesIt = false;
postid = $(this).find("h3").text().replace(/^\s\s*/, '').replace(/\s\s*$/, '').replace(/ /g, '');
for (i = 0; i < likesList.length; i++) {
if (likesList[i].postid === postid) {
count = count + 1;
users.push(likesList[i].userid)
if (likesList[i].userid === userid) {
$(this).find(".fa-thumbs-up").show();
$(this).find(".fa-thumbs-o-up").hide();
userLikesIt = true;
}
}
}
$(this).find(".counter").text(count);
neatUsers = "";
for (j = 0; j < users.length; j++) {
neatUsers = neatUsers + users[j] + "<br>";
}
$(this).find('#' + postid + 'LikesList').html(neatUsers);
if (userLikesIt === false) {
$(this).find(".fa-thumbs-up").hide();
$(this).find(".fa-thumbs-o-up").show();
}
});
};
|
JavaScript
| 0.045998 |
@@ -2309,29 +2309,8 @@
');%0A
-%09%09console.log(this);%0A
%09%09$(
@@ -3500,45 +3500,8 @@
) %7B%0A
-%09console.log(%22We have clicked it!%22);%0A
%09$.a
@@ -3723,30 +3723,8 @@
%7D);%0A
-%09console.log(caller);%0A
%7D%0A%0Av
@@ -3768,33 +3768,8 @@
) %7B%0A
-%09console.log(likesList);%0A
%09//
|
ac5a359c30b3b5a2dc012e77e9b05473e41e4323
|
Update script.js
|
JS/script.js
|
JS/script.js
|
/**
* Script um die Funktionsweise von Events und EventListenern zu zeigen.
*
* created by Kai Karren
*/
document.getElementById("testListener").addEventListener("click", listenerDemo);
function change(){
document.getElementById("onclickDemo").innerHTML = "<p>Was nun auch passiert ist.<p><p><tag onclick= function()> Beliebiger Text </tag> <p>";
}
function hover(obj){
obj.style.color ="green";
obj.style.textTransform ="uppercase";
obj.style.fontSize="35px";
document.getElementById("over").innerHTML = "<tag onmouseover = function() onmouseout = function() > Belibiger Text </tag>";
}
function nohover(obj){
obj.style.color ="black";
obj.style.textTransform ="none";
obj.style.fontSize="20px";
}
function listenerDemo(){
document.getElementById("testListener").innerHTML = "<p><tag id= test > Beliebiger Text </tag> </p><p>Im Script: document.getElementById(id).addEventListener(art, function())</p>";
}
|
JavaScript
| 0.000002 |
@@ -989,16 +989,17 @@
ction())
+;
%3C/p%3E%22;%0A%0A
@@ -995,12 +995,13 @@
));%3C/p%3E%22;%0A%0A%7D
+%0A
|
185ad3a0ac702ef4c72166fbb8bc7620380342ea
|
Add ability to specify profile from credentials file. Resolves #37
|
dynamoDBtoCSV.js
|
dynamoDBtoCSV.js
|
var program = require('commander');
var AWS = require('aws-sdk');
var unmarshalItem = require('dynamodb-marshaler').unmarshalItem;
var unmarshal = require('dynamodb-marshaler').unmarshal;
var Papa = require('papaparse');
var headers = [];
var unMarshalledArray = [];
program
.version('0.0.1')
.option('-t, --table [tablename]', 'Add the table you want to output to csv')
.option("-d, --describe")
.option("-r, --region [regionname]")
.option("-e, --endpoint [url]", 'Endpoint URL, can be used to dump from local DynamoDB')
.parse(process.argv);
if (!program.table) {
console.log("You must specify a table");
program.outputHelp();
process.exit(1);
}
if (program.region && AWS.config.credentials) {
AWS.config.update({region: program.region});
} else {
AWS.config.loadFromPath('./config.json');
}
if (program.endpoint) {
AWS.config.update({endpoint: program.endpoint})
}
var dynamoDB = new AWS.DynamoDB();
var query = {
"TableName": program.table,
"Limit": 1000
};
var describeTable = function(query) {
dynamoDB.describeTable({
"TableName": program.table
}, function(err, data) {
if (!err) {
console.dir(data.Table);
} else console.dir(err);
});
}
var scanDynamoDB = function ( query ) {
dynamoDB.scan( query, function ( err, data ) {
if ( !err ) {
unMarshalIntoArray( data.Items ); // Print out the subset of results.
if ( data.LastEvaluatedKey ) { // Result is incomplete; there is more to come.
query.ExclusiveStartKey = data.LastEvaluatedKey;
scanDynamoDB(query);
}
else {
console.log(Papa.unparse( { fields: [ ...headers ], data: unMarshalledArray } ));
}
}
else {
console.dir(err);
}
});
};
function unMarshalIntoArray( items ) {
if ( items.length === 0 )
return;
items.forEach( function ( row ) {
let newRow = {};
// console.log( 'Row: ' + JSON.stringify( row ));
Object.keys( row ).forEach( function ( key ) {
if ( headers.indexOf( key.trim() ) === -1 ) {
// console.log( 'putting new key ' + key.trim() + ' into headers ' + headers.toString());
headers.push( key.trim() );
}
let newValue = unmarshal( row[key] );
if ( typeof newValue === 'object' ) {
newRow[key] = JSON.stringify( newValue );
}
else {
newRow[key] = newValue;
}
});
// console.log( newRow );
unMarshalledArray.push( newRow );
});
}
if ( program.describe ) describeTable( query );
else scanDynamoDB( query );
|
JavaScript
| 0 |
@@ -527,16 +527,95 @@
amoDB')%0A
+ .option(%22-p, --profile %5Bprofile%5D%22, 'Use profile from your credentials file')%0A
.parse
@@ -630,16 +630,16 @@
.argv);%0A
-
%0Aif (!pr
@@ -738,24 +738,25 @@
exit(1);%0A%7D%0A%0A
+%0A
if (program.
@@ -914,24 +914,24 @@
endpoint) %7B%0A
-
AWS.config
@@ -971,16 +971,167 @@
nt%7D)%0A%7D%0A%0A
+if (program.profile) %7B%0A var newCreds = AWS.config.credentials;%0A newCreds.profile = program.profile;%0A AWS.config.update(%7Bcredentials: newCreds%7D);%0A%7D%0A%0A
var dyna
|
285dd162f9e87583c9491bc0acbc10e4b06a19b0
|
Update stryker config
|
stryker.conf.js
|
stryker.conf.js
|
module.exports = (config) => {
config.set({
files: [
'src/config/**/*.js',
'src/push/**/*.js',
'src/bbq/sensor/**/*.js',
'src/**/*.test.js',
],
mutate: [
'src/config/**/*.js',
'src/push/**/*.js',
'src/bbq/sensor/**/*.js',
'!src/**/*.test.js',
],
testRunner: 'jest',
coverageAnalysis: 'off',
// logLevel: 'debug',
});
};
|
JavaScript
| 0 |
@@ -55,39 +55,32 @@
s: %5B%0A 'src/
-config/
**/*.js',%0A
@@ -76,36 +76,35 @@
js',%0A '
+!
src/
-push/**/
+server
*.js',%0A
@@ -105,35 +105,31 @@
%0A '
+!
src/b
-bq/sensor
+ackend
/**
-/*
.js',%0A
@@ -133,29 +133,60 @@
%0A '
+!
src/
-**/*.test
+promisetest/**/*.js',%0A '!test/**/*
.js',%0A
@@ -219,15 +219,8 @@
src/
-config/
**/*
@@ -236,20 +236,19 @@
'
+!
src/
-push/**/
+server
*.js
@@ -261,22 +261,52 @@
'
+!
src/b
-bq/sensor
+ackend/**.js',%0A '!src/promisetest
/**/
@@ -421,13 +421,13 @@
l: '
-debug
+trace
',%0A
|
954be593696f45e2c9d7421275e2de7cadd37578
|
add missing `eventLog` argument in creep tick intent
|
src/processor/intents/creeps/tick.js
|
src/processor/intents/creeps/tick.js
|
var _ = require('lodash'),
utils = require('../../../utils'),
driver = utils.getDriver(),
C = driver.constants,
movement = require('../movement');
function _applyDamage(object, damage) {
let damageReduce = 0, damageEffective = damage;
if(_.any(object.body, i => !!i.boost)) {
for(let i=0; i<object.body.length; i++) {
if(damageEffective <= 0) {
break;
}
let bodyPart = object.body[i], damageRatio = 1;
if(bodyPart.boost && C.BOOSTS[bodyPart.type][bodyPart.boost] && C.BOOSTS[bodyPart.type][bodyPart.boost].damage) {
damageRatio = C.BOOSTS[bodyPart.type][bodyPart.boost].damage;
}
let bodyPartHitsEffective = bodyPart.hits / damageRatio;
damageReduce += Math.min(bodyPartHitsEffective, damageEffective) * (1 - damageRatio);
damageEffective -= Math.min(bodyPartHitsEffective, damageEffective);
}
}
damage -= Math.round(damageReduce);
object.hits -= damage;
}
module.exports = function(object, scope) {
const {roomObjects, bulk, roomController, gameTime} = scope;
if(!object || object.type != 'creep') return;
if(object.spawning) {
var spawn = _.find(roomObjects, {type: 'spawn', x: object.x, y: object.y});
if(!spawn) {
bulk.remove(object._id);
}
else {
if(!spawn.spawning || spawn.spawning.name != object.name) {
require('../spawns/_born-creep')(spawn, object, scope);
}
}
}
else {
movement.execute(object, bulk, roomController, gameTime);
if((object.x == 0 || object.y == 0 || object.x == 49 || object.y == 49) && object.user != '2' && object.user != '3') {
var [roomX, roomY] = utils.roomNameToXY(object.room),
x = object.x,
y = object.y,
room = object.room;
if (object.x == 0) {
x = 49;
room = utils.getRoomNameFromXY(roomX-1, roomY);
}
else if (object.y == 0) {
y = 49;
room = utils.getRoomNameFromXY(roomX, roomY-1);
}
else if (object.x == 49) {
x = 0;
room = utils.getRoomNameFromXY(roomX+1, roomY);
}
else if (object.y == 49) {
y = 0;
room = utils.getRoomNameFromXY(roomX, roomY+1);
}
bulk.update(object, {interRoom: {room, x, y}});
eventLog.push({event: C.EVENT_EXIT, objectId: object._id, data: {room, x, y}});
}
if(object.ageTime) { // since NPC creeps may appear right on portals without `ageTime` defined at the first tick
var portal = _.find(roomObjects, i => i.type == 'portal' && i.x == object.x && i.y == object.y);
if (portal) {
bulk.update(object, {interRoom: portal.destination});
}
}
if(!object.tutorial) {
if(!object.ageTime) {
object.ageTime = gameTime + (_.any(object.body, {type: C.CLAIM}) ? C.CREEP_CLAIM_LIFE_TIME : C.CREEP_LIFE_TIME);
bulk.update(object, {ageTime: object.ageTime});
}
if(gameTime >= object.ageTime-1) {
require('./_die')(object, undefined, scope);
}
}
if(!_.isEqual(object.actionLog, object._actionLog)) {
bulk.update(object, {actionLog: object.actionLog});
}
}
if(object.fatigue > 0) {
var moves = utils.calcBodyEffectiveness(object.body, C.MOVE, 'fatigue', 1);
object.fatigue -= moves * 2;
if(object.fatigue < 0)
object.fatigue = 0;
bulk.update(object._id, {fatigue: object.fatigue});
}
if(_.isNaN(object.hits) || object.hits <= 0) {
require('./_die')(object, undefined, scope);
}
if(object.userSummoned && _.any(roomObjects, i => i.type == 'creep' && i.user != '2' && i.user != roomController.user)) {
require('./_die')(object, undefined, scope);
}
let oldHits = object.hits;
if (object._damageToApply) {
_applyDamage(object, object._damageToApply);
delete object._damageToApply;
}
if (object._healToApply) {
object.hits += object._healToApply;
delete object._healToApply;
}
if(object.hits > object.hitsMax) {
object.hits = object.hitsMax;
}
if(object.hits <= 0) {
require('./_die')(object, undefined, scope);
}
else if(object.hits != oldHits) {
require('./_recalc-body')(object);
if(object.hits < oldHits) {
require('./_drop-resources-without-space')(object, scope);
}
bulk.update(object, {
hits: object.hits,
body: object.body,
energyCapacity: object.energyCapacity
});
}
};
|
JavaScript
| 0.000002 |
@@ -1134,16 +1134,26 @@
gameTime
+, eventLog
%7D = scop
|
6e28c5d71801f86be6de26a42f9acdb5b3eaefdc
|
use FlatList's refresh controller instead of my custom hoc
|
mobile/activities/Operation/index.js
|
mobile/activities/Operation/index.js
|
import React, { Component } from 'react'
import * as R from 'ramda'
import { connect } from 'react-redux'
import { compose, flattenProp, mapProps, setDisplayName } from 'recompose'
import { goToOrder } from 'Coopcon/data/navigation/actions'
import { isLoadingOperations, getCurrentOperation } from 'Coopcon/data/operation/selectors'
import { StyleSheet, View, FlatList } from 'react-native'
import { FAB } from 'react-native-paper'
import withLoadingIndicator from 'Coopcon/hocs/withLoadingIndicator'
import Order from './components/Order'
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
},
buttonContainer: {
position: 'absolute',
bottom: 0,
right: 0,
padding: 10,
},
})
const mapStateToProps = (state) => ({
loading: isLoadingOperations(state),
operation: getCurrentOperation(state),
})
const mapDispatchToProps = (dispatch) => ({
goToOrder: () => dispatch(goToOrder()),
})
const enhancer = compose(
connect(mapStateToProps, mapDispatchToProps),
withLoadingIndicator(),
flattenProp('operation'),
mapProps(R.evolve({
orders: R.map((id) => ({ id })),
})),
setDisplayName('Home'),
)
const Operation = enhancer(({ orders, goToOrder }) => (
<View style={styles.container}>
<FlatList
data={orders}
keyExtractor={R.prop('id')}
renderItem={({ item: { id } }) => (<Order id={id} />)}
/>
<View style={styles.buttonContainer}>
<FAB
icon="add"
onPress={goToOrder}
/>
</View>
</View>
))
export default class OperationWrapper extends Component {
render() {
return <Operation/>
}
}
OperationWrapper.navigationOptions = {
title: 'Pedidos',
}
|
JavaScript
| 0 |
@@ -234,16 +234,80 @@
ctions'%0A
+import %7B fetchOperation %7D from 'Coopcon/data/operation/actions'%0A
import %7B
@@ -493,77 +493,8 @@
er'%0A
-import withLoadingIndicator from 'Coopcon/hocs/withLoadingIndicator'%0A
impo
@@ -894,16 +894,68 @@
) =%3E (%7B%0A
+ fetchOperation: () =%3E dispatch(fetchOperation()),%0A
goToOr
@@ -1070,34 +1070,8 @@
s),%0A
- withLoadingIndicator(),%0A
fl
@@ -1218,16 +1218,25 @@
ancer((%7B
+ loading,
orders,
@@ -1245,16 +1245,32 @@
oToOrder
+, fetchOperation
%7D) =%3E (
@@ -1318,16 +1318,76 @@
latList%0A
+ onRefresh=%7BfetchOperation%7D%0A refreshing=%7Bloading%7D%0A
da
|
c6d6f001aa36fdefccd341e37fd4444ee01d0dfe
|
Fix TokenActivationEmail expiration timeout.
|
models/users/TokenActivationEmail.js
|
models/users/TokenActivationEmail.js
|
/**
* class models.users.TokenActivationEmail
*
* Expirable secret key used for email address confirmation by newly
* registered users.
**/
'use strict';
var Mongoose = require('mongoose');
var Schema = Mongoose.Schema;
var crypto = require('crypto');
var TOKEN_EXPIRE_TIMEOUT = 6 * 60 * 60; // 6 hours.
var TOKEN_SECRET_KEY_LENGTH = 16;
function generateSecretKey() {
return crypto.randomBytes(TOKEN_SECRET_KEY_LENGTH).toString('hex');
}
module.exports = function (N, collectionName) {
var TokenActivationEmail = new Schema({
secret_key : { type: String, required: true, 'default': generateSecretKey }
, create_ts : { type: Date, required: true, 'default': Date, expires: TOKEN_EXPIRE_TIMEOUT }
, email : { type: String, required: true }
});
TokenActivationEmail.methods.isExpired = function isExpired() {
return Date.now() >= (this.create_ts.getTime() + TOKEN_EXPIRE_TIMEOUT);
};
TokenActivationEmail.index({ secret_key: 1 }, { unique: true });
N.wire.on("init:models", function emit_init_TokenActivationEmail(__, callback) {
N.wire.emit("init:models." + collectionName, TokenActivationEmail, callback);
});
N.wire.on("init:models." + collectionName, function init_model_TokenActivationEmail(schema) {
N.models[collectionName] = Mongoose.model(collectionName, schema);
});
};
|
JavaScript
| 0 |
@@ -304,16 +304,23 @@
60 * 60
+ * 1000
; // 6 h
@@ -323,16 +323,25 @@
6 hours
+ in msecs
.%0Avar TO
|
252ed2dcade012e55ac689b394bb091f00364e04
|
Fix Arrayfild item and field name resolve recursing
|
src/resources/elements/arrayfield.js
|
src/resources/elements/arrayfield.js
|
import {containerless} from 'aurelia-framework';
import {Parentfield} from './abstract/parentfield';
import {Field} from './abstract/field';
/**
* Arrayfield is a {@link Parentfield} that has a variable number of the same kind of child.
*/
@containerless
export class Arrayfield extends Parentfield {
/**
* The base object that is cloned whenever a new child is added.
* @type {Field}
*/
item;
/**
* The text that is displayed in the new item -button rather than the label of
* the child.
* @type {String}
*/
newItemText;
/**
* The field that is used as the key if {@link #format} is {@linkplain map}
* @type {String}
*/
keyField = '_key';
/**
* The field that is used as the value if {@link #format} is {@linkplain map}
* This field is optional. By default, the whole value will be used as-is.
* @type {String}
*/
valueField = undefined;
/**
* Whether or not to add {@linkplain #<index>} to the end of the labels of
* children.
* @type {Boolean}
*/
addIndexToChildLabel = true;
/**
* Whether or not to automatically collapse other fields when uncollapsing a
* field.
* @type {Boolean}
*/
collapseManagement = false;
/** @inheritdoc */
_children = [];
/**
* @inheritdoc
* @param {Field} [args.item] The base object that is cloned to create
* new children.
* @param {String} [args.newItemText] The text that is displayed in the new
* item -button rather than the label of
* the child.
* @param {String} [args.keyField] The field that is used as the key if
* {@link #format} is {@linkplain map}
* @param {String} [args.valueField] The field that is used as the value if
* {@link #format} is {@linkplain map}.
* This field is optional. By default, the
* whole value will be used as-is.
* @param {Boolean} [args.collapsed] Whether or not the UI element should be
* collapsed.
*/
init(id = '', args = {}) {
args = Object.assign({
format: 'array',
newItemText: undefined,
keyField: '_key',
valueField: undefined,
addIndexToChildLabel: true,
collapseManagement: false,
collapsed: false
}, args);
this.item = args.item;
this.newItemText = args.newItemText;
this.keyField = args.keyField;
this.valueField = args.valueField;
this.addIndexToChildLabel = args.addIndexToChildLabel;
this.collapseManagement = args.collapseManagement;
this.collapsed = args.collapsed;
return super.init(id, args);
}
/**
* Check if this array is empty. If all children are empty, then this field is
* also considered to be empty.
*/
isEmpty() {
for (const child of this._children) {
if (!child.isEmpty()) {
// This field is not empty if any of the children is not empty.
return false;
}
}
return true;
}
/**
* @inheritdoc
* @return {Object[]|Object} The values of the children of this array in the
* format specified by {@link #format}.
*/
getValue() {
let value = undefined;
if (this.format === 'map') {
value = {};
for (const item of this._children) {
if (!item.showValueInParent || !item.display) {
continue;
} else if (item.isEmpty() && item.hideValueIfEmpty) {
continue;
}
const data = item.getValue();
const key = data[this.keyField];
if (this.valueField) {
value[key] = data[this.valueField];
} else {
delete data[this.keyField];
value[key] = data;
}
}
} else if (this.format === 'array') {
value = [];
for (const [index, item] of Object.entries(this._children)) {
if (!item.showValueInParent || !item.display) {
continue;
} else if (item.isEmpty() && item.hideValueIfEmpty) {
continue;
}
value[index] = item.getValue();
}
}
return value;
}
childCollapseChanged(field, isNowCollapsed) {
if (!isNowCollapsed && this.collapseManagement) {
for (const child of this._children) {
if (child !== field) {
child.setCollapsed(true);
}
}
}
}
/**
* @inheritdoc
* @param {Object|Object[]} value The new value in the format specified by
* {@link #format}.
*/
setValue(value) {
this._children = [];
for (const [key, item] of Object.entries(value)) {
const index = this.addChild();
if (this.format === 'map') {
item[this.keyField] = key;
}
this._children[index].setValue(item);
}
}
/**
* Add a new blank child to this array.
*/
addChild() {
if (!(this.item instanceof Field)) {
return;
}
const field = this.item.clone(this);
field.index = this._children.length;
field.id = `${this.item.id}-${field.index}`;
if (this.addIndexToChildLabel) {
field.labelFormat = `${field.labelFormat} #$index`;
}
this._children.push(field);
if (this.collapseManagement) {
field.setCollapsed(false);
}
this.onChange(field);
return field.index;
}
/**
* Delete the child with the given index from this field.
*
* @override
* @param {Number} index The index of the child.
*/
deleteChild(index) {
if (this._children.length === 0) {
return;
}
this._children.splice(index, 1);
for (let i = index; i < this._children.length; i++) {
const item = this._children[i];
item.index = i;
}
this.onChange();
}
/** @inheritdoc */
clone(parent) {
const clone = new Arrayfield();
clone.init(this.id, this);
if (parent) {
clone.parent = parent;
}
if (this.item instanceof Field) {
clone.item = this.item.clone();
}
return clone;
}
resolvePath(path) {
const parentResolveResult = super.resolvePath(path);
if (parentResolveResult) {
return parentResolveResult;
}
if (this.format === 'map') {
// Matches `fieldName(expectedValue)`
const match = (/([a-zA-Z0-9]+)\((.+?)\)/g).exec(path[0]);
if (match) {
const [, fieldName, value] = match;
for (const child of this._children) {
if (child.getValue()[fieldName] === value) {
return child;
}
}
}
}
if (path[0] === ':item') {
return this.item;
}
return undefined;
}
}
|
JavaScript
| 0 |
@@ -6623,16 +6623,44 @@
rn child
+.resolvePath(path.splice(1))
;%0A
@@ -6739,24 +6739,52 @@
rn this.item
+.resolvePath(path.splice(1))
;%0A %7D%0A
|
35fdaf00c8e11976b9bcc1dc03b661d4281ff012
|
Fix format of messages for teamcity: 1. Replace " by ' - because Teamcity can't process messages with " 2. Change messages structrure
|
teamcity-reporter.js
|
teamcity-reporter.js
|
'use strict';
var util = require('util');
/**
* @param {Errors[]} errorsCollection
*/
module.exports = function(errorsCollection) {
var errorCount = 0;
/**
* Formatting every error set.
*/
errorsCollection.forEach(function(errors) {
var file = errors.getFilename();
console.log(util.format('##teamcity[testSuiteStarted name="JSCS: %s"]', file));
if (!errors.isEmpty()) {
errors.getErrorList().forEach(function(error) {
errorCount++;
console.log(util.format('##teamcity[testStarted name="%s"]', file));
console.log(util.format('##teamcity[testFailed name="%s" message="line %d, col %d, %s"]',
file, error.line, error.column, error.message));
});
console.log(util.format('##teamcity[testSuiteFinished name="JSCS: %s"]', file));
}
});
if (!errorCount) {
console.log('##teamcity[testStarted name="JSCS"]');
console.log('##teamcity[testFinished name="JSCS"]');
}
};
|
JavaScript
| 0.999988 |
@@ -1,9 +1,9 @@
-'
+%22
use stri
@@ -4,17 +4,17 @@
e strict
-'
+%22
;%0A%0Avar u
@@ -31,14 +31,14 @@
ire(
-'
+%22
util
-'
+%22
);%0A/
@@ -152,16 +152,92 @@
nt = 0;%0A
+%0A console.log(util.format(%22##teamcity%5BtestSuiteStarted name='JSCS'%5D%22));%0A%0A
/**%0A
@@ -371,96 +371,8 @@
e();
-%0A console.log(util.format('##teamcity%5BtestSuiteStarted name=%22JSCS: %25s%22%5D', file));
%0A%0A
@@ -524,33 +524,33 @@
log(util.format(
-'
+%22
##teamcity%5BtestS
@@ -565,14 +565,14 @@
ame=
-%22%25s%22%5D'
+'%25s'%5D%22
, fi
@@ -609,33 +609,33 @@
log(util.format(
-'
+%22
##teamcity%5BtestF
@@ -649,12 +649,12 @@
ame=
-%22%25s%22
+'%25s'
mes
@@ -658,17 +658,17 @@
message=
-%22
+'
line %25d,
@@ -678,19 +678,19 @@
l %25d, %25s
-%22%5D'
+'%5D%22
,%0A
@@ -772,101 +772,8 @@
%7D);%0A
- console.log(util.format('##teamcity%5BtestSuiteFinished name=%22JSCS: %25s%22%5D', file));%0A
@@ -778,16 +778,17 @@
%7D%0A
+%0A
%7D);%0A
@@ -792,25 +792,24 @@
);%0A%0A if (
-!
errorCount)
@@ -806,21 +806,26 @@
rorCount
+ === 0
) %7B%0A
-
c
@@ -827,33 +827,45 @@
console.log(
-'
+util.format(%22
##teamcity%5BtestS
@@ -876,28 +876,28 @@
ed name=
-%22
+'
JSCS
-%22%5D'
+'%5D%22)
);%0A
-
c
@@ -907,17 +907,29 @@
ole.log(
-'
+util.format(%22
##teamci
@@ -953,24 +953,25 @@
ame=
-%22
+'
JSCS
-%22%5D'
+'%5D%22)
);%0A %7D
%0A%7D;%0A
@@ -966,12 +966,88 @@
);%0A %7D
+%0A%0A console.log(util.format(%22##teamcity%5BtestSuiteFinished name='JSCS'%5D%22));
%0A%7D;%0A
|
63d22bfa615b999e0601da71acae794af3ee4865
|
Remove tappable by default mixin
|
component.js
|
component.js
|
// This is a function that decorates React's createClass.
// It's used only internally in this library,
// but could be used externally eventually.
// See the mixins for more information on what this does.
var UI = require('reapp-ui');
var Component = require('reapp-component')();
var React = require('react');
var Identified = require('./mixins/Identified');
var Styled = require('./mixins/Styled');
var Classed = require('./mixins/Classed');
var Animated = require('./mixins/Animated');
var ComponentProps = require('./mixins/ComponentProps');
var Tappable = require('./mixins/Tappable');
Component.addDecorator(spec => {
spec.mixins = [].concat(
// unique ids and classes
Identified,
Classed(spec.name),
// constants
{ getConstant: UI.getConstants },
// styles and animations
Styled(spec.name, UI.getStyles),
Animated(UI.getAnimations),
// any component-defined mixins
spec.mixins || [],
Tappable,
// componentProps is the meat of a UI component
// when used, it will handle: id, ref, className, styles, animations
ComponentProps
);
// set UI displayname to help with debugging
spec.displayName = `UI-${spec.name}`;
// allow checking for 'isName' on all components
// spec.statics = spec.statics || {};
// spec[`is${spec.name}`] = true;
return React.createClass(spec);
});
module.exports = Component;
|
JavaScript
| 0 |
@@ -545,53 +545,8 @@
s');
-%0Avar Tappable = require('./mixins/Tappable');
%0A%0ACo
@@ -893,23 +893,8 @@
%5D,%0A%0A
- Tappable,%0A%0A
|
7ed00321c18c13bea37ba7105baad66680f41f58
|
Use correct indentation character
|
client/components/profile/profile-category.component.js
|
client/components/profile/profile-category.component.js
|
'use strict';
const PROFILE_CATEGORY_COMPONENT_NAME = 'profileCategory';
const profileCategoryComponent = {
bindings: {
options: '<',
profile: '<'
},
templateUrl: 'components/profile/profile-category.html',
controllerAs: 'profileCategoryCtrl',
controller: class demoController {
constructor($state) {
const { title, subhead, content, icon, model, action } = this.options;
this.$state = $state;
this.title = title;
this.subhead = subhead;
this.content = content;
this.icon = icon;
this.action = action;
this.section = _.property(model)(this.profile);
this.updatedAt = this.section && this.section.updatedAt;
this.completion = this.computeCompletion();
}
go() {
this.$state.go(this.action.sref);
}
getActionLabel() {
switch (this.completion) {
case 'empty':
return 'Commencer';
case 'complete':
return 'Modifier';
case 'half':
return 'Reprendre';
}
}
computeCompletion() {
if (!this.section) {
return 'empty';
} else if (this.section.__completion) {
return 'complete';
} else {
return 'half';
}
}
static get $inject() {
return [
'$state'
];
}
}
};
angular.module('impactApp')
.component(PROFILE_CATEGORY_COMPONENT_NAME, profileCategoryComponent);
|
JavaScript
| 0.001572 |
@@ -1304,9 +1304,10 @@
%7D%0A
-%09
+
%7D%0A%7D;
|
a39087941938faf693253196d201e31558fe0186
|
remove unneccessary classes from state data object
|
app/assets/javascripts/app/app.js
|
app/assets/javascripts/app/app.js
|
angular
.module('app', ['ui.router', 'templates', 'ngAnimate'])
.config(function($stateProvider) {
$stateProvider
.state('index', {
url: '/',
templateUrl: 'app/views/index.html',
controller: 'IndexController as vm_index',
data: {
bgColorClass: 'bg-color-index',
bgImgClass: 'bg-img bg-img-index'
}
})
.state('form', {
url: '/name-builder',
templateUrl: 'app/views/name-builder.html',
controller: 'FormController as vm_form'
})
.state('form.genre', {
url: '/genre',
templateUrl: 'app/views/name-builder-genre.html',
data: {
bgColorClass: 'bg-color-genre',
bgImgClass: 'bg-img bg-img-genre'
}
})
.state('form.length', {
url: '/length',
templateUrl: 'app/views/name-builder-length.html',
data: {
redirect: ['FormDataService', function(FormDataService) {
if (!FormDataService.formData.genre_id) {
return 'form.genre';
}
}],
bgColorClass: 'bg-color-length',
bgImgClass: 'bg-img bg-img-length'
}
})
.state('form.start-word', {
url: '/start-word',
templateUrl: 'app/views/name-builder-start-word.html',
data: {
redirect: ['FormDataService', function(FormDataService) {
if (!FormDataService.formData.genre_id) {
return 'form.genre';
} else if (!FormDataService.formData.words) {
return 'form.length';
}
}],
bgColorClass: 'bg-color-start-word',
bgImgClass: 'bg-img bg-img-start-word'
}
})
.state('name', {
url: '/band-name',
templateUrl: 'app/views/band-name.html',
controller: 'NameController as vm_name',
data: {
redirect: ['FormDataService', function(FormDataService) {
if (!FormDataService.formData.genre_id) {
return 'form.genre';
} else if (!FormDataService.formData.words) {
return 'form.length';
} else if (!FormDataService.formData.beginsWith && FormDataService.formData.beginsWith != '') {
return 'form.start-word';
}
}],
bgColorClass: 'bg-color-band-name bg-color-loading',
bgImgClass: 'bg-img bg-img-loading bg-img-band-name'
}
})
.state('otherwise', {
url: '*path',
templateUrl: 'app/views/index.html',
data: {
bgColorClass: 'bg-color-index',
bgImgClass: 'bg-img bg-img-index'
}
});
})
.run(function($rootScope, $state, $injector) {
$rootScope.$on('$stateChangeStart', function(event, toState, toParams) {
if (toState.data && toState.data.redirect) {
var redirect = $injector.invoke(toState.data.redirect);
if (redirect) {
event.preventDefault();
$state.go(redirect);
}
}
});
$rootScope.$state = $state;
});
|
JavaScript
| 0.000107 |
@@ -384,39 +384,32 @@
ass: 'bg-img
- bg-img
-index'%0A
@@ -388,32 +388,32 @@
'bg-img-index'%0A
+
%7D
@@ -872,23 +872,16 @@
'bg-img
- bg-img
-genre'%0A
@@ -1379,23 +1379,16 @@
'bg-img
- bg-img
-length'
@@ -1999,23 +1999,16 @@
'bg-img
- bg-img
-start-w
@@ -2832,23 +2832,16 @@
'bg-img
- bg-img
-loading
@@ -3077,32 +3077,32 @@
g-color-index',%0A
+
@@ -3120,23 +3120,16 @@
'bg-img
- bg-img
-index'%0A
|
1b87269072ccd9af054ef8bfb998af3502923049
|
fix spacing and indentation
|
app/assets/javascripts/my_site.js
|
app/assets/javascripts/my_site.js
|
(function() {
"use strict";
var CommentModel = Backbone.Model.extend({
validate: function(attr) {
if( !attr.email ) {
alert('Email Required!');
return;
}
if ( !attr.content ) {
alert('Comment field cannot be blank!');
return;
}
},
initialize: function() {
this.content = this.get('content');
this.email = this.get('email')
}
});
var CommentsCollection = Backbone.Collection.extend({
model: CommentModel,
localStorage: [],
url: '/comments'
});
var CommentView = Backbone.View.extend({
tagName: 'li',
// Super anit-pattern terrible >.<
template: "<header> <span class='author-email'><a href='#'><%= email %></a></span>" +
" <span class='date'><%= formatDate %></span> " +
// the time will come when comments have to be deleted or break down and make an admin UI
// " <nav> [<a href='#' class='delete'>x</a>] </nav>" +
" </header> <div class='comment-content'> <%= content %> </div>",
events: {
'click .delete': 'destroy',
},
initialize: function(params) {
if( !this.model ){
throw new Error('You must provide a Comment model');
};
this.$el.attr( "class", "list-group-item" );
this.listenTo( this.model, 'remove', this.remove);
this.listenTo( this.model, 'sync', this.render);
},
render: function(){
var commentInfo = {
email: this.model.email,
content: this.model.content,
formatDate: this.model.get('created_at'),
}
var template = _.template( this.template )
this.$el.html( template(commentInfo) );
return this.$el;
},
destroy: function(event){
event.preventDefault();
this.model.destroy();
},
formatDate: function(){
var date = this.model.get('created_at');
return date;
},
});
var commentsApp = Backbone.View.extend({
el: $('.comments'),
initialize: function() {
this.collection = new CommentsCollection();
this.listenTo( this.collection, 'add', this.renderComment );
this.listenTo( this.collection, 'add', this.renderCommentCount );
this.collection.fetch();
},
events: {
'submit form': 'createComment',
},
createComment: function(event) {
event.preventDefault();
// Create a new Comment Model with the data in the form
var comment = {
content: this.$('form textarea').val(),
email: this.$('#user-email').data('email'),
created_at: +new Date()
};
// The `validate` option ensures that empty comments aren't added
this.collection.create( comment, { validate: true });
},
renderComment: function(model) {
if (!model.content) return;
model.view = new CommentView( { model:model } );
this.$('#comment-list').prepend( model.view.render() );
this.resetFormFields();
},
renderCommentCount: function() {
var length = this.collection.length;
var commentText = length === 1 ? ' Comment' : ' Comments';
$('.comment-count').text( length + commentText )
},
resetFormFields: function() {
this.$('form textarea, form input[name="email"]').val(null);
},
});
$(function(){
window.comments = new commentsApp();
browserid.onLogin = function(data, status, xhr) {
window.location.reload();
}
browserid.onLogout = function(data) {
window.location.reload();
}
});
})();
|
JavaScript
| 0.000004 |
@@ -1316,16 +1316,17 @@
s.remove
+
);%0A
@@ -1372,16 +1372,17 @@
s.render
+
);%0A %7D
@@ -3374,21 +3374,8 @@
data
-, status, xhr
) %7B%0A
|
86aac386f52dbc866afdbe03e78b70c039a7f681
|
fix coords on viewscene
|
app/components/Views/ViewScene.js
|
app/components/Views/ViewScene.js
|
import React, { Component } from 'react';
import ViewActors from './ViewActors';
import ReactMapboxGl, { Layer, Feature, Marker } from 'react-mapbox-gl';
import ReactTimeout from 'react-timeout'
/* ----- COMPONENT ----- */
class Scene extends Component {
constructor() {
super();
this.state = {
coords: '',
style: 'light',
zoom: 13,
}
}
setInnerHTML(html) {
return { __html: html }
}
setMapJSX(jsx) {
return { __html: jsx }
}
componentWillReceiveProps(nextProps) {
// to animate map, set initial zoom to something more zoomed out than the actual value
if (nextProps.maps && nextProps.maps.length) {
let zoom = nextProps.maps[0].zoom;
if (zoom > 12) zoom -= 9;
else if (zoom > 6) zoom -= 3;
else if (zoom > 2) zoom -= 2;
this.setState({
coords: nextProps.maps[0].coords.split(','),
style: nextProps.maps[0].style,
zoom: zoom
})
}
this.props.setTimeout(() => {
if (nextProps.maps && nextProps.maps.length) {
this.setState({
coords: nextProps.maps[0].coords.split(','),
style: nextProps.maps[0].style,
zoom: nextProps.maps[0].zoom
})
}
}, 2001)
}
render() {
return (
<div className="col-md-12">
<div className="scene-hero">
{
this.props.maps && this.props.maps.length
? (<ReactMapboxGl
style={`mapbox://styles/mapbox/${this.state.style}-v9`}
accessToken="pk.eyJ1IjoiZm91cmVzdGZpcmUiLCJhIjoiY2oyY2VnbTN2MDJrYTMzbzgxNGV0OWFvdyJ9.whTLmuoah_lfoQhC_abI5w"
zoom={[this.state.zoom]}
pitch={30}
center={this.state.coords}
containerStyle={{
height: "500px",
width: "auto"
}}>
</ReactMapboxGl>)
: (
<div className="scene-hero-img">
<div className="scene-hero-img-container">
<img src={this.props.heroURL} />
</div>
<div className="scene-hero-img-credit">
<h4>Photo by <a href={this.props.heroPhotogURL}>{this.props.heroPhotog}</a> / <a href="http://unsplash.com">Unsplash</a></h4>
</div>
</div>
)
}
</div>
<div className="article-content col-md-4 col-md-offset-2">
<div className="article-titles">
<h3 className="view-story-heading story">{this.props.storyTitle}</h3>
<h1 className="view-story-heading">{this.props.currScene.title}</h1>
<h4 className="view-story-heading">by {this.props.user ? this.props.user.display_name || this.props.user.username : 'anonymous'}</h4>
</div>
<div
className="article-text"
dangerouslySetInnerHTML={this.setInnerHTML(this.props.html)}
/>
</div>
<div className="article-modules col-md-5 col-md-offset-1">
<ViewActors />
</div>
</div>
);
}
}
/* ----- CONTAINER ----- */
import { connect } from 'react-redux';
const mapStateToProps = store => ({
html: store.displayState.currScene.paragraphsHTML[0],
actors: store.displayState.currScene.actors,
storyTitle: store.displayState.title,
currScene: store.displayState.currScene,
maps: store.displayState.currScene.maps,
user: store.displayState.user,
heroURL: store.displayState.currScene.heroURL,
heroPhotog: store.displayState.currScene.heroPhotog,
heroPhotogURL: store.displayState.currScene.heroPhotogURL
});
export default connect(mapStateToProps)(ReactTimeout(Scene));
|
JavaScript
| 0.000001 |
@@ -319,10 +319,16 @@
ds:
-''
+%5B37, 55%5D
,%0A
|
9041c0ae646a4f537468ea88778c06793e28e5ee
|
Add logic for adjusting width when resizing height.
|
assets/src/edit-story/utils/getAdjustedElementDimensions.js
|
assets/src/edit-story/utils/getAdjustedElementDimensions.js
|
/**
* Updates Text element's width and height if it's being resized from edges or there are font changes.
*/
function getAdjustedElementDimensions( { element, content, width, height, fixedMeasure } ) {
if ( ! element || ! content.length ) {
return { width, height };
}
if ( 'width' === fixedMeasure ) {
if ( element.scrollHeight > height ) {
height = element.scrollHeight;
}
} else if ( 'height' === fixedMeasure ) {
// @todo This is not working fully as expected, it might also need adjusting width if the scrollHeight is over
if ( element.scrollWidth > width ) {
width = element.scrollWidth;
}
} else if ( element.scrollHeight > height || element.scrollWidth > width ) {
// If there's no fixed side, let's update both.
height = element.scrollHeight;
width = element.scrollWidth;
}
return { width, height };
}
export default getAdjustedElementDimensions;
|
JavaScript
| 0 |
@@ -1,8 +1,85 @@
+/**%0A * Internal dependencies%0A */%0Aimport %7B PAGE_WIDTH %7D from '../constants';%0A%0A
/**%0A * U
@@ -183,515 +183,1525 @@
.%0A *
-/%0Afunction getAdjustedElementDimensions( %7B element, content, width, height, fixedMeasure %7D ) %7B%0A%09if ( ! element %7C%7C ! content.length ) %7B%0A%09%09return %7B width, height %7D;%0A%09%7D%0A%09if ( 'width' === fixedMeasure ) %7B%0A%09%09if ( element.scrollHeight %3E height ) %7B%0A%09%09%09height = element.scrollHeight;%0A%09%09%7D%0A%09%7D else if ( 'height' === fixedMeasure ) %7B%0A%09%09// @todo This is not working fully as expected, it might also need adjusting width if the scrollHeight is over%0A%09%09if ( element.scrollWidth %3E width ) %7B%0A%09%09%09width = element.scroll
+%0A * @param %7BObject%7D element Element to measure.%0A * @param %7Bstring%7D content Text content.%0A * @param %7Bnumber%7D width Current element width.%0A * @param %7Bnumber%7D height Current element height.%0A * @param %7Bboolean%7D fixedMeasure If one side is locked for changing automatically, can be 'width' or 'height'.%0A * @return %7BObject%7D Updated width and height.%0A */%0Afunction getAdjustedElementDimensions( %7B element, content, width, height, fixedMeasure %7D ) %7B%0A%09if ( ! element %7C%7C ! content.length ) %7B%0A%09%09return %7B width, height %7D;%0A%09%7D%0A%09if ( 'width' === fixedMeasure ) %7B%0A%09%09if ( element.scrollHeight %3E height ) %7B%0A%09%09%09height = element.scrollHeight;%0A%09%09%7D%0A%09%7D else if ( 'height' === fixedMeasure ) %7B%0A%09%09if ( element.scrollWidth %3E width ) %7B%0A%09%09%09width = element.scrollWidth;%0A%09%09%7D%0A%09%09// Width isn't adjusted automatically, so we'll have to do it based on height.%0A%09%09const calcBuffer = 2;%0A%09%09if ( element.scrollHeight - height %3E calcBuffer ) %7B%0A%09%09%09let minWidth = width;%0A%09%09%09// Don't allow automatic resizing more than the page's width.%0A%09%09%09let maxWidth = PAGE_WIDTH;%0A%09%09%09while ( maxWidth - minWidth %3E 1 ) %7B%0A%09%09%09%09const mid = Math.floor( ( minWidth + maxWidth ) / 2 );%0A%09%09%09%09element.style.width = mid + 'px';%0A%09%09%09%09if ( element.scrollHeight - height %3E 2 ) %7B%0A%09%09%09%09%09maxWidth = mid;%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09minWidth = mid;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09// If it still doesn't fit, restore the original width.%0A%09%09%09if ( element.scrollHeight - height %3E calcBuffer ) %7B%0A%09%09%09%09element.style.width = width + 'px';%0A%09%09%09%7D else %7B%0A%09%09%09%09// If it fits, return the updated width.%0A%09%09%09%09width = min
Width;%0A
+%09%09%09%7D%0A
%09%09%7D%0A
|
0ec851372caa9309df9651126d71361d8163f889
|
Convert `toggleClipboardProps()` to ember-concurrency task
|
app/components/crate-toml-copy.js
|
app/components/crate-toml-copy.js
|
import { action } from '@ember/object';
import { later } from '@ember/runloop';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
export default class CrateTomlCopy extends Component {
@tracked showSuccess = false;
@tracked showNotification = false;
toggleClipboardProps(isSuccess) {
this.showSuccess = isSuccess;
this.showNotification = true;
later(
this,
() => {
this.showNotification = false;
},
2000,
);
}
@action
copySuccess() {
this.toggleClipboardProps(true);
}
@action
copyError() {
this.toggleClipboardProps(false);
}
}
|
JavaScript
| 0.00279 |
@@ -37,48 +37,8 @@
t';%0A
-import %7B later %7D from '@ember/runloop';%0A
impo
@@ -123,16 +123,71 @@
king';%0A%0A
+import %7B rawTimeout, task %7D from 'ember-concurrency';%0A%0A
export d
@@ -305,36 +305,33 @@
lse;%0A%0A
-toggleClipboardProps
+@(task(function*
(isSucce
@@ -408,54 +408,40 @@
ue;%0A
-%0A
-later(%0A this,%0A () =%3E %7B%0A
+yield rawTimeout(2000);%0A
-
this
@@ -473,37 +473,49 @@
;%0A
- %7D,%0A 2000,%0A );%0A %7D
+%7D).restartable())%0A showNotificationTask;
%0A%0A
@@ -549,36 +549,44 @@
this.
-toggleClipboardProps
+showNotificationTask.perform
(true);%0A
@@ -629,28 +629,36 @@
his.
-toggleClipboardProps
+showNotificationTask.perform
(fal
|
a3e802bbe7fe5d2a30bc38f39e9348110468799a
|
Add global definition for moment in datetime-picker component
|
app/components/datetime-picker.js
|
app/components/datetime-picker.js
|
import Ember from 'ember';
// DateTime picker component for Semantic UI (Semantic UI hasn't its own DateTime picker component yet).
export default Ember.Component.extend({
// String with input css classes.
classes: undefined,
// Flag to make control readonly.
readonly: false,
// Flag to make control required.
required: false,
// Flag to show time in control and time picker inside date picker.
hasTimePicker: false,
// Input value.
value: undefined,
_initializeComponent: function() {
var hasTimePicker = this.get('hasTimePicker');
var dateTimeFormat = hasTimePicker ? 'DD.MM.YYYY HH:mm:ss' : 'DD.MM.YYYY';
var val = this.get('value');
var startDate = new Date();
if (val !== undefined && moment(val).isValid()) {
startDate = new moment(val);
this.set('value', moment(val).format(dateTimeFormat));
}
this.$('input').daterangepicker({
startDate: startDate,
singleDatePicker: true,
timePicker: hasTimePicker,
timePickerIncrement: 1,
timePicker12Hour: false,
timePickerSeconds: true,
format: dateTimeFormat
});
}.on('didInsertElement')
});
|
JavaScript
| 0 |
@@ -1,8 +1,33 @@
+/* global moment:true */%0A
import E
@@ -799,20 +799,16 @@
rtDate =
- new
moment(
|
f0bbbce99266aaa8140c9f0e7c0715df6dab2144
|
attach locale to props in Browser to fix propagate issue of react-intl
|
app/containers/Browser/Browser.js
|
app/containers/Browser/Browser.js
|
import './browser'
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import Header from '../../components/Header'
import Spinner from '../../components/Spinner'
import Notification from '../../components/Notification'
import BrowserStack from '../BrowserStack'
import BrowserTabs from '../BrowserTabs'
import CorpusStatusWatcher from './CorpusStatusWatcher'
const Browser = ({ corpus, status }) => {
if (!corpus) {
// Corpus not yet selected
return <Spinner />
}
return (
<CorpusStatusWatcher className="window browser-window">
<Header corpus={ corpus } status={ status } />
<BrowserStack />
<BrowserTabs />
<Notification />
</CorpusStatusWatcher>
)
}
Browser.propTypes = {
corpus: PropTypes.object,
status: PropTypes.object
}
const mapStateToProps = ({ corpora }) => ({
corpus: corpora.selected,
status: corpora.status
})
export default connect(mapStateToProps)(Browser)
|
JavaScript
| 0 |
@@ -803,16 +803,56 @@
s.object
+,%0A locale: PropTypes.string.isRequired,
%0A%7D%0A%0Acons
@@ -881,16 +881,34 @@
corpora
+, intl: %7B locale %7D
%7D) =%3E (
@@ -961,16 +961,70 @@
a.status
+,%0A // hack needed to propagate locale change%0A locale
%0A%7D)%0A%0Aexp
|
3bc26a68f46782ec5d004cd9a74ea2795928e7e8
|
add hook to deploy
|
authentication/.serverless_plugins/deployment-info/index.js
|
authentication/.serverless_plugins/deployment-info/index.js
|
/**
* Created by eetut on 23/11/2016.
*/
'use strict';
const _ = require('lodash');
const chalk = require('chalk');
class Deploy {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.provider = this.serverless.providers.aws;
this.commands = {
authentication: {
commands: {
info: {
usage: 'Get info',
lifecycleEvents: [
'info',
],
},
},
},
};
this.hooks = {
'authentication:info:info': this.info.bind(this),
'after:info:info': this.info.bind(this),
};
}
info() {
const providers =
_(this.serverless.service.provider.environment)
.keys()
.filter(key => /PROVIDER_.+_ID/.test(key))
.map(provider => provider
.replace(/PROVIDER_/, '')
.replace(/_ID/, '')
.replace(/_/, '-')
.toLowerCase())
.value();
//
const stackName = this.provider.naming.getStackName(this.options.stage);
return this.provider
.request('CloudFormation',
'describeStacks',
{ StackName: stackName },
this.options.stage,
this.options.region)
.then((result) => {
const stack = _.first(result.Stacks);
let authorizerFunction =
_(stack.Outputs).find({ OutputKey: 'AuthorizeLambdaFunctionQualifiedArn' }).OutputValue;
if (this.serverless.service.provider.versionFunctions) {
authorizerFunction = authorizerFunction.substr(0, authorizerFunction.lastIndexOf(':'));
}
const serviceEndpoint =
_.find(stack.Outputs, { OutputKey: 'ServiceEndpoint' }).OutputValue;
return { authorizerFunction, serviceEndpoint };
})
.then((resources) => {
let message = '';
message += `${chalk.yellow.underline('\nAuthentication Service Information')}\n`;
message += `${chalk.yellow('Authorizer function:')} ${resources.authorizerFunction}\n`;
message += `${chalk.yellow('Callback endpoints:\n')}`;
message +=
providers.map((provider) => {
return `${resources.serviceEndpoint}/callback/${provider}`;
}).join('\n');
this.serverless.cli.consoleLog(message);
});
}
}
module.exports = Deploy;
|
JavaScript
| 0 |
@@ -620,24 +620,75 @@
bind(this),%0A
+ 'after:deploy:deploy': this.info.bind(this),%0A
%7D;%0A %7D%0A%0A
|
a34dfef91eec1291e3158b2c512418661a9f9192
|
verify and tested create account functionality
|
app/controllers/UserManagement.js
|
app/controllers/UserManagement.js
|
var args = arguments[0] || {};
// function to call after login or user created
var callback = args.callback;
var parseService = Alloy.Globals.parseService;
/**
*
*/
function handleLoginClick(_event) {
Ti.API.debug('clicked: ' + _event.source.id);
return parseService.loginUser($.login_email.value, $.login_password.value).then(function(_result) {
console.log("logged in user successfully: " + JSON.stringify(_result, null, 2));
// Do stuff after successful login.
Alloy.Globals.loggedIn = true;
Alloy.Globals.CURRENT_USER = _result;
callback && callback(_result);
}, function(_error) {
var errorMsg = JSON.stringify(_error);
alert(_error.message);
Ti.API.error('Error: ' + errorMsg);
callback && callback({
error : _error
});
});
}
/**
*
*/
function handleShowAcctClick(_event) {
Ti.API.debug('clicked: ' + _event.source.id);
var animation = require('alloy/animation');
// when move the create account screen into view
var moveToTop = Ti.UI.createAnimation({
top : '0dp',
duration : 1
});
$.createAcctView.animate(moveToTop, function() {
// now cross fade
animation.crossFade($.loginAcctView, $.createAcctView, 500, function() {
// when done animating, move the view off screen
var moveToBottom = Ti.UI.createAnimation({
top : '500dp',
duration : 1
});
$.loginAcctView.animate(moveToBottom);
});
});
}
/**
*
*/
function handleCreateAccountClick() {
if ($.acct_password.value !== $.acct_password_confirmation.value) {
alert("Please re-enter information");
return;
}
var params = {
first_name : $.acct_fname.value,
last_name : $.acct_lname.value,
username : $.acct_email.value,
email : $.acct_email.value,
user_type : "student",
password : $.acct_password.value,
password_confirmation : $.acct_password_confirmation.value,
};
var user = Alloy.createModel('User');
user.createAccount(params).then(function(_model) {
// Do stuff after successful creation of user.
Alloy.Globals.loggedIn = true;
Alloy.Globals.CURRENT_USER = _model;
callback && callback(_model);
}, function(_error) {
var errorMsg = JSON.stringify(_error);
alert(_error.message);
Ti.API.error('Error: ' + errorMsg);
});
};
/**
*
* @param {Object} _event
*/
function handleShowLoginClick(_event) {
Ti.API.debug('clicked: ' + _event.source.id);
var animation = require('alloy/animation');
// when move the login screen into view
var moveToTop = Ti.UI.createAnimation({
top : '0dp',
duration : 1
});
$.loginAcctView.animate(moveToTop, function() {
// now cross fade
animation.crossFade($.createAcctView, $.loginAcctView, 500, function() {
// when done animating, move the view off screen
var moveToBottom = Ti.UI.createAnimation({
top : '500dp',
duration : 1
});
$.createAcctView.animate(moveToBottom);
});
});
}
|
JavaScript
| 0 |
@@ -2083,72 +2083,36 @@
%7D;%0A%0A
+%0A
-var user = Alloy.createModel('User');%0A user.createAccount
+parseService.createUser
(par
@@ -2331,32 +2331,40 @@
function(_error
+Response
) %7B%0A var
@@ -2363,119 +2363,112 @@
-var errorMsg = JSON.stringify(_error);%0A alert(_error.message);%0A Ti.API.error('Error: ' + errorMsg
+alert(_errorResponse.error.error);%0A Ti.API.error('Error: ' + JSON.stringify(_errorResponse.error)
);%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.