Tidying up, bower changes

- Folder tidy up
- Bower updated to include source files
- Upgraded to svgstore 5.0.0
This commit is contained in:
Sam Potts 2015-02-24 12:37:23 +11:00
parent c105063ad9
commit 1b8b5d6ee4
32 changed files with 45 additions and 47 deletions

View File

@ -1,5 +1,6 @@
{
"name": "plyr",
"version": "1.0.10",
"description": "A simple HTML5 media player using custom controls",
"homepage": "http://plyr.io",
"keywords": [
@ -14,7 +15,10 @@
"dependencies": {},
"main": [
"dist/css/plyr.css",
"dist/js/plyr.js"
"dist/js/plyr.js",
"dist/sprite.svg",
"src/less/plyr.less",
"src/js/plyr.js"
],
"ignore": [
"node_modules",

View File

@ -1,14 +1,14 @@
{
"less": {
"plyr.css": ["assets/less/plyr.less"],
"docs.css": ["assets/less/docs.less"]
"plyr.css": ["src/less/plyr.less"],
"docs.css": ["src/less/docs.less"]
},
"js": {
"plyr.js": ["assets/js/plyr.js"],
"plyr.js": ["src/js/plyr.js"],
"docs.js": [
"assets/js/lib/hogan-3.0.2.mustache.js",
"src/js/lib/hogan-3.0.2.mustache.js",
"dist/js/templates.js",
"assets/js/docs.js"
"src/js/docs.js"
]
}
}

2
dist/js/plyr.js vendored

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -17,23 +17,21 @@ var fs = require("fs"),
svgmin = require("gulp-svgmin"),
hogan = require("gulp-hogan-compile");
var projectPath = __dirname;
var paths = {
project: projectPath,
var root = __dirname,
paths = {
// Watch paths
watchless: path.join(projectPath, "assets/less/**/*"),
watchjs: path.join(projectPath, "assets/js/**/*"),
watchicons: path.join(projectPath, "assets/icons/**/*"),
watchtemplates: path.join(projectPath, "assets/templates/**/*"),
// SVG Icons
svg: path.join(projectPath, "assets/icons/*.svg"),
watch: {
less: path.join(root, "src/less/**/*"),
js: path.join(root, "src/js/**/*"),
sprite: path.join(root, "src/sprite/*.svg"),
templates: path.join(root, "src/templates/*.html"),
},
// Output paths
js: path.join(projectPath, "dist/js/"),
css: path.join(projectPath, "dist/css/"),
icons: path.join(projectPath, "dist/svg/")
output: {
js: path.join(root, "dist/js/"),
css: path.join(root, "dist/css/"),
sprite: path.join(root, "dist/")
}
},
// Task names
@ -41,7 +39,7 @@ taskNames = {
jsAll: "js-all",
lessBuild: "less-",
jsBuild: "js-",
iconBuild: "icon-build",
sprite: "sprite-build",
templates: "templates"
},
// Task arrays
@ -49,7 +47,7 @@ lessBuildTasks = [],
jsBuildTasks = [],
// Fetch bundles from JSON
bundles = loadJSON(path.join(paths.project, "bundles.json"));
bundles = loadJSON(path.join(root, "bundles.json"));
// Load json
function loadJSON(path) {
@ -59,14 +57,14 @@ function loadJSON(path) {
// Build templates
gulp.task(taskNames.templates, function () {
return gulp
.src(paths.watchtemplates)
.src(paths.watch.templates)
.pipe(hogan("templates.js", {
wrapper: false,
templateName: function (file) {
return path.basename(file.relative.replace(/\\/g, "-"), path.extname(file.relative));
}
}))
.pipe(gulp.dest(paths.js));
.pipe(gulp.dest(paths.output.js));
});
// Process JS
@ -80,7 +78,7 @@ for (var key in bundles.js) {
.src(bundles.js[key])
.pipe(concat(key))
.pipe(uglify())
.pipe(gulp.dest(paths.js));
.pipe(gulp.dest(paths.output.js));
});
})(key);
}
@ -97,32 +95,29 @@ for (var key in bundles.less) {
.pipe(less())
.on("error", gutil.log)
.pipe(concat(key))
.pipe(prefix(["last 2 versions", "> 1%", "ie 9"], { cascade: true }))
.pipe(prefix(["last 2 versions"], { cascade: true }))
.pipe(minifyCss())
.pipe(gulp.dest(paths.css));
.pipe(gulp.dest(paths.output.css));
});
})(key);
}
// Process Icons
gulp.task(taskNames.iconBuild, function () {
gulp.task(taskNames.sprite, function () {
return gulp
.src(paths.svg)
.src(paths.watch.sprite)
.pipe(svgmin({
plugins: [{
removeDesc: true
}]
}))
.pipe(svgstore({
prefix: "icon-",
fileName: "sprite.svg"
}))
.pipe(gulp.dest(paths.icons));
.pipe(svgstore())
.pipe(gulp.dest(paths.output.sprite));
});
// Default gulp task
gulp.task("default", function(){
runSequence(taskNames.jsAll, lessBuildTasks.concat(taskNames.iconBuild, "watch"));
runSequence(taskNames.jsAll, lessBuildTasks.concat(taskNames.sprite, "watch"));
});
// Build all JS (inc. templates)
@ -132,8 +127,8 @@ gulp.task(taskNames.jsAll, function(){
// Watch for file changes
gulp.task("watch", function () {
//gulp.watch(paths.watchtemplates, [taskNames.jsAll]);
//gulp.watch(paths.watchjs, [taskNames.jsAll]);
gulp.watch(paths.watchless, lessBuildTasks);
gulp.watch(paths.watchicons, [taskNames.iconBuild]);
//gulp.watch(paths.watch.templates, [taskNames.jsAll]);
//gulp.watch(paths.watch.js, [taskNames.jsAll]);
gulp.watch(paths.watch.less, lessBuildTasks);
gulp.watch(paths.watch.sprite, [taskNames.iconBuild]);
});

View File

@ -26,7 +26,7 @@
<source src="//cdn.sampotts.me/plyr/movie.webm" type="video/webm">
<!-- Text track file -->
<track kind="captions" label="English" srclang="en" src="assets/movie_en_captions.vtt" default>
<track kind="captions" label="English" srclang="en" src="//cdn.sampotts.me/plyr/movie_en_captions.vtt" default>
<!-- Fallback for browsers that don't support the <video> element -->
<div>
@ -55,7 +55,7 @@
<!-- Load SVG defs -->
<script>
(function(d,p){var a=new XMLHttpRequest(),b=d.body;a.open("GET",p,!0);a.send();a.onload=function(){var c=d.createElement("div");c.style.display="none";c.innerHTML=a.responseText;b.insertBefore(c,b.childNodes[0])}})(document,"dist/svg/sprite.svg");
(function(d,p){var a=new XMLHttpRequest(),b=d.body;a.open("GET",p,!0);a.send();a.onload=function(){var c=d.createElement("div");c.style.display="none";c.innerHTML=a.responseText;b.insertBefore(c,b.childNodes[0])}})(document,"dist/sprite.svg");
</script>
<!-- Core player -->

View File

@ -1,6 +1,6 @@
{
"name": "plyr",
"version": "1.0.0",
"version": "1.0.10",
"description": "A simple HTML5 media player using custom controls",
"homepage": "http://plyr.io",
"main": "gulpfile.js",
@ -13,7 +13,7 @@
"gulp-less": "~1.3.1",
"gulp-minify-css": "~0.3.6",
"gulp-svgmin": "^1.0.0",
"gulp-svgstore": "^4.0.1",
"gulp-svgstore": "^5.0.0",
"gulp-uglify": "~0.3.1",
"gulp-util": "~2.2.20",
"run-sequence": "^0.3.6"

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v1.0.9
// plyr.js v1.0.10
// https://github.com/sampotts/plyr
// ==========================================================================
// Credits: http://paypal.github.io/accessible-html5-video-player/

View File

@ -35,7 +35,6 @@ html {
body {
font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #fff;
//.font-size(16);
line-height: 1.5;
text-align: center;
color: #6D797F;

View File

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 726 B

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 515 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1021 B

After

Width:  |  Height:  |  Size: 1021 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB