Commit 2d9c61a0 authored by Roberto Toro's avatar Roberto Toro
Browse files

linting

parent d9db4981
......@@ -47,7 +47,7 @@ gulp.task('pack-atlasMaker-dev', ['download', 'pack-resources'], function () {
gulp.task('pack-brainbox', ['pack-atlasMaker'], function () {
return gulp.src(brainboxFiles)
.pipe(gulpif(file => !(file.path.includes('.min.js')), uglify()))
.pipe(gulpif((file) => !(file.path.includes('.min.js')), uglify()))
.pipe(concat('brainbox.js'))
.pipe(gulp.dest(jsdest))
.pipe(rename('brainbox.min.js'))
......@@ -56,7 +56,7 @@ gulp.task('pack-brainbox', ['pack-atlasMaker'], function () {
gulp.task('pack-atlasMaker', ['download', 'pack-resources'], function () {
return gulp.src(atlasmakerFiles)
.pipe(gulpif(file => !(file.path.includes('.min.js')), uglify()))
.pipe(gulpif((file) => !(file.path.includes('.min.js')), uglify()))
.pipe(concat('atlasMaker.js'))
.pipe(gulp.dest(jsdest))
.pipe(rename('atlasMaker.min.js'))
......
#!/bin/bash
cd /brainbox
cd /brainbox || exit
npm install
node ./bin/www
......@@ -344,12 +344,14 @@ export var AtlasMakerWidget = {
* @param {string} path Path to script, either a local path or a url
* @param {function} testScriptPresent Function to test if the script is already present.
* If undefined, the script will be loaded.
* @returns {object} A promise
*/
loadScript: function loadScript(path, testScriptPresent) {
var def = new $.Deferred();
if(testScriptPresent && testScriptPresent()) {
console.log("[loadScript] Script",path,"already present, not loading it again");
return def.resolve().promise();
}
var s = document.createElement("script");
......@@ -359,6 +361,7 @@ export var AtlasMakerWidget = {
def.resolve();
};
document.body.appendChild(s);
return def.promise();
},
......
......@@ -33,23 +33,23 @@ export var BrainBox={
* @returns {string} A hash
*/
hash: function hash(str) {
let v0 = 0;
let v1;
const abc="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
let i;
for(i=0; i<str.length; i++) {
const ch=str.charCodeAt(i);
v0=((v0<<5)-v0)+ch;
v0&=v0;
let i, res, v, v0, v1;
const abc = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
const sz = abc.length;
v0 = 0;
for(i = 0; i<str.length; i++) {
const ch = str.charCodeAt(i);
v0 = ((v0<<5)-v0)+ch;
v0 &= v0;
}
const sz=abc.length;
let v;
let res="";
for(i=0; i<8; i++) {
v1=parseInt(v0/sz);
v=Math.abs(v0-v1*sz);
res+=abc[v];
v0=v1;
res = "";
for(i = 0; i<8; i++) {
v1 = parseInt(v0/sz);
v = Math.abs(v0-v1*sz);
res += abc[v];
v0 = v1;
}
return res;
......@@ -276,15 +276,15 @@ export var BrainBox={
stored={version:BrainBox.version,history:[]};
obj0 = {};
}
obj1 = {
obj1 = {
url:BrainBox.info.source,
view:AtlasMakerWidget.User.view?AtlasMakerWidget.User.view.toLowerCase():"sag",
slice:AtlasMakerWidget.User.slice?AtlasMakerWidget.User.slice:0,
lastVisited:(new Date()).toJSON()
};
$.extend(obj0, obj1);
stored.history.push(obj0);
localStorage.AtlasMaker=JSON.stringify(stored);
*/
......
......@@ -8,16 +8,14 @@ for(const item of list) {
const arr = item.split('/');
const key = arr[arr.length-2]; // module name is directory's name
entries[key] = item;
};
}
console.log(entries);
module.exports = {
mode: 'development',
entry: entries,
devtool: 'eval-source-map',
plugins: [
new CleanWebpackPlugin(['dist']),
],
plugins: [new CleanWebpackPlugin(['dist'])],
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'view/atlasMaker/dist/atlasMaker-tools')
......@@ -33,9 +31,7 @@ module.exports = {
},
{
test: /\.(png|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
},
{
test: /\.(svg)$/,
......@@ -48,10 +44,8 @@ module.exports = {
},
{
test: /\.(html)$/,
use: [
'html-loader'
]
use: ['html-loader']
}
]
}
};
\ No newline at end of file
};
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
// const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'development',
......@@ -9,9 +9,7 @@ module.exports = {
atlasmaker: './view/atlasMaker/src/atlasmaker.js'
},
devtool: 'eval-source-map',
plugins: [
new CleanWebpackPlugin(['dist'])
],
plugins: [new CleanWebpackPlugin(['dist'])],
output: {
filename: 'atlasmaker.js',
library: 'AtlasMakerWidget',
......@@ -29,15 +27,11 @@ module.exports = {
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
},
{
test: /\.(html)$/,
use: [
'html-loader'
]
use: ['html-loader']
}
]
}
......
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
// const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'development',
......@@ -32,9 +32,7 @@ module.exports = {
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
}
]
}
......
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
// const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'development',
......@@ -35,9 +35,7 @@ module.exports = {
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
}
]
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment