Errores eslint, scripts dev

This commit is contained in:
Juan Ferrer Toribio 2017-05-16 12:37:48 +02:00
parent 30ad456eea
commit c4978b24fb
13 changed files with 72 additions and 72 deletions

View File

@ -6,18 +6,17 @@ import {kebabToCamel} from '../lib/string';
* Registers a click handler on the element that opens the dialog id
* specified as value.
*/
directive.$inject = ['$document'];
export function directive($document) {
export function directive() {
return {
restrict: 'A',
link: function($scope, $element, $attrs) {
$element.on('click', function(event) {
let dialog = $scope[kebabToCamel($attrs['vnDialog'])];
let dialog = $scope[kebabToCamel($attrs.vnDialog)];
if (dialog instanceof Dialog)
dialog.show();
event.preventDefault();
});
}
}
};
}
module.directive('vnDialog', directive);

View File

@ -10,7 +10,7 @@ export function directive() {
restrict: 'A',
link: function($scope, $element, $attrs) {
let id = kebabToCamel($attrs.vnId);
let controller = $element[0].$ctrl;
let controller = $element.controller($element[0].tagName.toLowerCase());
if (!id)
throw new Error(`vnId: Attribute can't be null`);
@ -20,5 +20,5 @@ export function directive() {
$scope[id] = controller;
}
};
};
}
module.directive('vnId', directive);

View File

@ -5,13 +5,13 @@ directive.$inject = ['vnPopover'];
export function directive(popover) {
return {
restrict: 'A',
link: function($scope, $element, $attrs, $ctrl) {
link: function($scope, $element, $attrs) {
$element.on('click', function(event) {
popover.showComponent($attrs.vnDialog, $scope, $element);
event.preventDefault();
});
}
}
};
}
module.directive('vnPopover', directive);
@ -24,7 +24,7 @@ export class Popover {
let popover = this.document.createElement('div');
popover.className = 'vn-popover';
popover.addEventListener('mousedown',
(event) => this.onPopoverMouseDown(event));
event => this.onPopoverMouseDown(event));
popover.appendChild(childElement);
this.popover = popover;
@ -70,7 +70,7 @@ export class Popover {
}
this.document.body.appendChild(popover);
this.docMouseDownHandler = (event) => this.onDocMouseDown(event);
this.docMouseDownHandler = event => this.onDocMouseDown(event);
this.document.addEventListener('mousedown', this.docMouseDownHandler);
}
showComponent(childComponent, $scope, parent) {

View File

@ -17,7 +17,7 @@ class Controller {
// XXX: ¿Existe una forma más adecuada de acceder al controlador de un componente?
var childCtrl = angular.element(child).isolateScope().$ctrl;
childCtrl.onSubmit = (filter) => this.onChildSubmit(filter);
childCtrl.onSubmit = filter => this.onChildSubmit(filter);
event.preventDefault();
}
@ -36,7 +36,7 @@ class Controller {
}
Controller.$inject = ['$element', '$scope', '$document', '$compile', 'vnPopover', '$window'];
export const NAME = 'vnSearchbar'
export const NAME = 'vnSearchbar';
export const COMPONENT = {
template: require('./searchbar.html'),
bindings: {

View File

@ -11,14 +11,13 @@ goto caseUsage
:caseStart
call "%0" stop
echo "################################ Starting services"
echo "Starting nginx."
if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp")
start /I nginx -c "%nginxConf%" -p "%nginxPrefix%"
node dev.js
goto caseEnd
:caseStop
echo "################################ Stoping services"
echo "Stoping nginx."
if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop)
goto caseEnd

11
dev.js
View File

@ -1,11 +0,0 @@
require('./gulpfile');
var auth = require('./services/auth/server/server.js');
var client = require('./services/client/server/server.js');
var server = require('./services/salix/server/server.js');
var gulp = require('gulp');
gulp.start(['default']);
auth.start();
client.start();
server.start();

5
dev.sh
View File

@ -11,12 +11,11 @@ fi
case "$1" in
start|"")
$0 stop
echo "################################ Starting services"
echo "Starting nginx."
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix"
node dev.js
;;
stop)
echo "################################ Stoping services"
echo "Stoping nginx."
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix" -s stop
;;
*)

View File

@ -18,7 +18,19 @@ var langs = ['es', 'en'];
var modules = require('./spliting/modules.json');
var webpackConfig = require('./webpack.config.js');
// Clean
// Main tasks
gulp.task('build', ['clean'], function() {
return gulp.start('routes', 'locales', 'webpack');
});
gulp.task('default', ['clean'], function() {
return gulp.start('services', 'watch', 'routes', 'locales', 'webpack-dev-server');
});
gulp.task('client', ['clean'], function() {
return gulp.start('watch', 'routes', 'locales', 'webpack-dev-server');
});
gulp.task('clean', function() {
return del(`${buildDir}/*`, {force: true});
@ -140,12 +152,14 @@ gulp.task('watch', function() {
gulp.watch(localeFiles, ['locales']);
});
// Default
// Services
gulp.task('build', ['clean'], function() {
return gulp.start('routes', 'locales', 'webpack');
});
gulp.task('services', function() {
var auth = require('./services/auth/server/server.js');
var client = require('./services/client/server/server.js');
var server = require('./services/salix/server/server.js');
gulp.task('default', ['clean'], function() {
return gulp.start('watch', 'routes', 'locales', 'webpack-dev-server');
auth.start();
client.start();
server.start();
});