diff --git a/.gitignore b/.gitignore index 7fe87b16a..257ba7713 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ projects .zenflow-log test/*.map .bunyipconfig.js +.s3config.json node_modules npm-debug.log diff --git a/CHANGELOG2.md b/CHANGELOG2.md new file mode 100644 index 000000000..0a2f4e7cc --- /dev/null +++ b/CHANGELOG2.md @@ -0,0 +1,50 @@ + +``` +^ NEW CHANGES ABOVE ^ +``` + +CHANGELOG +========= + +#### 3.2.3 (2013-05-03) +* test line +* Added a plugins interface +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components +* Duration is now setable (need ed for HLS m3u8 files) +* Event binders (on/off/one) now return the player instance +* Stopped player from going back to beginningg on ended event. +* Added support for percent width/height and fluid layouts +* Improved load order of elements to reduce reflow. +* Changed addEvent function name to 'on'. +* Removed conflicting array.indexOf function +* Added exitFullScreen to support BlackBerry devices (pull/143) + +## 5.0.0 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components + +#### 4.1.2 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) + +### 4.1.0 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components + +#### 4.0.2 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) + +#### 4.0.1 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) + +## 4.0.0 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components + diff --git a/Gruntfile.js b/Gruntfile.js index 688a13784..c7be53277 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,23 @@ module.exports = function(grunt) { + var pkg, s3, semver, version, verParts; - var pkg = grunt.file.readJSON('package.json'); + semver = require('semver'); + pkg = grunt.file.readJSON('package.json'); + + try { + s3 = grunt.file.readJSON('.s3config.json'); + } catch(e) { + s3 = {}; + } + + verParts = pkg.version.split('.'); + version = { + full: pkg.version, + major: verParts[0], + minor: verParts[1], + patch: verParts[2] + }; + version.majorMinor = version.major + '.' + version.minor; // Project configuration. grunt.initConfig({ @@ -12,18 +29,10 @@ module.exports = function(grunt) { baseDir: 'src/js/' } }, - deps: { - src: 'src/js/dependencies.js', - options: { - baseDir: 'src/js/' - } - }, clean: { build: ['build/files/*'], dist: ['dist/*'] }, - // Current forEach issue: https://github.com/gruntjs/grunt/issues/610 - // npm install https://github.com/gruntjs/grunt-contrib-jshint/archive/7fd70e86c5a8d489095fa81589d95dccb8eb3a46.tar.gz jshint: { src: { src: ['src/js/*.js', 'Gruntfile.js', 'test/unit/*.js'], @@ -53,6 +62,42 @@ module.exports = function(grunt) { watch: { files: [ 'src/**/*.js', 'test/unit/*.js' ], tasks: 'dev' + }, + copy: { + minor: { + files: [ + {expand: true, cwd: 'build/files/', src: ['*'], dest: 'dist/'+version.majorMinor+'/', filter: 'isFile'} // includes files in path + ] + }, + patch: { + files: [ + {expand: true, cwd: 'build/files/', src: ['*'], dest: 'dist/'+version.full+'/', filter: 'isFile'} // includes files in path + ] + } + }, + s3: { + options: s3, + prod: { + // Files to be uploaded. + upload: [ + { + src: 'dist/cdn/*', + dest: 'vjs/'+version.full+'/', + rel: 'dist/cdn/', + headers: { + 'Cache-Control': 'public, max-age=31536000' + } + }, + { + src: 'dist/cdn/*', + dest: 'vjs/'+version.majorMinor+'/', + rel: 'dist/cdn/', + headers: { + 'Cache-Control': 'public, max-age=2628000' + } + } + ] + } } }); @@ -61,6 +106,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-s3'); grunt.loadNpmTasks('contribflow'); // Default task. @@ -89,7 +135,7 @@ module.exports = function(grunt) { // grunt.file.write('build/files/sourcelist.txt', sourceList.join(',')); // Allow time for people to update their index.html before they remove these - grunt.file.write('build/files/sourcelist.js', 'var sourcelist = ["' + sourceFiles.join('","') + '"]'); + // grunt.file.write('build/files/sourcelist.js', 'var sourcelist = ["' + sourceFiles.join('","') + '"]'); // Create a combined sources file. https://github.com/zencoder/video-js/issues/287 var combined = ''; @@ -101,6 +147,14 @@ module.exports = function(grunt) { grunt.file.copy('src/css/video-js.css', 'build/files/video-js.css'); grunt.file.copy('src/css/video-js.png', 'build/files/video-js.png'); grunt.file.copy('src/swf/video-js.swf', 'build/files/video-js.swf'); + // grunt.file.copy('src/css/font/', 'build/files/font/'); + + grunt.file.recurse('src/css/font', function(absdir, rootdir, subdir, filename) { + // Block .DS_Store files + if ('filename'.substring(0,1) !== '.') { + grunt.file.copy(absdir, 'build/files/font/' + filename); + } + }); }); grunt.registerMultiTask('minify', 'Minify JS files using Closure Compiler.', function() { @@ -155,26 +209,48 @@ module.exports = function(grunt) { }); grunt.registerTask('dist', 'Creating distribution', function(){ - // TODO: create semver folders (4.1.1, 4.1, 4, and latest) - // grunt copy could be used but is currently broken and needs an update + var exec = require('child_process').exec; + var done = this.async(); grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js'); + grunt.file.copy('build/files/combined.video.js', 'dist/video-js/video.dev.js'); grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css'); - grunt.file.copy('build/files/video-js.png', 'dist/video-js/video-js.png'); grunt.file.copy('build/files/video-js.swf', 'dist/video-js/video-js.swf'); grunt.file.copy('build/demo-files/demo.html', 'dist/video-js/demo.html'); grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/video-js/demo.captions.vtt'); - // Copy is broken. Waiting for an update to use. - // copy: { - // latest: { - // files: [ - // { src: ['dist/video-js'], dest: 'dist/latest' } // includes files in path - // // {src: ['path/**'], dest: 'dest/'}, // includes files in path and its subdirs - // // {expand: true, cwd: 'path/', src: ['**'], dest: 'dest/'}, // makes all src relative to cwd - // // {expand: true, flatten: true, src: ['path/**'], dest: 'dest/', filter: 'isFile'} // flattens results to a single level - // ] - // } - // }, + grunt.file.recurse('build/files/font', function(absdir, rootdir, subdir, filename) { + // Block .DS_Store files + if ('filename'.substring(0,1) !== '.') { + grunt.file.copy(absdir, 'dist/video-js/font/' + filename); + } + }); + + // CDN version uses already hosted font files + // Minified version only + // doesn't need demo files + grunt.file.copy('build/files/minified.video.js', 'dist/cdn/video.js'); + grunt.file.copy('build/files/video-js.css', 'dist/cdn/video-js.css'); + grunt.file.copy('build/files/video-js.swf', 'dist/cdn/video-js.swf'); + + + + var css = grunt.file.read('dist/cdn/video-js.css'); + css = css.replace(/font\//g, '../f/1/'); + grunt.file.write('dist/cdn/video-js.css', css); + + exec('cd dist && zip -r video-js-'+version.full+'.zip video-js && cd ..', { maxBuffer: 500*1024 }, function(err, stdout, stderr){ + + if (err) { + grunt.warn(err); + done(false); + } + + if (stdout) { + grunt.log.writeln(stdout); + } + + done(); + }); }); }; diff --git a/package.json b/package.json index b064cf6bf..941839129 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "video.js", "description": "An HTML5 and Flash video player with a common API and skin for both.", - "version": "3.2.3", + "version": "4.0.0", "copyright": "Copyright 2013 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE", "keywords": [ "html5", @@ -28,7 +28,9 @@ "grunt-contrib-clean": "~0.4.0a", "grunt-contrib-copy": "~0.3.2", "mocha": "~1.8.1", - "contribflow": "~0.2.0" + "contribflow": "~0.2.0", + "grunt-s3": "~0.2.0-alpha", + "semver": "~1.1.4" }, "testling": { "browsers": [ diff --git a/src/css/font/VideoJS.eot b/src/css/font/vjs.eot similarity index 100% rename from src/css/font/VideoJS.eot rename to src/css/font/vjs.eot diff --git a/src/css/font/VideoJS.svg b/src/css/font/vjs.svg similarity index 100% rename from src/css/font/VideoJS.svg rename to src/css/font/vjs.svg diff --git a/src/css/font/VideoJS.ttf b/src/css/font/vjs.ttf similarity index 100% rename from src/css/font/VideoJS.ttf rename to src/css/font/vjs.ttf diff --git a/src/css/font/VideoJS.woff b/src/css/font/vjs.woff similarity index 100% rename from src/css/font/VideoJS.woff rename to src/css/font/vjs.woff diff --git a/src/css/video-js.css b/src/css/video-js.css index 394bcb506..4d3a1d275 100644 --- a/src/css/video-js.css +++ b/src/css/video-js.css @@ -3,15 +3,6 @@ VideoJS Default Styles (http://videojs.com) Version GENERATED_AT_BUILD */ -@font-face{ - font-family:'VideoJS'; - src:url('./font/VideoJS.eot'); - src:url('./font/VideoJS.eot') format('embedded-opentype'), - url('./font/VideoJS.woff') format('woff'), - url('./font/VideoJS.ttf') format('truetype'); - font-weight:normal; - font-style:normal } - /* REQUIRED STYLES (be careful overriding) ================================================================================ */ @@ -158,6 +149,16 @@ so you can upgrade to newer versions easier. You can remove all these styles by /* Base UI Component Classes -------------------------------------------------------------------------------- */ +@font-face{ + font-family: 'VideoJS'; + src: url('font/vjs.eot'); + src: url('font/vjs.eot') format('embedded-opentype'), + url('font/vjs.woff') format('woff'), + url('font/vjs.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + .vjs-default-skin { color: #ccc; } diff --git a/src/css/font/VideoJS.dev.svg b/src/css/video-js.font.dev.svg similarity index 100% rename from src/css/font/VideoJS.dev.svg rename to src/css/video-js.font.dev.svg