Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
chore: corrections eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
gtoubiana committed Jan 21, 2017
1 parent 1ec9120 commit 8e90156
Show file tree
Hide file tree
Showing 18 changed files with 381 additions and 164 deletions.
Binary file modified dist/acte-0.0.17-dist.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/acte.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/acte.min.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/js/demo-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ $(document).ready(function () {
var jr = new acte.Jour($('#jour').val(), deb);

$('#affichage_de_jour table tbody').html(
'<tr>\n<th scope="row">Date grégorienne</th>\n' + jr.gregorien(
'<tr>\n<th scope="row">Date gr\xE9gorienne</th>\n' + jr.gregorien(
'<td class="success"><strong>%JSl %JMp %Mlb %A</strong><br>{sC}</td>',
'<td class="active">Pas de correspondances</td>', acte.saintChretien
) + '</tr>\n<tr><th scope="row">Date républicaine</th>\n' + jr.republicain(
) + '</tr>\n<tr><th scope="row">Date r\xE9publicaine</th>\n' +
jr.republicain(
'<td class="success"><strong>%JSl %JMp %Mlb an %Ar</strong><br>Jour {jR}</td>',
'<td class="active">Pas de correspondances</td>', acte.jourRepublicain
) + '</tr>\n<tr><th scope="row">Date julienne</th>\n' + jr.julien(
Expand Down
2 changes: 1 addition & 1 deletion docs/js/script.js

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions gulp/tasks/deltat.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ const scraper = require('website-scraper');
/* TASK: copier les données dans ./src/data/deltat.csv */
gulp.task('delta.scrap', () => {
const stream = scraper.scrape({
urls: [{
url: 'http://maia.usno.navy.mil/ser7/deltat.data',
filename: 'deltat.csv',
},
],
urls: [
{
url: 'http://maia.usno.navy.mil/ser7/deltat.data',
filename: 'deltat.csv',
},
],
directory: './src/data',
request: {
headers: { 'User-Agent': 'Mozilla/5.0 (Macintosh; ' +
'Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko)' +
' Chrome/52.0.2743.116 Safari/537.36',
headers: {
'User-Agent': 'Mozilla/5.0 (Macintosh; ' +
'Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko)' +
' Chrome/52.0.2743.116 Safari/537.36',
},
},
}).then((result) => {
Expand Down Expand Up @@ -129,7 +131,8 @@ gulp.task('delta.js', () => {
}

return console.log(
`Le fichier delta.js pour 1620-${an} a été généré avec succès !`);
`Le fichier delta.js pour 1620-${an} a été généré avec succès !`
);
});
});

Expand Down
14 changes: 8 additions & 6 deletions gulp/tasks/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ gulp.task('dist.acte.es5', () => {
'transform-es2015-parameters',
'transform-es2015-destructuring',
'transform-es2015-block-scoping',
'transform-es2015-typeof-symbol', ['transform-regenerator', {
async: false,
asyncGenerators: false,
},
],
'transform-es2015-typeof-symbol', [
'transform-regenerator', {
async: false,
asyncGenerators: false,
},
],

// no strict
['transform-es2015-modules-commonjs', {
[
'transform-es2015-modules-commonjs', {
strict: false,
},
],
Expand Down
56 changes: 31 additions & 25 deletions gulp/tasks/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,21 @@ gulp.task('docs.index', () => {
// Copier les fichiers du Bootstrap
gulp.task('docs.assets', () => {
const stream1 = gulp.src(
[`${config.paths.bowerBootstrap}/js/bootstrap.min.js`,
`${config.paths.bowerJquery}/jquery.min.js`,
`${config.paths.bowerJqueryUI}/jquery-ui.min.js`,
`${config.paths.bowerShiv}/html5shiv.min.js`,
`${config.paths.bowerRespond}/respond.min.js`,
`${config.paths.src}/docs/js/ie10-viewport-bug-workaround.js`,
[
`${config.paths.bowerBootstrap}/js/bootstrap.min.js`,
`${config.paths.bowerJquery}/jquery.min.js`,
`${config.paths.bowerJqueryUI}/jquery-ui.min.js`,
`${config.paths.bowerShiv}/html5shiv.min.js`,
`${config.paths.bowerRespond}/respond.min.js`,
`${config.paths.src}/docs/js/ie10-viewport-bug-workaround.js`,
])
.pipe(gulp.dest(`${config.paths.docs}/js/`))
.on('end', () => {
const stream2 = gulp.src(
[`${config.paths.bowerBootstrap}/css/bootstrap.min.css`,
`${config.paths.src}/docs/css/*.css`,
])
[
`${config.paths.bowerBootstrap}/css/bootstrap.min.css`,
`${config.paths.src}/docs/css/*.css`,
])
.pipe(gulp.dest(`${config.paths.docs}/css/`))
.on('end', () => {
const stream3 = gulp.src(
Expand Down Expand Up @@ -231,14 +233,16 @@ gulp.task('docs.script.es5', () => {
'transform-es2015-parameters',
'transform-es2015-destructuring',
'transform-es2015-block-scoping',
'transform-es2015-typeof-symbol', ['transform-regenerator', {
async: false,
asyncGenerators: false,
},
],
'transform-es2015-typeof-symbol', [
'transform-regenerator', {
async: false,
asyncGenerators: false,
},
],

// no strict
['transform-es2015-modules-commonjs', {
[
'transform-es2015-modules-commonjs', {
strict: false,
},
],
Expand Down Expand Up @@ -284,13 +288,14 @@ gulp.task('docs.concat.js', () => {
preserveComments: 'license',
};
const stream = gulp.src(
[`${config.paths.dist}/acte.min.js`,
`${config.paths.docs}/js/jquery.min.js`,
`${config.paths.docs}/js/jquery-ui.min.js`,
`${config.paths.docs}/js/bootstrap.min.js`,
`${config.paths.docs}/js/demo-script.js`,
`${config.paths.docs}/js/run_prettify.js`,
`${config.paths.docs}/js/ie10-viewport-bug-workaround.js`,
[
`${config.paths.dist}/acte.min.js`,
`${config.paths.docs}/js/jquery.min.js`,
`${config.paths.docs}/js/jquery-ui.min.js`,
`${config.paths.docs}/js/bootstrap.min.js`,
`${config.paths.docs}/js/demo-script.js`,
`${config.paths.docs}/js/run_prettify.js`,
`${config.paths.docs}/js/ie10-viewport-bug-workaround.js`,
])
.pipe(concat('script.js'))
.pipe(uglify(options))
Expand All @@ -301,9 +306,10 @@ gulp.task('docs.concat.js', () => {

gulp.task('docs.concat.css', () => {
const stream = gulp.src(
[`${config.paths.docs}/css/bootstrap.min.css`,
`${config.paths.docs}/css/jquery-ui-bootstrap.css`,
`${config.paths.docs}/css/demo-theme.css`,
[
`${config.paths.docs}/css/bootstrap.min.css`,
`${config.paths.docs}/css/jquery-ui-bootstrap.css`,
`${config.paths.docs}/css/demo-theme.css`,
])
.pipe(concat('style.css'))
.pipe(uncss({
Expand Down
2 changes: 1 addition & 1 deletion gulp/tasks/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ gulp.task('tests.specs', () => {
const ssstream = gulp.src(
[`${config.paths.testJasmine}/lib/acteSpec.js`])
.pipe(wrap(
`var acte = require(\'${config.paths.reqActe}\');
`var acte = require('${config.paths.reqActe}');
<%= contents %>\n`
))
.pipe(gulp.dest(config.paths.testJasmine));
Expand Down
2 changes: 2 additions & 0 deletions src/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Commencer par Bower, puis les npm Patch, Minor et Major.
$ npm run update
- Mettre à jour les plugins atom et mémoriser la config
$ npm run atom.list
- Vérifier Saucelabs
$ gulp tests.saucelabs
---
DESINSTALLER (OSX)

Expand Down
2 changes: 1 addition & 1 deletion src/js/private/functions/saisieValide.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const saisieValide = (saisie, regexp) => {

// On remplace le texte restant par des chiffres arabes
tempSaisie = remplacements(tempSaisie, regexp, 'gi')
.split(/[\/\.]+/gi);
.split(/[/.]+/gi);

// Si il n'y a que l'année [1,1,ac]
if (!tempSaisie[1] && !tempSaisie[2]) {
Expand Down
13 changes: 5 additions & 8 deletions test/jasmine/acteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ describe('Recettes', function () {
expect(new acte.Jour('8 décembre 2016').gregorien('', 0, function (res, obj) {
var result = '' + acte.nombreOrdinal(acte.arabeVersRomain(parseInt(obj.A / 100, 10) + 1), 'er', 'e');

return result + ' siècle';
return result + ' si\xE8cle';
})).toEqual('XXIe siècle');
});
it('Recette 3 : Afficher Mil plutôt que Mille', function () {
Expand All @@ -708,13 +708,10 @@ describe('Recettes', function () {
expect(new acte.Jour('1/1/2006').gregorien('', 0, function (res, obj) {
var jour = obj.JS === 0 ? 7 : obj.JS;

var _ref = obj.S === 0 ? [52, obj.A - 1] : [acte.prefixeZero(obj.S), obj.A];

var _ref2 = _slicedToArray(_ref, 2);

var semaine = _ref2[0];
var an = _ref2[1];

var _ref = obj.S === 0 ? [52, obj.A - 1] : [acte.prefixeZero(obj.S), obj.A],
_ref2 = _slicedToArray(_ref, 2),
semaine = _ref2[0],
an = _ref2[1];

return an + '-W' + semaine + '-' + jour;
})).toEqual('2005-W52-7');
Expand Down
16 changes: 8 additions & 8 deletions test/jasmine/lib/acte.js
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ if (!Array.prototype.reduce) {

// On remplace le texte restant par des chiffres arabes
tempSaisie = remplacements(tempSaisie, regexp, 'gi').split(
/[\/\.]+/gi);
/[/.]+/gi);

// Si il n'y a que l'année [1,1,ac]
if (!tempSaisie[1] && !tempSaisie[2]) {
Expand Down Expand Up @@ -2508,30 +2508,30 @@ if (!Array.prototype.reduce) {
switch (str.slice(-1)) {
case 't':
case 'x':
result = str + 'ième';
result = str + 'i\xE8me';
break;
case 'q':
result = str + 'uième';
result = str + 'ui\xE8me';
break;
case 'f':
result = str.slice(0, str.length - 1) + 'vième';
result = str.slice(0, str.length - 1) + 'vi\xE8me';
break;
case 'e':
result = str.slice(0, str.length - 1) + 'ième';
result = str.slice(0, str.length - 1) + 'i\xE8me';
break;
case 's':
result = str.slice(-2) === 'ts' ? str.slice(0, str.length - 1) +
'ième' : str + 'ième';
'i\xE8me' : str + 'i\xE8me';
break;
case 'n':
if (str.slice(-5) === 'et-un' || str.slice(-5) === 'et un') {
result = str + 'ième';
result = str + 'i\xE8me';
} else {
result = acte.premierOrdinalEnLettres(str, genre);
}
break;
default:
result = str + 'ième';
result = str + 'i\xE8me';
}

/* eslint-enable indent */
Expand Down
13 changes: 5 additions & 8 deletions test/jasmine/lib/acteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ describe('Recettes', function () {
expect(new acte.Jour('8 décembre 2016').gregorien('', 0, function (res, obj) {
var result = '' + acte.nombreOrdinal(acte.arabeVersRomain(parseInt(obj.A / 100, 10) + 1), 'er', 'e');

return result + ' siècle';
return result + ' si\xE8cle';
})).toEqual('XXIe siècle');
});
it('Recette 3 : Afficher Mil plutôt que Mille', function () {
Expand All @@ -707,13 +707,10 @@ describe('Recettes', function () {
expect(new acte.Jour('1/1/2006').gregorien('', 0, function (res, obj) {
var jour = obj.JS === 0 ? 7 : obj.JS;

var _ref = obj.S === 0 ? [52, obj.A - 1] : [acte.prefixeZero(obj.S), obj.A];

var _ref2 = _slicedToArray(_ref, 2);

var semaine = _ref2[0];
var an = _ref2[1];

var _ref = obj.S === 0 ? [52, obj.A - 1] : [acte.prefixeZero(obj.S), obj.A],
_ref2 = _slicedToArray(_ref, 2),
semaine = _ref2[0],
an = _ref2[1];

return an + '-W' + semaine + '-' + jour;
})).toEqual('2005-W52-7');
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/lib/boot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2015 Pivotal Labs
Copyright (c) 2008-2016 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
22 changes: 15 additions & 7 deletions test/jasmine/lib/jasmine-html.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2015 Pivotal Labs
Copyright (c) 2008-2016 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -209,9 +209,10 @@ jasmineRequire.HtmlReporter = function(j$) {

if (specsExecuted < totalSpecsDefined) {
var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all';
var skippedLink = order && order.random ? '?random=true' : '?';
alert.appendChild(
createDom('span', {className: 'jasmine-bar jasmine-skipped'},
createDom('a', {href: '?', title: 'Run all specs'}, skippedMessage)
createDom('a', {href: skippedLink, title: 'Run all specs'}, skippedMessage)
)
);
}
Expand All @@ -237,15 +238,22 @@ jasmineRequire.HtmlReporter = function(j$) {

alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage, seedBar));

for(i = 0; i < failedSuites.length; i++) {
var errorBarClassName = 'jasmine-bar jasmine-errored';
var errorBarMessagePrefix = 'AfterAll ';

for(var i = 0; i < failedSuites.length; i++) {
var failedSuite = failedSuites[i];
for(var j = 0; j < failedSuite.failedExpectations.length; j++) {
var errorBarMessage = 'AfterAll ' + failedSuite.failedExpectations[j].message;
var errorBarClassName = 'jasmine-bar jasmine-errored';
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage));
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessagePrefix + failedSuite.failedExpectations[j].message));
}
}

var globalFailures = (doneResult && doneResult.failedExpectations) || [];
for(i = 0; i < globalFailures.length; i++) {
var failure = globalFailures[i];
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessagePrefix + failure.message));
}

var results = find('.jasmine-results');
results.appendChild(summary);

Expand Down Expand Up @@ -309,7 +317,7 @@ jasmineRequire.HtmlReporter = function(j$) {
setMenuModeTo('jasmine-failure-list');

var failureNode = find('.jasmine-failures');
for (var i = 0; i < failures.length; i++) {
for (i = 0; i < failures.length; i++) {
failureNode.appendChild(failures[i]);
}
}
Expand Down
Loading

0 comments on commit 8e90156

Please sign in to comment.