Commit 0864d988 authored by Erase's avatar Erase

Refonte avec ajout Gulp

parent 0446eb6a
node_modules/
\ No newline at end of file
This diff is collapsed.
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="robots" content="noindex"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="x-ua-compatible" content="ie=edge"><title>Nouvel onglet</title><link rel="shortcut icon" href="favicon.ico?1.1" type="image/x-icon"><link rel="icon" href="favicon.ico?1.1" type="image/x-icon"><link rel="stylesheet" href="https://cdn.green-effect.fr/goofi/goofi.php?family=Lato:300:latin"><link rel="stylesheet" href="css/style.css"></head><body><div id="wrapper"><div class="box"><time class="time" id="js-time"></time><br><span id="quotes"></span><br><span id="weather"></span><br><form class="search" id="js-search" autocomplete="off"><input class="search-text" id="js-search-text" type="text" autofocus></form><pre class="help" id="js-help"></pre></div><div class="grid"></div><form id="addLinkForm"><div><label for="titre">Titre du lien</label> <input type="text" id="titre" value=""></div><div><label for="cible">Cible du lien</label> <input type="text" id="cible" value=""></div><input type="submit" value="Ajouter"></form></div><script src="js/script.js"></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Copyright 2017 Amardeep Rai
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var autoprefixer = require('gulp-autoprefixer');
var csso = require('gulp-csso');
var concat = require('gulp-concat');
var del = require('del');
var gulp = require('gulp');
var htmlmin = require('gulp-htmlmin');
var runSequence = require('run-sequence');
var uglify = require('gulp-uglify');
// Set the browser that you want to supoprt
const AUTOPREFIXER_BROWSERS = [
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7',
'android >= 4.4',
'bb >= 10'
];
// Gulp task to minify CSS files
gulp.task('styles', function () {
return gulp.src(['src/css/weather.css', 'src/css/jquery-ui.min.css', 'src/css/style.css','src/css/alertify.min.css', 'src/css/bootstrap.min.css'])
// Auto-prefix css styles for cross browser compatibility
.pipe(autoprefixer({browsers: AUTOPREFIXER_BROWSERS}))
// Minify the file
.pipe(csso())
.pipe(concat('style.css'))
// Output
.pipe(gulp.dest('./dist/css'))
});
// Gulp task to minify JavaScript files
gulp.task('scripts', function() {
return gulp.src(['src/js/jquery-1.12.0.min.js', 'src/js/jquery-ui.min.js', 'src/js/jquery.simpleWeather.min.js', 'src/js/jstorage.min.js', 'src/js/alertify.min.js', 'src/js/app.js'])
// Minify the file
//.pipe(uglify())
.pipe(concat('script.js'))
// Output
.pipe(gulp.dest('./dist/js'))
});
// Gulp task to minify HTML files
gulp.task('pages', function() {
return gulp.src(['./src/index.html'])
.pipe(htmlmin({
collapseWhitespace: true,
removeComments: true
}))
.pipe(gulp.dest('./dist'));
});
// Clean output directory
gulp.task('clean', () => del(['dist']));
gulp.task('copy', function(){
gulp.src(['./src/fonts/*']).pipe(gulp.dest('./dist/fonts/'));
gulp.src(['./src/favicon.ico*']).pipe(gulp.dest('./dist/'));
});
// Gulp task to minify all files
gulp.task('default', ['clean'], function () {
runSequence(
'copy',
'styles',
'scripts',
'pages'
);
});
\ No newline at end of file
{
"name": "local-minifier",
"version": "0.1.0",
"description": "A local environment to minify CSS, JS, & HTML files",
"license": "Apache-2.0",
"author": "Amardeep Rai",
"repository": {
"type": "git",
"url": "https://github.com/amardeeprai/local-minifier"
},
"devDependencies": {
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-autoprefixer": "latest",
"gulp-csso": "^2.0.0",
"gulp-htmlmin": "^3.0.0",
"gulp-uglify": "^2.0.0",
"run-sequence": "^1.2.2"
},
"engines": {
"node": ">=0.12.0"
},
"dependencies": {
"gulp-concat": "^2.6.1"
}
}
This diff is collapsed.
......@@ -10,18 +10,9 @@
<link rel="shortcut icon" href="favicon.ico?1.1" type="image/x-icon">
<link rel="icon" href="favicon.ico?1.1" type="image/x-icon">
<link rel="stylesheet" href="css/weather.css">
<link rel="stylesheet" href="https://cdn.green-effect.fr/goofi/goofi.php?family=Lato:300:latin">
<link rel="stylesheet" href="css/jquery-ui.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/alertify.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery-1.12.0.min.js" type="text/javascript"></script>
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
<script src="js/jquery.simpleWeather.min.js" type="text/javascript"></script>
<script src="js/jstorage.min.js" type="text/javascript"></script>
<script src="js/alertify.min.js" type="text/javascript"></script>
<link rel="stylesheet" href='css/style.css'>
</head>
<body>
......@@ -40,11 +31,9 @@
</div>
<div class="grid">
<a title="Framasoft" href="https://framasoft.fr" class="small-box">Framasoft</a>
<a title="Warrior du dimanche" href="https://warriordudimanche.net/" class="small-box">Bronco</a>
<a title="Green Effect" href="https://www.green-effect.fr" class="small-box">Erase</a>
</div>
<form id="addLinkForm">
<div>
<label for="titre"> Titre du lien </label>
......@@ -58,6 +47,6 @@
</form>
</div>
<script src="js/app.js" type="text/javascript"></script>
<script src='js/script.js'></script>
</body>
</html>
......@@ -71,6 +71,7 @@ function loadLinks(){
$('a.small-box').contextmenu(function(){
var nom = $(this).attr('title');
removeLink(nom);
alertify.success('Le lien a été correctement supprimé.');
loadLinks();
});
}else{
......@@ -89,6 +90,7 @@ function loadLinks(){
addLink($titre.val(), $cible.val());
alertify.success('Le lien a été correctement ajouté.');
alertify.genericDialog().close().set('closable', true);
$form.unbind('submit');
}else{
alertify.error('Erreur dans le titre ou la cible du lien.');
}
......@@ -251,10 +253,4 @@ $(function() {
}
};
});
}());
Markdown is supported
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