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
|
---|---|---|---|---|---|---|---|
cceb224f6a9a39451b90fcff182049a24f3ad2b0
|
fix build script
|
gruntfile.js
|
gruntfile.js
|
module.exports = function(grunt) {
'use strict';
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
sampleDir: "samples",
libDir: "src",
destDir: "dest",
testDir: "test",
docDir: "doc",
watch: {
sample: {
files: ['<%= sampleDir %>/*.jsx', '<%= libDir %>/*.jsx'],
tasks: ['jsx:build']
},
test: {
files: ['<%= testDir %>/*.jsx', '<%= libDir %>'],
tasks: ['jsx:test']
}
},
jsx: {
sample: {
src: ['<%= sampleDir %>/*.jsx'],
add_search_path: ['<%= libDir %>'],
dest: '<%= sampleDir %>/',
executable: 'node'
},
commonjs: {
src: ['src/danish-stemmer.jsx', 'src/dutch-stemmer.jsx', 'src/english-stemmer.jsx', 'src/finnish-stemmer.jsx', 'src/french-stemmer.jsx',
'src/german-stemmer.jsx', 'src/hungarian-stemmer.jsx', 'src/italian-stemmer.jsx', 'src/norwegian-stemmer.jsx', 'src/porter-stemmer.jsx',
'src/portuguese-stemmer.jsx', 'src/romanian-stemmer.jsx', 'src/russian-stemmer.jsx', 'src/spanish-stemmer.jsx', 'src/swedish-stemmer.jsx',
'src/turkish-stemmer.jsx'],
output_rule: {
regexp: /lib\/(.+)\.jsx/,
replace: 'dest\/$1.common.js'
},
add_search_path: ['<%= libDir %>'],
minify: false,
release: false,
linker: 'commonjs-lib'
},
amd: {
src: ['src/danish-stemmer.jsx', 'src/dutch-stemmer.jsx', 'src/english-stemmer.jsx', 'src/finnish-stemmer.jsx', 'src/french-stemmer.jsx',
'src/german-stemmer.jsx', 'src/hungarian-stemmer.jsx', 'src/italian-stemmer.jsx', 'src/norwegian-stemmer.jsx', 'src/porter-stemmer.jsx',
'src/portuguese-stemmer.jsx', 'src/romanian-stemmer.jsx', 'src/russian-stemmer.jsx', 'src/spanish-stemmer.jsx', 'src/swedish-stemmer.jsx',
'src/turkish-stemmer.jsx'],
output_rule: {
regexp: /lib\/(.+)\.jsx/,
replace: 'dest\/$1.amd.js'
},
add_search_path: ['<%= libDir %>'],
minify: false,
release: false,
linker: 'amd-lib'
},
closure: {
src: ['src/danish-stemmer.jsx', 'src/dutch-stemmer.jsx', 'src/english-stemmer.jsx', 'src/finnish-stemmer.jsx', 'src/french-stemmer.jsx',
'src/german-stemmer.jsx', 'src/hungarian-stemmer.jsx', 'src/italian-stemmer.jsx', 'src/norwegian-stemmer.jsx', 'src/porter-stemmer.jsx',
'src/portuguese-stemmer.jsx', 'src/romanian-stemmer.jsx', 'src/russian-stemmer.jsx', 'src/spanish-stemmer.jsx', 'src/swedish-stemmer.jsx',
'src/turkish-stemmer.jsx'],
output_rule: {
regexp: /lib\/(.+)\.jsx/,
replace: 'dest\/$1.closure.js'
},
add_search_path: ['<%= libDir %>'],
minify: false,
release: false,
linker: 'closure-lib'
},
global: {
src: ['src/danish-stemmer.jsx', 'src/dutch-stemmer.jsx', 'src/english-stemmer.jsx', 'src/finnish-stemmer.jsx', 'src/french-stemmer.jsx',
'src/german-stemmer.jsx', 'src/hungarian-stemmer.jsx', 'src/italian-stemmer.jsx', 'src/norwegian-stemmer.jsx', 'src/porter-stemmer.jsx',
'src/portuguese-stemmer.jsx', 'src/romanian-stemmer.jsx', 'src/russian-stemmer.jsx', 'src/spanish-stemmer.jsx', 'src/swedish-stemmer.jsx',
'src/turkish-stemmer.jsx'],
output_rule: {
regexp: /lib\/(.+)\.jsx/,
replace: 'dest\/$1.global.js'
},
add_search_path: ['<%= libDir %>'],
minify: false,
release: false,
linker: 'export-global'
},
standard: {
src: ['src/danish-stemmer.jsx', 'src/dutch-stemmer.jsx', 'src/english-stemmer.jsx', 'src/finnish-stemmer.jsx', 'src/french-stemmer.jsx',
'src/german-stemmer.jsx', 'src/hungarian-stemmer.jsx', 'src/italian-stemmer.jsx', 'src/norwegian-stemmer.jsx', 'src/porter-stemmer.jsx',
'src/portuguese-stemmer.jsx', 'src/romanian-stemmer.jsx', 'src/russian-stemmer.jsx', 'src/spanish-stemmer.jsx', 'src/swedish-stemmer.jsx',
'src/turkish-stemmer.jsx'],
output_rule: {
regexp: /lib\/(.+)\.jsx/,
replace: 'dest\/$1.js'
},
add_search_path: ['<%= libDir %>'],
release: false,
minify: false
},
test: {
src: ['<%= testDir %>/*.jsx'],
add_search_path: ['<%= libDir %>'],
test: false
},
doc: {
src: ['<%= libDir %>/*.jsx'],
add_search_path: ['<%= libDir %>'],
dest: '<%= docDir %>',
mode: 'doc'
}
}
});
for (var key in pkg.devDependencies) {
if (/grunt-/.test(key)) {
grunt.loadNpmTasks(key);
}
}
grunt.registerTask('default', ['jsx:test']);
grunt.registerTask('build', [
'jsx:commonjs',
'jsx:amd',
'jsx:closure',
'jsx:standard',
'jsx:global'
]);
grunt.registerTask('sample', ['jsx:sample']);
grunt.registerTask('doc', ['jsx:doc']);
};
// vim: set expandtab tabstop=2 shiftwidth=2:
|
JavaScript
| 0.000001 |
@@ -1200,35 +1200,35 @@
regexp: /
-lib
+src
%5C/(.+)%5C.jsx/,%0A
@@ -1950,35 +1950,35 @@
regexp: /
-lib
+src
%5C/(.+)%5C.jsx/,%0A
@@ -2696,35 +2696,35 @@
regexp: /
-lib
+src
%5C/(.+)%5C.jsx/,%0A
@@ -2851,36 +2851,35 @@
release:
-fals
+tru
e,%0A linke
@@ -3448,35 +3448,35 @@
regexp: /
-lib
+src
%5C/(.+)%5C.jsx/,%0A
@@ -3578,36 +3578,35 @@
minify:
-fals
+tru
e,%0A relea
@@ -3601,36 +3601,35 @@
release:
-fals
+tru
e,%0A linke
@@ -4210,19 +4210,19 @@
egexp: /
-lib
+src
%5C/(.+)%5C.
|
c61a7109738180c2e6f6deaf69bb0ab3905221be
|
clean up.
|
gruntfile.js
|
gruntfile.js
|
//'use strict';
var path = require('path').resolve('.');
module.exports = function (grunt) {
grunt.initConfig({
defaulTheme:'theme1'
,pkg: grunt.file.readJSON('package.json'),
less: {
dev: {
options: {
sourceMap: true,
dumpLineNumbers: 'comments',
relativeUrls: true
}
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
}
},
express: {
all: {
options: {
bases: [ path + '\\dist\\themes\\<%=defaulTheme%>'],
port: 8080,
hostname: "0.0.0.0",
livereload: true
}
}
},
// grunt-watch will monitor the projects files
// https://github.com/gruntjs/grunt-contrib-watch
watch: {
all: {
files: 'src/<%=defaulTheme%>/*.less',
tasks: ['buildthemes:<%=defaulTheme%>','express', 'open', 'watch'],
options: {
spawn: false,
}
}
},
// grunt-open will open your browser at the project's URL
// https://www.npmjs.org/package/grunt-open
open: {
all: {
path: 'http://localhost:8080/index.html'
}
}
, buildthemes: { theme1:{}, theme2:{},theme3:{}}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-express');
grunt.loadNpmTasks('grunt-open');
//grunt.registerTask('default', ['less','cssmin']);
grunt.registerTask('compile', ['less:dev']);
grunt.registerTask('dev', ['less:dev']);
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['buildthemes','express', 'open', 'watch']);
//grunt.registerTask('default', ['buildthemes']);
grunt.registerTask('build', function(theme) {
grunt.log.writeln( ['building... (' + theme + ')' ] );
var bs= 'bootstrap';
var th = 'theme';
var dist = 'dist/themes/' + theme + '/css/';
var src = 'src/' + theme + '/';
var css = ".css";
var less = ".less";
var minfile = bs + '.min' + css;
var files ={};
files[dist + bs + css] = src + bs + less;
files[dist + th + css] = src + th + less;
grunt.config('less.dev.files', files);
var cssminfiles={};
cssminfiles[dist + minfile] = [dist + bs + css, dist + th + css];
grunt.config('cssmin.target.files', cssminfiles);
var copyfiles = [
{
expand: true
, src: ['**']
, dest: 'dist/themes/'+ theme +'/fonts/'
, cwd: 'node_modules/bootstrap/dist/fonts/'
, filter: 'isFile'
}
,{
expand: true
, src: ['**']
, dest: 'dist/themes/'+ theme +'/'
, cwd: 'src/templates/'
, filter: 'isFile'
}
,{
expand: true
, src: ['bootstrap*.min.js']
, dest: 'dist/themes/'+ theme +'/js/'
, cwd: 'node_modules/bootstrap/dist/js/'
, filter: 'isFile'
}
];
grunt.config('copy.main.files',copyfiles);
grunt.task.run(['less:dev','cssmin','copy']);
});
grunt.registerMultiTask('buildthemes', function() {
grunt.task.run('build:' + this.target);
});
};
|
JavaScript
| 0 |
@@ -598,22 +598,8 @@
%7D,
-%0D%0A %0D%0A %0D%0A
@@ -928,143 +928,8 @@
%0D%0A
- %0D%0A %0D%0A // grunt-watch will monitor the projects files%0D%0A // https://github.com/gruntjs/grunt-contrib-watch%0D%0A
@@ -1257,150 +1257,8 @@
%7D,%0D%0A
- %0D%0A %0D%0A%0D%0A // grunt-open will open your browser at the project's URL%0D%0A // https://www.npmjs.org/package/grunt-open%0D%0A
@@ -1374,32 +1374,16 @@
%7D%0D%0A
- %0D%0A %0D%0A
@@ -1436,58 +1436,8 @@
%7D%7D%0D%0A
- %0D%0A %0D%0A %0D%0A %0D%0A %0D%0A
@@ -1447,18 +1447,16 @@
%0D%0A %0D%0A
-%0D%0A
grun
@@ -2763,36 +2763,16 @@
iles);%0D%0A
- %0D%0A %0D%0A
%0D%0A
@@ -3595,36 +3595,16 @@
%5D;%0D%0A
- %0D%0A %0D%0A
@@ -3651,28 +3651,8 @@
);%0D%0A
- %0D%0A %0D%0A
@@ -3698,26 +3698,24 @@
,'copy'%5D);%0D%0A
-%0D%0A
%7D); %0D
|
b156d0fa13f42f87fa4986303e63575b40921519
|
Kill existing DynamoDBLocal before starting
|
gruntfile.js
|
gruntfile.js
|
'use strict';
var DynamoDbLocal = require('dynamodb-local');
var DYNAMO_DB_PORT = 8000;
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
app: {
src: ['gruntfile.js', 'index.js', 'lib/**/*.js'],
options: {
node: true,
jshintrc: '.jshintrc'
}
},
test: {
src: ['test/**/*.js' ],
options: {
node: true,
jshintrc: 'test/.jshintrc'
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js']
},
testCoverage: {
options: {
reporter: 'spec',
require: 'test/coverage/blanket'
},
src: ['test/**/*.js']
},
coverage: {
options: {
reporter: 'html-cov',
// use the quiet flag to suppress the mocha console output
quiet: true,
// specify a destination file to capture the mocha
// output (the quiet option does not suppress this)
captureFile: 'coverage.html'
},
src: ['test/**/*.js']
},
'travis-cov': {
options: {
reporter: 'travis-cov'
},
src: ['test/**/*.js']
}
}
});
// Load libs
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('dynamo:start', function() {
var done = this.async();
DynamoDbLocal
.launch(DYNAMO_DB_PORT)
.then(function() { done(); })
.catch(function(e) { done(e); });
});
grunt.registerTask('dynamo:stop', function() {
DynamoDbLocal.stop(DYNAMO_DB_PORT);
});
// Register the default tasks
grunt.registerTask('default', ['jshint', 'dynamo:start', 'mochaTest']);
grunt.registerTask('test', ['jshint', 'dynamo:start', 'mochaTest:test']);
grunt.registerTask('coverage', ['jshint', 'dynamo:start', 'mochaTest:testCoverage', 'mochaTest:coverage', 'mochaTest:travis-cov']);
};
|
JavaScript
| 0 |
@@ -1475,214 +1475,474 @@
var
-done = this.async();%0A
+getPID = 'ps aux %7C grep %22
DynamoD
-b
+B
Local
-%0A .launch(DYNAMO_DB_PORT)%0A .then(function() %7B done(); %7D)%0A .catch(functi
+.jar -port ' +%0A DYNAMO_DB_PORT +%0A '%22 %7C grep -v grep %7C awk %5C'%7Bprint $2%7D%5C'';%0A var done = this.async();%0A require('child_process').exec(getPID, function (err, pid) %7B%0A if(err) %7B%0A return d
on
+e
(e
-) %7B done(e); %7D);%0A %7D);%0A%0A grunt.registerTask('dynamo:stop', function() %7B
+rr);%0A %7D%0A if(pid) %7B%0A console.log('Killing DynamoDBLocal process');%0A process.kill(pid);%0A %7D else %7B%0A console.log('No DynamoDBLocal process running');%0A %7D%0A
%0A
@@ -1961,13 +1961,22 @@
ocal
-.stop
+%0A .launch
(DYN
@@ -1987,16 +1987,99 @@
DB_PORT)
+%0A .then(function() %7B done(); %7D)%0A .catch(function(e) %7B done(e); %7D);%0A %7D)
;%0A %7D);%0A
@@ -2400,8 +2400,9 @@
'%5D);%0A%0A%7D;
+%0A
|
207ffec0b70c6698ce9c56c01ea32d3d760baa5e
|
Optimize browser-require
|
src/core/helpers/loader.js
|
src/core/helpers/loader.js
|
function require(path, parent){
var m, realpath;
if(parent)
realpath = require.mods[parent].aliases[path];
else
realpath = path;
if(!realpath)
realpath = require.virtual( path );
if(!(m = require.mods[realpath]))
{
console.error('Module not found: ', path);
return null
}
if(!m.init)
{
m.factory.call(this, require.local(realpath), m.module, m.module.exports);
m.init = true;
}
return m.module.exports;
}
require.mods = {}
require.local = function( path ){
return function( id ) { return require( id, path ); }
}
require.register = function(path, mod, aliases){
require.mods[path] = {
factory: mod,
aliases: aliases,
module: {exports:{}}
};
}
require.virtual = function(path) {
for(var virtual in require.virtual.conf)
if(path.indexOf(virtual) == 0)
return require.virtual.conf[virtual] + path.match(/\/(.+)/)[0];
return null;
}
require.virtual.conf = ~VIRTUAL;
|
JavaScript
| 0.000001 |
@@ -58,16 +58,20 @@
parent)%0A
+ %7B%0A
real
@@ -119,35 +119,8 @@
;%0A
-else%0A realpath = path;%0A%0A
if
@@ -130,20 +130,16 @@
ealpath)
-%0A
realpat
@@ -169,16 +169,46 @@
th );%0A
+%7D%0A else%0A realpath = path;%0A
%0A if(!(
@@ -238,21 +238,24 @@
th%5D))%0A
-%7B%0A
+ return
console
@@ -294,30 +294,8 @@
h);%0A
- return null%0A %7D%0A
%0A i
|
bc83217a2f6c09a23ca061525e4a2995d9c3aa80
|
Use 'return' to break out of function
|
core/net.js
|
core/net.js
|
var http = require("http");
var https = require("https");
var Promise = require("promise");
module.exports = {
download: function(url) {
url = this.completeUrl(url);
return new Promise(function(resolve, reject) {
var client = url.substring(0, 8) == "https://" ? https : http;
client.get(url, function(res) {
var chunks = [];
res.on('data', function(chunk) {
chunks.push(chunk);
});
res.on('end', function() {
if (res.statusCode > 300 && res.statusCode <= 308) {
if (res.headers.location) {
resolve(module.exports.download(res.headers.location));
}
} else {
resolve({
data: Buffer.concat(chunks),
headers: res.headers,
});
}
reject("unknown failure");
});
})
.on('error', function(err) {
reject(err.message);
});
});
},
completeUrl: function(url) {
if (!url.match('://')) {
url = 'http://' + url;
}
return url;
},
};
|
JavaScript
| 0.000921 |
@@ -581,32 +581,39 @@
%7B%0A
+return
resolve(module.e
@@ -697,16 +697,23 @@
+return
resolve(
|
be773d2fe77ac9004476beeb9f2f21b1dc7ee721
|
Update TODO list
|
src/directives/hotTable.js
|
src/directives/hotTable.js
|
(function() {
/**
* Main Angular Handsontable directive
*/
function hotTable(settingFactory, autoCompleteFactory, $rootScope) {
return {
restrict: 'EA',
scope: {},
// for ng-repeat
priority: -400,
controller: ['$scope', function($scope) {
this.setColumnSetting = function(column) {
if (!$scope.htSettings) {
$scope.htSettings = {};
}
if (!$scope.htSettings.columns) {
$scope.htSettings.columns = [];
}
$scope.htSettings.columns.push(column);
settingFactory.updateHandsontableSettings($scope.hotInstance, $scope.htSettings);
};
this.removeColumnSetting = function(column) {
if ($scope.htSettings.columns.indexOf(column) > -1) {
$scope.htSettings.columns.splice($scope.htSettings.columns.indexOf(column), 1);
settingFactory.updateHandsontableSettings($scope.hotInstance, $scope.htSettings);
}
};
}],
compile: function(tElement, tAttrs) {
var _this = this,
bindingsKeys;
this.scope = settingFactory.trimScopeDefinitionAccordingToAttrs(settingFactory.getTableScopeDefinition(), tAttrs);
bindingsKeys = Object.keys(this.scope);
angular.forEach(bindingsKeys, function(key) {
var mode = _this.scope[key].charAt(0);
_this.$$isolateBindings[key] = {
attrName: _this.scope[key].length > 1 ? _this.scope[key].substr(1, _this.scope[key].length) : key,
collection: false,
mode: mode,
optional: false
};
});
return function(scope, element, attrs) {
if (!scope.htSettings) {
scope.htSettings = {};
}
settingFactory.mergeSettingsFromScope(scope.htSettings, scope);
settingFactory.mergeHooksFromScope(scope.htSettings, scope);
scope.htSettings.data = scope.datarows;
scope.htSettings.dataSchema = scope.dataschema;
scope.htSettings.hotId = attrs.hotId;
scope.htSettings.observeDOMVisibility = scope.observeDomVisibility;
if (scope.htSettings.columns) {
for (var i = 0, length = scope.htSettings.columns.length; i < length; i++) {
if (scope.htSettings.columns[i].type !== 'autocomplete') {
continue;
}
if (typeof scope.htSettings.columns[i].optionList === 'string') {
var optionList = {};
var match = scope.htSettings.columns[i].optionList.match(/^\s*(.+)\s+in\s+(.*)\s*$/);
if (match) {
optionList.property = match[1];
optionList.object = match[2];
} else {
optionList.object = optionList;
}
scope.htSettings.columns[i].optionList = optionList;
}
autoCompleteFactory.parseAutoComplete(scope.htSettings.columns[i], scope.datarows, true);
}
}
scope.hotInstance = settingFactory.initializeHandsontable(element, scope.htSettings);
var origAfterChange = scope.htSettings.afterChange;
scope.htSettings.afterChange = function() {
if (origAfterChange) {
origAfterChange.apply(this, arguments);
}
if (!$rootScope.$$phase) {
scope.$apply();
}
};
// TODO: Add watch properties descriptor
angular.forEach(bindingsKeys, function(key) {
scope.$watch(key, function(newValue) {
if (newValue === void 0) {
return;
}
if (key === 'datarows') {
settingFactory.renderHandsontable(scope.hotInstance);
} else {
scope.htSettings[key] = newValue;
settingFactory.updateHandsontableSettings(scope.hotInstance, scope.htSettings);
}
}, ['datarows', 'columns', 'colWidths', 'rowHeaders'].indexOf(key) >= 0);
});
/**
* Check if data length has been changed
*/
scope.$watchCollection('datarows', function(newValue, oldValue) {
if (oldValue && oldValue.length === scope.htSettings.minSpareRows && newValue.length !== scope.htSettings.minSpareRows) {
scope.htSettings.data = scope.datarows;
settingFactory.updateHandsontableSettings(scope.hotInstance, scope.htSettings);
}
});
};
}
};
}
hotTable.$inject = ['settingFactory', 'autoCompleteFactory', '$rootScope'];
angular.module('ngHandsontable.directives').directive('hotTable', hotTable);
}());
|
JavaScript
| 0 |
@@ -3510,16 +3510,59 @@
scriptor
+ + needs perf test watch equality vs toJson
%0A
|
c7b00ee92b02ac777920fa65a83ebf9ab598058c
|
Add prettify function for tab constants
|
react-native/react/constants/tabs.js
|
react-native/react/constants/tabs.js
|
'use strict'
export const STARTUP_TAB = 'STARTUP_TAB'
export const FOLDER_TAB = 'FOLDER_TAB'
export const CHAT_TAB = 'CHAT_TAB'
export const PEOPLE_TAB = 'PEOPLE_TAB'
export const DEVICES_TAB = 'DEVICES_TAB'
export const MORE_TAB = 'MORE_TAB'
|
JavaScript
| 0 |
@@ -232,12 +232,279 @@
'MORE_TAB'%0A
+%0Aconst prettyNames = %7B%0A %5BSTARTUP_TAB%5D: null,%0A %5BFOLDER_TAB%5D: 'Folder',%0A %5BCHAT_TAB%5D: 'Chat',%0A %5BPEOPLE_TAB%5D: 'People',%0A %5BDEVICES_TAB%5D: 'Devices',%0A %5BMORE_TAB%5D: 'More'%0A%7D%0A%0Aexport function prettify (tabName) %7B%0A return prettyNames%5BtabName%5D %7C%7C 'You have found a bug'%0A%7D%0A
|
b40b34b8b3d6dde7b45de1ee22a0f3fc201bb27e
|
fix nav links
|
react-ui/src/components/Nav/index.js
|
react-ui/src/components/Nav/index.js
|
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import { isEmpty } from 'lodash';
import { setEmail } from 'app/actions';
import './Nav.scss';
class Nav extends Component {
componentWillMount() {
const token = localStorage.getItem('bap-token');
if (!isEmpty(token)) {
fetch('/api/authenticate', {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
token
})
})
.then(response => response.json())
.then(json => {
if (json.email) {
this.props.onSetEmail(json.email);
}
});
}
}
logout = event => {
event.preventDefault();
localStorage.setItem('bap-token', '');
this.props.onSetEmail('');
};
renderLogin() {
if (!this.props.email) {
return (
<Link className="Nav__right-link" to="/login">
Log in
</Link>
);
}
return (
<Link className="Nav__right-link" to="/" onClick={this.logout}>
Log out
</Link>
);
}
render() {
return (
<nav className="Nav">
<Link className="Nav__logo-section" to="/">
<img className="Nav__logo" src="/images/logo-only-blue-background.png" alt="" />
<div className="Nav__title">BEST</div>
<div className="Nav__title Nav__title--act">ACT</div>
<div className="Nav__title">PREP</div>
</Link>
<div className="Nav__space" />
<Link className="Nav__right-link" to="/course">
Start for free
</Link>
<Link className="Nav__right-link Nav__right-link--buy" to="/buy">
Get <strong>NO RISK, FULL</strong> access
</Link>
<Link className="Nav__right-link" to="/contact">
Contact
</Link>
{this.renderLogin()}
</nav>
);
}
}
const mapStateToProps = function(state) {
return {
email: state.app.email
};
};
const mapActionsToProps = {
onSetEmail: setEmail
};
export default connect(mapStateToProps, mapActionsToProps)(Nav);
|
JavaScript
| 0 |
@@ -1018,16 +1018,479 @@
%7D;%0A%0A
+ renderCourse() %7B%0A return (%0A %3CLink className=%22Nav__right-link%22 to=%22/course%22%3E%0A %7Bthis.props.email ? 'Course Home' : 'Start for Free'%7D%0A %3C/Link%3E%0A );%0A %7D%0A%0A renderBuy() %7B%0A if (this.props.email) %7B return null; %7D%0A%0A return (%0A %3CLink className=%22Nav__right-link Nav__right-link--buy%22 to=%22/buy%22%3E%0A Get %3Cstrong%3ENO RISK, FULL%3C/strong%3E access%0A %3C/Link%3E%0A );%0A %7D%0A%0A
rend
@@ -2360,55 +2360,29 @@
-%3CLink className=%22Nav__right-link%22 to=%22/c
+%7Bthis.renderC
ourse
-%22%3E
+()%7D
%0A
@@ -2398,218 +2398,26 @@
- Start for free%0A %3C/Link%3E%0A %3CLink className=%22Nav__right-link Nav__right-link--buy%22 to=%22/buy%22%3E%0A Get %3Cstrong%3ENO RISK, FULL%3C/strong%3E access%0A %3C/Link%3E
+%7Bthis.renderBuy()%7D
%0A
|
e6b084d5e0939cd4a1e43aff00239a5b4660b15a
|
Fix typo
|
src/events/eventManager.js
|
src/events/eventManager.js
|
import getEventID from './getEventID';
import addRootDomEventListeners from './addRootDomEventListeners';
import EventRegistry from './EventRegistry';
import listenersStorage from './listenersStorage';
import listenerSetup from './hooks/listenerSetup';
function eventListener(e) {
listenersStorage[getEventID(e.target)][e.type](e);
}
export default {
/**
* Set a event listeners on a node
*/
addListener(domNode, type, listener) {
const registry = EventRegistry[type];
if (registry) {
// is this activated, YET?
if (!registry.activated) {
if (registry.setup) {
registry.setup();
} else if (registry.bubbles) {
let handler = listenerSetup(type, addRootDomEventListeners);
document.addEventListener(type, handler, false);
}
registry.activated = true;
}
const id = getEventID(domNode),
listeners = listenersStorage[id] || (listenersStorage[id] = {});
if (!listeners[type]) {
if (registry.bubbles) {
++registry.listenersCounter;
} else {
let handler = listenerSetup(type, eventListener);
domNode.addEventListener(type, handler, false);
domNode._infernoListeners = domNode._infernoListeners || {};
domNode._internoListeners[type] = handler;
}
}
listeners[type] = listener;
}
},
/**
* Remove event listeners from a node
*/
removeListener(node, type) {
const id = getEventID(node, true);
if (id) {
const listeners = listenersStorage[id];
if (listeners && listeners[type]) {
listeners[type] = null;
const registry = EventRegistry[type];
if (registry) {
if (registry.bubbles) {
--registry.listenersCounter;
} else {
node.removeEventListener(type, node._infernoListeners[type]);
node._infernoListeners[type] = null;
}
}
}
}
}
};
|
JavaScript
| 0.999999 |
@@ -1568,17 +1568,17 @@
Node._in
-t
+f
ernoList
|
dfb2f67b5d775a7d45538f0c93ed8fa1c89cf97c
|
Change abbrivated stage variable to full word, more explicit
|
src/extensions/registry.js
|
src/extensions/registry.js
|
'use strict'
//let validator = require('mc-extension-validator')
let glob = require('glob')
const EXT_PATH = process.cwd() + '/node_modules/mc-ext-*'
let registry = {
_extensions: {},
_typesByFqids: {},
/**
* Resolve all `mc-ext-*` modules and register them
*
* @param {string} dir Path mission control extensions
*/
resolve: function resolve(dir) {
let modules = glob.sync(dir)
modules.forEach(module => {
this.register(require(module))
})
},
/**
* Reload all extensions
*/
reload: function reload() {
// Reset all of our internal registry pieces
this._extensions = {}
this._typesByFqids = {}
// Reload the modules
this.resolve(EXT_PATH)
},
/**
* [register provided module]
* @param {Object} module [Module instance]
*/
register: function register(module) {
if (typeof this._extensions[module.vendor] !== 'object') {
this._extensions[module.vendor] = {}
}
// TODO: validate extension index
this._extensions[module.vendor][module.id] = {
vendor: module.vendor,
id: module.id,
name: module.name,
description: module.description
}
this.registerStages(module)
// TODO: register log types
},
registerStages: function registerStages(module) {
if (Array.isArray(module.stages)) {
module.stages.forEach(st => {
// TODO: validate stage type
// Register the stage as vendor.extension_id.stages.example
let fqid = module.vendor + '.' + module.id + '.stages.' + st.id
this._typesByFqids[fqid] = st
})
}
},
/**
* Get an item/type from the extension via the FQID (full-qualified identifier)
*
* @param {string} name [dot syntax path]
* @return {object} [resolved extension path]
*/
get: function get(name) {
if (typeof this._typesByFqids[name] !== 'undefined') {
return this._typesByFqids[name]
} else {
throw new Error('Extension FQID "' + name + '" not found')
}
},
/**
* Get stage types
*
* @return {Array}
*/
getStageTypes: function getStageTypes() {
let stages = []
for (let fqid in this._typesByFqids) {
// Shallow clone so we don't mutate the stage object
let stage = Object.assign({}, this._typesByFqids[fqid])
stage.fqid = fqid
stages.push(stage)
}
return stages
}
}
// Initially load extensions
registry.resolve(EXT_PATH)
module.exports = registry
|
JavaScript
| 0.000002 |
@@ -1367,16 +1367,19 @@
rEach(st
+age
=%3E %7B%0A%0A
@@ -1551,16 +1551,19 @@
s.' + st
+age
.id%0A
@@ -1595,16 +1595,19 @@
id%5D = st
+age
%0A%0A
|
cc7c851de6400e26b077c8d81c07a40269726218
|
change config from 'simplePush' to fireboxes to be inline with cordova naming and added support for firefoxos only config
|
src/firefoxos/pushProxy.js
|
src/firefoxos/pushProxy.js
|
var cordova = require('cordova');
module.exports = {
register: function (onNotification, success, fail, config) {
var client = AeroGear.UnifiedPushClient(config.simplePush.variantID, config.simplePush.variantSecret, config.pushServerURL + '/rest/registry/device');
var req = navigator.push.register();
req.onsuccess = function (e) {
config.deviceToken = req.result;
var settings = {
success: success,
error: fail
};
settings.metadata = config;
client.registerWithPushServer(settings);
};
navigator.mozSetMessageHandler('push', function (message) {
onNotification(message);
});
}
};
require("cordova/exec/proxy").add("push", module.exports);
|
JavaScript
| 0 |
@@ -47,17 +47,16 @@
rts = %7B%0A
-%0A
regist
@@ -106,24 +106,73 @@
, config) %7B%0A
+ var pushConfig = config.firefoxos %7C%7C config;%0A
var clie
@@ -207,54 +207,40 @@
ent(
-c
+pushC
onfig.
-simplePush.variantID, config.simplePush
+variantID, pushConfig
.var
|
07fb0f0e2eba6f21a890bc7ea9945c3c65fcca20
|
enable console reporter for Protractor tests on CI
|
integration/protractor-web/protractor.conf.js
|
integration/protractor-web/protractor.conf.js
|
const { TestRunnerTagger } = require('@integration/testing-tools');
const { ArtifactArchiver } = require('@serenity-js/core');
const { ConsoleReporter } = require('@serenity-js/console-reporter');
const { Photographer, TakePhotosOfFailures } = require('@serenity-js/web');
const { SerenityBDDReporter } = require('@serenity-js/serenity-bdd');
const { Actors } = require('./src/Actors');
const port = process.env.PORT || 8080;
exports.config = {
baseUrl: `http://localhost:${port}`,
SELENIUM_PROMISE_MANAGER: false,
onPrepare: function () {
return require('protractor').browser.waitForAngularEnabled(false);
},
allScriptsTimeout: 120_000,
framework: 'custom',
frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
serenity: {
actors: new Actors(),
runner: 'mocha',
crew: [
new TestRunnerTagger('protractor'),
ArtifactArchiver.storingArtifactsAt(`${ process.cwd() }/target/site/serenity`),
// Photographer.whoWill(TakePhotosOfInteractions),
Photographer.whoWill(TakePhotosOfFailures),
new SerenityBDDReporter(),
// ConsoleReporter.withDefaultColourSupport(),
]
},
specs: [
'./node_modules/@integration/web-specs/spec/**/*.spec.ts',
],
mochaOpts: {
timeout: 60_000,
// ts-node is already loaded by nyc when protractor is executed via npm test
require: [
'ts-node/register',
],
reporter: 'spec',
},
chromeDriver: require(`chromedriver`).path,
directConnect: true,
capabilities: {
browserName: 'chrome',
acceptInsecureCerts: true,
loggingPrefs: {
browser: 'INFO',
},
'goog:chromeOptions': {
// As of version 75, ChromeDriver is W3C by default, which Protractor does not fully support.
w3c: false,
args: [
'--disable-web-security',
'--allow-file-access-from-files',
'--allow-file-access',
'--disable-infobars',
'--headless',
'--disable-gpu',
'--window-size=1024x768',
],
},
},
};
|
JavaScript
| 0 |
@@ -1162,22 +1162,51 @@
+%5D%0A
-//
+ .concat(process.env.CI &&
Console
@@ -1240,27 +1240,17 @@
upport()
-,%0A %5D
+)
%0A %7D,%0A
|
55345283ac5f5df23c1c8d0b316d21b101d85f8e
|
Add update contact
|
api/controllers/ContactController.js
|
api/controllers/ContactController.js
|
/**
* ContactController
*
* @description :: Server-side logic for managing contacts
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
login: function (req, res) {
if (typeof req.param('nickname') === 'undefined' || typeof req.param('password') === 'undefined') {
return res.json({errorMessage: "Les informations de connexion entrées en correspondent pas !"});
} else {
Contact.findOne({nickname: req.param('nickname')}).exec(function (user) {
if (err) return res.badRequest(err);
if (!user) return res.json({errorMessage: "Les informations de connexion entrées en correspondent pas !"});
bcrypt.compare(req.param('password'), user.password, function (err, res) {
if (err) return res.badRequest(err);
if (!res) return res.json({errorMessage: "Les informations de connexion entrées en correspondent pas !"});
return res.json(res);
});
});
}
},
getContacts: function (req, res) {
Contact.find().populate('phones').exec(function (err, contacts) {
if (err) return res.badRequest(err);
return res.json(contacts);
});
},
getContactByNickname: function (req, res) {
Contact.findOne({nickname: req.param('nickname')}).populate('phones').exec(function (err, contact) {
if (err) return res.badRequest(err);
return res.json(contact);
});
},
createContact: function (req, res) {
var phones = (typeof req.param('phones') !== 'undefined') ? JSON.parse(req.param('phones')) : '';
Contact.create(
req.allParams()
).exec(function (err, created) {
if (err) return res.badRequest(err);
Contact.find({id: created.id}).populate('phones').exec(function (e, r) {
if (phones !== '') {
if (Array.isArray(phones)) {
phones.forEach(function (phone) {
r[0].phones.add({
label: phone.label,
phone: phone.phone
});
r[0].save(function (err, result) {
if (err) return res.badRequest(err);
return res.json(created);
});
});
}
}
});
});
},
updateContact: function (req, res) {
// Todo: To be implement !
return res.json({info: "To be implement !"});
},
deleteContact: function (req, res) {
Contact.destroy({id: req.param('id')}).exec(function (err) {
if (err) return res.badRequest(err);
return res.json({deleted: req.param('id')});
});
},
getSMSByNickname: function (req, res) {
Contact.findOne({nickname: req.param('nickname')}).populateAll().exec(function (err, contact) {
if (err) return res.badRequest(err);
var sms = {
send: contact.smsSend,
receipt: contact.smsReceipt
}
return res.json(sms);
});
}
};
|
JavaScript
| 0 |
@@ -2277,81 +2277,181 @@
-// Todo: To be implement !%0A return res.json(%7Binfo: %22To be implement !%22
+Contact.update(%7Bnickname: req.param('nickname')%7D, req.allParams()).exec(function(contact) %7B%0A if(err) return res.badRequest(res);%0A return res.json(contact%5B0%5D);%0A
%7D);%0A
|
dea31e36b16307fa531f141746a3497206113543
|
Fix bug occurred because of dependeny injection
|
src/get-script-commands.js
|
src/get-script-commands.js
|
'use strict';
const getLernaPackages = require('./get-lerna-packages');
const getPackage = require('./get-package');
/**
* @returns {Object} returns an object of available scripts as key and their packages as array
**/
function getScriptCommands({ diGetLernaPackages = getLernaPackages, diGetPackage = getPackage }) {
const commands = {};
diGetLernaPackages(packagePath => {
const packageData = diGetPackage(packagePath);
if (!packageData.scripts) {
return;
}
Object.keys(packageData.scripts).forEach(scriptKey => {
if (!commands[scriptKey]) {
commands[scriptKey] = [];
}
commands[scriptKey].push(packagePath);
});
});
return commands;
}
module.exports = getScriptCommands;
|
JavaScript
| 0.000001 |
@@ -116,16 +116,81 @@
);%0A%0A/**%0A
+ * @param %7BObject%7Cundefined%7D di - dependency injection for tests%0A
* @retu
@@ -311,30 +311,93 @@
nds(
-%7B diGetLernaPackages =
+di) %7B%0A%09const commands = %7B%7D;%0A%0A%09const diGetLernaPackages = di ? di.diGetLernaPackages :
get
@@ -413,9 +413,16 @@
ages
-,
+;%0A%09const
diG
@@ -437,44 +437,41 @@
e =
-getPackage %7D) %7B%0A%09const commands = %7B%7D
+di ? di.diGetPackage : getPackage
;%0A%0A%09
|
b653dff1985de1ace05b52e3cc9c9749d38cb890
|
add support for provide release from options directly rather than through file.
|
tasks/raygun_deployment.js
|
tasks/raygun_deployment.js
|
/*
* grunt-raygun-deployment
* https://raygun.io
*
* Copyright (c) 2015 Raygun.io
* Licensed under the MIT license.
*/
'use strict';
var request = require('request');
module.exports = function (grunt) {
grunt.registerTask('raygun_deployment', 'Grunt plugin for generating Deployment information for Raygun.io', function () {
var finishedTask = this.async(), end, send, generate;
var options = this.options({
release: 'Release.yaml',
raygunApiUri: 'https://app.raygun.io',
useGit: true
});
if(!options.raygunApiKey && !process.env.RAYGUN_APIKEY){
grunt.fatal('Required option raygunApiKey is missing');
return;
}
if(!options.raygunAuthToken && !process.env.RAYGUN_AUTHTOKEN){
grunt.fatal('Required option raygunAuthToken is missing');
return;
}
var apiKey = options.raygunApiKey || process.env.RAYGUN_APIKEY;
var authToken = options.raygunAuthToken || process.env.RAYGUN_AUTHTOKEN;
generate = function(release, gitHash) {
var deployment = {
apiKey: apiKey,
version: release.version,
ownerName: release.ownerName,
emailAddress: release.emailAddress,
comment: release.notes,
scmIdentifier: gitHash
};
send(deployment);
};
send = function(data) {
request.post({
uri: options.raygunApiUri + '/deployments',
qs: { authToken: authToken },
json: true,
body: data
}, end);
};
end = function(error, res, body) {
if(error) {
grunt.fatal(error);
} else if (res.statusCode === 200) {
grunt.log.writeln('Sent deployment info to Raygun.io');
finishedTask();
} else if(res.statusCode === 403) {
grunt.fatal('Could not send deployment info to Raygun: your raygunApiKey is either wrong or you don\'t have access to that application');
} else if(res.statusCode === 401) {
grunt.fatal('Could not send deployment info to Raygun: your raygunAuthToken is wrong');
} else {
grunt.fatal('Could not send deployment info to Raygun: got a ' + res.statusCode + ' response code');
}
};
var release = grunt.file.readYAML(options.release);
if(options.useGit) {
grunt.util.spawn({
cmd: 'git',
args: ['rev-parse', '--verify', 'HEAD'],
grunt: false,
fallback: ''
}, function(error, result) {
var gitHash = String(result);
generate(release, gitHash);
});
} else {
generate(release, '');
}
});
};
|
JavaScript
| 0 |
@@ -2186,45 +2186,188 @@
e =
-grunt.file.readYAML(options.release);
+null;%0A%0A if(typeof options.release==%22string%22)%7B%0A grunt.file.readYAML(options.release);%0A %7D else if(typeof options.release==%22object%22)%7B%0A release = options.release;%0A %7D
%0A%0A
|
c88a471094bd21ce3c9fb721d6da45791df063a3
|
add use strict to attraction.js since it seems to be giving off errors in Heroku deployment
|
app/assets/javascripts/attraction.js
|
app/assets/javascripts/attraction.js
|
// Attraction Constructor
function Attraction(id, name, url, attraction_type, destination){
this.id = id;
this.name = name;
this.url = url;
this.attraction_type = attraction_type;
this.destination = destination;
}
Attraction.prototype.formatUrl = function(){
var origUrl = this.url;
if (origUrl.includes("http") == true){
return origUrl;
}
else if (origUrl.includes("www.") == true){
return "http://" + origUrl;
}
else {
return "http://www." + origUrl;
}
}
|
JavaScript
| 0 |
@@ -19,16 +19,29 @@
tructor%0A
+'use strict'%0A
function
@@ -274,16 +274,17 @@
nction()
+
%7B%0A var
|
f0164e4fa24684e53f091cf4c1391099d4fc9e00
|
Fix the scroll button now that we inject that after page load
|
app/assets/javascripts/lib/scroll.js
|
app/assets/javascripts/lib/scroll.js
|
$(function() {
$('[data-scroll]').click(function() {
var $target = $($(this).attr('data-target'));
$('html, body').animate({ scrollTop: $target.offset().top }, 500);
setTimeout(function() { $target.focus(); }, 500);
return false;
});
});
|
JavaScript
| 0 |
@@ -13,16 +13,33 @@
%7B%0A $('
+body').delegate('
%5Bdata-sc
@@ -48,16 +48,19 @@
ll%5D'
-).
+, '
click
-(
+',
func
@@ -190,17 +190,16 @@
, 500);%0A
-%0A
setT
@@ -245,17 +245,16 @@
500);%0A%0A
-%0A
retu
|
32e3309e686f9800d002d0071995f55c3401361c
|
use same format for id as for signature
|
security.js
|
security.js
|
var crypto = require('crypto')
//
//security is pluggable - or can be left out.
//
//there is a sign method, and a verify method (which may be async)
//hmm, after thinking through some possible attacks,
//https://github.com/dominictarr/scuttlebutt/issues/6
//I've realized that it is necessary to let the security plugin set
//the ID. hmm, that means there will need to be an async initialization step...
//
//The security will either need to shell out to `ssh-keygen` or to read a key pair
//from the file system. hmm, There should only be a single instance of security per
//process (except when testing), so maybe init security, then pass it to a new scuttlebutt)
//there may be many scuttlebutt instances but they should use the same key pair.
//
//that is up to security - maybe init the security when the app starts - indeed,
//probably generate the key during installation, and then `readFileSync()`
//
//Yup, because we don't want to be regenerating that stuff live.
//
// we do need the security to be able to set the key though!
//exactly what init api the security plugin wants to use is it's own business.
//it doesn't have to pass keys in like this...
var algorithm = 'RSA-SHA1'
var format = 'base64'
var hashAlg = 'SHA1'
module.exports = function (keys,
//THIS IS SERIOUS BUSINESS!
PRIVATE, PUBLIC
//THEREFORE THE CAPS MUST BE LOCKED
) {
return {
sign: function (update) {
var data = JSON.stringify(update)
return crypto.createSign(algorithm).update(data).sign(PRIVATE, format)
},
verify: function (update, cb) {
var _update = update.slice()
var sig = _update.pop()
var id = update[3]
var data = JSON.stringify(_update)
var key = keys[id]
if(!key) return cb(null, false)
cb(null, crypto.createVerify(algorithm).update(data).verify(key, sig, format))
},
createId: function () {
//hash of public key.
return crypto.createHash(hashAlg).update(PUBLIC).digest()
}
}
}
|
JavaScript
| 0.000002 |
@@ -1967,16 +1967,22 @@
.digest(
+format
)%0A %7D%0A
|
99268051ad42e5e78218933ccf049139330f4f1c
|
Make 'childLinkViews' and Ember Array
|
addon/components/active-link.js
|
addon/components/active-link.js
|
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'li',
childLinkViews: [],
classNameBindings: ['active'],
active: Ember.computed('[email protected]', function() {
return Ember.A(this.get('childLinkViews')).isAny('active');
}),
didRender: function() {
Ember.run.schedule('afterRender', this, function() {
var childLinkElements = this.$('a.ember-view');
var childLinkViews = childLinkElements.toArray().map(view =>
this._viewRegistry[view.id]
);
this.set('childLinkViews', childLinkViews);
});
}
});
|
JavaScript
| 0.000014 |
@@ -82,30 +82,8 @@
i',%0A
- childLinkViews: %5B%5D,%0A
cl
@@ -196,16 +196,8 @@
urn
-Ember.A(
this
@@ -218,17 +218,16 @@
kViews')
-)
.isAny('
@@ -249,31 +249,147 @@
%0A%0A
-didRender: function() %7B
+init() %7B%0A this._super( ...arguments );%0A this.set('childLinkViews', Ember.A());%0A %7D,%0A%0A didRender() %7B%0A this._super( ...arguments );
%0A
@@ -444,27 +444,27 @@
n() %7B%0A
-var
+let
childLinkEl
@@ -507,11 +507,11 @@
-var
+let
chi
@@ -643,16 +643,24 @@
Views',
+Ember.A(
childLin
@@ -666,16 +666,17 @@
nkViews)
+)
;%0A %7D)
@@ -685,8 +685,9 @@
%7D%0A%0A%7D);
+%0A
|
323f13f70e3bacc059e09748631f96300d2312ca
|
add g-recaptcha CSS class to g-recaptcha component
|
addon/components/g-recaptcha.js
|
addon/components/g-recaptcha.js
|
import Ember from 'ember';
import Configuration from '../configuration';
export default Ember.Component.extend({
sitekey: Configuration.siteKey,
tabindex: Ember.computed.alias('tabIndex'),
renderReCaptcha() {
if (Ember.isNone(window.grecaptcha)) {
Ember.run.later(() => {
this.renderReCaptcha();
}, 500);
} else {
let container = this.$()[0];
let properties = this.getProperties(
'sitekey',
'theme',
'type',
'size',
'tabindex'
);
let parameters = Ember.merge(properties, {
callback: this.get('successCallback').bind(this),
'expired-callback': this.get('expiredCallback').bind(this)
});
let widgetId = window.grecaptcha.render(container, parameters);
this.set('widgetId', widgetId);
}
},
successCallback(reCaptchaResponse) {
let action = this.get('onSuccess');
if (Ember.isPresent(action)) {
action(reCaptchaResponse);
}
},
expiredCallback() {
let action = this.get('onExpired');
if (Ember.isPresent(action)) {
action();
} else {
if (Ember.isPresent(this.set('widgetId'))) {
window.grecaptcha.reset(this.set('widgetId'));
}
}
},
// Lifecycle Hooks
didInsertElement() {
this._super(...arguments);
Ember.run.next(() => {
this.renderReCaptcha();
});
}
});
|
JavaScript
| 0 |
@@ -108,16 +108,48 @@
tend(%7B%0A%0A
+ classNames: %5B'g-recaptcha'%5D,%0A%0A
siteke
|
92b812887cd2d5887223ba0f59f8035fee661b33
|
Fix native Object.is() detection, fixes #54.
|
features.js
|
features.js
|
define(["requirejs-dplugins/has"], function (has) {
/* global Platform */
has.add("console-api", typeof console !== "undefined");
has.add("host-browser", typeof window !== "undefined");
has.add("object-observe-api", typeof Object.observe === "function" && typeof Array.observe === "function");
has.add("object-is-api", Object.is);
has.add("setimmediate-api", typeof setImmediate === "function");
has.add("mutation-observer-api",
typeof MutationObserver !== "undefined"
&& (/\[\s*native\s+code\s*\]/i.test(MutationObserver) // Avoid polyfill version of MutationObserver
|| !/^\s*function/.test(MutationObserver)));
has.add("polymer-platform", typeof Platform !== "undefined");
return has;
});
|
JavaScript
| 0 |
@@ -317,16 +317,18 @@
s-api%22,
+!!
Object.i
|
73c5c7e230f7fb943715f6abb052a010c2912a50
|
Remove unnecessary js
|
pages/welcome/js/script.js
|
pages/welcome/js/script.js
|
(function() {
chrome.storage.sync.get("playedTutorial", function(playedTutorial) {
if(!playedTutorial.playedTutorial) {
console.log(playedTutorial.playedTutorial)
document.getElementById("loading").style.display = "none";
document.getElementById("oninstall").style.display = "block";
utils.onInstall.setTutorialPlayed();
}else {
}
});
})();
/*TODO: rename file to something more descriptive*/
|
JavaScript
| 0.000046 |
@@ -123,122 +123,8 @@
) %7B%0A
- console.log(playedTutorial.playedTutorial)%0A document.getElementById(%22loading%22).style.display = %22none%22;%0A
@@ -239,15 +239,82 @@
%7D
+
else %7B%0A
+ document.getElementById(%22onupdate%22).style.display = %22block%22;
%0A
|
c6ea01a472f4effd34defa1f771001cb2c866eed
|
add new 'label' property to settings for easy display
|
settings.js
|
settings.js
|
// user settings:
var _settings;
var saveSettings = function(){
localStorage.setItem("user_settings",JSON.stringify(_settings));
}
var initializeSettings = function(){
_settings = JSON.parse(localStorage.getItem("user_settings"));
if(_settings === null || _settings === {}){
_settings = [
{item:'fullscreenCaptions',value:true},
{item:'notificationColors',value:true}
]
saveSettings();
}
}
$(document).ready(function(){
initializeSettings();
});
// Retrieve a setting object by 'item' property (the name) from the _settings arrays for use
var getSetting = function(setting){
// retrieve the first item from an array of settings that match the given name
return $.grep(_settings,function(e){return e.item === setting})[0];
};
var settingChanged = function(element){
var $element = $(element);
if($element.is(":checkbox")){
console.log('its a checkbox');
var setting = getSetting($element.prop('value'));
if($element.is(":checked")){
// find the setting for the given checkbox and match the setting to whether or not its checked:
setting.value = true;
}
else{
setting.value = false;
}
console.log(setting.value);
}
saveSettings();
};
var settingsDialogue = function(){
var dialog = $('#d_Settings');
var settingsDiv = $('#d_Settings #settingsContainer');
settingsDiv.html("");
$(_settings).each(function(i,item){
var settingItem = null;
var evalItem = item.value;
switch(typeof evalItem){
case 'boolean':
settingItem = $("<label><input type='checkbox' value='"+item.item+"'" +
""+
(item.value === true ? 'checked' : '') + ">"+item.item+"</label></input>");
break;
default:
console.log('could not evaluate setting ' + item.item);
break;
}
console.log(settingItem);
settingsDiv.append(settingItem);
settingsDiv.append('<br>');
});
$(':checkbox').change(function(){
settingChanged(this);
});
};
|
JavaScript
| 0 |
@@ -340,16 +340,49 @@
lue:true
+,label:'Fullscreen Notifications'
%7D,%0D%0A%09%09%09%7B
@@ -417,16 +417,44 @@
lue:true
+,label:'Notification Colors'
%7D%0D%0A%09%09%5D%0D%0A
@@ -1735,20 +1735,21 @@
%3E%22+item.
-item
+label
+%22%3C/labe
|
fa2f99acf627f106e57a2d5985e84cbe04973400
|
Create first autorun for updating layout
|
cothink2/client/layout.js
|
cothink2/client/layout.js
|
var Layout = {}
Layout.init = function (msgbus) {
};
layout = Object.create(Layout);
Meteor.startup(function () {
layout.init(msgbus);
});
|
JavaScript
| 0 |
@@ -14,42 +14,437 @@
%7B%7D%0A%0A
-Layout.init = function (msgbus) %7B%0A
+var autoruns = %7B%0A 'centerFocussedItem': function () %7B%0A var focussedItem = uiCore.getFocussedItem();%0A if (focussedItem != null) %7B%0A layout.render(focussedItem);%0A %7D%0A %7D,%0A%7D;%0A%0ALayout.init = function (msgbus) %7B%0A for (func in autoruns) %7B%0A Tracker.autorun(autoruns%5Bfunc%5D);%0A %7D%0A%7D;%0A%0ALayout.render = function (item) %7B%0A assert_type(item, Item);%0A%0A console.log('render item #' + item.id);
%0A%7D;%0A
|
7b460d0f4b7d89c07e3bd854cbb4e67862bca726
|
improve changeset notes
|
app/create-feed-from-gtfs/service.js
|
app/create-feed-from-gtfs/service.js
|
import Ember from 'ember';
export default Ember.Service.extend({
store: Ember.inject.service(),
feedModel: null,
userModel: null,
createFeedAndUserModels: function() {
var newFeedModel = this.get('store').createRecord('feed', {});
var newUserModel = this.get('store').createRecord('user', {});
this.set('feedModel', newFeedModel);
this.set('userModel', newUserModel);
return {
feed: newFeedModel,
user: newUserModel
};
},
toChangeset: function() {
var feedModel = this.get('feedModel');
var changes = [];
feedModel.get('operators').map(function(operator) {
if (operator.get('include_in_changeset') === true) {
changes.push({
action: 'createUpdate',
operator: operator.toChange()
});
}
});
changes.push({
action: 'createUpdate',
feed: feedModel.toChange()
});
var changeset = this.get('store').createRecord('changeset', {
notes: 'This is a test. TODO put a custom message here.',
payload: {
changes: changes
}
});
changeset.set('user', this.get('userModel'));
return changeset;
}
});
|
JavaScript
| 0 |
@@ -966,57 +966,82 @@
es:
-'This is a test. TODO put a custom message here.'
+%60Changed submitted from Feed Registry for feed at $%7BfeedModel.get('url')%7D%60
,%0A
|
3a383efc919c11969c5688bc53681caaba4afbe1
|
edit Wallet
|
app/models/ballotbox.server.model.js
|
app/models/ballotbox.server.model.js
|
'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Wallet = mongoose.model('Wallet');
var crypto = require('crypto');
var BallotBoxSchema = new Schema({
//hash will be SHA1(ballotbox.yes+ballotbox.no+ballotbox.protest)
hash: {
type: String,
default: '',
trim: true,
required: 'proposal hash cannot be blank',
},
yes: {
type: String,
default: '',
trim: true,
required: 'ballotbox yes address cannot be blank',
},
no: {
type: String,
default: '',
trim: true,
required: 'ballotbox no address cannot be blank',
},
protest: {
type: String,
default: '',
trim: true,
required: 'protest address cannot be blank',
},
});
BallotBoxSchema.statics.create = function(proposal_title, callback) {
Wallet.create_vote_address(Date.now(), proposal_title, function(err, data) {
this.yes = data;
});
Wallet.create_vote_address(Date.now(), proposal_title, function(err, data) {
this.no = data;
});
Wallet.create_vote_address(Date.now(), proposal_title, function(err, data) {
this.protest = data;
});
var sha = crypto.createHash('sha1');
sha.write(this.yes+this.no+this.protest);
this.hash = sha.read();
this.save(callback);
};
mongoose.model('BallotBox', BallotBoxSchema);
|
JavaScript
| 0.000001 |
@@ -755,16 +755,18 @@
ck) %7B%0A%0A%09
+//
Wallet.c
@@ -831,24 +831,26 @@
r, data) %7B%0A%09
+//
%09this.yes =
@@ -848,38 +848,44 @@
is.yes = data;%0A%09
+//
%7D);%0A
-%0A%09
+//%0A%09//
Wallet.create_vo
@@ -942,24 +942,26 @@
r, data) %7B%0A%09
+//
%09this.no = d
@@ -966,22 +966,28 @@
data;%0A%09
+//
%7D);%0A
-%0A%09
+//%0A%09//
Wallet.c
@@ -1056,16 +1056,18 @@
ata) %7B%0A%09
+//
%09this.pr
@@ -1085,14 +1085,20 @@
a;%0A%09
+//
%7D);%0A
-%0A%09
+//%0A%09//
var
@@ -1131,16 +1131,18 @@
ha1');%0A%09
+//
sha.writ
@@ -1176,16 +1176,18 @@
test);%0A%09
+//
this.has
|
8cb5eb90858f16e37629497f5ff5f81f497ca4de
|
Add extension system to System. Add System properties. Add System.Debug.
|
api/system.js
|
api/system.js
|
/*
* Copyright (c) 2014 The Sphere Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @namespace System
* @author Jos Kuijpers (Rahkiin)
*/
/**
* Abort the current game with a message.
*
* @param {String} msg - Message to show after abort.
* @noreturn
*/
System.abort = function(msg) {
}
/**
* Exit the game unconditionally.
*
* @noreturn
*/
System.exit = function() {
}
|
JavaScript
| 0 |
@@ -1442,238 +1442,1811 @@
%0A *
-Abort the current game with a message.%0A *%0A * @param %7BString%7D msg - Message to show after abort.%0A * @noreturn%0A */%0ASystem.abort = function(msg) %7B%0A%7D%0A%0A/**%0A * Exit the game unconditionally.%0A *%0A * @noreturn%0A */%0ASystem.exit = function() %7B%0A%7D
+Get the version number of the engine.%0A * @static%0A */%0ASystem.version = 1; // 00.00.01%0A%0A/**%0A * Get the version string of the engine.%0A * @static%0A */%0ASystem.versionString = %22Sphere Pegasus 0.0.1%22;%0A%0A/**%0A * An array of extensions of type System.Extension.%0A *%0A * The key is the extension point. This is also the string used%0A * when importing the module using require().%0A *%0A * @static%0A */%0ASystem.extensions = %7B%0A%09%22sqlite%22 : null%0A%7D%0A%0A/**%0A * Abort the current game with a message.%0A *%0A * @param %7BString%7D msg - Message to show after abort.%0A * @noreturn%0A */%0ASystem.abort = function(msg) %7B%0A%7D%0A%0A/**%0A * Exit the game unconditionally.%0A *%0A * @noreturn%0A */%0ASystem.exit = function() %7B%0A%7D%0A%0A/**%0A * Get the resolved path of a resource, relative to the%0A * the engine or user directory (/ or ~/).%0A *%0A * This function should use relative paths, because otherwise it%0A * would be useless with File().%0A *%0A * @param %7BString%7D query - The resource query.%0A * @param %7BString%7D %5Bextension=%5D - The default extension.%0A * @param %7BString%7D %5Bfolder=%5D - The default folder.%0A */%0ASystem.resolve = function(query,extension,folder) %7B%0A%7D%0A%0A/**%0A * Try to run the garbage collector.%0A *%0A * @warning Only use while debugging and use at own risk.%0A */%0ASystem.Debug.garbageCollect() %7B%0A%7D%0A%0A/**%0A * Name of the extension.%0A */%0ASystem.Extension.prototype.name = %22SQLite%22;%0A%0A/**%0A * Version number of the extension.%0A */%0ASystem.Extension.prototype.version = 1;%0A%0A/**%0A * Version string of the extension.%0A */%0ASystem.Extension.prototype.versionString = %22SQLite 0.0.1%22;%0A%0A/**%0A * Get the functionality description of the extension.%0A *%0A * This description is per-extension and can be used to provide%0A * information about the functionalities of the plugin,%0A * such as whether a specific action is available in this version.%0A */%0ASystem.Extension.prototype.functionalityDescription = %7B%7D;
%0A
|
ba47579762088f66fa940de4a62145ae5be4d6a8
|
update c2mysql-images.
|
app/mongodb-script/c2mysql-images.js
|
app/mongodb-script/c2mysql-images.js
|
'use strict';
const init = require('../base/init');
const config = require('../base/config');
const date2 = require('../base/date2');
const mongo2 = require('../mongodb/mongo2');
const my2 = require('../mysql/my2');
const imageb = require('../image/image-base');
init.add(
(done) => {
console.log('copy mongodb images to mysql image.');
let c = 0;
let cursor = mongo2.db.collection('images').find().sort({ id: 1 });
(function read() {
cursor.next(function (err, r) {
if (err) return done(err);
if (!r) return done();
c++;
if (c % 100 === 0) {
process.stdout.write(c + ' ');
}
r.id = r._id;
delete r._id;
r.vers = JSON.stringify(r.vers || null);
my2.query('replace into image set ?', r, (err) => {
if (err) return done(err);
setImmediate(read);
});
});
})();
},
(done) => {
mongo2.close(done);
},
(done) => {
my2.close(done);
},
(done) => {
console.log('done.');
done();
}
);
init.run();
|
JavaScript
| 0 |
@@ -657,30 +657,51 @@
-r.id =
+let img = %7B%0A id:
r._id
-;%0A
+,%0A
dele
@@ -700,21 +700,19 @@
-delete r._id;
+uid: r.uid,
%0A
@@ -720,16 +720,41 @@
-r.
+ cdate: r.cdate,%0A
vers
- =
+:
JSO
@@ -780,17 +780,57 @@
%7C%7C null)
-;
+,%0A comment: r.comment,%0A %7D
%0A
@@ -868,17 +868,19 @@
set ?',
-r
+img
, (err)
|
983b010755ea00342ea1905b9393251bf0473537
|
Remove deprecated require
|
shoedrip.js
|
shoedrip.js
|
const request = require('request-promise-native');
let connection = require('./psc.js');
let BattleMonitor = require('./BattleMonitor.js');
module.exports.champ = {};
let getCurrentThread = async () => {
let b = await request.get('http://a.4cdn.org/vp/catalog.json');
let catalog = JSON.parse(b);
let derp_no = 0;
catalog.some(page => {
return page.threads.some(t => {
if (t.sub && t.sub.toLowerCase().indexOf('showderp') != -1 && t.no > derp_no)
return derp_no = t.no;
});
});
return derp_no;
}
let getCurrentChamp = async b => {
let thread = JSON.parse(b);
let derp_no = 0;
for (var i = thread.posts.length - 1; i != 0; --i) {
if (!thread.posts[i].trip)
continue;
let content = thread.posts[i].com.replace(/<(?:.|\n)*?>/gm, '');
let matches;
if ((matches = content.match(/(https?:\/\/)?play.pokemonshowdown.com\/battle-(.*)-([0-9]*)/g))) {
let champ = {champ_name: thread.posts[i].name, champ_trip: thread.posts[i].trip, champ_last_active: thread.posts[i].time};
let curtime = ~~(+new Date() / 1000);
champ.champ_active = curtime - champ.champ_last_active < 15 * 60;
champ.champ_battle = matches[0];
if(champ.champ_battle[0] != 'h')
champ.champ_battle = 'http://' + champ.champ_battle;
return champ;
}
}
return {};
}
let oldbattle = null;
// stolen from gist
levenshtein = (a, b) => {
var tmp;
if (a.length === 0) { return b.length; }
if (b.length === 0) { return a.length; }
if (a.length > b.length) { tmp = a; a = b; b = tmp; }
var i, j, res, alen = a.length, blen = b.length, row = Array(alen);
for (i = 0; i <= alen; i++) { row[i] = i; }
for (i = 1; i <= blen; i++) {
res = i;
for (j = 1; j <= alen; j++) {
tmp = row[j - 1];
row[j - 1] = res;
res = b[i - 1] === a[j - 1] ? tmp : Math.min(tmp + 1, Math.min(res + 1, row[j] + 1));
}
}
return res;
}
let main = async () => {
try {
let thread = await getCurrentThread();
let threadjs = await request.get('http://a.4cdn.org/vp/thread/' + thread + '.json');
let champ = await getCurrentChamp(threadjs);
if (champ.champ_battle != oldbattle) {
oldbattle = champ.champ_battle;
if (champ.champ_name != undefined && champ.champ_name != '')
new BattleMonitor(champ);
}
module.exports.champ = champ;
}
catch(e) {
console.log(e);
}
}
main();
setInterval(async () => {await main();}, 1000 * 60);
|
JavaScript
| 0.000003 |
@@ -48,46 +48,8 @@
');%0A
-let connection = require('./psc.js');%0A
let
|
65f5a7f85fd2ed38a95f006a8063f73d4f958f15
|
modify configure
|
crawler/conf/configure.js
|
crawler/conf/configure.js
|
// Global configure for crawler. Export the whole configure info by an object.
module.exports=
{
database:
{
// the schema used to access mongodb.
access_schema: "mongodb://localhost/cnews"
},
worker:
{
// the robots.txt info cached will expire within the time. If <0, no expiration time
robots_info_expire_in_seconds: 24*60*60,
robots_in_one_domain_interval_in_ms: 5000,
robots_in_one_domain_concurrency: 1,
// if the value=0, no time out is set.
fetch_time_out_in_ms: 100000
},
request:
{
// when requesting instant data like robots.txt, the number of redirects allowed.
default_max_redirect_allowed: 10
},
scheduler:
{
// max worker working at the same time, when batching workers, the number of living
// workers will be supplemented to this value.
max_worker: 10,
// if the value >=0, it indicates the max number of pages that can be fetched within one batch.
// if the value <0, no limitation is set.
max_fetches_per_launch: 5000,
// if launch the crawler in entry.js, the time indicates the interval (in seconds) of
// each batch.
spawn_interval_in_seconds: 1
},
log:
{
// if the value>0, when the number of workers can be divided by the value or reached max, the event is logged.
// if the value=0, the number of workers will not trigger any logging.
log_workers_num: 100
}
}
|
JavaScript
| 0.000001 |
@@ -1257,17 +1257,18 @@
econds:
-1
+60
%0A %7D,%0A
@@ -1506,18 +1506,16 @@
s_num: 1
-00
%0A %7D%0A%7D
|
6c35b58ac3a610c6633b87047a4be89e31b1e42e
|
Return app-sync version on status API.
|
src/gateway-api-status.js
|
src/gateway-api-status.js
|
import R from "ramda";
import Promise from "bluebird";
import pm2 from "./pm2";
import prettyBytes from "pretty-bytes";
import { promises } from "./util";
import log from "./log";
const HOST_NAME = process.env["HOSTNAME"] || "unknown";
export default (apps) => {
const processNameToAppId = (name) => name.split(":")[0];
const getApp = (id) => {
id = processNameToAppId(id);
return R.find(app => app.id === id, apps);
};
const getAppStatus = (app, processItem) => {
return new Promise((resolve, reject) => {
if (!app || !processItem) {
resolve();
return;
}
const status = {
id: app.id,
status: processItem.pm2_env.status,
route: `${ app.route.toString() } ⇨ ${ app.port }`,
repository: `${ app.repo.name }:${ app.branch }`,
resources: {
memory: prettyBytes(processItem.monit.memory),
cpu: processItem.monit.cpu
}
};
const gettingVersion = app.version().catch(err => reject(err));
gettingVersion.then(version => {
status.version = {
local: version.local,
remote: version.remote
};
if (version.isUpdateRequired) { status.version.isUpdateRequired = true; }
if (version.isDependenciesChanged) { status.version.isDependenciesChanged = true; }
if (version.isDownloading) {
status.status += `, updating to v${ version.remote }`;
status.version.isDownloading = true;
}
resolve(status);
});
});
};
const getRunningApps = () => {
return new Promise((resolve, reject) => {
Promise.coroutine(function*() {
const processes = yield pm2.apps();
let { results } = yield promises(processes.map(item => getAppStatus(getApp(item.name), item))).catch(err => reject(err));
results = R.reject(R.isNil)(results);
results = R.sortBy(R.prop("id"))(results);
resolve(results);
})();
});
};
return {
getStatuses(req, res) {
getRunningApps()
.then(appsStatus => res.send({ host: HOST_NAME, apps: appsStatus }))
.catch(err => {
log.error(err);
res.status(500).send({
error: "Failed while getting the status of running applications",
message: err.message
});
});
},
getAppStatus(req, res) {
Promise.coroutine(function*() {
const id = req.params.app;
const app = getApp(id);
const sendFail = (err) => res.status(500).send({ message: `Failed while getting the status of the application '${ id }'.`, err: err.message });
if (!app) {
res.status(404).send({ error: `The application '${ id }' does not exist.` });
} else {
const processes = yield pm2
.apps(item => processNameToAppId(item.name) === id)
.catch(err => sendFail(err));
const item = processes[0];
const status = yield getAppStatus(getApp(item.name), item).catch(err => sendFail(err));
res.send(status);
}
})();
}
};
};
|
JavaScript
| 0 |
@@ -172,16 +172,59 @@
%22./log%22;
+%0Aimport packageJson from %22../package.json%22;
%0A%0Aconst
@@ -2323,16 +2323,26 @@
s.send(%7B
+%0A
host: H
@@ -2350,16 +2350,66 @@
ST_NAME,
+%0A version: packageJson.version,%0A
apps: a
@@ -2417,16 +2417,24 @@
psStatus
+%0A
%7D))%0A
|
f16aec607e76716090b90dbce921e033e4327817
|
Switch to code authorization flow
|
app/config.js
|
app/config.js
|
// This is the default configuration for the dev mode of the web console.
// A generated version of this config is created at run-time when running
// the web console from the openshift binary.
//
// To change configuration for local development, copy this file to
// assets/app/config.local.js and edit the copy.
window.OPENSHIFT_CONFIG = {
apis: {
hostPort: "localhost:8443",
prefix: "/apis"
},
api: {
openshift: {
hostPort: "localhost:8443",
prefix: "/oapi"
},
k8s: {
hostPort: "localhost:8443",
prefix: "/api"
}
},
auth: {
oauth_authorize_uri: "https://localhost:8443/oauth/authorize",
oauth_redirect_base: "https://localhost:9000/dev-console",
oauth_client_id: "openshift-web-console",
logout_uri: ""
},
loggingURL: "",
metricsURL: ""
};
window.OPENSHIFT_VERSION = {
openshift: "dev-mode",
kubernetes: "dev-mode"
};
|
JavaScript
| 0.000001 |
@@ -641,24 +641,83 @@
authorize%22,%0A
+ oauth_token_uri: %22https://localhost:8443/oauth/token%22,%0A
oauth_re
|
9cec80d5262fe45c3621e450ef509e050aae5a08
|
add EVENT_TAG_HIDE_BUILDING_NAME constant
|
app/consts.js
|
app/consts.js
|
export default {
colors: [
"ff4d40",
"ffa540",
"f2ec0f",
"3c6d2b",
"40ff73",
"4071ff",
"ff4086",
"40ccff",
"5940ff",
"ff40f5",
"a940ff",
"e6ab68",
"4d4d4d"
],
EVENT_TYPE_PLAIN: 1,
EVENT_TYPE_HOMEWORK: 2,
EVENT_TYPE_SCHEDULE: 3,
EVENT_TAG_RESERVED: 0,
EVENT_TAG_DESCRIPTION: 1,
EVENT_TAG_HOMEWORK: 2,
EVENT_TAG_TERM_ID: 3,
EVENT_TAG_CLASS_ID: 4,
EVENT_TAG_OWNER_ID: 5,
EVENT_TAG_OWNER_NAME: 6,
EVENT_TAG_DAY_NUMBER: 7,
EVENT_TAG_BLOCK: 8,
EVENT_TAG_BUILDING_NAME: 9,
EVENT_TAG_ROOM_NUMBER: 10,
EVENT_TAG_LOCATION: 11,
EVENT_TAG_READ_ONLY: 12,
EVENT_TAG_SHORT_NAME: 13,
EVENT_TAG_ACTIONS: 14,
EVENT_TAG_CANCELLED: 15,
EVENT_TAG_CANCELABLE: 16,
EVENT_TAG_SECTION: 17,
EVENT_TAG_ORIGINAL_START: 18,
EVENT_TAG_ORIGINAL_END: 19,
CALENDAR_STATUS_UNIMPORTED: 0,
CALENDAR_STATUS_IMPORTED: 1,
CALENDAR_STATUS_NEEDS_UPDATE: 2,
RECUR_FREQUENCY_DAILY: 0,
RECUR_FREQUENCY_WEEKLY: 1,
RECUR_FREQUENCY_MONTHLY: 2,
RECUR_FREQUENCY_YEARLY: 3,
TOKEN_TYPE_NONE: 0,
TOKEN_TYPE_RESET_PASSWORD: 1,
TOKEN_TYPE_CHANGE_EMAIL: 2,
TOKEN_TYPE_VERIFY_EMAIL: 3,
};
|
JavaScript
| 0.000028 |
@@ -768,16 +768,51 @@
END: 19,
+%0A%09EVENT_TAG_HIDE_BUILDING_NAME: 20,
%0A%0A%09CALEN
|
cf8625f53de804512571b1010844e090dae1044b
|
remove interceptors
|
app/js/app.js
|
app/js/app.js
|
'use strict';
define(['angular', 'angular-sanitize', 'angular-loading-bar', 'angular-animate',
'text-angular'
/*,'angular-form-controls','angular-storage', 'angular-route', 'angular-cookies', */
],
function(angular) {
var dependencies = ['ngRoute', 'ngCookies', 'chieffancypants.loadingBar', 'ngAnimate',
'ngSanitize', 'angular-intro', 'scbdControls', 'ngLocalizer',
'textAngular', 'cbd-forums', 'LocalStorageModule',
'ng-breadcrumbs', 'scbdServices', 'scbdFilters'
];
angular.defineModules(dependencies);
var app = angular.module('app', dependencies);
app.config(['$controllerProvider', '$compileProvider', '$provide', '$filterProvider', '$httpProvider',
function($controllerProvider, $compileProvider, $provide, $filterProvider, $httpProvider) {
// console.log($routeProvider);
//app.controllerProvider = $controllerProvider;
//app.routeProvider = $routeProvider;
//app.compileProvider = $compileProvider;
app.filter = function(name, param1, param2, param3, param4) {
return (fromCache('filter', name) ||
toCache('filter', name, $filterProvider.register(name, param1, param2, param3, param4))).data;
};
app.factory = function(name, param1, param2, param3, param4) {
return (fromCache('factory', name) ||
toCache('factory', name, $provide.factory(name, param1, param2, param3, param4))).data;
};
app.value = function(name, param1, param2, param3, param4) {
return (fromCache('value', name) ||
toCache('value', name, $provide.value(name, param1, param2, param3, param4))).data;
};
app.controller = function(name, param1, param2, param3, param4) {
return (fromCache('controller', name) ||
toCache('controller', name, $controllerProvider.register(name, param1, param2, param3, param4))).data;
};
app.directive = function(name, param1, param2, param3, param4) {
return (fromCache('directive', name) ||
toCache('directive', name, $compileProvider.directive(name, param1, param2, param3, param4))).data;
};
$httpProvider.interceptors.push('authenticationHttpIntercepter');
$httpProvider.interceptors.push('realmHttpIntercepter');
//==========================================
//==========================================
//==========================================
//==========================================
var lazyCache = {};
function fromCache(type, name) {
var key = type + ':' + name;
if (lazyCache[key])
console.log('Already defined: ' + key);
return lazyCache[key];
}
function toCache(type, name, data) {
var key = type + ':' + name;
if (lazyCache[key])
throw 'Cannot cache: Already defined: ' + key;
lazyCache[key] = {
data: data
};
return lazyCache[key];
}
}
]);
app.run(function($rootScope, $location) {
$rootScope.$on('$routeChangeSuccess', function(event, current, previous) {
//padding route attributes to the rootscope
if (current.$$route && current.$$route.subTemplateUrl)
$rootScope.subTemplateUrl = current.$$route.subTemplateUrlFull;
});
});
return app;
});
|
JavaScript
| 0 |
@@ -2471,162 +2471,8 @@
%7D;%0A%0A
- $httpProvider.interceptors.push('authenticationHttpIntercepter');%0A $httpProvider.interceptors.push('realmHttpIntercepter');
%0A%0A
|
182463ba57f89b3242298998f7e26c34fc325431
|
Set multivalue arguments as comma separated lists
|
plugins/item_tasks/web_client/views/TaskRunView.js
|
plugins/item_tasks/web_client/views/TaskRunView.js
|
import _ from 'underscore';
import WidgetCollection from '../collections/WidgetCollection';
import ControlsPanel from './ControlsPanel';
import View from 'girder/views/View';
import FolderModel from 'girder/models/FolderModel';
import ItemModel from 'girder/models/ItemModel';
import router from 'girder/router';
import { restRequest } from 'girder/rest';
import { renderMarkdown } from 'girder/misc';
import template from '../templates/taskRun.pug';
import '../stylesheets/taskRun.styl';
const TaskRunView = View.extend({
events: {
'click .g-run-task': 'execute'
},
initialize: function (settings) {
this._taskSpec = this.model.get('meta').itemTaskSpec || {};
this._inputs = this._taskSpec.inputs || [];
this._outputs = this._taskSpec.outputs || [];
this._inputWidgets = new WidgetCollection();
this._outputWidgets = new WidgetCollection();
this._initialValues = settings.initialValues || null;
const inputs = this._initialValues && this._initialValues.inputs || {};
const outputs = this._initialValues && this._initialValues.outputs || {};
// Build all the widget models from the task IO spec
this._inputWidgets.add(
this._inputs.map((input) => this._setJobInfo(input, inputs))
);
this._outputWidgets.add(
this._outputs.map((output) => this._setJobInfo(output, outputs))
);
this._inputsPanel = new ControlsPanel({
title: 'Configure inputs',
collection: this._inputWidgets,
parentView: this
});
this._outputsPanel = new ControlsPanel({
title: 'Configure outputs',
collection: this._outputWidgets,
parentView: this
});
},
/**
* Fill in values according to an existing job.
*
* @param {object} spec The task parameter spec
* @param {object} bindings The job parameter bindings
*/
_setJobInfo: function (spec, bindings) {
const match = bindings[spec.id || spec.name] || {};
if (match.mode === 'girder' && match.resource_type === 'item') {
spec.value = new ItemModel({
_id: match.id,
_modelType: 'item',
name: match.fileName || match.id
});
spec.fileName = match.fileName || match.id;
} else if (match.mode === 'girder' && match.parent_type === 'folder') {
spec.value = new FolderModel({
_id: match.parent_id,
_modelType: 'folder'
});
spec.fileName = match.name || match.id;
} else if (_.has(match, 'data')) {
spec.value = match.data;
}
return spec;
},
render: function () {
var hasInputs = !!this._inputs.length,
hasOutputs = !!this._outputs.length;
this.$el.html(template({
item: this.model,
hasInputs: hasInputs,
hasOutputs: hasOutputs,
renderMarkdown: renderMarkdown
}));
if (hasInputs) {
this._inputsPanel.setElement(this.$('.g-inputs-container')).render();
}
if (hasOutputs) {
this._outputsPanel.setElement(this.$('.g-outputs-container')).render();
}
},
/**
* Validates that all of the widgets are in a valid state. Displays any
* invalid states and
*/
validate: function () {
let ok = true;
const test = (model) => {
if (!model.isValid()) {
ok = false;
}
};
// Don't short-circuit; we want to highlight *all* invalid inputs
this._inputWidgets.each(test);
this._outputWidgets.each(test);
return ok;
},
/**
* Translates the WidgetCollection state for the input and output widgets into the
* appropriate girder_worker input and output bindings, then invokes the endpoint
* to execute the task. TODO We probably want to move that translation layer down into
* the WidgetCollection itself in the future.
*/
execute: function (e) {
if (!this.validate()) {
this.$('.g-validation-failed-message').text(
'One or more of your inputs or outputs is invalid, they are highlighted in red.');
return;
}
this.$('.g-validation-failed-message').empty();
$(e.currentTarget).attr('disabled', 'true').addClass('disabled');
const inputs = {}, outputs = {};
const translate = (model) => {
const val = model.value();
switch (model.get('type')) {
case 'image': // This is an input
return {
mode: 'girder',
resource_type: 'file',
id: val.id,
fileName: model.get('fileName') || null
};
case 'file': // This is an input
return {
mode: 'girder',
resource_type: 'item',
id: val.id,
fileName: model.get('fileName') || null
};
case 'new-file': // This is an output
return {
mode: 'girder',
parent_id: val.id,
parent_type: 'folder',
name: model.get('fileName')
};
default:
return {
mode: 'inline',
data: model.value()
};
}
};
this._inputWidgets.each((model) => {
inputs[model.id] = translate(model);
});
this._outputWidgets.each((model) => {
outputs[model.id] = translate(model);
});
restRequest({
path: `item_task/${this.model.id}/execution`,
type: 'POST',
data: {
inputs: JSON.stringify(inputs),
outputs: JSON.stringify(outputs)
},
error: null
}).done((resp) => {
router.navigate(`job/${resp._id}`, {trigger: true});
}).error((resp) => {
$(e.currentTarget).attr('disabled', null).removeClass('disabled');
this.$('.g-validation-failed-message').text('Error: ' + resp.responseJSON.message);
});
}
});
export default TaskRunView;
|
JavaScript
| 0.000008 |
@@ -4593,20 +4593,18 @@
-cons
+le
t val =
@@ -5550,16 +5550,127 @@
efault:%0A
+ if (model.isVector()) %7B%0A val = val.join(',');%0A %7D%0A
@@ -5760,29 +5760,19 @@
data:
-model.value()
+val
%0A
|
ae06d181d42b0d50e888ed16ef0eb499623e759c
|
Fix double fetching
|
src/Administration/Users/UsersList/UsersList.js
|
src/Administration/Users/UsersList/UsersList.js
|
import React, { useEffect, useState } from 'react'
// import PropTypes from 'prop-types'
import Grid from '@material-ui/core/Grid'
import {
makeStyles,
Paper,
Table,
TableCell,
TableRow,
TableHead,
TableBody,
TableFooter,
TableContainer,
TableSortLabel,
} from '@material-ui/core'
import { Alert, AlertTitle } from '@material-ui/lab'
import api from '@/_api'
import BasePageContainer from '@/_common/BasePageContainer'
import BasePageToolbar from '@/_common/BasePageToolbar'
import { BaseTablePagination } from '@/_common/BaseTable'
import UsersListAction from './UsersListActions'
import UsersListTableItems from './UsersListTableItems'
const UsersList = ({ match }) => {
const classes = useStyles()
const [status, setStatus] = React.useState('idle')
const [statusMessage, setStatusMessage] = React.useState('')
const [page, setPage] = React.useState(0)
const [usersData, setUsersData] = useState({ users: [], count: 0 })
const [rowsPerPage, setRowsPerPage] = React.useState(10)
const [order, setOrder] = React.useState({
order: 'desc',
orderBy: 'createdAt',
})
const { users, count } = usersData
// const rowsExpected = count ? Math.max(count - rowsPerPage * page, 0) : rowsPerPage
const tableColumns = [
{
id: 'avatarUrl',
label: '',
isSortable: false,
},
{
id: 'firstName',
label: 'First Name',
isSortable: true,
},
{
id: 'lastName',
label: 'Last Name',
isSortable: true,
},
{
id: 'username',
label: 'Username',
isSortable: true,
},
{
id: 'email',
label: 'Email',
isSortable: true,
},
{
id: 'createdAt',
label: 'Created',
isSortable: true,
},
]
// Request users
useEffect(() => {
async function fetchUsers() {
setStatus('loading')
try {
const userDataRes = await api.users.getList({
limit: rowsPerPage,
offset: page * rowsPerPage,
order,
})
// Make some artificial delay
await new Promise(resolve => {
setTimeout(() => resolve(true), 300)
})
setStatus('idle')
setUsersData(userDataRes)
} catch (err) {
console.log('error', err.message)
setStatus('error')
setStatusMessage(err.message)
}
}
fetchUsers()
}, [order, page, rowsPerPage, usersData.count])
const handleChangePage = (event, newPage) => {
setPage(newPage)
}
const handleChangeRowsPerPage = event => {
setRowsPerPage(parseInt(event.target.value, 10))
setPage(0)
}
const handelChangeOrder = (event, columnId) => {
setOrder({
// If the sorting column has changed
order: columnId !== order.orderBy || order.order === 'desc' ? 'asc' : 'desc',
orderBy: columnId,
})
}
return (
<BasePageContainer>
<BasePageToolbar
title={'Users Adminstration'}
actionsComponent={UsersListAction}
></BasePageToolbar>
<Grid container spacing={3}>
<Grid item xs={12}>
{status === 'error' && (
<Alert severity="error">
<AlertTitle>Error</AlertTitle>
{statusMessage}
</Alert>
)}
{status !== 'error' && (
<TableContainer component={Paper}>
<Table className={classes.table} aria-label="custom pagination table">
<TableHead>
<TableRow>
{tableColumns.map(column => (
<TableCell key={column.id}>
{/* Sortable */}
{column.isSortable && (
<TableSortLabel
active={order.orderBy === column.id}
direction={order.orderBy === column.id ? order.order : 'asc'}
onClick={event => handelChangeOrder(event, column.id)}
>
{column.label}
</TableSortLabel>
)}
{/* Non-sortable */}
{!column.isSortable && column.label}
</TableCell>
))}
<TableCell>Actions</TableCell>
</TableRow>
</TableHead>
<TableBody>
<UsersListTableItems
users={status === 'loading' ? [] : users}
rowsPerPage={rowsPerPage}
/>
</TableBody>
<TableFooter>
<TableRow>
<BaseTablePagination
page={page}
rowsPerPage={rowsPerPage}
count={count}
order={order}
onChangePage={handleChangePage}
onChangeRowsPerPage={handleChangeRowsPerPage}
/>
</TableRow>
</TableFooter>
</Table>
</TableContainer>
)}
</Grid>
</Grid>
</BasePageContainer>
)
}
const useStyles = makeStyles(theme => ({
root: {
flexShrink: 0,
marginLeft: theme.spacing(2.5),
},
}))
UsersList.propTypes = {}
export default UsersList
|
JavaScript
| 0.000775 |
@@ -2416,25 +2416,8 @@
Page
-, usersData.count
%5D)%0A%0A
|
cc5295da298371bd7d5e1f2a0ad760d83f56655d
|
Fix string conversion problems
|
libraries/Native/JavaScript.js
|
libraries/Native/JavaScript.js
|
Elm.Native.JavaScript = {};
Elm.Native.JavaScript.make = function(elm) {
elm.Native = elm.Native || {};
elm.Native.JavaScript = elm.Native.JavaScript || {};
if (elm.Native.JavaScript.values) return elm.Native.JavaScript.values;
var List = Elm.Native.List.make(elm);
var Render = ElmRuntime.use(ElmRuntime.Render.Element);
function fromJS(v) {
var type = typeof v;
if (type === 'number' ) return v;
if (type === 'boolean') return v;
if (type === 'string' ) return List.fromArray(v);
if (v instanceof Array) {
var arr = [];
var len = v.length;
for (var i = 0; i < len; ++i) {
var x = fromJS(v[i]);
if (x !== null) arr.push(x);
}
return List.fromArray(arr);
}
if (type === 'object') {
var rec = { _:{} };
for (var f in v) {
var x = fromJS(v[f]);
if (x !== null) rec[f] = x;
}
return rec;
}
return null;
}
function toJS(v) {
var type = typeof v;
if (type === 'number' || type === 'boolean') return v;
if (type === 'object' && '_' in v) {
var obj = {};
for (var k in v) {
var x = toJS(v[k]);
if (x !== null) obj[k] = x;
}
return obj;
}
if (type === 'object' && (v.ctor === '::' || v.ctor === '[]')) {
var array = List.toArray(v);
if (typeof array[0] === 'string') {
array = array.join('');
} else {
for (var i = array.length; i--; ) {
array[i] = toJS(array[i]);
}
}
return array;
}
return null;
}
function fromRecord(r) {
if (typeof r === 'object' && '_' in r) {
return toJS(r);
}
throw new Error("'fromRecord' must be called on a record.");
}
function id(n) { return n; }
function toElement(w,h,domNode) {
return A3( newElement, w, h, {
ctor: 'Custom',
type: 'DomNode',
render: function(node) { return node; },
update: function(node,oldNode,newNode) {
if (node === newNode) return;
node.parentNode.replaceChild(newNode, node);
},
model: domNode
});
}
function fromElement(element) {
return Render.render(element);
}
return elm.Native.JavaScript.values = {
toInt : function(n) { return n|0; },
toFloat : function(n) { return +n; },
toBool : id,
toString : id,
toList : List.fromArray,
fromString : id,
fromList : List.toArray,
fromInt : id,
fromFloat : id,
fromBool : id,
toElement : toElement,
fromElement : fromElement,
toRecord : fromJS,
fromRecord : fromRecord
};
};
|
JavaScript
| 0.000088 |
@@ -498,25 +498,9 @@
urn
-List.fromArray(v)
+v
;%0A
@@ -1433,115 +1433,8 @@
v);%0A
- if (typeof array%5B0%5D === 'string') %7B%0A array = array.join('');%0A %7D else %7B%0A
@@ -1489,20 +1489,16 @@
-
array%5Bi%5D
@@ -1520,24 +1520,8 @@
%5D);%0A
- %7D%0A
|
e1bf3cb629c9f36c7c25d05f0fdb562d4c50aeeb
|
rename argument passed into removeBodyClass in NameController
|
app/assets/javascripts/app/controllers/NameController.js
|
app/assets/javascripts/app/controllers/NameController.js
|
function NameController($window, $timeout, ShareBandNameService, FormDataService, SocialMediaShareService) {
var ctrl = this;
ctrl.loadingPage = true;
ctrl.bandName = ShareBandNameService;
ctrl.removeBodyClass = (className) => {
let body = angular.element(document.querySelector('body'));
body.removeClass(className);
}
ctrl.hideLoadingPage = () => {
ctrl.removeBodyClass('bg-loading');
ctrl.loadingPage = false;
}
ctrl.resetBandName = function() {
ctrl.bandName.name = '';
ctrl.bandName.genre_id = '';
FormDataService.formData = {};
}
ctrl.twtrBandName = () => {
return ctrl.bandName.name.replace(/\s/g, '+');
}
ctrl.fbFeed = SocialMediaShareService.fbFeed;
ctrl.twtrTweet = SocialMediaShareService.twtrTweet;
SocialMediaShareService.fbSDK;
$timeout(ctrl.hideLoadingPage, 3000);
}
angular
.module('app')
.controller('NameController', NameController);
|
JavaScript
| 0.000001 |
@@ -400,16 +400,22 @@
ass('bg-
+color-
loading'
|
74bd3a1a6cb9a8e36e80d61aba984f6a231cf3fd
|
Update retrieveRegistrationStatus.js
|
app/cloud/server/functions/retrieveRegistrationStatus.js
|
app/cloud/server/functions/retrieveRegistrationStatus.js
|
import { settings } from '../../../settings';
import { Users } from '../../../models';
export function retrieveRegistrationStatus() {
const info = {
connectToCloud: settings.get('Register_Server'),
workspaceRegistered: (settings.get('Cloud_Workspace_Client_Id')) ? true : false,
workspaceId: settings.get('Cloud_Workspace_Id'),
uniqueId: settings.get('uniqueID'),
token: '',
email: '',
};
const firstUser = Users.getOldest({ emails: 1 });
info.email = firstUser && firstUser.emails[0].address;
if (settings.get('Organization_Email')) {
info.email = settings.get('Organization_Email');
}
return info;
}
|
JavaScript
| 0.000001 |
@@ -475,16 +475,36 @@
tUser &&
+ firstUser.emails &&
firstUs
|
84af768ebed6561e47cd4aded0f3925764bbbd2c
|
add demo-index.html
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var plumber = require('gulp-plumber');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var header = require('gulp-header');
var imagemin = require('gulp-imagemin');
var zip = require('gulp-zip');
// var debug = require('gulp-debug');
var runSequence = require('gulp-sequence');
var replace = require('gulp-replace');
var distPath = "dist/crysyan/";
var version = "0.0.9";
var widgetsLoad = [];
(function () {
// var widgetConfig= require('js/config.js');
// var widgetBasePath = "js/widget/";
// var widgets = widgetConfig.CrysyanWidgetConfig.widgets;
// for (var attr in widgets) {
// if (widgets[attr].hasOwnProperty("jsFile") && typeof widgets[attr].jsFile === "string" && widgets[attr].jsFile !== "") {
// widgetsLoad.push(widgetBasePath + widgets[attr].jsFile);
// }
// }
widgetPath="js/widget/";
// widgetsLoad = [widgetPath+"*.js"]; or
widgetsLoad = [
widgetPath+"cursor.js",
widgetPath+"pencil.js",
widgetPath+"eraser.js",
widgetPath+"image.js",
widgetPath+"undo.js",
widgetPath+"into-go.js",
widgetPath+"clear.js"];
})();
gulp.task('clean-all', function () {
return gulp.src([distPath + "*", distPath, "release/", "release/*"])
.pipe(clean())
.pipe(plumber());
});
gulp.task('designer-minify', function () {
return gulp.src(["js/crysyan-designer.js"])
.pipe(uglify())
.pipe(plumber())
.pipe(rename({suffix: '-min'}))
.pipe(gulp.dest(distPath));
});
gulp.task('widgets-concat', function () {
return gulp.src(widgetsLoad)
.pipe(concat("widgets.js"))
.pipe(plumber())
.pipe(gulp.dest(distPath + "js/"));
});
gulp.task('core-concat', function () {
return gulp.src(["js/util.js", "js/config.js", "js/widget.js", "js/canvas.js", "js/view.js"])
.pipe(concat("core.js"))
.pipe(plumber())
.pipe(gulp.dest(distPath + "js/"));
});
gulp.task('core-header', function () {
return gulp.src(["js/crysyan.js"])
.pipe(header('var CrysyanFlag=false;'))
.pipe(plumber())
.pipe(gulp.dest(distPath + "js/"));
});
gulp.task('core-widgets-concat-minify', ["widgets-concat", "core-concat",'core-header'], function () {
return gulp.src([distPath + "js/core.js", distPath + "js/widgets.js",distPath + "js/crysyan.js"])
.pipe(concat("crysyan-core-min.js"))
.pipe(plumber())
.pipe(gulp.dest(distPath))
.pipe(uglify())
.pipe(plumber())
.pipe(gulp.dest(distPath));
});
gulp.task('imagemin', function () {
return gulp.src(["img/*"])
.pipe(imagemin())
.pipe(plumber())
.pipe(gulp.dest(distPath + "img/"));
});
gulp.task('html-replace-move', function () {
return gulp.src(["html/*"])
.pipe(replace('src="../js/crysyan.js"', 'src="../crysyan-core-min.js"'))
.pipe(plumber())
.pipe(gulp.dest(distPath + "html/"));
});
gulp.task('guidance-move', function () {
return gulp.src(["guidance.md"])
.pipe(gulp.dest(distPath));
});
gulp.task('building', ['clean-all'], function (cb) {
runSequence(
["designer-minify",
"core-widgets-concat-minify",
"imagemin",
"html-replace-move","guidance-move"], cb);
});
gulp.task('after-building-clean', ['building'], function () {
return gulp.src(['dist/js'])
.pipe(clean())
.pipe(plumber());
});
gulp.task('build', ['building','after-building-clean']);
gulp.task('publish', ['build'], function () {
return gulp.src([distPath+'*', distPath+'**/*', "!"+distPath+'js'])
.pipe(plumber())
.pipe(zip('crysyan-' + version + '.zip'))
.pipe(gulp.dest('release'));
});
gulp.task('default', ["build"]);
|
JavaScript
| 0.000001 |
@@ -3082,32 +3082,298 @@
%22html/%22));%0A%7D);%0A%0A
+gulp.task('demo-replace-move', function () %7B%0A return gulp.src(%5B%22index.html%22%5D)%0A .pipe(replace('src=%22../js/crysyan.js%22', 'src=%22crysyan-core-min.js%22'))%0A .pipe(plumber())%0A .pipe(rename(%7Bprefix: 'demo-'%7D))%0A .pipe(gulp.dest(distPath));%0A%7D);%0A%0A
gulp.task('guida
@@ -3389,32 +3389,32 @@
, function () %7B%0A
-
return gulp.
@@ -3687,16 +3687,36 @@
ce-move%22
+,%22demo-replace-move%22
%5D, cb);%0A
@@ -3807,17 +3807,42 @@
rc(%5B
-'
+distPath+'js',distPath+%22
dist/js
-'
+/*%22
%5D)%0A
|
0c5273a54e32968ba4a859a8c9f26bee3d047b70
|
Fix condition, load url_path
|
geotrek/core/static/core/geotrek.forms.snap.js
|
geotrek/core/static/core/geotrek.forms.snap.js
|
L.FieldStore.LineSnapStore = L.FieldStore.extend({
_deserialize: function (value) {
console.debug("Deserialize " + value);
value = JSON.parse(value);
value = value['geom'];
return L.FieldStore.prototype._deserialize.call(this, value);
},
_serialize: function (layer) {
var str = L.FieldStore.prototype._serialize.call(this, layer);
var edited = layer.getLayers();
if (edited.length === 0)
return '';
layer = edited[0];
// Store snaplist
var n = layer.getLatLngs().length,
snaplist = new Array(n);
if (layer.editing._poly.snapediting) {
for (var i=0; i<n; i++) {
var marker = layer.editing._poly.snapediting._markers[i];
if (marker.snap && marker.snap.properties && marker.snap.properties.pk)
snaplist[i] = marker.snap.properties.pk;
}
}
var serialized = {geom: str,
snap: snaplist};
console.debug("Serialized to " + JSON.stringify(serialized));
return JSON.stringify(serialized);
}
});
MapEntity.GeometryField.GeometryFieldPathMixin = {
/*
* Load the path layer in addition to another layer should be reusable.
* (At least for the fix to propagate events)
*/
buildPathsLayer: function (objectsLayer) {
var url_path = window.SETTINGS.urls.path_layer
var pathsLayer = MapEntity.pathsLayer({style: {clickable: true}, no_draft: objectsLayer.modelname != 'path'});
if (objectsLayer.modelname != 'path'){
pathsLayer.load(url_path + '?no_draft=true', true);
}
else {
pathsLayer.load(url_path, true);
}
this._map.addLayer(pathsLayer);
// Propagate mouseover events, from the Path layer (on top)
// to the objects layer (below).
// This fixes bug #680
(function (){
// Reference to the object layer hovered before the path is hovered
var overlapped = null;
objectsLayer.on('mouseover', function (e) {
overlapped = e.layer;
});
// On path hover, propagate events to overlapped layer
pathsLayer.on('mouseover mouseout', function (e) {
if (overlapped !== null) {
e.layer = overlapped;
e.target = overlapped;
overlapped.fire(e.type, e);
}
if (e.type == 'mouseout') {
overlapped = null;
}
});
})();
return pathsLayer;
},
};
MapEntity.GeometryField.GeometryFieldSnap = MapEntity.GeometryField.extend({
options: {
field_store_class: L.FieldStore.LineSnapStore
},
includes: MapEntity.GeometryField.GeometryFieldPathMixin,
initialize: function (options) {
MapEntity.GeometryField.prototype.initialize.call(this, options);
L.Handler.MarkerSnap.mergeOptions({
snapDistance: window.SETTINGS.map.snap_distance
});
this._geometry = null;
this._guidesLayers = [];
this._pathsLayer = null;
this._objectsLayer = null;
},
buildObjectsLayer: function () {
this._objectsLayer = MapEntity.GeometryField.prototype.buildObjectsLayer(arguments);
this._guidesLayers.push(this._objectsLayer);
if (this.getModelName() != 'path') {
// If current model is not path, we should add the path layer
// as a guide layer.
this._pathsLayer = this.buildPathsLayer(this._objectsLayer);
this._guidesLayers.push(this._pathsLayer);
}
else {
// It should like paths everywhere in the application
var style = window.SETTINGS.map.styles.path;
this._objectsLayer.options.style = style;
this._objectsLayer.options.styles.default = style;
}
if (this._geometry) {
// null if not loaded (e.g. creation form)
this._initSnap(this._geometry);
}
return this._objectsLayer;
},
guidesLayers: function () {
return this._guidesLayers;
},
_initSnap: function (layer) {
var handlerClass = null;
if (layer instanceof L.Marker) {
handlerClass = L.Handler.MarkerSnap;
}
else if (layer instanceof L.Polyline) {
handlerClass = L.Handler.PolylineSnap;
}
else {
console.warn('Unsupported layer type for snap.');
return;
}
layer.editing = new handlerClass(this._map, layer);
for (var i=0, n=this._guidesLayers.length; i<n; i++) {
layer.editing.addGuideLayer(this._guidesLayers[i]);
}
// Since snapping happens only once the geometry is created.
// We are out of Leaflet.Draw.
layer.on('move edit', function (e) {
this.store.save(this.drawnItems);
}, this);
// On edition, show start and end markers as snapped
this._map.on('draw:editstart', function (e) {
setTimeout(function () {
if (!layer.editing) {
console.warn('Layer has no snap editing');
return; // should never happen ;)
}
var markers = layer.editing._markers;
var first = markers[0],
last = markers[markers.length - 1];
first.fire('move');
last.fire('move');
}, 0);
});
},
onCreated: function (e) {
MapEntity.GeometryField.prototype.onCreated.call(this, e);
this._initSnap(e.layer);
},
load: function () {
this._geometry = MapEntity.GeometryField.prototype.load.call(this);
return this._geometry;
}
});
|
JavaScript
| 0.000001 |
@@ -1606,17 +1606,16 @@
'path')
-%7B
%0A
@@ -1619,32 +1619,16 @@
-pathsLayer.load(
url_path
@@ -1629,16 +1629,17 @@
l_path +
+=
'?no_dr
@@ -1651,46 +1651,10 @@
rue'
-, true)
;%0A
- %7D%0A else %7B%0A
@@ -1689,26 +1689,16 @@
, true);
-%0A %7D
%0A%0A
|
b1d9be368b688d9dfa7f2e02c44f421fc70347a6
|
Remove strip-debug task. Manually removing console.logs. Resolves #62.
|
gulpfile.js
|
gulpfile.js
|
// Include gulp
var gulp = require('gulp');
// Include plugins
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var stripDebug = require('gulp-strip-debug');
var sass = require('gulp-sass');
var optipng = require('gulp-optipng');
var options = ['-o2'];
/**
* TASK: optipng
* USES: gulp-optipng
* DESCRIPTION: Optimize all .png files
*/
gulp.task('optipng', function() {
return gulp.src('img/logos/*.png')
.pipe(optipng(options))
.pipe(gulp.dest('img/optimized/'));
});
/**
* TASK: scripts
* USES: gulp-concat, gulp-rename, gulp-uglify
* DESCRIPTION: Concats all js files, compresses, and renames with .min
*/
gulp.task('scripts', function(){
return gulp.src([
'assets/js/jquery.min.js',
'assets/js/bootstrap.min.js',
'assets/js/lunr.min.js',
'assets/js/set-query.js',
'assets/js/main.js',
'assets/js/modalizer.js',
'assets/js/search.js',
'assets/js/results.js'
])
.pipe(concat('all.js'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('assets-dist/js/'));
});
/**
* TASK: sass
* USES: gulp-concat, gulp-sass, gulp-rename
* DESCRIPTION: Concats all scss files, compresses, and renames with .min
*/
var sassOptions = {
errLogToConsole: true,
outputStyle: 'compressed'
};
gulp.task('sass', function() {
return gulp.src([
'assets/scss/typography.scss',
'assets/scss/variables.scss',
'assets/scss/mixins.scss',
'assets/scss/bootstrap-overrides.scss',
'assets/scss/base.scss',
'assets/scss/layouts.scss',
'assets/scss/includes.scss'
])
.pipe(concat('all.scss'))
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('dist/css'))
});
/**
* TASK: stripdebug
* USES: gulp-strip-debug
* DESCRIPTION: Removes all console.log and debugging messages from js files
*/
gulp.task('stripdebug', function() {
return gulp.src('assets/js/*.js')
.pipe(stripDebug())
.pipe(gulp.dest('dist/js/'));
});
// Default task
gulp.task('default', ['scripts', 'sass']);
|
JavaScript
| 0 |
@@ -1736,269 +1736,8 @@
;%0A%0A%0A
-/**%0A *%09TASK: stripdebug%0A *%09USES: gulp-strip-debug%0A * DESCRIPTION: Removes all console.log and debugging messages from js files%0A */%0Agulp.task('stripdebug', function() %7B%0A%09return gulp.src('assets/js/*.js')%0A%09.pipe(stripDebug())%0A%09.pipe(gulp.dest('dist/js/'));%0A%7D);%0A%0A
// D
|
3b418bf82ca093d014f6520dd3dbe04ca6d71b5b
|
Fix requirejs configuration so dagre-d3 is not minified.
|
alien4cloud-ui/src/main/build/config/requirejs.js
|
alien4cloud-ui/src/main/build/config/requirejs.js
|
'use strict';
// Require js optimizer configuration
module.exports = function (grunt) {
var config = {
dist: {
options: {
appDir: '<%= yeoman.app %>',
dir: '<%= yeoman.dist %>',
mainConfigFile:'./src/main/webapp/scripts/require.config.js',
modules:[
{
name:'a4c-bootstrap',
exclude: [
'lodash-base',
'jquery',
'angular',
'angular-cookies',
'angular-bootstrap',
'angular-resource',
'angular-sanitize',
'angular-ui-router',
'angular-translate-base',
'angular-translate',
'angular-animate',
'angular-xeditable',
'angular-ui-select',
'angular-tree-control',
'ng-table',
'toaster',
'hopscotch',
'angular-file-upload',
'button-confirm',
'angular-ui-ace',
'ace',
'sockjs',
'stomp',
'd3',
'd3-tip',
'd3-pie'
// 'dagre-d3'
]//,
// excludeShallow: [
// 'scripts/admin/admin'
// ],
}
],
baseUrl: '.',
keepBuildDir: true,
optimize: 'uglify',
// optimize: 'none',
optimizeCss: 'none',
optimizeAllPluginResources: false,
fileExclusionRegExp: /^(bower_components|api-doc|data|images|js-lib|META-INF|styles|views)$/,
removeCombined: true,
findNestedDependencies: true,
normalizeDirDefines: 'all',
inlineText: true,
skipPragmas: true,
done: function (done, output) {
var analysis = require('rjs-build-analysis');
var tree = analysis.parse(output);
var duplicates = analysis.duplicates(tree);
if (duplicates.length > 0) {
grunt.log.subhead('Duplicates found in requirejs build:');
grunt.log.warn(duplicates);
return done(new Error('r.js built duplicate modules, please check the excludes option.'));
} else {
var relative = [];
var bundles = tree.bundles || [];
bundles.forEach(function (bundle) {
bundle.children.forEach(function (child) {
if (child.match(/\.\//)) {
relative.push(child + ' is relative to ' + bundle.parent);
}
});
});
if (relative.length) {
grunt.log.subhead('Relative modules found in requirejs build:');
grunt.log.warn(relative);
return done(new Error('r.js build contains relative modules, duplicates probably exist'));
}
}
done();
}
}
}
};
return config;
};
|
JavaScript
| 0 |
@@ -1135,16 +1135,17 @@
'd3-pie'
+,
%0A
@@ -1150,19 +1150,16 @@
- //
'dagre-
|
48347141c93695483670726e5c8d49245d9285ea
|
添加app中的watch命令:gulp watch_self 只监听app中的scss变化
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp'),
sh = require('shelljs'),
del = require('del'),
sass = require('gulp-sass'),
minifyCss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
gulpif = require('gulp-if'),
useref = require('gulp-useref'),
connect = require('gulp-connect');
gulp.task('default', ['copy']);
gulp.task('copy', ['useref'], function() {
return gulp.src([
'app/img/**',
'app/lib/ionic/fonts/**',
'app/lib/ionic/js/ionic.bundle.js',
'app/templates/**'
], {base: 'app'})
.pipe(gulp.dest('www'));
});
gulp.task('copy:dev', ['useref:dev'], function() {
return gulp.src([
'app/{img,lib,templates}/**'
], {base: 'app'})
.pipe(gulp.dest('www'));
});
gulp.task('useref', ['clean', 'sass'], function() {
var assets = useref.assets();
return gulp.src([
'app/*.html',
])
.pipe(assets)
.pipe(gulpif('*.js', uglify({mangle: false})))
.pipe(gulpif('*.css', minifyCss()))
.pipe(assets.restore())
.pipe(useref())
.pipe(gulp.dest('www'));
});
gulp.task('useref:dev', ['clean', 'sass'], function() {
var assets = useref.assets();
return gulp.src([
'app/*.html'
])
.pipe(assets)
.pipe(assets.restore())
.pipe(useref())
.pipe(gulp.dest('www'));
});
gulp.task('sass', ['clean'], function() {
return gulp.src([
'scss/ionic.app.scss',
'app/scss/**/*.scss'
])
.pipe(sass())
.pipe(gulp.dest('.tmp/css'));
});
gulp.task('clean', function(done) {
del(['www', '.tmp'], done);
});
gulp.task('build', ['copy'], function() {
sh.exec('cordova build android');
});
gulp.task('serve', function() {
connect.server({
root: 'www',
port: 3000
});
});
gulp.task('watch', ['copy:dev'], function() {
return gulp.watch([
'app/{img,js,scss,templates}/**/*',
'app/index.html'
], ['copy:dev']);
});
|
JavaScript
| 0 |
@@ -1446,24 +1446,56 @@
ipe(sass())%0A
+ .pipe(gulp.dest('app/css'))%0A
.pipe(gu
@@ -1577,16 +1577,27 @@
, '.tmp'
+, 'app/css'
%5D, done)
@@ -1928,12 +1928,114 @@
:dev'%5D);%0A%7D);
+%0A%0Agulp.task('watch_self', %5B'sass'%5D, function() %7B%0A return gulp.watch(%5B'app/scss/**/*'%5D, %5B'sass'%5D);%0A%7D);
|
e1df03f9deaa93560ad7da944d7376d1a427353e
|
add linux as target platform for builds
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var del = require('del');
var runSequence = require('run-sequence');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var minifyCss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var typescript = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
var modRewrite = require('connect-modrewrite');
var electronConnect = require('electron-connect');
var process = require('process');
var packager = require('electron-packager');
var archiver = require('archiver');
var fs = require('fs');
var path = require('path');
var shell = require('gulp-shell')
var pkg = require('./package.json');
var exec = require('child_process').exec;
var argv = require('yargs').argv;
var embedTemplates = require('gulp-angular-embed-templates');
var paths = {
'build': 'dist/',
'release': 'release/',
'cache': 'cache/',
'lib': 'node_modules/',
'bootstrap': 'node_modules/bootstrap-sass/assets/',
'mdi': 'node_modules/mdi/'
};
gulp.task('test', function (cb) {
var cmd = 'node_modules/.bin/karma start karma.conf.js --single-run';
if (argv.ci!=undefined&&argv.ci=='true')
var cmd = 'export CHROME_BIN=/usr/bin/chromium-browser; xvfb-run karma start karma.conf.js --single-run';
exec(cmd, function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
})
const tscConfig = require('./tsconfig.json');
var electronServer = electronConnect.server.create({path: paths.build});
// compile sass and concatenate to single css file in build dir
gulp.task('sass', function() {
return gulp.src('src/scss/app.scss')
.pipe(sass({includePaths: [
paths.bootstrap + 'stylesheets/',
paths.mdi + 'scss/'
], precision: 8}))
.pipe(concat(pkg.name + '.css'))
.pipe(gulp.dest(paths.build + '/css'));
});
gulp.task('copy-fonts', function() {
return gulp.src([
paths.mdi + '/fonts/**/*',
paths.bootstrap + '/fonts/**/*'
])
.pipe(gulp.dest(paths.build + '/fonts'));
});
gulp.task('copy-html', function() {
return gulp.src('src/index.html')
.pipe(gulp.dest(paths.build));
});
gulp.task('copy-templates', function() {
return gulp.src('src/templates/**/*.html')
.pipe(gulp.dest(paths.build + '/templates'));
});
gulp.task('copy-img', function() {
return gulp.src('src/img/**/*')
.pipe(gulp.dest(paths.build + '/img'));
});
gulp.task('copy-config', function() {
return gulp.src('src/config/**/*.json')
.pipe(gulp.dest(paths.build + '/config'));
});
gulp.task('build', [
'sass',
'compile-ts',
'copy-html',
'copy-templates',
'copy-img',
'copy-fonts',
'copy-config',
'concat-deps',
'test-compile-ts'
]);
// clean
gulp.task('clean', function() {
return del([paths.build + '/**/*', paths.release + '/**/*']);
});
gulp.task('compile-ts', function () {
return gulp
.src('src/app/**/*.ts')
.pipe(embedTemplates({basePath: "src", sourceType:'ts'}))
//.pipe(sourcemaps.init())
.pipe(typescript(tscConfig.compilerOptions))
//.pipe(sourcemaps.write('dist/app/maps'))
.pipe(gulp.dest(paths.build + 'app'));
});
gulp.task('test-compile-ts', function () {
return gulp
.src('src/test/**/*.ts')
.pipe(typescript(tscConfig.compilerOptions))
.pipe(gulp.dest(paths.build + 'test'));
});
gulp.task('concat-deps', function() {
return gulp.src([
paths.lib + '/node-uuid/uuid.js',
paths.lib + '/angular2/bundles/angular2-polyfills.js',
paths.lib + '/systemjs/dist/system.src.js',
paths.lib + '/rxjs/bundles/Rx.js',
paths.lib + '/angular2/bundles/angular2.dev.js',
paths.lib + '/angular2/bundles/http.dev.js',
paths.lib + '/angular2/bundles/router.dev.js'
])
.pipe(concat(pkg.name + '-deps.js'))
.pipe(uglify())
.pipe(gulp.dest(paths.build + '/lib'));
});
function watch() {
gulp.watch('src/scss/**/*.scss', ['sass']);
gulp.watch('src/app/**/*.ts', ['compile-ts']);
gulp.watch('src/config/**/*.json', ['copy-config']);
gulp.watch('src/templates/**/*.html', ['copy-templates','compile-ts']);
gulp.watch('src/index.html', ['copy-html']);
gulp.watch('src/img/**/*', ['copy-img']);
gulp.watch('src/test/**/*ts', ['test-compile-ts']);
}
gulp.task('test-watch', ['build', 'prepare-package'], function() {
watch();
});
// runs the development server and sets up browser reloading
gulp.task('server', ['build', 'prepare-package'], function() {
electronServer.start();
gulp.watch('main.js', ['prepare-package'], electronServer.restart);
watch();
gulp.watch('dist/**/*', electronServer.reload);
});
// copy necessary files to dist in order for them to be included in package
// and remove dev dependencies from index.html
gulp.task('prepare-package', function() {
gulp.src('src/index.html')
.pipe(gulp.dest(paths.build));
return gulp.src(['main.js','package.json']).pipe(gulp.dest('dist'));
});
gulp.task('package-node-dependencies', function() {
gulp.src('node_modules/node-uuid/**/*' )
.pipe(gulp.dest('dist/node_modules/node-uuid'));
});
// builds an electron app package for different platforms
gulp.task('package', [], function() {
packager({
dir: paths.build,
name: pkg.name,
platform: ['win32', 'darwin'],
arch: 'all',
version: '0.36.7',
appBundleId: pkg.name,
appVersion: pkg.version,
buildVersion: pkg.version,
cache: paths.cache,
helperBundleId: pkg.name,
icon: 'dist/img/logo',
out: paths.release
}, function(err, appPath) {
if (err)
throw err;
var folderPaths = appPath.toString().split(',');
for (var i in folderPaths) {
var fileName = folderPaths[i].substring(folderPaths[i].lastIndexOf(path.sep) + 1);
var output = fs.createWriteStream(paths.release + '/' + fileName + '.zip');
var archive = archiver('zip');
archive.on('error', function(err) {
throw err;
});
archive.pipe(output);
archive.directory(folderPaths[i], fileName, { 'name': fileName });
archive.finalize();
}
});
});
gulp.task('default', function() {
runSequence('clean', 'build', 'prepare-package','package-node-dependencies','test', 'package');
});
|
JavaScript
| 0 |
@@ -5211,16 +5211,25 @@
'darwin'
+, 'linux'
%5D,%0A%09%09arc
|
c735e6d082c175cb53b94e1a15ea41326c6337c7
|
use callback to allow correct task dep definition
|
gulpfile.js
|
gulpfile.js
|
'use strict';
// generated on 2014-07-15 using generator-gulp-webapp 0.1.0
var gulp = require('gulp');
var critical = require('critical');
// load plugins
var $ = require('gulp-load-plugins')();
gulp.task('styles', function () {
return gulp.src('app/styles/main.css')
.pipe($.autoprefixer('last 1 version'))
.pipe(gulp.dest('.tmp/styles'))
.pipe($.size());
});
gulp.task('scripts', function () {
return gulp.src('app/scripts/**/*.js')
.pipe($.jshint())
.pipe($.jshint.reporter(require('jshint-stylish')))
.pipe($.size());
});
gulp.task('html', ['styles', 'scripts'], function () {
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');
var assets = $.useref.assets({searchPath: '{.tmp,app}'});
return gulp.src('app/*.html')
.pipe(assets)
.pipe(jsFilter)
.pipe($.uglify())
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe($.csso())
.pipe(cssFilter.restore())
.pipe(assets.restore())
.pipe($.useref())
.pipe(gulp.dest('dist'))
.pipe($.size());
});
gulp.task('images', function () {
return gulp.src('app/images/**/*')
.pipe($.cache($.imagemin({
optimizationLevel: 3,
progressive: true,
interlaced: true
})))
.pipe(gulp.dest('dist/images'))
.pipe($.size());
});
gulp.task('fonts', function () {
return gulp.src(require('main-bower-files')().concat('app/fonts/**/*'))
.pipe($.filter('**/*.{eot,svg,ttf,woff}'))
.pipe($.flatten())
.pipe(gulp.dest('dist/fonts'))
.pipe($.size());
});
gulp.task('extras', function () {
return gulp.src(['app/*.*', '!app/*.html'], { dot: true })
.pipe(gulp.dest('dist'));
});
gulp.task('clean', function () {
return gulp.src(['.tmp', 'dist'], { read: false }).pipe($.clean());
});
gulp.task('build', ['html', 'images', 'fonts', 'extras']);
gulp.task('default', ['clean'], function () {
gulp.start('build');
});
gulp.task('connect', function () {
var connect = require('connect'),
serveStatic = require('serve-static'),
serveIndex = require('serve-index');
var app = connect()
.use(require('connect-livereload')({ port: 35729 }))
.use(serveStatic('app'))
.use(serveStatic('.tmp'))
.use(serveIndex('app'));
require('http').createServer(app)
.listen(9000)
.on('listening', function () {
console.log('Started connect web server on http://localhost:9000');
});
});
gulp.task('serve', ['connect'], function () {
require('opn')('http://localhost:9000');
});
// Copy our site styles to a site.css file
// for async loading later
gulp.task('copystyles', function () {
return gulp.src(['dist/styles/main.css'])
.pipe($.rename({
basename: "site"
}))
.pipe(gulp.dest('dist/styles'));
});
// Generate & Inline Critical-path CSS
gulp.task('critical', ['build', 'copystyles'], function () {
// At this point, we have our
// production styles in main/styles.css
// As we're going to overwrite this with
// our critical-path CSS let's create a copy
// of our site-wide styles so we can async
// load them in later. We do this with
// 'copystyles' above
critical.generateInline({
base: 'dist/',
src: 'index.html',
styleTarget: 'styles/main.css',
htmlTarget: 'index.html',
width: 320,
height: 480,
minify: true
});
});
// inject bower components
gulp.task('wiredep', function () {
var wiredep = require('wiredep').stream;
gulp.src('app/*.html')
.pipe(wiredep({
directory: 'app/bower_components'
}))
.pipe(gulp.dest('app'));
});
gulp.task('watch', ['connect', 'serve'], function () {
var server = $.livereload();
// watch for changes
gulp.watch([
'app/*.html',
'.tmp/styles/**/*.css',
'app/scripts/**/*.js',
'app/images/**/*'
]).on('change', function (file) {
server.changed(file.path);
});
gulp.watch('app/styles/**/*.css', ['styles']);
gulp.watch('app/scripts/**/*.js', ['scripts']);
gulp.watch('app/images/**/*', ['images']);
gulp.watch('bower.json', ['wiredep']);
});
|
JavaScript
| 0.000237 |
@@ -3052,24 +3052,26 @@
, function (
+cb
) %7B%0A%0A //
@@ -3570,24 +3570,27 @@
: true%0A %7D
+,cb
);%0A%7D);%0A%0A%0A//
|
61e93434174cf3a203a2367a2116d426c2cee5a1
|
Fix page title
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var opts = {
paths: ['node_modules/lucify-commons'],
publishFromFolder: 'dist',
assetContext: process.env.MINARD ? '' : 'embed/the-flow-towards-europe-updating/'
};
var builder = require('lucify-component-builder');
builder(gulp, opts);
|
JavaScript
| 0.000003 |
@@ -107,16 +107,80 @@
'dist',%0A
+ pageDef: %7B%0A title: 'The Flow Towards Europe - Lucify'%0A %7D,%0A
assetC
|
073c345e8ed1ba0d09f33acd8b7d84005c0902e8
|
Change gulpfile dev dependencies to only be required in server mode
|
gulpfile.js
|
gulpfile.js
|
// inspired by https://gist.github.com/dmitruksergey/8441752
var gulp = require('gulp'),
jade = require('gulp-jade'),
sass = require('gulp-sass'),
gulpif = require('gulp-if'),
autoprefixer = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css'),
imagemin = require('gulp-imagemin'),
browsersync = require('browser-sync').create(),
del = require('del'),
runSequence = require('run-sequence'),
nodemon = require('gulp-nodemon'),
ghPages = require('gulp-gh-pages'),
replace = require('gulp-replace');
var isDev = false;
var staticMode = false;
var output_path = 'resources/public';
var deployed_path = 'deployed';
var dev_path = {
sass: ['assets/stylesheets/*.scss', '!assets/stylesheets/_*.scss'],
jadedev: ['assets/jade/**/*.jade', '!assets/jade/_*.jade'],
jade: ['assets/jade/**/*.jade', '!assets/jade/_*.jade', '!assets/jade/layout/*', '!assets/jade/mixins/*'],
js: ['assets/javascripts/**/*.js'],
images: ['assets/images/**/*', '!assets/images/dev-*'],
favicons: ['assets/icons/favicon.*'],
fonts: ['assets/stylesheets/fonts/*','node_modules/font-awesome/fonts/fontawesome-webfont.*'],
port: 7777
};
var build_path = {
css: output_path + '/stylesheets/',
html: output_path + '/',
js: output_path + '/javascripts/',
images: output_path + '/images',
fonts: output_path + '/fonts/',
library: output_path + '/library/'
};
gulp.task('jade', function () {
var jadeSrc = isDev ? dev_path.jadedev : dev_path.jade;
return gulp.src(jadeSrc)
.pipe(jade({
pretty: true,
locals: {
"javascriptsBase": "javascripts",
"stylesheetsBase": "stylesheets",
"imagesBase": "images",
"initData": "",
"applicationName": "Stonecutter",
"staticMode": staticMode
}
}))
.on('error', function(err) {
console.log(err);
this.emit('end');
})
.pipe(gulpif(staticMode, replace(/>!/g, '>')))
.pipe(gulp.dest(build_path.html))
.pipe(browsersync.stream());
});
gulp.task('sass', function () {
return gulp.src(dev_path.sass)
.pipe(sass({style: 'expanded', errLogToConsole: true}))
.on('error', function(err) {
console.log(err);
this.emit('end');
})
.pipe(autoprefixer())
.pipe(gulpif(!isDev, minifyCSS({noAdvanced: true}))) // minify if Prod
.pipe(gulp.dest(build_path.css))
.pipe(browsersync.stream());
});
gulp.task('js', function () {
return gulp.src(dev_path.js)
.on('error', function(err) {
console.log(err);
this.emit('end');
})
.pipe(gulp.dest(build_path.js))
.pipe(browsersync.stream());
});
gulp.task('images', function () {
return gulp.src(dev_path.images)
.pipe(imagemin({optimizationLevel: 3}))
.pipe(gulp.dest(build_path.images))
.pipe(browsersync.stream());
});
gulp.task('favicons', function () {
return gulp.src(dev_path.favicons)
.pipe(imagemin({optimizationLevel: 3}))
.pipe(gulp.dest(build_path.html))
.pipe(browsersync.stream());
});
gulp.task('fonts', function () {
return gulp.src(dev_path.fonts)
.pipe(gulp.dest(build_path.fonts));
});
gulp.task('browser-sync', ['nodemon'], function () {
return browsersync.init({
proxy: "localhost:7069", // local node app address
port: dev_path.port, // use *different* port than above
notify: true,
open: true,
ui: {
port: 7079
}
})
});
gulp.task('clean-build', function (cb) {
del([output_path], cb);
});
gulp.task('clean-deployed', function (cb) {
del([deployed_path], cb);
});
gulp.task('watch', function () {
gulp.watch('assets/jade/**/*.jade', browsersync.reload);
gulp.watch('assets/stylesheets/**/*.scss', ['sass']);
gulp.watch(dev_path.images, ['images']);
gulp.watch(dev_path.js, ['js']);
});
gulp.task('clj', function () {
gulp.watch('assets/jade/**/*.jade', browsersync.reload);
gulp.watch('assets/stylesheets/**/*.scss', ['sass']);
gulp.watch(dev_path.images, ['images']);
gulp.watch(dev_path.favicons, ['favicons']);
gulp.watch(dev_path.js, ['js']);
});
gulp.task('server', function (callback) {
isDev = true;
runSequence('clean-build',
['sass', 'js', 'images', 'favicons', 'fonts', 'browser-sync', 'watch'],
callback);
});
gulp.task('build', function (callback) {
runSequence('clean-build',
['jade', 'sass', 'js', 'images', 'favicons', 'fonts'],
callback);
});
gulp.task('ghpages', function() {
return gulp.src('./resources/public/**/*')
.pipe(ghPages({cacheDir:deployed_path}));
});
gulp.task('deploy', function (callback) {
staticMode = true;
runSequence(['build'],
['ghpages'],
['clean-deployed'], callback);
});
gulp.task('nodemon', function (cb) {
var called = false;
return nodemon({
script: 'static-server.js',
ignore: [
'gulpfile.js',
'node_modules/'
]
})
.on('start', function () {
if (!called) {
called = true;
cb();
}
})
.on('restart', function () {
setTimeout(function () {
browsersync.stream();
}, 1000);
});
});
gulp.task('default', function () {
gulp.start('server');
});
|
JavaScript
| 0 |
@@ -320,27 +320,19 @@
'),%0A
-browsersync
+del
= requi
@@ -339,55 +339,50 @@
re('
-browser-sync').create(),%0A del = require('del
+del'),%0A replace = require('gulp-replace
'),%0A
@@ -432,41 +432,42 @@
-nodemon = require('gulp-
+browsersync = '',%0A
nodemon
+ = '
'
-)
,%0A
@@ -482,71 +482,10 @@
s =
-require('gulp-gh-pages'),%0A replace = require('gulp-replace')
+''
;%0A%0Av
@@ -3366,24 +3366,143 @@
open: true,%0A
+ files: %5Bbuild_path.images,%0A dev_path.jade,%0A dev_path.favicons,%0A dev_path.js,%0A build_path.css%5D,%0A
ui: %7B%0A
@@ -4237,32 +4237,158 @@
isDev = true;%0A
+ browsersync = require('browser-sync').create();%0A nodemon = require('gulp-nodemon');%0A ghPages = require('gulp-gh-pages');%0A%0A
runSequence('c
|
119650c9f7c0553a64638dce7f3f4603edf96b88
|
Fix font path issue in gulpfile
|
gulpfile.js
|
gulpfile.js
|
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-minify-css gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
cache = require('gulp-cache'),
livereload = require('gulp-livereload'),
del = require('del');
xml2json = require('gulp-xml2json');
streamqueue = require('streamqueue');
cssnano = require('gulp-cssnano');
sourcemaps = require('gulp-sourcemaps');
// Copy
gulp.task('copyjson', function() {
return gulp.src('themes/barricade/static/src/particlesjs-config.json')
.pipe(gulp.dest('static/src/'))
.pipe(notify({ message: 'Copy json task complete' }));
});
gulp.task('copyfonts', function() {
return gulp.src('bower_components/font-awesome/fonts/*')
.pipe(gulp.dest('static/src/fonts'))
.pipe(notify({ message: 'Copy fonts task complete' }));
});
gulp.task('copy', function() {
gulp.start('copyjson', 'copyfonts');
});
// Styles
gulp.task('styles', function() {
return sass('themes/barricade/static/src/sass/styles.scss', { style: 'expanded' })
.pipe(autoprefixer('last 2 version'))
.pipe(gulp.dest('themes/barricade/static/src/css'))
.pipe(rename({ suffix: '.min' }))
.pipe(minifycss())
.pipe(sourcemaps.init())
.pipe(cssnano())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('static/src/css'))
.pipe(notify({ message: 'Styles task complete' }));
});
// Scripts
gulp.task('scriptconcat', function() {
return gulp.src([
'themes/barricade/static/src/js/custom/jquery.js',
'themes/barricade/static/src/js/custom/foundation.js',
'themes/barricade/static/src/js/custom/foundation.topbar.js',
'themes/barricade/static/src/js/custom/foundation.offcanvas.js',
'themes/barricade/static/src/js/custom/foundation.accordion.js',
'themes/barricade/static/src/js/custom/foundation.dropdown.js',
'themes/barricade/static/src/js/custom/foundation.slider.js',
'themes/barricade/static/src/js/custom/foundation.tooltip.js',
'themes/barricade/static/src/js/custom/particles.min.js',
'themes/barricade/static/src/js/custom/headroom.min.js',
'themes/barricade/static/src/js/custom/init.js'
])
.pipe(concat('main.js'))
.pipe(gulp.dest('themes/barricade/static/src/js'))
.pipe(notify({ message: 'Script concat task complete' }));
});
gulp.task('scriptminify', function() {
return gulp.src([
'themes/barricade/static/src/js/main.js',
'themes/barricade/static/src/js/analytics.js'
])
.pipe(jshint())
.pipe(jshint.reporter('default'))
// .pipe(concat())
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('static/src/js'))
.pipe(notify({ message: 'Script minify task complete' }));
});
gulp.task('scripts', function() {
gulp.start('scriptconcat', 'scriptminify');
});
// Images
gulp.task('images', function() {
return streamqueue({ objectMode: true },
gulp.src('themes/barricade/static/src/img/**/*{.jpg,.png,.gif}')
.pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true })))
.pipe(notify({ message: 'Images minifed' })),
gulp.src('themes/barricade/static/src/img/**/*')
.pipe(notify({ message: 'Images task complete' }))
.pipe(gulp.dest('static/src/img'))
)
});
// JSON
gulp.task('json', function () {
return gulp.src('static/index.xml')
.pipe(xml2json())
.pipe(rename({extname: '.json'}))
.pipe(gulp.dest('static/'))
.pipe(notify({ message: 'JSON updated' }));
});
// Clean
gulp.task('clean', function() {
return del('static/src/**/*');
});
// Default task
gulp.task('default', ['clean'], function() {
gulp.start('styles', 'scripts', 'images', 'json', 'copy');
});
// Watch
gulp.task('watch', function() {
// Watch .scss files
gulp.watch('themes/barricade/static/src/sass/**/*.scss', ['styles']);
// Watch .js files
gulp.watch('themes/barricade/static/src/js/custom/init.js', ['scripts']);
// Watch image files
gulp.watch('themes/barricade/static/img/src/**/*.{png,gif,jpg}', ['images']);
// Create LiveReload server
livereload.listen();
// Watch any files in static/, reload on change
gulp.watch(['static/**', 'static/src/**']).on('change', livereload.changed);
});
|
JavaScript
| 0.000001 |
@@ -1142,37 +1142,35 @@
rc('
-bower_components/font-awesome
+themes/barricade/static/src
/fon
|
45b954de5c9a87ebf808746947d21d703c046a76
|
Complete the functionality.
|
gulpfile.js
|
gulpfile.js
|
'use strict';
var gulp = require('gulp');
var _ = require('lodash');
var browserify = require('browserify');
var reactify = require('reactify');
var File = require('vinyl');
var source = require('vinyl-source-stream');
var path = require('path');
var buildPath = './build/';
var indexFileName = '__index.js';
var files = {
'react': 'react',
'test1': './test1.jsx',
'test2': './test2.jsx'
};
gulp.task('index', function () {
var indexContent = 'module.exports = {\n';
indexContent += _.map(files, function (file, alias) {
var p = file[0] === '.' ? path.resolve(file) : file;
return ' ' + alias + ': require(\'' + p + '\')';
}).join(',\n');
indexContent += '\n};';
var indexFile = new File({
contents: new Buffer(indexContent)
});
return indexFile
.pipe(source(indexFileName))
.pipe(gulp.dest(buildPath));
});
gulp.task('default', ['index'], function () {
var bd = browserify({
debug: true
});
bd.require(path.resolve(buildPath, indexFileName), {expose: '__index'});
bd.transform(reactify)
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest(buildPath));
});
|
JavaScript
| 0.000805 |
@@ -389,16 +389,50 @@
st2.jsx'
+,%0A 'test3': './folder1/test3.jsx'
%0A%7D;%0A%0Agul
@@ -563,16 +563,70 @@
lias) %7B%0A
+ // path.resolve expose the real path for the user%0A
var
@@ -629,16 +629,17 @@
var p =
+(
file%5B0%5D
@@ -649,24 +649,21 @@
'.'
+)
?
-path.resolve(
+('../' +
file
|
1acdcffadbe8ef9a4e9e19b3323fd9aa18660ba6
|
change path with pcss on pss
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp'),
postcss = require('gulp-postcss'),
rename = require('gulp-rename'),
ghPages = require('gulp-gh-pages'),
shell = require('gulp-shell')
require('gulp-release-tasks')(gulp);
var pkg = require('./package.json'),
slim_banner = [
'*',
'* Copyright (c) ' + new Date().getFullYear() + ' ' + pkg.author.name,
'* ' + pkg.name + ' - ' + pkg.description,
'* @version ' + pkg.version,
'* @link ' + pkg.homepage,
'* @license ' + pkg.license.type,
'*'
].join('\n');
gulp.task('jekyll', function() {
return gulp.src('*.js', {read: false})
.pipe(shell('jekyll build'))
});
gulp.task('deploy', ['pcss', 'jekyll'] ,function() {
return gulp.src('./_gh-pages/**/*')
.pipe(ghPages())
});
gulp.task('pcss', function() {
return gulp.src('./app/pcss/' + pkg.name + '.pcss')
.pipe(postcss([
require('postcss-import')(),
require('postcss-mixins')(),
require('postcss-for-variables')(),
require('postcss-for')(),
require('postcss-custom-properties')(),
require('postcss-nested')(),
require('postcss-calc')({ precision: 3 }),
require('postcss-banner')({banner: slim_banner})
]))
.pipe(rename({ extname: '.css' }))
.pipe(gulp.dest('./dist/css/'))
.pipe(gulp.dest('./docs/dist/css/'))
});
gulp.task('default',['pcss']);
|
JavaScript
| 0 |
@@ -812,17 +812,16 @@
.task('p
-c
ss', fun
@@ -858,17 +858,16 @@
'./app/p
-c
ss/' + p
@@ -879,17 +879,16 @@
me + '.p
-c
ss')%0A
|
6f973e9ddf8e2567284b41bf7692dbb7c213bece
|
Add single component build style. #2
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
//Build the JavaScript source.
var babelify = require("babelify"); //es6
var browserify = require('browserify'); //build the source
var source = require('vinyl-source-stream');
/****************************
JS BUILD
**********************/
/**
* Build a js file from a given source.
* @param {string} directory - directory name
* @param {object} options [description]
*/
function jsBuild(directory, options) {
options = options || {};
var entryFile = './' + directory + '/' + (options.entryFile || 'index.js');
var generatedFile = (options.generatedFile || "generated.js");
return browserify(({
entries: [entryFile],
extensions: ['.jsx'],
standalone: "focus.components." + directory.replace('/', '.')
}))
.transform(babelify)
.bundle()
//Pass desired output filename to vinyl-source-stream
.pipe(source(generatedFile))
.pipe(gulp.dest('./' + directory + '/example/js/'));
}
gulp.task('browserify', function() {
return browserify(({
entries: ['./index.js'],
extensions: ['.jsx'],
standalone: "focus.components"
}))
.transform(babelify)
.bundle()
//Pass desired output filename to vinyl-source-stream
.pipe(source('focus-components.js'))
.pipe(gulp.dest('./dist/'))
.pipe(gulp.dest('./example/js'));
});
gulp.task('componentify', function() {
//Each component build
var components = require('./package.json').components || [];
return components.forEach(function(component) {
return jsBuild(component.path, {
entryFile: "index.js",
generatedFile: component.name + ".js"
});
});
});
/*************************************
STYLE BUILD
*********************************/
//Build the style woth sass.
|
JavaScript
| 0.000002 |
@@ -1314,16 +1314,19 @@
onentify
+-js
', funct
@@ -1674,16 +1674,931 @@
******/%0A
+function styleBuild(directory, options)%7B%0A%09options = options %7C%7C %7B%7D;%0A%09var sass = require('gulp-sass');%0A%09var concat = require('gulp-concat');%0A%09var generatedFile = (options.generatedFile %7C%7C %22component.css%22);%0A return gulp.src(%5Bdirectory+'/**/*.scss'%5D)%0A%09%09.pipe(sass())%0A%09%09.pipe(concat(generatedFile))%0A%09%09.pipe(gulp.dest(directory + '/example/css/'));%0A%7D%0A%0Agulp.task('componentify-style', function() %7B%0A%09//Each component build%0A%09var components = require('./package.json').components %7C%7C %5B%5D;%0A%09return components.forEach(function(component) %7B%0A%09%09return styleBuild(component.path, %7B%0A%09%09%09generatedFile: component.name + %22.css%22%0A%09%09%7D);%0A%09%7D);%0A%7D);%0A%0Agulp.task('style', function() %7B%0A%09var sass = require('gulp-sass');%0A%09var concat = require('gulp-concat');%0A%09gulp.src(%5B'app/**/*.scss'%5D)%0A%09%09.pipe(sass())%0A%09%09.pipe(concat('custom.css'))%0A%09%09.pipe(gulp.dest('./example/css/'));%0A%7D);%0A%0A%0Agulp.task('componentify',%5B'componentify-js', 'componentify-style'%5D);%0A
%0A%0A%0A%0A%0A//B
|
ca45e372381a181d80982b97a0376cd5f18088fc
|
Change globbing pattern
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');
var paths = {
sass: ['./scss/**/*.scss']
};
gulp.task('default', ['sass']);
gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
.pipe(sass({
errLogToConsole: true
}))
.pipe(gulp.dest('./www/css/'))
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./www/css/'))
.on('end', done);
});
gulp.task('watch', function() {
gulp.watch(paths.sass, ['sass']);
});
gulp.task('install', ['git-check'], function() {
return bower.commands.install()
.on('log', function(data) {
gutil.log('bower', gutil.colors.cyan(data.id), data.message);
});
});
|
JavaScript
| 0 |
@@ -301,11 +301,13 @@
css/
-*
+%7B,
*/
+%7D
*.sc
|
833a4b28f74d1104b7a8fbc74a778222c3d49da6
|
upgrade to Flow v0.30.0
|
tcomb-validation/3.2.0+.js
|
tcomb-validation/3.2.0+.js
|
import type { $Type, Struct } from 'tcomb'
declare module 'tcomb-validation' {
declare type Path = Array<string | number>;
declare type ValidationErrorT = Struct<{
actual: any,
expected: $Type,
path: Path,
message: string
}>;
declare type ValidationResultT = Struct<{
errors: Array<ValidationErrorT>,
value: any
}>;
declare module.exports: {
ValidationError: ValidationErrorT,
ValidationResult: ValidationResultT,
validate(x: any, type: $Type, options?: Object): ValidationResultT
};
}
|
JavaScript
| 0 |
@@ -7,21 +7,21 @@
type %7B
-$
Type
+T
, Struct
@@ -195,21 +195,24 @@
pected:
-$
Type
+T%3C*%3E
,%0A pa
@@ -365,15 +365,160 @@
are
-module.
+type ValidationOptions = %7B%0A path?: Path,%0A context?: any%0A %7D;%0A%0A declare type ExtendedValidationOptions = Path %7C ValidationOptions;%0A%0A declare var
expo
@@ -635,13 +635,16 @@
pe:
-$
Type
+T%3C*%3E
, op
@@ -655,14 +655,33 @@
s?:
-Object
+ExtendedValidationOptions
): V
|
dbb4272eeca972bb3716623d2f9c79d67cd0bdaa
|
reorder imports
|
gulpfile.js
|
gulpfile.js
|
#!/usr/bin/env node
const less = require('gulp-less');
const tweakdom = require('gulp-tweakdom');
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const rollup = require('gulp-better-rollup')
const babel = require('rollup-plugin-babel')
const uglify = require('rollup-plugin-uglify');
const uglifyES = require('uglify-es');
const concat = require('gulp-concat');
const del = require('del');
const cleanCSS = require('gulp-clean-css');
gulp.task('css', function() {
return gulp.src('*.less')
.pipe(less())
.pipe(cleanCSS())
.pipe(gulp.dest('./dist'));
});
gulp.task('rollup-nomodule', function() {
// TODO: bring in Promise and fetch polyfill or remove dep
const options = {
// nb. ascii_only so escaped emoji are left alone
plugins: [babel(), uglify({output: {ascii_only: true}})],
};
return gulp.src(['src/polyfill.js', 'src/bundle.js'])
.pipe(sourcemaps.init())
.pipe(rollup(options, {format: 'iife'}))
.pipe(concat('support.min.js'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./dist'));
})
gulp.task('rollup', ['rollup-nomodule'], function() {
// nb. this task doesn't really depend on rollup-nomodule, but they can't be run in parallel
const options = {
// nb. ascii_only so escaped emoji are left alone
plugins: [uglify({output: {ascii_only: true, ecma: 6}}, uglifyES.minify)],
};
return gulp.src('src/bundle.js')
.pipe(sourcemaps.init())
.pipe(rollup(options, {format: 'es'}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./dist'));
});
gulp.task('html', function() {
const mutator = document => {
// replace lessCSS with actual styles
document.getElementById('less').remove();
const link = Object.assign(document.createElement('link'),
{href: 'styles.css', rel: 'stylesheet'});
document.head.appendChild(link);
// fix paths for module/nomodule code
document.head.querySelector('script[nomodule]').src = 'support.min.js';
document.head.querySelector('script[src^="src/"]').src = 'bundle.js';
};
return gulp.src('*.html')
.pipe(tweakdom(mutator))
.pipe(gulp.dest('./dist'));
});
gulp.task('static', function() {
return gulp.src(['manifest.json', 'opensearch.xml', 'res/*'], {base: '.'})
.pipe(gulp.dest('./dist'));
});
gulp.task('default', ['css', 'rollup', 'html', 'static']);
gulp.task('clean', function() {
return del(['./dist'])
});
|
JavaScript
| 0.000009 |
@@ -24,33 +24,140 @@
nst
-less = require('gulp-less
+del = require('del');%0Aconst gulp = require('gulp');%0Aconst rollup = require('gulp-better-rollup')%0Aconst concat = require('gulp-concat
');%0A
@@ -162,24 +162,24 @@
;%0Aconst
-tweakdom
+cleanCSS
= requi
@@ -187,24 +187,25 @@
e('gulp-
-tweakdom
+clean-css
');%0Acons
@@ -198,36 +198,36 @@
an-css');%0Aconst
-gulp
+less
= require('gulp
@@ -218,32 +218,37 @@
= require('gulp
+-less
');%0Aconst source
@@ -280,38 +280,40 @@
cemaps');%0Aconst
-rollup
+tweakdom
= require('gulp
@@ -309,39 +309,35 @@
quire('gulp-
-better-rollup
+tweakdom
')
+;
%0Aconst babel
@@ -460,119 +460,8 @@
s');
-%0Aconst concat = require('gulp-concat');%0Aconst del = require('del');%0Aconst cleanCSS = require('gulp-clean-css');
%0A%0Agu
|
31eaf507511899b8ba4bc906f9d519979adb8143
|
remove erroneous gulp-notify
|
gulpfile.js
|
gulpfile.js
|
(function() {
'use strict';
var gulp = require('gulp');
var fork = require('./lib/fork');
var jscs = require('gulp-jscs');
var notify = require('gulp-notify');
var buildPath = '_site';
gulp.task('build', ['lintStyle', 'copySCSS']);
gulp.task('lintStyle', lintStyle);
gulp.task('copySCSS', ['lintStyle'], copySCSS);
function copySCSS() {
var files = ['node_modules/normalize.css/normalize.css'];
gulp.src(files).pipe(gulp.dest(buildPath + '/css'));
}
function lintStyle() {
var files = ['bin/*.js', 'lib/*.js', 'gulpfile.js'];
return gulp
.src(files)
.pipe(jscs())
.pipe(require('gulp-jscs-stylish')())
.pipe(jscs.reporter('fail'));
}
})();
|
JavaScript
| 0.999992 |
@@ -129,47 +129,8 @@
');%0A
- var notify = require('gulp-notify');%0A
va
|
6365e76a764ba0bb0f7a72e772bc8203fbffdaf1
|
Move variable declarations and add section headers
|
lib/node_modules/@stdlib/math/base/special/acosh/scripts/accuracy.js
|
lib/node_modules/@stdlib/math/base/special/acosh/scripts/accuracy.js
|
'use strict';
// TODO: clean-up
var abs = require( '@stdlib/math/base/special/abs' );
var divide = require( 'compute-divide' );
var mean = require( 'compute-mean' );
var subtract = require( 'compute-subtract' );
var acosh = require( './../lib' );
var data = require( './fixtures/julia/data.json' );
var x = data.x;
var yexpected = data.expected;
var ycustom = new Array( x.length );
var ynative = new Array( x.length );
for ( var i = 0; i < x.length; i++ ) {
if ( yexpected[ i ] === 0.0 ) {
yexpected[ i ] += 1e-16;
}
ycustom[ i ] = acosh( x[ i ] );
ynative[ i ] = Math.acosh( x[ i ] );
}
var customErrs = abs( divide( subtract( ycustom, yexpected ), yexpected ) );
var nativeErrs = abs( divide( subtract( ynative, yexpected ), yexpected ) );
console.log( 'The mean relative error of Math.acosh compared to Julia is %d', mean( nativeErrs ) );
console.log( 'The mean relative error of this module compared to Julia is %d', mean( customErrs ) );
|
JavaScript
| 0 |
@@ -27,16 +27,31 @@
ean-up%0A%0A
+// MODULES //%0A%0A
var abs
@@ -254,24 +254,41 @@
../lib' );%0A%0A
+%0A// FIXTURES //%0A%0A
var data = r
@@ -332,28 +332,121 @@
);%0A%0A
-var x = data.x;%0Avar
+%0A// MAIN //%0A%0Avar customErrs;%0Avar nativeErrs;%0Avar yexpected;%0Avar ynative;%0Avar ycustom;%0Avar x;%0Avar i;%0A%0Ax = data.x;%0A
yexp
@@ -468,20 +468,16 @@
pected;%0A
-var
ycustom
@@ -501,20 +501,16 @@
ngth );%0A
-var
ynative
@@ -543,12 +543,8 @@
or (
- var
i =
@@ -706,20 +706,16 @@
%5D );%0A%7D%0A%0A
-var
customEr
@@ -779,20 +779,16 @@
ed ) );%0A
-var
nativeEr
|
d490758d097d38f5a4231e61ffc384c0b4de26d2
|
Add `userStarredApp` task to `build` step in gulpfile
|
gulpfile.js
|
gulpfile.js
|
const gulp = require('gulp');
const less = require('gulp-less');
const dest = require('gulp-dest');
const watch = require('gulp-watch');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
const gutil = require('gulp-util');
const proxy = require('http-proxy-middleware')
const sync = require('browser-sync')
const history = require('connect-history-api-fallback')
gulp.task('server', function() {
const proxyDjango = proxy('/', {target: 'http://localhost:8888', xfwd: true})
sync.init({
notify: false,
open: false,
port: 8000,
server: {
baseDir: '/galaxy',
middleware: [proxyDjango, history()]
}
});
});
gulp.task('accountApp', function() {
return gulp.src([
'./galaxy/static/js/accountApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.accountApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('detailApp', function() {
return gulp.src([
'./galaxy/static/js/detailApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.detailApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('listApp', function() {
return gulp.src([
'./galaxy/static/js/listApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.listApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('exploreApp', function() {
return gulp.src([
'./galaxy/static/js/exploreApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.exploreApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('importStatusApp', function() {
return gulp.src([
'./galaxy/static/js/importStatusApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.importStatusApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('roleAddApp', function() {
return gulp.src([
'./galaxy/static/js/roleAddApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.roleAddApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('userStarredApp', function() {
return gulp.src([
'./galaxy/static/js/userStarredApp/*.js',
'./galaxy/static/js/commonDirectives/*.js',
'./galaxy/static/js/commonServices/*.js'
])
.pipe(concat('galaxy.userStarredApp.js'))
.pipe(uglify({ 'mangle': true, 'compress': true }))
.pipe(rename({extname: ".min.js"}))
.pipe(gulp.dest('./galaxy/static/dist'));
});
gulp.task('less', function() {
return gulp.src(['./galaxy/static/less/galaxy.less'])
.pipe(less({
compress: true
}))
.on('error', gutil.log)
.pipe(dest('galaxy/static/css', {ext: '.min.css'}))
.pipe(gulp.dest('./'));
});
gulp.task('less-watch', ['less'], function (done) {
sync.reload();
done();
});
gulp.task('generic-watch', function(done) {
sync.reload();
done();
});
gulp.task('watch', function () {
gulp.watch('./galaxy/static/less/*.less', ['less-watch']);
gulp.watch('./galaxy/static/js/*/*.js', ['generic-watch']);
gulp.watch('./galaxy/static/partials/*.html', ['generic-watch']);
});
gulp.task('default', ['less', 'server', 'watch']);
gulp.task('build', ['less', 'accountApp', 'listApp', 'detailApp', 'exploreApp', 'roleAddApp', 'importStatusApp']);
|
JavaScript
| 0.000001 |
@@ -4335,24 +4335,29 @@
k('build', %5B
+%0A
'less', 'acc
@@ -4389,16 +4389,20 @@
ailApp',
+%0A
'explor
@@ -4439,12 +4439,31 @@
atusApp'
+, 'userStarredApp'%0A
%5D);%0A
|
e474402372d241a9c01675e67a447a5eccf2c711
|
fix fonts url
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
cssmin = require('gulp-cssmin'),
del = require('del'),
eslint = require('gulp-eslint'),
eventStream = require('event-stream'),
inject = require('gulp-inject'),
less = require('gulp-less'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
templateCache = require('gulp-angular-templatecache'),
uglify = require('gulp-uglify'),
util = require('gulp-util'),
watch = require('gulp-watch'),
webserver = require('gulp-webserver'),
paths = require('./gulp.config.json');
/*******************************************[MAIN TASKS]******************************************/
/**
* Build optimized app
*/
gulp.task('build', ['clean'], function () {
return gulp.start('create-app');
});
/**
* Serve dev environment with JS and less watchers
*/
gulp.task('serve', ['watch'], function () {
gulp.src(paths.app)
.pipe(webserver({
open: true
}));
});
/**
* Print description
*/
gulp.task('default', function () {
util.log();
util.log(util.colors.bold.green('Available commands:'));
util.log('-', util.colors.green('gulp build'), '- build optimized app, it creates dist directory with minified scripts and styles');
util.log('-', util.colors.green('gulp serve'), '- serve dev environment with JS and less watchers');
util.log();
});
/******************************************[HELPER TASKS]*****************************************/
var glyphiconsRegex = /\.\.\/fonts\/glyphicons-([a-z-]+)\.([a-z]{2,5})/g,
fontAwesomeRegex = /\.\.\/fonts\/fontawesome-([a-z-]+)\.([a-z]{2,5})/g;
/**
* Remove dist directory
*/
gulp.task('clean', function () {
return del(paths.dist);
});
/**
* Create optimized app
*/
gulp.task('create-app', ['jsmin', 'cssmin', 'copy-fonts', 'copy-images'], function () {
var jsSrc = gulp.src(paths.dist + paths.jsMinified, {
read: false
});
var cssSrc = gulp.src(paths.dist + paths.cssMinified, {
read: false
});
return gulp.src(paths.app + 'index.html')
.pipe(inject(jsSrc, {
ignorePath: paths.dist.substring(1),
addRootSlash: false
}))
.pipe(inject(cssSrc, {
ignorePath: paths.dist.substring(1),
addRootSlash: false
}))
.pipe(gulp.dest(paths.dist));
});
/**
* Minify and bundle JS files
*/
gulp.task('jsmin', function () {
var bowerComponents = gulp.src(paths.vendorJs),
sources = gulp.src(paths.js),
templates = gulp.src(paths.html)
.pipe(templateCache('templates.js', {
module: 'app',
root: './'
}))
.pipe(replace('./assets/images/', './images/'));
return eventStream.merge(bowerComponents, sources, templates)
.pipe(concat(paths.jsMinified))
.pipe(uglify())
.pipe(gulp.dest(paths.dist));
});
/**
* Minify and bundle less files
*/
gulp.task('cssmin', function () {
return gulp.src(paths.appLess)
.pipe(less())
.pipe(replace(glyphiconsRegex, './fonts/glyphicons-$1.$2'))
.pipe(replace(fontAwesomeRegex, './fonts/fontawesome-$1.$2'))
.pipe(replace('../assets/images/', './images/'))
.pipe(autoprefixer())
.pipe(cssmin())
.pipe(rename(paths.cssMinified))
.pipe(gulp.dest(paths.dist));
});
/**
* Copy fonts to dist directory
*/
gulp.task('copy-fonts', function () {
return gulp.src(paths.fonts)
.pipe(gulp.dest(paths.dist + 'fonts/'));
});
/**
* Copy images to dist directory
*/
gulp.task('copy-images', function () {
return gulp.src(paths.images)
.pipe(gulp.dest(paths.dist + 'images/'));
});
/**
* Watch JS and less file
*/
gulp.task('watch', ['lint', 'css'], function () {
watch(paths.js, function () {
gulp.start('lint')
});
watch(paths.less, function () {
gulp.start('css')
});
});
/**
* Lint JS files using ESlint
*/
gulp.task('lint', function () {
return gulp.src(paths.js)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.results(function (results) {
if (results.errorCount === 0 && results.warningCount === 0) {
util.log(util.colors.bold.green('ESlint test has been passed'));
}
}));
});
/**
* Compile less into css for dev server
*/
gulp.task('css', function () {
return gulp.src(paths.appLess)
.pipe(plumber({
errorHandler: function (error) {
util.log(util.colors.red(error.message));
this.emit('end');
}
}))
.pipe(less())
.pipe(replace(glyphiconsRegex, './bower_components/bootstrap/fonts/glyphicons-$1.$2'))
.pipe(replace(fontAwesomeRegex, './bower_components/font-awesome/fonts/fontawesome-$1.$2'))
.pipe(autoprefixer())
.pipe(gulp.dest(paths.app + 'pages/'));
});
|
JavaScript
| 0.009169 |
@@ -4489,32 +4489,33 @@
phiconsRegex, '.
+.
/bower_component
@@ -4590,16 +4590,17 @@
egex, '.
+.
/bower_c
|
02cf45a3ee0061097bbfe74f6567c38ca871d3bc
|
Clarify plugin loading in server.
|
app/server.js
|
app/server.js
|
exports = module.exports = function(container, store, logger) {
var oauth2orize = require('oauth2orize');
var server = oauth2orize.createServer({
store: store
});
var paramDecls = container.components('http://schemas.authnomicon.org/js/aaa/oauth2/request/parameters')
, grantDecls = container.components('http://schemas.authnomicon.org/js/aaa/oauth2/grant')
, exchangeDecls = container.components('http://schemas.authnomicon.org/js/aaa/oauth2/exchange')
return Promise.all(paramDecls.map(function(spec) { return container.create(spec.id); } ))
.then(function(plugins) {
// Register request parameter extensions with the OAuth 2.0 server.
plugins.forEach(function(plugin, i) {
server.grant(plugin);
logger.info('Loaded OAuth 2.0 request parameters: ' + paramDecls[i].a['@name']);
});
})
.then(function() {
return Promise.all(grantDecls.map(function(spec) { return container.create(spec.id); } ));
})
.then(function(plugins) {
// Register response types with the OAuth 2.0 server.
plugins.forEach(function(plugin, i) {
server.grant(grantDecls[i].a['@type'] || plugin.name, plugin);
logger.info('Loaded OAuth 2.0 response type: ' + (grantDecls[i].a['@type'] || plugin.name));
});
})
.then(function() {
return Promise.all(exchangeDecls.map(function(spec) { return container.create(spec.id); } ));
})
.then(function(plugins) {
// Register grant types with the OAuth 2.0 server.
plugins.forEach(function(plugin, i) {
server.exchange(exchangeDecls[i].a['@type'] || plugin.name, plugin);
logger.info('Loaded OAuth 2.0 grant type: ' + (exchangeDecls[i].a['@type'] || plugin.name));
});
})
.then(function() {
return server;
});
}
exports['@implements'] = 'http://schemas.authnomicon.org/js/aaa/oauth2/Server';
exports['@singleton'] = true;
exports['@require'] = [
'!container',
'http://schemas.authnomicon.org/js/aaa/oauth2/TransactionStore',
'http://i.bixbyjs.org/Logger'
];
|
JavaScript
| 0 |
@@ -181,100 +181,94 @@
%0A
-var paramDecls = container.components('http://schemas.authnomicon.org/js/aaa/oauth2/
+return Promise.resolve(server)%0A .then(function(server) %7B%0A // Register
request
-/
+
para
@@ -276,120 +276,62 @@
eter
-s')%0A , grantDecls = container.components('http://schemas.authnomicon.org/js/aaa/oauth2/grant')%0A , exchange
+ extensions with the OAuth 2.0 server.%0A var param
Decl
@@ -405,22 +405,39 @@
th2/
-exchange
+request/parameters
')
+;
%0A
-%0A
+ %0A
re
@@ -524,16 +524,20 @@
); %7D ))%0A
+
.the
@@ -566,78 +566,8 @@
- // Register request parameter extensions with the OAuth 2.0 server.%0A
@@ -606,32 +606,36 @@
n, i) %7B%0A
+
server.grant(plu
@@ -632,32 +632,36 @@
.grant(plugin);%0A
+
logger.i
@@ -735,32 +735,36 @@
e'%5D);%0A
+
%7D);%0A
%7D)%0A .then
@@ -743,35 +743,43 @@
%7D);%0A
+
+
%7D)%0A
+
.then(functi
@@ -777,32 +777,268 @@
en(function() %7B%0A
+ return server;%0A %7D);%0A %7D)%0A .then(function(server) %7B%0A // Register response types with the OAuth 2.0 server.%0A var grantDecls = container.components('http://schemas.authnomicon.org/js/aaa/oauth2/grant')%0A %0A
return Pro
@@ -1112,33 +1112,29 @@
ec.id); %7D ))
-;
%0A
-%7D)%0A
.then(fu
@@ -1159,64 +1159,8 @@
- // Register response types with the OAuth 2.0 server.%0A
@@ -1191,32 +1191,36 @@
on(plugin, i) %7B%0A
+
server.g
@@ -1274,32 +1274,36 @@
lugin);%0A
+
logger.info('Loa
@@ -1371,32 +1371,36 @@
plugin.name));%0A
+
%7D);%0A %7D)
@@ -1389,35 +1389,43 @@
%7D);%0A
-%7D)%0A
+ %7D)%0A
.then(functi
@@ -1423,32 +1423,271 @@
en(function() %7B%0A
+ return server;%0A %7D);%0A %7D)%0A .then(function(server) %7B%0A // Register grant types with the OAuth 2.0 server.%0A var exchangeDecls = container.components('http://schemas.authnomicon.org/js/aaa/oauth2/exchange')%0A %0A
return Pro
@@ -1768,25 +1768,21 @@
d); %7D ))
-;
%0A
-%7D)%0A
.the
@@ -1811,61 +1811,8 @@
- // Register grant types with the OAuth 2.0 server.%0A
@@ -1855,24 +1855,28 @@
) %7B%0A
+
+
server.excha
@@ -1924,32 +1924,36 @@
.name, plugin);%0A
+
logger.i
@@ -2039,32 +2039,36 @@
me));%0A
+
+
%7D);%0A
%7D)%0A .then
@@ -2047,39 +2047,47 @@
%7D);%0A
+
+
%7D)%0A
+
+
.then(function()
@@ -2085,24 +2085,97 @@
unction() %7B%0A
+ return server;%0A %7D);%0A %7D)%0A .then(function(server) %7B%0A
return
|
c47bd191dbef6feb7be843a0c021b176d8c087b2
|
Add /api suffix to kube gulp proxy
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp'),
wiredep = require('wiredep').stream,
eventStream = require('event-stream'),
gulpLoadPlugins = require('gulp-load-plugins'),
map = require('vinyl-map'),
fs = require('fs'),
path = require('path'),
url = require('url'),
uri = require('URIjs'),
s = require('underscore.string'),
hawtio = require('hawtio-node-backend');
var plugins = gulpLoadPlugins({});
var pkg = require('./package.json');
var config = {
main: '.',
ts: ['plugins/**/*.ts'],
templates: ['plugins/**/*.html'],
templateModule: pkg.name + '-templates',
dist: './dist/',
js: pkg.name + '.js',
tsProject: plugins.typescript.createProject({
target: 'ES5',
module: 'commonjs',
declarationFiles: true,
noExternalResolve: false
})
};
gulp.task('bower', function() {
gulp.src('index.html')
.pipe(wiredep({}))
.pipe(gulp.dest('.'));
});
/** Adjust the reference path of any typescript-built plugin this project depends on */
gulp.task('path-adjust', function() {
gulp.src('libs/**/includes.d.ts')
.pipe(map(function(buf, filename) {
var textContent = buf.toString();
var newTextContent = textContent.replace(/"\.\.\/libs/gm, '"../../../libs');
// console.log("Filename: ", filename, " old: ", textContent, " new:", newTextContent);
return newTextContent;
}))
.pipe(gulp.dest('libs'));
});
gulp.task('clean-defs', function() {
return gulp.src('defs.d.ts', { read: false })
.pipe(plugins.clean());
});
gulp.task('tsc', ['clean-defs'], function() {
var cwd = process.cwd();
var tsResult = gulp.src(config.ts)
.pipe(plugins.typescript(config.tsProject))
.on('error', plugins.notify.onError({
message: '#{ error.message }',
title: 'Typescript compilation error'
}));
return eventStream.merge(
tsResult.js
.pipe(plugins.concat('compiled.js'))
.pipe(gulp.dest('.')),
tsResult.dts
.pipe(gulp.dest('d.ts')))
.pipe(map(function(buf, filename) {
if (!s.endsWith(filename, 'd.ts')) {
return buf;
}
var relative = path.relative(cwd, filename);
fs.appendFileSync('defs.d.ts', '/// <reference path="' + relative + '"/>\n');
return buf;
}));
});
gulp.task('template', ['tsc'], function() {
return gulp.src(config.templates)
.pipe(plugins.angularTemplatecache({
filename: 'templates.js',
root: 'plugins/',
standalone: true,
module: config.templateModule,
templateFooter: '}]); hawtioPluginLoader.addModule("' + config.templateModule + '");'
}))
.pipe(gulp.dest('.'));
});
gulp.task('concat', ['template'], function() {
return gulp.src(['compiled.js', 'templates.js'])
.pipe(plugins.concat(config.js))
.pipe(gulp.dest(config.dist));
});
gulp.task('clean', ['concat'], function() {
return gulp.src(['templates.js', 'compiled.js', 'site'], { read: false })
.pipe(plugins.clean());
});
gulp.task('watch', ['build'], function() {
plugins.watch(['libs/**/*.js', 'libs/**/*.css', 'index.html', config.dist + '/' + config.js], function() {
gulp.start('reload');
});
plugins.watch(['libs/**/*.d.ts', config.ts, config.templates], function() {
gulp.start(['tsc', 'template', 'concat', 'clean']);
});
});
gulp.task('connect', ['watch'], function() {
// lets disable unauthorised TLS issues with kube REST API
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var kube = uri(process.env.KUBERNETES_MASTER || 'http://localhost:8080');
console.log("Connecting to Kubernetes on: " + kube);
var localProxies = [];
if (process.env.LOCAL_APP_LIBRARY === "true") {
localProxies.push({
proto: "http",
port: "8588",
hostname: "localhost",
path: '/services/app-library',
targetPath: "/"
});
}
var defaultProxies = [{
proto: kube.protocol(),
port: kube.port(),
hostname: kube.hostname(),
path: '/kubernetes',
targetPath: kube.path()
}, {
proto: kube.protocol(),
hostname: kube.hostname(),
port: kube.port(),
path: '/jolokia',
targetPath: '/hawtio/jolokia'
}, {
proto: kube.protocol(),
hostname: kube.hostname(),
port: kube.port(),
path: '/git',
targetPath: '/hawtio/git'
}];
var staticProxies = localProxies.concat(defaultProxies);
hawtio.setConfig({
port: 2772,
staticProxies: staticProxies,
staticAssets: [{
path: '/',
dir: '.'
}],
fallback: 'index.html',
liveReload: {
enabled: true
}
});
var debugLoggingOfProxy = process.env.DEBUG_PROXY === "true";
hawtio.use('/', function(req, res, next) {
var path = req.originalUrl;
// avoid returning these files, they should get pulled from js
if (s.startsWith(path, '/plugins/') && s.endsWith(path, 'html')) {
console.log("returning 404 for: ", path);
res.statusCode = 404;
res.end();
} else {
if (debugLoggingOfProxy) {
console.log("allowing: ", path);
}
next();
}
});
hawtio.listen(function(server) {
var host = server.address().address;
var port = server.address().port;
console.log("started from gulp file at ", host, ":", port);
});
});
gulp.task('reload', function() {
gulp.src('.')
.pipe(hawtio.reload());
});
gulp.task('build', ['bower', 'path-adjust', 'tsc', 'template', 'concat', 'clean']);
gulp.task('site', ['clean', 'build'], function() {
gulp.src(['index.html', 'css/**', 'images/**', 'libs/**', 'dist/**'], {base: '.'}).pipe(gulp.dest('site'));
});
gulp.task('default', ['connect']);
|
JavaScript
| 0 |
@@ -3486,16 +3486,17 @@
e = uri(
+(
process.
@@ -3544,16 +3544,26 @@
t:8080')
+ + '/api')
;%0A cons
@@ -3994,16 +3994,20 @@
bernetes
+/api
',%0A t
|
d55770188e521c6b368af75550a39a57dc4934c5
|
remove redundancies in gulp file
|
gulpfile.js
|
gulpfile.js
|
// Sass configuration
var gulp = require('gulp');
var sass = require('gulp-sass');
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('sass', function () {
gulp.src('public/css/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(f => f.base));
});
gulp.task('sass:watch', function () {
gulp.watch('*.scss', ['sass']);
});
|
JavaScript
| 0.000002 |
@@ -1,88 +1,4 @@
-// Sass configuration%0Avar gulp = require('gulp');%0Avar sass = require('gulp-sass');%0A%0A
'use
@@ -7,17 +7,16 @@
trict';%0A
-%0A
var gulp
|
811db5b0e18a546242cbf0e4f9b6a56481938509
|
Add release tab -- bare-bones for later
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
bump = require('gulp-bump'),
git = require('gulp-git'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
size = require('gulp-size'),
pkg = require('./package.json');
var paths = {
pkg: './package.json',
src: './tote.js',
all: [ 'gulpfile.js', './tote.js' ],
dist: './www/dist'
};
gulp.task('lint', function() {
return gulp.src(paths.src)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('bump', function() {
return gulp.src(paths.pkg)
.pipe(bump())
.pipe(gulp.dest('./'));
});
gulp.task('tag', function () {
var pkg = require(paths.pkg),
ver = 'v' + pkg.version,
msg = 'Release ' + v;
return gulp.src('./')
.pipe(git.commit(msg))
.pipe(git.tag(v, msg))
.pipe(git.push('origin', 'master', '--tags'))
.pipe(gulp.dest('./'));
});
gulp.task('package', function() {
return gulp.src(paths.src)
.pipe(concat(pkg.name + '.js'))
.pipe(gulp.dest(paths.dist))
.pipe(rename(pkg.name + '.min.js'))
.pipe(uglify())
.pipe(size())
.pipe(gulp.dest(paths.dist));
});
gulp.task('dev', ['lint', 'package'], function() {
gulp.watch(paths.all, ['lint', 'package']);
});
gulp.task('default', ['package']);
|
JavaScript
| 0 |
@@ -1419,20 +1419,51 @@
ault', %5B'package'%5D);
+%0Agulp.task('release', %5B'tag'%5D);
|
9e23b99a987972456ec65c19e7ee4d76007af180
|
Fix bug in games_list.view.js
|
app/scripts/views/games_list.view.js
|
app/scripts/views/games_list.view.js
|
(function () {
'use strict';
var countPrisoners = function (board, player1IsMe) {
var i, j,
freeMenCount = 0;
board.forEach(function (row) {
row.forEach(function (cell) {
if (player1IsMe) {
if (cell === 'M' || cell === 'K') {
freeMenCount++;
}
} else {
if (cell === 'm' || cell === 'k') {
freeMenCount++;
}
}
});
});
return (12 - freeMenCount);
};
var filterGamesList = function (self, obj) {
return self.collection.filter(function (game) {
obj.isOddTurn = game.attributes.game.turn_counter % 2 == 1;
obj.isEvenTurn = !obj.isOddTurn;
// TODO: Swap out app.username for ?app.user.username? once that is exposed.
obj.player1IsMe = game.attributes.player1.username === app.username;
obj.player2IsMe = !obj.player1IsMe;
game.set('me', (obj.player1IsMe) ? 'player1' : 'player2');
// TODO: I may need to flip player1IsMe with player2IsMe
// depending on how server handles the game startup.
obj.isMyTurn = obj.isOddTurn && obj.player1IsMe ||
obj.isEvenTurn && obj.player2IsMe;
return (self.myMoves) ? obj.isMyTurn : !obj.isMyTurn;
});
};
var addProps = function (filteredGamesList, obj, view) {
var opponentUsername, hash, opponent, prisonCount, prisoner, timestamp;
filteredGamesList.forEach(function (game) {
opponentUsername = obj.player1IsMe ? game.attributes.player2.username : game.attributes.player1.username;
hash = CryptoJS.MD5(opponentUsername).toString();
game.set('hash', hash);
opponent = obj.player1IsMe ? game.attributes.player2.username : game.attributes.player1.username;
game.set('opponent', opponent);
prisonCount = countPrisoners(game.attributes.game.board, obj.player1IsMe);
game.set('prisonCount', prisonCount || 'NO');
prisoner = utils.pluralize('prisoner', prisonCount);
game.set('prisoner', prisoner);
game.set('isMyTurn', obj.isMyTurn);
timestamp = moment(game.attributes.game.updated_at).fromNow();
game.set('timestamp', timestamp);
view.$el.append(view.template(game.attributes));
});
};
var render = function () {
var self = this,
obj = {};
this.$el.empty();
this.collection.fetch().done(function () {
var filteredGamesList = filterGamesList(self, obj);
if (filteredGamesList.length > 0) {
addProps(filteredGamesList, obj, self);
} else {
self.$el.append(self.templateNoMoves(game.attributes));
}
});
};
var launchGame = function (e) {
console.log('Clicked to launch game');
var game = app.games.find(function (game) {
return game.attributes.game.id == e.currentTarget.id;
});
app.menView = new app.MenView(game);
app.boardView = new app.BoardView(game);
};
app.GamesListView = Backbone.View.extend({
initialize: function () {
$('.games-wrapper').append('<div class="games-page"></div>');
app.myMovesView = new app.MyMovesView(app.games);
app.theirMovesView = new app.TheirMovesView(app.games);
}
});
app.MyMovesView = Backbone.View.extend({
tagName: 'ul',
className: 'games',
template: Handlebars.templates.game,
templateNoMoves: Handlebars.templates.game_no_my_moves,
events: {
'click li': 'clicked'
},
initialize: function (collection) {
this.collection = collection;
this.render();
this.myMoves = true;
$('.games-page').append('<h2 id="myTurn">Your Move</h2>').append(this.el);
},
render: render,
clicked: launchGame
});
app.TheirMovesView = Backbone.View.extend({
tagName: 'ul',
className: 'games',
template: Handlebars.templates.game,
templateNoMoves: Handlebars.templates.game_no_their_moves,
events: {
'click li': 'clicked'
},
initialize: function (collection) {
this.collection = collection;
this.render();
this.myMoves = false;
$('.games-page').append('<h2 id="theirTurn">Their Move</h2>').append(this.el);
},
render: render,
clicked: launchGame
});
}());
|
JavaScript
| 0.000001 |
@@ -2587,31 +2587,16 @@
NoMoves(
-game.attributes
));%0A
|
f9006997bda076e7ed5201c26a2b07ec85369b90
|
update gulpfile
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var gutil = require('gulp-util');
var clean = require('gulp-clean');
var rename = require('gulp-rename');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var qunit = require('gulp-qunit');
var fb = require('gulp-fb');
var paths = {
src: [
'src/__intro.js',
'src/core.js',
'src/attribute.js',
'src/class.js',
'src/utils.js',
'src/serialize.js',
'src/deserialize.js',
'src/object.js',
'src/asset.js',
'src/vec2.js',
'src/matrix3.js',
'src/rect.js',
'src/color.js',
'src/texture.js',
'src/sprite.js',
'src/atlas.js',
'src/fontInfo.js',
'src/editor/platform.js',
'src/editor/dom.js',
'src/editor/fileUtils.js',
'src/__outro.js',
],
dev: 'bin/core.dev.js',
min: 'bin/core.min.js',
test: {
src: 'test/unit/**/*.js',
runner: 'test/lib/runner.html',
lib_dev: [
'bin/core.dev.js',
],
lib_min: [
'bin/core.min.js',
],
},
ref: {
src: [
'test/lib/*.js',
'test/unit/_*.js',
],
dest: '_references.js',
},
};
// clean
gulp.task('clean', function() {
return gulp.src('bin/**/*', {read: false})
.pipe(clean())
;
});
// jshint
gulp.task('jshint', function() {
return gulp.src(paths.src.concat( ['!**/__intro.js','!**/__outro.js'] ))
.pipe(jshint({
forin: false,
multistr: true,
}))
.pipe(jshint.reporter(stylish))
;
});
// dev
gulp.task('dev', ['jshint'], function() {
return gulp.src(paths.src)
.pipe(concat('core.dev.js'))
.pipe(gulp.dest('bin'))
;
});
// min
gulp.task('min', ['dev'], function() {
return gulp.src('bin/core.dev.js')
.pipe(rename('core.min.js'))
.pipe(uglify())
.pipe(gulp.dest('bin'))
;
});
/////////////////////////////////////////////////////////////////////////////
// test
/////////////////////////////////////////////////////////////////////////////
gulp.task('unit-runner', function() {
var js = paths.test.src;
var dest = paths.test.src.split('*')[0];
return gulp.src(js, { read: false, base: './' })
.pipe(fb.toFileList())
.pipe(fb.generateRunner(paths.test.runner,
dest,
'Fireball Core Test Suite',
paths.test.lib_min,
paths.test.lib_dev,
paths.src))
.pipe(gulp.dest(dest))
;
});
gulp.task('test', ['dev', 'unit-runner'], function() {
return gulp.src(['test/unit/**/*.html', '!**/*.dev.*'])
.pipe(qunit())
;
});
/////////////////////////////////////////////////////////////////////////////
// tasks
/////////////////////////////////////////////////////////////////////////////
// ref
gulp.task('ref', function() {
var src = paths.src;//.concat(['!src/__intro.js', '!src/__outro.js']);
var files = paths.ref.src.concat(src);
var destPath = paths.ref.dest;
return fb.generateReference(files, destPath);
});
// watch
gulp.task('watch', function() {
gulp.watch(paths.src, ['min']).on( 'error', gutil.log );
});
//
gulp.task('all', ['min', 'test', 'ref'] );
gulp.task('ci', ['min', 'test'] );
gulp.task('default', ['min'] );
|
JavaScript
| 0.000001 |
@@ -1471,16 +1471,17 @@
;%0A%0A// js
+-
hint%0Agul
|
cfb349edabbd6507a834fa483065ab5ee4da72e0
|
Add back required include to gulpfile
|
gulpfile.js
|
gulpfile.js
|
var browserify = require('browserify'),
concat = require('gulp-concat'),
gulp = require('gulp'),
insert = require('gulp-insert'),
jshint = require('gulp-jshint'),
karma = require('karma'),
package = require('./package.json'),
replace = require('gulp-replace'),
source = require('vinyl-source-stream');
streamify = require('gulp-streamify');
var srcDir = './src/';
var srcFiles = srcDir + '**.js';
var buildDir = './';
var header = "/*!\n\
* chartjs-chart-financial\n\
* Version: {{ version }}\n\
*\n\
* Copyright 2017 Ben McCann\n\
* Released under the MIT license\n\
* https://github.com/chartjs/chartjs-chart-financial/blob/master/LICENSE.md\n\
*/\n";
gulp.task('default', ['watch']);
gulp.task('build', buildTask);
gulp.task('jshint', jsHintTask);
gulp.task('watch', watchTask);
gulp.task('test', testTask);
function buildTask() {
var nonBundled = browserify('./src/index.js')
.ignore('chart.js')
.bundle()
.pipe(source('Chart.Financial.js'))
.pipe(insert.prepend(header))
.pipe(streamify(replace('{{ version }}', package.version)))
.pipe(gulp.dest(buildDir))
.pipe(streamify(uglify({
preserveComments: 'some'
})))
.pipe(streamify(concat('Chart.Financial.min.js')))
.pipe(gulp.dest(buildDir));
return nonBundled;
}
function watchTask() {
return gulp.watch(srcFiles, ['build', 'jshint']);
}
function jsHintTask() {
return gulp.src(srcFiles)
.pipe(jshint())
.pipe(jshint.reporter('default'));
}
function runTest(done, singleRun) {
new karma.Server({
configFile: __dirname + '/karma.conf.js',
singleRun: singleRun
}, done).start();
}
function testTask(done) {
runTest(done, true);
}
|
JavaScript
| 0 |
@@ -350,16 +350,51 @@
eamify')
+,%0A uglify = require('gulp-uglify')
;%0A%0Avar s
|
e77c773b8c7006d5427006e83fa4986aff6b26fd
|
build demos on html change in components
|
gulpfile.js
|
gulpfile.js
|
/////
// Mostly stolen from https://github.com/pkozlowski-opensource/ng2-play
/////
var gulp = require('gulp');
var karma = require('karma').server;
var buildConfig = require('./scripts/build/config');
var concat = require('gulp-concat');
var debug = require('gulp-debug');
var del = require('del');
var exec = require('gulp-exec');
var karma = require('karma').server;
var plumber = require('gulp-plumber');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var shell = require('gulp-shell');
var traceur = require('gulp-traceur');
var wrap = require("gulp-wrap");
gulp.task('default', ['js', 'html', 'sass', 'libs', 'playgroundJs', 'playgroundFiles', 'demo']);
gulp.task('watch', ['default'], function() {
var http = require('http');
var connect = require('connect');
var serveStatic = require('serve-static');
var port = 9000;
gulp.watch(buildConfig.src.html, ['html']);
gulp.watch(buildConfig.src.js, ['js']);
gulp.watch(buildConfig.src.scss, ['sass']);
gulp.watch(buildConfig.src.playgroundJs, ['playgroundJs']);
gulp.watch(buildConfig.src.playgroundFiles, ['playgroundFiles']);
var app = connect().use(serveStatic(__dirname + '/' + buildConfig.dist)); // serve everything that is static
http.createServer(app).listen(port);
console.log('Serving `dist` on http://localhost:' + port);
});
gulp.task('lint', shell.task([
'./node_modules/.bin/standard'
]));
gulp.task('karma', function() {
return karma.start({ configFile: __dirname + '/scripts/test/karma.conf.js' });
});
gulp.task('karma-watch', function() {
return karma.start({ configFile: __dirname + '/scripts/test/karma-watch.conf.js' });
});
gulp.task('sass-watch', ['sass'], function () {
gulp.watch('src/**/*.scss', ['sass']);
});
gulp.task('sass', function(done) {
gulp.src('src/components/app/ionic.scss')
.pipe(sass({
onError: function(err) {
console.log(err);
}
}))
.pipe(gulp.dest('dist/css'))
.on('end', done);
});
gulp.task('clean', function(done) {
del([buildConfig.dist], done);
});
gulp.task('playgroundFiles', function() {
return gulp.src(buildConfig.src.playgroundFiles)
.pipe(gulp.dest(buildConfig.dist));
});
gulp.task('playgroundJs', function() {
return gulp.src(buildConfig.src.playgroundJs)
.pipe(rename({extname: ''})) //hack, see: https://github.com/sindresorhus/gulp-traceur/issues/54
.pipe(plumber())
.pipe(traceur({
modules: 'instantiate',
moduleName: true,
annotations: true,
types: true
}))
.pipe(rename({extname: '.js'})) //hack, see: https://github.com/sindresorhus/gulp-traceur/issues/54
.pipe(gulp.dest(buildConfig.dist));
});
function traceurCompile() {
return lazypipe()
();
}
gulp.task('js', function () {
return gulp.src(buildConfig.src.js)
.pipe(rename(function(file) {
// Forces the files to register themselves with 'ionic' prefix
file.dirname = 'ionic/' + file.dirname;
}))
.pipe(rename({extname: ''})) //hack, see: https://github.com/sindresorhus/gulp-traceur/issues/54
.pipe(plumber())
.pipe(traceur({
modules: 'instantiate',
moduleName: true,
annotations: true,
types: true
}))
.pipe(rename({extname: '.js'})) //hack, see: https://github.com/sindresorhus/gulp-traceur/issues/54
// compiled js files in playground go to the playground root, everything else goes in /ionic
.pipe(gulp.dest('dist'));
});
gulp.task('html', function () {
// Don't do anything with html for now
// return gulp.src(buildConfig.src.html)
// .pipe(gulp.dest(buildConfig.dist));
});
gulp.task('libs', ['angular2'], function () {
return gulp.src(buildConfig.lib)
.pipe(gulp.dest('dist/lib'));
});
gulp.task('angular2', function () {
//transpile & concat
return gulp.src([
'node_modules/angular2/es6/prod/*.es6',
'node_modules/angular2/es6/prod/src/**/*.es6'
], {
base: 'node_modules/angular2/es6/prod'
})
.pipe(rename(function(path){
path.dirname = 'angular2/' + path.dirname; //this is not ideal... but not sure how to change angular's file structure
path.extname = ''; //hack, see: https://github.com/sindresorhus/gulp-traceur/issues/54
}))
.pipe(traceur({ modules: 'instantiate', moduleName: true}))
.pipe(concat('angular2.js'))
.pipe(gulp.dest('dist/lib'));
});
gulp.task('demo', function () {
gulp.src(["./src/components/**/examples/**/index.html"])
.pipe(debug({title: 'Generating Demo:'}))
.pipe(wrap({ src: './scripts/examples/template/index.html'}))
.pipe(rename(function(file) {
file.dirname = file.dirname.replace("/examples/","/");
}))
.pipe(gulp.dest("./dist/examples"));
});
|
JavaScript
| 0.000002 |
@@ -898,16 +898,24 @@
%5B'html'
+, 'demo'
%5D);%0A gu
|
b98d8f30ecc1f995ed57a1a1691d39ceaae8aa4f
|
fix gulp publish
|
gulpfile.js
|
gulpfile.js
|
'use strict';
/* ---------- */
/* variables */
var srcFile = 'html.sortable.src.js';
/* ---------- */
/* setup */
var gulp = require('gulp');
var log = require('gulp-util').log;
var rename = require('gulp-rename');
var del = require('del');
var bump = require('gulp-bump');
var semver = require('semver');
var shell = require('gulp-shell');
var minimist = require('minimist');
var prompt = require('gulp-prompt');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var umd = require('gulp-umd');
var strip = require('gulp-strip-code');
/* ---------- */
/* error handling */
var reportError = function(error) {
if (error.message !== undefined) {
log(error.message);
} else {
log(error);
}
};
/* ---------- */
/* linting */
gulp.task('lint', function() {
gulp.src([
'src/' + srcFile,
'src/html.sortable.angular.js'
])
.pipe(jscs())
.on('error', reportError)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
;
});
/* ---------- */
/* convert to umd */
gulp.task('umd', function() {
return gulp.src('src/' + srcFile)
.pipe(strip({
//jscs:disable
start_comment: 'start-testing',
end_comment: 'end-testing'
//jscs:enable
}))
.pipe(umd({
dependencies: function() {
return [{
name: '$',
amd: 'jquery',
cjs: 'jquery',
global: 'jQuery'
}];
},
exports: function() {
return 'sortable';
},
namespace: function() {
return 'sortable';
}
}))
.pipe(rename('html.sortable.js'))
.pipe(gulp.dest('src/'));
});
/* ---------- */
/* build */
gulp.task('build-version', ['umd'], function() {
// clear dist
del.sync('./dist/*', {force: true});
// copy files to dist
gulp.src(['src/html.sortable.js', 'src/html.sortable.angular.js'])
.pipe(gulp.dest('./dist'))
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(uglify())
.pipe(jshint())
.pipe(rename({
suffix: '.min'
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist'))
// remove umd
.on('end', function() {
del.sync('./src/html.sortable.js', {force: true});
});
});
/* bump version */
gulp.task('bump-version', function() {
var msg = 'Are you sure you want to bump the version to ';
if (process.argv.slice(2) === 'publish') {
msg = 'Are you sure you want to publish the version ';
}
var args = minimist(process.argv.slice(3));
var v = args.v || args.version;
if (v === undefined) {
v = semver.inc(require('./package.json').version, 'patch');
}
return gulp.src(['./package.json', './bower.json'])
.pipe(prompt.confirm(msg + v))
.pipe(bump({version: v}))
.pipe(shell([
"git shortlog -ns master | awk '$1 >= 1 {print $0}' | cut -d' ' -f2- > AUTHORS",
"git add AUTHORS ./package.json ./bower.json && git commit -m 'bump to version v"+v+"'"
]))
.pipe(gulp.dest('./'));
});
/* tag version */
gulp.task('tag-version', ['bump-version'], function() {
var args = minimist(process.argv.slice(3));
var v = args.v || args.version;
if (v === undefined) {
delete require.cache[require.resolve('./package.json')];
v = require('./package.json').version;
}
return gulp.src('')
.pipe(shell([
'git tag v' + v
]));
});
/* publish version */
gulp.task('publish-version', ['tag-version'], function() {
return gulp.src('')
.pipe(shell([
'git push --tags'
])
);
});
/* ---------- */
/* tasks */
gulp.task('test', ['lint']);
gulp.task('build', ['umd', 'build-version', 'test']);
gulp.task('publish', ['bump-version', 'tag-version', 'publish-version']);
|
JavaScript
| 0.000001 |
@@ -2821,24 +2821,178 @@
rsion: v%7D))%0A
+ .pipe(gulp.dest('./'));%0A%7D);%0A%0Agulp.task('add-files', %5B'bump-version'%5D, function() %7B%0A var v = require('./package.json').version;%0A return gulp.src(%5B%5D)%0A
.pipe(sh
@@ -3134,16 +3134,25 @@
wer.json
+ ./dist/*
&& git
@@ -3199,36 +3199,8 @@
%5D))%0A
- .pipe(gulp.dest('./'));%0A
%7D);%0A
@@ -3240,36 +3240,33 @@
version', %5B'
-bump-version
+add-files
'%5D, function
@@ -3868,16 +3868,29 @@
ersion',
+ 'add-files',
'tag-ve
|
c2bb10380f5e551bba74f4b7fb0dce1ad05625ac
|
Add events db data into event scope
|
app/shared/teamform_db/teamformDb.js
|
app/shared/teamform_db/teamformDb.js
|
angular.module('teamform-db', ['firebase'])
.factory('teamformDb', ['$firebaseObject', '$firebaseArray', TeamformDb]);
function TeamformDb($firebaseObject, $firebaseArray) {
initalizeFirebase();
var service = {
loginWithFacebook: loginWithFacebook,
saveNewFBUser: saveNewFBUser,
getUser: getUser,
getEvent: getEvent,
getEventAdminData: getEventAdminData,
getAllTeams: getAllTeams,
getTeam: getTeam,
setTeamData: setTeamData,
getAllMembers: getAllMembers,
getMember: getMember,
setMemberData: setMemberData,
};
return service;
function loginWithFacebook() {
var provider = new firebase.auth.FacebookAuthProvider();
return firebase.auth().signInWithPopup(provider);
}
function saveNewFBUser(
fbID,
name,
email,
profilePicUrl,
token,
refreshToken,
callback) {
var refPath = "user/" + fbID;
var ref = firebase.database().ref(refPath);
var data = {
'fb_id': fbID,
'fb_name': name,
'display_name': name,
'email': email,
'profile_pic_url': profilePicUrl,
'token': token,
'refresh_token': refreshToken,
'created_at': Date.now(),
};
ref.set(data, callback);
}
function getUser(userID) {
var refPath = 'user/' + userID;
ref = firebase.database().ref(refPath);
var param = $firebaseObject(ref);
return param;
}
function getEvent(eventName) {
var refPath = eventName + "/admin/param";
ref = firebase.database().ref(refPath);
var param = $firebaseObject(ref);
return param;
}
function getEventAdminData(eventName, callback) {
var refPath = eventName + "/admin";
retrieveOnceFirebase(firebase, refPath, callback);
}
function getAllTeams(eventName) {
var refPath = eventName + '/team';
return $firebaseArray(firebase.database().ref(refPath));
};
function getTeam(eventName, teamID, callback) {
var refPath = eventName + "/team/" + teamID;
retrieveOnceFirebase(firebase, refPath, callback);
};
function setTeamData(eventName, teamID, data, callback) {
var refPath = eventName + "/team/" + teamID;
var ref = firebase.database().ref(refPath);
ref.set(data, callback);
};
function getAllMembers(eventName) {
var refPath = eventName + "/member";
return $firebaseArray(firebase.database().ref(refPath));
};
function getMember(eventName, userID, callback) {
var refPath = eventName + "/member/" + userID;
retrieveOnceFirebase(firebase, refPath, callback);
}
function setMemberData(eventName, userID, data, callback) {
var refPath = eventName + "/member/" + userID;
var ref = firebase.database().ref(refPath);
ref.set(data, callback);
}
}
|
JavaScript
| 0.000002 |
@@ -190,16 +190,48 @@
base();%0A
+%0A var eventScope = 'events/';%0A%0A
var se
@@ -1484,32 +1484,45 @@
%09var refPath =
+ eventScope +
eventName + %22/a
@@ -1705,16 +1705,29 @@
fPath =
+ eventScope +
eventNa
@@ -1844,32 +1844,45 @@
%09var refPath =
+ eventScope +
eventName + '/t
@@ -2011,32 +2011,45 @@
%0A%09%09var refPath =
+ eventScope +
eventName + %22/t
@@ -2192,32 +2192,45 @@
var refPath =
+ eventScope +
eventName + %22/t
@@ -2375,32 +2375,45 @@
%09var refPath =
+ eventScope +
eventName + %22/m
@@ -2547,32 +2547,45 @@
%09var refPath =
+ eventScope +
eventName + %22/m
@@ -2716,32 +2716,32 @@
ta, callback) %7B%0A
-
%09var refPath =
@@ -2736,24 +2736,37 @@
ar refPath =
+ eventScope +
eventName +
|
9a89d011e855bbdce746e4ee4da024b786acd9ce
|
Remove unreachable rule from eslint
|
gulpfile.js
|
gulpfile.js
|
'use strict';
/////////////////////////////////////////////////////////////////////////
// PLUGINS & MODULES //
/////////////////////////////////////////////////////////////////////////
let gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
connect = require('gulp-connect'),
csscomb = require('gulp-csscomb'),
csso = require('gulp-csso'),
eslint = require('gulp-eslint'),
htmlhint = require('gulp-htmlhint'),
htmlmin = require('gulp-htmlmin'),
imagemin = require('gulp-imagemin'),
sass = require('gulp-sass'),
stripDebug = require('gulp-strip-debug'),
uglify = require('gulp-uglify'),
util = require('gulp-util');
/////////////////////////////////////////////////////////////////////////
// PATH //
/////////////////////////////////////////////////////////////////////////
let path = {};
path.dev = {};
path.public = {};
path.dev.app = "dev/app/";
let assets = "dev/assets/";
path.dev.fonts = assets + "fonts/";
path.dev.img = assets + "img/";
path.dev.lib = assets + "lib/";
let pbl = "public/";
path.public.css = pbl + "css/";
path.public.fonts = pbl + "fonts/";
path.public.img = pbl + "img/";
path.public.js = pbl + "js/";
path.public.lib = pbl + "lib/";
path.public.templates = pbl + "templates/";
let production = util.env.type === 'prod';
/////////////////////////////////////////////////////////////////////////
// SOURCE //
/////////////////////////////////////////////////////////////////////////
let appJs = [ path.dev.app + "app.js", path.dev.app + "**/*.js",
path.dev.app + "**/*.*.js" ],
vendorJs = [ path.dev.lib + "jQuery/*.js",
path.dev.lib + "jquery-validate/jquery-validate.js",
path.dev.lib + "jquery-validate/*.js",
path.dev.lib + "angular/*.js",
path.dev.lib + "**/*.js" ],
fonts = [ path.dev.fonts + "*.ttf", path.dev.fonts + "*.woff",
path.dev.fonts + "*.woff2", path.dev.fonts + "*.eot" ],
vendorCss = [ path.dev.lib + "**/*.css", path.dev.lib + "**/*.*.css" ],
sassSrc = [ path.dev.app + "**/*.scss" ],
templateSrc = [ path.dev.app + "**/*.html", path.dev.app + "**/*.*.html" ],
imgSrc = [ path.dev.img + "*.jpg", path.dev.img + "*.png" ];
/////////////////////////////////////////////////////////////////////////
// CONNECT TASKS //
/////////////////////////////////////////////////////////////////////////
gulp.task ('connect', () => {
connect.server({
root: 'public/',
port: 3000,
livereload: true
});
});
/////////////////////////////////////////////////////////////////////////
// JS TASKS //
/////////////////////////////////////////////////////////////////////////
gulp.task ( 'app-js', () => {
return gulp.src( appJs )
.pipe(eslint({
rules: {
'strict': 1,
'comma-dangle': 2,
'no-unreachable': 2,
'vars-on-top': 1,
'block-spacing': 1,
'comma-spacing': 1,
'array-bracket-spacing': 1,
'comma-style': 1,
'space-infix-ops': 1,
'space-before-func-paren': 1,
'space-before-blocks': 1
},
env: {
es6: true
}
}))
.pipe(eslint.format())
.pipe( concat('bundle.js') )
.pipe( production ? uglify() : util.noop() )
.pipe( production ? stripDebug() : util.noop() )
.pipe( gulp.dest(path.public.js) )
.pipe( connect.reload() );
} );
gulp.task ( 'vendor-js', () => {
return gulp.src( vendorJs )
.pipe( concat('vendor.js') )
.pipe( production ? uglify() : util.noop() )
.pipe( gulp.dest(path.public.lib) )
.pipe( connect.reload() );
} );
/////////////////////////////////////////////////////////////////////////
// CSS TASKS //
/////////////////////////////////////////////////////////////////////////
gulp.task ( 'css', () => {
return gulp.src ( sassSrc )
.pipe( sass() )
.pipe( concat('style.css') )
.pipe( csso (
{
restructure: production,
sourceMap: !production,
debug: !production
}
))
.pipe( production ? util.noop() : csscomb() )
.pipe( autoprefixer( { browsers: [ "> 0%" ] } ) )
.pipe( gulp.dest(path.public.css) )
.pipe( connect.reload() );
} );
gulp.task ( 'vendor-css', () => {
return gulp.src ( vendorCss )
.pipe( concat('vendor.css') )
.pipe( csso (
{
restructure: production,
sourceMap: !production,
debug: !production
}
))
.pipe( production ? util.noop() : csscomb() )
.pipe( gulp.dest(path.public.lib) )
.pipe( connect.reload() );
} );
/////////////////////////////////////////////////////////////////////////
// HTML TASKS //
/////////////////////////////////////////////////////////////////////////
gulp.task ( 'templates', () => {
return gulp.src( templateSrc )
.pipe( htmlmin( { collapseWhitespace: true } ) )
.pipe( htmlhint() )
.pipe( gulp.dest( path.public.templates ) )
.pipe( connect.reload() );
} );
gulp.task( 'reload-index', () => {
return gulp.src("public/index.html")
.pipe(connect.reload());
} );
/////////////////////////////////////////////////////////////////////////
// RESOURCES TASKS //
/////////////////////////////////////////////////////////////////////////
gulp.task ( 'img', () => {
return gulp.src( imgSrc )
.pipe( imagemin() )
.pipe( gulp.dest( path.public.img ) )
.pipe( connect.reload() );
} );
gulp.task ( 'fonts', () => {
return gulp.src( fonts )
.pipe( gulp.dest(path.public.fonts) )
.pipe( connect.reload() );
} );
/////////////////////////////////////////////////////////////////////////
// WATCH //
/////////////////////////////////////////////////////////////////////////
gulp.task ( 'watch', () => {
gulp.watch ( appJs, ['app-js'] );
gulp.watch ( vendorJs, ['vendor-js'] );
gulp.watch ( vendorCss, ['vendor-css'] );
gulp.watch ( sassSrc, ['css'] );
gulp.watch ( templateSrc, ['templates'] );
gulp.watch ( imgSrc, ['img'] );
gulp.watch ( fonts, ['fonts'] );
gulp.watch ( "public/index.html", ['reload-index'] );
} );
/////////////////////////////////////////////////////////////////////////
// DEFAULT //
/////////////////////////////////////////////////////////////////////////
gulp.task ( 'default', [ 'vendor-js', 'app-js', 'vendor-css', 'css',
'img', 'fonts', 'templates' ] );
|
JavaScript
| 0.000013 |
@@ -3339,33 +3339,8 @@
2,%0A
-%09%09%09%09'no-unreachable': 2,%0A
%09%09%09%09
|
2cfd5199c59ca84d479f00b4c95a15238dc225c3
|
use font awesome version 4.2 instead of 4.3
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var notify = require('gulp-notify');
var htmlreplace = require('gulp-html-replace');
var minifiy_css = require('gulp-minify-css');
var main_bower = require('main-bower-files');
var filter = require('gulp-filter');
var bower_dir = 'public/js/lib/vendor/bower_components';
/**
Starting point for gulp... the default task is a blank task depending on the array passed in
*/
gulp.task('default', ['minify-js', 'replace-js', 'minify-css', 'replace-css', 'minify-bower', 'replace-bower', 'minify-libs', 'replace-libs']);
/****************************************
Minify
*****************************************/
/**
These are all js files from winstonApp
*/
gulp.task('minify-js', function() {
return gulp.src(['public/js/app.js', 'public/js/controllers/*.js', 'public/js/services/*.js'])
.pipe(concat('app.min.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js/app-min'))
.pipe(notify({ message: 'Finished minifying app (excluding bower)'}));
});
/**
Make sure to manually add new css libs here
*/
gulp.task('minify-css', function() {
return gulp.src([bower_dir + '/normalize.css/normalize.css',
bower_dir + '/bootstrap/dist/css/bootstrap.css',
bower_dir + '/angular-material/angular-material.css',
bower_dir + '/fullcalendar/dist/fullcalendar.css',
'//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css',
bower_dir + '/ngprogress-lite/ngprogress-lite.css',
bower_dir + '/angular-socialshare/angular-socialshare.css',
'public/css/style.css'])
.pipe(concat('css.min.css'))
.pipe(minifiy_css())
.pipe(gulp.dest('public/css/css-min'))
.pipe(notify({ message: 'Finished minifying css'}));
});
/**
This grabs all main bower js files...if its in bower, its included in here
*/
gulp.task('minify-bower', function() {
var jsFilter = filter('*.js')
return gulp.src(main_bower())
.pipe(jsFilter)
.pipe(concat('bower.min.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js/bower/bower-min'))
.pipe(notify({ message: 'Finished minifying bower'}))
.pipe(jsFilter.restore());
});
/**
Make sure to manually add new libs into this!
*/
gulp.task('minify-libs', function() {
return gulp.src(['public/js/lib/calendar.js',
'public/js/lib/filterStabilize.js',
'public/js/lib/fuse.min.js',
'public/js/lib/memoize.js',
'public/js/lib/twitter.min.js'
])
.pipe(concat('libs.min.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js/libs/libs-min'))
.pipe(notify({ message: 'Finished minifying libs'}));
});
/****************************************
Replace
*****************************************/
gulp.task('replace-libs', ['minify-libs'], function() {
return gulp.src('views/libs.html')
.pipe(htmlreplace({
'js': 'js/libs/libs-min/libs.min.js'
}))
.pipe(notify({ message: 'Finished replacing libs in html'}))
.pipe(gulp.dest('views/build'));
})
gulp.task('replace-bower', ['minify-bower'], function() {
gulp.src('views/bower.html')
.pipe(htmlreplace({
'js': 'js/bower/bower-min/bower.min.js'
}))
.pipe(notify({ message: 'Finished replacing bower in html'}))
.pipe(gulp.dest('views/build'));
});
gulp.task('replace-js', ['minify-js'], function() {
gulp.src('views/includes.html')
.pipe(htmlreplace({
'js': 'js/app-min/app.min.js'
}))
.pipe(notify({ message: 'Finished replacing js in html'}))
.pipe(gulp.dest('views/build'));
});
gulp.task('replace-css', ['minify-css'], function() {
gulp.src('views/styles.html')
.pipe(htmlreplace({
'css': 'css/css-min/css.min.css'
}))
.pipe(notify({ message: 'Finished replacing css in html'}))
.pipe(gulp.dest('views/build'));
});
|
JavaScript
| 0.00001 |
@@ -1481,9 +1481,9 @@
e/4.
-3
+2
.0/c
|
23ed122a85fa2f941d1b2ade075b4a2a6c925307
|
add build task and point default task to build task
|
gulpfile.js
|
gulpfile.js
|
'use strict';
//node modules
var path = require('path');
// node_modules modules
var _ = require('lodash');
var browserify = require("browserify");
var browserSync = require("browser-sync");
var bsreload = browserSync.reload;
var del = require('del');
var mergeStream = require('merge-stream');
var q = require('q');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
// gulp modules
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
// kickstart modules
var assemble = require('kickstart-assemble');
// user project configuration
var config = require('./config.js');
// error handler
var onError = function (err, cb) {
plugins.util.beep();
plugins.util.log(plugins.util.colors.red(err));
if (typeof this.emit === 'function') this.emit('end');
};
// clean task
gulp.task('clean', function (cb) {
del([
config.dest.base
], cb);
});
// styles task
gulp.task('styles', function () {
return gulp.src(config.src.styles)
.pipe(plugins.plumber({ errorHandler: onError }))
.pipe(plugins.sass(config.sass.settings))
.pipe(plugins.if(!config.dev, plugins.combineMediaQueries()))
.pipe(plugins.autoprefixer(config.sass.autoprefixer))
.pipe(plugins.if(!config.dev, plugins.csso()))
.pipe(gulp.dest(config.dest.styles))
.pipe(plugins.if(config.dev, bsreload({ stream: true })));
});
// scripts task
gulp.task('scripts', function () {
var browserifyTask = function () {
var browserifyThis = function (bundleConfig) {
if (config.dev) {
_.extend(config.src.scriptBundles, watchify.args, { debug: true });
bundleConfig = _.omit(bundleConfig, ['external', 'require']);
}
var b = browserify(bundleConfig);
var bundle = function () {
return b
.bundle()
.on('error', onError)
.pipe(source(bundleConfig.outputName))
.pipe(gulp.dest(bundleConfig.dest))
.pipe(plugins.if(config.dev, bsreload({ stream: true })));
};
if (config.dev) {
b = watchify(b);
b.on('update', bundle);
} else {
if (bundleConfig.require) b.require(bundleConfig.require);
if (bundleConfig.external) b.external(bundleConfig.external);
}
return bundle();
};
return mergeStream.apply(gulp, _.map(config.scriptBundles, browserifyThis));
}
return browserifyTask();
});
// images task
gulp.task('images', function () {
return gulp.src(config.src.images)
.pipe(plugins.changed(config.dest.images))
.pipe(plugins.if(!config.dev, plugins.imagemin(config.images)))
.pipe(gulp.dest(config.dest.images))
.pipe(plugins.if(config.dev, bsreload({ stream: true })));
});
// fonts task
gulp.task('fonts', function () {
return gulp.src(config.src.fonts)
.pipe(gulp.dest(config.dest.fonts));
});
// copy extra files task
gulp.task('copy:extras', function (done) {
return gulp.src('./src/*.{ico,txt}')
.pipe(gulp.dest(config.dest.base));
});
gulp.task('templates', function(done) {
var opts = {
assets: config.dest.base + '/assets',
data: [config.src.data],
production: false,
layout: 'default-layout',
layouts: 'src/layouts/*.html',
partials: 'src/includes/**/*.html',
pages: 'src/pages/**/*.html',
dest: config.dest.base
};
assemble.templates(opts, done);
});
gulp.task('styleguide', function(done) {
var base = 'src/includes/patterns';
var opts = {
data: [config.src.data],
patterns: {
components: [base + '/components/**/*.{hbs,html}'],
modules: [base + '/modules/**/*.{hbs,html}'],
strutures: [base + '/structures/**/*.{hbs,html}'],
templates: [base + '/templates/**/*.{hbs,html}']
},
src: base + '/**/*.{hbs,html}',
dest: config.dest.base + '/styleguide'
};
assemble.styleguide(opts);
done();
});
gulp.task('browserSync', function () {
return browserSync(config.browserSync);
});
// watch task
gulp.task('watch', function () {
// plugins.watch(config.src.html, function () {
// plugins.sequence('compile', function() {
// bsreload();
// });
// });
plugins.watch(config.src.styles, function () {
gulp.start('styles:app')
});
plugins.watch(config.src.images, function () {
gulp.start('images:app')
});
});
// test performance task
gulp.task('test:performance', function () {
//TODO: write the performance tasks
});
// performance task entry point
gulp.task('perf', ['test:performance']);
// compile task
gulp.task('compile', ['templates', 'styleguide']);
// production build task
gulp.task('build:production', ['clean'], function (cb) {
plugins.sequence(
['fonts', 'images', 'styles', 'scripts'],
['compile', 'copy:extras'],
done
);
});
gulp.task('default', ['clean'], function(done) {
plugins.sequence(
['fonts', 'images', 'styles', 'scripts'],
['compile', 'copy:extras'],
['browserSync', 'watch'],
done
);
});
|
JavaScript
| 0 |
@@ -5113,23 +5113,21 @@
p.task('
-default
+build
', %5B'cle
@@ -5316,10 +5316,44 @@
);%0A%7D);%0A%0A
+gulp.task('default', %5B'build'%5D);%0A%0A
%0A%0A
|
cbddbf7dfe02d8260b0b5376c2ee5bb114337a83
|
Add flipper dude
|
fliptext.js
|
fliptext.js
|
(function() {
var flippedCharacterSet = {
a: "\u0250",
b: "q",
c: "\u0254",
d: "p",
e: "\u01DD",
f: "\u025F",
g: "\u0183",
h: "\u0265",
i: "\u0131",
j: "\u027E",
k: "\u029E",
l: "l",
m: "\u026F",
n: "u",
o: "o",
p: "d",
q: "b",
r: "\u0279",
s: "s",
t: "\u0287",
u: "n",
v: "\u028C",
w: "\u028D",
y: "\u028E",
z: "z",
1: "\u21C2",
2: "\u1105",
3: "\u1110",
4: "\u3123",
5: "\u03DB",
6: "9",
7: "\u3125",
8: "8",
9: "6",
0: "0",
".": "\u02D9",
",": "'",
"'": ",",
'"': ",,",
"´": ",",
"`": ",",
";": "\u061B",
"!": "\u00A1",
"\u00A1": "!",
"?": "\u00BF",
"\u00BF": "?",
"[": "]",
"]": "[",
"(": ")",
")": "(",
"{": "}",
"}": "{",
"<": ">",
">": "<",
_: "\u203E",
"\r": "\n"
};
var flipText = function(input, emoji) {
emoji = emoji || false;
var output = "";
for (var i = input.length - 1; i >= 0; i--) {
output += flippedCharacterSet[input.charAt(i)] || input.charAt(i);
};
return output;
}
window.flipText = flipText;
})();
|
JavaScript
| 0 |
@@ -900,16 +900,50 @@
%22%0A %7D;%0A%0A
+ var flipperDude = %22(%E2%95%AF%C2%B0%E2%96%A1%C2%B0)%E2%95%AF%EF%B8%B5 %22;%0A%0A
var fl
@@ -1155,16 +1155,64 @@
%0A %7D;%0A
+%0A if (emoji) output = flipperDude + output;%0A%0A
retu
|
4ab2da15f727949b45ce8751df041fb3295d5ae0
|
Change template spec to passing so that test works on first run
|
template/src/index.spec.js
|
template/src/index.spec.js
|
describe('<%= projectName %>', function () {
xit('should work', function () {
})
})
|
JavaScript
| 0 |
@@ -44,9 +44,8 @@
%7B%0A
-x
it('
|
ac30303dcb82304e2d48d5c258e3870a88e0781b
|
Clean up comments
|
index.ios.js
|
index.ios.js
|
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View
} from 'react-native';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import rootReducer from './app/reducers/rootReducer.js';
import ViewContainer from './app/containers/container_viewContainer';
import thunk from 'redux-thunk';
import createLogger from 'redux-logger';
import promise from 'redux-promise';
import Signin from './app/containers/container_FBLogin';
import FriendList from './app/components/FriendList';
import { Router, Scene, Actions} from 'react-native-router-flux';
//creates logger
const logger = createLogger();
// creates store
const store = createStore(
rootReducer,
applyMiddleware(thunk, promise, logger)
);
const findAR = () => (
<Provider store={store}>
<Router scenes={scenes} />
</Provider>
);
const scenes = Actions.create(
<Scene key="root" hideNavBar>
<Scene initial key="login" component={Signin} />
<Scene key="view" component={ViewContainer} />
<Scene key="friends" component={FriendList} />
</Scene>
);
AppRegistry.registerComponent('findAR', () => findAR);
|
JavaScript
| 0 |
@@ -1,83 +1,4 @@
-/**%0A * Sample React Native App%0A * https://github.com/facebook/react-native%0A */%0A
'use
|
6865625d185fdbf89355428874e879f4c9bc66a9
|
Fix typo
|
gulpfile.js
|
gulpfile.js
|
'use strict';
var gulp = require('gulp'),
runSequence = require('run-sequence'),
karma = require('gulp-karma'),
protractor = require('gulp-protractor').protractor,
webdriver = require('gulp-protractor').webdriver,
webdriverUpdate = require('gulp-protractor').webdriver_update,
jshint = require('gulp-jshint'),
browserify = require('browserify'),
source = require('vinyl-source-stream'),
streamify = require('gulp-streamify'),
uglifyify = require('uglifyify'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
ngAnnotate = require('browserify-ngannotate'),
templateCache = require('gulp-angular-templatecache'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
morgan = require('morgan'),
express = require('express'),
livereload = require('connect-livereload'),
livereloadport = 35728,
serverport = 3000;
/************************************************
Web Server
***********************************************/
var server = express();
// log all requests to the console
server.use(morgan('dev'));
// Add live reload
server.use(livereload({port: livereloadport}));
server.use(express.static('./build'));
// Serve index.html for all routes to leave routing up to Angular
server.all('/*', function(req, res) {
res.sendFile('index.html', { root: 'build' });
});
/************************************************
Gulp Development/Production Tasks
***********************************************/
// JSHint task
gulp.task('lint', function() {
return gulp.src(['app/js/**/*.js', '!app/js/templates.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Browserify task
gulp.task('browserify', function() {
var b = browserify({
basedir: '.',
entries: './app/js/main.js',
debug: true,
insertGlobals: true
});
b.transform({
global: true
}, ngAnnotate);
b.transform({
global: true
}, uglifyify);
return b.bundle()
.pipe(source('main.js'))
.pipe(streamify(rename({suffix: '.min'})))
.pipe(gulp.dest('build/js'))
.pipe(refresh(lrserver));
});
// Styles task
gulp.task('styles', function() {
return gulp.src('app/styles/main.scss')
// The onerror handler prevents Gulp from crashing when you make a mistake in your SASS
.pipe(sass({style: 'compressed', onError: function(e) { console.log(e); } }))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('build/css/'))
.pipe(refresh(lrserver));
});
// Views task
gulp.task('views', function() {
// Put our index.html in the dist folder
gulp.src('app/index.html')
.pipe(gulp.dest('build/'));
// Process any other view files from app/views
return gulp.src('app/views/**/*.html')
.pipe(templateCache({
standalone: true
}))
.pipe(gulp.dest('app/js'))
.pipe(refresh(lrserver));
});
gulp.task('watch', function() {
// Watch our scripts
gulp.watch(['app/js/**/*.js'],[
'lint',
'browserify'
]);
// Watch our styles
gulp.watch(['app/styles/**/*.scss'], [
'styles'
]);
// Watch our views
gulp.watch(['app/index.html', 'app/views/**/*.html'], [
'views'
]);
});
// Dev task
gulp.task('dev', function() {
// Start webserver if not already running
try {
server.listen(serverport);
} catch(e) {
console.log('Server running.');
}
// Start live reload
lrserver.listen(livereloadport);
// Run all tasks once
runSequence('styles', 'views', 'browserify');
// Then, run the watch task to keep tabs on changes
gulp.start('watch');
});
/************************************************
Gulp Testing Tasks
***********************************************/
// Unit test task
gulp.task('unit', function() {
// Nonsensical source to fall back to files listened in karma.conf.js,
// see https://github.com/lazd/gulp-karma/issues/9
return gulp.src('./thisdoesntexist')
.pipe(karma({
configFile: 'test/karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
// Make sure failed tests cause gulp to exit non-zero
throw err;
});
});
// Webdriver tasks for Protractor testing
gulp.task('webdriver-update', webdriverUpdate);
gulp.task('webdriver', webdriver);
// Protractor test task
gulp.task('protractor', ['webdriver-update', 'webdriver'], function() {
return gulp.src('test/e2e/**/*.js')
.pipe(protractor({
configFile: 'test/protractor.conf.js'
}))
.on('error', function(err) {
// Make sure failed tests cause gulp to exit non-zero
throw err;
});
});
// Run all tests at once
gulp.task('test', function() {
// Start webserver if not already running
try {
server.listen(serverport);
} catch(e) {
console.log('Server running.');
}
// Run both unit and e2e tests
runSequence('unit', 'protractor');
});
|
JavaScript
| 0.999999 |
@@ -4047,18 +4047,16 @@
es liste
-ne
d in kar
|
36753ee9b4666548566eaa58403ada204a601610
|
Add gulp watch
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
gulp.task('default', ['lint', 'style']);
gulp.task('lint', function() {
gulp.src(['*.js', 'app/**/*.js', 'config/*.js', 'test/*.js'])
.pipe(jshint({linter: require('jshint-jsx').JSXHINT}))
.pipe(jshint.reporter(stylish));
});
gulp.task('scripts', function() {
gulp.src('app/client.js')
.pipe(browserify({
debug: true,
transform: ['reactify']
}))
.pipe(gulp.dest('./public/js/'));
});
gulp.task('style', function() {
gulp.src(['*.js', 'app/controllers/*.js', 'config/*.js', 'test/*.js'])
.pipe(jscs());
});
|
JavaScript
| 0.000001 |
@@ -182,50 +182,8 @@
);%0A%0A
-gulp.task('default', %5B'lint', 'style'%5D);%0A%0A
gulp
@@ -680,16 +680,167 @@
e(jscs());%0A%7D);%0A%0A
+gulp.task('watch', function() %7B%0A gulp.watch(%5B'app/*.js', 'app/components/*.js'%5D, %5B'scripts'%5D);%0A%7D);%0A%0Agulp.task('default', %5B'lint', 'style', 'watch'%5D);%0A
|
7bc0327770f2cfa9179c6a7515233672a562aedb
|
use gulp-unused
|
gulpfile.js
|
gulpfile.js
|
'use strict';
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var eslint = require('gulp-eslint');
var through = require('through2');
gulp.task('coverage', function() {
return gulp.src(['index.js', 'lib/**/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['coverage'], function() {
return gulp.src('test/*.js')
.pipe(mocha({reporter: 'spec'}))
.pipe(istanbul.writeReports());
});
gulp.task('lint', function() {
return gulp.src(['*.js', 'lib/**/*.js', 'test/*.js'])
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('vars', function() {
var utils = require('./lib/utils');
var keys = Object.keys(utils);
var report = {};
var cache = {};
return gulp.src(['index.js', 'lib/**/*.js'])
.pipe(through.obj(function(file, enc, next) {
var str = file.contents.toString();
keys.forEach(function(key) {
report[key] = report[key] || 0;
var re = cache[key] || (cache[key] = new RegExp('\\.' + key, 'g'));
var m = str.match(re);
if (!m) return;
report[key]++;
});
next(null, file);
}, function(next) {
var keys = Object.keys(report);
var res = {};
keys.sort(function(a, b) {
return report[a] > report[b] ? -1 : 1;
});
keys.forEach(function(key) {
res[key] = report[key];
});
console.log(res);
console.log(keys.length, 'modules');
next();
}))
});
gulp.task('default', ['test', 'lint']);
|
JavaScript
| 0.000002 |
@@ -153,23 +153,22 @@
');%0Avar
-through
+unused
= requi
@@ -175,16 +175,19 @@
re('
-through2
+gulp-unused
');%0A
@@ -640,12 +640,14 @@
sk('
-vars
+unused
', f
@@ -664,558 +664,76 @@
%7B%0A
-var utils = require('./lib/utils');%0A var keys = Object.keys(utils);%0A var report = %7B%7D;%0A var cache = %7B%7D;%0A%0A return gulp.src(%5B'index.js', 'lib/**/*.js'%5D)%0A .pipe(through.obj(function(file, enc, next) %7B%0A var str = file.contents.toString();%0A keys.forEach(function(key) %7B%0A report%5Bkey%5D = report%5Bkey%5D %7C%7C 0;%0A var re = cache%5Bkey%5D %7C%7C (cache%5Bkey%5D = new RegExp('%5C%5C.' + key, 'g'));%0A var m = str.match(re);%0A if (!m) return;%0A report%5Bkey%5D++;%0A %7D);%0A%0A next(null, file);%0A %7D, function(next) %7B%0A var
+return gulp.src(%5B'index.js', 'lib/**/*.js'%5D)%0A .pipe(unused(%7B
keys
- =
+:
Obj
@@ -747,298 +747,40 @@
s(re
-port);%0A var res = %7B%7D;%0A%0A keys.sort(function(a, b) %7B%0A return report%5Ba%5D %3E report%5Bb%5D ? -1 : 1;%0A %7D);%0A%0A keys.forEach(function(key) %7B%0A res%5Bkey%5D = report%5Bkey%5D;%0A %7D);%0A%0A console.log(res);%0A console.log(keys.length, 'modules');%0A next();%0A
+quire('./lib/utils.js'))
%7D))%0A%7D);%0A
gulp
@@ -775,16 +775,17 @@
%7D))%0A%7D);%0A
+%0A
gulp.tas
|
bd1ce753b3c558e27ef1d8b3186ec7418db2f33d
|
Change the buildin action of the refernece.
|
reference/built-in-action.js
|
reference/built-in-action.js
|
var loadManyReferenceList = require('./builder').loadMany;
var dispatcher = require('../dispatcher');
module.exports =
function(referenceNames){
return function(){
return Promise.all(loadManyReferenceList(referenceNames))
.then(function successReferenceLoading(data){
dispatcher.handleViewAction({data: data, type: 'update'});
}, function errorReferenceLoading(err){
dispatcher.handleViewAction({data: err, type: 'error'});
});
};
};
|
JavaScript
| 0 |
@@ -99,193 +99,641 @@
');%0A
-module.exports =%0Afunction(referenceNames)%7B%0A return function()%7B%0A return Promise.all(loadManyReferenceList(referenceNames))%0A .then(function successReferenceLoading(data)%7B
+%0A/**%0A * Focus reference action.%0A * @param %7Barray%7D referenceNames - An array which contains the name of all the references to load.%0A * @returns %7BPromise%7D - The promise of loading all the references.%0A */%0Afunction builtInReferenceAction(referenceNames)%7B%0A return function()%7B%0A return Promise.all(loadManyReferenceList(referenceNames))%0A .then(function successReferenceLoading(data)%7B%0A //Rebuilt a constructed information from the map.%0A var reconstructedData = %7B%7D;%0A referenceNames.map((name, index)=%3E%7B%0A reconstructedData%5Bname%5D = data%5Bindex%5D;%0A %7D);%0A //
%0A
@@ -777,17 +777,30 @@
(%7Bdata:
-d
+reconstructedD
ata, typ
@@ -810,16 +810,38 @@
'update'
+, subject: 'reference'
%7D);%0A
@@ -981,10 +981,51 @@
%7D;%0A%7D
+%0A%0Amodule.exports = builtInReferenceAction
;%0A
|
5099ca19843a9fc91ae9c868bf5dda91c396c321
|
update gulpfile settings
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
coffee = require('gulp-coffee'),
watch = require('gulp-watch'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
browserify = require('gulp-browserify'),
rename = require('gulp-rename'),
connect = require('gulp-connect');
gzip = require('gulp-gzip');
fs = require('fs');
s3 = require('gulp-s3');
var dest = './dist';
var paths = {
main_stylesheet: ['./src/stylesheets/app.scss'],
stylesheets: ['./src/stylesheets/*.scss'],
main_javascript: ['./src/javascripts/app.coffee'],
javascripts: ['./src/javascripts/**/*.coffee'],
html: ['./src/html/podigee-podcast-player.html', './src/html/embed-example.html'],
images: ['./src/images/**'],
fonts: ['./vendor/fonts/**'],
themes: {
html: ['./src/themes/**/index.html'],
css: ['./src/themes/**/*.scss']
}
};
gulp.task('upload', function() {
awsCredentials = JSON.parse(fs.readFileSync('./aws.json'))
return gulp.src('build/**')
.pipe(s3(awsCredentials, {
uploadPath: "/podigee-podcast-player/",
headers: {'x-amz-acl': 'public-read'}
}))
})
gulp.task('stylesheets', function() {
return gulp.src(paths.main_stylesheet)
.pipe(sass({style: 'compressed'}))
.pipe(gulp.dest('./build/stylesheets'))
.pipe(gzip())
.pipe(gulp.dest('./build/stylesheets'))
.pipe(connect.reload())
})
gulp.task('javascripts', function() {
gulp.src(paths.main_javascript, {read: false})
.pipe(browserify({
transform: ['coffeeify'],
extensions: ['.coffee']
}))
//.pipe(uglify())
.pipe(rename('podigee-podcast-player.js'))
.pipe(gulp.dest('./build/javascripts'))
.pipe(gzip())
.pipe(gulp.dest('./build/javascripts'))
.pipe(connect.reload())
})
gulp.task('html', function() {
gulp.src(paths.html)
.pipe(gulp.dest('./build'))
.pipe(connect.reload())
})
gulp.task('images', function() {
gulp.src(paths.images)
.pipe(gulp.dest('./build/images'))
.pipe(connect.reload())
})
gulp.task('fonts', function() {
gulp.src(paths.fonts)
.pipe(gulp.dest('./build/fonts'))
.pipe(connect.reload())
})
gulp.task('themes', function() {
gulp.src(paths.themes.html)
.pipe(gulp.dest('./build/themes'))
.pipe(connect.reload())
gulp.src(paths.themes.css)
.pipe(sass({style: 'compressed'}))
.pipe(gulp.dest('./build/themes'))
.pipe(connect.reload())
})
gulp.task('default', ['stylesheets', 'javascripts', 'html', 'images', 'fonts', 'themes'])
gulp.task('watch', function() {
// Watch .scss files
gulp.watch(paths.stylesheets, ['stylesheets'])
// Watch .js files
gulp.watch(paths.javascripts, ['javascripts'])
// Watch .html files
gulp.watch(paths.html, ['html'])
// Watch images files
gulp.watch(paths.images, ['images'])
// Watch theme files
gulp.watch(paths.themes.html, ['themes'])
gulp.watch(paths.themes.css, ['themes'])
})
gulp.task('connect', function() {
connect.server({
root: [__dirname],
livereload: true
});
});
// Serve
gulp.task('serve', ['default', 'connect', 'watch']);
|
JavaScript
| 0 |
@@ -1097,24 +1097,16 @@
Path: %22/
-podigee-
podcast-
@@ -1611,18 +1611,16 @@
%7D))%0A
-//
.pipe(ug
@@ -3008,16 +3008,37 @@
erver(%7B%0A
+ host: '0.0.0.0',%0A
root
|
85ea5905ffa9c650f91fc706d164cb00ebd2d668
|
work on comments in the gulpfile
|
gulpfile.js
|
gulpfile.js
|
// GULP DEPENDENCIES
// ----------------------------------------------------------------------------
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imageMin = require('gulp-imagemin');
var notify = require('gulp-notify');
var rename = require('gulp-rename');
var cache = require('gulp-cache');
var del = require('del');
var scsslint = require('gulp-scss-lint');
// GULP TASKS.
// ----------------------------------------------------------------------------
gulp.task('styles', function() {
return sass('./resources/assets/scss/*.scss', { style: 'expanded' })
.pipe(autoprefixer('last 2 version'))
.pipe(gulp.dest('./public/css'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('./public/css'))
.pipe(notify({ message: 'Styles task complete' }));
});
// Lint the scss resources,
// This function is depended on.
// the scss_lint gem.
// You can install it with the following command:
//
// gem install scss_lint
gulp.task('scss-lint', function() {
return gulp.src('./resources/assets/scss/*.scss')
.pipe(scsslint());
});
// Clean the assets directories.
gulp.task('clean', function() {
return del(['./public/styles']);
});
// Gulp default task.
// You can simply run it with `gulp`
gulp.task('default', ['clean'], function() {
gulp.start('styles');
});
gulp.task('watch', function() {
// Watch .scss files.
gulp.watch('./resources/assets/scss/*.scss', ['styles']);
});
|
JavaScript
| 0 |
@@ -751,16 +751,63 @@
-------%0A
+// TODO: need to set up a help command shell.%0A%0A
gulp.tas
@@ -1689,16 +1689,38 @@
);%0A%7D);%0A%0A
+// Watch for changes.%0A
gulp.tas
|
9f90fc3002b3f895092c736e3ef1982c8f23e46e
|
Copy CSS manually
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp')
, notify = require("gulp-notify")
, csso = require('gulp-csso')
, uglify = require('gulp-uglify')
, connect = require('gulp-connect')
, compass = require('gulp-for-compass')
, concat = require('gulp-concat')
, autoprefixer = require('gulp-autoprefixer')
, imageminJpegtran = require('imagemin-jpegtran')
, imageminPngquant = require('imagemin-pngquant')
, imageResize = require('gulp-image-resize');
;
//server
gulp.task('server', function() {
connect.server({
livereload: true
});
});
//html
gulp.task('html',function(){
gulp.src('index.html')
.pipe(connect.reload())
.pipe(notify("Change index.html"));
});
//css
gulp.task('css',function(){
gulp.src('style.css')
.pipe(connect.reload());
});
//js
gulp.task('js', function() {
gulp.src('./lib/js/**/*.js')
.pipe(connect.reload());
});
//compress pic
gulp.task('compress-image', function () {
gulp.src('./lib/**.jpg')
.pipe(imageminJpegtran({progressive: true})())
.pipe(gulp.dest('./build/lib/'));
gulp.src('./lib/pic/**')
.pipe(imageResize({ width : 1280 }))
.pipe(gulp.dest('./build/lib/pic/'));
gulp.src('./lib/image/**')
.pipe(imageResize({ width : 300 }))
.pipe(imageminJpegtran({progressive: true})())
.pipe(imageminPngquant({quality: '65-80', speed: 4})())
.pipe(gulp.dest('./build/lib/image/'));
});
//sass
gulp.task('sass', function(){
gulp.src('./lib/sass/**/*.sass')
.pipe(compass({
httpFontsPath: '../font/',
httpGeneratedImagesPath: '../pic/',
cssDir: './lib/css/',
sassDir: './lib/sass/',
fontsDir: './lib/font/',
imagesDir: './lib/pic/',
force: true
}))
.pipe(connect.reload())
.pipe(notify("Compile SASS"));
});
//concat
gulp.task('concat-js', function() {
return gulp.src([
'./lib/js/owl.carousel.js',
//'./lib/js/jquery.stellar.js',
//'./lib/js/jquery.appear.js',
'./lib/js/app.js',
'./lib/js/map.js'
])
.pipe(concat('app.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./lib/js/'));
});
//watch
gulp.task('watch', function () {
gulp.watch('./index.html', ['html']);
gulp.watch('./lib/sass/**/*', ['sass']);
gulp.watch('./lib/css/**/*', ['css']);
gulp.watch('./lib/js/**/*', ['concat-js', 'js']);
});
//compress css
gulp.task('compress-css', function() {
return gulp.src('./lib/css/style.css')
.pipe(autoprefixer({
browsers: ['last 10 versions'],
cascade: false
}))
.pipe(csso())
.pipe(gulp.dest('./build/lib/css/'));
});
//compress js
//gulp.task('compress-js', function() {
// gulp.src('./public/js/*')
// .pipe(uglify())
// .pipe(gulp.dest('./public/js/'))
//});
gulp.task('copy-src',['build-static'],function() {
gulp.src(['./index.html','./favicon.*'])
.pipe(gulp.dest('./build'))
gulp.src(['./lib/font/*'])
.pipe(gulp.dest('./build/lib/font'))
gulp.src(['./lib/js/app.min.js'])
.pipe(gulp.dest('./build/lib/js'))
});
gulp.task('build-static', ['sass', 'css', 'js', 'concat-js']);
gulp.task('default', ['server', 'html', 'build-static', 'watch']);
gulp.task('production', ['build-static', 'compress-css', 'compress-image','copy-src']);
|
JavaScript
| 0 |
@@ -3050,16 +3050,50 @@
-static'
+, 'compress-css', 'compress-image'
%5D,functi
@@ -3099,16 +3099,16 @@
ion() %7B%0A
-
gulp.s
@@ -3240,24 +3240,92 @@
lib/font'))%0A
+ gulp.src(%5B'./lib/css/*'%5D)%0A .pipe(gulp.dest('./build/lib/css'))%0A
gulp.src(%5B
@@ -3518,24 +3518,24 @@
'watch'%5D);%0A
+
gulp.task('p
@@ -3567,41 +3567,8 @@
c',
-'compress-css', 'compress-image',
'cop
|
1fd47d0bb5bad71b41f30575dc551b6284aab2c3
|
update extjs 5.0.1
|
app/assets/javascripts/fast_ext/app/view/VMenu.js
|
app/assets/javascripts/fast_ext/app/view/VMenu.js
|
Ext.define('FastExt.view.VMenu', {
extend:'Ext.tree.Panel',
requires:['FastExt.store.MWindowMgr'],
alias: 'widget.vMenu',
title:'Menu',
animate:false,
collapseMode:"mini",
collapsible:true,
iconCls:"fast-ext-menu",
lines:false,
rootVisible:false,
split:true,
dockedItems:[{dock:"top",items:[{xtype:"tbfill"},
{iconCls:"fast-ext-tree-expand",tooltip:"Expand All",xtype:"button", listeners:{click:{fn:function (sender ,e ,eOpts) {sender.up().up().expandAll();}}}},
{iconCls:"fast-ext-tree-collapse",tooltip:"Collapse All",xtype:"button", listeners:{click:{fn:function (sender ,e ,eOpts) { sender.up().up().collapseAll(); sender.up().up().getRootNode().expand();}}}}],xtype:"toolbar"}
],
initComponent: function(){
this.store = Ext.create('Ext.data.TreeStore', {
autoLoad:true,
fields:['id', {name:'text', mapping:'title'},'leaf','expanded', 'window'],
proxy:{
type:'ajax',
url:'/fast_ext/m_menu_items.json',
reader:{
type:'json',
root:'',
record:''
//successProperty:''
}
},
root:{
name:this.title,
id:'',
expanded:true
}
});
this.callParent(arguments);
},
listeners:{
itemclick:function(self, record, item, index, e, eOpts){
this.loadVWindow(self, record, item, index, e, eOpts);
}
},
loadVWindow:function (self, record, item, index, e, eOpts) {
var c = Ext.getCmp('mycenter');
c.setLoading(true);
var id = record.get('window');
//var id = 'm_list';
if (record.get('leaf')) {
FastExt.store.MWindowMgr.load(id, function (obj) {
var winId = 'win-' + id;
var win = Ext.getCmp(winId);
if (!win) {
win = Ext.create('FastExt.view.VWindow', {
id: winId,
valueObject: obj
});
c.add(win);
}
c.setActiveTab(win);
c.setLoading(false);
});
}
}
});
|
JavaScript
| 0.000001 |
@@ -892,12 +892,12 @@
me:'
-text
+name
', m
@@ -1278,18 +1278,18 @@
id:
-''
+ 1
,%0A
|
5f8d42bace0f904fa851de93571c417faf899ed7
|
switch from bower vendor folder to node-mnodules
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var sass = require('gulp-sass');
var nunjucks = require('gulp-nunjucks-html');
var spritesmith = require('gulp.spritesmith');
var merge = require('merge-stream');
var sourcemaps = require('gulp-sourcemaps');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var webserver = require('gulp-webserver');
var argv = require('yargs').argv;
var gulpif = require('gulp-if');
var urlAdjuster = require('gulp-css-url-adjuster');
var settings = {
build: {
prod: !!(argv.production || argv.prod),
version: parseInt(Math.random() * 10000000) + "-" + parseInt(Math.random() * 10000000)
}
}
console.log('Production mode: ', settings.build.prod);
gulp.task('styles', ['sprite'], function () {
return gulp.src([
'./m/_scss/**/*.scss'
])
.pipe(sass().on('error', sass.logError))
.pipe(concat('site.min.css'))
.pipe(urlAdjuster({
prepend: '',
append: '',
replace: ['../fonts/','../f/'],
}))
.pipe(gulpif(!settings.build.prod, sourcemaps.init()))
.pipe(cleanCSS())
.pipe(gulpif(!settings.build.prod, sourcemaps.write()))
.pipe(gulp.dest('./m/css'));
});
gulp.task('html', function () {
return gulp.src('./m/_templates/*.html')
.pipe(nunjucks({
searchPaths: ['./m/_templates'],
tags: {
blockStart: '<%',
blockEnd: '%>',
variableStart: '<$',
variableEnd: '$>',
commentStart: '<#',
commentEnd: '#>'
}
}))
.pipe(gulp.dest('./'));
});
gulp.task('webfonts', function() {
return gulp.src([
])
.pipe(gulp.dest('./m/f/'));
});
gulp.task('js-pre', function () {
return gulp.src([
'./m/_vendor/jquery/dist/jquery.min.js',
'./m/_vendor/bootstrap-sass/assets/javascripts/bootstrap.min.js',
'./m/_vendor/helix.jquery.equal-heights/src/jquery.equal-heights.js',
'./m/_vendor/underscore/underscore-min.js',
'./m/js/app/pre/**/*.js'
])
.pipe(gulpif(!settings.build.prod, sourcemaps.init()))
.pipe(concat('pre.min.js'))
.pipe(gulpif(settings.build.prod, uglify()))
.pipe(gulpif(!settings.build.prod, sourcemaps.write('./')))
.pipe(gulp.dest('./m/js/'));
});
gulp.task('js-post', function () {
return gulp.src([
'./m/js/app/post/**/*.js',
])
.pipe(gulpif(!settings.build.prod, sourcemaps.init()))
.pipe(concat('post.min.js'))
.pipe(gulpif(settings.build.prod, uglify()))
.pipe(gulpif(!settings.build.prod, sourcemaps.write('./')))
.pipe(gulp.dest('./m/js/'));
});
gulp.task('js', ['js-pre', 'js-post'], function () { });
gulp.task('sprite', function () {
var spriteData = gulp.src('./m/i/_spritesource/**/*.png')
.pipe(spritesmith({
padding: 15,
imgName: 'sprite.png',
imgPath: '../i/sprite.png?' + settings.build.version,
cssName: '_sprites.scss',
retinaSrcFilter: ['./m/i/_spritesource/**/*@2x.png'],
retinaImgName: '[email protected]',
retinaImgPath: '../i/[email protected]?' + settings.build.version,
}));
var imgStream = spriteData.img
.pipe(gulp.dest('./m/i/'));
var cssStream = spriteData.css
.pipe(gulp.dest('./m/_scss/'));
return merge(imgStream, cssStream);
});
gulp.task('webserver', ['default'], function () {
gulp.src('./')
.pipe(webserver({
livereload: {
enable: true,
filter: function (fileName) {
if (fileName.match(/.map$/)) {
return false;
} else {
return true;
}
}
},
directoryListing: true,
open: true
}));
});
gulp.task('process', ['webfonts', 'styles', 'html', 'js'], function () { });
gulp.task('default', ['process'], function () {
gulp.watch('./m/_scss/**/*', ['styles']);
gulp.watch('./m/_templates/**/*', ['html']);
gulp.watch('./m/i/_spritesource/**/*', ['sprite']);
gulp.watch('./m/_vendor/**/*', ['js']);
gulp.watch('./m/js/app/**/*', ['js']);
});
|
JavaScript
| 0 |
@@ -1635,25 +1635,28 @@
(%5B%0A%09%09'./
-m/_vendor
+node_modules
/jquery/
@@ -1681,25 +1681,28 @@
',%0A%09%09'./
-m/_vendor
+node_modules
/bootstr
@@ -1756,24 +1756,21 @@
%09'./
-m/_vendor/helix.
+node_modules/
jque
@@ -1821,25 +1821,28 @@
',%0A%09%09'./
-m/_vendor
+node_modules
/undersc
@@ -3675,49 +3675,8 @@
%5D);%0A
-%09gulp.watch('./m/_vendor/**/*', %5B'js'%5D);%0A
%09gul
|
773c7fcd32dcb6df2df3eba145ac887fdf53d327
|
Add library option
|
gulpfile.js
|
gulpfile.js
|
const path = require('path')
const gulp = require('gulp')
const webpack = require('webpack-stream')
const gutil = require('gulp-util')
const gzip = require('gulp-gzip')
const rename = require('gulp-rename')
const uglify = require('gulp-uglify')
const sourcemaps = require('gulp-sourcemaps')
const webpackConfig = require('./webpack.config.js')
gulp.task('build', (done) => {
// inprogress.js
webpack(Object.assign(webpackConfig, {
entry: path.resolve(__dirname, 'index.js'),
output: {
filename: 'inprogress.js'
}
}))
.pipe(gulp.dest('dist'))
// inprogress.min.js + source map
.pipe(sourcemaps.init())
.pipe(uglify().on('error', gutil.log))
.pipe(gzip())
.pipe(rename('inprogress.min.js'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
})
|
JavaScript
| 0.000001 |
@@ -522,16 +522,73 @@
ress.js'
+,%0A library: 'InProgress',%0A libraryTarget: 'umd'
%0A %7D%0A
|
5c12c77b82a5f170fb0882ec30e0b034e88dc06a
|
Use dist instead
|
gulpfile.js
|
gulpfile.js
|
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Gulp tasks.
*/
const execSync = require('child_process').execSync;
const fs = require('fs');
const jsgl = require('js-green-licenses');
const path = require('path');
const rimraf = require('rimraf');
/**
* Run the license checker for all packages.
* @return {Promise} A promise.
*/
function checkLicenses() {
const checker = new jsgl.LicenseChecker({
// dev: true,
// verbose: false,
});
checker.setDefaultHandlers();
const pluginsDir = 'plugins';
const promises = [];
// Check root package.json.
promises.push(checker.checkLocalDirectory('.'));
fs.readdirSync(pluginsDir)
.filter((file) => {
return fs.statSync(path.join(pluginsDir, file)).isDirectory();
}).forEach((plugin) => {
const pluginDir = path.join(pluginsDir, plugin);
// Check each plugin package.json.
promises.push(checker.checkLocalDirectory(pluginDir));
});
return Promise.all(promises);
}
/**
* Publish all plugins that have changed since the last release.
* @param {boolean=} dryRun True for running through the publish script as a dry
* run.
* @return {Function} Gulp task.
*/
function publish(dryRun) {
return (done) => {
// Login to npm.
execSync(`npm login --registry https://wombat-dressing-room.appspot.com`,
{stdio: 'inherit'});
const releaseDir = path.join('..', 'blockly-samples-release');
// Delete the release directory if it exists.
if (fs.existsSync(releaseDir)) {
rimraf.sync(releaseDir);
}
// Clone a fresh copy of blockly-samples.
console.log(`Checking out a fresh copy of blockly-samples under\
${path.resolve(releaseDir)}`);
execSync(`git clone https://github.com/google/blockly-samples ${releaseDir}`,
{stdio: 'pipe'});
// Run npm install.
console.log('Running npm install.');
execSync(`npm install`, {cwd: releaseDir, stdio: 'inherit'});
// Run npm publish.
execSync(`npm run publish:${dryRun ? 'check' : 'release'}`,
{cwd: releaseDir, stdio: 'inherit'});
done();
};
}
/**
* Publish all plugins.
* @return {Function} Gulp task.
*/
function publishRelease() {
return publish();
}
/**
* Run through a dry run of the release script.
* @return {Function} Gulp task.
*/
function publishDryRun() {
return publish(true);
}
module.exports = {
checkLicenses: checkLicenses,
publish: publishRelease,
publishDryRun: publishDryRun,
};
|
JavaScript
| 0 |
@@ -1446,50 +1446,14 @@
r =
-path.join('..', 'blockly-samples-release')
+'dist'
;%0A
|
9d38a23712fe1924a875d188b62a85b3fcf280e9
|
Refactor plugin variable name into something shorter
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var templatecache = require('gulp-angular-templatecache');
var karma = require('karma').server;
var _ = require('lodash');
var browserSync = require('browser-sync');
var at = require('gulp-asset-transform');
var protractor = require('gulp-protractor').protractor;
var del = require('del');
var paths = {
css : ['src/assets/css/*.css', 'src/app/**/*.css'],
fonts : 'src/assets/fonts/*.*',
images : 'src/assets/images/**',
index : 'src/index.html',
integration : 'test/integration/*.js',
js : 'src/app/**/*.js',
less : ['src/assets/less/*.less', 'src/app/components/**/*.less'],
templates : 'src/app/components/**/*.html'
};
var config = {
jshint : 'config/jshint.conf',
karma : require('./config/karma.conf')
};
gulp.task('copy-images', function() {
return gulp.src(paths.images)
.pipe(plugins.plumber())
.pipe(plugins.imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(plugins.size({ title: 'images', showFiles: true }))
.pipe(gulp.dest('develop/images'));
});
gulp.task('copy-fonts', function() {
return gulp.src(paths.fonts)
.pipe(plugins.plumber())
.pipe(plugins.size({ title: 'fonts' }))
.pipe(gulp.dest('develop/fonts'));
});
gulp.task('at-build', function() {
return gulp.src(paths.index)
.pipe(plugins.plumber())
.pipe(at({
css: {
tasks: ['concat',
plugins.size({ title: 'css', showFiles: true })]
},
js: {
tasks: ['concat',
plugins.size({ title: 'js', showFiles: true })]
},
js_lib: {
tasks: ['concat',
plugins.size({ title: 'js_lib', showFiles: true })]
},
less: {
tasks: [plugins.less(),
'concat',
plugins.size({ title: 'less', showFiles: true})]
}
}))
.pipe(gulp.dest('develop/'))
.pipe(browserSync.reload({ stream: true }));
});
gulp.task('templates', function () {
return gulp.src(paths.templates)
.pipe(plugins.plumber())
.pipe(templatecache('templates.js', { standalone: true }))
.pipe(plugins.size({ title: 'templates' }))
.pipe(gulp.dest('develop/js'))
.pipe(browserSync.reload({ stream: true }));
});
gulp.task('jshint', function() {
gulp.src(paths.js)
.pipe(plugins.jshint(config.jshint))
.pipe(plugins.jshint.reporter('jshint-stylish'));
});
gulp.task('less-lint', function() {
gulp.src(paths.less)
.pipe(plugins.plumber())
.pipe(plugins.recess())
.pipe(plugins.recess.reporter());
});
gulp.task('clean', function(done) {
del(['develop/**'], done);
});
gulp.task('karma', function(done) {
karma.start(_.assign({}, config.karma, { singleRun: true, colors: true }), done);
});
gulp.task('karma-ci', function(done) {
karma.start(_.assign({}, config.karma, { singleRun: false, colors: true, autoWatch: true }), done);
});
gulp.task('integration', ['server'], function(done) {
gulp.src(paths.integration)
.pipe(protractor({
configFile: 'config/protractor.conf',
args: ['--baseUrl', 'http://localhost:3000/#/']
}))
.on('error', function(e) { browserSync.exit(); throw e; })
.on('end', function() { browserSync.exit(); done(); });
});
gulp.task('server', function() {
browserSync({
server: {
baseDir: 'develop'
},
logConnections: true,
open: false
});
});
gulp.task('watch', function() {
gulp.watch([paths.index, paths.css, paths.less, paths.js], ['at-build']);
gulp.watch([paths.images, paths.fonts], ['copy-assets']);
gulp.watch([paths.templates], ['templates']);
gulp.watch([paths.js], ['jshint']);
gulp.watch([paths.less], ['less-lint']);
});
gulp.task('copy-assets', ['copy-images', 'copy-fonts']);
gulp.task('build', ['at-build', 'templates', 'copy-assets']);
gulp.task('develop', ['build', 'server', 'watch', 'karma-ci']);
|
JavaScript
| 0.000002 |
@@ -34,23 +34,23 @@
');%0Avar
-plugins
+$
=
@@ -979,39 +979,33 @@
ages)%0A .pipe(
-plugins
+$
.plumber())%0A
@@ -1010,23 +1010,17 @@
.pipe(
-plugins
+$
.imagemi
@@ -1087,39 +1087,33 @@
e %7D))%0A .pipe(
-plugins
+$
.size(%7B title: '
@@ -1256,39 +1256,33 @@
onts)%0A .pipe(
-plugins
+$
.plumber())%0A
@@ -1279,39 +1279,33 @@
er())%0A .pipe(
-plugins
+$
.size(%7B title: '
@@ -1427,39 +1427,33 @@
ndex)%0A .pipe(
-plugins
+$
.plumber())%0A
@@ -1510,39 +1510,33 @@
-plugins
+$
.size(%7B title: '
@@ -1616,39 +1616,33 @@
-plugins
+$
.size(%7B title: '
@@ -1725,39 +1725,33 @@
-plugins
+$
.size(%7B title: '
@@ -1818,23 +1818,17 @@
tasks: %5B
-plugins
+$
.less(),
@@ -1870,23 +1870,17 @@
-plugins
+$
.size(%7B
@@ -2090,39 +2090,33 @@
ates)%0A .pipe(
-plugins
+$
.plumber())%0A
@@ -2184,23 +2184,17 @@
.pipe(
-plugins
+$
.size(%7B
@@ -2365,31 +2365,25 @@
)%0A .pipe(
-plugins
+$
.jshint(conf
@@ -2404,23 +2404,17 @@
.pipe(
-plugins
+$
.jshint.
@@ -2516,23 +2516,17 @@
.pipe(
-plugins
+$
.plumber
@@ -2535,31 +2535,25 @@
)%0A .pipe(
-plugins
+$
.recess())%0A
@@ -2561,23 +2561,17 @@
.pipe(
-plugins
+$
.recess.
|
f1ac1e1c1668aba0613df508e9907f2bb8abad9d
|
Print stacktrace on error while watching
|
gulpfile.js
|
gulpfile.js
|
const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const glob = require('glob');
const Mocha = require('mocha');
const eslint = require('eslint');
const gutil = require('gulp-util');
const colors = gutil.colors;
const PATH = {
src: path.join(__dirname, 'src'),
dest: path.join(__dirname, 'lib'),
test: path.join(__dirname, 'test')
};
const GLOB = {
src: `${PATH.src}/*.js`,
test: `${PATH.test}/**/*.js`,
spec: `${PATH.test}/**/*.spec.js`,
dest: `${PATH.dest}/*.js`
};
const TEST_HELPERS = [
'babel-core/register',
'./test/mocha-env'
];
const LINT_CONF = {
src: {},
test: {
envs: ['node', 'mocha'],
rules: {
'no-console': 1
}
},
gulpfile: {
envs: ['node'],
rules: {
'no-multi-spaces': 0,
'no-console': 0
}
},
eg: {
globals: ['require'],
envs: ['browser']
}
};
/**
* Clear cached module to enable to re-require the module.
* @param {string} path - The module path.
* @return {void}
*/
function clearModuleCache(path) {
delete require.cache[path];
}
/**
* Run tests by mocha.
* @param {string} pattern - The pattern of test files.
* @param {Object} options - The options passed to mocha.
* @return {Promise} Will be resolved if all the tests pass.
*/
function runTests(pattern, options) {
const mocha = new Mocha(options);
const files = glob.sync(pattern, { realpath: true });
files.forEach(file => {
clearModuleCache(file); // For watching
mocha.addFile(file);
});
return new Promise((resolve, reject) => {
mocha.run(failed => failed ? reject() : resolve());
});
}
/**
* Lint sources by eslint. Throws an Error if any errors are found.
* @param {string} pattern - The target file pattern.
* @param {Object} configs - The config passed to {@code eslint.CLIEngine}.
* @param {boolean} strict - If true and there are one or more warnings,
* an Error is thrown even if there is no errors.
* @return {void}
*/
function lintFiles(pattern, configs, strict) {
const linter = new eslint.CLIEngine(configs);
const report = linter.executeOnFiles([pattern]);
const formatter = linter.getFormatter();
console.log(formatter(report.results));
if (0 < report.errorCount || (strict && 0 < report.warningCount)) {
throw new Error('eslint reports some problems.');
}
}
// -------------------------------------------------------------
// Tasks
// -------------------------------------------------------------
gulp.task('default', [
'test:watch',
'lint:watch'
]);
gulp.task('build', () => {
return gulp.src(GLOB.src)
.pipe(babel())
.pipe(gulp.dest(PATH.dest));
});
gulp.task('watch', ['build'], () => {
gulp.watch(GLOB.src, event => {
gutil.log(colors.cyan('babel:'), event.path);
gulp.src(event.path)
.pipe(babel())
.on('error', e => console.log(e.stack))
.pipe(gulp.dest(PATH.dest));
});
});
gulp.task('test:all', [
'lint:all',
'test:prepare',
'test'
]);
gulp.task('test', ['build', 'test:prepare'], () => {
return runTests(GLOB.spec)
.catch(() => process.exit(1));
});
gulp.task('test:watch', ['watch', 'test:prepare'], () => {
const files = [GLOB.test, GLOB.dest];
runTests(GLOB.spec, { reporter: 'dot' });
gulp.watch(files, event => {
clearModuleCache(event.path);
runTests(GLOB.spec, { reporter: 'dot' });
});
});
gulp.task('test:prepare', () => {
TEST_HELPERS.forEach(path => require(path));
});
gulp.task('lint:all', [
'lint',
'lint:gulpfile',
'lint:eg'
]);
gulp.task('lint', [
'lint:src',
'lint:test'
]);
gulp.task('lint:src', () => {
lintFiles(GLOB.src, LINT_CONF.src, true);
});
gulp.task('lint:test', () => {
lintFiles(GLOB.test, LINT_CONF.test, true);
});
gulp.task('lint:gulpfile', () => {
lintFiles('./gulpfile.js', LINT_CONF.gulpfile, true);
});
gulp.task('lint:eg', () => {
lintFiles('./example/src', LINT_CONF.eg, true);
});
gulp.task('lint:watch', () => {
const linters = {
src: new eslint.CLIEngine(LINT_CONF.src),
test: new eslint.CLIEngine(LINT_CONF.test)
};
function lintAndReport(path, linter) {
const report = linter.executeOnFiles([path]);
const formatter = linter.getFormatter();
console.log(formatter(report.results));
}
lintAndReport(GLOB.src, linters.src);
lintAndReport(GLOB.test, linters.test);
gulp.watch(GLOB.src, event => {
lintAndReport(event.path, linters.src);
});
gulp.watch(GLOB.test, event => {
lintAndReport(event.path, linters.test);
});
});
|
JavaScript
| 0 |
@@ -1272,29 +1272,137 @@
ved
-if all the tests pass
+after running all tests.%0A * The argument is an exit code. If any runtime errors occured,%0A * this promise will be rejected
.%0A *
@@ -1687,59 +1687,79 @@
-mocha.run(failed =%3E failed ? reject() : resolve());
+try %7B%0A mocha.run(resolve);%0A %7D catch(e) %7B%0A reject(e);%0A %7D
%0A %7D
@@ -3210,16 +3210,21 @@
.
-catch(()
+then(exitCode
=%3E
@@ -3240,10 +3240,47 @@
xit(
-1)
+exitCode))%0A .catch(e =%3E %7B throw e; %7D
);%0A%7D
@@ -3348,47 +3348,28 @@
%7B%0A
-const files = %5BGLOB.test, GLOB.dest%5D;%0A%0A
+function test() %7B%0A
ru
@@ -3410,28 +3410,100 @@
' %7D)
-;%0A gulp.watch(files
+%0A .catch(e =%3E console.log(e.stack));%0A %7D%0A%0A test();%0A gulp.watch(%5BGLOB.test, GLOB.dest%5D
, ev
@@ -3553,47 +3553,13 @@
-runTests(GLOB.spec, %7B reporter: 'dot' %7D
+test(
);%0A
|
80a27d19d39cb2105059145f38d037e968a9c267
|
Fix issues with not using dots reporter on travis
|
gulpfile.js
|
gulpfile.js
|
/*globals require, __dirname */
/* jshint node:true */
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var karma = require('karma').server;
var lodash = require('lodash');
var plato = require('gulp-plato');
var karmaConfig = __dirname + '/karma.conf.js';
var paths = require('./paths');
gulp.task('complexity', function () {
return gulp.src('src/**/*.js')
.pipe(plato('complexity'));
});
var testConfig = function (options) {
var travisOptions = process.env.TRAVIS &&
{
browsers: ['Firefox']
};
return lodash.assign(options, travisOptions);
};
gulp.task('test', function (done) {
karma.start(testConfig(
{
configFile: karmaConfig,
singleRun: true,
reporters: ['progress', 'coverage', 'threshold']
}
), done);
});
gulp.task('tdd', function (done) {
gulp.watch(paths.all, ['lint']);
karma.start({
configFile: karmaConfig
}, done);
});
gulp.task('lint', function () {
return gulp
.src(paths.lint)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('default', {verbose: true}))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('default', ['lint', 'complexity', 'test']);
|
JavaScript
| 0 |
@@ -536,16 +536,68 @@
irefox'%5D
+,%0A reporters: %5B'dots', 'coverage', 'threshold'%5D
%0A %7D;%0A
|
327ac142b4267d1607060d7b1e41dc468005accb
|
Update Gulp production task
|
gulpfile.js
|
gulpfile.js
|
'use strict'; // http://www.w3schools.com/js/js_strict.asp
// 1. LOAD PLUGINS
var gulp = require('gulp');
var bourbon = require('bourbon').includePaths;
var neat = require('bourbon-neat').includePaths;
var p = require('gulp-load-plugins')({ // This loads all the other plugins.
DEBUG: false,
pattern: ['gulp-*', 'gulp.*', 'del', 'run-*', 'browser*', 'vinyl-*', 'through2'],
rename: {
'vinyl-source-stream': 'source',
'vinyl-buffer': 'buffer',
},
});
// 2. CONFIGURATION
var
src = 'source/', // The Middleman source folder
dest = '.tmp/', // The "hot" build folder used by Middleman's external pipeline
development = p.environments.development,
production = p.environments.production,
css = {
in: src + 'stylesheets/**/*.{css,scss,sass}',
out: dest + 'stylesheets/',
},
sassOpts = {
imagePath: '../images',
includePaths: [bourbon, neat],
errLogToConsole: true
},
js = {
in: src + 'javascripts/*.{js,coffee}',
out: dest + 'javascripts/'
},
uglifyOpts = {
output: {
comments: 'uglify-save-license'
}
},
images = {
in: src + 'images/*',
out: dest + 'images/'
},
serverOpts = {
proxy: 'localhost:4567',
open: false,
reloadDelay: 500,
files: [dest + '**/*.{js,css}', src + '**/*.{html,erb,haml,markdown}']
};
// 3. WORKER TASKS
// CSS Preprocessing
gulp.task('css', function() {
return gulp.src(css.in)
.pipe(development(p.sourcemaps.init()))
.pipe(p.sass(sassOpts).on('error', p.sass.logError))
.pipe(p.autoprefixer()).on('error', handleError)
.pipe(production(p.cleanCss()))
.pipe(development(p.sourcemaps.write()))
.pipe(gulp.dest(css.out));
});
// Javascript Bundling
gulp.task('js', function(done) {
var b = p.browserify({
entries: src + 'javascripts/all.js',
debug: true
});
return b.bundle().on('error', handleError)
.pipe(p.source('bundle.js'))
.pipe(production ? p.buffer() : p.through.obj())
.pipe(production(p.stripDebug()))
.pipe(production ? p.uglify(uglifyOpts) : p.through.obj())
.pipe(gulp.dest(js.out))
done();
});
// Image Optimization
gulp.task('images', function() {
return gulp.src(images.in)
.pipe(p.changed(images.out))
.pipe(p.imagemin())
.pipe(gulp.dest(images.out));
});
// Clean .tmp/
gulp.task('clean', function(done) {
p.del([
dest + '*'
]), done();
});
// Asset Size Report
gulp.task('sizereport', function () {
return gulp.src(dest + '**/*')
.pipe(p.sizereport({
gzip: true
}));
});
// 4. SUPER TASKS
// Development Task
gulp.task('development', gulp.series('clean', 'css', 'js', 'images'));
// Production Task
gulp.task('production', function(done) {
p.runSequence('clean', 'css', 'js', 'images', 'sizereport', done);
});
// Default Task
// This is the task that will be invoked by Middleman's exteranal pipeline when
// running 'middleman server'
gulp.task('default', gulp.series('development', function browsersync () {
p.browserSync.init(serverOpts);
gulp.watch(css.in, gulp.series('css'));
gulp.watch(js.in, gulp.series('js'));
gulp.watch(images.in, gulp.series('images'));
}));
function handleError(err) {
console.log(err.toString());
this.emit('end');
}
|
JavaScript
| 0.000001 |
@@ -2603,39 +2603,19 @@
n',
-function(done) %7B%0A%09p.runSequence
+gulp.series
('cl
@@ -2659,18 +2659,9 @@
ort'
-, done);%0A%7D
+)
);%0A%0A
|
284eabf7603decc88c9444fdecfe01af46834ef4
|
update gulpfile
|
gulpfile.js
|
gulpfile.js
|
// gulpfile.js
'use strict';
// ----------------------------------
// available tasks:
// 'gulp'
// 'gulp clean'
// clean:cache
// 'gulp bower'
// bower:clean - bower:scss - bower:js
// 'gulp sass'
// sass:doc
// 'gulp html'
// html:nunjucks - html:inject
// 'gulp serve'
// 'gulp watch'
// ----------------------------------
// plugins:
// gulp, run-sequence, gulp-util, gulp-plumber
// gulp-load-plugins, gulp-load-subtasks
// gulp-nunjucks-render, gulp-changed,
// gulp-sass, gulp-sourcemaps, browser-sync
// gulp-prettify, gulp-newer, main-bower-files
// gulp-flatten, del, gulp-inject, gulp-cached
// gulp-autoprefixer, sassdoc, gulp-minify-css
// gulp-rename, lazypipe
// ----------------------------------
// main gulp plugins
var gulp = require('gulp'),
path = require('./gulp/paths.js'),
config = require('./gulp/config.js'),
sequence = require('run-sequence'),
$ = require('gulp-load-plugins')({
// used for all plugins type not just with gulp-*
pattern: '*'
});
// require all tasks : gulp-load-subtasks
$.loadSubtasks('./gulp/tasks/**/*.js', $, path, config);
// common tasks
gulp.task('default', function(cb) {
sequence(
// config.task.clean,
// config.task.clean + ':cache',
config.task.bower,
[
config.task.sass,
// config.task.sass + ':doc',
],
config.task.html,
config.task.browserSync,
'watch',
cb
)
});
|
JavaScript
| 0.000001 |
@@ -240,19 +240,51 @@
sass:
-doc
+compile - sass:doc - sass:minifycss
%0A// '
|
e81b45114657f66c774313a4b0a1e385d7a9c59a
|
Fix path join
|
gulpfile.js
|
gulpfile.js
|
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const webpack = require('webpack');
const RestoreDirname = require('./webpack/restoredirname.webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
gulp.task('default', ['webpack', 'sass']);
gulp.task('sass', ['webpack'], function () {
gulp.src([
'./src/assets/css/bundle.scss',
'./src/assets/css/composer.scss',
'./src/assets/css/viewer.scss',
'./src/assets/css/preferences.scss',
'./src/assets/css/suggestions.scss'
])
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./src/assets/css/'));
});
gulp.task('webpack', function (cb) {
webpack({
target: 'electron',
context: __dirname + '/src',
node: {
__dirname: false
},
entry: {
'index': './view/index.js',
'prompt': './view/prompt.js',
'composer': './view/composer.js',
'about': './view/about.js',
'viewer': './view/viewer.js',
'suggestions': './view/suggestions.js',
'preferences': './view/preferences.js',
'entry': './main.js'
},
output: {
path: __dirname + '/src/assets/js',
publicPath: './js/',
filename: '[name].js',
chunkFilename: '[id].js'
},
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.json$/,
loader: 'json-loader'
}
],
noParse: /node_modules\/json-schema\/lib\/validate\.js/
},
plugins: [
new RestoreDirname(),
new ExtractTextPlugin('../css/components.scss'),
new webpack.LoaderOptionsPlugin({
options: {
vue: {
loaders: {
sass: ExtractTextPlugin.extract('css-loader!sass-loader')
}
}
}
})
],
devtool: 'source-map',
externals: { spellchecker: 'commonjs spellchecker' }
}, cb);
});
gulp.task('watch', function () {
gulp.watch('./src/static/css/**/*.scss', ['sass']);
gulp.watch(['./src/**/*.js', '!./src/entry.js', '!./src/static/js/**/*.js'], ['webpack']);
});
|
JavaScript
| 0.000001 |
@@ -105,24 +105,54 @@
'webpack');%0A
+const path = require('path');%0A
const Restor
@@ -751,16 +751,26 @@
ontext:
+path.join(
__dirnam
@@ -774,17 +774,16 @@
name
- +
+,
'
-/
src'
+)
,%0A
@@ -1167,16 +1167,26 @@
path:
+path.join(
__dirnam
@@ -1190,13 +1190,11 @@
name
- +
+,
'
-/
src/
@@ -1203,16 +1203,17 @@
sets/js'
+)
,%0A
|
2228001c9867afb520fa3904b49058448284fe23
|
update of gulpfile.js - commit.
|
gulpfile.js
|
gulpfile.js
|
/*!
* rose-normalize-sass [v0.0.1]
* ___________________________________________________
* Gulp: The streaming build system.
* https://github.com/gulpjs/gulp | http://gulpjs.com/
* @author : Prabhat Kumar, http://prabhatkumar.org/
* @date : 11-July-2015
* ___________________________________________________
* @require : Node.js®
* @require : Gulp
*/
'use strict';
// main module.
var gulp = require('gulp');
// required modules.
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var scsslint = require('gulp-scss-lint');
var uglify = require('gulp-uglify');
var beautify = require('gulp-beautify');
var sourcemaps = require('gulp-sourcemaps');
// utility modules.
var path = require('path');
var gutil = require('gulp-util');
var gulpif = require('gulp-if');
var size = require('gulp-size');
var del = require('del');
var notify = require("gulp-notify");
var rename = require("gulp-rename");
var replace = require('gulp-replace');
var bytediff = require('gulp-bytediff');
var chmod = require('gulp-chmod');
// After every @Done, gulp-css-target;
// Break a CSS file down into multiple targets allowing for better targeting and performance.
// @[v0.1.0]
// https://github.com/Snugug/gulp-css-target/
var target = require('gulp-css-target');
// ***** SETTINGS ***** //
var AUTOPREFIXER_BROWSERS = [
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 22',
'ios >= 7',
'android >= 4.4',
'bb >= 10'
];
|
JavaScript
| 0.000002 |
@@ -1487,16 +1487,47 @@
**** //%0A
+var paths = %7B%0A root: %5B''%5D%0A%7D;%0A%0A
var AUTO
@@ -1696,8 +1696,253 @@
10'%0A%5D;%0A
+%0A// ***** TASKS ***** //%0A// Rerun the task when a file changes.%0Agulp.task('watch', function()%7B%0A gulp.watch(paths.root, %5B'rose-sass'%5D);%0A%7D);%0A%0A// The default task (called when you run 'gulp' from cli)%0Agulp.task('default', %5B'watch', 'rose-sass'%5D);%0A
|
19525392459542864523ad0db2583d683cb85811
|
tidy gulp processes
|
gulpfile.js
|
gulpfile.js
|
"use strict";
const gulp = require("gulp"),
concat = require("gulp-concat"),
cssmin = require("gulp-cssmin"),
htmlmin = require("gulp-htmlmin"),
uglify = require("gulp-uglify"),
merge = require("merge-stream"),
pipeline = require('readable-stream').pipeline,
del = require("del"),
bundleconfig = require("./distbundlesconfig.json");
const replace = require('gulp-replace');
const jsdoc = require('gulp-jsdoc3');
// the md doc output is, e.g. MeadCoScriptXPrint for MeadCo.ScriptX.Print
// this table drives back replacement
const namespaces = [
"MeadCo.ScriptX.Print",
"Print.Licensing",
"Print.PDF",
"Print.HTML",
];
function getBundles(regexPattern) {
return bundleconfig.filter(function (bundle) {
return regexPattern.test(bundle.outputFileName);
});
}
function mintoDist() {
var tasks = getBundles(/\.js$/).map(function (bundle) {
return pipeline(
gulp.src(bundle.inputFiles, { base: "." }),
uglify({
output: {
comments: "some"
}
}),
concat(bundle.outputFileName),
gulp.dest(".")
);
});
return merge(tasks);
}
function cleanDist() {
var files = bundleconfig.map(function (bundle) {
return bundle.outputFileName;
});
return del(files, { force: true });
}
function cleanDocs() {
return del('./docs');
}
gulp.task('CompileDocs', function (done) {
const config = require('./tooling/docs/jsdoc.json');
gulp.src(['readme.md', '.src/**/*.js'], { read: false }).pipe(jsdoc(config,done));
});
function ProcessName(nsname) {
console.log("Start ProcessName: " + nsname);
var badName = nsname.replace(/\./g, "");
console.log("Replace: " + badName + " with: " + nsname);
var regx = new RegExp(badName + "(?![a-zA-Z]*\.html)", "gi")
return gulp.src("./docs/*.html").pipe(replace(regx, nsname)).pipe(gulp.dest("./docs"));
}
gulp.task('ProcessDocs1', function () {
return ProcessName("MeadCo.ScriptX.Print.Licensing");
});
gulp.task('ProcessDocs2', function () {
return ProcessName("MeadCo.ScriptX.Print.HTML");
});
gulp.task('ProcessDocs3', function () {
return ProcessName("MeadCo.ScriptX.Print.PDF");
});
gulp.task('ProcessDocs4', function () {
return ProcessName("MeadCo.ScriptX.Print");
});
gulp.task('MakeDocs', gulp.series('CompileDocs', 'ProcessDocs1', 'ProcessDocs2','ProcessDocs3', 'ProcessDocs4'));
exports.buildDist = gulp.series(gulp.parallel(cleanDist,cleanDocs), gulp.parallel(mintoDist, 'MakeDocs'));
|
JavaScript
| 0 |
@@ -1667,57 +1667,8 @@
e) %7B
-%0A console.log(%22Start ProcessName: %22 + nsname);
%0A%0A
@@ -1710,24 +1710,27 @@
g, %22%22);%0A%0A
+ //
console.log
@@ -2407,16 +2407,17 @@
sDocs2',
+
'Process
@@ -2447,25 +2447,88 @@
);%0A%0A
-exports.b
+gulp.task('BuildDocs', gulp.series(cleanDocs,'MakeDocs'));%0A%0Agulp.task('B
uildDist
= g
@@ -2523,18 +2523,18 @@
uildDist
- =
+',
gulp.se
@@ -2599,22 +2599,23 @@
toDist, 'MakeDocs'))
+)
;%0A
|
5c18b745b148b4dbc4dc04732caa30fb50f95efa
|
add updateUrl for non-AMO releases. resolves #46
|
gulpfile.js
|
gulpfile.js
|
var fs = require('fs');
var path = require('path');
var mime = require('mime');
var gulp = require('gulp');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var footer = require('gulp-footer');
var header = require('gulp-header');
var jade = require('gulp-jade');
var run = require('gulp-run');
var zip = require('gulp-zip');
var merge = require('merge-stream');
var map = require('vinyl-map');
var source = require('vinyl-source-stream');
var plist = require('plist');
var package = require('./package.json');
gulp.task('default', [ 'chrome:zip', 'firefox:xpi', 'safari' ], function() {
});
gulp.task('clean', function() {
return gulp.src([ './build', './dist' ], { read: false })
.pipe(clean());
});
var rImages = /(url\(['|"]?)([^:'"]*)(?=['|"]?\))/ig;
var encode64 = map(function(code, filename) {
code = code.toString();
var dir = path.dirname(filename);
return code.replace(rImages, function(match, p1, url) {
var imgPath = path.join(dir, url);
if (fs.existsSync(imgPath)) {
var img = fs.readFileSync(imgPath);
url = 'data:' + mime.lookup(imgPath) + ';base64,' + img.toString('base64');
match = p1 + url;
} else {
console.error('Could not find image: ' + imgPath);
}
return match;
});
});
gulp.task('chrome:css', function() {
var extPath = map(function(code) {
code = code.toString();
return code.replace(rImages, '$1chrome-extension://__MSG_@@extension_id__/$2');
});
return gulp.src('./betterdgg/*.css')
.pipe(extPath)
.pipe(concat('betterdgg.css'))
.pipe(gulp.dest('./build/chrome/'));
});
gulp.task('firefox:css', function() {
return gulp.src('./betterdgg/*.css')
.pipe(encode64)
.pipe(concat('betterdgg.css'))
.pipe(gulp.dest('./build/firefox/data/'));
});
gulp.task('safari:css', function() {
return gulp.src('./betterdgg/*.css')
.pipe(encode64)
.pipe(concat('betterdgg.css'))
.pipe(gulp.dest('./dist/betterdgg.safariextension/'));
});
gulp.task('js', [ 'templates', 'version' ], function() {
return gulp.src([ './vendor/**/*.js',
'./betterdgg/modules/*.js', './build/templates.js', './build/version.js',
'./betterdgg/*.js' ])
.pipe(concat('betterdgg.js'))
.pipe(header('var injectedBetterDGG = function() {\n'))
.pipe(footer('\n};'))
.pipe(gulp.dest('./build/'));
});
gulp.task('templates', function() {
var nameTemplate = map(function(code, filename) {
code = code.toString();
var declaration = 'window.BetterDGG.templates.' + path.basename(filename, '.js') + ' = function(';
return code.replace(/^function template\(/, declaration);
});
return gulp.src([ './betterdgg/templates/**/*.jade' ])
.pipe(jade({ client: true }))
.pipe(nameTemplate)
.pipe(concat('templates.js'))
.pipe(gulp.dest('./build/'));
});
gulp.task('version', function() {
var stream = source('version.js');
stream.write(';(function(bdgg) {');
stream.write('bdgg.version = "' + package.version + '";');
stream.write('}(window.BetterDGG = window.BetterDGG || {}));');
return gulp.src('version.js')
.pipe(stream)
.pipe(gulp.dest('./build/'));
});
gulp.task('chrome:manifest', function() {
return gulp.src('./chrome/manifest.json')
.pipe(map(function(code) {
var obj = JSON.parse(code.toString());
obj.version = package.version;
return JSON.stringify(obj);
}))
.pipe(gulp.dest('./build/chrome/'));
});
gulp.task('chrome', [ 'chrome:css', 'chrome:manifest', 'js' ], function() {
var assets = gulp.src([ './betterdgg/**/*.png',
'./chrome/**/*', '!./chrome/inject.js', '!./chrome/manifest.json' ])
.pipe(gulp.dest('./build/chrome/'));
var js = gulp.src([ './build/betterdgg.js', './chrome/inject.js' ])
.pipe(concat('betterdgg.js'))
.pipe(gulp.dest('./build/chrome/'));
return merge(assets, js);
});
gulp.task('chrome:zip', [ 'chrome' ], function() {
gulp.src('./build/chrome/**/*')
.pipe(zip('betterdgg-chrome.zip'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('firefox:manifest', function() {
return gulp.src('./firefox/package.json')
.pipe(map(function(code) {
var obj = JSON.parse(code.toString());
obj.version = package.version;
return JSON.stringify(obj);
}))
.pipe(gulp.dest('./build/firefox/'));
});
gulp.task('firefox', [ 'firefox:css', 'firefox:manifest', 'js' ], function() {
var assets = gulp.src([ './firefox/**/*', '!./firefox/data/inject.js',
'!./firefox/package.json' ])
.pipe(gulp.dest('./build/firefox/'));
var js = gulp.src([ './build/betterdgg.js', './firefox/data/inject.js' ])
.pipe(concat('betterdgg.js'))
.pipe(gulp.dest('./build/firefox/data/'));
return merge(assets, js);
});
gulp.task('firefox:xpi', [ 'firefox' ], function() {
run('mkdir -p ./dist && cd ./build/firefox && cfx xpi --output-file=../../dist/betterdgg.xpi').exec();
});
gulp.task('safari:plist', function() {
return gulp.src('./safari/Info.plist')
.pipe(map(function(code) {
var obj = plist.parse(code.toString());
obj.CFBundleVersion = package.version;
obj.CFBundleShortVersionString = package.version.replace(/^(\d+\.\d+)\..*/, '$1');
return plist.build(obj);
}))
.pipe(gulp.dest('./dist/betterdgg.safariextension/'));
});
gulp.task('safari', [ 'safari:css', 'safari:plist', 'js' ], function() {
var assets = gulp.src([ './betterdgg/**/*.png',
'./safari/**/*', '!./safari/inject.js', '!./safari/Info.plist' ])
.pipe(gulp.dest('./dist/betterdgg.safariextension/'));
var js = gulp.src([ './build/betterdgg.js', './safari/inject.js' ])
.pipe(concat('betterdgg.js'))
.pipe(gulp.dest('./dist/betterdgg.safariextension/'));
merge(assets, js).on('end', function() {
console.log('Open ./dist/betterdgg.safariextension in Safari Extension Builder'
+ ' to dist Safari extension');
});
});
|
JavaScript
| 0.000001 |
@@ -5193,16 +5193,104 @@
cfx xpi
+'%0A%09+ ' --update-url https://9inevolt.github.io/betterdgg/firefox/update.rdf'%0A + '
--outpu
|
34b0f8715b2bfe6bcdca05f5b30fb01374e3ec14
|
Stop copying fonts around
|
gulpfile.js
|
gulpfile.js
|
// generated on 2014-09-19 using generator-gulp-webapp 0.1.0
'use strict';
var autoprefixer = require('gulp-autoprefixer');
var clean = require('gulp-clean');
var flatten = require('gulp-flatten');
var gulp = require('gulp');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var opn = require('opn');
var plumber = require('gulp-plumber');
var sass = require('gulp-ruby-sass');
var server = require("webpack-dev-server");
var size = require('gulp-size');
var streamify = require('gulp-streamify');
var subtree = require('gulp-subtree');
var symlink = require('gulp-symlink');
var uglify = require('gulp-uglify');
var webpack = require('webpack');
jshint.stylish = require('jshint-stylish');
/////////
gulp.task('styles', function () {
return gulp.src('app/styles/app.scss')
.pipe(plumber())
.pipe(sass({
style: 'expanded',
precision: 10
}))
.pipe(autoprefixer('last 1 version'))
.pipe(gulp.dest('dist'))
.pipe(size());
});
gulp.task('html', function () {
// Copy index.html to dist
return gulp.src('app/index.html').pipe(gulp.dest('dist'));
});
gulp.task('fonts', function () {
// Copy fonts to dist
return gulp.src(['app/fonts/**/*.woff', 'bower_components/**/*.woff'])
.pipe(flatten())
.pipe(gulp.dest('dist/fonts'))
.pipe(size());
});
gulp.task('link', function() {
gulp.src('public/data').pipe(symlink('dist'))
gulp.src('bower_components').pipe(symlink('dist'))
})
//////////
var webpackConfig = require("./webpack.config.js");
// The development server (the recommended option for development)
gulp.task("default", ["webpack-dev-server"]);
gulp.task("serve", ["webpack-dev-server"]);
// Build and watch cycle (another option for development)
//// Advantage: No server required, can run app from filesystem
//// Disadvantage: Requests are not blocked until bundle is available,
//// can serve an old app on refresh
gulp.task("build-dev", ["webpack:build-dev"], function() {
gulp.watch(["app/**/*"], ["webpack:build-dev"]);
});
// Production build
gulp.task("build", ["webpack:build"]);
gulp.task("prepare-build", ['html', 'styles', 'fonts', 'link'])
gulp.task("webpack:build", ['prepare-build'], function(callback) {
// modify some webpack config options
var myConfig = Object.create(webpackConfig);
myConfig.plugins = myConfig.plugins.concat(
new webpack.DefinePlugin({
"process.env": {
// This has effect on the react lib size
"NODE_ENV": JSON.stringify("production")
}
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin()
);
// run webpack
webpack(myConfig, function(err, stats) {
if(err) throw new gutil.PluginError("webpack:build", err);
gutil.log("[webpack:build]", stats.toString({
colors: true
}));
callback();
});
});
// modify some webpack config options
var myDevConfig = Object.create(webpackConfig);
myDevConfig.devtool = "source-map";
myDevConfig.debug = true;
// create a single instance of the compiler to allow caching
var devCompiler = webpack(myDevConfig);
gulp.task("webpack:build-dev", ['prepare-build'], function(callback) {
// run webpack
devCompiler.run(function(err, stats) {
if(err) throw new gutil.PluginError("webpack:build-dev", err);
gutil.log("[webpack:build-dev]", stats.toString({
colors: true
}));
callback();
});
});
gulp.task("webpack-dev-server", ['prepare-build'], function(callback) {
gulp.watch('app/styles/**/*.scss', ['styles']);
// modify some webpack config options
var myConfig = Object.create(webpackConfig);
myConfig.devtool = "source-map";
myConfig.debug = true;
// Start a webpack-dev-server
new server(webpack(myConfig), {
contentBase: myConfig.output.contentBase,
path: myConfig.output.path,
publicPath: "/" + myConfig.output.publicPath,
stats: {
colors: true
}
}).listen(8080, "localhost", function(err) {
if(err) throw new gutil.PluginError("webpack-dev-server", err);
var url = "http://localhost:8080/webpack-dev-server/index.html";
gutil.log("[webpack-dev-server]", url);
opn(url);
});
});
//////////
gulp.task('deploy', ['build'], function () {
return gulp.src('dist')
.pipe(subtree())
.pipe(clean());
});
gulp.task('clean', function () {
return gulp.src(['.tmp', 'dist'], { read: false }).pipe(clean());
});
// gulp.task('default', function () {
// console.log('gulp build');
// console.log('gulp watch');
// console.log('gulp deploy');
// });
|
JavaScript
| 0 |
@@ -1193,210 +1193,8 @@
);%0A%0A
-gulp.task('fonts', function () %7B%0A%09// Copy fonts to dist%0A%09return gulp.src(%5B'app/fonts/**/*.woff', 'bower_components/**/*.woff'%5D)%0A%09%09.pipe(flatten())%0A%09%09.pipe(gulp.dest('dist/fonts'))%0A%09%09.pipe(size());%0A%7D);%0A%0A
gulp
|
cf6d3c23fb8321a20a896f3af5656b0fe20ba46f
|
build everything before watching
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var less = require('gulp-less');
var expect = require('gulp-expect-file');
var del = require('del');
var paths = {
vendor_styles: [
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/AngularJS-Toaster/toaster.css',
'bower_components/angular-ui-select/dist/select.min.css',
'bower_components/clippy/build/clippy.css',
'bower_components/angular-hotkeys/build/hotkeys.min.css'
],
html_templates: [
'src/**/*.html'
],
vendor_scripts: [
'bower_components/angular/angular.min.js',
'bower_components/angular-sanitize/angular-sanitize.min.js',
'bower_components/angular-resource/angular-resource.min.js',
'bower_components/angular-cookies/angular-cookies.min.js',
'bower_components/angular-animate/angular-animate.min.js',
'bower_components/angular-bootstrap/ui-bootstrap.min.js',
'bower_components/angular-ui-select/dist/select.min.js',
'bower_components/AngularJS-Toaster/toaster.js',
'bower_components/angular-ui-router/release/angular-ui-router.min.js',
'bower_components/angular-jwt/dist/angular-jwt.min.js',
'bower_components/jquery/jquery.min.js',
'bower_components/angular-hotkeys/build/hotkeys.min.js',
'bower_components/lodash/lodash.min.js',
'js_vendor/moment.min.js',
'js_vendor/angular-moment.min.js',
'js_vendor/ZeroClipboard.min.js'
],
clippy: [
'bower_components/clippy/build/clippy.min.js'
],
scripts: [
'src/**/*.js'
],
styles: [
'styles/**/*.less'
],
vendor_fonts: [
'bower_components/bootstrap/dist/fonts/*',
'styles/fonts/*'
],
cleanup: [
'api/public/t',
'api/public/js',
'api/public/fonts'
]
};
gulp.task('clean', function(cb) {
del(paths.cleanup, cb);
});
gulp.task('vendor_scripts', [], function() {
return gulp.src(paths.vendor_scripts)
.pipe(expect(paths.vendor_scripts))
.pipe(concat('vendor.js'))
.pipe(gulp.dest('api/public/js'));
});
gulp.task('clippy', [], function() {
return gulp.src(paths.clippy)
.pipe(expect(paths.clippy))
.pipe(concat('clippy.js'))
.pipe(gulp.dest('api/public/js'));
});
gulp.task('vendor_styles', [], function() {
return gulp.src(paths.vendor_styles)
.pipe(expect(paths.vendor_styles))
.pipe(concat('vendor_styles.css'))
.pipe(gulp.dest('api/public/css'));
});
gulp.task('vendor_fonts', [], function() {
return gulp.src(paths.vendor_fonts)
.pipe(expect(paths.vendor_fonts))
.pipe(gulp.dest('api/public/fonts'));
});
gulp.task('scripts', [], function() {
return gulp.src(paths.scripts)
.pipe(concat('app.js'))
.pipe(gulp.dest('api/public/js'));
});
gulp.task('styles', [], function() {
return gulp.src(paths.styles)
.pipe(less())
.pipe(concat('app.css'))
.pipe(gulp.dest('api/public/css'));
});
gulp.task('html_templates', [], function() {
return gulp.src(paths.html_templates)
.pipe(gulp.dest('api/public/t'));
});
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.html_templates, ['html_templates']);
gulp.watch(paths.styles, ['styles']);
});
gulp.task('default', ['vendor_fonts', 'vendor_styles', 'html_templates', 'vendor_scripts', 'clippy', 'scripts', 'styles']);
|
JavaScript
| 0 |
@@ -3390,16 +3390,29 @@
'watch',
+ %5B'default'%5D,
functio
|
458b9d1689e403167cc2797828fedadb4f17d929
|
Remove gulp-coveralls
|
gulpfile.js
|
gulpfile.js
|
const gulp = require('gulp');
const path = require('path');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config');
const webpackStream = require('webpack-stream');
const babel = require('gulp-babel');
const coveralls = require('gulp-coveralls');
const eslint = require('gulp-eslint');
const manifest = require('./package.json');
const mainFile = manifest.main
const destinationDirectory = path.dirname(mainFile);
function build() {
return gulp.src('./src/formwood.js')
.pipe(webpackStream(webpackConfig, webpack))
.pipe(gulp.dest(destinationDirectory));
}
function sendToCoveralls() {
gulp.src('coverage/**/lcov.info')
.pipe(coveralls());
}
function lint() {
return gulp.src('src/**/*')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
gulp.task('build', build);
gulp.task('coveralls', sendToCoveralls);
gulp.task('lint', lint);
gulp.task('default', ['build']);
|
JavaScript
| 0.000004 |
@@ -230,53 +230,8 @@
');%0A
-const coveralls = require('gulp-coveralls');%0A
cons
|
77417916a9b62a525ab2b17c30e6d694cc421104
|
Fix style
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
var stylus = require('gulp-stylus');
var jade = require('gulp-jade');
var nodemon = require('gulp-nodemon');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var noop = function () {};
var stylish = require('gulp-jscs-stylish');
var DIST_DIR = './public/dist';
var JS_DIR = DIST_DIR + '/js';
var CSS_DIR = DIST_DIR + '/css';
var VIEW_DIR = DIST_DIR + '/views';
var DIRECTIVES_DIR = DIST_DIR + '/directives-views';
var COMPILED_STYLUS_DIR = './public/css/';
var JS_SRC = ['./public/vendors/jquery/dist/jquery.min.js',
'./public/vendors/bootstrap/dist/js/bootstrap.min.js',
'./public/vendors/toastr/toastr.min.js',
'./public/vendors/angular/angular.js',
'./public/vendors/angular-resource/angular-resource.js',
'./public/vendors/angular-animate/angular-animate.js',
'./public/vendors/angular-route/angular-route.js',
'./public/vendors/angular-translate/angular-translate.min.js',
'./public/vendors/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js',
'./public/vendors/angular-local-storage/dist/angular-local-storage.min.js',
'./public/vendors/angular-ui-select/dist/select.js',
'./public/vendors/odometer/odometer.js',
'./public/vendors/angular-odometer-js/dist/angular-odometer.js',
'./public/vendors/Chart.js/Chart.min.js',
'./public/vendors/angular-chart.js/dist/angular-chart.min.js',
'./public/vendors/ngDialog/js/ngDialog.min.js',
'./public/vendors/angular-utils-pagination/dirPagination.js',
'./public/vendors/angular-hotkeys/build/hotkeys.min.js',
'./public/app/app.js',
'./public/app/config/**/*.js',
'./public/app/filters/**/*.js',
'./public/app/directives/**/*.js',
'./public/app/ui/**/*.js',
'./public/app/questions/**/*.js',
'./public/app/users/**/*.js',
'./public/app/admin/**/*.js'
];
var CSS_SRC = ['./public/css/socicon.css',
'./public/vendors/ngDialog/css/ngDialog.min.css',
'./public/vendors/ngDialog/css/ngDialog-theme-default.min.css',
'./public/vendors/angular-ui-select/dist/select.css',
'./public/vendors/odometer/themes/odometer-theme-minimal.css',
'./public/vendors/toastr/toastr.css',
'./public/vendors/angular-chart.js/dist/angular-chart.css',
'./public/vendors/angular-hotkeys/build/angular-hotkeys.min.css',
'./public/css/site.css',
'./public/css/mobile.css'];
var VIEW_SRC = ['./public/app/**/*.jade'];
// yvar DIRECTIVE_SRC = ['./public/app/directives/**/*.jade'];
var STYLUS_SRC = ['./public/css/*.styl'];
var TO_LINT_SRC = ['./public/app/**/*.js',
'./server.js',
'./server/**/*.js',
'!./public/**/bootstrap-tagsinput.js'];
gulp.task('default', function () {
gulp.start('build');
});
gulp.task('build', function () {
gulp.start('build-client');
});
gulp.task('clean-client-dist', function () {
return gulp.src(DIST_DIR)
.pipe(clean());
});
gulp.task('build-client', ['clean-client-dist'], function () {
gulp.start('build-client-js');
gulp.start('build-client-css');
gulp.start('build-client-views');
});
gulp.task('build-client-js', function () {
gulp.src(JS_SRC)
.pipe(sourcemaps.init())
.pipe(concat('dilemme.js'))
.pipe(gulp.dest(JS_DIR))
.pipe(uglify({mangle: false}))
.pipe(rename({extname: '.min.js'}))
.pipe(sourcemaps.write('maps'))
.pipe(gulp.dest(JS_DIR));
});
gulp.task('build-client-stylus', function () {
return gulp.src(STYLUS_SRC)
.pipe(stylus())
.pipe(gulp.dest(COMPILED_STYLUS_DIR));
});
gulp.task('build-client-css', ['build-client-stylus'], function () {
gulp.src(CSS_SRC)
.pipe(sourcemaps.init())
.pipe(autoprefixer())
.pipe(concat('dilemme.css'))
.pipe(gulp.dest(CSS_DIR))
.pipe(minify())
.pipe(rename({extname: '.min.css'}))
.pipe(sourcemaps.write('maps'))
.pipe(gulp.dest(CSS_DIR));
});
gulp.task('build-client-views', function () {
gulp.src(VIEW_SRC)
.pipe(jade())
.pipe(gulp.dest(VIEW_DIR));
gulp.src(['./public/app/directives/**/*.jade'])
.pipe(jade())
.pipe(gulp.dest(DIRECTIVES_DIR));
});
gulp.task('watch', function () {
gulp.start('watch-client');
gulp.start('watch-server');
});
gulp.task('watch-client', function () {
gulp.watch(JS_SRC, ['build-client-js']);
gulp.watch(STYLUS_SRC, ['build-client-css']);
gulp.watch(VIEW_SRC, ['build-client-views']);
});
gulp.task('watch-server', function () {
nodemon({
script: 'server.js',
watch: './server'
});
});
gulp.task('lint', function () {
gulp.src(TO_LINT_SRC)
.pipe(jshint())
.pipe(jscs())
.on('error', noop)
.pipe(stylish.combineWithHintResults()) // combine with jshint results
.pipe(jshint.reporter('jshint-stylish'));
});
|
JavaScript
| 0.000001 |
@@ -496,25 +496,24 @@
p = function
-
() %7B%7D;%0Avar s
|
775384f128dafadc0ac5e48942c9e87bc628d2de
|
Create an unminified and minified version of the scripts
|
gulpfile.js
|
gulpfile.js
|
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var nodemon = require('gulp-nodemon');
var watch = require('gulp-watch');
var rename = require('gulp-rename');
var karma = require('gulp-karma');
var mocha = require('gulp-mocha');
var publicDir = 'public/**/*.js';
//Backbone requires specific order for its dependencies
gulp.task('scripts', function(){
return gulp.src(['./bower_components/jquery/dist/jquery.js',
'./bower_components/underscore/underscore.js',
'./bower_components/backbone/backbone.js',
'./node_modules/socket.io-client/socket.io.js',
'./public/client/**/*.js',
'./public/client/app.js'])
.pipe(concat('scripts.js'))
.pipe(rename('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./public/dist/'));
});
gulp.task('watch-public', function(){
gulp.watch([publicDir, '!public/dist/*.js'], ['scripts']);
});
gulp.task('develop', function(){
gulp.start('scripts');
nodemon({
script: './server.js',
env: { 'NODE_ENV': 'development' },
ignore: ['public/dist/']
})
//have nodemon run watch on start
.on('start', ['watch-public']);
});
gulp.task('default', ['develop']);
gulp.task('test-server', function(){
return gulp.src(['./test/server/server.js','./test/server/integration.js' ], {read: false})
.pipe(mocha({reporter: 'nyan'}));
});
var testFiles = ['./test/client/unit.js',
'./test/client/integration.js'];
gulp.task('test-client', function() {
return gulp.src(testFiles)
.pipe(karma({
configFile: 'karma.conf.js',
reporters: ['progress', 'coverage'],
action: 'run'
}))
.on('error', function(err) {
throw err;
});
});
|
JavaScript
| 0 |
@@ -785,24 +785,69 @@
ripts.js'))%0A
+ .pipe(gulp.dest('./public/dist/'))%0A
.p
@@ -1126,17 +1126,16 @@
odemon(%7B
-
%0A scr
@@ -1840,12 +1840,13 @@
%0A %7D);%0A%7D);
+%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.