Errores eslint, scripts dev
This commit is contained in:
parent
30ad456eea
commit
c4978b24fb
|
@ -6,18 +6,17 @@ import {kebabToCamel} from '../lib/string';
|
||||||
* Registers a click handler on the element that opens the dialog id
|
* Registers a click handler on the element that opens the dialog id
|
||||||
* specified as value.
|
* specified as value.
|
||||||
*/
|
*/
|
||||||
directive.$inject = ['$document'];
|
export function directive() {
|
||||||
export function directive($document) {
|
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
link: function($scope, $element, $attrs) {
|
link: function($scope, $element, $attrs) {
|
||||||
$element.on('click', function(event) {
|
$element.on('click', function(event) {
|
||||||
let dialog = $scope[kebabToCamel($attrs['vnDialog'])];
|
let dialog = $scope[kebabToCamel($attrs.vnDialog)];
|
||||||
if (dialog instanceof Dialog)
|
if (dialog instanceof Dialog)
|
||||||
dialog.show();
|
dialog.show();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
module.directive('vnDialog', directive);
|
module.directive('vnDialog', directive);
|
||||||
|
|
|
@ -10,7 +10,7 @@ export function directive() {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
link: function($scope, $element, $attrs) {
|
link: function($scope, $element, $attrs) {
|
||||||
let id = kebabToCamel($attrs.vnId);
|
let id = kebabToCamel($attrs.vnId);
|
||||||
let controller = $element[0].$ctrl;
|
let controller = $element.controller($element[0].tagName.toLowerCase());
|
||||||
|
|
||||||
if (!id)
|
if (!id)
|
||||||
throw new Error(`vnId: Attribute can't be null`);
|
throw new Error(`vnId: Attribute can't be null`);
|
||||||
|
@ -20,5 +20,5 @@ export function directive() {
|
||||||
$scope[id] = controller;
|
$scope[id] = controller;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
module.directive('vnId', directive);
|
module.directive('vnId', directive);
|
||||||
|
|
|
@ -5,13 +5,13 @@ directive.$inject = ['vnPopover'];
|
||||||
export function directive(popover) {
|
export function directive(popover) {
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
link: function($scope, $element, $attrs, $ctrl) {
|
link: function($scope, $element, $attrs) {
|
||||||
$element.on('click', function(event) {
|
$element.on('click', function(event) {
|
||||||
popover.showComponent($attrs.vnDialog, $scope, $element);
|
popover.showComponent($attrs.vnDialog, $scope, $element);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
module.directive('vnPopover', directive);
|
module.directive('vnPopover', directive);
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ export class Popover {
|
||||||
let popover = this.document.createElement('div');
|
let popover = this.document.createElement('div');
|
||||||
popover.className = 'vn-popover';
|
popover.className = 'vn-popover';
|
||||||
popover.addEventListener('mousedown',
|
popover.addEventListener('mousedown',
|
||||||
(event) => this.onPopoverMouseDown(event));
|
event => this.onPopoverMouseDown(event));
|
||||||
popover.appendChild(childElement);
|
popover.appendChild(childElement);
|
||||||
this.popover = popover;
|
this.popover = popover;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ export class Popover {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.document.body.appendChild(popover);
|
this.document.body.appendChild(popover);
|
||||||
this.docMouseDownHandler = (event) => this.onDocMouseDown(event);
|
this.docMouseDownHandler = event => this.onDocMouseDown(event);
|
||||||
this.document.addEventListener('mousedown', this.docMouseDownHandler);
|
this.document.addEventListener('mousedown', this.docMouseDownHandler);
|
||||||
}
|
}
|
||||||
showComponent(childComponent, $scope, parent) {
|
showComponent(childComponent, $scope, parent) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Controller {
|
||||||
|
|
||||||
// XXX: ¿Existe una forma más adecuada de acceder al controlador de un componente?
|
// XXX: ¿Existe una forma más adecuada de acceder al controlador de un componente?
|
||||||
var childCtrl = angular.element(child).isolateScope().$ctrl;
|
var childCtrl = angular.element(child).isolateScope().$ctrl;
|
||||||
childCtrl.onSubmit = (filter) => this.onChildSubmit(filter);
|
childCtrl.onSubmit = filter => this.onChildSubmit(filter);
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class Controller {
|
||||||
}
|
}
|
||||||
Controller.$inject = ['$element', '$scope', '$document', '$compile', 'vnPopover', '$window'];
|
Controller.$inject = ['$element', '$scope', '$document', '$compile', 'vnPopover', '$window'];
|
||||||
|
|
||||||
export const NAME = 'vnSearchbar'
|
export const NAME = 'vnSearchbar';
|
||||||
export const COMPONENT = {
|
export const COMPONENT = {
|
||||||
template: require('./searchbar.html'),
|
template: require('./searchbar.html'),
|
||||||
bindings: {
|
bindings: {
|
||||||
|
|
5
dev.cmd
5
dev.cmd
|
@ -11,14 +11,13 @@ goto caseUsage
|
||||||
|
|
||||||
:caseStart
|
:caseStart
|
||||||
call "%0" stop
|
call "%0" stop
|
||||||
echo "################################ Starting services"
|
echo "Starting nginx."
|
||||||
if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp")
|
if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp")
|
||||||
start /I nginx -c "%nginxConf%" -p "%nginxPrefix%"
|
start /I nginx -c "%nginxConf%" -p "%nginxPrefix%"
|
||||||
node dev.js
|
|
||||||
goto caseEnd
|
goto caseEnd
|
||||||
|
|
||||||
:caseStop
|
:caseStop
|
||||||
echo "################################ Stoping services"
|
echo "Stoping nginx."
|
||||||
if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop)
|
if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop)
|
||||||
goto caseEnd
|
goto caseEnd
|
||||||
|
|
||||||
|
|
11
dev.js
11
dev.js
|
@ -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
5
dev.sh
|
@ -11,12 +11,11 @@ fi
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start|"")
|
start|"")
|
||||||
$0 stop
|
$0 stop
|
||||||
echo "################################ Starting services"
|
echo "Starting nginx."
|
||||||
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix"
|
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix"
|
||||||
node dev.js
|
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo "################################ Stoping services"
|
echo "Stoping nginx."
|
||||||
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix" -s stop
|
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix" -s stop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
28
gulpfile.js
28
gulpfile.js
|
@ -18,7 +18,19 @@ var langs = ['es', 'en'];
|
||||||
var modules = require('./spliting/modules.json');
|
var modules = require('./spliting/modules.json');
|
||||||
var webpackConfig = require('./webpack.config.js');
|
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() {
|
gulp.task('clean', function() {
|
||||||
return del(`${buildDir}/*`, {force: true});
|
return del(`${buildDir}/*`, {force: true});
|
||||||
|
@ -140,12 +152,14 @@ gulp.task('watch', function() {
|
||||||
gulp.watch(localeFiles, ['locales']);
|
gulp.watch(localeFiles, ['locales']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Default
|
// Services
|
||||||
|
|
||||||
gulp.task('build', ['clean'], function() {
|
gulp.task('services', function() {
|
||||||
return gulp.start('routes', 'locales', 'webpack');
|
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() {
|
auth.start();
|
||||||
return gulp.start('watch', 'routes', 'locales', 'webpack-dev-server');
|
client.start();
|
||||||
|
server.start();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue