├── .bowerrc ├── bower.json ├── README.md ├── .jshintrc ├── package.json ├── dist └── js │ └── jquery-tubular.min.js ├── LICENSE ├── src └── js │ └── jquery-tubular.js └── Gruntfile.js /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "packages" 3 | } 4 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-tubular", 3 | "version": "0.0.1", 4 | "dependencies": { 5 | "jquery": "~1.10.2" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | jquery-tubular 2 | ============== 3 | 4 | This repository is a fork of jQuery tubular plugin by Sean McCambridge (http://www.seanmccambridge.com/tubular). 5 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esnext": true, 3 | "bitwise": true, 4 | "browser": true, 5 | "camelcase": true, 6 | "curly": true, 7 | "debug": true, 8 | "eqeqeq": true, 9 | "immed": true, 10 | "indent": 4, 11 | "latedef": true, 12 | "newcap": true, 13 | "noarg": true, 14 | "quotmark": "single", 15 | "regexp": true, 16 | "undef": true, 17 | "unused": "vars", 18 | "strict": true, 19 | "trailing": true, 20 | "smarttabs": true 21 | } 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-tubular", 3 | "version": "0.0.1", 4 | "description": "This repository is a fork of jQuery tubular plugin by Sean McCambridge (http://www.seanmccambridge.com/tubular).", 5 | "author": "Stéphan Zych", 6 | "license": "MIT", 7 | "devDependencies": { 8 | "grunt": "latest", 9 | "grunt-contrib-clean": "latest", 10 | "grunt-contrib-connect": "latest", 11 | "grunt-contrib-jshint": "latest", 12 | "grunt-contrib-uglify": "latest", 13 | "grunt-contrib-watch": "latest", 14 | "grunt-recess": "latest", 15 | "grunt-shell": "latest" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /dist/js/jquery-tubular.min.js: -------------------------------------------------------------------------------- 1 | /* jquery-tubular - v0.0.1 - 2013-11-19* by Stéphan Zych (http://monkeymonk.be)* forked from Sean McCambridge (http://www.seanmccambridge.com/tubular)* licensed under the MIT License */!function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b)};b.DEFAULTS={ratio:16/9,videoId:"ZCAnLxRvNNc",mute:!0,repeat:!0,width:a(window).width(),wrapperZIndex:99,playButtonClass:"tubular-play",pauseButtonClass:"tubular-pause",muteButtonClass:"tubular-mute",volumeUpClass:"tubular-volume-up",volumeDownClass:"tubular-volume-down",increaseVolumeBy:10,start:0,callback:null},b.prototype={};var c=a.fn.tubular;a.fn.tubular=function(c){return this.each(function(){var d=a(this),e=d.data(".tubular"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data(".tubular",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.tubular.Constructor=b,a.fn.tubular.noConflict=function(){return a.fn.tubular=c,this},a(document).on("","",function(){})}(window.jQuery); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Stéphan Zych 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/js/jquery-tubular.js: -------------------------------------------------------------------------------- 1 | 2 | (function ($) { 3 | 'use strict'; 4 | 5 | 6 | var Tubular = function (element, options) { 7 | this.options = options; 8 | this.$element = $(element); 9 | }; // Tubular 10 | 11 | Tubular.DEFAULTS = { 12 | ratio: 16/9, // usually either 4/3 or 16/9 -- tweak as needed 13 | videoId: 'ZCAnLxRvNNc', // toy robot in space is a good default, no? 14 | mute: true, 15 | repeat: true, 16 | width: $(window).width(), 17 | wrapperZIndex: 99, 18 | playButtonClass: 'tubular-play', 19 | pauseButtonClass: 'tubular-pause', 20 | muteButtonClass: 'tubular-mute', 21 | volumeUpClass: 'tubular-volume-up', 22 | volumeDownClass: 'tubular-volume-down', 23 | increaseVolumeBy: 10, 24 | start: 0, 25 | callback: null 26 | }; // DEFAULTS 27 | 28 | Tubular.prototype = {}; // Prototypes 29 | 30 | var old = $.fn.tubular; 31 | 32 | $.fn.tubular = function (option) { 33 | return this.each(function () { 34 | var $this = $(this), 35 | data = $this.data('.tubular'), 36 | options = $.extend({}, Tubular.DEFAULTS, $this.data(), typeof option === 'object' && option); 37 | 38 | if (!data) { 39 | $this.data('.tubular', (data = new Tubular(this, options))); 40 | } 41 | 42 | if (typeof option === 'string') { 43 | data[option](); 44 | } 45 | }); 46 | }; // $.fn.tubular 47 | 48 | $.fn.tubular.Constructor = Tubular; 49 | 50 | $.fn.tubular.noConflict = function () { 51 | $.fn.tubular = old; 52 | return this; 53 | }; // No conflict 54 | 55 | $(document) 56 | .on('', '', function () {}); 57 | 58 | }) (window.jQuery); 59 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* global module */ 2 | 3 | module.exports = function (grunt) { 4 | 'use strict'; 5 | 6 | grunt.initConfig({ 7 | // Metadata 8 | pkg: grunt.file.readJSON('package.json'), 9 | 10 | 11 | // -- Tasks 12 | clean: { 13 | dist: [ 14 | 'dist/css/jquery-tubular.min.css', 15 | 'dist/js/jquery-tubular.min.js' 16 | ] 17 | }, // clean 18 | 19 | recess: { 20 | minified: { 21 | options: { 22 | compress: true 23 | }, 24 | files: { 25 | 'dist/css/jquery-tubular.min.css': [ 26 | 'src/less/jquery-tubular.less' 27 | ] 28 | } 29 | } // minified 30 | }, 31 | 32 | jshint: { 33 | options: { 34 | jshintrc: '.jshintrc' 35 | }, 36 | all: [ 37 | 'Gruntfile.js', 38 | 'src/js/*.js', 39 | '!dist/js/*.min.js' 40 | ] 41 | }, 42 | 43 | uglify: { 44 | minified: { 45 | options: { 46 | banner: '/* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>' + 47 | '* by <%= pkg.author %> (http://monkeymonk.be)' + 48 | '* forked from Sean McCambridge (http://www.seanmccambridge.com/tubular)' + '* licensed under the MIT License '+ 49 | '*/' 50 | }, 51 | files: { 52 | 'dist/js/jquery-tubular.min.js': [ 53 | 'src/js/jquery-tubular.js' 54 | ] 55 | } 56 | }, // minified 57 | }, // uglify 58 | 59 | 60 | shell: { 61 | done: { 62 | command: 'terminal-notifier -message "Bazinga! Grunt Tasks done!" -title "Gruntfile.js"' 63 | } 64 | }, // shell 65 | 66 | connect: { 67 | server: { 68 | options: { 69 | port: 8800, 70 | base: '.' 71 | } 72 | } 73 | }, // connect 74 | 75 | watch: { 76 | less: { 77 | files: [ 78 | 'src/less/*.less' 79 | ], 80 | 81 | tasks: ['recess', 'shell:done'] 82 | }, 83 | 84 | js: { 85 | files: [ 86 | '<%= jshint.all %>' 87 | ], 88 | 89 | tasks: ['jshint', 'uglify', 'shell:done'] 90 | } 91 | }, // watch 92 | }); 93 | 94 | grunt.loadNpmTasks('grunt-contrib-clean'); 95 | grunt.loadNpmTasks('grunt-contrib-jshint'); 96 | grunt.loadNpmTasks('grunt-contrib-connect'); 97 | grunt.loadNpmTasks('grunt-contrib-uglify'); 98 | grunt.loadNpmTasks('grunt-contrib-watch'); 99 | grunt.loadNpmTasks('grunt-recess'); 100 | grunt.loadNpmTasks('grunt-shell'); 101 | 102 | 103 | grunt.event.on('watch', function(action, filepath, target) { 104 | grunt.log.writeln(target + ': ' + filepath + ' has ' + action); 105 | }); 106 | 107 | 108 | // -- Tasks 109 | 110 | grunt.registerTask('before-test', [ 111 | 'clean' 112 | ]); 113 | grunt.registerTask('test', [ 114 | 'recess', 115 | 'uglify' 116 | ]); 117 | grunt.registerTask('after-test', [ 118 | 'shell:done' 119 | ]); 120 | 121 | grunt.registerTask('js', [ 122 | 'uglify', 123 | 'shell:done' 124 | ]); 125 | grunt.registerTask('css', [ 126 | 'recess', 127 | 'shell:done' 128 | ]); 129 | 130 | grunt.registerTask('default', ['before-test', 'test', 'after-test']); 131 | }; 132 | --------------------------------------------------------------------------------